function makeid() 
   {
	var text = "";     
	var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";      
	for( var i=0; i < 5; i++ )         
		text += possible.charAt(Math.floor(Math.random() * possible.length));      
	
	return text; 
   } 

function UpdateBothFrames(menuURL, mainURL)
   {
   self.parent.MenuFrame.location = menuURL;
   self.parent.WorkingFrame.location = mainURL;
   }

function UpdateMenuFrame(myURL)
   {
   MenuReady = false;
   self.parent.MenuFrame.location = myURL;
   }

function UpdateMainFrame(myURL)
   {
    self.parent.WorkingFrame.location = myURL;
   }

function ChangeMenuFunction(vSID, myURL)
   {
   UpdateMainFrame("/owa_dba/plsql/web_menus.defaultpage?vSID=" + vSID);
   self.parent.MenuFrame.location=myURL;
   }

function UpdateBrowserWindow(myURL)
   {
    top.location = myURL;   
   }

function BreakFrames()
   {
   vURL = self.location;

   if (self != top)
     window.open( vURL, "_top", "");

   }

function OpenNewBrowserWindow(myURL,myWidth,myHeight)
   {
   OpenNewBrowserWindow2(myURL,myWidth,myHeight);	
   //window.open(myURL, "_new", "width=" + myWidth + ",height="+myHeight+",menubar=no,scrollbars=yes,resizable=yes");
   }

function OpenNewBrowserWindow2(myURL,myWidth,myHeight)
   {
   window.open(myURL, makeid(), "width=" + myWidth + ",height="+myHeight+",menubar=no,scrollbars=yes,resizable=yes");
   }


function OpenReportWindow(myURL,myWidth,myHeight)
   {
   window.open(myURL, "ReportWindow", "width=" + myWidth + ",height="+myHeight+",menubar=no,scrollbars=no,resizable=yes");
   //window.open(myURL, "_new", "width=" + myWidth + ",height="+myHeight+",menubar=no,scrollbars=no,resizable=yes");
   }

function OpenNewBrowserWindowForPrint(myURL,myWidth,myHeight)
   {
   window.open(myURL, "_new", "width=" + myWidth + ",height="+myHeight+",toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes");
   }
function SetWorkingScreen(MenuLevel)
   {
   self.parent.MenuFrame.RefreshForm.vWorkingCustomerScreen.value = 
      self.parent.WorkingFrame.location.pathname;

   if (MenuLevel < 3)
      {
      self.parent.MenuFrame.RefreshForm.vWorkingCompanyScreen.value = 
         self.parent.WorkingFrame.location.pathname;
      }
   else
      {
      self.parent.MenuFrame.RefreshForm.vWorkingCompanyScreen.value = "/owa_dba/plsql/web_menus.defaultpage";
      }
   }

function MenuCoBox()
   {
   vURL = "/owa_dba/plsql/web_menus.ProcessCompanyBox";
   vCID = document.CompanyForm.vCompany.options[document.CompanyForm.vCompany.selectedIndex].value;
   vSID = document.CompanyForm.vSID.value;
   vMenu = document.RefreshForm.vCompanyMenu.value;
   vWorking = document.RefreshForm.vWorkingCompanyScreen.value;

   UpdateMenuFrame( vURL + "?vCID=" + vCID + "&vSID=" + vSID + "&vMenu=" + vMenu + "&vWorkingURL=" + vWorking);
   }


function MenuCustBox()
   {
   vURL = "/owa_dba/plsql/web_menus.ProcessCustomerBox";
   vCID = document.CustomerForm.vCustomer.options[document.CustomerForm.vCustomer.selectedIndex].value;
   vSID = document.CustomerForm.vSID.value;
   vMenu = document.RefreshForm.vCustomerMenu.value;
   vWorking = document.RefreshForm.vWorkingCustomerScreen.value;

   UpdateMenuFrame(vURL + "?vCID=" + vCID + "&vSID=" + vSID + "&vMenu=" + vMenu + "&vWorkingURL=" + vWorking);
   }

function UserDropdownBox()
   {
   document.UserEditForm.action = "/owa_dba/plsql/web_users.ProcessDropdownBox";
   document.UserEditForm.submit();
   }

function OtherUserDropdownBox()
   {
   document.UserEditForm.action = "/owa_dba/plsql/web_users.ProcessOtherUserBox";
   document.UserEditForm.submit();
   }

function SubmitCarrier2ToURL(vURL, vNextTab)
   {
   if (verifyCarrier2(document.CarriersEditForm))
	{
	document.CarriersEditForm.action = vURL;
   	document.CarriersEditForm.vNextTab.value = vNextTab;
   	document.CarriersEditForm.submit();
	}
   }

function SubmitCarrierToURL(vURL, vNextTab)
   {
   document.CarriersEditForm.action = vURL;
   document.CarriersEditForm.vNextTab.value = vNextTab;
   document.CarriersEditForm.submit();
   }

function SubmitZipRateTableToURL(vURL)
   {
   document.ZipRateMainForm.action=vURL;
   document.ZipRateMainForm.submit();
   }
function SubmitZoneWeightRateTableToURL(vURL)
   {
   document.ZoneWeightRateMainForm.action=vURL;
   document.ZoneWeightRateMainForm.submit();
   }
function SubmitZoneWeightCustRateTableToURL(vURL)
   {
   document.ZoneWeightCustRateMainForm.action=vURL;
   document.ZoneWeightCustRateMainForm.submit();
   }
function SubmitZoneWeightCustRateTableToURL(vURL)
   {
   document.ZoneWeightCustRateMainForm.action=vURL;
   document.ZoneWeightCustRateMainForm.submit();
   }
function SubmitZoneRateTableToURL(vURL)
   {
   document.ZoneMainForm.action=vURL;
   document.ZoneMainForm.submit();
   }
function SubmitWeightRateTableToURL(vURL)
   {
   document.WeightMainForm.action=vURL;
   document.WeightMainForm.submit();
   }
function SubmitZoneCartonRateTableToURL(vURL)
   {
   document.ZoneCartonMainForm.action=vURL;
   document.ZoneCartonMainForm.submit();
   }
function SubmitZipCustRateTableToURL(vURL)
   {
   document.ZipCustRateMainForm.action=vURL;
   document.ZipCustRateMainForm.submit();
   }
function SubmitZoneCustRateTableToURL(vURL)
   {
   document.ZoneCustMainForm.action=vURL;
   document.ZoneCustMainForm.submit();
   }
function SubmitPalletRateTableToURL(vURL)
   {
   document.PalletMainForm.action=vURL;
   document.PalletMainForm.submit();
   }
function SubmitWeightCustRateTableToURL(vURL)
   {
   document.WeightCustMainForm.action=vURL;
   document.WeightCustMainForm.submit();
   }
function SubmitZoneCartonCustRateTableToURL(vURL)
   {
   document.ZoneCartonCustMainForm.action=vURL;
   document.ZoneCartonCustMainForm.submit();
   }
function SubmitRateTypeToURL(vRateType, vRateName)
   { 
     top.WorkingFrame.CarriersEditForm.vRateName.value = vRateName;
     top.WorkingFrame.CarriersEditForm.vRateType.value = vRateType;

     if(vRateType == 1) 
     {
       top.WorkingFrame.CarriersEditForm.action = "/owa_dba/plsql/web_carrierrates.ZipRateTableForm";
       top.WorkingFrame.CarriersEditForm.submit();
     }
     else if(vRateType == 2) 
     {
       top.WorkingFrame.CarriersEditForm.action = "/owa_dba/plsql/web_carrierrates.ZoneRateTableForm";
       top.WorkingFrame.CarriersEditForm.submit();
     }
     else if(vRateType == 3) 
     {
       top.WorkingFrame.CarriersEditForm.action = "/owa_dba/plsql/web_carrierrates.ZoneCartonRateTableForm";
       top.WorkingFrame.CarriersEditForm.submit();
     }
     else if(vRateType == 4) 
     {
       top.WorkingFrame.CarriersEditForm.action = "/owa_dba/plsql/web_carrierrates.ZoneWeightRateTableForm";
       top.WorkingFrame.CarriersEditForm.submit();
     }
     else if(vRateType == 5) 
     {
       top.WorkingFrame.CarriersEditForm.action = "/owa_dba/plsql/web_carrierrates.WeightRateTableForm";
       top.WorkingFrame.CarriersEditForm.submit();
     }
     else if(vRateType == 7) 
     {
       top.WorkingFrame.CarriersEditForm.action = "/owa_dba/plsql/web_carrierrates.FlatRateTableForm";
       top.WorkingFrame.CarriersEditForm.submit();
     }
     else if(vRateType == 8) 
     {
       top.WorkingFrame.CarriersEditForm.action = "/owa_dba/plsql/web_carrierrates.PalletRateTableForm";
       top.WorkingFrame.CarriersEditForm.submit();
     }
   }
function SubmitCopyRatesToURL()
   { 
     document.CarriersEditForm.action = "/owa_dba/plsql/web_carrierrates.CopyRates";
     document.CarriersEditForm.submit();     
   }
function SubmitAddRatesToURL()
   { 
     document.CarriersEditForm.action = "/owa_dba/plsql/web_carrierrates.AddRates";
     document.CarriersEditForm.submit();     
   }
function SubmitCopyCustRatesToURL()
   {                                    
   //    vRateType = document.CustomerEditForm.vCustomerRateType.options[document.LoadRatesForm.vCustomerRateType.selectedIndex].value; 
       document.LoadRatesForm.vCarrierID.value =document.CustomerEditForm.vSlidingDiscCarriers.options[document.CustomerEditForm.vSlidingDiscCarriers.selectedIndex].value;
   //    parent.LoadRatesForm.vCustomerRateType.value = vRateType;
      if (document.LoadRatesForm.vCarrierID.value != "")
      {
       document.LoadRatesForm.action = "/owa_dba/plsql/web_customerrates.CopyCustRates";
       document.LoadRatesForm.submit();  
      }
   }
function ViewCustomerRates(vRateType, vRateName)
   { 
     document.EditRatesForm.vratename.value = vRateName;
     document.EditRatesForm.vRateType.value = vRateType; 
//   vRateType = document.LoadRatesForm.vCustomerRateType.options[document.LoadRatesForm.vCustomerRateType.selectedIndex].value;
   vRatePerShip = parent.iCustRateType.LoadRatesForm.vRatePerShipment.checked;
   vUseRetRate = parent.iCustRateType.LoadRatesForm.vUseReturnRates.checked;
   vUseWeekendRate = parent.iCustRateType.LoadRatesForm.vUseWeekendRates.checked;

   parent.LoadRatesForm.vRateName.value = vRateName;
   parent.LoadRatesForm.vCustomerRateType.value = vRateType;
   if (vRatePerShip == 1 || vRatePerShip == "YES")
	parent.LoadRatesForm.vRatePerShipment.value = 1;
   else
	parent.LoadRatesForm.vRatePerShipment.value = 0;

   if (vUseRetRate == 1 || vRatePerShip == "YES")
	parent.LoadRatesForm.vUseReturnRates.value = 1;
   else
	parent.LoadRatesForm.vUseReturnRates.value = 0;

   if (vUseWeekendRate == 1 || vRatePerShip == "YES")
  	parent.LoadRatesForm.vUseWeekendRates.value = 1;
   else
	parent.LoadRatesForm.vUseWeekendRates.value = 0;

   parent.LoadRatesForm.vCarrierID.value = parent.CustomerEditForm.vSlidingDiscCarriers.options[parent.CustomerEditForm.vSlidingDiscCarriers.selectedIndex].value;

   parent.LoadRatesForm.submit();
   }

function SubmitAddCustRatesToURL()
   { 
     document.AddRatesForm.vCarrierID.value = document.CustomerEditForm.vSlidingDiscCarriers.options[document.CustomerEditForm.vSlidingDiscCarriers.selectedIndex].value;    
     document.AddRatesForm.submit();     
   }

function SubmitCustomerToURL(vURL, vNextTab)
   {
   document.CustomerEditForm.vNextTab.value = vNextTab;
   document.CustomerEditForm.action=vURL;
   document.CustomerEditForm.submit();
   }

function SubmitInvoiceToURL(vURL)
   {
   document.InvoiceEditForm.action=vURL;
   document.InvoiceEditForm.submit();
   }

function SubmitPrefsToURL(vURL)
   {
   document.EditForm.action=vURL;
   document.EditForm.submit();
   }

function SubmitZipRateReturn()
   {
   vSID = document.ZipRateMainForm.vSID.value;
   vCarrierRecID = document.ZipRateMainForm.vCarrierRecID.value;
   if (document.ZipRateMainForm.bRates.value == "EDIT ZIP RATES")
     {
     document.ZipRateMainForm.bRates.value = "EDIT RETURN RATES"
     document.iZipRate.location.href = "/owa_dba/plsql/web_carrierrates.ZipRateTableLoad?vSID=" + vSID + "&vCarrierRecID=" + vCarrierRecID + "&pUseReturn=0&pColumn=0";	
     }
   else
     {
     document.ZipRateMainForm.bRates.value = "EDIT ZIP RATES"
     document.iZipRate.location.href = "/owa_dba/plsql/web_carrierrates.ZipRateTableLoad?vSID=" + vSID + "&vCarrierRecID=" + vCarrierRecID + "&pUseReturn=1&pColumn=0";	
     }
   }
function SubmitZoneWeightRateReturn()
   {
   vSID = document.ZoneWeightRateMainForm.vSID.value;
   vCarrierRecID = document.ZoneWeightRateMainForm.vCarrierRecID.value;
   if (document.ZoneWeightRateMainForm.bRates.value == "EDIT ZONE WEIGHT RATES")
     {
     document.ZoneWeightRateMainForm.bRates.value = "EDIT RETURN RATES"
     document.iZoneWeightRate.location.href = "/owa_dba/plsql/web_carrierrates.ZoneWeightRateTableLoad?vSID=" + vSID + "&vCarrierRecID=" + vCarrierRecID + "&pUseReturn=0&pColumn=0";	
     }
   else
     {
     document.ZoneWeightRateMainForm.bRates.value = "EDIT ZONE WEIGHT RATES"
     document.iZoneWeightRate.location.href = "/owa_dba/plsql/web_carrierrates.ZoneWeightRateTableLoad?vSID=" + vSID + "&vCarrierRecID=" + vCarrierRecID + "&pUseReturn=1&pColumn=0";	
     }
   }
function SubmitWeightRateReturn()
   {
   vSID = document.WeightMainForm.vSID.value;
   vCarrierRecID = document.WeightMainForm.vCarrierRecID.value;
   if (document.WeightMainForm.bRates.value == "EDIT WEIGHT RATES")
     {
     document.WeightMainForm.bRates.value = "EDIT RETURN RATES"
     document.iWeightRate.location.href = "/owa_dba/plsql/web_carrierrates.WeightRateTableLoad?vSID=" + vSID + "&vCarrierRecID=" + vCarrierRecID + "&pUseReturn=0&pColumn=0";	
     document.iMinWeightRate.location.href = "/owa_dba/plsql/web_carrierrates.minWeightRateTableLoad?vSID=" + vSID + "&vCarrierRecID=" + vCarrierRecID + "&pUseReturn=0";	

     }
   else
     {
     document.WeightMainForm.bRates.value = "EDIT WEIGHT RATES"
     document.iWeightRate.location.href = "/owa_dba/plsql/web_carrierrates.WeightRateTableLoad?vSID=" + vSID + "&vCarrierRecID=" + vCarrierRecID + "&pUseReturn=1&pColumn=0";	
     document.iMinWeightRate.location.href = "/owa_dba/plsql/web_carrierrates.minWeightRateTableLoad?vSID=" + vSID + "&vCarrierRecID=" + vCarrierRecID + "&pUseReturn=1";	
     }
   }

function SubmitCartonZoneReturn()
   {
   vSID = document.ZoneCartonMainForm.vSID.value;
   vCarrierRecID = document.ZoneCartonMainForm.vCarrierRecID.value;
   if (document.ZoneCartonMainForm.bRates.value == "EDIT CARTON ZONE RATES")
     {
     document.ZoneCartonMainForm.bRates.value = "EDIT WEEKEND RATES"
     document.iZoneCartonRate.location.href = "/owa_dba/plsql/web_carrierrates.ZoneCartonRateTableLoad?vSID=" + vSID + "&vCarrierRecID=" + vCarrierRecID + "&pUseReturn=0&pColumn=0";	
     }
   else
     {
     document.ZoneCartonMainForm.bRates.value = "EDIT CARTON ZONE RATES"
     document.iZoneCartonRate.location.href = "/owa_dba/plsql/web_carrierrates.ZoneCartonRateTableLoad?vSID=" + vSID + "&vCarrierRecID=" + vCarrierRecID + "&pUseReturn=1&pColumn=0";	
     }
   }

function SubmitZoneRateReturn()
   {
   vSID = document.ZoneMainForm.vSID.value;
   vCarrierRecID = document.ZoneMainForm.vCarrierRecID.value;
   if (document.ZoneMainForm.bRates.value == "EDIT ZONE RATES")
     {
     document.ZoneMainForm.bRates.value = "EDIT RETURN RATES"
     document.iZoneRate.location.href = "/owa_dba/plsql/web_carrierrates.ZoneRateTableLoad?vSID=" + vSID + "&vCarrierRecID=" + vCarrierRecID + "&pUseReturn=0&pColumn=0";	
     }
   else
     {
     document.ZoneMainForm.bRates.value = "EDIT ZONE RATES"
     document.iZoneRate.location.href = "/owa_dba/plsql/web_carrierrates.ZoneRateTableLoad?vSID=" + vSID + "&vCarrierRecID=" + vCarrierRecID + "&pUseReturn=1&pColumn=0";	
     }
   }

function SubmitZipCustRateReturn()
   {
   vSID = document.ZipCustRateMainForm.vSID.value;
   vCarrierRecID = document.ZipCustRateMainForm.vCarrierRecID.value;
   vRateName = document.ZipCustRateMainFormParam.vRateName.value;
   if (document.ZipCustRateMainForm.bRates.value == "EDIT ZIP RATES")
     {
     document.ZipCustRateMainForm.bRates.value = "EDIT RETURN RATES"
     document.iZipCustRate.location.href = "/owa_dba/plsql/web_customerrates.ZipCustRateTableLoad?vSID=" + vSID + "&vCarrierRecID=" + vCarrierRecID + "&vRateName=" + vRateName + "&pUseReturn=0&pColumn=0";	
     }
   else
     {
     document.ZipCustRateMainForm.bRates.value = "EDIT ZIP RATES"
     document.iZipCustRate.location.href = "/owa_dba/plsql/web_customerrates.ZipCustRateTableLoad?vSID=" + vSID + "&vCarrierRecID=" + vCarrierRecID + "&vRateName=" + vRateName + "&pUseReturn=1&pColumn=0";	
     }
   }
function SubmitZoneWeightCustRateReturn()
   {
   vSID = document.ZoneWeightCustRateMainForm.vSID.value;
   vCarrierRecID = document.ZoneWeightCustRateMainForm.vCarrierRecID.value;
   vRateName = document.ZoneWeightCustRateMainFormParam.vRateName.value;
   if (document.ZoneWeightCustRateMainForm.bRates.value == "EDIT ZONE WEIGHT RATES")
     {
     document.ZoneWeightCustRateMainForm.bRates.value = "EDIT RETURN RATES"
     document.iZoneWeightCustRate.location.href = "/owa_dba/plsql/web_customerrates.ZoneWeightCustRateTableLoad?vSID=" + vSID + "&vCarrierRecID=" + vCarrierRecID + "&vRateName=" + vRateName + "&pUseReturn=0&pColumn=0";	
     }
   else
     {
     document.ZoneWeightCustRateMainForm.bRates.value = "EDIT ZONE WEIGHT RATES"
     document.iZoneWeightCustRate.location.href = "/owa_dba/plsql/web_customerrates.ZoneWeightCustRateTableLoad?vSID=" + vSID + "&vCarrierRecID=" + vCarrierRecID + "&vRateName=" + vRateName + "&pUseReturn=1&pColumn=0";	
     }
   }
function SubmitWeightCustRateReturn()
   {
   vSID = document.WeightCustMainForm.vSID.value;
   vCarrierRecID = document.WeightCustMainForm.vCarrierRecID.value;
   vRateName = document.WeightCustMainFormParam.vRateName.value;
   if (document.WeightCustMainForm.bRates.value == "EDIT WEIGHT RATES")
     {
     document.WeightCustMainForm.bRates.value = "EDIT RETURN RATES"
     document.iWeightRate.location.href = "/owa_dba/plsql/web_customerrates.WeightCustRateTableLoad?vSID=" + vSID + "&vCarrierRecID=" + vCarrierRecID + "&vRateName=" + vRateName + "&pUseReturn=0&pColumn=0";	
     }
   else
     {
     document.WeightCustMainForm.bRates.value = "EDIT WEIGHT RATES"
     document.iWeightRate.location.href = "/owa_dba/plsql/web_customerrates.WeightCustRateTableLoad?vSID=" + vSID + "&vCarrierRecID=" + vCarrierRecID + "&vRateName=" + vRateName + "&pUseReturn=1&pColumn=0";	
     }
   }

function SubmitCartonZoneCustReturn()
   {
   vSID = document.ZoneCartonCustMainForm.vSID.value;
   vCarrierRecID = document.ZoneCartonCustMainForm.vCarrierRecID.value;
   vRateName = document.ZoneCartonCustMainFormParam.vRateName.value;
   if (document.ZoneCartonCustMainForm.bRates.value == "EDIT CARTON ZONE RATES")
     {
     document.ZoneCartonCustMainForm.bRates.value = "EDIT WEEKEND RATES"
     document.iZoneCartonRate.location.href = "/owa_dba/plsql/web_customerrates.ZoneCartonCustRateTableLoad?vSID=" + vSID + "&vCarrierRecID=" + vCarrierRecID + "&vRateName=" + vRateName + "&pUseReturn=0&pColumn=0";	
     }
   else
     {
     document.ZoneCartonCustMainForm.bRates.value = "EDIT CARTON ZONE RATES"
     document.iZoneCartonRate.location.href = "/owa_dba/plsql/web_customerrates.ZoneCartonCustRateTableLoad?vSID=" + vSID + "&vCarrierRecID=" + vCarrierRecID + "&vRateName=" + vRateName + "&pUseReturn=1&pColumn=0";	
     }
   }

function SubmitZoneCustRateReturn()
   {
   vSID = document.ZoneCustMainForm.vSID.value;
   vCarrierRecID = document.ZoneCustMainForm.vCarrierRecID.value;
   vRateName = document.ZoneCustMainFormParam.vRateName.value;
   if (document.ZoneCustMainForm.bRates.value == "EDIT ZONE RATES")
     {
     document.ZoneCustMainForm.bRates.value = "EDIT RETURN RATES"
     document.iZoneRate.location.href = "/owa_dba/plsql/web_customerrates.ZoneCustRateTableLoad?vSID=" + vSID + "&vCarrierRecID=" + vCarrierRecID + "&vRateName=" + vRateName + "&pUseReturn=0&pColumn=0";	
     }
   else
     {
     document.ZoneCustMainForm.bRates.value = "EDIT ZONE RATES"
     document.iZoneRate.location.href = "/owa_dba/plsql/web_customerrates.ZoneCustRateTableLoad?vSID=" + vSID + "&vCarrierRecID=" + vCarrierRecID + "&vRateName=" + vRateName + "&pUseReturn=1&pColumn=0";	
     }
   }


function SubmitCustomerTab3(vURL, vNextTab)
   {
   vOptionIndex = document.DiscountSelectForm.vDiscountType.selectedIndex;
   vActiveFormName=document.DiscountSelectForm.vDiscountType.options[vOptionIndex].value;

   if (vActiveFormName == "global")
      {
      document.GlobalCustEditForm.vNextTab.value = vNextTab;
      document.GlobalCustEditForm.action = vURL;
      document.GlobalCustEditForm.submit();
      }
   else if (vActiveFormName == "sliding")
      {
      document.SlidingCustEditForm.vNextTab.value = vNextTab;
      document.SlidingCustEditForm.action = vURL;
      document.SlidingCustEditForm.submit();
      }
   else
      {
      document.DiscountSelectForm.vNextTab.value = vNextTab;
      document.DiscountSelectForm.action = vURL;
      document.DiscountSelectForm.submit();
      }
   }

function SubmitCustomerTab5(vURL, vNextTab)
   {
   vOptionIndex = document.TypeSelectForm.vType.selectedIndex;
   vActiveFormName=document.TypeSelectForm.vType.options[vOptionIndex].value;

    if (vActiveFormName == "StoreID")
      {
      document.StoreSelectForm.vNextTab.value = vNextTab;
      document.StoreSelectForm.action = vURL;
      document.StoreSelectForm.submit();
      }
   else if (vActiveFormName == "Control#")
      {
      document.ControlSelectForm.vNextTab.value = vNextTab;
      document.ControlSelectForm.action = vURL;
      document.ControlSelectForm.submit();
      }
   else
      {
      document.TypeSelectForm.vNextTab.value = vNextTab;
      document.TypeSelectForm.action = vURL;
      document.TypeSelectForm.submit();
      }
   }

function SubmitCustomerEdits(vSID)
   {
   vOptionIndex = document.DiscountSelectForm.vDiscountType.selectedIndex;
   vActiveFormName = document.DiscountSelectForm.vDiscountType.options[vOptionIndex].value;
   vURL = "/owa_dba/plsql/web_customers.SubmitCustomers3";

   if (document.DiscountSelectForm.vCustRecID == "0")
      vURL = "/owa_dba/plsql/web_customers.SubmitCustomers3";

   if (vActiveFormName == "global")
      {
      document.GlobalCustEditForm.action = vURL;
      document.GlobalCustEditForm.submit();
      }
   else if (vActiveFormName == "sliding")
      {
      document.SlidingCustEditForm.action = vURL;
      document.SlidingCustEditForm.submit();
      }
   else
      {
      document.DiscountSelectForm.action = vURL;
      document.DiscountSelectForm.submit();
      }

   }
function SubmitCustomer5Edits(vSID)
   {
   vOptionIndex = document.TypeSelectForm.vType.selectedIndex;
   vActiveFormName = document.TypeSelectForm.vType.options[vOptionIndex].value;
   vURL = "/owa_dba/plsql/web_customers.SubmitCustomers5";

   if (document.TypeSelectForm.vCustRecID == "0")
      vURL = "/owa_dba/plsql/web_customers.AddNewCustomerResults";

   if (vActiveFormName == "StoreID")
      {
      document.StoreSelectForm.action = vURL;
      document.StoreSelectForm.submit();
      }
   else if (vActiveFormName == "Control#")
      {
      document.ControlSelectForm.action = vURL;
      document.ControlSelectForm.submit();
      }
   else
      {
      document.TypeSelectForm.action = vURL;
      document.TypeSelectForm.submit();
      }

   }
function SubmitZipRateTableChange(vRow)
   {
   document.ZipRateForm.pNextRow.value = vRow;
   document.ZipRateForm.submit();
   }
function SubmitZoneWeightRateTableChange(vRow)
   {
   document.ZoneWeightRateForm.pNextRow.value = vRow;
   document.ZoneWeightRateForm.submit();
   }
function SubmitZoneWeightCustRateTableChange(vRow)
   {
   document.ZoneWeightCustRateForm.pNextRow.value = vRow;
   document.ZoneWeightCustRateForm.submit();
   }
function SubmitZoneRateTableChange(vRow)
   {
   document.ZoneRateForm.vNextRow.value = vRow;
   document.ZoneRateForm.submit();
   }
function SubmitWeightRateTableChange(vRow)
   {
   document.WeightRateForm.vNextRow.value = vRow;
   document.WeightRateForm.submit();
   }
function SubmitZoneCartonRateTableChange(vRow)
   {
   document.ZoneCartonRateForm.vNextRow.value = vRow;
   document.ZoneCartonRateForm.submit();
   }
function SubmitZipCustRateTableChange(vRow)
   {
   document.ZipCustRateForm.pNextRow.value = vRow;
   document.ZipCustRateForm.submit();
   }
function SubmitZoneCustRateTableChange(vRow)
   {
   document.ZoneRateForm.vNextRow.value = vRow;
   document.ZoneRateForm.submit();
   }
function SubmitWeightCustRateTableChange(vRow)
   {
   document.WeightRateForm.vNextRow.value = vRow;
   document.WeightRateForm.submit();
   }
function SubmitZoneCartonCustRateTableChange(vRow)
   {
   document.ZoneCartonRateForm.vNextRow.value = vRow;
   document.ZoneCartonRateForm.submit();
   }
function SubmitPalletRateCustTableChange(vRow)
   {
   document.PalletRateForm.vNextRow.value = vRow;
   document.PalletRateForm.submit();
   }
function SubmitStoresDeliveredChange(vRow)
   {
   document.CarrierForm.vNextRow.value = vRow;
   document.CarrierForm.submit();
   }

function SubmitCarrierChange(vRow)
   {
   document.CarrierForm.vNextRow.value = vRow;
   document.CarrierForm.submit();
   }

function SaveCarrierChanges()
  {
  parent.iCustRateType.LoadRatesForm.action = "/owa_dba/plsql/web_customers.Save_CarrierChanges";
  parent.iCustRateType.LoadRatesForm.submit();
  }

function SaveWeightMinChanges()
  {
  document.LoadMinRatesForm.action = "/owa_dba/plsql/web_carrierrates.Save_MinWeights";
  document.LoadMinRatesForm.submit();
  }

function SaveWeightMinCustChanges()
  {
  document.LoadMinCustRatesForm.action = "/owa_dba/plsql/web_customerrates.Save_MinCustWeights";
  document.LoadMinCustRatesForm.submit();
  }

function CarrierDropdownBox()
   {
   vSID = document.SlidingCustEditForm.vSID.value;
   vCarrierID = document.SlidingCustEditForm.vSlidingDiscCarriers.options[document.SlidingCustEditForm.vSlidingDiscCarriers.selectedIndex].value;
   document.fltCarrier.location.href = "/owa_dba/plsql/web_customers.LoadCarrierDiscounts?pSID=" + vSID + "&pCarrierID=" + vCarrierID + "&pColumn=0";
   }

function SubmitMultiAddStores()
   {
    document.CarriersEditForm.action="/owa_dba/plsql/web_carriers.MultiAddStores";
    document.CarriersEditForm.submit();
   }
function SubmitQueryStores()
   {
    document.CarriersEditForm.action="/owa_dba/plsql/web_carriers.QueryStores";
    document.CarriersEditForm.submit();
   }

function SelectReport()
   {
   document.location = 
      document.RptForm.RptList.options[document.RptForm.RptList.selectedIndex].value;
   }

function UpdateExceptionReport(reportnumber)
   {
   vSID = document.DataForm.vSID.value;
   vMBOLRecID = document.DataForm.vMBOLRecID.value;
   vBegin = document.DataForm.vStartScan.options[document.DataForm.vStartScan.selectedIndex].value;
   vEnd   = document.DataForm.vEndScan.options[document.DataForm.vEndScan.selectedIndex].value;
   if (reportnumber == 1)
    {
   	document.location = "/owa_dba/plsql/web_exceptionreport.ExceptionReportSummary?vSID=" +
                       vSID + '&vMBOLRecID=' + vMBOLRecID + "&vStartScan=" + vBegin +
                       "&vEndScan=" + vEnd;
     }                   
    else 
     {
     	document.location = "/owa_dba/plsql/web_exceptionreport.ExceptionReportDetail?vSID=" +
                       vSID + '&vMBOLRecID=' + vMBOLRecID + "&vStartScan=" + vBegin +
                       "&vEndScan=" + vEnd;	
     }	
   }

function GotoSummaryReport()
   {
   vSID = parent.pframe.DataForm.vSID.value;
   vMBOLRecID = parent.pframe.DataForm.vMBOLRecID.value;
   vBegin = parent.pframe.DataForm.vStartScan.options[parent.pframe.DataForm.vStartScan.selectedIndex].value;
   vEnd   = parent.pframe.DataForm.vEndScan.options[parent.pframe.DataForm.vEndScan.selectedIndex].value;

   parent.location = "/owa_dba/plsql/web_exceptionreport.ShowExceptionReportSummary?vSID=" +
                       vSID + '&vMBOLRecID=' + vMBOLRecID + "&vStartScan=" + vBegin +
                       "&vEndScan=" + vEnd;
   }

function GotoSummaryReport2()
   {
   vSID = parent.pframe.DataForm.vSID.value;
   vMBOLRecID = parent.pframe.DataForm.vMBOLRecID.value;
   vStart = parent.pframe.DataForm.vStartScan.value;
   vEnd = parent.pframe.DataForm.vEndScan.value;

   parent.location = "/owa_dba/plsql/web_exceptionreport.ShowExceptionReportSummary?vSID=" +
                       vSID + '&vMBOLRecID=' + vMBOLRecID + "&vStartScan=" + vStart + "&vEndScan=" + vEnd;
   }

function GotoDetailedReport()
   {
   vSID = parent.pframe.DataForm.vSID.value;
   vMBOLRecID = parent.pframe.DataForm.vMBOLRecID.value;
   vBegin = parent.pframe.DataForm.vStartScan.options[parent.pframe.DataForm.vStartScan.selectedIndex].value;
   vEnd   = parent.pframe.DataForm.vEndScan.options[parent.pframe.DataForm.vEndScan.selectedIndex].value;

   parent.location = "/owa_dba/plsql/web_exceptionreport.ShowExceptionReportDetail?vSID=" +
                       vSID + '&vMBOLRecID=' + vMBOLRecID + "&vStartScan=" + vBegin +
                       "&vEndScan=" + vEnd;
   }

function GotoDetailedReport2() 
   {
   vSID = parent.pframe.DataForm.vSID.value;
   vMBOLRecID = parent.pframe.DataForm.vMBOLRecID.value;
   vStart = parent.pframe.DataForm.vStartScan.value;
   vEnd = parent.pframe.DataForm.vEndScan.value;

   parent.location = "/owa_dba/plsql/web_exceptionreport.ShowExceptionReportDetail?vSID=" +
                       vSID + '&vMBOLRecID=' + vMBOLRecID + "&vStartScan=" + vStart + "&vEndScan=" + vEnd;
   }

function GotoReconciledReport()
   {
   vSID = parent.pframe.DataForm.vSID.value;
   vMBOLRecID = parent.pframe.DataForm.vMBOLRecID.value;
   vBegin = parent.pframe.DataForm.vStartScan.options[parent.pframe.DataForm.vStartScan.selectedIndex].value;
   vEnd   = parent.pframe.DataForm.vEndScan.options[parent.pframe.DataForm.vEndScan.selectedIndex].value;

   parent.location = "/owa_dba/plsql/web_exceptionreport.ShowExceptionReportReconciled?vSID=" +
                       vSID + '&vMBOLRecID=' + vMBOLRecID + "&vStartScan=" + vBegin +
                       "&vEndScan=" + vEnd;
   }

function GotoReconciledReport2()
   {
   vSID = parent.pframe.DataForm.vSID.value;
   vMBOLRecID = parent.pframe.DataForm.vMBOLRecID.value;
   vBegin = "OD";
   vEnd   = "OB";
   parent.location = "/owa_dba/plsql/web_exceptionreport.ShowExceptionReportReconciled?vSID=" +
                       vSID + '&vMBOLRecID=' + vMBOLRecID + "&vStartScan=" + vBegin +
                       "&vEndScan=" + vEnd;
   }

function GotoDeliveryComment()
   {
   vSID = parent.pframe.DataForm.vSID.value;
   vMBOLRecID = parent.pframe.DataForm.vMBOLRecID.value;

   parent.location = "/owa_dba/plsql/web_servicereport.ShowComment?vSID=" +
                       vSID + '&vMBOLRecID=' + vMBOLRecID;
   }

function GotoIBOSD()
   {
   vSID = parent.pframe.DataForm.vSID.value;
   vMBOLRecID = parent.pframe.DataForm.vMBOLRecID.value; 

   parent.location = "/owa_dba/plsql/web_exceptionreport.showexceptionreportsummary?vSID=" +
                       vSID + '&vMBOLRecID=' + vMBOLRecID + '&vStartScan=OD&vEndScan=OB';
   }

function GotoDelOSD()
   {
   vSID = parent.pframe.DataForm.vSID.value;
   vMBOLRecID = parent.pframe.DataForm.vMBOLRecID.value;

   parent.location = "/owa_dba/plsql/web_exceptionreport.showexceptionreportsummary?vSID=" +
                       vSID + '&vMBOLRecID=' + vMBOLRecID + '&vStartScan=OB&vEndScan=IS';
   }

function ChangeStoreHistory()
   {
   vSID = document.StoreHistoryForm.vSID.value;
   vBOLRecID = document.StoreHistoryForm.vBOLRecID.value;
   vScanType = document.StoreHistoryForm.vScanType.options[document.StoreHistoryForm.vScanType.selectedIndex].value;

   document.location = "/owa_dba/plsql/web_storereport.StoreHistory?vSID=" +
                       vSID + '&vBOLRecID=' + vBOLRecID + "&vScanType=" + vScanType;
   }

function ChangeServiceReport()
   {
   vSID = document.ServiceForm.vSID.value;
   vMBOLRecID = document.ServiceForm.vMBOLRecID.value;
   vShipType = document.ServiceForm.vShipType.options[document.ServiceForm.vShipType.selectedIndex].value;

   document.location = "/owa_dba/plsql/web_servicereport.ServiceReport?vSID=" +
                       vSID + '&vMBOLRecID=' + vMBOLRecID + "&vShipType=" + vShipType;
   }

function SubmitStoresDeliveredCopy()
{
document.CopyResultsForm.submit();
}

function SubmitDeficitWt()
  {
    vSID = document.ZipRateMainForm.vSID.value;
    vCarrierRecID = document.ZipRateMainForm.vCarrierRecID.value;
    vUseReturn = 0;
    if (document.ZipRateMainForm.vUseReturnRates.value == "YES")
    {
      if (document.ZipRateMainForm.bRates.value == "EDIT ZIP RATES")
      {
        vUseReturn = 1;
      }
      else
      {
        vUseReturn = 0;
      }
    }
    document.iZipRate.location = "/owa_dba/plsql/web_carrierrates.CalculateDeficitWeight?vSID=" + vSID + 
		"&vCarrierRecID=" + vCarrierRecID + 
		"&vUseReturn=" + vUseReturn +
		"&vTable=1";
  }
function SubmitZoneDeficitWt()
  {
    vSID = document.ZoneWeightRateMainForm.vSID.value;
    vCarrierRecID = document.ZoneWeightRateMainForm.vCarrierRecID.value;
    vUseReturn = 0;
    if (document.ZoneWeightRateMainForm.vUseReturnRates.value == "YES")
    {
      if (document.ZoneWeightRateMainForm.bRates.value == "EDIT ZONE WEIGHT RATES")
      {
        vUseReturn = 1;
      }
      else
      {
        vUseReturn = 0;
      }
    }
    document.iZoneWeightRate.location = "/owa_dba/plsql/web_carrierrates.CalculateDeficitWeight?vSID=" + vSID + 
		"&vCarrierRecID=" + vCarrierRecID + 
		"&vUseReturn=" + vUseReturn +
		"&vTable=0";
  }
function SubmitCustDeficitWt()
  {
    vSID = document.ZipCustRateMainForm.vSID.value;
    vCarrierRecID = document.ZipCustRateMainForm.vCarrierRecID.value;
    vUseReturn = 0;
    if (document.ZipCustRateMainForm.vUseReturnRates.value == 1)
    {
      if (document.ZipCustRateMainForm.bRates.value == "EDIT ZIP RATES")
      {
        vUseReturn = 1;
      }
      else
      {
        vUseReturn = 0;
      }
    }
    document.iZipCustRate.location = "/owa_dba/plsql/web_customerrates.CalculateDeficitWeight?vSID=" + vSID + 
		"&vCarrierRecID=" + vCarrierRecID + 
		"&vUseReturn=" + vUseReturn +
		"&vTable=1";
  }
function SubmitCustZoneDeficitWt()
  {
    vSID = document.ZoneWeightCustRateMainForm.vSID.value;
    vCarrierRecID = document.ZoneWeightCustRateMainForm.vCarrierRecID.value;
    vUseReturn = 0;
    if (document.ZoneWeightCustRateMainForm.vUseReturnRates.value == 1)
    {
      if (document.ZoneWeightCustRateMainForm.bRates.value == "EDIT ZONE WEIGHT RATES")
      {
        vUseReturn = 1;
      }
      else
      {
        vUseReturn = 0;
      }
    }
    document.iZoneWeightCustRate.location = "/owa_dba/plsql/web_Customerrates.CalculateDeficitWeight?vSID=" + vSID + 
		"&vCarrierRecID=" + vCarrierRecID + 
		"&vUseReturn=" + vUseReturn +
		"&vTable=0";
  }
function SubmitArchive()
   {
   document.InvoiceEditForm.action="/owa_dba/plsql/Web_Invoices.ArchiveMbols"
   document.InvoiceEditForm.submit();
   }
function SubmitNameDrop(pTableType, pRateName)
   {
    pCarrierRecID = parent.CarriersEditForm.vCarrierRecID.value;
    	
    if (pTableType==1)
    { 	
       pRateTypeCD = document.CarrierForm.vStoreSRateTypeCd.options[document.CarrierForm.vStoreSRateTypeCd.selectedIndex].value;
       document.NameDrop.location="/owa_dba/plsql/web_carriersloadstores.LoadNameDropDown?pCarrierRecID=" +
             pCarrierRecID + "&pRateTypeCD=" + pRateTypeCD + "&pRateName=" + pRateName + "&pTableType=" + pTableType;
    }
    else
    {
       pRateTypeCD = document.CarrierForm.vStoreCRateTypeCd.options[document.CarrierForm.vStoreCRateTypeCd.selectedIndex].value;
       document.NameDrop2.location="/owa_dba/plsql/web_carriersloadstores.LoadNameDropDown?pCarrierRecID=" +
             pCarrierRecID + "&pRateTypeCD=" + pRateTypeCD + "&pRateName=" + pRateName + "&pTableType=" + pTableType;
  
    }
       
    //   alert("/owa_dba/plsql/web_carriers.LoadNameDropDown?pCarrierRecID=" +
    //             pCarrierRecID + "&pRateTypeCD=" + pRateTypeCD + "&pRateName=" + pRateName + "&pTableType=" + pTableType);
        
   }                                     
function GetChangedName(pTableType)
   {
    if (pTableType==1)
    {
       parent.CarrierForm.vStoreSRateName.value=document.RateNameDropDown.vStoreSRateName.options[document.RateNameDropDown.vStoreSRateName.selectedIndex].value;
    }
    else
    {
        parent.CarrierForm.vStoreCRateName.value=document.RateNameDropDown.vStoreCRateName.options[document.RateNameDropDown.vStoreCRateName.selectedIndex].value;
     }
    }  

function submitToDelete()
   {
   document.SaveForm.action = "/owa_dba/plsql/Web_BaroverChange.BulkDelete"
   document.SaveForm.submit();
   //rm.submit();
}




















