//酒店详情查看showModelessDialog
function HotelInfo(HotelID,ComeTime,GoTime){
	window.showModelessDialog("HotelInfo.Asp?HotelId="+HotelID+"&ComeTime="+ComeTime+"&GoTime="+GoTime+"&Random="+Math.random(), "qq", "dialogHeight:550px;dialogWidth:760px;help:no;resizable:no;status:no;overflow-x:none");
}
//酒店订单
function HotelOrder(TextStr){
	document.getElementById("SubmitStr").value=TextStr;
	document.getElementById("HotelSubmitForm").submit();
}
//打开地图连接
function mst_showMap(g_mapid,g_label,g_addr){
	window.open("Hotel_Map.asp?g_mapid="+g_mapid+"&g_label="+escape(g_label)+"&g_addr="+escape(g_addr),"","Width=600,Height=500,top=100,left=100,status=no,scrollbars=no")
}
//入住人数选择
function SelectGuestNum(GuestNum){
	var ListTemp,N,ListTemp
	N=4
	ListTemp=document.getElementById("GuestNameListTemp").innerHTML;
	ListTemp=ListTemp.replace("1","")
	document.getElementById("GuestNameList").innerHTML="";
	var ListText
	var j=0;
	for(var i=0;i<GuestNum-1;i++){
		j=j+1
		if(i+2<10){ListTemp1="&nbsp;"}else{ListTemp1=""}
		ListText=ListTemp1+(i+2)+ListTemp+"&nbsp;"
		if(j==N){ListText +="<br>";j=0;N=5}
		document.getElementById("GuestNameList").innerHTML +=ListText
	}
}
//选择房间数计算总价
function SelectMoney(Str,GuestNum,GuestNumT){
	var  MoneyTemp=document.getElementById("AllMoney").getAttributeNode("title").value;
	document.getElementById("AllMoney").innerHTML=(Number(MoneyTemp)*Number(Str)).toFixed(2);
	document.getElementById("GuestNum").length=0;
	for(i=0;i<Number(Str)*2;i++){
		document.getElementById("GuestNum").options[i]=new Option(i+1,i+1)
		if (document.getElementById("GuestNum").options[i].value==GuestNumT) document.getElementById("GuestNum").selectedIndex = i
	}

}//

//订单提交
function HotelOrderSubmit(Url,Form){
	if (Url.substr(Url.length-1)=="F")	{
		if(CheckForm(document.getElementById(Form))==false){return false; }
	}
	var QueryString=AjaxMake(Form,"GuestName",true);
	Url=Url+"&"+QueryString
	document.getElementById(Form).action=Url;
	document.getElementById(Form).submit();
	
}

// 协议酒店的操作
function MyHotel(Str,Url){
	var CheckInfo=document.getElementsByName("InfoId");
	var InfoStr="";
	var InfoNum=0
	for (i=0; i<CheckInfo.length;i++){
		if(CheckInfo[i].checked){
			InfoStr=CheckInfo[i].value;InfoNum++;
		}
	}
	//if (Str!=null && Str!=""){
		//alert(Str)
		switch(Str){
			case "Add":
				location=Url+"&Action=Add";
				break;
			case "Edit":
				if(InfoNum==1){
					location=Url+"&Action=Edit&InfoId="+InfoStr;
				}else{
					Alert("操作修改信息时<p>请选择一条要操作的记录。</p>")
				}
				break;
			case "Del":
				if (InfoNum>0){
					Confirm("真的要执行删除操作吗?",280,150,"","Z|0#0",SubmitMyHotelListForm)
				}else{
					Alert("操作修改信息时<p>至少选择一条要操作的记录。</p>")
				}
				break;
			case "List":
				location=Url;
				break;
			case "Room":
				if(InfoNum==1){
					location=Url+"&Action=Room&InfoId="+InfoStr;
				}else{
					Alert("添加房型时<p>请选择一条酒店记录。</p>")
				}
				break;
		}
	//}
}

function SubmitMyHotelListForm(){
document.getElementById("MyHotelListForm").submit();	
}
//全选单前列表中的所有多选框
function MyHotel_CheckAll(form){
	var CheckInfo=document.getElementsByName("InfoId");
	if(document.getElementById("AllInfoId").checked==true){
		for (var i=0;i<CheckInfo.length;i++){
				CheckInfo[i].checked = true;
		}
	}else{
		for (var i=0;i<CheckInfo.length;i++){
				CheckInfo[i].checked = false;
		}
	}
}

//协议酒店查看
function MyShowHotel(HotelID){
	window.showModelessDialog("MyHotelInfo_1.Asp?HotelId="+HotelID+"&Random="+Math.random(), "qq", "dialogHeight:550px;dialogWidth:760px;help:no;resizable:no;overflow-x:none");
}
