﻿// JavaScript Document
//向左滚动
function ScrollImgLeft()
{
	var speed=20
	var scroll_begin = document.getElementById("scroll_begin");
	var scroll_end = document.getElementById("scroll_end");
	var scroll_div = document.getElementById("scroll_div");
	scroll_end.innerHTML=scroll_begin.innerHTML
	function Marquee(){
	if(scroll_end.offsetWidth-scroll_div.scrollLeft<=0)
	scroll_div.scrollLeft-=scroll_begin.offsetWidth
	else
	scroll_div.scrollLeft++
	}
	var MyMar=setInterval(Marquee,speed)
	scroll_div.onmouseover=function() {clearInterval(MyMar)}
	scroll_div.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
}
//限制内容图片大小
function resize(o) {
	if (o.width>680) {
	o.style.width='680px';
	o.style.height='auto';
	}
}
//搜索
function SearchRoom()
{
	var TheSeachContent=document.getElementById("SearchTxt").value;
	if (TheSeachContent=="" || TheSeachContent=="输入您要查找的内容....")
	{
		alert("请输入您要查找的内容....");
	}
	else
	{
		var TheUrl="News_List.asp?tag=Search&TheContent="+TheSeachContent
		window.open(TheUrl,"_self");
	}
}
//预定房验证
function CkRoom(TheForm)
{
	if(TheForm.Bkxm.value=="")
	{
		alert("宾客姓名不能为空");
		TheForm.Bkxm.focus();
		return false;
	}
	if(TheForm.Rzsj.value=="")
	{
		alert("入住日期不能为空");
		TheForm.Rzsj.focus();
		return false;
	}
	if(TheForm.Ldsj.value=="")
	{
		alert("离店时间不能为空");
		TheForm.Ldsj.focus();
		return false;
	}
	if(TheForm.Fjlx.value=="")
	{
		alert("请选择房间类型");
		TheForm.Fjlx.focus();
		return false;
	}
	if(TheForm.Fjs.value=="")
	{
		alert("房间数不能为空");
		TheForm.Fjs.focus();
		return false;
	}
	if(TheForm.Ddsj.value=="")
	{
		alert("抵店时间不为空");
		TheForm.Ddsj.focus();
		return false;
	}
	if(TheForm.Lxdh.value=="")
	{
		alert("联系电话不能为空");
		TheForm.Lxdh.focus();
		return false;
	}
	if(TheForm.Cz.value=="")
	{
		alert("传真号码不能为空");
		TheForm.Cz.focus();
		return false;
	}
}
//预定别墅
function CkVilla(TheForm)
{
	if(TheForm.Bkxm.value=="")
	{
		alert("宾客姓名不能为空");
		TheForm.Bkxm.focus();
		return false;
	}
	if(TheForm.Rzsj.value=="")
	{
		alert("入住日期不能为空");
		TheForm.Rzsj.focus();
		return false;
	}
	if(TheForm.Ldsj.value=="")
	{
		alert("离店时间不能为空");
		TheForm.Ldsj.focus();
		return false;
	}
	if(TheForm.Bslx.value=="")
	{
		alert("请选择别墅类别");
		TheForm.Bslx.focus();
		return false;
	}
	if(TheForm.Fjs.value=="")
	{
		alert("房间数不能为空");
		TheForm.Fjs.focus();
		return false;
	}
	if(TheForm.Ddsj.value=="")
	{
		alert("抵店时间不能为空");
		TheForm.Ddsj.focus();
		return false;
	}
	if(TheForm.Lxdh.value=="")
	{
		alert("联系电话不能为空");
		TheForm.Lxdh.focus();
		return false;
	}
	if(TheForm.Cz.value=="")
	{
		alert("传真号码不能为空");
		TheForm.Cz.focus();
		return false;
	}
}
function CkWedding(TheForm)
{
	if(TheForm.Hlrq.value=="")
	{
		alert("婚礼日期不能为空");
		TheForm.Hlrq.focus();
		return false;
	}
	if(TheForm.Hlcd.value=="")
	{
		alert("婚礼场地不能为空");
		TheForm.Hlcd.focus();
		return false;
	}
	if(TheForm.Hlsj.value=="")
	{
		alert("婚礼时间不能为空");
		TheForm.Hlsj.focus();
		return false;
	}
	if(TheForm.Yjsj.value=="")
	{
		alert("预计时间不能为空");
		TheForm.Yjsj.focus();
		return false;
	}
	if(TheForm.Fkfs.value=="")
	{
		alert("请选择付款方式");
		TheForm.Fkfs.focus();
		return false;
	}
	if(TheForm.Ycyq.value=="")
	{
		alert("请选择用餐要求");
		TheForm.Ycyq.focus();
		return false;
	}
	if(TheForm.Hlyeyq.value=="")
	{
		alert("婚礼娱乐要求不能为空");
		TheForm.Hlyeyq.focus();
		return false;
	}
	if(TheForm.Lxr.value=="")
	{
		alert("联系人不能为空");
		TheForm.Lxr.focus();
		return false;
	}
	if(TheForm.Lxdh.value=="")
	{
		alert("联系电话不能为空");
		TheForm.Lxdh.focus();
		return false;
	}
	if(TheForm.Cz.value=="")
	{
		alert("传真不能为空");
		TheForm.Cz.focus();
		return false;
	}
	if(TheForm.Email.value=="")
	{
		alert("E-mail不能为空");
		TheForm.Email.focus();
		return false;
	}
}

//会议预定
function CkMeeting(TheForm)
{
	if(TheForm.Hysj.value=="")
	{
		alert("会议时间不能为空");
		TheForm.Hysj.focus();
		return false;
	}
	if(TheForm.Hydd.value=="")
	{
		alert("会议地点不能为空");
		TheForm.Hydd.focus();
		return false;
	}
	if(TheForm.Chrs.value=="")
	{
		alert("餐会人数不能为空");
		TheForm.Chrs.focus();
		return false;
	}
	if(TheForm.Hyxs.value=="")
	{
		alert("请选择会议形式");
		TheForm.Hyxs.focus();
		return false;
	}
	if(TheForm.Ycyq.value=="")
	{
		alert("请选择用餐要求");
		TheForm.Ycyq.focus();
		return false;
	}
	if(TheForm.Hyssyq.value=="")
	{
		alert("会议设施要求不能为空");
		TheForm.Hyssyq.focus();
		return false;
	}
	if(TheForm.Hyylyq.value=="")
	{
		alert("会议娱乐要求不能为空");
		TheForm.Hyylyq.focus();
		return false;
	}
	if(TheForm.Dwmc.value=="")
	{
		alert("单位名称不能为空");
		TheForm.Dwmc.focus();
		return false;
	}
	if(TheForm.Lxr.value=="")
	{
		alert("联系人不能为空");
		TheForm.Lxr.focus();
		return false;
	}
	if(TheForm.Lxdh.value=="")
	{
		alert("联系电话不能为空");
		TheForm.Lxdh.focus();
		return false;
	}
	if(TheForm.Cz.value=="")
	{
		alert("传真不能为空");
		TheForm.Cz.focus();
		return false;
	}
}
