﻿var dom=getObj

  function getObj(objID) 
	{
	    if (document.getElementById)
	    {
	        if (document.getElementById(objID)==null)
	        objID="ctl00_cphContent_"+objID;
	        
	        return document.getElementById(objID)
	    }
	    else if (document.all)
	    {
	        if (document.all(objID)==null)
	        objID="ctl00_cphContent_"+objID;
	        
	        return document.all[objID];
	    }
	    else if (document.layers)
	    {
	        if (document.layers(objID)==null)
	        objID="ctl00_cphContent_"+objID;
	        	    
	        return document.layers[objID];
	    }
	}

function BookHotel(){

var fmonth = getObj("arrivalMonthYear").value.substring(4,6);
        var tmonth = getObj("departureMonthYear").value.substring(4,6);
        if (fmonth.substring(0,1) == "0"){
			
            fmonth = fmonth.substring(1,2);			
         }
         fmonth = parseFloat(fmonth)+1;
        
        if (tmonth.substring(0,1) == "0"){
           tmonth = tmonth.substring(1,2);		  
         }
          tmonth = parseFloat(tmonth)+1;
		
	
	
	iRet = window.open("http://www.travelodge.com/Travelodge/control/Booking/modify_dates?areaCode=&brandCode=TL,RA,DI,BU,MT,HJ,SE,KG,WG,WY,BH"+
	"&searchWithinMiles=50"+
	"&areaType=3"+
	"&destination=Chilliwack, British Columbia, CANADA&state=British Columbia&country=CANADA"+
	"&checkInDate="+ fmonth +"/"+getObj("arrivalDay").value+
	"&numberAdults="+getObj("nadult").value+
	"&numberRooms="+getObj("rooms").value+
	"&checkOutDate="+ tmonth +"/"+getObj("departureDay").value+
	"&numberChildren="+getObj("nchild").value+
	"&numberBigChildren="+getObj("bigchild").value+
	"&rate="+getObj("srp").value+
	"&useWRPoints=false"+
	"&corporateCode="+
	"&variant="+
	"&id=09758"+
	"&propBrandId=TL"+
	"&force_nostay=false"+
	"&tab=tab1" );	
		
		

}

function setMenu(menuId)
{
	document.getElementById(menuId).id="current";
}


