// JavaScript Document

//**********************************************************************************************
var xmlHttp;
function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}// JavaScript Document

//new function Get Product subcategory
function getRoomTypes(str,str1,str2)
{

// document.getElementById("out_destination").innerHTML='Please wait....... Loading data' 
xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="getroomtypes.php"
url=url+"?q="+str+"&cin="+str1+"&cout="+str2
url=url+"&sid="+Math.random()
//alert(url)
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null) 
//alert(url);
function stateChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 	
	 document.getElementById("roomtypelist").innerHTML=xmlHttp.responseText 
	 document.getElementById("step1").innerHTML='<a href="#" onClick="return chkform();"><img class="go" alt="step one" src="images/1done.jpg" border="0" /></a>';
	 } 
}
}
//end
function isFutureDate(obj){
	var dteDate;
	var d= new Date();
	var now = new Date(d.getFullYear(),d.getMonth(),d.getDate());	
	//alert(now);
	obj1 = obj.split("/"); 
	obj1[0] = parseInt(obj1[0], 10);
	obj1[1] = parseInt(obj1[1], 10)-1;
	obj1[2] = parseInt(obj1[2], 10);
	dteDate=new Date(obj1[2], obj1[1], obj1[0]);
	//alert(dteDate);
		if(dteDate < now)
	return true;	
}
function compareDate(obj,ibj){
	var checkoutDate;
	var checkinDate;	
	obj1 = obj.split("/"); 
	obj1[0] = parseInt(obj1[0], 10);
	obj1[1] = parseInt(obj1[1], 10)-1;
	obj1[2] = parseInt(obj1[2], 10);
	checkoutDate=new Date(obj1[2], obj1[1], obj1[0]);
	ibj1 = ibj.split("/"); 
	ibj1[0] = parseInt(ibj1[0], 10);
	ibj1[1] = parseInt(ibj1[1], 10)-1;
	ibj1[2] = parseInt(ibj1[2], 10);
	checkinDate=new Date(ibj1[2], ibj1[1], ibj1[0]);
	if(checkinDate >= checkoutDate)
	return true;
}