
function reloadListBox() {
	windowSave();
	document.navListBox.submit();
	}
	
function divHeight() {
	dh = window('PopUpListBox').style.height
	alert(dh);
}

<!--List Box Item Scripts-->

	
	
function listboxItemSelect(ListBoxFormName,ItemType,ItemID,ItemName,ListTarget,ListMode,IsParent,IsChild,ParentItemID,mainFramePath,itemParam) 
{
	
	ContainerForm = document[ListBoxFormName];
	FormTarget = ContainerForm['FormTarget'].value;
	

	<!--Category Click commands-->
	if (ItemType == 'UserID')
		{
			if (ListTarget == 'Admin')
				{
				top.mainFrame.window.location.href='/crm/users/user.cfm?UserID='+ItemID;
				}
		}
	else if (ItemType == 'Customer')
		{
						
			if (ListTarget == 'Admin')
				{
				top.mainFrame.window.location.href='/crm/customers/customer.cfm?CustomerID='+ItemID;
				}
		}	
	else if (ItemType == 'Order' | ItemType == 'Booking')
		{
			if (ListTarget == 'Admin')
				{
				top.mainFrame.window.location.href='/crm/orders/order.cfm?OrderID='+ItemID;
				}
		}
	else if (ItemType == 'Log')
		{
			top.mainFrame.window.location.href=mainFramePath;
		}
}


<!--Mouse Over Functions-->
function listboxItemMouseOver(ItemType,ItemID,ListTarget) 
	{
		if (ListTarget == 'Admin')
			{
			if (ItemType == 'CategoryID')
				{
				top.leftFrame.ListBoxInfo.location.href="/crm/catalog/InfoScreen/category_info.cfm?CategoryID="+ItemID;
				}
			}

	}


	
<!--List Box Function Scrpts-->


function SelectContainer(ListBoxFormName,ItemType,ItemID,ItemName,ListTarget,ListMode,IsParent,IsChild,ParentItemID,ContainerPath,mainFramePath,containerParam) {
	
	
	
	if (mainFramePath == '')
		{}
	else 		
		{ top.window.mainFrame.location.href=mainFramePath; }
			
		
	Container = ListBoxFormName+'x'+ItemType+'x'+ItemID+'x'+ParentItemID+'x';
	
	ContainerForm = document[ListBoxFormName];
	ContainerFormField = ContainerForm[Container+"Field"];
	
	if (ContainerFormField.value == 'hidden') {
		ShowContainer(ListBoxFormName,ItemType,ItemID,ItemName,ParentItemID,ContainerPath);		
	}
	
	listboxItemSelect(ListBoxFormName,ItemType,ItemID,ItemName,ListTarget,ListMode,IsParent,IsChild,ParentItemID,mainFramePath,containerParam);
	
	
}
	
function ShowHideContainer(ListBoxFormName,ItemType,ItemID,ItemName,ParentItemID,ContainerPath) {
		
	Container = ListBoxFormName+'x'+ItemType+'x'+ItemID+'x'+ParentItemID+'x';
	
			ContainerForm = document[ListBoxFormName];
			ContainerFormField = ContainerForm[Container+"Field"];
				
			if (ContainerFormField.value == 'hidden') {
				ShowContainer(ListBoxFormName,ItemType,ItemID,ItemName,ParentItemID,ContainerPath);
			}
			else if (ContainerFormField.value == 'visible') {
				HideContainer(ListBoxFormName,ItemType,ItemID,ParentItemID,ContainerPath);
			}
}


function ShowContainer(ListBoxFormName,ItemType,ItemID,ItemName,ParentItemID,ContainerPath) {
		
	Container = ListBoxFormName+'x'+ItemType+'x'+ItemID+'x'+ParentItemID+'x';
	
	ContainerForm = document[ListBoxFormName];
	ContainerFormField = ContainerForm[Container+"Field"];
	
	<!--Show Container-->
	ContainerDiv = document.getElementById(Container+"Div");
	ContainerDiv.className = 'visibleContainer';
	
	ContainerPlus = document.getElementById(Container+"Plus");
	ContainerPlus.src = '/crm/scripts/ListBox/img/minus.gif';
	
	ContainerFormField.value='visible';
	ContainerForm.ItemType.value=ItemType;
	ContainerForm.ItemID.value=ItemID;
	ContainerForm.ItemName.value=ItemName;
	ContainerForm.ParentItemID.value=ParentItemID;
	
	ajaxForm(ListBoxFormName,ContainerPath,Container+'Div');
	}
	
	
function HideContainer(ListBoxFormName,ItemType,ItemID,ParentItemID,ContainerPath) {
		
	Container = ListBoxFormName+'x'+ItemType+'x'+ItemID+'x'+ParentItemID+'x';
	
	ContainerForm = document[ListBoxFormName];
	ContainerFormField = ContainerForm[Container+"Field"];
	
	<!--Hide Container-->
	ContainerDiv = document.getElementById(Container+"Div");
	ContainerDiv.className = 'hiddenContainer';
	
	ContainerPlus = document.getElementById(Container+"Plus");
	ContainerPlus.src = '/crm/scripts/ListBox/img/plus.gif';
	
	ContainerFormField.value='hidden';
	}

function windowRestore(x,y) { 
   var x=0; 
   var y=0; 
   
   if (top.opera && (typeof window.pageYOffset != 'undefined')) { 
      window.pageXOffset = x; 
      window.pageYOffset = y; 
   } 
   else if (window.document.compatMode && (window.document.compatMode != 'BackCompat')) { 
      window.document.documentElement.scrollLeft = x; 
      window.document.documentElement.scrollTop = y; 
   } 
   else window.scrollBy(x,y); 
} 

function windowSave(ListBoxFormName) {
   var xx, yy; 
   if (typeof window.pageXOffset != 'undefined') { 
      xx = window.pageXOffset; 
      yy = window.pageYOffset; 
   } 
   else { 
      if ((!window.document.compatMode) || (window.document.compatMode == 'BackCompat')) { 
         xx = window.document.body.scrollLeft; 
         yy = window.document.body.scrollTop; 
      } 
      else { 
         xx = window.document.documentElement.scrollLeft; 
         yy = window.document.documentElement.scrollTop; 
      } 
   } 
   
   
  	
   
  	document.navListBox.xPos.value = xx; 
  	document.navListBox.yPos.value = yy;
}


<!--Right click commands-->



	
	

	

function hideRCMenu(ListBoxFormName,ItemType,ItemID,ParentItemID) {
	
	Container = ListBoxFormName+'x'+ItemType+'x'+ItemID+'x'+ParentItemID+'x';
	
	if (!document.getElementById(Container+'RCMenu').contains(event.toElement)) 
		{ 
		RightClickHideMenu = document.getElementById(Container+'RCMenu');
		RightClickHideMenu.className = 'hiddenRCMenu';
		RightClickHideInsideMenu = document.getElementById(Container+'insideRCMenu');
		RightClickHideInsideMenu.style.visibility = 'hidden';
		RightClickHideInsideMenu.style.display = 'none';
		} 
}


function showRCMenu(ListBoxFormName,ItemType,ItemID,ItemName,ParentItemID,ListTarget,IsParent,IsChild,ContainerPath) {
	
	ShowContainer(ListBoxFormName,ItemType,ItemID,ItemName,ParentItemID,ContainerPath)
	
	Container = ListBoxFormName+'x'+ItemType+'x'+ItemID+'x'+ParentItemID+'x';
	
	ContainerForm = document[ListBoxFormName]
	
	ContainerForm.ItemType.value = ItemType;
	ContainerForm.ItemID.value = ItemID;
	ContainerForm.ParentItemID.value = ParentItemID;
	ContainerForm.IsParent.value = IsParent;
	ContainerForm.IsChild.value = IsChild;
	
	ajaxForm(ContainerForm,'/crm/scripts/ListBox/right_click_menu.cfm',Container+'RCMenu');
	
	RightClickShowMenu = document.getElementById(Container+'RCMenu');
	RightClickShowMenu.className = 'visibleRCMenu';


}
	
function windowResize(windowName,height,width) 
	{
	  myWindow = ColdFusion.Window.getWindowObject(windowName);
       
      myWindow.resizeTo(width, height);	
	}
	
function listByLetter(letter,ListBoxFormName,ListTarget) {
		
		ContainerForm = document[ListBoxFormName];
		ContainerForm.ListLetter.value=letter;
		
		if (ListTarget == 'FormTo' || ListTarget == 'ShipTo')
			{
			ColdFusion.navigate('/crm/scripts/ListBox/ListBox_PopUp.cfm','PopUpListBox','','','post',ListBoxFormName);
			}
		else {
			ContainerForm.submit();
			}
	}	
	
