
	function isYes(){
		if (G('myOK').checked==false) {
			G("bt1").disabled=true;
		} else {
			G("bt1").disabled=false;
		}
	}

	function toggle(div){

		$("#"+div).toggle(2000);//显示隐藏切换,参数可以无
	}

	//检测账号
	function UserCheck(obj,result,type){
		var UserName=$("#"+obj).val();
		if (UserName=="") {
			window.alert("用户名称不能为空！");
			$("#"+obj).get(0).focus();
			return false;
		}
		if (UserName.lenb()<4) {
			window.alert("用户名称不能小于4个字符！");
			$("#"+obj).get(0).focus();
			return false;
		}
		$("#"+result).html('<span style="color:#cccccc">正在检测，请稍候...</span>');
		var myRnd=GetRndNum(1,100000);
		$.get("/jQueryGetData.php",{Action:"GetUserCheck",UserName:UserName,Rnd:myRnd,Type:type},function(Data){
			if (Data!='') {
				$("#"+result).html(Data);
			}
		});
	}

	//检测公司名称
	function CompanyCheck(obj,result,type){
		var UserName=$("#"+obj).val();
		if (UserName=="") {
			window.alert("公司名称不能为空！");
			$("#"+obj).get(0).focus();
			return false;
		}
		if (UserName.lenb()<4) {
			window.alert("公司名称不能小于4个字符！");
			$("#"+obj).get(0).focus();
			return false;
		}
		$("#"+result).html('<span style="color:#cccccc">正在检测，请稍候...</span>');
		var myRnd=GetRndNum(1,100000);
		$.get("/jQueryGetData.php",{Action:"GetCompanyCheck",UserName:UserName,Rnd:myRnd},function(Data){
			if (Data!='') {
				$("#"+result).html(Data);
			}
		});
	}

	function RegChk(){
		if (G("yhm").value=="") {
			window.alert('用户名不能为空！');
			G("yhm").focus();
			return false;
		}
		if (G("yhm").value.length<2) {
			window.alert('请输入正确的用户名称，不能小于两个字符！');
			G("yhm").focus();
			return false;
		}

		if (G("mm1").value.length<7) {
			window.alert('请输入正确的密码，长度不能小于7个字符！');
			G('mm1').focus();
			return false;
		}

		if (G("mm2").value!=G("mm1").value) {
			window.alert('两次输入的密码不一致，请检查！');
			G('mm2').focus();
			return false;
		}

		if (G("sjhm").value=='') {
			window.alert('手机号码不能为空！');
			G("sjhm").focus();
			return false;
		}

		if (G("sjhm").value.length!=11) {
			window.alert('请输入正确的手机号码！');
			G("sjhm").focus();
			return false;
		}

		if (G("dzyj").value=='') {
			alert('电子邮件不能为空！');
			G('dzyj').focus();
			return false;
		}


		if (G("dzyj").value.length > 0 && isEmail(G("dzyj").value)==false) {
			 alert("EMAIL格式错误，请重新输入！");
			 G("dzyj").focus();
			 return false;
		 }

		$.get("GetData.php",{Action:"GetUserCheck",UserName:$("#gs_name").val()},function(Data){
			if (Data!='') {
				//alert(Data);
				if (Data=="恭喜，此用户名未被注册！"){
					G("form1").submit();
				} else {
					window.alert('请检测您的用户名是否存在！');
					return false;
				}
			}
		});

	}





//CharMode函数
//测试某个字符是属于哪一类
function CharMode(iN) {
   if (iN>=48 && iN <=57) //数字

    return 1;
   if (iN>=65 && iN <=90) //大写字母
    return 2;
   if (iN>=97 && iN <=122) //小写
    return 4;
   else
    return 8; //特殊字符
}

//bitTotal函数
//计算出当前密码当中一共有多少种模式
function bitTotal(num) {
   modes=0;
   for (i=0;i<4;i++) {
    if (num & 1) modes++;
     num>>>=1;
    }
   return modes;
}

//checkStrong函数
//返回密码的强度级别
function checkStrong(sPW) {
   if (sPW.length<=4)
    return 0; //密码太短
    Modes=0;
    for (i=0;i<sPW.length;i++) {
     //测试每一个字符的类别并统计一共有多少种模式
     Modes|=CharMode(sPW.charCodeAt(i));
   }
   return bitTotal(Modes);
}

//pwStrength函数
//当用户放开键盘或密码输入框失去焦点时,根据不同的级别显示不同的颜色

function pwStrength(pwd,num) {
   O_color="#eeeeee";
   L_color="#FF0000";
   M_color="#FF9900";
   H_color="#33CC00";
   if (pwd==null||pwd==''){
    	Lcolor=Mcolor=Hcolor=O_color;
   }
   else {
    	S_level=checkStrong(pwd);
		switch(S_level) {
			case 0:
				 Lcolor=Mcolor=Hcolor=O_color;
			case 1:
				 Lcolor=L_color;
				 Mcolor=Hcolor=O_color;
				 break;
			case 2:
				 Lcolor=Mcolor=M_color;
				 Hcolor=O_color;
				 break;
			default:
			 	Lcolor=Mcolor=Hcolor=H_color;
    	}
   }
   G("strength_L"+num).style.background=Lcolor;
   G("strength_M"+num).style.background=Mcolor;
   G("strength_H"+num).style.background=Hcolor;
	return;
}

/* 会员注册类型 鼠标事件*/
function myOver(objID,RegType) {
	//if (G("MemType").value!='') return false;
	for(k=1;k<=4;k++) {
		G("myReg"+k).style.display="none";
		if (parseInt(objID)!=k) {
			G("myType"+k).className="td";

		} else {
			G("myType"+k).className="tdsel";
		}
	}
	G("RegType").value=RegType;
	G("myReg"+objID).style.display="";

}


	/*企业员工注册检测*/
	function _Company() {
		if (G("gsmc").value=="") {
			alert("公司名称不能为空！")
			G("gsmc").focus();
			return false;
		}
		if (G("gslx").value=="") {
			alert("请选择公司类型！")
			G("gslx").focus();
			return false;
		}
		if (G("hy").value=="") {
			alert("请输入所属行业！")
			G("hy").focus();
			return false;
		}
		if (G("gsdz").value=="") {
			alert("请输入公司地址！")
			G("gsdz").focus();
			return false;
		}
		if (G("xm").value=="") {
			alert("请输入姓名！")
			G("xm").focus();
			return false;
		}
		if (G("bm").value=="") {
			alert("请输入所属部门！")
			G("bm").focus();
			return false;
		}
		if (G("zw").value=="") {
			alert("请输入职务！")
			G("zw").focus();
			return false;
		}
		if (G("dh").value=="") {
			alert("请输入联系电话！")
			G("dh").focus();
			return false;
		}
		if (G("dzyx").value.length > 0 && isEmail(G("dzyx").value)==false) {
			 alert("EMAIL格式错误，请重新输入！");
			 G("dzyx").focus();
			 return false;
		}
		if (G("qy_yzm").value=="" || G("qy_yzm").value.length<3) {
			alert("请输入正确的验证码！")
			G("qy_yzm").focus();
			return false;
		}

	}

	/*同行会员注册账号检测是否为空 */
	function _SameBusiness() {
		if (G("th_yhm").value=="") {
			alert("用户名不能为空！");
			G("th_yhm").focus();
			return false;
		}
		if (G("th_yhm").value.lenb()<4) {
			alert("用户名不能小于4个字符！");
			G("th_yhm").focus();
			return false;
		}
		if (G("th_mm1").value=="") {
			alert("用户名密码不能为空！");
			G("th_mm1").focus();
			return false;
		}
		if (G("th_mm1").value.length<6) {
			alert("密码不能小于6个字符！");
			G("th_mm1").focus();
			return false;
		}
		if (G("th_mm2").value=="") {
			alert("确认密码不能为空！");
			G("th_mm2").focus();
			return false;
		}
		if (G("th_mm1").value!=G("th_mm2").value) {
			alert("您两次输入的密码不一致！");
			G("th_mm1").focus();
			return false;
		}
/*		if (G("th_csrq").value=="") {
			alert("请输入您的出生日期！！");
			G("th_csrq").focus();
			return false;
		}
*/		if (G("th_zsxm").value=="") {
			alert("真实姓名不能为空！！");
			G("th_zsxm").focus();
			return false;
		}
		if (G("th_sjhm").value.length!=11 || isNaN(G("th_sjhm").value)) {
			window.alert('请输入正确的手机号码！');
			G("th_sjhm").focus();
			return false;
		}
/*		if (G("th_dzyj").value=='') {
			alert('电子邮件不能为空！');
			G('th_dzyj').focus();
			return false;
		}
*//*		if (G("th_dzyj").value.length > 0 && isEmail(G("th_dzyj").value)==false) {
			 alert("EMAIL格式错误，请重新输入！");
			 G("th_dzyj").focus();
			 return false;
		}
*/
		if (G("zj1").checked==false && G("zj2").checked==false && G("zj3").checked==false && G("zj4").checked==false && G("zj5").checked==""){
			alert("请选择证件!");
			G("zj1").focus();
			return false;
		}
		if(G("jy1").checked==false && G("jy2").checked==false){
			alert("请选择是否有机票经验!");
			G("jy1").focus();
			return false;
		}
		if (G("th_yzm").value=='') {
			alert('请输入验证码！');
			G('th_yzm').focus();
			return false;
		}
		if (G("th_yzm").value.length!=4) {
			alert('请输入正确的验证码！');
			G('th_yzm').focus();
			return false;
		}
	}

	function _Hotel () {
		if (G("jd_yhm").value=="") { alert("用户名不能为空！");G("jd_yhm").focus();return false;}
		if (G("jd_yhm").value.lenb()<4) { alert("用户名不能小于4个字符！");G("jd_yhm").focus();return false;}
		if (G("jd_mm1").value=="") { alert("密码不能为空！");G("jd_mm1").focus();return false;}
		if (G("jd_mm2").value=="") { alert("确认密码不能为空！");G("jd_mm2").focus();return false;}
		if (G("jd_mm1").value!=G("jd_mm2").value) { alert("您两次输入的密码不一致！");G("jd_mm1").focus();return false;}
		if (G("jd_jdmc").value=="") {alert("酒店名称不能为空！");G("jd_jdmc").focus();return false;}
		if (G("jd_jdfr").value=="") {alert("酒店法人不能为空！");G("jd_jdfr").focus();return false;}
		if (G("jd_jdmc").value.lenb()<6) {alert("请输入正确的酒店名称！");G("jd_jdmc").focus();return false;}
		if (G("jd_ssqy1").value=="") { alert("请选择所属区域的省或直辖市！");G("jd_ssqy1").focus();return false;}
		if (G("jd_ssqy2").value=="") { alert("请选择所属区域的 市！");G("jd_ssqy2").focus();return false;}
		if (G("jd_ssqy3").value=="") { alert("请选择所属区域的 县或区！");G("jd_ssqy3").focus();return false;}
		if (G("jd_lxdz").value=="") { alert("请输入联系地址！");G("jd_lxdz").focus();return false;}
		if (G("jd_lxdz").value.lenb()<8) { alert("输入正确的联系地址！");G("jd_lxdz").focus();return false;}
		if (G("jd_lxr").value=="") { alert("请输入联系人");G("jd_lxr").focus();return false;}
		if (G("jd_lxdh").value=="") { alert("联系电话不能为空！");G("jd_lxdh").focus();return false;}
		if (G("jd_cz").value=="") { alert("传真不能为空！");G("jd_cz").focus();return false;}
		if (G("jd_cz").value.length<11) { alert("请输入正确的传真号码！");G("jd_cz").focus();return false;}
		if (G("jd_lxdh").value=="") { alert("联系电话不能为空！");G("jd_lxdh").focus();return false;}
		if (G("jd_lxdh").value.length<11) { alert("请输入正确的联系电话！");G("jd_lxdh").focus();return false;}
		if (G("jd_dzyx").value.length > 0 && isEmail(G("jd_dzyx").value)==false) {
			  alert("请输入正确的电子邮箱地址！\n\n支持有效格式：abc@xx.ccc");
			 G("jd_dzyx").focus();
			 return false;
		}
		if (G("jd_sslx").value=="") { alert("请选择所属类型！");G("jd_sslx").focus();return false;}
		if (G("jd_jdxj").value=="") { alert("请选择酒店星级！");G("jd_jdxj").focus();return false;}
	}

	function _Travel(){
		if (G("ly_yhm").value=="") { alert("用户名不能为空！");G("ly_yhm").focus();return false;}
		if (G("ly_yhm").value.lenb()<4) { alert("用户名不能小于4个字符！");G("ly_yhm").focus();return false;}
		if (G("ly_mm1").value=="") { alert("密码不能为空！");G("ly_mm1").focus();return false;}
		if (G("ly_mm2").value=="") { alert("确认密码不能为空！");G("ly_mm2").focus();return false;}
		if (G("ly_mm1").value!=G("ly_mm2").value) { alert("您两次输入的密码不一致！");G("ly_mm1").focus();return false;}
		//if (G("ly_biming").value=="") {alert("笔名不能为空！");G("ly_biming").focus();return false;}
		if (G("ly_truename").value=="") {alert("真实姓名不能为空！");G("ly_truename").focus();return false;}
		/*if(document.getElementsByName("ly_sex")[0].checked||document.getElementsByName("ly_sex")[1].checked){
		}
		else{
			alert("请选择性别！");
			document.getElementsByName("ly_sex")[0].focus();
			return false;
		}*/
		/*if (!isMobile(G("ly_sjhm").value)) {
			G("ly_sjhm").focus();
			alert("请填写正确的手机号码！");
			return false;
		}*/
		//if (G("ly_yzbm").value=="") {alert("请填写邮政编码！");G("ly_yzbm").focus();return false;}
		//if (G("ly_dzyx").value=="") {alert("请填写电子邮箱！");G("ly_dzyx").focus();return false;}
		if (G("ly_province").value=="") { alert("请选择所属区域的省或直辖市！");G("ly_province").focus();return false;}
		if (G("ly_city").value=="") { alert("请选择所属区域的 市！");G("ly_city").focus();return false;}
		if (G("ly_area").value=="") { alert("请选择所属区域的 县或区！");G("ly_area").focus();return false;}
		if (G("ly_gsmc").value=="") {alert("请填写公司名称！");G("ly_gsmc").focus();return false;}
		if(document.getElementById("TravelType").options[document.getElementById("TravelType").options.selectedIndex].value==87){
			obj=document.getElementsByName("MainProduct");
			index=obj.length;
			count = 0;
			str = ",";
			for(i=0;i<index;i++){
				if(obj[i].checked){
					str += obj[i].value + ",";
					count++;
				}
			}
			document.getElementById("MainProducts").value = str;
			if(count==0){
				alert("请选择主要产品");
				return false;
			}
		}
		else{
			//if (G("ly_szbm").value=="") {alert("请填写所在部门！");G("ly_szbm").focus();return false;}
			//if (G("ly_zw").value=="") {alert("请填写职务！");G("ly_zw").focus();return false;}
			/*
			if (G("ly_frdb").value=="") {alert("请填写法人代表！");G("ly_frdb").focus();return false;}*/
		}
	}

	/*注册条款是否同意*/
	function clause(thisid,obj) {
		G(thisid).checked==false?G(obj).disabled=true:G(obj).disabled=false;
	}

	function chooseTravelType(){
		type = document.getElementById("TravelType").value;
		if(type==87){
			document.getElementById("MainProduct").style.display = "block";
			document.getElementById("caigoushang").style.display = "none";
		}
		else{
			document.getElementById("MainProduct").style.display = "none";
			document.getElementById("caigoushang").style.display = "block";
		}
	}