var hotel_cate_id;
function ShowLinePic(){
	document.getElementById('hot').style.display = "none";
	var hotLI = document.getElementById('hot').getElementsByTagName("li");
	var lineAD = GetCookieData("lineAD");
	if(isNaN(lineAD)){
		lineAD = Math.floor(Math.random() * hotLI.length);    
	}else{
		lineAD = lineAD*1 +1;
	}	
	if( lineAD >= hotLI.length ){
		lineAD = 0;
	}
	document.getElementById('hot_show').innerHTML = hotLI[lineAD].innerHTML;
	Set("lineAD",lineAD);
}


firSelect = function(obj){
	dateSelectAction = function(value,obj){	//	扩展函数，选择日历后触发
		for(var i=0; i<_dateObjTwo.GroupArray.length; i++){
			 if(_dateObjTwo.GroupArray[i].DayNum <= GetlinuxDate(value)){
					_dateObjTwo.GroupArray[i].Status = 0; 
			}
		}
		document.getElementById('end_time').select();
		document.getElementById('end_time').focus();
		return;
	}
	for(var i=0; i<_dateObjTwo.GroupArray.length; i++){
		_dateObjTwo.GroupArray[i].Status = 1; 
	}
	return;
}

secSelect = function(obj){
	dateSelectAction = function(value,obj){	//	扩展函数，选择日历后触发
		 startRequest( hotel_cate_id, document.getElementById('start_time').value, document.getElementById('end_time').value)
	}	
}


//AJAX 酒店房型报价信息
var xmlHttp;
function createXMLHttpRequest()
{
    if(window.ActiveXObject)
    {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else if(window.XMLHttpRequest)
    {
        xmlHttp = new XMLHttpRequest();
    }
}
function startRequest( hotel_cate_id, start_time, end_time)
{	            	 
    createXMLHttpRequest();
    try
    {
		var url = "hotel-room-price.php?hotel_cate_id=" + hotel_cate_id +"&start_time=" + start_time +"&end_time=" + end_time;			
        xmlHttp.onreadystatechange = handleStateChange;
        xmlHttp.open("GET", url, true);
        xmlHttp.send(null);
		
    }
    catch(exception)
    {
        alert("xmlHttp Fail");
    }
}


function handleStateChange()
{    
    if(xmlHttp.readyState == 4)
    {            
        if (xmlHttp.status == 200 )
        { 
			document.getElementById('hotelRoomPriceShow').innerHTML =  xmlHttp.responseText;  
            return;            
        }
    }
}
