<!--
/*

' 旅行社网上信息发布系统 V1.0版
' 声明:此版本不以任何方式免费提供他人,若需此程式用来学习请先征求作者 webmaster@somis.cn 同意.
' 任何不明途径、商业性的应用必须经过somis团队授权.否则将追究其法律责任.  
' Copyright (C) 2005 www.somis.cn. All rights reserved.
' HomePage: http://www.somis.cn/
' Email: master@somis.cn
' File: all.js  公用脚本
' Version:1.0
' Date: 2005-12-19
' Design by somis团队,奇怪,Abo,一言不发
' QQ:373218510

*/


function CheckName(Name) {
	var ErrStr;
	var ErrChar;
	var ArryErrStr;
	ErrChar="!@#$%^&*()_+|-=\\~`;'[]{}\"':;,./<>?～！@#￥％^&×（）……＋|－＝、〔〕｛｝：“；‘《》？，。、０１２３４５６７８９";
	ErrStr="虚拟,傻冒,先生,小姐,代订,webmaster,admin,user,管理员,客服";
	ArryErrStr = ErrStr.split(",");
	//是否含有非法字符
	for(var k=0;k<Name.length;k++){
		if(ErrChar.indexOf(Name.charAt(k))>-1){
			return false;
		}
	}
	//是否含有非法字符串
	for (k=0; k<ArryErrStr.length; k++){
		if (Name.indexOf(ArryErrStr[k])>-1){
			return false;
		}
	}
	return true;
}




function CheckDate(strDate1,strDate2) {
	//var tmp1=strDate1.split('-');
	//var tmp2=strDate2.split('-');
	//var date1=eval('new Date('+tmp1[0]+','+tmp1[1]+','+tmp1[2]+')');
	//var date2=eval('new Date('+tmp2[0]+','+tmp2[1]+','+tmp2[2]+')');
	//return (date2>date1);
	return(stringToDate(strDate1, true)<stringToDate(strDate2, true));
}

function stringToDate(sDate, bIgnore)
{	var bValidDate, year, month, day;
	var iaDate = new Array(3);
	
	if (bIgnore) 
	 bValidDate = true
	else
	 bValidDate = isDateString(sDate);
	
	if (bValidDate)
	{  iaDate = sDate.toString().split("-");
		year = parseFloat(iaDate[0]);
		month = parseFloat(iaDate[1]) - 1;
		day=parseFloat(iaDate[2]);
		return (new Date(year,month,day));
	}
	else 
	return (new Date(1900,1,1));
}

//--CheckIfEnglish----------------------------------------------------------------------------------


	function CheckIsEnglish(String){ 
	var Letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890_";
	var i;
	var c;
	for( i = 0; i < String.length; i ++ ){
		c = String.charAt( i );
		if (Letters.indexOf( c ) < 0)
		return false;
		}
	return true;
	}
	

//--CheckIfNumber----------------------------------------------------------------------------------


	function CheckIsNumber(String){ 
	var Letters = "0123456789";
	var i;
	var c;
	for( i = 0; i < String.length; i ++ ){
		c = String.charAt( i );
		if (Letters.indexOf( c ) < 0)
		return false;
		}
	return true;
	}
	
//--countain-------------------------------------------------------------------------------------


	function contain(str,charset){
	var i;
	for(i=0;i<charset.length;i++){
		if(str.indexOf(charset.charAt(i))>=0)
		return true;
		}
	return false;
	}

//--CheckIsEmail----------------------------------------------------------------------------------


	function CheckIsEmail(emailasserss){
    return(new RegExp(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/).test(emailasserss));
	}

//--eopenwin---------------------------------------------------------------------------------------


	function openwin(page,size){
	window.open(page,"newuser","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,"+ size);
	}

//--goToURL-----------------------------------------------------------------------------------------


	function MM_goToURL() { //v3.0
		var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
		for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
	}

//--reset form----------------------------------------------------------------------------------------


	function confirm_reset(){
	if (confirm("该项操作将要清除您刚才填写的所有信息，你确定要清除吗?")){
		return true;
	}
	return false;
	}
	
//--hotele select----------------------------------------------------------------------------------


	function check_select_hotel(theform){

	if (theform.starclass.value==""){
		alert("请选择酒店星级");
		theform.starclass.focus();
		return (false);
		}

	if (theform.arrive_time.value==""){
		alert("请制订您需入住酒店的时间");
		theform.arrive_time.focus();
		return (false);
		}

	if (theform.arrive_time.value==null){
		alert("入住酒店的时间格式不正确");
		theform.arrive_time.focus();
		return (false);
		}

	if (theform.leave_time.value==""){
		alert("请制订您需离开酒店的时间");
		theform.leave_time.focus();
		return (false);
		}

	if (theform.leave_time.value==null){
		alert("离开酒店的时间格式不正确");
		theform.leave_time.focus();
		return (false);
		}

	if (! CheckDate(theform.arrive_time.value,theform.leave_time.value)) {
		alert('离店日期不能大于或等于入住日期！');
		theform.leave_time.focus();
		return false;
	}

	if (theform.arrive_time.value == theform.leave_time.value){
		alert("离开酒店时间不能和入住酒店的时间相同");
		theform.arrive_time.focus();
		return (false);
		}
	
	if (CheckName(theform.hotelname.value)==false){
		theform.hotelname.focus();
		alert("酒店名称中含有非法字符！");
		return false;
		}
		
	//if (theform.hotelname.value==""){
	//	alert("请输入您需查询的酒店名称");
	//	theform.hotelname.focus();
	//	return (false);
	//	}

	if (theform.shi.value==""){
		alert("城市名称是必须指定的");
		theform.shi.focus();
		return (false);
		}
	return (true);
	}


//--user login----------------------------------------------------------------------------------


	function check_userlogin(theform){

	if (theform.UserName.value.length<2){
		alert("请填写完整的用户名");
		theform.UserName.focus();
		return (false);
		}
		
	if ((CheckName(theform.UserName.value)==false)||(CheckName(theform.UserPassWord.value)==false)){
		theform.UserName.focus();
		alert("用户名或密码中含有非法字符！");
		return false;
		}
		
	if (theform.UserPassWord.value.length<3){
		alert("请填写完整的密码");
		theform.UserPassWord.focus();
		return (false);
		}

	if (theform.userkey.value.length<4){
		alert("请填写完整的验证码");
		theform.userkey.focus();
		return (false);
		}

	return (true);
	}

//--comment_on----------------------------------------------------------------------------------


	function check_comment_on(theform){

	if (theform.names.value.length<2){
		alert("请输入完整的姓名或用户名");
		theform.names.focus();
		return (false);
		}

	if (theform.email.value==""){
		alert("请输入信箱地址");
		theform.email.focus();
		return (false);
		}
		
    if (!CheckIsEmail(theform.email.value)){
		alert("请输入正确的邮箱地址");
		theform.email.focus();
		return false;
		}
	
	if (theform.email.value.length<8){
		alert("请输入正确的邮箱地址");
		theform.email.focus();
		return (false);
		}
		
	if ((theform.comment.value.length<6) || (theform.comment.value.length>300)){
		alert("您要发表的评论内容字符数不能少于6个或多于300个");
		theform.comment.focus();
		return (false);
		}
		
	if (theform.u_key.value.length<4){
		alert("请填写完整的验证码");
		theform.u_key.focus();
		return (false);
		}
	return (true);
	}

//--check_user_reg----------------------------------------------------------------------------------


	function check_user_reg(theform){

	if (CheckName(theform.username.value)==false){
		theform.username.focus();
		alert("用户名中含有非法字符！");
		return false;
		}

	if ((CheckName(theform.password1.value)==false)||(CheckName(theform.password2.value)==false)){
		theform.password1.focus();
		alert("密码中含有非法字符！");
		return false;
		}

	if ((theform.username.value.length<2) || (theform.username.value.length>20)){
		alert("用户名的长度应该为2-20位");
		theform.username.focus();
		return (false);
		}
	
	if ((theform.password1.value.length<3) || (theform.password1.value.length>20)){
		alert("密码的长度应该为3-20位");
		theform.password1.focus();
		return (false);
		}

	if ((theform.password2.value.length<3) || (theform.password2.value.length>20)){
		alert("密码的长度应该为3-20位");
		theform.password2.focus();
		return (false);
		}
		
	if (theform.password1.value != theform.password2.value){
		alert("两次输入密码不匹配");
		theform.password2.focus();
		return (false);
		}

	if (theform.username.value == theform.password2.value){
		alert("用户名不能和密码相同");
		theform.password2.focus();
		return (false);
		}
		
	if ((theform.quesion.value.length<3) || (theform.quesion.value.length>25)){
		alert("请正确输入找回密码的提示问题");
		theform.quesion.focus();
		return (false);
		}
		
	if ((theform.answer.value.length<3) || (theform.answer.value.length>25)){
		alert("请正确输入找回密码的答案");
		theform.answer.focus();
		return (false);
		}
				
    if (!CheckIsEmail(theform.email.value)){
		alert("请输入正确的邮箱地址");
		theform.email.focus();
		return false;
		}
	
	if ((theform.email.value.length<8) || (theform.email.value.length>60)){
		alert("请输入正确的邮箱地址");
		theform.email.focus();
		return (false);
		}
	
	if (theform.yesmore.checked==true){

		if (theform.face[1].checked==true){
		
			if (theform.faceurl.value==""){
			alert("自定义头像地址不能为空");
				theform.faceurl.focus();
				return (false);
				}
				
			if (theform.facewidth.value==""){
				alert("自定义头像宽度不能为空");
				theform.facewidth.focus();
				return (false);
				}

			if ((theform.facewidth.value < 32) || (theform.facewidth.value > 132)){
				alert("自定义头像宽度不符合规定");
				theform.facewidth.focus();
				return (false);
				}
		
			if (theform.faceheight.value==""){
				alert("自定义头像高度不能为空");
				theform.faceheight.focus();
				return (false);
			}
		
			if ((theform.faceheight.value < 32) || (theform.faceheight.value > 132)){
				alert("自定义头像高度不符合规定");
				theform.faceheight.focus();
				return (false);
				}
			}
				
		if (theform.qianming.value.length>250){
			alert("签名长度太长了,应该在250字内,并且不支持UBB或HTML标签");
			theform.qianming.focus();
			return (false);
			}
			
		if (theform.introduction.value.length>300){
			alert("个人简介应该在300字内,并且不支持UBB或HTML标签");
			theform.introduction.focus();
			return (false);
			}
			
		if (theform.agreement.checked != true){
			alert("您必须接受用户注册协议后才能正式注册成为我们的会员");
			theform.agreement.focus();
			return (false);
			}
		}
		
	if (theform.u_key.value.length<4){
		alert("请填写完整的验证码");
		theform.u_key.focus();
		return (false);
		}
	return (true);
	}


//--check_user_edit_reginfo----------------------------------------------------------------------------------


	function check_user_edit_reginfo(theform){

	if ((theform.password1.value!="")||(theform.password2.value!="")){
	if ((CheckName(theform.password1.value)==false)||(CheckName(theform.password2.value)==false)){
		theform.password1.focus();
		alert("密码中含有非法字符！");
		return false;
		}

	if (theform.password1.value != theform.password2.value){
		alert("两次输入密码不匹配");
		theform.password2.focus();
		return (false);
		}

	if ((theform.password1.value.length<3) || (theform.password1.value.length>20)){
		alert("密码的长度应该为3-20位");
		theform.password1.focus();
		return (false);
		}

	if ((theform.password2.value.length<3) || (theform.password2.value.length>20)){
		alert("密码的长度应该为3-20位");
		theform.password2.focus();
		return (false);
		}
		
	if (theform.password1.value != theform.password2.value){
		alert("两次输入密码不匹配");
		theform.password2.focus();
		return (false);
		}
	}
	
	if ((theform.quesion.value.length<3) || (theform.quesion.value.length>25)){
		alert("请正确输入找回密码的提示问题");
		theform.quesion.focus();
		return (false);
		}
		
	if (theform.answer.value!=""){
	if ((theform.answer.value.length<3)||(theform.answer.value.length>25)){
		alert("请正确输入找回密码的答案");
		theform.answer.focus();
		return (false);
		}
	}
				
    if (!CheckIsEmail(theform.email.value)){
		alert("请输入正确的邮箱地址");
		theform.email.focus();
		return false;
		}

	if ((theform.email.value.length<8) || (theform.email.value.length>60)){
		alert("请输入正确的邮箱地址");
		theform.email.focus();
		return (false);
		}
	
	if (theform.yesmore.checked==true){

		if (theform.face[1].checked==true){
		
			if (theform.faceurl.value==""){
			alert("自定义头像地址不能为空");
				theform.faceurl.focus();
				return (false);
				}
				
			if (theform.facewidth.value==""){
				alert("自定义头像宽度不能为空");
				theform.facewidth.focus();
				return (false);
				}

			if ((theform.facewidth.value < 32) || (theform.facewidth.value > 132)){
				alert("自定义头像宽度不符合规定");
				theform.facewidth.focus();
				return (false);
				}
		
			if (theform.faceheight.value==""){
				alert("自定义头像高度不能为空");
				theform.faceheight.focus();
				return (false);
			}
		
			if ((theform.faceheight.value < 32) || (theform.faceheight.value > 132)){
				alert("自定义头像高度不符合规定");
				theform.faceheight.focus();
				return (false);
				}
			}
				
		if (theform.qianming.value.length>250){
			alert("签名长度太长了,应该在250字内,并且不支持UBB或HTML标签");
			theform.qianming.focus();
			return (false);
			}
			
		if (theform.introduction.value.length>300){
			alert("个人简介应该在300字内,并且不支持UBB或HTML标签");
			theform.introduction.focus();
			return (false);
			}
		}
		
	if (theform.u_key.value.length<4){
		alert("请填写完整的验证码");
		theform.u_key.focus();
		return (false);
		}
	return (true);
	}
	
//--check_hotel_Booking_centres----------------------------------------------------------------------------------


	function hotel_Booking_centres(theform){
	
	if (theform.arrive_time.value==""){
		alert("请制订您需入住酒店的时间");
		theform.arrive_time.focus();
		return (false);
		}

	if (theform.arrive_time.value==null){
		alert("入住酒店的时间格式不正确");
		theform.arrive_time.focus();
		return (false);
		}

	if (theform.leave_time.value==""){
		alert("请制订您需离开酒店的时间");
		theform.leave_time.focus();
		return (false);
		}

	if (theform.leave_time.value==null){
		alert("离开酒店的时间格式不正确");
		theform.leave_time.focus();
		return (false);
		}
		
	if (! CheckDate(theform.arrive_time.value,theform.leave_time.value)) {
		alert('入住酒店的时间不能大于或等于离开酒店时间');
		theform.leave_time.focus();
		return false;
	}

	if (theform.arrive_time.value == theform.leave_time.value){
		alert("离开酒店时间不能和入住酒店的时间相同");
		theform.arrive_time.focus();
		return (false);
		}
		
	if (!CheckIsNumber(theform.personcount.value) || (theform.personcount.value<=0)) {
		alert("入住人数只能填写数字,最少1人");
		theform.personcount.focus();
		return false;
		}
		
	if (theform.clientname1.value=="") {
		alert("入住登记人第一登记人姓名不能留空");
		theform.clientname1.focus();
		return false;
		}
		
	if (theform.ArrivalWay.value=="") {
		alert("请填写您的到达目的地方式");
		theform.ArrivalWay.focus();
		return false;
		}
		
	if (theform.ArrivalWay.value=="") {
		alert("请填写您的到达目的地方式");
		theform.ArrivalWay.focus();
		return false;
		}
		
	if (theform.contactname.value=="") {
		alert("联系人姓名项不能留空");
		theform.contactname.focus();
		return false;
		}
		
	if ((theform.contactname.value.length<2) || (theform.contactname.value.length>20)){
		alert("联系人姓名不能少于2个或多于20个中文字符");
		theform.contactname.focus();
		return (false);
		}
				
	if (!CheckIsEmail(theform.email.value)){
		alert("请输入正确的邮箱地址");
		theform.email.focus();
		return false;
		}
	
	if ((theform.email.value.length<8) || (theform.email.value.length>50)){
		alert("请输入正确的邮箱地址");
		theform.email.focus();
		return (false);
		}
		
	if (theform.userkey.value.length<4){
		alert("请填写完整的验证码");
		theform.userkey.focus();
		return (false);
		}		
	return (true);
	}

//--check_Travel_Booking_centres----------------------------------------------------------------------------------

	function travel_Booking_centres(theform){
	
	if (theform.tempteam.value==1) {
	if (theform.team.value=="") {
		alert("贵社或组团人项不能为空");
		theform.team.focus();
		return false;
		}
	}
	
	if (!CheckIsNumber(theform.personcount1.value) || (theform.personcount1.value<=0)) {
		alert("来游人数大人只能填写数字,最少1人");
		theform.personcount1.focus();
		return false;
		}

	if (theform.personcount2.value.length>0) {
	if (!CheckIsNumber(theform.personcount2.value) || (theform.personcount2.value<=0)) {
		alert("来游人数小孩项只能填写数字,最少1人");
		theform.personcount2.focus();
		return false;
		}
	}
	
	if (theform.personcount3.value.length>0) {
	if (!CheckIsNumber(theform.personcount3.value) || (theform.personcount3.value<=0)) {
		alert("来游人数老人项只能填写数字,最少1人");
		theform.personcount3.focus();
		return false;
		}
	}
	
	if (theform.arrive_time.value==""){
		alert("请制订您需来游的时间");
		theform.arrive_time.focus();
		return (false);
		}

	if (theform.arrive_time.value==null){
		alert("来游的时间格式不正确");
		theform.arrive_time.focus();
		return (false);
		}

	if (theform.leave_time.value==""){
		alert("请制订您需返程的时间");
		theform.leave_time.focus();
		return (false);
		}

	if (theform.leave_time.value==null){
		alert("返程的时间格式不正确");
		theform.leave_time.focus();
		return (false);
		}

	if (! CheckDate(theform.arrive_time.value,theform.leave_time.value)) {
		alert('来游的时间不能大于或等于返程时间');
		theform.leave_time.focus();
		return false;
	}

	if (theform.arrive_time.value == theform.leave_time.value){
		alert("来游时间不能和返程的时间相同");
		theform.arrive_time.focus();
		return (false);
		}
		
	if (theform.contactname.value=="") {
		alert("主要联系人项不能留空");
		theform.contactname.focus();
		return false;
		}
		
	if ((theform.contactname.value.length<2) || (theform.contactname.value.length>20)){
		alert("联系人姓名不能少于2个或多于20个中文字符");
		theform.contactname.focus();
		return (false);
		}
		
	if (!CheckIsEmail(theform.email.value)){
		alert("请输入正确的邮箱地址");
		theform.email.focus();
		return false;
		}
	
	if ((theform.email.value.length<8) || (theform.email.value.length>50)){
		alert("请输入正确的邮箱地址");
		theform.email.focus();
		return (false);
		}
		
	if (theform.userkey.value.length<4){
		alert("请填写完整的验证码");
		theform.userkey.focus();
		return (false);
		}		
	return (true);
	}


//--check_Railroad_Booking_centres----------------------------------------------------------------------------------

	function railroad_Booking_centres(theform){
	
	if (!CheckIsNumber(theform.Roomcount.value) || (theform.Roomcount.value<=0)) {
		alert("订购票数错误,最少1张");
		theform.Roomcount.focus();
		return false;
		}
	
	if (theform.arrive_time.value==""){
		alert("请指定您的需票时间");
		theform.arrive_time.focus();
		return (false);
		}

	if (theform.arrive_time.value==null){
		alert("需票时间格式不正确");
		theform.arrive_time.focus();
		return (false);
		}
		
	if (theform.contactname.value=="") {
		alert("联系人项不能留空");
		theform.contactname.focus();
		return false;
		}
		
	if ((theform.contactname.value.length<2) || (theform.contactname.value.length>20)){
		alert("联系人姓名不能少于2个或多于20个中文字符");
		theform.contactname.focus();
		return (false);
		}
		
	if (!CheckIsEmail(theform.email.value)){
		alert("请输入正确的邮箱地址");
		theform.email.focus();
		return false;
		}
	
	if ((theform.email.value.length<8) || (theform.email.value.length>50)){
		alert("请输入正确的邮箱地址");
		theform.email.focus();
		return (false);
		}
		
	if (theform.userkey.value.length<4){
		alert("请填写完整的验证码");
		theform.userkey.focus();
		return (false);
		}		
	return (true);
	}



//--check_Airplane_Booking_centres----------------------------------------------------------------------------------

	function airplane_Booking_centres(theform){
	
	if (!CheckIsNumber(theform.Roomcount.value) || (theform.Roomcount.value<=0)) {
		alert("订购票数错误,最少1张");
		theform.Roomcount.focus();
		return false;
		}
	
	if (theform.arrive_time.value==""){
		alert("请指定您的需票时间");
		theform.arrive_time.focus();
		return (false);
		}

	if (theform.arrive_time.value==null){
		alert("需票时间格式不正确");
		theform.arrive_time.focus();
		return (false);
		}
		
	if (theform.contactname.value=="") {
		alert("联系人项不能留空");
		theform.contactname.focus();
		return false;
		}
		
	if ((theform.contactname.value.length<2) || (theform.contactname.value.length>20)){
		alert("联系人姓名不能少于2个或多于20个中文字符");
		theform.contactname.focus();
		return (false);
		}
		
	if (!CheckIsEmail(theform.email.value)){
		alert("请输入正确的邮箱地址");
		theform.email.focus();
		return false;
		}
	
	if ((theform.email.value.length<8) || (theform.email.value.length>50)){
		alert("请输入正确的邮箱地址");
		theform.email.focus();
		return (false);
		}
		
	if (theform.approval.checked==false){
		alert("您阅读接受注意事项的内容后才可完成预订");
		theform.approval.focus();
		return (false);
		}
		
	if (theform.userkey.value.length<4){
		alert("请填写完整的验证码");
		theform.userkey.focus();
		return (false);
		}		
	return (true);
	}


//--check_car_Booking_centres----------------------------------------------------------------------------------

	function car_Booking_centres(theform){
	
	if (!CheckIsNumber(theform.personcount.value) || (theform.personcount.value<=0)) {
		alert("用车总人数最少1人且只能填写数字");
		theform.personcount.focus();
		return false;
		}
	
	if (theform.arrive_time.value==""){
		alert("请指定您的需用车时间");
		theform.arrive_time.focus();
		return (false);
		}

	if (theform.arrive_time.value==null){
		alert("需用车时间格式不正确");
		theform.arrive_time.focus();
		return (false);
		}
		
	if (theform.contactname.value=="") {
		alert("联系人项不能留空");
		theform.contactname.focus();
		return false;
		}
		
	if ((theform.contactname.value.length<2) || (theform.contactname.value.length>20)){
		alert("联系人姓名不能少于2个或多于20个中文字符");
		theform.contactname.focus();
		return (false);
		}
		
	if (!CheckIsEmail(theform.email.value)){
		alert("请输入正确的邮箱地址");
		theform.email.focus();
		return false;
		}
	
	if ((theform.email.value.length<8) || (theform.email.value.length>50)){
		alert("请输入正确的邮箱地址");
		theform.email.focus();
		return (false);
		}
		
	if (theform.userkey.value.length<4){
		alert("请填写完整的验证码");
		theform.userkey.focus();
		return (false);
		}		
	return (true);
	}


//--check_Travel_select----------------------------------------------------------------------------------

	function travel_Travel_select(theform){
	
	if (theform.shi.value=="") {
		alert("必须选择目的地城市");
		theform.shi.focus();
		return false;
		}
	return (true);
	}

//--check_Tourist_attractions_select----------------------------------------------------------------------------------

	function Tourist_attractions_select(theform){
	
	if (theform.shi.value=="") {
		alert("必须选择目的地城市");
		theform.shi.focus();
		return false;
		}
	if (theform.word.value=="") {
		alert("景点关键字不能为空");
		theform.word.focus();
		return false;
		}	
	return (true);
	}

//--check_news_select----------------------------------------------------------------------------------

	function news_select(theform){
	
	if (theform.shi.value=="") {
		alert("二级分类是必须选择的");
		theform.shi.focus();
		return false;
		}
	if (theform.word.value=="") {
		alert("关键字不能为空");
		theform.word.focus();
		return false;
		}	
	return (true);
	}
	
	
//--check_news_select----------------------------------------------------------------------------------

	function book(theform){
	
	if (theform.xingming.value=="") {
		alert("姓名没有填写");
		theform.xingming.focus();
		return false;
		}
		
	if (theform.email.value=="") {
		alert("信箱地址没有填写");
		theform.email.focus();
		return false;
		}
		
	if (!CheckIsEmail(theform.email.value)){
		alert("请输入正确的邮箱地址");
		theform.email.focus();
		return false;
		}
	
	if ((theform.email.value.length<8) || (theform.email.value.length>50)){
		alert("请输入正确的邮箱地址");
		theform.email.focus();
		return (false);
		}
		
	if ((theform.title.value.length<5) || (theform.title.value.length>20)){
		alert("标题长度5—20个字符");
		theform.title.focus();
		return (false);
		}
		
	if ((theform.neirong.value.length<10) || (theform.neirong.value.length>800)){
		alert("留言内容长度10—800个字符");
		theform.neirong.focus();
		return (false);
		}
	
	if (theform.u_key.value.length<4){
		alert("请填写完整的验证码");
		theform.u_key.focus();
		return (false);
		}
				
	return (true);
	}
	

//--check_go_select----------------------------------------------------------------------------------


	function hotel_go_select(theform){
	
	if (theform.go.value==""){
		alert("查询关键字不能为空");
		theform.go.focus();
		return (false);
		}
	return (true);
	}	
//-->