//查询酒店
function searchHotelRoomInfo(date){
	// 定义两个标志是为了把城市和时间的错误都显示出来，然后再返回
	var dateError = false;
	var cityError = false;
	
	document.getElementById("TR_DateError").style.display = "none";
	document.getElementById("TR_CityError").style.display = "none";
	
	if(!checkDate(date)){
		dateError = true;
	}
	
	if(!checkCity()){
		cityError = true;
	}
	if(dateError || cityError){
		return;
	}
   // document.searchForHotel.action = "./switchdo.do?prefix=/hotel&page=/mulHotelBook_html.do?actionType=getHotelResult"; 
   document.searchForHotel.action = jsUseURL+"switchdo.do?prefix=/hotel&page=/mulHotelBook_html.do?actionType=getHotelResult"; 
    document.searchForHotel.submit();
}
function searchHotelRoomInfo_html(date){
	// 定义两个标志是为了把城市和时间的错误都显示出来，然后再返回
	var dateError = false;
	var cityError = false;
	
	document.getElementById("TR_DateError").style.display = "none";
	document.getElementById("TR_CityError").style.display = "none";
	
	if(!checkDate(date)){
		dateError = true;
	}
	
	if(!checkCity()){
		cityError = true;
	}
	if(dateError || cityError){
		return;
	}
    document.searchForHotel.action = jsUseURL+"switchdo.do?prefix=/hotel&page=/mulHotelBook_html.do?actionType=getHotelResult"; 
    document.searchForHotel.submit();
}
//点击热点城市
function do_search_submit(cityid,cityname,date){
    /*if(!checkDate(date)){
    	return;
    }
    //置入检索的City信息
    document.getElementById("hotelCityID").value = cityid;
    document.getElementById("hotel_CityID").value = cityname;
	document.searchForHotel.action = "./switchdo.do?prefix=/hotel&page=/mulHotelBook_html.do?actionType=getHotelResult"; 
    document.searchForHotel.submit();
    */
    window.location = jsUseBasePath+cityid.toLowerCase()+"-"+htmlUseLanId.toLowerCase()+".htm"; 
}
//点击热点城市
function do_search_submit_html(cityid,cityname,date){
   /* if(!checkDate(date)){
    	return;
    }
    //置入检索的City信息
    document.getElementById("hotelCityID").value = cityid;
    document.getElementById("hotel_CityID").value = cityname;
	document.searchForHotel.action = jsUseURL+"switchdo.do?prefix=/hotel&page=/mulHotelBook_html.do?actionType=getHotelResult"; 
    document.searchForHotel.submit();
    */
    window.location = jsUseBasePath+cityid.toLowerCase()+"-"+htmlUseLanId.toLowerCase()+".htm"; 
}
//点击推荐酒店
function reserve_submit_common(cityid,cityName,hotelmulid,calstart,page_id){
    var objTR = document.getElementById("TR_DateError");
    var objSpan = document.getElementById("Span_DateError");
    document.getElementById("hotelCityID").value = cityid;
	document.getElementById("hotel_CityID").value = cityName;
	
	document.getElementById("calstart").value = calstart;
	//document.getElementById("calend").value = claend;
	var fName = document.getElementById(page_id);
    //fName.action = "./switchdo.do?prefix=/hotel&page=/mulHotelBook.do?actionType=getHotelInfo&hotelmulid=" + hotelmulid; 
    fName.action = jsUseURL+"switchdo.do?prefix=/hotel&page=/mulHotelBook.do?actionType=getHotelInfo&hotelmulid=" + hotelmulid; 
    fName.submit();
}
//点击推荐酒店
function reserve_submit_common_html(cityid,cityName,hotelmulid,calstart,calend,page_id){
    window.location = jsUseBasePath+hotelmulid.toLowerCase()+"-"+htmlUseLanId.toLowerCase()+".htm?checkindate="+calstart+"&checkoutdate="+calend; 
}

//预订酒店房型
function bookHotelRooms(hotelid,roomID,checkInDate,checkOutDate,formId){
	var fromObj = document.getElementById(formId);	
	//fromObj.calstart.value = checkInDate;
	//fromObj.calend.value = checkOutDate;
    //fromObj.action = jsUseURL+"switchdo.do?prefix=/hotel&page=/mulHotelBook_html.do?actionType=getHotelOrder&hotelmulid="+hotelid+"&roomID=" + roomID+"&checkInDate="+checkInDate+"&checkOutDate="+checkOutDate; 
      fromObj.action = jsUseURL+"switchdo.do?prefix=/inbound&page=/customerLogin.do&LoginForward=mulHotelBook_html&actionType=getHotelOrder&hotelmulid="+hotelid+"&roomID=" + roomID+"&checkInDate="+checkInDate+"&checkOutDate="+checkOutDate;  
    fromObj.submit();
}
//检查是否登陆
function hotelCheckLogin(hotel_id,room_id,in_date,out_date,form_id){
	//	checkLoginId("bookHotelRooms('"+hotel_id+"','"+room_id+"','"+in_date+"','"+out_date+"','"+form_id+"')");
	bookHotelRooms(hotel_id,room_id,in_date,out_date,form_id);
	
}
