
_localhost = 'localhost'
function OpenPopUp(name,params)
{	
	
	switch(name)
	{	
		case "NewConsumer":
				document.location.href="AddConsumer.aspx?"+'topnav=0';				 
				break;	
		case "NewUser":
				document.location.href="AddUser.aspx?"+'topnav=0';				 
				break;
		case "NewAdminUser":
				document.location.href="AddAdminUser.aspx?"+params+'&topnav=0';				
				//window.open("SiteMaintenance/AddAdminUser.aspx","_NEW2", "height=230, screenX=200, screenY=200, width=350, top=200, left=200, menubar=0, location=0, resizable=0, status=0");				
				break;
		case "EditVeriSignInfo":
				window.open("EditVersignInfo.aspx","_NEW2", "height=330, screenX=200, screenY=200, width=400, top=200, left=200, menubar=0, location=0, resizable=0, status=0");

				break;
		case "EditSite":
				window.open("EditSite.aspx","_NEW2", "height=260, screenX=200, screenY=200, width=350, top=200, left=200, menubar=0, location=0, resizable=0, status=0");
				break;
		case "NewSite":
				document.location.href="AddSite.aspx?"+'topnav=0'							
				//window.open("SiteMaintenance/AddSite.aspx","_NEW2", "height=150, screenX=200, screenY=200, width=300, top=200, left=200, menubar=0, location=0, resizable=0, status=0");
				break;		
		case "ChangeLogo":
				window.open("UploadLogo.aspx","_NEW2", "height=150, screenX=200, screenY=200, width=300, top=200, left=200, menubar=0, location=0, resizable=0, status=0");
				break;							
		case "EditReport":
				window.open("EditReport.aspx","_NEW2", "height=240, screenX=200, screenY=200, width=350, top=200, left=200, menubar=0, location=0, resizable=0, status=0");				
				break;
		case "NewPriceListValue":
				window.open("../../BackEnd/CustomerMaintenance/AddPriceList.aspx?"+params,"_NEW2", "height=140, screenX=200, screenY=200, width=300, top=200, left=200, menubar=0, location=0, resizable=0, status=0");				
				break;		
		case "CustomFieldDetails":
				document.location.href="AddCustomField.aspx?"+params+ '&topnav=1';				
				break;
		case "AssignAddress":
				window.open("EditAddressList.aspx","_NEW2", "height=340, screenX=200, screenY=200, width=750, top=200, left=200, menubar=0, location=0, resizable=0, status=0");				
				break;						
		case "NewUser":
				document.location.href="AddUser.aspx?"+'topnav=0'
				break;		
		case "EditUser":
				document.location.href="EditUser.aspx?"+'topnav=0'
				break;			
		case "ManageUsers":
				document.location.href="SiteUsers.aspx?"+'topnav=1';
				break;
		case "Help":
				window.open("Help.aspx","_NEW2", "height=400, screenX=200, screenY=200, width=500, top=200, left=200, menubar=0, location=0, resizable=0, status=0");				
				break;		
		case "AddReport":
				window.open("AddReport.aspx","_NEW2", "height=400, screenX=200, screenY=200, width=500, top=200, left=200, menubar=0, location=0, resizable=0, status=0");				
				break;		
		case "LogOut":
				document.location.href="LogIn.aspx?"+'access=admin';
				break;		
		case "LogIn":
				document.location.href="LogIn.aspx?"+params;
				break;		
		case "Stats":
				document.location.href="stats.aspx?"+'topnav=0';
				break;	
		case "LicenseDetails":
				window.open("LicenseDetails.aspx?"+params,"_NEW2", "height=170, screenX=200, screenY=200, width=300, top=200, left=200, menubar=0, location=0, resizable=0, status=0");				
				break;			
//`		case "PartDetails":
//					window.open("LicenseDetails.aspx?"+params,"_NEW2", "height=170, screenX=200, screenY=200, width=300, top=200, left=200, menubar=0, location=0, resizable=0, status=0");				
//					break;						
		case "SearchUsers":
				document.location.href="SearchUsers.aspx?"+'topnav=0';
				break;				
		case "SiteMaintenance":				
				document.location.href="SiteMaintenance.aspx?"+'topnav=0';
				break;
		case "SystemMaintenance":
				document.location.href="BackendUsers.aspx?"+'topnav=1';
				break;
		case "ArgSystemMaintenance":
				document.location.href="BackendUsers.aspx?"+'topnav=1';
				break;
		case "SiteInfo":
				document.location.href="SiteDetails.aspx?"+'topnav=0'
				break;					
		case "Navigation":
				document.location.href="Navigation.aspx?"+'topnav=0';
				break;							
		case "HelpDesk":
				document.location.href="HelpDesk.aspx?"+'topnav=1';
				break;							
		case "SearchUsers":
				document.location.href="SearchUsers.aspx?"+'topnav=0';
				break;			
		case "AddAdminUser":
				document.location.href="AddAdminUsers.aspx?"+'topnav=0';
				break;	
		case "ChangePasswordMain":
				document.location.href="ChangePassword.aspx?"+'topnav=0';
				break;		
		case "ChangePasswordAdmin":
				document.location.href="ChangePassword.aspx?"+'topnav=1';
				break;					
		case "NavigateUsers":
				document.location.href="NavigateUsers.aspx?"+params + '&topnav=0';
				break;									
		case "BackendUsers":
				document.location.href="BackendUsers.aspx?"+'topnav=1';
				break;							
		case "EditBackendUser":
				document.location.href="EditBackendUser.aspx?"+ params + '&topnav=1';
				break;							
		case "NewBackendUser":
				document.location.href="AddBackendUser.aspx?"+'topnav=1';
				break;							
		case "SiteCarriers":
				document.location.href="SiteCarriers.aspx?"+'topnav=1';
				break;
		case "EditCarrier":
				document.location.href="EditSiteCarrier.aspx?"+'topnav=1';
				break;
		case "NewCarrier":
				document.location.href="AddSiteCarrier.aspx?"+'topnav=1';
				break;
		case "SiteContacts":
				document.location.href="BackEndUsers.aspx?"+'topnav=1';
				break;
		case "EditContact":
				document.location.href="EditSiteContact.aspx?"+'topnav=1';
				break;
		case "NewContact":
				document.location.href="AddSiteContact.aspx?"+'topnav=1';
				break;
		case "SiteMultipliers":
				document.location.href="SiteMultipliers.aspx?"+'topnav=1';
				break;						
		case "EditMultiplier":
				document.location.href="EditSiteMultiplier.aspx?"+'topnav=1';
				break;						
		case "NewMultiplier":
				document.location.href="AddSiteMultiplier.aspx?"+'topnav=1';
				break;						
		case "RateCheck":
				document.location.href="RateCheck.aspx?"+'topnav=1';;
				break;		
		// Customer Maintenance	
		
		
		
		/* Customer maintenance stats*/
		
		case "CustomerMaintenance":
				document.location.href="../../BackEnd/CustomerMaintenance/CustomersList.aspx?"+'topnav=1';
				break;								
		case "ManageCustomerAddress":			
				document.location.href="../../BackEnd/CustomerMaintenance/ManageAddress.aspx?"+params+ '&topnav=1';
				break;							
		case "CustomerAddress":
				document.location.href="CustomerAddressDetails.aspx?"+params+ '&topnav=1';
				break;	
		case "AddressDetails":
				document.location.href="../../SiteAdmin/CustomerMaintenance/AddressDetails.aspx?"+params+ '&topnav=1';
				break;		
								
		case "UserGroupDetails":
				document.location.href="UserGroupDetails.aspx?"+params+ '&topnav=1';
				break;				
			
		case "ManageCustomerUsers":
				document.location.href="ManageCustomerUsers.aspx?"+params+ '&topnav=1';
				break;		
		case "CustomerUserDetails":
				document.location.href="../../BackEnd/CustomerMaintenance/CustomerUserDetails.aspx?"+params+ '&topnav=1';
				break;																
		case "ViewUserHierarchy":
				document.location.href="UserHierarchy.aspx?"+'topnav=1';
				break;							
		case "ManageUserGroups":
				document.location.href="../../BackEnd/CustomerMaintenance/ManageUserGroups.aspx?"+params+ '&topnav=1';
				break;							
		case "ManageProductCategories":
				document.location.href="ManageProductCategories.aspx?"+params+ '&topnav=1';
				break;							
		case "ManageCustomers":
				document.location.href="../../BackEnd/CustomerMaintenance/CustomersList.aspx?"+'topnav=1';;
				break;	
		
		case "CustomerDetails":
				document.location.href="../../BackEnd/CustomerMaintenance/CustomerDetails.aspx?"+params+ '&topnav=1';
				break;	
		case "ImportAddresses":
				document.location.href="../../SiteAdmin/CustomerMaintenance/ImportAddresses.aspx?"+params+ '&topnav=1';
				break;			
		case "ImportCustomerUsers":
				document.location.href="../../SiteAdmin/CustomerMaintenance/ImportCustomerUsers.aspx?"+params+ '&topnav=1';
				break;					
		case "UploadLogo_CustomerMain":
				document.location.href="UploadLogo.aspx?"+'topnav=1';
				break;					
		case "AssignDefaultCarrier":				
				window.open("AssignDefaultCarrier.aspx","_NEW2", "height=250, screenX=200, screenY=200, width=500, top=200, left=200, menubar=0, location=0, resizable=0, status=0");								
				break;					
		case "AssignApprovingManager":				
				window.open("AssignApprovingManager.aspx","_NEW2", "height=270, screenX=200, screenY=200, width=500, top=200, left=200, menubar=0, location=0, resizable=0, status=0");								
				break;
		case "AssignDefaultPriceList":				
				window.open("AssignDefaultPriceList.aspx","_NEW2", "height=270, screenX=200, screenY=200, width=500, top=200, left=200, menubar=0, location=0, resizable=0, status=0");								
				break;				
		case "AssignDefaultPrice_CL":				
				window.open("AssignDefaultPrice_CL.aspx","_NEW2", "height=220, screenX=200, screenY=200, width=400, top=200, left=200, menubar=0, location=0, resizable=0, status=0");								
				break;						
		case "AddCarrier":				
				window.open("AddCarrier.aspx","_NEW2", "height=270, screenX=200, screenY=200, width=500, top=200, left=200, menubar=0, location=0, resizable=0, status=0");								
				break;				
		case "EditCarrier_cm":				
				window.open("EditCarrier.aspx","_NEW2", "height=170, screenX=200, screenY=200, width=400, top=200, left=200, menubar=0, location=0, resizable=0, status=0");								
				break;				
		
		//
		/* Customer maintenance ends */
		
		/*PartMaintenance stats */
		
		case "PartMaintenance":
				document.location.href="SearchParts.aspx?"+'topnav=1';
				break;							
		case "SearchParts":
				document.location.href="SearchParts.aspx?"+'topnav=1';
				break;							
		case "PartDetails":
				document.location.href="../../BackEnd/Parts/AddEditPart.aspx?"+params+ '&topnav=1';
				break;		
		case "PartHistory":
				document.location.href="PartHistory.aspx?"+'topnav=1';
				break;							
		case "SearchPartKits":
				document.location.href="SearchPartKits.aspx?"+'topnav=1';
				break;							
		case "PartKitDetails":
				document.location.href="PartKitDetails.aspx?"+params+ '&topnav=1';
				break;			
		case "SoftProofDetails_part":
				document.location.href="SoftProofProjects.aspx?"+'topnav=1';
				break;					
		case "SoftProofProjects":
				document.location.href="SoftProofProjectsList.aspx?"+'topnav=1';
				break;						
		case "EditPriceList":
				document.location.href="EditPriceList.aspx?"+'topnav=1';				
				break;		
		case "DiscountDetails":
				window.open("DiscountDetails.aspx?"+params,"_NEW2", "height=225, screenX=100, screenY=100, width=400, top=150, left=150, menubar=0, location=0, resizable=0, status=0");								
				break;	
		case "PartAlias":
				document.location.href="PartAlias.aspx?"+'topnav=1';
				break;				
		case "AddPartsToKit":
				window.open("AddPartsToKit.aspx","_NEW2", "height=265, screenX=200, screenY=200, width=500, top=200, left=200, menubar=0, location=0, resizable=0, status=0");								
				break;	
		case "EditPartsInKit":
				window.open("EditPartsInKit.aspx?"+params,"_NEW2", "height=165, screenX=200, screenY=200, width=350, top=200, left=200, menubar=0, location=0, resizable=0, status=0");								
				break;			
		/* PartMaintenance ends*/
		
		/* Order Maintenance stats*/
		case "SearchOrders":
				document.location.href="SearchOrders.aspx?"+params+ '&topnav=1';
				break;		
		case "OrderMaintenance":
				document.location.href="SearchOrders.aspx?"+'topnav=1';
				break;		
		case "ViewOrder":
				document.location.href="ViewOrder.aspx?"+'topnav=1';
				break;		
		case "PlaceOrder":
				document.location.href="PlaceOrder.aspx?"+'topnav=1';
				break;				
		case "CheckOut":
				document.location.href="CheckOut.aspx?"+'topnav=1';
				break;						
		case "Cart":
				document.location.href="CartList.aspx?"+'topnav=1';
				break;						
		case "OrderMaintenance":
				document.location.href="EntryPage.aspx?"+'topnav=1';
				break;	
		case "BillingAndShipping":
				document.location.href="BillingAndShipping.aspx?"+'topnav=1';
				break;						
		case "OrderConfirmation":
				document.location.href="Confirmation.aspx?"+'topnav=1';
				break;						
		case "ThankyouPage":
				document.location.href="ThankYou.aspx?"+'topnav=1';
				break;						
		case "AddCreditCard":				
				window.open("CreditCardInfo.aspx","_NEW2", "height=200, screenX=200, screenY=200, width=350, top=200, left=200, menubar=0, location=0, resizable=0, status=0");								
				break;			
		case "AddOfflineCharges":
				window.open("AddOfflineCharges.aspx?"+params,"_NEW2", "height=200, screenX=200, screenY=200, width=350, top=200, left=200, menubar=0, location=0, resizable=0, status=0");								
				break;			
		case "DetailLine":
				window.open("AddDetailLine.aspx?"+params,"_NEW2", "height=200, screenX=200, screenY=200, width=350, top=200, left=200, menubar=0, location=0, resizable=0, status=0");								
				break;			
		case "Jobticket":
				window.open("JobTicket.aspx","_NEW2", "top=200, left=200, menubar=0, location=0, resizable=0, status=0");								
				//document.location.href="../SiteAdmin/JobTicket.aspx";
				break;						
		case "EditOrderLineItem":
				document.location.href="EditOrderLineItem.aspx?"+'topnav=1';
				break;						
		case "EditOrderDetails":
				document.location.href="EditOrderDetails.aspx?"+'topnav=1';
				break;						
		case "AddOrderLineItem":
				document.location.href="AddOrderLineItem.aspx?"+'topnav=1';
				break;						
		case "EditShippingdetails":
				document.location.href="EditShippingDetails.aspx?"+'topnav=1';
				break;						
		case "CustomizeOrder":
				document.location.href="CustomizeOrder.aspx?"+'topnav=1';
				break;								
		case "CustimizationDetails":
				document.location.href="CustomizationDetails.aspx?"+'topnav=1';
				break;
		case "EditBilltoAddress":
				window.open("EditBilltoAddress.aspx","_NEW2", "height=300, screenX=200, screenY=200, width=380, top=200, left=200, menubar=0, location=0, resizable=0, status=0");								
				break;			
		
		case "OrderDetailsPrint":		
				alert("Yes" + params)		
				window.open("../WMS/OrderDetails.aspx?"+params,"_NEW2", "height=550, screenX=200, screenY=200, width=800, top=100, left=50, menubar=0, location=0, resizable=0, status=0");								
				//document.location.href="OrderDetails.aspx";
				break;	
		/* Order Maintenance ends*/
		
		/* communication module links stats*/
		
		case "SearchTicketsArgAdmin":
				document.location.href="SearchTickets.aspx?"+params+'&topnav=0';
				break;	
		case "SearchTickets":				
				if(params == 'type=SiteAdmin')
				{
					document.location.href="SearchTickets.aspx?"+params+'&topnav=1';
				}
				else if(params == 'type=ArgAdmin')
				{
					document.location.href="SearchTickets.aspx?"+params+'&topnav=0';
				}
				break;	
		case "EditTicket":
				if(params == 'type=SiteAdmin')
				{
					document.location.href="EditTicket.aspx?"+params+'&topnav=1';
				}
				else if(params == 'type=ArgAdmin')
				{
					document.location.href="EditTicket.aspx?"+params+'&topnav=0';
				}
				
				break;	
		case "MessageCenter":
				document.location.href="MessagesList.aspx?"+params+ '&topnav=1';
				break;	
		case "MessageCenterArgAdmin":
				document.location.href="MessagesList.aspx?"+params+ '&topnav=1';
				break;	
		case "EditMessage":
				document.location.href="MessageDetails.aspx?"+params+ '&topnav=1';
				break;	
		case "MessageStatus":
				window.open("MessageStatus.aspx","_NEW2", "height=280, screenX=200, screenY=200, width=500, top=200, left=200, menubar=0, location=0, resizable=0, status=0");								
				break;	
		case "BroadCaseSetting":
				window.open("BroadcastSettings.aspx","_NEW2", "height=280, screenX=200, screenY=200, width=500, top=200, left=200, menubar=0, location=0, resizable=0, status=0");								
				break;	
		case "AddbroadUser_ByUser":
				window.open("NewUser.aspx","_NEW2", "height=280, screenX=200, screenY=200, width=500, top=200, left=200, menubar=0, location=0, resizable=0, status=0");								
				break;	
		case "NewCustomerMessageList":
				window.open("NewCustomer.aspx","_NEW2", "height=270, screenX=200, screenY=200, width=500, top=200, left=200, menubar=0, location=0, resizable=0, status=0");								
				break;
				
		/* communication module ends*/
		
		
		/* WMS module stats*/
		case "WMS":
				document.location.href="EntryPage.aspx?"+'topnav=1';
				break;										
		case "WMSMaintenance":
				document.location.href="WMSWindow.aspx?"+'topnav=1';
				break;	
		case "WMS_Window":
				document.location.href="WMSWindow.aspx?"+params+ '&topnav=1';
				break;	
		case "WMS_OrderDetails":				
				window.open("OrderDetails.aspx?"+params,"_NEW2", "height=500, screenX=200, screenY=200, width=880, top=100, left=50, menubar=0, location=0, resizable=0, status=0");								
				//document.location.href="OrderDetails.aspx";
				break;	
		case "WMS_OrderDetails2":
				window.open("../../BackEnd/WarehouseManagement/OrderDetails.aspx?"+params,"_NEW2", "height=500, screenX=200, screenY=200, width=880, top=100, left=50, menubar=0, location=0, resizable=0, status=0");								
				//document.location.href="OrderDetails.aspx";
				break;	
		case "WMS_ManualPicks":
				document.location.href=params;
				return false;
				break;	
		case "WMS_ShipOrder":
				document.location.href=params;
				return false;
				break;	
		case "WMS_AddTracking":
				window.open("AddTrackDetails.aspx","_NEW2", "height=200, screenX=200, screenY=200, width=300, top=200, left=200, menubar=0, location=0, resizable=0, status=0");								
				break;	
		case "WMS_LivePicks":				
				window.open("LivePicks.aspx?"+params,"_NEW2", "height=500, screenX=200, screenY=200, width=700, top=100, left=200, menubar=0, location=0, resizable=0, status=0");								
				break;	
		case "WMS_Locator":
				document.location.href="Locator.aspx?"+params+ '&topnav=1';
				break;	
		case "WMS_InvenTrans":
				document.location.href="InventoryTransactions.aspx?"+params+ '&topnav=1';
				break;	
		case "WMS_PhyInvenForTerminal":
				document.location.href="PhysicalInventoryForTerminal.aspx?"+'topnav=1';
				break;	
		case "WMS_PhyInvenForAdmin":
				document.location.href="PhysicalInventory.aspx?"+'topnav=1';
				break;	
		case "WMS_Locations":
				document.location.href="SearchLocation.aspx?"+'topnav=1';
				break;	
		case "WMS_DisLocations":
				document.location.href="DiscrepantLocation.aspx?"+'topnav=1';
				break;							
		case "NewPI":
				window.open("AddNewPI.aspx","_NEW2", "height=120, screenX=200, screenY=200, width=300, top=200, left=200, menubar=0, location=0, resizable=0, status=0");								
				break;
		case "LocationDetails":
				document.location.href="LocationDetails.aspx?"+params+ '&topnav=1';
				break;
		case "LocationAdjust":
				window.open("AdjustLocation.aspx?"+params,"_NEW2", "height=240, screenX=200, screenY=200, width=400, top=200, left=200, menubar=0, location=0, resizable=0, status=0");
				break;
		case "WMS_PrintPISheet":
				window.open("PrintPISheet.aspx?","_NEW2", "height=600, screenX=200, screenY=200, width=700, top=20, left=100, menubar=0, location=0, resizable=0, status=0");				
				break;				
		case "WMS_ManualPISheet":
				document.location.href="InventorySheet.aspx?"+params+ '&topnav=1';
				break;		
		case "WMS_AddPart":
				document.location.href="AddPart.aspx?"+params+ '&topnav=1';				
				break;
		case "WMS_EditQuantity":
				window.open("EditQuantityOnHand.aspx","NEW2", "height=175, screenX=200, screenY=200, width=350, top=200, left=200, menubar=0, location=0, resizable=0, status=0");
				break;
		case "WMS_ShipOut":
				document.location.href="ShipOut.aspx?"+'topnav=1';;				
				break;		
		case "WMS_PrintManulPkedList":
				window.open("PrintManualTicket.aspx","NEW2", "height=500,width=700, screenX=100, screenY=100, top=50, left=100, menubar=0, location=0, resizable=0, status=0");
				break;		
		case "WMS_ProcessOrders":
				document.location.href="FPP_ProcessOrders.aspx?"+'topnav=1';				
				break;
		case "WMS_Shippments":
				document.location.href="FPP_Shippments.aspx?"+'topnav=1';				
				break;
		
		case "WMS_Inprogress":
				document.location.href="FPP_InProgess.aspx?"+'topnav=1';			
				break;
		case "WMS_PrintPickSheets":
				window.open("FPP_PrintPickSheets.aspx","NEW2", "height=650,width=800, screenX=100, screenY=100, top=50, left=100, menubar=0, location=0, resizable=0, status=0");				
				break;		
				
		case "UserGroupDetails":
			window.open("../../BackEnd/CustomerMaintenance/UserGroupDetailsPopup.aspx?"+params,"NEW2", "height=275,width=500, screenX=100, screenY=100, top=150, left=300, menubar=0, location=0, resizable=0, status=0");				
			break;
		case "PartsPoppup":
			window.open("PartsPopUp.aspx?"+params,"NEW2", "height=265,width=500, screenX=100, screenY=100, top=150, left=300, menubar=0, location=0, resizable=0, status=0");				
			break;
		/*WMS module ends*/
		
		/*Gun Interface begins*/
		case "GunInterface":				
				//window.open("RemoteAccess/Login.aspx");				
				document.location.href="RemoteAccess/Default.aspx";
				break;	
		/*Gun Interface ends*/

		/*Soft proof starts*/
		case "SoftProofDetails":
				document.location.href="SoftProofDetails.aspx?"+params+ '&topnav=1';				
				break;
		case "SoftProofAttachParts":
				window.open("AttachPart.aspx?"+params,"NEW2", "height=350,width=700, screenX=100, screenY=100, top=150, left=300, menubar=0, location=0, resizable=0, status=0");				
				break;
		case "SoftProofPartVariableList":
			window.open("PartVariableList.aspx?"+params,"NEW2", "height=600,width=600, screenX=100, screenY=100, top=150, left=300, menubar=0, location=0, resizable=0, status=0");				
			break;
		case "SoftProofPreview":
			window.open("SoftProofPreview.aspx?"+params,"NEW2", "height=600,width=1000, screenX=10, screenY=10, top=10, left=10, menubar=0, location=0, resizable=0, status=0");				
			break;
		
		case "SoftProofPartCustomization":
			window.open("../../SoftProof/SoftProofPreview.aspx?"+params,"NEW2", "height=600,width=1000, screenX=10, screenY=10, top=10, left=10, menubar=0, location=0, resizable=0, status=0");				
			break;
			
		/*Soft proof ends*/
		
		/* */
		case "ReportsAdmin":
				document.location.href="Reports.aspx?"+'topnav=0';
				break;								
		case "Reports":
				document.location.href="Reports.aspx?"+'topnav=1';
				break;	
		case "CustomerReports":
				document.location.href="Reports.aspx";
				break;
		
		
		case "ReportDetails_SiteMain": 				
				document.location.href="ReportDetails.aspx?"+params+'&topnav=0';								
				break;
		case "ReportDetails_SiteAdmin": 				
				document.location.href="ReportDetails.aspx?"+params+'&topnav=1';								
				break;
		case "RunReport_SiteMain":
				document.location.href="RunReport.aspx?"+params+'&topnav=0';
				break;
		case "RunReport_SiteAdmin":
				document.location.href="RunReport.aspx?"+params+'&topnav=1';
				break;
		case "ShowReport":
				window.open("SampleReport.aspx");
				
				break;		
						
		case "NavLoginBuyer":
				//window.open("../LogIn.aspx");
				document.location.href="LogIn.aspx";
				break;		
		case "NavLoginAdmin":
				//window.open("../LogIn.aspx?"+params+ '&topnav=1');
				document.location.href="../LogIn.aspx";
				break;		
		
		case "LogInAsFrontEnd":
				//window.open("../LogIn.aspx");
				document.location.href="../LogIn.aspx?"+params;
				break;		
		case "LogInAsSiteAdmin":
				//window.open("../LogIn.aspx?"+params);
				document.location.href="../LogIn.aspx?"+params;
				break;		
		case "LoginAsGun":
				//window.open("RemoteAccess/Login.aspx?"+params);				
				document.location.href="../SiteAdmin/WMS/RemoteAccess/Default.aspx?"+params;
				break;		
		
		
		default:		
				document.location.href="Common/UnderConstruction.aspx";
				break;							
				
	}
	return false;
}


function HOver(obj)
{	
	obj.className = "gridColumn";
}
function HOut(obj)
{
	obj.className= "";
}

function Trim(s) 
{
	var m = s.match(/^\s*(\S+(\s+\S+)*)\s*$/);
	return (m == null) ? "" : m[1];
}

function HOver(obj)
{	
	obj.className = "gridColumn";
}
function HOut(obj)
{
	obj.className= "";
}

function GridHOver(obj)
{
	obj.className = "hover4grid";
}

function GridHOut(obj)
{
	obj.className= "";
}


function unselectRows()
{
	
	for (var i=0; i < _gridControlId.rows.length; i++)
	{
		var oTr = _gridControlId.rows[i];
		unselectRow(oTr);	
	}
}

function unselectRow(o)
{
	applyStyles(o, "");	
}
function applyStyles(o, sClass)
{
	var i = 0;
	var ii = o.cells.length;
	
	while (i < ii)
	{
		o.cells[i].className = sClass;
		i++;
	}
}

function setGlow(o, sBorder, sBackground)
{
	if (!o)
	{
		return false;
	}

	with (o.runtimeStyle)
	{
		borderColor = sBorder;
		backgroundColor = sBackground;		
	}
}



function menuRollOver(o,bTurnOn)
{
	if (bTurnOn)
	{		
		o.className = "onovermenu2";		
	}
	else
	{
		o.className = "icmenu2";		
	}
}
function GetCoordinates(aTag)
{	
	var p=[0,0];
	while(aTag!=null){
  		p[0]+=aTag.offsetLeft;
  		p[1]+=aTag.offsetTop;
  		aTag=aTag.offsetParent;  		  		  		
	}	
	
	return p;
	
}

function sortGrid(columnName)
{
}
function RefreshGrid()
{
}

function alignDivHieght()
	{						
		var divName = document.getElementById(_divName);			
		if (divName)
		{	
			if (navigator.appName.indexOf("Microsoft") != -1)
			    yy = document.body.clientHeight;
			else
			    yy = window.innerHeight;
			    
			if (yy > _divheight)
			    divName.style.height = yy - _divheight;
			else
			    divName.style.height = 0;								
		}
	}
	
	function addLoadEvent(func) 
	{			
		var oldonload = window.onload;
		if (typeof window.onload != 'function')
		{
			window.onload = func;
			window.onresize = func;
		}
		else
		{
			window.onload = function() 
			{
				func();
			}
			window.onresize = function() 
			{
				func();
			}
		}
	}

function ShowDivSaveState(obj, name, serverSideControlNameThatStoresDisplayState)
{
	ShowDiv(obj,name);
	CurrDivName = document.getElementById(name);
	controlThatStoresState = document.getElementById(serverSideControlNameThatStoresDisplayState);
	controlThatStoresState.value = CurrDivName.style.display;
}



function ShowDiv(obj,name)
{

	try
	{
		
		CurrDivName = document.getElementById(name);
		if(CurrDivName==null) return;
		
		if(navigator.appName.indexOf("Netscape") != -1)
		{
			temp = obj.getElementsByTagName("img")
			
			
			if(CurrDivName.style.display == 'none')
			{
				CurrDivName.style.display = '';					
				if(0 != temp[0].length)
				{			
					temp[0].src = _applicationPath + '/UI/General/minus.gif'		
				}			
			}
			else
			{	
				CurrDivName.style.display = 'none';
				if(0 != temp[0].length)
				{			
					temp[0].src = 'http://myargosy.com/v2/UI/General/plus.gif'
				}	
				
			}
		}
		else if(navigator.appName.indexOf("Microsoft") != -1)
		{	
			if(CurrDivName.style.display == null || CurrDivName.style.display == 'none')
			{
				CurrDivName.style.display = '';		
				obj.firstChild.src = 'http://myargosy.com/v2/UI/General/minus.gif'		
			}
			else
			{	
				CurrDivName.style.display = 'none';
				obj.firstChild.src = 'http://myargosy.com/v2/UI/General/plus.gif'		
			}
		}
		
	}
	catch(_ex)
	{
	}
}
function ShowReport(appRoot, reportPage, windowName, features)
{
	window.open( appRoot + "/Common/ReportPage.aspx?PageUrl=" + reportPage, windowName, features);
	//window.open( appRoot + "Common/ReportPage.aspx?url=" + reportPage, windowName, features);
	return false;
}



function attachLoadEvent(divName,height)
{		
		_divName = divName;
		_divheight = height;
		addLoadEvent(alignDivHieght);		
}

//Function to Fire Button Events
function TriggerEvent(objSender, objControlName, Mode)
{	
	document.getElementById(objControlName).value = Mode;
	document.forms[0].submit();
}

//Function to Open Chidl Window
function OpenChildWindow(objSender, URL, BuildOption)
{
	
	var ChildWin = "";
	
	var WinParams = BuildWinParams(BuildOption);
	ChildWin = window.open(URL,"_NEW2", WinParams);
}

//Function to Open Chidl Window
//and to Set the Return Values from the PopUp Window
//objToSet  is a comma seperated Control ID. Control can be an Hidden, TextBox Type
var ReturnObj = new Object();
function ShowPopUp(objSender, URL, BuildOption, objToSet)
{
	var ChildWin = "";
	objToSet = objToSet.split(",");
	ReturnObj.ReturnValue = new Array();
	for(i=0; i< objToSet.length; i++)
	{	
		ReturnObj.ReturnValue[i] = document.getElementById(objToSet[i]);
	}
	var WinParams = BuildWinParams(BuildOption);
	ChildWin = window.open(URL,"_NEW2", WinParams);
}
function BuildWinParams(BuildOption)
{
	var WinParmas = "";
	switch(BuildOption)
	{
		
		case 1:
			WinParmas = "height=270, screenX=200, screenY=200, width=500, top=200, left=200, menubar=0, location=0, resizable=0, status=0";
			break;
		case 2:
			WinParmas = "height=250, screenX=200, screenY=200, width=500, top=200, left=200, menubar=0, location=0, resizable=0, status=0"
			break;
		case 3:			//Add PriceList
			WinParmas = "height=140, screenX=200, screenY=200, width=300, top=200, left=200, menubar=0, location=0, resizable=0, status=0";
			break;
		case 4:			//Set Default Address
			WinParmas = "height=340, screenX=200, screenY=200, width=750, top=200, left=200, menubar=0, location=0, resizable=0, status=yes";
			break;
		case 5:			//Add NEW PI    
			WinParmas = "height=170, screenX=200, screenY=200, width=350, top=200, left=200, menubar=0, location=0, resizable=0, status=0";
			break;
		case 6:
			WinParmas = "height=500,width=700, screenX=100, screenY=100, top=150, left=300, menubar=0, location=0, resizable=1, status=0";
			break;	
		case 7: //add broadcastuser 
			WinParmas = "height=510,width=500, screenX=250, screenY=250, top=100, left=200, menubar=0, location=0, resizable=0, status=1";
			break;		
		case 8: //add pi line item
			WinParmas = "height=275,width=500, screenX=250, screenY=250, top=100, left=200, menubar=0, location=0, resizable=0, status=1";
			break;	
		case 9: //Edit pi line item
			WinParmas = "height=200,width=400, screenX=250, screenY=250, top=100, left=200, menubar=0, location=0, resizable=0, status=1";
			break;	
		case 10:
			WinParmas = "height=325,width=525, screenX=100, screenY=100, top=150, left=300, menubar=0, location=0, resizable=0, status=0";
			break;	
		case 11:
			WinParmas = "height=900,width=700, directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,toolbar=no,top=0,left=0";
			break;
		case 15: //search consumer
			WinParmas = "height=350,width=700, screenX=250, screenY=250, top=100, left=200, menubar=0, location=0, resizable=1, status=0";
			break;
		case 20: // print pack list with scroll bar for window
			WinParmas = "height=250, screenX=200, screenY=200, width=500, top=200, left=200, menubar=0, location=0, resizable=0,scrollbars=1, status=0";
			break;
		case 21:
			WinParmas = "height=1000,width=700, directories=no,location=no,menubar=0,resizable=yes,scrollbars=yes,toolbar=0,status=1,top=0,left=0";
			break;
		case 22: // Flat Rate Popup Window
			WinParmas = "height=350, screenX=700, screenY=200, width=500, top=200, left=200, menubar=0, location=0, resizable=0,scrollbars=1, status=0";
			break;
		case 23: //Broadcast User/Customer
			WinParmas = "height=610, width=700, screenX=250, screenY=250, top=100, left=200, menubar=0, location=0, resizable=0, status=0";
			break;
	}
	return WinParmas;
}

//Function to Reload the Parent Page from ChildWindow
//If IsReLoad = true then the Parent Page is refreshed
//Is IsSubmit = true then the Parent page is Submitted
function CloseThisWindow(IsReLoad, IsSubmit)
{	
	try
	{
		if(IsReLoad)
		{	
			window.opener.location.href = window.opener.location.href;
		}
		else if(IsSubmit)
		{	
			window.opener.document.forms[0].submit();
		}
	}
	catch(_e)
	{
		alert(_e.message);
	}
}

//Function to set the Return Values from the PopUp to Parent Controls
//ReturnValues is a comma seperated string. Each value is set the
//corresponding Controls as defined in ReturnObj object
function SetReturnParams(ReturnValues)
{	
	try
	{
		ReturnValues = ReturnValues.split(",");
		for(i=0; i<ReturnValues.length;i++)
		{
			window.opener.ReturnObj.ReturnValue[i].value = ReturnValues[i];
		}
	}
	catch(_e)
	{
		alert(_e.message);
	}
}

//Function to Move Selected Items from Source Dropdown list
//to Target Dropdown list
function MoveItems(FromList, ToList)
{	
	var FromList = document.getElementById(FromList);
	var ToList = document.getElementById(ToList);
	var FromListLength = FromList.options.length;
	for(j=0; j<FromListLength; j++)
	{		
		if(FromList.options[j].selected)
		{	
			var NewOpt = document.createElement("OPTION");
			NewOpt.text = FromList.options[j].text;
			NewOpt.value = FromList.options[j].value;
			ToList.add(NewOpt);
			FromList.remove(j);
			FromListLength--;
			j--;
		}
	}
	return false;
}
//Function to Display Child grid 
function DisplayChildGrid(ParentGridId, ChildGridId, ColumnSpan, SelectedParentValue)
{	
	
	try
	{	
		var GroupGrid = document.getElementById(ParentGridId);
		//SelectedParentValue = parseInt(SelectedParentValue);
		if(document.getElementById(ChildGridId).innerHTML != "")
		{
			for(i=0; i<GroupGrid.rows.length; i++)
			{	
				if(GroupGrid.rows[i].cells[0].innerHTML == SelectedParentValue)
				{
					var NewRow = GroupGrid.insertRow(i+1);
					var NewCell = "";
					if(ColumnSpan != 0)
					{
						NewRow.insertCell(0);
						NewCell = NewRow.insertCell(1);
						NewCell.colSpan = ColumnSpan; 
					}
					else
					{
						NewCell = NewRow.insertCell(0);
					}
					NewCell.height="100%";
					NewCell.innerHTML = document.getElementById(ChildGridId).innerHTML;
					NewCell.focus();
				}
			}
		}
	}
	catch(_e)
	{
		alert(_e.message);
	}
}
// Pass in the event and button. 
// This function will call the click event of the button passed. 
function fireClickButtonEventonEnter(e, buttonid)
{ 
	var bt = document.getElementById(buttonid); 
    if (typeof bt == 'object')
    { 
		if (event.keyCode == 13)
        { 
			bt.click(); 
			return false; 
		} 
	}
}
function CloseWindow()
{
	window.opener=self; 
	window.close();
}

function Legend()
{
	window.radalert("250","250");
}

// Used to determine if any checkbox is checked in a grid.  Copied from Grid.js
function IfChecked(name)
{		
  try
  {	
	var _gridControl = document.getElementById(name);
	var isCheckBoxSelected = false;
	
	var els=document.getElementsByTagName("input");
  	
	for(var i=0; i < els.length; i++) 
	{	
		if (els[i].type=='checkbox' && els[i].name.indexOf('chkBox')) 
		{ 	
			if(els[i].checked)
			{
				isCheckBoxSelected = true;
				break;
			}
		}
	}
	
	if(isCheckBoxSelected ==  false)
	{
		alert("Please select one or more items to continue.");
		return false;
	}
	return isCheckBoxSelected;
	
  }
  catch(_Exce)
  {
  	alert("Error processing your request.");
	return false;
  }
}

/*
function GridHover(obj)
{
	obj.className = "gridHover";
}

function GridHOut(obj)
{
	obj.className= "";
}
*/