   function Go()
    {  
    if ( document.all["blnhost"].value=="1")
        {              
            document.all["mainform"].action="/";
        }
    }


 function submitAmkReservation(ID,appurl)
  {
       if (ID !='~agent.userid~')  window.location.href=appurl;
	else window.location="/fl";	 
  }

 function show_CMSLabel(ID)
	{
        var obj = document.getElementById(ID);
		if (obj != null) obj.style.display = 'block';
	}
 
  function popUp(URL)
	{
    	 window.open (URL,"mywindow","toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,left=25,top=20,resizable=1,width=800,height=600");       
	}

function RailagentReportpopUP(URL)
	{
    	 window.open (URL,"Report","toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,left=25,top=20,resizable=1,width=640,height=480");       
	}
function wanscript_show_now(mystuff)
	{
			
		var linkbox = document.getElementById(mystuff);		
		
		if ( linkbox.style.display == 'block' ) 
			{
			
		  		for (f = 0; f < document.forms.length; f++)
                {
                var elements = document.forms[f].elements;
                 // looping through all elements on certain form
                    for (e = 0; e < elements.length; e++)
                    {             
                            if (elements[e].type == "select-one")
                            {
                                    elements[e].style.display = 'block';
                            }
                     }
                }
			
				linkbox.style.display = 'none';
			}
            else
            {
                    
                for (f = 0; f < document.forms.length; f++)
                {
                var elements = document.forms[f].elements;
                 // looping through all elements on certain form
                    for (e = 0; e < elements.length; e++)
                    {             
                            if (elements[e].type == "select-one")
                            {
                                    elements[e].style.display = 'none';
                            }
                     }
                }
            	linkbox.style.display = 'block';
			}
	}
	
	function Toggle(item,imgName,Imagepath) 
    {      
       var obj=document.getElementById(item);
       //visible=(obj.style.display!="none")
       visible=(obj.style.display)

       if (visible.length==0) 
       { visible="none";}
     
       var  key=document.getElementById("x" + item);
  
       if (visible == "block") 
       {
         obj.style.display="none";
         document.getElementById(imgName).src=Imagepath +'plus.gif';
         
       } else {
       
          obj.style.display="block";
          document.getElementById(imgName).src=Imagepath +'minus.gif';
       }
    }
	
/* ******************************* Price Grid Submit ******************************* */


    function submitForm(AFF,Ag_id,Type,Pd_id)
    {
        var OrderFormCMSPath;
        OrderFormCMSPath=document.all["OrderFormCMSPath"].value;        
        document.all["AFF"].value = AFF;
        document.all["Ag_id"].value = Ag_id;
        document.all["Type"].value = Type;  
        document.all["Pd_id"].value = Pd_id;        
        document.all["mainform"].method = "Post";
        document.all["mainform"].action= OrderFormCMSPath + "cart/orderformCMS.asp";
        document.all["mainform"].submit();
    }
    
    function submitForm_NoAg_id(AFF,Type,Pd_id)
    {
        var OrderFormCMSPath;
        OrderFormCMSPath=document.all["OrderFormCMSPath"].value;        
        document.all["AFF"].value = AFF;      
        document.all["Type"].value = Type;  
        document.all["Pd_id"].value = Pd_id;        
        document.all["mainform"].method = "Post";
        document.all["mainform"].action= OrderFormCMSPath + "cart/orderformCMS.asp";
        document.all["mainform"].submit();
    }
    
  /* ******************************* End Of Price Grid Submit ******************************* */
    
   
    
    function submitBritForm(CMSOrderFormPath,Class,Price,SPrice,via)
    {     
             
        document.all["Cl"].value = Class;
        document.all["price"].value = Price;
        document.all["SetPrice"].value = SPrice;
        document.all["Via"].value = via;      
        document.all["mainform"].method = "Post";
        document.all["mainform"].action=CMSOrderFormPath + "cart/orderformCMS.asp";  
        document.all["mainform"].submit();
    }
    
	 /********************RailBest submit**********************/
	 
	function submitRailBestForm(OrderFormCMSPath,ag_id,AFF,FromStationName,ToStationName,pd_id,PJourneyType,CL,JDateDY,JDateMN,JDateYR,JTimeHR)
    {     
        document.all["ag_id"].value = ag_id;
        document.all["AFF"].value = AFF;
        document.all["DispStationIntxt"].value = FromStationName;      
        document.all["DispstationOUTtxt"].value = ToStationName;
        document.all["pd_id"].value = pd_id;       
        document.all["JJourneyType"].value = PJourneyType;
        document.all["Cl"].value = CL;
        document.all["DateDY"].value = JDateDY;
        document.all["DateMN"].value = JDateMN;
        document.all["DateYR"].value = JDateYR;
        document.all["JTimeHR"].value = JTimeHR;
        document.all["Type"].value = "rbp2p";        
        document.all["mainform"].method = "Post";
        document.all["mainform"].action=OrderFormCMSPath + "cart/orderformCMS.asp";  
        document.all["mainform"].submit();
    }
    
   
	function submitRailBestForm_NoAg_id(OrderFormCMSPath,AFF,FromStationName,ToStationName,pd_id,PJourneyType,CL,JDateDY,JDateMN,JDateYR,JTimeHR)
    {   
        document.all["AFF"].value = AFF;
        document.all["DispStationIntxt"].value = FromStationName;      
        document.all["DispstationOUTtxt"].value = ToStationName;
        document.all["pd_id"].value = pd_id;       
        document.all["JJourneyType"].value = PJourneyType;
        document.all["Cl"].value = CL;
        document.all["DateDY"].value = JDateDY;
        document.all["DateMN"].value = JDateMN;
        document.all["DateYR"].value = JDateYR;
        document.all["JTimeHR"].value = JTimeHR;
        document.all["Type"].value = "rbp2p";        
        document.all["mainform"].method = "Post";
        document.all["mainform"].action=OrderFormCMSPath + "cart/orderformCMS.asp";  
        document.all["mainform"].submit();
    }
    
     /********************End of RailBest submit**********************/
     
     
     
     
    function submitSwanForm(OrderFormCMSPath,ag_id,AFF,FromStationName,ToStationName,JdateDY,JdateMN,JdateYR,JtimeHR,OdateDY,OdateMN,OdateYR,OtimeHR,NoAdults,NoSeniors,NoYouth,NoChildren,CL,FareType,SwanPass)
    {
      
            document.all["ag_id"].value = ag_id;
            document.all["AFF"].value = AFF;
            document.all["DispStationIntxt"].value = FromStationName;      
            document.all["DispstationOUTtxt"].value = ToStationName;
            document.all["Cl"].value = CL;
            document.all["DateDY"].value = JdateDY;
            document.all["DateMN"].value = JdateMN;
            document.all["DateYR"].value = JdateYR;
            document.all["JTimeHR"].value = JtimeHR;        
            document.all["OTimeMN"].value = "00";
            document.all["RTimeMN"].value = "00";
           
            if (SwanPass == "Railpass")
            {                
                document.all["flexible"].value = "";
                document.all["railpass"].value = SwanPass;
            }   
            else if (SwanPass == "Flexible")
            {              
                document.all["flexible"].value = SwanPass;
                document.all["railpass"].value = "";
            }   
            document.all["RDateDY"].value = OdateDY;
            document.all["RDateMN"].value = OdateMN;
            document.all["RDateYR"].value = OdateYR;
            document.all["HFareType"].value=FareType 
            document.all["RRTimeHR"].value = OtimeHR;
            
            document.all["Adults"].value = NoAdults;
            document.all["Seniors"].value = NoSeniors;
            document.all["Youth"].value = NoYouth;
            document.all["Children"].value = NoChildren;   
           
            document.all["mainform"].method = "Post";
            document.all["mainform"].action=OrderFormCMSPath + "cart/orderformCMS.asp";  
            document.all["mainform"].submit();
    }
    
    function submitSwanForm_NoAg_id(OrderFormCMSPath,AFF,FromStationName,ToStationName,JdateDY,JdateMN,JdateYR,JtimeHR,OdateDY,OdateMN,OdateYR,OtimeHR,NoAdults,NoSeniors,NoYouth,NoChildren,CL,FareType,SwanPass)
    {    
          
            document.all["AFF"].value = AFF;
            document.all["DispStationIntxt"].value = FromStationName;      
            document.all["DispstationOUTtxt"].value = ToStationName;
            document.all["Cl"].value = CL;
            document.all["DateDY"].value = JdateDY;
            document.all["DateMN"].value = JdateMN;
            document.all["DateYR"].value = JdateYR;
            document.all["JTimeHR"].value = JtimeHR;        
            document.all["OTimeMN"].value = "00";
            document.all["RTimeMN"].value = "00";
           
            if (SwanPass == "Railpass")
            {                
                document.all["flexible"].value = "";
                document.all["railpass"].value = SwanPass;
            }   
            else if (SwanPass == "Flexible")
            {              
                document.all["flexible"].value = SwanPass;
                document.all["railpass"].value = "";
            }   
            document.all["RDateDY"].value = OdateDY;
            document.all["RDateMN"].value = OdateMN;
            document.all["RDateYR"].value = OdateYR;
            document.all["HFareType"].value=FareType 
            document.all["RRTimeHR"].value = OtimeHR;
            
            document.all["Adults"].value = NoAdults;
            document.all["Seniors"].value = NoSeniors;
            document.all["Youth"].value = NoYouth;
            document.all["Children"].value = NoChildren;   
           
            document.all["mainform"].method = "Post";
            document.all["mainform"].action=OrderFormCMSPath + "cart/orderformCMS.asp";  
            document.all["mainform"].submit();
    }
     

    /**********************Elgar Submit ************************************/

    function submitElgar(OrderFormCMSPath,ag_id,AFF,FromStationName,ToStationName,JdateDY,JdateMN,JdateYR,JtimeHR,OdateDY,OdateMN,OdateYR,OtimeHR,NoAdults,NoSeniors,NoYouth,NoChildren,CL,FareType,Type,Sessionid,pd_id)
    {
      
            document.all["ag_id"].value = ag_id;
            document.all["AFF"].value = AFF;
            document.all["DispStationIntxt"].value = FromStationName;      
            document.all["DispstationOUTtxt"].value = ToStationName;
            document.all["Cl"].value = CL;
            document.all["DateDY"].value = JdateDY;
            document.all["DateMN"].value = JdateMN;
            document.all["DateYR"].value = JdateYR;
            document.all["JTimeHR"].value = JtimeHR;                               
            document.all["RDateDY"].value = OdateDY;
            document.all["RDateMN"].value = OdateMN;
            document.all["RDateYR"].value = OdateYR;            
            document.all["RRTimeHR"].value = OtimeHR;
            
            document.all["Adults"].value = NoAdults;
            document.all["Seniors"].value = NoSeniors;
            document.all["Youth"].value = NoYouth;
            document.all["Children"].value = NoChildren; 
            document.all["HFareType"].value=FareType 
            
            document.all["Type"].value = Type;
            document.all["Sessionid"].value = Sessionid;
            document.all["pd_id"].value = pd_id;    
           
            document.all["mainform"].method = "Post";
            document.all["mainform"].action=OrderFormCMSPath + "cart/orderformCMS.asp";  
            document.all["mainform"].submit();
    }
    
    function submitElgar_NoAg_id(OrderFormCMSPath,AFF,FromStationName,ToStationName,JdateDY,JdateMN,JdateYR,JtimeHR,OdateDY,OdateMN,OdateYR,OtimeHR,NoAdults,NoSeniors,NoYouth,NoChildren,CL,FareType,Type,Sessionid,pd_id)
     {    
           
            document.all["AFF"].value = AFF;
            document.all["DispStationIntxt"].value = FromStationName;      
            document.all["DispstationOUTtxt"].value = ToStationName;
            document.all["Cl"].value = CL;
            document.all["DateDY"].value = JdateDY;
            document.all["DateMN"].value = JdateMN;
            document.all["DateYR"].value = JdateYR;
            document.all["JTimeHR"].value = JtimeHR;                               
            document.all["RDateDY"].value = OdateDY;
            document.all["RDateMN"].value = OdateMN;
            document.all["RDateYR"].value = OdateYR;            
            document.all["RRTimeHR"].value = OtimeHR;
            
            document.all["Adults"].value = NoAdults;
            document.all["Seniors"].value = NoSeniors;
            document.all["Youth"].value = NoYouth;
            document.all["Children"].value = NoChildren; 
            document.all["HFareType"].value=FareType 
            
            document.all["Type"].value = Type;
            document.all["Sessionid"].value = Sessionid;
            document.all["pd_id"].value = pd_id;    
           
            document.all["mainform"].method = "Post";
            document.all["mainform"].action=OrderFormCMSPath + "cart/orderformCMS.asp";  
            document.all["mainform"].submit();
    }
    
        /*******************End of Elgar Submit ************************************/
    
    
    
     /*******************TainTickets Submit ************************************/
    
    function submitForm_traintickets(Fcity,Tcity,trainticketsURL)
    {
        document.all["Fcity1"].value = Fcity;         
        document.all["Tcity1"].value = Tcity;     
        document.all["mainform"].method = "Post";
        document.all["mainform"].action=trainticketsURL;
        document.all["mainform"].submit();
    }        
    
    /*******************End of TainTickets Submit ************************************/
    
    
    
    /*******************RailPasses Submit ************************************/
     function submitForm_RaiPasses(AFF,Type)
    {
    
        var OrderFormCMSPath;
        OrderFormCMSPath=document.all["OrderFormCMSPath_RailPasses"].value;          
        document.all["AFF"].value = AFF;
        document.all["Type"].value = Type;                         
        document.all["mainform"].method = "Post";
        document.all["mainform"].action=OrderFormCMSPath + "cart/orderformCMS.asp";        
        document.all["mainform"].submit();
    }   
    function submitP2PForm_RaiPasses(HostName,AFF,Type,P2PPage)
    {       
        document.all["Type"].value = Type;         
        document.all["mainform"].method = "Post";
        document.all["mainform"].action="http://" + HostName + "/P2PPages/" + AFF + "/" + P2PPage;            
        document.all["mainform"].submit();        
    }
        
    /*******************End of RailPasses Submit ************************************/
	
    

   
