
		var obj_ddlRooms;
		var obj_ddlChildrens1;
		var obj_ddlChildrens2;
		var obj_ddlChildrens3;

		var SI_Child1;
		var SI_Child2;
		var SI_Child3;		 
		
		var obj_TD_ddlChild1Room1;
		var obj_TD_ddlChild2Room1;

		var obj_TD_ddlChild1Room2;
		var obj_TD_ddlChild2Room2;

		var obj_TD_ddlChild1Room3;
		var obj_TD_ddlChild2Room3;

		var objDD;

		var obj_ddlChildrens2;
		var obj_ddlChildrens1;

		var MaxSelectedIndex;
		
		//Variables used in GetReedemSearchBoxControlsValues() function.
		var sRoom1Child1Age="0";
	    var sRoom1Child2Age="0";
	    var sRoom2Child1Age="0";
	    var sRoom2Child2Age="0";
	    var sRoom2Adults="0";
	    var sRoom2Children="0";
	    var sRoom3Adults="0";
	    var sRoom3Children="0";
	    var sRoom3Child1Age="0";
	    var sRoom3Child2Age="0";

		function GetMaxSelectedIndexFor_ddlChildrens()
		{
				obj_ddlRooms=window.document.getElementById("ddlRooms");
				obj_ddlChildrens1=window.document.getElementById("ddlChildrens1");
				obj_ddlChildrens2=window.document.getElementById("ddlChildrens2");
				obj_ddlChildrens3=window.document.getElementById("ddlChildrens3");
				
				SI_Child1=parseInt(obj_ddlChildrens1.selectedIndex);
				SI_Child2=parseInt(obj_ddlChildrens2.selectedIndex);
				SI_Child3=parseInt(obj_ddlChildrens3.selectedIndex);
				
				if (obj_ddlRooms.selectedIndex=="0")
				{
						return window.document.getElementById("ddlChildrens1").selectedIndex;
				}

				if (obj_ddlRooms.selectedIndex =="1")
				{
						if ( SI_Child1 > SI_Child2 )
						{
								return obj_ddlChildrens1.selectedIndex;
						}
						
						if (SI_Child2 > SI_Child1 ) 
						{
								return obj_ddlChildrens2.selectedIndex;
						}
						return obj_ddlChildrens2.selectedIndex;
									
				}	
				
				if (obj_ddlRooms.selectedIndex=="2")
				{
						if (SI_Child1 > SI_Child2 ) 
						{
								if (SI_Child1 > SI_Child3 ) 
								{
										return obj_ddlChildrens1.selectedIndex;
								}
								if (SI_Child1 = SI_Child3 ) 
								{
										return obj_ddlChildrens1.selectedIndex;
								}								
						}
						
						if (SI_Child2 > SI_Child3 ) 
						{
								if (SI_Child2 > SI_Child1 ) 
								{
										return obj_ddlChildrens2.selectedIndex;
								}
								if (SI_Child2 = SI_Child1 ) 
								{
										return obj_ddlChildrens2.selectedIndex;
								}								
						}
						
						if (SI_Child3 > SI_Child1 ) 
						{
								if (SI_Child3 > SI_Child2 ) 
								{
										return obj_ddlChildrens3.selectedIndex;
								}
								if (SI_Child3 = SI_Child2 ) 
								{
										return obj_ddlChildrens3.selectedIndex;
								}								
								
						}
						
						if (SI_Child1 = SI_Child2 ) 
						{
								if (SI_Child1 > SI_Child3 ) 
								{
										return obj_ddlChildrens1.selectedIndex;
								}
								if (SI_Child3 > SI_Child1 ) 
								{
										return obj_ddlChildrens3.selectedIndex;
								}
								
						}
						if (SI_Child2 = SI_Child3 ) 
						{
								if (SI_Child2 > SI_Child1 ) 
								{
										return obj_ddlChildrens2.selectedIndex;
								}
								if (SI_Child1 > SI_Child2 ) 
								{
										return obj_ddlChildrens1.selectedIndex;
								}
						}
						
						if (SI_Child3 = SI_Child1 ) 
						{
								if (SI_Child3 > SI_Child1 ) 
								{
										return obj_ddlChildrens3.selectedIndex;
								}
								if (SI_Child1 > SI_Child3 ) 
								{
									return obj_ddlChildrens1.selectedIndex;
								}
						}
						
							return obj_ddlChildrens1.selectedIndex;
			
				} 

		} 

		function ToggleVisibility_ddlChildrens1(strSelectedIndex)
		{
				if (strSelectedIndex == "0" )
				{						
						window.document.getElementById("ddlChild1Room1").style.display="none";
						window.document.getElementById("ddlChild2Room1").style.display="none";						
						
						window.document.getElementById("ddlChild1Room2").style.display="none";
						window.document.getElementById("ddlChild2Room2").style.display="none";
												
						window.document.getElementById("ddlChild1Room3").style.display="none";
						window.document.getElementById("ddlChild2Room3").style.display="none";							
				}

				if (strSelectedIndex == "1" )
				{						
						window.document.getElementById("ddlChild1Room1").style.display="block";
						window.document.getElementById("ddlChild2Room1").style.display="none";	
												
						window.document.getElementById("ddlChild1Room2").style.display="none";
						window.document.getElementById("ddlChild2Room2").style.display="none";
												
						window.document.getElementById("ddlChild1Room3").style.display="none";
						window.document.getElementById("ddlChild2Room3").style.display="none";							
				}

				if (strSelectedIndex == "2" )
				{						
						window.document.getElementById("ddlChild1Room1").style.display="block";
						window.document.getElementById("ddlChild2Room1").style.display="block";	
												
						window.document.getElementById("ddlChild1Room2").style.display="none";
						window.document.getElementById("ddlChild2Room2").style.display="none";
												
						window.document.getElementById("ddlChild1Room3").style.display="none";
						window.document.getElementById("ddlChild2Room3").style.display="none";	
				}						
		} //function ToggleVisibility_ddlChildrens1(strSelectedIndex)

		function ToggleVisibility_ddlChildrens2(strSelectedIndex)
		{
				if (strSelectedIndex == "0" )
				{						
						window.document.getElementById("ddlChild1Room2").style.display="none";
						window.document.getElementById("ddlChild2Room2").style.display="none";
												
						window.document.getElementById("ddlChild1Room3").style.display="none";
						window.document.getElementById("ddlChild2Room3").style.display="none";	
				}

				if (strSelectedIndex == "1" )
				{						
						window.document.getElementById("ddlChild1Room2").style.display="block";
						window.document.getElementById("ddlChild2Room2").style.display="none";
												
						window.document.getElementById("ddlChild1Room3").style.display="none";
						window.document.getElementById("ddlChild2Room3").style.display="none";	
				}

				if (strSelectedIndex == "2" )
				{						
						window.document.getElementById("ddlChild1Room2").style.display="block";
						window.document.getElementById("ddlChild2Room2").style.display="block";
												
						window.document.getElementById("ddlChild1Room3").style.display="none";
						window.document.getElementById("ddlChild2Room3").style.display="none";	
				}						
		} //function ToggleVisibility_ddlChildrens2(strSelectedIndex)

		function ToggleVisibility_ddlChildrens3(strSelectedIndex)
		{
				if (strSelectedIndex == "0" )
				{						
						window.document.getElementById("ddlChild1Room3").style.display="none";
						window.document.getElementById("ddlChild2Room3").style.display="none";	
				}

				if (strSelectedIndex == "1" )
				{						
						window.document.getElementById("ddlChild1Room3").style.display="block";
						window.document.getElementById("ddlChild2Room3").style.display="none";	
				}

				if (strSelectedIndex == "2" )
				{						
						window.document.getElementById("ddlChild1Room3").style.display="block";
						window.document.getElementById("ddlChild2Room3").style.display="block";	
				}						
		} //function ToggleVisibility_ddlChildrens3(strSelectedIndex)			

		function ToggleVisibility_AllCell_ChildrenRooms_Room1(strFlagCell1,strFlagCell2,strFlagCell3)
		{
		
		obj_TD_ddlChild1Room1 = window.document.getElementById("ddlChild1Room1");
		obj_TD_ddlChild2Room1 = window.document.getElementById("ddlChild2Room1");

		//----------------------------------------------------------
		if (strFlagCell2 == "ON")
		{
		obj_TD_ddlChild1Room1.style.display="block";			
		}
		else (strFlagCell2 == "OFF")
		{
		obj_TD_ddlChild1Room1.style.display="none";			
		}

		//----------------------------------------------------------
		if (strFlagCell3 == "ON")
		{
		obj_TD_ddlChild2Room1.style.display="block";			
		}
		else (strFlagCell3 == "OFF")
		{
		obj_TD_ddlChild2Room1.style.display="none";			
		}				
		}

		function ToggleVisibility_AllCell_ChildrenRooms_Room2(strFlagCell1,strFlagCell2,strFlagCell3)
		{
		
		obj_TD_ddlChild1Room2 = window.document.getElementById("ddlChild1Room2");
		obj_TD_ddlChild2Room2 = window.document.getElementById("ddlChild2Room2");

		//----------------------------------------------------------
		if (strFlagCell2 =="ON")
		{
		obj_TD_ddlChild1Room2.style.display="block";			
		}
		else (strFlagCell2 =="OFF")
		{
		obj_TD_ddlChild1Room2.style.display="none";			
		}

		//----------------------------------------------------------
		if (strFlagCell3 =="ON")
		{
		obj_TD_ddlChild2Room2.style.display="block";			
		}
		else (strFlagCell3 =="OFF")
		{
		obj_TD_ddlChild2Room2.style.display="none";			
		}

		}

		function ToggleVisibility_AllCell_ChildrenRooms_Room3(strFlagCell1,strFlagCell2,strFlagCell3)
		{
				
		obj_TD_ddlChild1Room3 = window.document.getElementById("ddlChild1Room3");
		obj_TD_ddlChild2Room3 = window.document.getElementById("ddlChild2Room3");
		
		//----------------------------------------------------------
		if (strFlagCell2 =="ON")
		{
		obj_TD_ddlChild1Room3.style.display="block";			
		}
		else (strFlagCell2 =="OFF")
		{
		obj_TD_ddlChild1Room3.style.display="none";			
		}

		//----------------------------------------------------------
		if (strFlagCell3 =="ON")
		{
		obj_TD_ddlChild2Room3.style.display="block";			
		}
		else (strFlagCell3 =="OFF")
		{
		obj_TD_ddlChild2Room3.style.display="none";			
		}

		}
		
		function ToggleVisibility_Rooms3()
		{
				MaxSelectedIndex =GetMaxSelectedIndexFor_ddlChildrens();
								
				objDD = window.document.getElementById("ddlChildrens3");
				if(objDD.selectedIndex == "0")
				{						
						window.document.getElementById("ddlChild1Room3").style.display="none";
						window.document.getElementById("ddlChild2Room3").style.display="none";				
				}
				
				if(objDD.selectedIndex == "1") 		
				{						
						window.document.getElementById("ddlChild1Room3").style.display="block";
						window.document.getElementById("ddlChild2Room3").style.display="none";				
			
				}	//if(objDD.selectedIndex == "1") 

				if(objDD.selectedIndex == "2") 		
				{						
						window.document.getElementById("ddlChild1Room3").style.display="block";
						window.document.getElementById("ddlChild2Room3").style.display="block";					

				}	//if(objDD.selectedIndex == "2") 
							
		}	//function ToggleVisibility_Rooms3()		

		function ToggleVisibility_Rooms2()
		{				
				MaxSelectedIndex =GetMaxSelectedIndexFor_ddlChildrens();
								
				obj_ddlChildrens2 = window.document.getElementById("ddlChildrens2");
				if(obj_ddlChildrens2.selectedIndex == "0") 		
				{						
						window.document.getElementById("ddlChild1Room2").style.display="none";
						window.document.getElementById("ddlChild2Room2").style.display="none";
												
				}

				if(obj_ddlChildrens2.selectedIndex == "1") 		
				{					
						window.document.getElementById("ddlChild1Room2").style.display="block";
						window.document.getElementById("ddlChild2Room2").style.display="none";
				
				} //if(objDD.selectedIndex == "1") 		

				if(obj_ddlChildrens2.selectedIndex == "2") 		
				{					
					window.document.getElementById("ddlChild1Room2").style.display="block";
					window.document.getElementById("ddlChild2Room2").style.display="block";
					
					} //if(objDD.selectedIndex == "2") 		
		}//function ToggleVisibility_Rooms2()	

		function ToggleVisibility_Rooms1()
		{								
				MaxSelectedIndex =GetMaxSelectedIndexFor_ddlChildrens();
								
				objDD = window.document.getElementById("ddlChildrens1");
				
				if(objDD.selectedIndex == "0") 		
				{						
						window.document.getElementById("ddlChild1Room1").style.display="none";
						window.document.getElementById("ddlChild2Room1").style.display="none";
				}

				if(objDD.selectedIndex == "1") 		
				{						
						window.document.getElementById("ddlChild1Room1").style.display="block";
						window.document.getElementById("ddlChild2Room1").style.display="none";
				} //if(objDD.selectedIndex == "1") 

				if(objDD.selectedIndex == "2") 		
				{						
						window.document.getElementById("ddlChild1Room1").style.display="block";
						window.document.getElementById("ddlChild2Room1").style.display="block";
				} //if(objDD.selectedIndex == "2")			
		}

		function ToggleVisibility()
		{
				objDD = window.document.getElementById("ddlRooms");

				if(objDD.selectedIndex == "0") 		
				{
						var ad2 = window.document.getElementById("ddlAdults2");
						var ad3 = window.document.getElementById("ddlAdults3");
						var ch2 = window.document.getElementById("ddlChildrens2");
						
						var Room2Row = window.document.getElementById("room2Row");
						var Room3Row = window.document.getElementById("room3Row");
						
						ad2.style.display="none";
						ad3.style.display="none";
						ch2.style.display="none";
						Room2Row.style.display="none";
						Room3Row.style.display="none";
						
						//++++ 	Control state based on SelectedIndex for ddlChildrens1 ++++
						obj_ddlChildrens1 = window.document.getElementById("ddlChildrens1");
						ToggleVisibility_ddlChildrens1(obj_ddlChildrens1.selectedIndex)
						
				}	//if(objDD.selectedIndex == "0")

				if(objDD.selectedIndex == "1") 		
				{
						
						var ad2 = window.document.getElementById("ddlAdults2");
						var ch2 = window.document.getElementById("ddlChildrens2");
						var Room2Row = window.document.getElementById("room2Row");
						
						ad2.style.display="";
						ch2.style.display="";
						Room2Row.style.display="";
						
						var ad3 = window.document.getElementById("ddlAdults3");
						var ch3 = window.document.getElementById("ddlChildrens3");
						var Room3Row = window.document.getElementById("room3Row");
						
						ad3.style.display="none";
						ch3.style.display="none";
						Room3Row.style.display="none";
						
						//++++ According to the option selected in ddlChildrens2, toggle state ++++
						MaxSelectedIndex = GetMaxSelectedIndexFor_ddlChildrens();
												
						obj_ddlChildrens2 = window.document.getElementById("ddlChildrens2");
						ToggleVisibility_ddlChildrens2(obj_ddlChildrens2.selectedIndex);
						
				}	//if(objDD.selectedIndex == "1")			
				
				if(objDD.selectedIndex== "2") 	
				{
						
						var ad2 = window.document.getElementById("ddlAdults2");
						var ch2 = window.document.getElementById("ddlChildrens2");
						var Room2Row = window.document.getElementById("room2Row");
						
						ad2.style.display="";
						ch2.style.display="";
						Room2Row.style.display="";
						var ad3 = window.document.getElementById("ddlAdults3");
						var ch3 = window.document.getElementById("ddlChildrens3");
						var Room3Row = window.document.getElementById("room3Row");
						
						ad3.style.display="";
						ch3.style.display="";
						Room3Row.style.display="";
						
						//++++ According to the option selected in ddlChildrens2, toggle state ++++
						MaxSelectedIndex =GetMaxSelectedIndexFor_ddlChildrens();
												
						obj_ddlChildrens2 = window.document.getElementById("ddlChildrens2");
						ToggleVisibility_ddlChildrens2(obj_ddlChildrens2.selectedIndex);						
						obj_ddlChildrens3 = window.document.getElementById("ddlChildrens3");
						ToggleVisibility_ddlChildrens3(obj_ddlChildrens3.selectedIndex);
										
				} //if(objDD.selectedIndex=="2") 
		} //ToggleVisibility()
		
		function getCityListOld()
		{
			obj_ddlCountryList = window.document.getElementById("ddlCountryList");
			obj_ddlCityList = window.document.getElementById("ddlCityList");
			obj_ddlCityList.selectedIndex = 0;
			var ccode=obj_ddlCountryList.value;
			
			if (document.implementation && document.implementation.createDocument)
			{
				var xmlHttp = new XMLHttpRequest();
				xmlHttp.open("GET", "GetCityList.aspx?ccode="+ccode, false);
				xmlHttp.send(null);
				var xmlcity = document.implementation.createDocument("", "doc", null);
				xmlcity.load("country.xml");				
				var objcitylist = xmlcity.getElementsByTagName("CD");
				alert(objcitylist.length);
			}
			else if (window.ActiveXObject)
			{
				var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
				xmlHttp.open("GET", "GetCityList.aspx?ccode="+ccode, false)
				xmlHttp.send()			
				var xmlcity = new ActiveXObject("Microsoft.XMLDOM")
				xmlcity.async=false
				xmlcity.loadXML(xmlHttp.responseText)
				var objcitylist = xmlcity.selectNodes("//CD")
			}			
						
			obj_ddlCityList.length = objcitylist.length;			
					
			if (objcitylist.length > 0)
			{			
				for(var i=0;i < objcitylist.length;i++)
				{					
					obj_ddlCityList.options[i].value=objcitylist.item(i).selectSingleNode("C").text;
					obj_ddlCityList.options[i].text=objcitylist.item(i).selectSingleNode("N").text;
				}
			}
		}
		
		function getSelectedCityIDOld()
		{
			obj_ddlCityList1 = window.document.getElementById("ddlCityList");
			obj_hidCityID = window.document.getElementById("hidCityID");			
			obj_hidCityName = window.document.getElementById("hidCityName");			
			obj_hidCityID.value = obj_ddlCityList1.value;			
			obj_hidCityName.value = obj_ddlCityList1.options[obj_ddlCityList1.selectedIndex].text;									
		}
		
		function resetCountryList(){			
			obj_ddlCountryList = window.document.getElementById("ddlCountryList");			
			obj_ddlCountryList.selectedIndex = 0;
		}
		
		function calender(mode)
		{							
			if(navigator.appName.indexOf("Netscape") == -1)
			{
				window.open("PAdminPopUp.aspx?mode="+mode,"cal","width=200,height=180,,top=375,left=795");
			}
			else 
			{
				msgWindow = open("PAdminPopUp.aspx?mode="+mode,"cal","width=200,height=180,,top=375,left=795");
			}					
		}
		
	function setYears(inY,outY)
	{
		if(inY.options.selectedIndex > outY.options.selectedIndex)
		{
			outY.options.selectedIndex = outY.options.selectedIndex + 1;
		}
	}
	
	function amadChange(inM,inD,outM,outD,outY,inY,objNights)
	{	
		if	(!isBrowserSupp())
		    {
		    return;
		    }		
		   setYears(inY,outY);
		var res = adjustDate(inM.options.selectedIndex, inD);
		if (res != 0)
			{
				outD.options.selectedIndex=0;
				
			    if (inM.options.selectedIndex==11)
				{					
					if((outY.options.length -1) == outY.options.selectedIndex)
					{
						alert("Date Out Of Range");
						if(inY.options.selectedIndex !=0)
						{
							inY.options.selectedIndex = inY.options.selectedIndex - 1;
							outM.options.selectedIndex = 0;
						}
						return;
					}
					
					
					outM.options.selectedIndex=0
					outY.options.selectedIndex = outY.options.selectedIndex + 1;
				}
				else
				{
					outM.options.selectedIndex=inM.options.selectedIndex + 1;
				}
			}
		else
		{
		outM.options.selectedIndex = inM.options.selectedIndex;
		outD.options.selectedIndex = inD.options.selectedIndex+1; 
		 }

getNights(inM,inD,outM,outD,outY,inY,objNights); 
return;
}

function amadChanges(inM,inD,outM)
	{	
		if	(!isBrowserSupp())
		    {
		    return;
		    }		
		var res = adjustDate(inM.options.selectedIndex, inD);
return;
}

function adjustDate(mthIdx, Dt)
{
var value=0;

var today = new Date()
var theYear = parseInt(today.getYear(),10)

if (mthIdx < today.getMonth()) {
    theYear = (parseInt(today.getYear(), 10) + 1)
}
if(theYear<100){
    theYear = "19" + theYear
}
else{
    if((theYear-100) < 10){
        theYear = "0" + (theYear-100)
    }
    else{
        theYear = (theYear-100)+""
    }
    theYear = "20" + theYear
}


var numDays=getDaysInMonth(mthIdx, theYear);

if (mthIdx==1)
    {
    if (Dt.options.selectedIndex + 1 < numDays)
        {
        return 0;
        }
    else
        {
        Dt.options.selectedIndex=numDays - 1;
        //check for leap year
        if (numDays==29)
            {
            return 99;
            }
        else
            {
            return 1;
            }
        }
    }
if (Dt.options.selectedIndex + 1 < numDays)
    {
    value=0;
    }
else
    {
    if (Dt.options.selectedIndex + 1 > numDays)
        {
        Dt.options.selectedIndex--;
        value=3;
        }
    else
        {
        //index is 31 or 30
        value=2;
        }
    }
return value;
}


function dmddChange(outM,outD,inM,inD,outY,inY,objNights)
{
if (!isBrowserSupp())
    {
    return;
    }

adjustDate(outM.options.selectedIndex,outD);
if (((outM.options.selectedIndex < inM.options.selectedIndex) && (inM.options.selectedIndex != 11)) || ((outM.options.selectedIndex == inM.options.selectedIndex) && (outD.options.selectedIndex <= inD.options.selectedIndex)))
	{
		amadChange(inM,inD,outM,outD,outY,inY);
	}
getNights(inM,inD,outM,outD,outY,inY,objNights);
return;
}


function getDaysInMonth(mthIdx, YrStr)
{
// all the rest have 31
var maxDays=31
// expect Feb. (of course)
if (mthIdx==1)
    {
    if (isLeapYear(YrStr))
        {
        maxDays=29;
        }
    else
        {
        maxDays=28;
        }
    }
// thirty days hath...
if (mthIdx==3 || mthIdx==5 || mthIdx==8 || mthIdx==10)
    {
    maxDays=30;
    }
return maxDays;
}

function isLeapYear(yrStr)
{
var leapYear=false;
var year = parseInt(yrStr, 10);
// every fourth year is a leap year
if (year%4 == 0)
    {
    leapYear=true;
    // unless it's a multiple of 100
    if (year%100 == 0)
        {
        leapYear=false;
        // unless it's a multiple of 400
        if (year%400 == 0)
            {
            leapYear=true;
            }
        }
    }
return leapYear;
}
function isBrowserSupp() {
    // Get the version of the browser
    version =  parseFloat( navigator.appVersion );

    if ( ( version >= 2.0 ) && ( version < 2.1 ) && ( navigator.appName.indexOf( "Netscape" ) != -1 ) ) {
        return false;
    }
    else {
    return true;
    }

return true;
}

function fromyearchange(ddlfromyear,ddltoyear)
{
	
	if(ddlfromyear.value > ddltoyear.value)
	{
		ddltoyear.value =parseInt(ddltoyear.value) + 1;
	}
	if(ddltoyear < ddlfromyear)
	{
		
	}
}

function toyearchange(ddlfromyear,ddltoyear)
{
	
	if(ddltoyear.value < ddlfromyear.value )
	{
		ddlfromyear.value = parseInt(ddlfromyear.value)- 1;
	}
	
}

function validateSearchForm()
{
	var fromdate;
	var todate;
	var ddlFromYear;
	var ddlFromMonth;
	var ddlFromDay;
	var countryid;
	var cityid;
	var ddlToYear;
	var ddlToMonth;
	var ddlToDay;
	var strErrormsg;
	var bError;
	var objNights;
	bError = 0;
	strErrormsg = ""
	ddlFromYear = window.document.forms[0].ddlCheckINYear;
	ddlFromMonth = window.document.forms[0].ddlCheckINMonth;	
	ddlFromDay = window.document.forms[0].ddlCheckINDate;
					
	ddlToYear = window.document.forms[0].ddlCheckOutYear;
	ddlToMonth = window.document.forms[0].ddlCheckOutMonth;	
	ddlToDay = window.document.forms[0].ddlCheckOutDate;
	
	hotelSearch = window.document.forms[0].ihdHotelSearch.value;
	objNights = window.document.getElementById("lblNumNights");

	if(hotelSearch == 1)
	{
		countryid = window.document.forms[0].ihdCountryID.value;	
		cityid = window.document.forms[0].ihdCityID.value;	
	}
	else
	{
		countryid = window.document.forms[0].ddlCountryList.value;
		cityid = window.document.forms[0].ddlCityList.value;
	}

	fromdate = new Date(ddlFromYear.value,ddlFromMonth.options.selectedIndex,ddlFromDay.value);
	todate = new Date(ddlToYear.value,ddlToMonth.options.selectedIndex,ddlToDay.value);
	
	if(countryid == "")
	{
		strErrormsg = " Please select the Country";
		bError = 1;
	}
	if(cityid == "")
	{
		 strErrormsg = strErrormsg +"\n Please select the City";
		 bError = 1;
	}
	if(bError ==1)
	{
		alert(strErrormsg + "\n    - Please correct the above error(s).");
		return false;
	}
	var currentdate;
	currentdate = new Date();
	if(fromdate < currentdate)
	{
	 alert("invalid date");
	 return false;
	}
	if(!(getNights(ddlFromMonth,ddlFromDay,ddlToMonth,ddlToDay,ddlToYear,ddlFromYear,objNights)))
	{
		return false;
	}	
	
}
var m_iCityId="";
var m_strCityName="";
var m_iCountryId="";
var m_strCountryName="";

function validateHotelSearchForm()
{
	var fromdate;
	var todate;
	var ddlFromYear;
	var ddlFromMonth;
	var ddlFromDay;
	var countryid;
	var cityid;
	var ddlToYear;
	var ddlToMonth;
	var ddlToDay;
	var strErrormsg;
	var bError;
	var objNights;
	var ErrorFlag=0;
		
	bError = 0;
	strErrormsg = ""
	
	var str = location.href;
		str = str.toLowerCase();
		
    if(str.indexOf("hotelprofile") == -1 )
	{
	var txtRegion = window.document.getElementById("txtRegion");
    var	xiCityName = window.document.getElementById("txtRegion").value;
    if(xiCityName == "")
    {
        alert("Please select valid Destination");
        txtRegion.focus();
		return false;
    }
    
    var obj_hidDestination = window.document.getElementById("hidDestination")
    obj_hidDestination.value=xiCityName;
    
    GetCountryDetails(xiCityName);
    if(m_strCityName=="")
	{
	    ErrorFlag=1;
	}
	else
	{
	    obj_hidCityName = window.document.getElementById("hidCityName")
	    if(obj_hidCityName == null)
	     alert("Object not found");
	    obj_hidCityName.value =  m_strCityName;
	}
	if(m_iCityId=="")
	{
	    ErrorFlag=1;
	}
	else
	{
	
	    var obj_hidCityID = window.document.getElementById("hidCityID");
	    obj_hidCityID.value = m_iCityId;
	}
	if(m_strCountryName=="")
	{
	    ErrorFlag=1;
	}
	else
	{	    
    	var obj_hidCountryName = window.document.getElementById("hidCountryName");
	    obj_hidCountryName.value = m_strCountryName;
	}
	if(m_iCountryId=="")
	{
	    ErrorFlag=1;
	}
	else
	{
	    var obj_hidCountryID = window.document.getElementById("hidCountryID");
	    obj_hidCountryID.value = m_iCountryId;
	}
	
	if(ErrorFlag==1)
	{
	    alert("Please select valid Destination");
		return false;
	}
	}	
	ddlFromYear = window.document.forms[0].ddlCheckINYear;
	ddlFromMonth = window.document.forms[0].ddlCheckINMonth;	
	ddlFromDay = window.document.forms[0].ddlCheckINDay;
					
	hotelSearch = window.document.forms[0].ihdHotelSearch.value;

	if(hotelSearch == 1)
	{
		countryid = window.document.forms[0].ihdCountryID.value;	
		cityid = window.document.forms[0].ihdCityID.value;	
	}
	else if(hotelSearch == 2)
	{
		countryid = window.document.forms[0].ihdCountryID.value;	
		cityid = window.document.forms[0].ihdCityID.value;	
	}
	else
	{
	}

	try
	{
		fromdate = new Date(ddlFromYear.value,ddlFromMonth.options.selectedIndex,ddlFromDay.value);

		//Check if the selected day is not present in the selected month then show invalid date msg.
		//For e.g. in February the max day is 29 so, if user select 30 Feb then show invalid date msg.
		if (GetDaysInMonth(ddlFromMonth.options.selectedIndex, ddlFromYear.value) < ddlFromDay.value)
		{
			alert("Invalid Date Selection! Please Check.");
			alert("aa");
			return false
		}
	}
	catch(e)
	{
	    alert("bb");
		alert("Invalid Date Selection! Please Check.");
		return false
	}
	
	if(countryid == "Initial")
	{
		strErrormsg = " Please select the Country";
		bError = 1;
	}
	if(cityid == "Initial")
	{
		 strErrormsg = strErrormsg +"\n Please select the City";
		 bError = 1;
	}
	if(cityid == "")
	{
		 strErrormsg = strErrormsg +"\n Please select the City";
		 bError = 1;
	}
	if(bError == 1)
	{
		alert(strErrormsg + "\n    - Please correct the above error(s).");
		return false;
	}
	var currentdate;
	currentdate = new Date();
	if(fromdate < currentdate)
	{
		alert("Invalid Date Selection! Please Check.");
	   return false;
	}
	
	return true;
}

function GetDaysInMonth(intMonth, intYear)
{
	var dteMonth = new Date(intYear,intMonth);//
	var intDaysInMonth = 28;//the fewest number of days in a month
	var blnDateFound = false;//Set a variable to check on the while loop

	while (!blnDateFound)
	{
	dteMonth.setDate(intDaysInMonth+1);//create the next possible day
	var intNewMonth = dteMonth.getMonth();//new month date 

	if (intNewMonth != intMonth)//if the month has changed
		blnDateFound = true;
	else
		intDaysInMonth++;
	}
	return intDaysInMonth;
}

function GetCountryDetails(xiCityName)
{
    var CityArray;
	var CityCountryArray; 
	var CityId;
	
	for(var iCounterCity = 0; iCounterCity < labels.length; iCounterCity++)
	{
		CityCountryArray = labels[iCounterCity];
		
		if(xiCityName == CityCountryArray[0])
		{
			CityId = CityCountryArray[1];
			break;
		} 
	}
				
	for(var iCounterCountry = 0; iCounterCountry < CountryArray.length; iCounterCountry++)
	{
	    CityArray = CountryArray[iCounterCountry];
		
		if(CityId == CityArray[1])
		{
		    m_strCityName    = CityArray[0];
			m_iCityId	     = CityArray[1];
			m_strCountryName = CityArray[2];
			m_iCountryId	 = CityArray[3];	
			break;
		}	  
	} 
	
}	

	function getNights(inM,inD,outM,outD,outY,inY,objNights)
	{
		var dateDiff;
		var one_day=1000*60*60*24;
		var ddlFromYear;
		var ddlFromMonth;
		var ddlFromDay;	

		var ddlToYear;
		var ddlToMonth;
		var ddlToDay;

		ddlFromYear = inY.value;
		ddlFromMonth = inM.selectedIndex;	
		ddlFromDay = inD.value;

		ddlToYear = outY.value;
		ddlToMonth = outM.options.selectedIndex;	
		ddlToDay = outD.value;

		fromdate = new Date(ddlFromYear,ddlFromMonth,ddlFromDay);
		todate = new Date(ddlToYear,ddlToMonth,ddlToDay);

		dateDiff = Math.ceil((todate.getTime()-fromdate.getTime())/(one_day));	
		if(dateDiff < 1)
		{
			alert("invalid date");
			return false;	
		}
		else
		{
			if (objNights!=null)
			{
				objNights.innerText = String(dateDiff);
			}
		}
		return true;
	}
	
	function InitializeControls()
	{
		var newDate;
		newDate = new Date();
		
		document.frmSearch.ddlCheckINYear.options.length = 0;
		document.frmSearch.ddlCheckINYear.options[document.frmSearch.ddlCheckINYear.options.length]= new Option(newDate.getFullYear(),newDate.getFullYear());
		document.frmSearch.ddlCheckINYear.options[document.frmSearch.ddlCheckINYear.options.length]= new Option((newDate.getFullYear()+1),(newDate.getFullYear()+1));

		window.document.getElementById("RoomsRow3").style.display="none";
		window.document.getElementById("RoomsRow4").style.display="none";
		window.document.getElementById("ddlChild1Room1").style.display="none";
		window.document.getElementById("ddlChild2Room1").style.display="none";
		window.document.getElementById("ddlChild1Room2").style.display="none";
		window.document.getElementById("ddlChild2Room2").style.display="none";
	}
	
	function FillUpYearDropDown()
	{
		var yearDropDown = document.getElementById("ddlCheckINYear");
		var currentDate=new Date();
		var currentYear=currentDate.getFullYear();
		var ddlOption=new Option;
		var Count;

		for(Count = 0; Count<= 1; Count++)
		{
		var ddlOption=new Option;
		ddlOption.text=currentYear;
		ddlOption.value=currentYear;
		yearDropDown.options.add(ddlOption);
		currentYear++;
		}
	}

    function GetReedemSearchBoxControlsValues()
	{
	     var CheckInDate="";
	     var CheckOutDate="";
	     var sNoOfNights="";
	     var CityId="";
	     var CityName="";
	     var CountryId="";
	     var CountryName="";
	     var Destination="";
	     var HotelName="";
	     var strCheckInDate="";
	     var strCheckOutDate="";
	     var strMonth="";
	     var strDay="";
	     var sNoOfRooms="";
	     var sStarRatings="";
	     var sCurrencyCode="";
	     var sRoom1Adults="0";
	     var sRoom1Children="0";
	     
	     //string variable for Agent Login Id
		 var sAgentLoginID = "";
		 //string variable for Home Page URL
		 var sHomePageURL = "";
		 //string variable for DeepLink URL
		 var sDeepLinkURL = "";
		 //string variable for Redeem Page URL
		 var sRedeemPageURL = "";
		 var sQueryString="";
	     
         try
         {
         //Get check in and check out date.
         strCheckInDate = document.getElementById("ddlCheckINYear").value + "/" + document.getElementById("ddlCheckINMonth").value + "/" + document.getElementById("ddlCheckINDay").value;
	     CheckInDate=new Date(strCheckInDate);
	     CheckOutDate=CheckInDate;
	     CheckOutDate.setDate(CheckOutDate.getDate()+ parseInt(document.getElementById("ddlNoOfNights").value));
	     sNoOfNights=document.getElementById("ddlNoOfNights").value;
	     
	     CityId=document.getElementById("hidCityID").value;
	     CityName=document.getElementById("hidCityName").value;
	     CountryId=document.getElementById("hidCountryID").value;
	     CountryName=document.getElementById("hidCountryName").value;
	     Destination=document.getElementById("hidDestination").value;
	     HotelName=document.getElementById("txtSrcHotelName").value;
	     

	     strMonth=CheckOutDate.getMonth() + 1;
	     if(strMonth<=9)
	     {
	       strMonth= ("0" + strMonth);
	     }
	     strDay=CheckOutDate.getDate();
	     if(strDay<=9)
	     {
	       strDay= ("0" + strDay);
	     }
	     strCheckOutDate=CheckOutDate.getFullYear() + "/" + strMonth + "/" + strDay;
	     
	     document.getElementById("txtRegion").EnableViewState=true;
	     
	     // Agent Login Id
		 sAgentLoginID = "Hotel Hippo";
		 // Home Page URL
		 sHomePageURL = "http:||www.hotelhippo.com|index.aspx";
		 // Redeem Page URL
		 sRedeemPageURL = "http://www.hotelhippo.com/cheap-hotel-breaks/redeemvoucher.htm";

	     // Number of Rooms
		 sNoOfRooms = document.getElementById("ddlRooms").value;
		 // Star Ratings for the hotel to be search
		 sStarRatings = document.getElementById("cmb_star").value;
		 // Currency Code
		 sCurrencyCode = document.getElementById("ddlCurrencyList").value;
		 // Room1 Adults count
		 sRoom1Adults = document.getElementById("ddlAdults1").value;		
		 // Room1 Children count
		 sRoom1Children  = document.getElementById("ddlChildrens1").value;
		 
		 // Get Room1's values
		 GetRoom1Values();
		 
		 if(document.getElementById("ddlRooms").value =="2")
		 {
		  // Get Room1's values
		  GetRoom2Values();
		 }
		 
		 if(document.getElementById("ddlRooms").value =="3")
		 {
		  // Get Room1's values
		  GetRoom2Values();
		  GetRoom3Values();
		 } 
		 
		 //var sQueryString=MakeQueryString();
		 
		sQueryString = "CityId=" + CityId;	   
	    sQueryString=sQueryString + "&CountryId=" + CountryId;
	    sQueryString=sQueryString + "&HotelName=" + HotelName;

	    sQueryString=sQueryString + "&Destination=" + Destination;
	    sQueryString=sQueryString + "&StarRatings=" + sStarRatings;
	    sQueryString=sQueryString + "&CurrencyCode=" + sCurrencyCode;

	    sQueryString=sQueryString + "&Chkindate=" + strCheckInDate;
	    sQueryString=sQueryString + "&Chkoutdate=" + strCheckOutDate; 
	    sQueryString=sQueryString + "&Rooms=" + sNoOfRooms;
	    sQueryString=sQueryString + "&Adult1=" + sRoom1Adults;
	    sQueryString=sQueryString + "&Adult2=" + sRoom2Adults;
	    
	    sQueryString=sQueryString + "&Adult3=" + sRoom3Adults;
	    sQueryString=sQueryString + "&Child1=" + sRoom1Children;
	    sQueryString=sQueryString + "&Child2=" + sRoom2Children;
	    sQueryString=sQueryString + "&Child3=" + sRoom3Children;
	    sQueryString=sQueryString + "&Child1Age1=" + sRoom1Child1Age;

	    sQueryString=sQueryString + "&Child2Age1=" + sRoom2Child1Age;
	    sQueryString=sQueryString + "&Child3Age1=" + sRoom3Child1Age;
	    sQueryString=sQueryString + "&Child1Age2=" + sRoom1Child2Age;
	    sQueryString=sQueryString + "&Child2Age2=" + sRoom2Child2Age;
	    sQueryString=sQueryString + "&Child3Age2=" + sRoom3Child2Age;

	    sQueryString=sQueryString + "&AgentLoginID=" + sAgentLoginID;
	    sQueryString=sQueryString + "&HomePageURL=" + sHomePageURL;
	    sQueryString=sQueryString + "&RedeemPageURL=" + sRedeemPageURL; 
	    
	}
	catch(e)
	{
	sQueryString="";
	}
	
	return sQueryString;
}
	
	//Get the Details for the Room 1.
	function GetRoom1Values()
	{
	try
	{
	     if(document.getElementById("ddlChildrens1").value =="0")
	     {
	    
	      sRoom1Child1Age="0";
	      sRoom1Child2Age="0";
	     }
	     if(document.getElementById("ddlChildrens1").value =="1")
	     {
	      sRoom1Child1Age=document.getElementById("ddlChild1Room1").value;
	      sRoom1Child2Age="0";
	     }
	     if(document.getElementById("ddlChildrens1").value =="2")
	     {
	      sRoom1Child1Age=document.getElementById("ddlChild1Room1").value;
	      sRoom1Child2Age=document.getElementById("ddlChild2Room1").value;
	     }
	  }
	  catch(e)
	  {
	  alert(e.message);
	  }
	}
	
	//Get the Details for the Room 2.
	function GetRoom2Values()
	{
	try
	{
	     // Room2 Adults Count
		 sRoom2Adults =document.getElementById("ddlAdults2").value;
		 
		 // Room2 Children Count
		 sRoom2Children  = document.getElementById("ddlChildrens2").value;
		 
		 
	     if(document.getElementById("ddlChildrens2").value =="0")
	     {
	      sRoom2Child1Age="0";
	      sRoom2Child2Age="0";
	      
	     }
	     if(document.getElementById("ddlChildrens2").value =="1")
	     {
	      sRoom2Child1Age=document.getElementById("ddlChild1Room2").value;
	      sRoom2Child2Age="0";
	       
	     }
	     if(document.getElementById("ddlChildrens2").value =="2")
	     {
	      sRoom2Child1Age=document.getElementById("ddlChild1Room2").value;
	      sRoom2Child2Age=document.getElementById("ddlChild2Room2").value;
	      
	     }
	  }
	  catch(e)
	  {
	   alert(e.message);
	  }
	}
	
	//Get the Details for the Room 3.
	function GetRoom3Values()
	{
	try
	{
	    // Room3 Adults Count
		sRoom3Adults =document.getElementById("ddlAdults3").value;
		// Room3 Children Count
		sRoom3Children  = document.getElementById("ddlChildrens3").value;

	     if(document.getElementById("ddlChildrens3").value =="0")
	     {
	      sRoom3Child1Age="0";
	      sRoom3Child2Age="0";
	     }
	     if(document.getElementById("ddlChildrens3").value =="1")
	     {
	      sRoom3Child1Age=document.getElementById("ddlChild1Room3").value;
	      sRoom3Child2Age="0";
	     }
	     if(document.getElementById("ddlChildrens3").value =="2")
	     {
	      sRoom3Child1Age=document.getElementById("ddlChild1Room3").value;
	      sRoom3Child2Age=document.getElementById("ddlChild2Room3").value;
	     }
	  }
	  catch(e)
	  {
	  alert(e.message);
	  }

	}
	
	
	//Redirect the page to 'HotelResults' page.
	function RedirectToHotelResultsPage()
	{
	 try
	 {
	  //Validate the form. 
	  if(validateHotelSearchForm()==true)
	  {
	     var sQueryString=GetReedemSearchBoxControlsValues();
	     if(sQueryString!="")
	     {
	     //get the deep link Url.
	     var sDeeplinkURL="http://www.HotelHippo.com/HotelSearchResults.aspx";
	     //Get the redirect url.
	     var sUrl=sDeeplinkURL + "?" + sQueryString;   
	     var obj_hidRedirectUrl = document.getElementById("hidRedirectUrl");
	     obj_hidRedirectUrl.value=sUrl;
	     //Redirect the page.
	     window.location="RedeemVoucherHoldingPage.asp";
	     }
	     return true;
	  }
	  else
	  {
	  return false;
	  }
	 }
	 catch(e)
	 {
	 alert(e.message);
	 }
	 
	}
	
	function SetReedemSearchBoxControlsValues(queryStringsArray)
	{
	  //Set the date values.
	  SetDateValue(queryStringsArray);
	  //Set the destination value.
	  if(queryStringsArray.Destination!=null)
      {
       //document.getElementById("txtRegion").value=queryStringsArray.Destination;
      }
      //Set the hotel name.
      if(queryStringsArray.HotelName!=null)
      {
       document.getElementById("txtSrcHotelName").value=queryStringsArray.HotelName;
      }
      //Set the star ratings
      if(queryStringsArray.StarRatings!=null)
      {
       document.getElementById("cmb_star").value=queryStringsArray.StarRatings;
      }
      //Set the currency.
      if(queryStringsArray.CurrencyCode!=null)
      {
       document.getElementById("ddlCurrencyList").value=queryStringsArray.CurrencyCode;
      }
      //Set the room values.
      SetRoomValues(queryStringsArray);
	}
	
	function SetDateValue(queryStringsArray)
	{
	  //set the date values.
	  var szCheckInDate;				
	  var szCheckOutDate;
	  var sMonth;
	  var sDate;
	  var DateDifference;
	  
	  try
	  {
	  
	  if(queryStringsArray.Chkindate!=null)
	  {
	    //Read the check in date from the querystring.
	    szCheckInDate=new Date(queryStringsArray.Chkindate);
	    //Get year , month and date.
	    document.getElementById("ddlCheckINYear").value=szCheckInDate.getFullYear();
	    //Add one in month as '0' means January.
	    sMonth=szCheckInDate.getMonth() + 1;
	    if(sMonth<=9)
	    {
	    sMonth="0" + sMonth;
	    }
	    document.getElementById("ddlCheckINMonth").value=sMonth;
	    sDate=szCheckInDate.getDate();
	    if(sDate<=9)
	    {
	    sDate="0" + sDate;
	    }
	    document.getElementById("ddlCheckINDay").value=sDate; 
	    
	    //Display no of nights.
	    if(queryStringsArray.Chkoutdate!=null)
	    {
	     szCheckOutDate=new Date(queryStringsArray.Chkoutdate);
	     var DateDifference=((szCheckOutDate.getTime()-szCheckInDate.getTime())/(1000*60*60*24));
	      document.getElementById("ddlNoOfNights").value=DateDifference;
	    }
	  }

	  }
	  
	  catch(e)
	  {
	  alert(e.message);
	  }
	}
	
	function SetRoomValues(queryStringsArray)
	{
	try
	{
	  if(queryStringsArray.Rooms!=null)
	  {
	   document.getElementById("ddlRooms").value=queryStringsArray.Rooms;
	  }
	  //Set adults and children values.
	  if(queryStringsArray.Adult1!=null)
	  {
	   document.getElementById("ddlAdults1").value=queryStringsArray.Adult1;
	  }
	  if(queryStringsArray.Child1!=null)
	  {
	   document.getElementById("ddlChildrens1").value=queryStringsArray.Child1;
	  }
	  //set room1 values.
	  SetRoom1Values(queryStringsArray);
	  
	  var BrowserName=navigator.appName;
	  
	  //Set room2 values.
	  if(document.getElementById("ddlRooms").value=="2")
	  {
		if(BrowserName=="Microsoft Internet Explorer")
		{
		document.getElementById("room2Row").style.display='inline-block';
		}
		else
		{
		document.getElementById("room2Row").style.display='table-row';
		}
	    
	    SetRoom2Values(queryStringsArray);
	  }
	  
	  //Set room3 values
	  if(document.getElementById("ddlRooms").value=="3")
	  {
	    if(BrowserName=="Microsoft Internet Explorer")
		{
		document.getElementById("room2Row").style.display='inline-block';
		document.getElementById("room3Row").style.display='inline-block';
		}
		else
		{
		document.getElementById("room2Row").style.display='table-row';
		document.getElementById("room3Row").style.display='table-row';
		}
		
	    SetRoom2Values(queryStringsArray);
	    SetRoom3Values(queryStringsArray);
	  }
	}
	catch(e)
	{
	 alert(e.message);
	}
	}
	
	//Set Room1 values.
	function SetRoom1Values(queryStringsArray)
	{
	 try
	 {

	  if(document.getElementById("ddlChildrens1").value=="1")
	  {
	    if(queryStringsArray.Child1Age1!=null)
	    {
	      document.getElementById("ddlChild1Room1").value=queryStringsArray.Child1Age1;
	      document.getElementById("ddlChild1Room1").style.display="block";
	      document.getElementById("ddlChild1Room1").Visible=true;
	    }
	  }
	  if(document.getElementById("ddlChildrens1").value=="2")
	  {
		if(queryStringsArray.Child1Age1!=null)
		{
		  document.getElementById("ddlChild1Room1").value=queryStringsArray.Child1Age1;
	      document.getElementById("ddlChild1Room1").style.display="block";
	      document.getElementById("ddlChild1Room1").Visible=true;
		}
		if(queryStringsArray.Child1Age2!=null)
		{
		  document.getElementById("ddlChild2Room1").value=queryStringsArray.Child1Age2;
	      document.getElementById("ddlChild2Room1").style.display="block";
	      document.getElementById("ddlChild2Room1").Visible=true;
		}
	  }

	 }
	 catch(e)
	 {
	 alert(e.message);
	  return false;
	 }
	}
	
	//Set room 2 values.
	function SetRoom2Values(queryStringsArray)
	{
		try
		{
		
			if(queryStringsArray.Adult2!=null)
			{
			 document.getElementById("ddlAdults2").value=queryStringsArray.Adult2;
	         document.getElementById("ddlAdults2").style.display="block";
	         document.getElementById("ddlAdults2").Visible=true;
			}
			if(queryStringsArray.Child2!=null)
			{
			 document.getElementById("ddlChildrens2").value=queryStringsArray.Child2;
	         document.getElementById("ddlChildrens2").style.display="block";
	         document.getElementById("ddlChildrens2").Visible=true;
			}
			if(document.getElementById("ddlChildrens2").value=="1")
			{
			 if(queryStringsArray.Child2Age1!=null)
			 {
			  document.getElementById("ddlChild1Room2").value=queryStringsArray.Child2Age1;
	          document.getElementById("ddlChild1Room2").style.display="block";
	          document.getElementById("ddlChild1Room2").Visible=true;
			 }
			}
			if(document.getElementById("ddlChildrens2").value=="2")
			{
			 if(queryStringsArray.Child2Age1!=null)
			 {
			  document.getElementById("ddlChild1Room2").value=queryStringsArray.Child2Age1;
	          document.getElementById("ddlChild1Room2").style.display="block";
	          document.getElementById("ddlChild1Room2").Visible=true;
			 }
			 if(queryStringsArray.Child2Age1!=null)
			 {
			  document.getElementById("ddlChild2Room2").value=queryStringsArray.Child2Age2;
	          document.getElementById("ddlChild2Room2").style.display="block";
	          document.getElementById("ddlChild2Room2").Visible=true;
			 }
			}
		}
		catch(e)
		{
		 alert(e.message);
		 return false;
		}
	}
	
	//Set room3 values
	function SetRoom3Values(queryStringsArray)
	{

		try
		{
		 if(queryStringsArray.Adult3!=null)
		 {
		      document.getElementById("ddlAdults3").value=queryStringsArray.Adult3;
	          document.getElementById("ddlAdults3").style.display="block";
	          document.getElementById("ddlAdults3").Visible=true;
		 }
		 if(queryStringsArray.Child3!=null)
		 {
		      document.getElementById("ddlChildrens3").value=queryStringsArray.Child3;
	          document.getElementById("ddlChildrens3").style.display="block";
	          document.getElementById("ddlChildrens3").Visible=true;
		 }
		 if(document.getElementById("ddlChildrens3").value=="1")
		 {
		   if(queryStringsArray.Child3Age1!=null)
		   {
		      document.getElementById("ddlChild1Room3").value=queryStringsArray.Child3Age1;
	          document.getElementById("ddlChild1Room3").style.display="block";
	          document.getElementById("ddlChild1Room3").Visible=true;
		   }
		  
		 }
		 
		  if(document.getElementById("ddlChildrens3").value=="2")
		  {
		    if(queryStringsArray.Child3Age1!=null)
		    {
		      document.getElementById("ddlChild1Room3").value=queryStringsArray.Child3Age1;
	          document.getElementById("ddlChild1Room3").style.display="block";
	          document.getElementById("ddlChild1Room3").Visible=true;
		    }
		    if(queryStringsArray.Child3Age2!=null)
		    {
		      document.getElementById("ddlChild2Room3").value=queryStringsArray.Child3Age2;
	          document.getElementById("ddlChild2Room3").style.display="block";
	          document.getElementById("ddlChild2Room3").Visible=true;
		    }
		  }
		}
		catch(e)
		{
		alert(e.message);
		return false;
		}
	}
	
	// Dispaly currenct date .
	function DisplayCurrentDate()
	{
		try
		{
		  var currentDate=new Date();
		  var sYear=currentDate.getFullYear();
		  //add '1' to month becoz '0' indicates january.
		  var sMonth=currentDate.getMonth()+1;
		  var sDate=currentDate.getDate()+ 2;
		  
		  document.getElementById("ddlCheckINYear").value=sYear;
		  if(sMonth<=9)
		  {
		   sMonth="0" + sMonth;
	      }
	      document.getElementById("ddlCheckINMonth").value=sMonth;
          if(sDate<=9)
	      {
	      sDate="0" + sDate;
	      }
	      document.getElementById("ddlCheckINDay").value=sDate; 
		}
		catch(e)
		{
			alert(e.message);
			return false;
		}
	}


