var Public_Remark_Object = null;
var Public_HotelLogo = new Array();
var RemarkItem = new Array();
var RemarkItemIndex = 0;
var Page_Size = 20;
var Page_Count = 0;
var Page_Index = 1;
var Total_Count = 0;

function cls_Remark(remarkid, hotelid, hotelcode, hotelname, userid, username, userphoto, userpoint, remarkitem1, remarkitem2, remarkitem3, remarkitem4, remarkpoint, remarkintro, remarktime, remarkip)
{
	this.RemarkID = remarkid;
	this.HotelID = hotelid;
	this.HotelCode = hotelcode;
	this.HotelName = hotelname;
	this.UserID = userid;
	this.UserName = username;
	this.UserPhoto = userphoto;
	this.UserPoint = userpoint;
	this.RemarkItem1 = remarkitem1;
	this.RemarkItem2 = remarkitem2;
	this.RemarkItem3 = remarkitem3;
	this.RemarkItem4 = remarkitem4;
	this.RemarkPoint = remarkpoint;
	this.RemarkTime = remarktime;
	this.RemarkIP = remarkip;
	this.RemarkIntro = remarkintro;
}

function cls_Hotel() {
	this.HotelID = 0;
	this.HotelCode = "";
	this.HotelName = "";
	this.RemarkTimes = 0;
	this.RemarkItem = new Array();
}
cls_Hotel.prototype.AddRemark = function (i, remark) {
	this.RemarkItem[i] = remark;
}

function Hotel_AddLogo(i, path)
{
	Public_HotelLogo[i] = path;
}

function ShowHotelLogo(i)
{
	var imglayer = CheckObject("HotelLogo_Layer");
	var numlayer = CheckObject("HotelLogo_Index");
	if (!imglayer) return;
	if (!numlayer) return;
	var strBody1 = "";
	var strBody2 = "";
	if (Public_HotelLogo.length > 0)
	{
		if (i >= Public_HotelLogo.length)
		{
			i = 0;
		}
		strBody1 = "<a href=\"javascript: void(0)\" onclick=\"javascript: ShowHotelLogo(" + (i + 1) + ")\"><img src=\"" + Public_HotelLogo[i] + "\" border=\"0\"></a>";
		for (var j=0;j<Public_HotelLogo.length ;j++ )
		{
			strBody2 += (strBody2 == "" ? "" : "&nbsp;") + "<a href=\"javascript: void(0)\" onclick=\"javascript: ShowHotelLogo(" + j + ")\">" + (i == j ? "<font class=\"fb\">" + (j + 1) + "</font>" : (j + 1)) + "</a>";
		}
	}
	imglayer.innerHTML = strBody1;
	numlayer.innerHTML = strBody2;
	eval("setTimeout(\"ShowHotelLogo(" + (i + 1) + ");\", 5000)");
}

function hotelremark_checkdata(theform)
{
	var reg = /\s*/gi;
	var RemarkIntro = theform.RemarkIntro.value;
	if (RemarkIntro.replace(reg, "") == "")
	{
		alert("请输入点评内容！");
		theform.RemarkIntro.focus();
		return false;
	}
	else if (RemarkIntro.length > 500)
	{
		alert("点评内容不能超过500个字符！");
		theform.RemarkIntro.focus();
		return false;
	}
	else
	{
		return true;
	}
}

function hotelremark_submit(theform, hotelcode, hotelname)
{
	if (hotelremark_checkdata(theform))
	{
		var RemarkItem1 = theform.RemarkItem1_1.checked ? 1 : theform.RemarkItem1_2.checked ? 2 : theform.RemarkItem1_3.checked ? 3 : theform.RemarkItem1_4.checked ? 4 : 5;
		var RemarkItem2 = theform.RemarkItem2_1.checked ? 1 : theform.RemarkItem2_2.checked ? 2 : theform.RemarkItem2_3.checked ? 3 : theform.RemarkItem2_4.checked ? 4 : 5;
		var RemarkItem3 = theform.RemarkItem3_1.checked ? 1 : theform.RemarkItem3_2.checked ? 2 : theform.RemarkItem3_3.checked ? 3 : theform.RemarkItem3_4.checked ? 4 : 5;
		var RemarkItem4 = theform.RemarkItem4_1.checked ? 1 : theform.RemarkItem4_2.checked ? 2 : theform.RemarkItem4_3.checked ? 3 : theform.RemarkItem4_4.checked ? 4 : 5;
		var RemarkIntro = theform.RemarkIntro.value;
		var xmlhttp = CreateXmlHttpObj();
		if (CheckXML(xmlhttp))
		{
			theform.RemarkIntro.disabled = true;
			theform.submitbutton.disabled = true;
			xmlhttp.onreadystatechange = function()
			{
				if (xmlhttp.readyState == 4)
				{
					if (xmlhttp.status == 200) 
					{
						var strResult = xmlhttp.responseText;
						if (strResult != "")
						{
							alert(strResult.substr(3));
							if (strResult.substr(0,3) == "OK+")
							{
								window.location.href = "/hotel/summary/" + hotelcode + ".html";
							}
							else
							{
								theform.RemarkIntro.disabled = false;
								theform.submitbutton.disabled = false;
							}
						}
					}				
				}
			}
			var postinfo = "HotelCode=" + hotelcode + "&HotelName=" + escape(hotelname) + "&RemarkItem1=" + RemarkItem1 + "&RemarkItem2=" + RemarkItem2 + "&RemarkItem3=" + RemarkItem3 + "&RemarkItem4=" + RemarkItem4 + "&RemarkIntro=" + escape(RemarkIntro);
			xmlhttp.open("POST", "/hotel/summary/SaveRemark.aspx", true);
			xmlhttp.setRequestHeader("Content-Length",postinfo.length);
			xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			xmlhttp.send(postinfo);
		}
	}
	return false;
}

function IsPost(formname, hotelcode, hotelname)
{
	var theform = CheckObject(formname);
	if (!theform) return;
	if (event.ctrlKey && event.keyCode == 13)
	{
		hotelremark_submit(theform, hotelcode, hotelname);
	}
}

function RemarkFlag(point)
{
	var strResult = "";
	switch (point)
	{
	case 1:
		strResult = "差"; 
		break;
	case 2:
		strResult = "一般"; 
		break;
	case 3:
		strResult = "好"; 
		break;
	case 4:
		strResult = "很好"; 
		break;
	case 5:
		strResult = "非常好"; 
		break;
	default:
		strResult = "差"; 
		break;
	}
	return strResult;
}

function PaiHang(objname)
{
	var remarkrank_layer = CheckObject(objname);
	if (!remarkrank_layer) return false;
	var xmlhttp = CreateXmlHttpObj();
	if (CheckXML(xmlhttp))
	{
		xmlhttp.onreadystatechange = function()
		{
			if (xmlhttp.readyState == 4)
			{
				if (xmlhttp.status == 200) 
				{
					var strResult = xmlhttp.responseText;
					if (strResult != "")
					{
						remarkrank_layer.innerHTML = strResult;
					}
				}				
			}
		}
		xmlhttp.open("GET", "/inc/Hotel_RemarkRank.aspx?s=8", true);
		xmlhttp.setRequestHeader("If-Modified-Since","0");
		xmlhttp.setRequestHeader("Content-Type","text/html")
		xmlhttp.send(null);
	}
}

function CheckClickRemark(hotelcode, hotelname, clicktimes)
{
	var hotel_clickremark = CheckObject("hotel_clickremark");
	if (!hotel_clickremark) return false;
	var xmlhttp = CreateXmlHttpObj();
	if (CheckXML(xmlhttp))
	{
		xmlhttp.onreadystatechange = function()
		{
			if (xmlhttp.readyState == 4)
			{
				if (xmlhttp.status == 200) 
				{
					var strResult = xmlhttp.responseText;
					if (strResult != "")
					{
						hotel_clickremark.innerHTML = strResult;
					}
				}
			}
		}
		xmlhttp.open("GET", "/inc/Hotel_ClickRemark.aspx?ID=" + hotelcode + "&NA=" + escape(hotelname) + "&ClickTimes=" + clicktimes, true);
		xmlhttp.setRequestHeader("If-Modified-Since","0");
		xmlhttp.setRequestHeader("Content-Type","text/html")
		xmlhttp.send(null);
	}
}

function List_HotelRemark(hotelcode)
{
	var obj = CheckObject("hotel_remarklayer");
	if (!obj) return;
	var xmlhttp = CreateXmlHttpObj();
	if (CheckXML(xmlhttp))
	{
		xmlhttp.onreadystatechange = function()
		{
			if (xmlhttp.readyState == 4)
			{
				if (xmlhttp.status == 200) 
				{
					var strResult = xmlhttp.responseText;
					if (strResult != "")
					{
						eval(strResult);
						show_Remark(hotelcode);
					}
				}
			}
		}
		var postinfo = "HotelCode=" + hotelcode + "&t=" + Total_Count + "&p=" + Page_Index + "&s=" + Page_Size;
		xmlhttp.open("POST", "/inc/Page_HotelRemarks.aspx", true);
		xmlhttp.setRequestHeader("Content-Length",postinfo.length)
		xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
		xmlhttp.send(postinfo);
	}
}

function show_Remark(hotelcode)
{
	var obj = CheckObject("hotel_remarklayer");
	if (!obj) return;
	var strBody = "";
	for (var i=0;i<RemarkItem.length ;i++ )
	{
		strBody += "<div class=\"remarklist_layer\">";
		strBody += "<div class=\"remarkuser_layer\">" + (RemarkItem[i].UserID > 0 ? "<a href=\"http://user.ly234.com/userindex.aspx?UserID=" + RemarkItem[i].UserID + "\" target=\"_blank\"><img src=\"http://user.ly234.com/" + RemarkItem[i].UserPhoto + "\" width=\"80\" height=\"90\" border=\"0\"></a><br><a href=\"http://user.ly234.com/userindex.aspx?UserID=" + RemarkItem[i].UserID + "\" target=\"_blank\">" + RemarkItem[i].UserName + "</a><br>积分：<font class=\"entxt f11\">" + RemarkItem[i].UserPoint + "</font>" : "<img src=\"/" + RemarkItem[i].UserPhoto + "\" width=\"80\" height=\"90\" border=\"0\"></a><br>" + RemarkItem[i].UserName + "<br>积分：") + "</div>";
		strBody += "<div class=\"remarkinfo_layer\">";
		strBody += "<div class=\"remarkinfot_layer list_td\"><img src=\"/images/point_03.gif\" align=\"absmiddle\"> 硬件条件：<font class=\"ff60\">" + RemarkFlag(RemarkItem[i].RemarkItem1) + "</font>&nbsp;　　　&nbsp;环境位置：<font class=\"ff60\">" + RemarkFlag(RemarkItem[i].RemarkItem2) + "</font>&nbsp;　　　&nbsp;性 价 比：<font class=\"ff60\">" + RemarkFlag(RemarkItem[i].RemarkItem3) + "</font>&nbsp;　　　&nbsp;提供服务：<font class=\"ff60\">" + RemarkFlag(RemarkItem[i].RemarkItem4) + "</font></div>";
		strBody += "<div class=\"remarkinfoc_layer\">" + RemarkItem[i].RemarkIntro + "</div>";
		strBody += "<div class=\"remarkinfof1_layer\">&nbsp;综合评分：<font class=\"entxt f11\">" + RemarkItem[i].RemarkPoint + "</font></div><div class=\"remarkinfof2_layer\">点评时间：<font class=\"entxt f11\">" + RemarkItem[i].RemarkTime + "</font></div></div>";
		strBody += "</div></div>";
	}
	strBody += show_Pager(hotelcode);
	obj.innerHTML = strBody;
}

function show_Pager(hotelcode)
{
	var strBody = "";
	if (Page_Count > 1)
	{
		var pageshow = 10;
		strBody += "<div class=\"remarkpager_layer\">";
		strBody += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" height=\"100%\"><tr>";
		strBody += "<td width=\"20%\" nowrap>共 <font class=\"entxt f11\">" + Total_Count + "</font> 条 第 <font class=\"entxt f11\">" + Page_Index + " / " + Page_Count + "</font> 页</td>";
		strBody += "<td width=\"70%\" align=\"center\" nowrap>";
		if (Page_Count <= pageshow)
		{
			for (var i=1;i<=Page_Count ;i++ )
			{
				strBody += (i > 1 ? "&nbsp;" : "") + (Page_Index == i ? "<b>" + i + "</b>" : "<a href=\"javascript: void(0)\" onclick=\"javascript: goto_pager('" + hotelcode + "', " + i + ")\" class=\"entxt f11\">" + i + "</a>");
			}
		}
		else
		{
			var pIndex = parseInt(Page_Index / pageshow);
			if (Page_Index % pageshow > 0)
			{
				pIndex++;
			}
			if (pIndex > 1)
			{
				strBody += "<a href=\"javascript:void(0)\" onclick=\"javascript: goto_pager('" + hotelcode + "', " + ((pIndex - 1) * pageshow) + ")\" class=\"entxt f11\"><b>...</b></a>&nbsp;";
			}
			for (var i=(pIndex - 1) * pageshow + 1;i<=pIndex * pageshow && i <= Page_Count ;i++ )
			{
				strBody += Page_Index == i ? "<b>" + i + "</b>" : "<a href=\"javascript:void(0)\" onclick=\"javascript: goto_pager('" + hotelcode + "'," + i + ")\" class=\"entxt f11\">" + i + "</a>&nbsp;";
			}
			if (pIndex < parseInt(Page_Index / pageshow) + (Page_Count % pageshow > 0 ? 1 : 0))
			{
				strBody += "<a href=\"javascript:void(0)\" onclick=\"javascript: goto_pager('" + hotelcode + "'," + (pIndex * pageshow + 1) + ")\" class=\"entxt f11\"><b>...</b></a>";
			}
		}
		strBody += "</td>";
		strBody += "<td width=\"5%\" align=\"right\" nowrap><select id=\"gotopagebox\" onchange=\"goto_pager('" + hotelcode + "', this.value)\">";
		for (var i=1;i<=Page_Count ;i++ )
		{
			strBody += "<option value=\"" + i + "\"" + (Page_Index == i ? " selected" : "") + ">" + i + "</option>";
		}
		strBody += "</select></td>";
		strBody += "</tr></div>";
	}
	return strBody;
}

function goto_pager(hotelcode, pageindex)
{
	Page_Index = pageindex;
	List_HotelRemark(hotelcode);
}

function NewRemark(objname, hotelcode, pageindex, pagesize)
{
	var obj = CheckObject(objname);
	if (!obj) return;
	var xmlhttp = CreateXmlHttpObj();
	if (CheckXML(xmlhttp))
	{
		xmlhttp.onreadystatechange = function()
		{
			if (xmlhttp.readyState == 4)
			{
				if (xmlhttp.status == 200) 
				{
					var strResult = xmlhttp.responseText;
					if (strResult != "")
					{
						eval(strResult);
						show_NewRemark(objname, hotelcode);
					}
				}
			}
		}
		var postinfo = "HotelCode=" + hotelcode + "&t=100&p=" + pageindex + "&s=" + pagesize;
		xmlhttp.open("POST", "/inc/Page_HotelRemarks.aspx", true);
		xmlhttp.setRequestHeader("Content-Length",postinfo.length)
		xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
		xmlhttp.send(postinfo);
	}
}

function show_NewRemark(objname, hotelcode)
{
	var obj = CheckObject(objname);
	if (!obj) return;
	var strBody = "";
	for (var i=0;i<RemarkItem.length ;i++ )
	{
		strBody += "<div class=\"listitemlayer\">";
		strBody += "<div class=\"listitem_layer\"><font class=\"entxt f11\">" + RemarkItem[i].RemarkTime + "</font> " + "驴友 " + RemarkItem[i].UserName + " 点评 <a href=\"http://lijiang.ly234.com/hotel/" + RemarkItem[i].HotelCode + ".html\" target=\"blank\">" + RemarkItem[i].HotelName + "</a></div>";
		strBody += "<div class=\"list_itemlayer\">" + RemarkItem[i].RemarkIntro + "</div>";
		strBody += "</div>";
	}
	obj.innerHTML = strBody;
}

/*

function Change_RemarkPager(objname, hotelcode, showtype, pageindex, pagesize, totalcount)
{
	var remark_list = CheckObject(objname);
	if (!remark_list) return;
	var xmlhttp = CreateXmlHttpObj();
	if (CheckXML(xmlhttp))
	{
		xmlhttp.onreadystatechange = function()
		{
			if (xmlhttp.readyState == 4)
			{
				if (xmlhttp.status == 200) 
				{
					var strResult = xmlhttp.responseText;
					if (strResult != "")
					{
						eval(strResult);
						switch (showtype)
						{
						case 1:
							remark_list.innerHTML = ShowNewRemark1();
							break;
						case 2:
							remark_list.innerHTML = ShowNewRemark2();
							break;
						}
					}
					else
					{
						remark_list.innerHTML = "";
					}
				}				
			}
		}
		xmlhttp.open("GET", "/inc/Hotel_ShowNewRemark.inc.aspx?ID=" + hotelcode + "&ShowType=" + showtype + "&PageIndex=" + pageindex + "&TotalCount=" + totalcount + "&PageSize=" + pagesize, true);
		xmlhttp.setRequestHeader("If-Modified-Since","0");
		xmlhttp.setRequestHeader("Content-Type","text/html")
		xmlhttp.send(null);
	}
}

function ShowNewRemark1(hotelcode)
{
	var strBody = "";
	for (var i=0;i<Public_Hotel_Object.RemarkItem.length ;i++ )
	{
		strBody += "<div class=\"item7\">·<a href=\"summary.aspx?ID=" + Public_Hotel_Object.RemarkItem[i].HotelID + "\" class=\"b\"><font class=\"fblack\">" + Public_Hotel_Object.RemarkItem[i].ComeDate + "入住" + Public_Hotel_Object.RemarkItem[i].HotelName + "</font></a></div>";
		strBody += "<div class=\"item8\">" + Public_Hotel_Object.RemarkItem[i].RemarkIntro + "</div>";
		strBody += "<div class=\"item9\">" + Public_Hotel_Object.RemarkItem[i].UserName + " 发表于 " + Public_Hotel_Object.RemarkItem[i].RemarkTime + "</div>";
	}
	return strBody;
}

function ShowNewRemark2()
{
	var strBody = "";
	for (var i=0;i<Public_Hotel_Object.RemarkItem.length ;i++ )
	{
		strBody += "<div class=\"ts_c list_td\"><div class=\"u_info ln20\"><a href=\"../user/userindex.aspx?UserID=" + Public_Hotel_Object.RemarkItem[i].UserID + "\" target=\"_blank\">" + Public_Hotel_Object.RemarkItem[i].UserPhoto + "</a><br><a href=\"../user/userindex.aspx?UserID=" + Public_Hotel_Object.RemarkItem[i].UserID + "\" target=\"_blank\">" + Public_Hotel_Object.RemarkItem[i].UserName + "</a><br>积分：<font class=\"entxt f11\">" + Public_Hotel_Object.RemarkItem[i].UserPoint + "</font></div>";
		strBody += "<div class=\"r_info\"><div class=\"fb list_td entxt fleft\"><img src=\"../images/point_02.gif\" align=\"absmiddle\"> <a href=\"summary.aspx?ID=" + Public_Hotel_Object.RemarkItem[i].HotelID + "\" class=\"b\"><font class=\"fblack\">" + Public_Hotel_Object.RemarkItem[i].ComeDate + "入住" + Public_Hotel_Object.RemarkItem[i].HotelName + "</font></a></div><div class=\"fright entxt f11 list_td\">" + Public_Hotel_Object.RemarkItem[i].RemarkTime + "</div>";
		strBody += "<div class=\"r_i_c ln20 paddleft5 paddtb5\">" + Public_Hotel_Object.RemarkItem[i].RemarkIntro + "</div>";
		strBody += "<div class=\"fleft\"><div class=\"fleft\">&nbsp;综合评分：<font class=\"entxt f11\">" + Public_Hotel_Object.RemarkItem[i].RemarkPoint + "</font></div><div class=\"fright entxt f11\">" + Public_Hotel_Object.RemarkItem[i].RemarkTime + "</div></div>";
		strBody += "<div class=\"ln20 paddtop5 fleft\">&nbsp;" + Public_Hotel_Object.RemarkItem[i].RemarkItemName1 + "：<font class=\"ff60 entxt f11\">" + Public_Hotel_Object.RemarkItem[i].RemarkItemPoint1 + "</font>&nbsp;" + Public_Hotel_Object.RemarkItem[i].RemarkItemName2 + "：<font class=\"ff60 entxt f11\">" + Public_Hotel_Object.RemarkItem[i].RemarkItemPoint2 + "</font>&nbsp;" + Public_Hotel_Object.RemarkItem[i].RemarkItemName3 + "：<font class=\"ff60 entxt f11\">" + Public_Hotel_Object.RemarkItem[i].RemarkItemPoint3 + "</font>&nbsp;" + Public_Hotel_Object.RemarkItem[i].RemarkItemName4 + "：<font class=\"ff60 entxt f11\">" + Public_Hotel_Object.RemarkItem[i].RemarkItemPoint4 + "</font></div>";
		strBody += "</div></div>";
	}
	return strBody;
}

// 分页
function Show_Pager(actions, showtype, pageindex, pagesize, totalcount)
{
	if (totalcount <= 0)
	{
		return "";
	}
	var iPageLength = 10;
	var iPageCount = parseInt(totalcount / pagesize);
	if (totalcount % pagesize > 0) iPageCount++;
	if (pageindex <= 0) pageindex = 1;
	if (pageindex > iPageCount) pageindex = iPageCount;
	var strBody = "<div id=\"pager_layer\">";
	strBody += "<div id=\"pager_info_layer\">共 " + totalcount + " 条 第 " + pageindex + " / " + iPageCount + " 页</div>";
	strBody += "<div id=\"pager_list_layer\">";
	if (pageindex <= iPageLength)
	{
		var maxIndex = iPageCount > iPageLength ? iPageLength : iPageCount;
		for (var i=1;i<=maxIndex ;i++ )
		{
			strBody += "<a href=\"javascript:void(0)\" onclick=\"javascript:" + actions + "(" + showtype + "," + i + "," + pagesize + "," + totalcount + ")\"><strong>" + (i == pageindex ? "<font color=\"red\">" + i + "</font>" : i) + "</strong></a>&nbsp;";
		}
		strBody += iPageCount > iPageLength ? "<a href=\"javascript:void(0)\" onclick=\"javascript:" + actions + "(" + showtype + "," + (iPageLength + 1) + "," + pagesize + "," + totalcount + ")\"><strong>...</strong></a>&nbsp;" : "";
	}
	else
	{
		var minIndex = (pageindex % iPageLength > 0 ? parseInt(pageindex / iPageLength) : parseInt(pageindex / iPageLength) - 1) * iPageLength + 1;
		var maxIndex = iPageCount > minIndex + iPageLength - 1 ? minIndex + iPageLength - 1 : iPageCount;
		strBody += pageindex > iPageLength ? "<a href=\"javascript:void(0)\" onclick=\"javascript:" + actions + "(" + showtype + "," + (minIndex - 1) + "," + pagesize + "," + totalcount + ")\"><strong>...</strong></a>&nbsp;" : "";
		for (var i=minIndex;i<=maxIndex ;i++ )
		{
			strBody += "<a href=\"javascript:void(0)\" onclick=\"javascript:" + actions + "(" + showtype + "," + i + "," + pagesize + "," + totalcount + ")\"><strong>" + (i == pageindex ? "<font color=\"red\">" + i + "</font>" : i) + "</strong></a>&nbsp;";
		}
		strBody += iPageCount > maxIndex ? "<a href=\"javascript:void(0)\" onclick=\"javascript:" + actions + "(" + showtype + "," + (maxIndex + 1) + "," + pagesize + "," + totalcount + ")\"><strong>...</strong></a>&nbsp;" : "";
	}
	strBody += "</div></div>";
	return strBody;
}

// 酒店预定
function CheckData_BuyRoomForm(objname, balert)
{
	var theform = document.getElementById(objname);
	if (theform.HotelIDH.value == "" || theform.HotelIDH.value == "0")
	{
		if (balert) alert("非法数据提交！");
		return false;
	}
	if (theform.RoomIDH.value == "" || theform.RoomIDH.value == "0")
	{
		if (balert) alert("非法数据提交！");
		return false;
	}
	if (theform.SelectDate1.value == "")
	{
		if (balert) alert("请选择日期！");
		return false;
	}
	if (theform.BuyDays.value == "" || theform.BuyDays.value == "0")
	{
		if (balert)
		{
			alert("请输入入住天数！");
			theform.BuyDays.focus();
		}
		return false;
	}
	if (theform.BuyRooms.value == "" || theform.BuyRooms.value == "0")
	{
		if (balert)
		{
			alert("请输入预订房间数量！");
			theform.BuyRooms.focus();
		}
		return false;
	}
	if (theform.BuyNumber.value == "" || theform.BuyNumber.value == "0")
	{
		if (balert)
		{
			alert("请输入入住人数！");
			theform.BuyNumber.focus();
		}
		return false;
	}
	if (theform.BuyName.value == "" || theform.BuyName.value.length < 2)
	{
		if (balert)
		{
			alert("请输入您的姓名！");
			theform.BuyName.focus();
		}
		return false;
	}
	if (theform.BuyTelphone.value == "" || theform.BuyTelphone.value.length < 10)
	{
		if (balert)
		{
			alert("请输入您的联系电话，外地请输入区号+电话号码！");
			theform.BuyTelphone.focus();
		}
		return false;
	}
	return true;
}

function BuyRoom_Submit(objname)
{
	if (!confirm("你确定资料填写正确并要预约吗？"))
	{
		return;
	}
	var theform = document.getElementById(objname);
	var hotelid = theform.HotelIDH.value;
	var roomid = theform.RoomIDH.value;
	var btime = theform.SelectDate1.value;
	var bdays = theform.BuyDays.value;
	var brooms = theform.BuyRooms.value;
	var bnumber = theform.BuyNumber.value;
	var bname = theform.BuyName.value;
	var btel = theform.BuyTelphone.value;
	var bintro = theform.BuyIntro.value;
	var sflag = theform.SubmitFlag.value;
	var xmlhttp = CreateXmlHttpObj();
	if (CheckXML(xmlhttp))
	{
		theform.submitbutton.value = "正在提交数据，请等待 ...";
		theform.RoomIDH.disabled = true;
		theform.submitbutton.disabled = true;
		theform.resetbutton.disabled = true;
		theform.BuyDays.disabled = true;
		theform.BuyRooms.disabled = true;
		theform.BuyNumber.disabled = true;
		theform.BuyName.disabled = true;
		theform.BuyTelphone.disabled = true;
		theform.BuyIntro.disabled = true;
		xmlhttp.onreadystatechange = function()
		{
			if (xmlhttp.readyState == 4)
			{
				if (xmlhttp.status == 200) 
				{
					var strResult = xmlhttp.responseText;
					if (strResult != "")
					{
						var aresult = strResult.split('+');
						var istatu = aresult[0];
						var smessage = aresult[1];
						if (istatu == "0")
						{
							alert(smessage);
							theform.submitbutton.value = " 提交订单 ";
							theform.RoomIDH.disabled = false;
							theform.submitbutton.disabled = false;
							theform.resetbutton.disabled = false;
							theform.BuyDays.disabled = false;
							theform.BuyRooms.disabled = false;
							theform.BuyNumber.disabled = false;
							theform.BuyName.disabled = false;
							theform.BuyTelphone.disabled = false;
							theform.BuyIntro.disabled = false;
						}
						else
						{
							alert(smessage);
							window.location.href = "Order.aspx?ID=" + istatu;
						}
					}
					else
					{
						alert("网络忙，请稍后再试！");
						theform.submitbutton.value = " 提交订单 ";
						theform.RoomIDH.disabled = false;
						theform.submitbutton.disabled = false;
						theform.resetbutton.disabled = false;
						theform.BuyDays.disabled = false;
						theform.BuyRooms.disabled = false;
						theform.BuyNumber.disabled = false;
						theform.BuyName.disabled = false;
						theform.BuyTelphone.disabled = false;
						theform.BuyIntro.disabled = false;
					}
				}				
			}
		}
		var sContent = "HotelID=" + hotelid + "&RoomID=" + roomid + "&SelectDate=" + btime + "&BuyNumber=" + bnumber + "&BuyDays=" + bdays + "&BuyRooms=" + brooms + "&BuyName=" + escape(bname) + "&BuyTelphone=" + btel + "&SubmitFlag=" + sflag + "&BuyIntro=" + escape(bintro);
		xmlhttp.open("POST", "/Hotel/Buy.aspx", true);
		xmlhttp.setRequestHeader("Content-Length",sContent.length)
		xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
		xmlhttp.send(sContent);
	}
}

*/