function subm()
{
	f=true;
	v=$("txt_username").value;
	d=$("Layer1");
	d.innerHTML="";
	if(v=="")
	{
		$("txt_username").style.border="#FF0000 solid 1px";
		d.style.display="block";
		d.innerHTML=d.innerHTML+'<li>用户名不能为空！</li>';
		f=false;
	}
	else
	{
		if(v.length<6 || v.length>32)
		{
			$("txt_username").style.border="#FF0000 solid 1px";
			d.style.display="block";
			d.innerHTML=d.innerHTML+'<li>用户名长度为6-32个字符！</li>';
			f=false;
		}
	}
	v1=$("txt_password").value;
	if(v1=="")
	{
		$("txt_password").style.border="#FF0000 solid 1px";
		d.style.display="block";
		d.innerHTML=d.innerHTML+'<li>密码不能为空！</li>';
		f=false;
	}
	else
	{
		if(v1.length<6 || v1.length>16)
		{
			$("txt_password").style.border="#FF0000 solid 1px";
			d.style.display="block";
			d.innerHTML=d.innerHTML+'<li>密码长度为6-16个字符！</li>';
			f=false;
		}
		
	}
	if(f){
	  $("login_bar_id").disabled=true;
	  $("login_bar_id").value="登陆中...";
	  city.login(v,v1,function(r0){
	  	$("login_bar_id").disabled=false;
	  	$("login_bar_id").value="登   录";
	  	r = r0.substring(2);
	  	r2 = r0.substring(0,1);
	  	userType = r0.substring(1,2);
		if(r == "-1"){
			d.style.display="block";
			d.innerHTML='<li>服务器内部错误，请稍候再试！</li>';
			f = false;
		}
		else if(r == "0"){
			$("txt_username").style.border="#FF0000 solid 1px";
			$("txt_password").style.border="#FF0000 solid 1px";
			d.style.display="block";
			d.innerHTML='<li>用户名或密码不正确！</li>';
			f = false;
		}
		else{
			$("loginbar").innerHTML = getLoginBarShowStr(userType,r);
			if($("isQueryResultPageFlag") != null){
				$("popdivbar").innerHTML = getLoginPopDivStr(r2,r);
			}
			f = true;	
		}
   	  });
	}
	return f;
}

function loadLoginBar(){
	city.checkUserStatus(function (r){
		userType = r.substring(0,1);
		r2 = r.substring(1);	
		$("loginbar").innerHTML = getLoginBarShowStr(userType,r2);
	});
}

function loadPopDiv(){
	var r = "";
	DWREngine.setAsync(false);
	city.checkUserStatusForPopDiv(function (result){
		r = result;
	});
	var r1 = r.substring(0,1);
	var r2 = r.substring(1);
	$("popdivbar").innerHTML = getLoginPopDivStr(r1,r2);
	if(r2 == "0"){
		openFlyBar1();
	}
	else{
		openFlyBar();
	}
}

function getLoginPopDivStr(str1,str2){
	if(str2 != "0"){
		return  "<table id=\"loginstatusid\" width=\"675\" height=\"27\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin-top:6px;\"><tr><td><div id=\"Message\" ><table width=\"344\" height=\"152\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"342\" height=\"152\"><table width=\"173\" height=\"59\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><table width=\"0\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"338\" height=\"33\" background=\"/images/dlpic1.gif\"><table width=\"325\" height=\"19\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"273\" class=\"whitefont\">&nbsp;&nbsp;天航网会员</td><td width=\"32\" class=\"white12font\"><span style=\"cursor:pointer;\" onclick=\"javascript:hideScreen();\">关闭</span></td><td width=\"20\" class=\"whitefont\"><span style=\"cursor:pointer;\" onclick=\"javascript:hideScreen();\"><img src=\"/images/close.gif\" width=\"14\" height=\"12\" /></span></td></tr></table></td></tr><tr><td height=\"69\" background=\"/images/dlpic2.gif\"><table width=\"286\" height=\"100\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tr><td colspan=\"2\" align=\"center\" id=\"relogininfo\" style=\"font-size:13px;color:red;display:none;\" ></td></tr><tr><td width=\"86\">登录帐号：</td><td width=\"200\"><input type=\"text\" id=\"reloginuserid\" name=\"reloginuserid\" style=\"border:#9FB6CD solid 1px;height:15px\" onclick=\"this.style.border='#9FB6CD solid 1px';$('relogininfo').style.display='none';\" onfocus=\"this.value=''\"/></td></tr><tr><td>登录密码：</td><td><input type=\"password\" name=\"reloginpsw\"  id=\"reloginpsw\" style=\"border:#9FB6CD solid 1px;height:15px\" onclick=\"this.style.border='#9FB6CD solid 1px';$('relogininfo').style.display='none';\" onfocus=\"this.value=''\"/></td></tr><tr><td colspan=\"2\"><div align=\"center\"><input style=\"cursor:hand\" type=\"button\" onclick=\"loginbar()\" class=\"btn9\" value=\"登录后预订\" /></div></td></tr></table></td></tr><tr><td><img src=\"/images/dlpic3.gif\" width=\"328\" height=\"11\" /></td></tr></table></td></tr></table></td></tr></table></div><div id=\"Screen\"></div><div align=\"center\"><input  type=\"button\" class=\"btn9\" value=\"返回首页\"  onclick=\"document.queryForm.action='/index.html';document.queryForm.submit();\" style=\"cursor:hand;\" />&nbsp;&nbsp;&nbsp;<input  type=\"submit\" class=\"btn9\"  onclick=\"inputorder();\" style=\"cursor:hand;\" value=\"下一步 填写订单\" /><table width=\"256\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td>&nbsp;</td></tr></table></div></td></tr></table></td></tr></table></td></tr></table>";
	}
	else{
		var r1 = "<table id=\"notloginstatusid\" width=\"675\" height=\"36\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"orangefont\">尊敬的用户，您还未登录天航网 &gt;&gt;</td></tr></table><table width=\"675\" height=\"67\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"352\"><table width=\"173\" height=\"59\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><table width=\"0\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"338\" height=\"33\" background=\"/images/dlpic1.gif\"><table width=\"237\" height=\"19\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"whitefont\">&nbsp;&nbsp;天航网会员</td></tr></table></td></tr><tr><td height=\"69\" background=\"/images/dlpic2.gif\"><table width=\"286\" height=\"90\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tr><td colspan=\"2\" align=\"center\" id=\"relogininfo\" style=\"font-size:13px;color:red;display:none;\" ></td></tr><tr><td width=\"72\">登录帐号：</td><td width=\"214\"><input type=\"text\" maxlength=\"32\" size=\"20\" id=\"reloginuserid\" name=\"reloginuserid\" style=\"border:#9FB6CD solid 1px;height:15px\" onclick=\"this.style.border='#9FB6CD solid 1px';$('relogininfo').style.display='none';\" onfocus=\"this.select();\" /></td></tr><tr><td width=\"72\">登录密码：</td><td width=\"214\"><input type=\"password\" maxlength=\"16\" size=\"21\" name=\"reloginpsw\"  id=\"reloginpsw\" style=\"border:#9FB6CD solid 1px;height:15px\" onclick=\"this.style.border='#9FB6CD solid 1px';$('relogininfo').style.display='none';\" onfocus=\"this.value=''\"/></td></tr><tr><td colspan=\"2\" align=\"center\"><input style=\"cursor:hand\" type=\"button\" onclick=\"loginbar()\" class=\"btn9\" value=\"登录后预订\" /></td></tr></table></td></tr><tr><td><img src=\"/images/dlpic3.gif\" width=\"328\" height=\"11\" /></td></tr></table></td></tr></table></td><td width=\"323\"><table width=\"19\" height=\"71\" border=\"0\" align=\"right\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><table width=\"173\" height=\"59\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><table width=\"173\" height=\"59\" border=\"0\" align=\"right\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><div id=\"Message1\">";
		var r2 = "<table width=\"363\" height=\"610\" border=\"0\" align=\"right\" cellpadding=\"0\" cellspacing=\"0\"><tr><td height=\"17\"><img src=\"/images/righboder1.gif\" width=\"671\" height=\"17\" /></td></tr><tr><td height=\"581\" valign=\"top\" background=\"/images/righboder2.gif\"><table width=\"630\" height=\"21\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"18\"><img src=\"/images/juline.gif\" width=\"18\" height=\"22\" /></td><td width=\"414\" background=\"/images/orangeline.gif\" class=\"orangefont\">用户注册</td><td width=\"198\" background=\"/images/orangeline.gif\" class=\"huicolor\">请注意：带有 <span class=\"redcolor\">*</span> 号的项目必须填写 </td></tr></table><form  id=\"regForm\" name=\"regForm\" method=\"post\" action=\"\"><table width=\"630\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tr><td height=\"49\"><table width=\"0\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td height=\"58\" colspan=\"2\">—— <span class=\"orangecolor\"><strong>请选择您的用户名</strong></span> ——————</td></tr><tr><td width=\"310\" valign=\"top\"><table width=\"311\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tr><td colspan=\"2\" ><span class=\"redcolor\">*</span> 用 户 名 ：<input name=\"reg_username\" type=\"text\" id=\"reg_username\" size=\"30\" style=\"border:#9FB6CD solid 1px;height:15px\" maxlength=\"32\" onclick=\"this.style.border='#9FB6CD solid 1px';$('error_msg_username').style.display='none';\"  onfocus=\"this.select()\" onblur=\"checkUserid()\"/><div style=\"background-color:#FFF5E1; color:#000000; padding-left:85px; font-weight:bold\" id=\"error_msg_username\"></div></td></tr></table></td><td width=\"320\">· 由字母a~z(不区分大小写)、数字0~9、下划线等组<br />&nbsp;&nbsp;&nbsp;成，不能出现汉字<br />· 只能以字母开头，长度为6-32个字符，例如xixii88</td></tr><tr><td colspan=\"2\">&nbsp;</td></tr></table></td></tr></table><table width=\"630\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tr><td height=\"33\" colspan=\"3\">—— <span class=\"orangecolor\"><strong>请填写安全设置</strong></span>（以下信息对保护您的帐号安全极为重要，请您慎重填写并牢记）  ——————</td></tr><tr><td height=\"34\" colspan=\"2\" width=\"313\"><span class=\"redcolor\">*</span> 手机号码 ：<input name=\"reg_mobile\" id=\"reg_mobile\" type=\"text\" size=\"30\" maxlength=\"11\"  style=\"border:#9FB6CD solid 1px;height:15px\" onclick=\"this.style.border='#9FB6CD solid 1px';$('error_msg_mobile').style.display='none';\"  onfocus=\"this.select()\" onblur=\"checkMobileid()\"/><div style=\"background-color:#FFF5E1; color:#000000; padding-left:85px; font-weight:bold\" id=\"error_msg_mobile\"></div></td><td width=\"317\" height=\"33\">· 中国移动或中国联通手机号码</td></tr><tr><td height=\"33\" colspan=\"2\"><span class=\"redcolor\"> </span>&nbsp;&nbsp;邮件地址 ：<input name=\"reg_email\" type=\"text\" id=\"reg_email\" size=\"30\" maxlength=\"127\" style=\"border:#9FB6CD solid 1px;height:15px\" onclick=\"this.style.border='#9FB6CD solid 1px';$('error_msg_email').style.display='none';\"  onfocus=\"this.select()\" onblur=\"checkEmail()\"/><div style=\"background-color:#FFF5E1; color:#000000; padding-left:85px; font-weight:bold\" id=\"error_msg_email\"></div></td><td>· 请填写常用邮件地址，此地址将作为找回密码依据</td></tr><tr><td height=\"33\" colspan=\"2\"><span class=\"redcolor\">*</span> 密&nbsp;&nbsp;&nbsp;&nbsp;码 ：<input name=\"reg_password\" type=\"password\" id=\"reg_password\" size=\"33\" maxlength=\"25\" style=\"border:#9FB6CD solid 1px;height:15px\" onclick=\"this.style.border='#9FB6CD solid 1px';$('error_msg_password').style.display='none';\"  onfocus=\"this.select()\" onblur=\"checkPassword1()\"/><div style=\"background-color:#FFF5E1; color:#000000; padding-left:85px; font-weight:bold\" id=\"error_msg_password\"></div></td><td height=\"33\">· 密码长度为6-16位，字母区分大小写</td></tr> <tr><td height=\"33\" colspan=\"2\"><span class=\"redcolor\">*</span> 确认密码 ：<input name=\"reg_password2\" type=\"password\" id=\"reg_password2\" size=\"33\" maxlength=\"25\"  style=\"border:#9FB6CD solid 1px;height:15px\" onclick=\"this.style.border='#9FB6CD solid 1px';$('error_msg_password2').style.display='none';\"  onfocus=\"this.select()\" onblur=\"checkPassword2()\"/><div style=\"background-color:#FFF5E1; color:#000000; padding-left:85px; font-weight:bold\" id=\"error_msg_password2\"></div></td><td height=\"33\">&nbsp;</td></tr><tr><td height=\"33\" colspan=\"2\">&nbsp;&nbsp;真实姓名 ：<input name=\"reg_name\" id=\"reg_name\" type=\"text\" size=\"30\" maxlength=\"32\" style=\"border:#9FB6CD solid 1px;height:15px\"/></td><td height=\"33\">· 请尽可能提供真实姓名,以便我们提供更周到的服务</td></tr><tr><td height=\"33\" colspan=\"2\">&nbsp;&nbsp;推 荐 人  ：<input name=\"reg_referrid\" id=\"reg_referrid\" type=\"text\" size=\"30\" maxlength=\"32\" style=\"border:#9FB6CD solid 1px;height:15px\" onclick=\"this.style.border='#9FB6CD solid 1px';$('error_msg_referrid').style.display='none';\"  onfocus=\"this.select()\" onblur=\"checkreferrid()\"/><div style=\"background-color:#FFF5E1; color:#000000; padding-left:85px; font-weight:bold\" id=\"error_msg_referrid\"></div></td><td height=\"33\">· 填写推荐人ID，可额外获得100积分，<a href=\"/jfgz.html#5\" style=\"color:red;\" target=\"blank\">积分规则</a></td></tr>";
		var r3 = "<tr><td height=\"33\"><span class=\"redcolor\">*</span> 验 证 码 ：<input name=\"reg_vcode\" type=\"text\" id=\"reg_vcode\" size=\"12\" maxlength=\"5\" style=\"border:#9FB6CD solid 1px;height:15px\" onclick=\"this.style.border='#9FB6CD solid 1px';$('error_msg_vcode').style.display='none';\"  onfocus=\"this.select()\" onblur=\"checkvcode()\"/><div style=\"background-color:#FFF5E1; color:#000000; padding-left:20px; font-weight:bold\" id=\"error_msg_vcode\"></div></td><td width=\"107\"><img id=\"imgCodeId\" alt=\"看不清，换一张图片\" style=\"cursor:hand;\" src=\"/util/validate/getimgcode.html\" onclick='this.src=\"/util/validate/getimgcode.html\"'/></td><td height=\"33\">· 请输入左侧图案中的数字</td></tr>";
		var r4 = "<tr height=\"0\"><td width=\"206\"></td><td width=\"107\"></td><td width=\"317\"></td></tr><tr><td height=\"33\" colspan=\"3\"><span class=\"redcolor\">* </span>您通过什么途径得知天航网:</td></tr><tr><td height=\"33\" colspan=\"3\"><input name=\"reg_obtain\" id=\"reg_obtain\" type=\"radio\" checked value=\"0\" /><span style=\"cursor:hand\" onclick='document.regForm.reg_obtain[0].checked=true'>朋友推荐</span>&nbsp;&nbsp;<input type=\"radio\" id=\"reg_obtain\" name=\"reg_obtain\"  value=\"1\"/><span style=\"cursor:hand\" onclick='document.regForm.reg_obtain[1].checked=true'>搜索引擎(baidu或google)</span>&nbsp;&nbsp;<input type=\"radio\" id=\"reg_obtain\" name=\"reg_obtain\"  value=\"2\"/><span style=\"cursor:hand\" onclick='document.regForm.reg_obtain[2].checked=true'>论坛BBS</span>&nbsp;&nbsp;<input type=\"radio\" id=\"reg_obtain\" name=\"reg_obtain\"  value=\"3\"/><span style=\"cursor:hand\" onclick='document.regForm.reg_obtain[3].checked=true'>报纸、杂志</span>&nbsp;&nbsp;<input type=\"radio\" id=\"reg_obtain\" name=\"reg_obtain\"  value=\"4\"/><span style=\"cursor:hand\" onclick='document.regForm.reg_obtain[4].checked=true'>其 他</span>&nbsp;&nbsp;</td></tr><tr><td height=\"33\" colspan=\"3\"><span class=\"redcolor\">* </span><input name=\"agree\" type=\"checkbox\" id=\"agree\" value=\"1\"  onclick=\"f_agree()\"/><span class=\"14font\">我已查看并同意<a href=\"/user_agreement.html\" target=\"_blank\">《天航网服务条款》</a></span> <span style=\"background-color:#FFF5E1; color:#000000; padding-left:200px; font-weight:bold\" id=\"div_agree\"></span></td></tr><tr><td height=\"13\" colspan=\"3\"></td></tr><tr><td height=\"35\" colspan=\"3\"><div align=\"center\"><input style=\"cursor:hand\" id=\"sub_btn_reg\" type=\"button\" class=\"btn5\" value=\"确认填写正确后，点击提交注册\"  onclick=\"f_submit()\"/></div></td></tr><tr><td height=\"30\" colspan=\"3\"><div align=\"center\"><span style=\"cursor:pointer;\" onclick=\"javascript:hideScreen1();\"><strong>关闭本页</strong></span></div></td></tr></table></form></td></tr><tr><td height=\"11\"><img src=\"/images/righboder3.gif\" width=\"671\" height=\"11\" /></td></tr></table>";
		var r5 = "</div><div id=\"Screen1\"></div><table width=\"0\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"338\" height=\"33\" background=\"/images/dlpic1.gif\"><table width=\"320\" height=\"19\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"194\" class=\"whitefont\">&nbsp;&nbsp;非天航网会员</td><td width=\"126\" class=\"withe12link\"><span onclick=\"javascript:showScreen1();\"  style=\"cursor:hand; color:#FFFFFF\"><strong>&gt;&gt;&gt;&gt;&gt;&gt;新用户注册&gt;&gt;</strong></span></td></tr></table></td></tr><tr><td height=\"69\" background=\"/images/dlpic2.gif\"><table width=\"286\" height=\"90\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tr><td colspan=\"2\">请输入手机号码进行预订 <label id=\"phonenumbererrorid\" style=\"font-size:13px;color:red;display:none;\"></label></td></tr><tr><td align=\"center\" colspan=\"2\" id=\"phonenumbererrorid\" style=\"font-size:13px;color:red;display:none;\"></td></tr><tr><td width=\"72\">手机号码：</td><td width=\"214\"><input type=\"text\" name=\"mobileid\" id=\"mobileid\" style=\"border:#9FB6CD solid 1px;height:15px\" onfocus=\"this.select();\" onclick=\"this.style.border='#9FB6CD solid 1px';$('phonenumbererrorid').style.display='none';\" maxlength=\"11\"/></td></tr><tr><td colspan=\"2\"><div align=\"center\"><input style=\"cursor:hand\" type=\"button\" onclick=\"checkmobile()\" class=\"btn9\" value=\"直接预订\" /></div></td></tr></table></td></tr><tr><td><img src=\"/images/dlpic3.gif\" width=\"328\" height=\"11\" /></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table><table width=\"675\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td>&nbsp;</td></tr></table></td></tr></table></td></tr></table>";	
		if(str1 == "0"){
			r3 = "";
		}
		return r1+r2+r3+r4+r5;
	}
}

function getLoginBarShowStr(userType,showName){
	var loginInnerHTML = "";
	if(showName != "0"){
		loginInnerHTML += "<table width=\"400\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>";
		loginInnerHTML += "<td width=\"400\" height=\"27\" valign=\"middle\">";
		loginInnerHTML += '<span class="orangecolor S S">★ <strong>欢迎您 </strong></span><span class="S S S">'+showName+'</span> <span class="orangecolor S S">◆</span><span class="S S S"> <a href="/profile/orderinfo.html">我的订单</a> </span><span class="orangecolor S S">◆</span><span class="S S S"> ';
		if(userType == "1"){
			loginInnerHTML += '<a href="/profile/refer/agent.html">我的业绩</a> </span>';
		}
		else if(userType == "2"){
			loginInnerHTML += '<a href="/profile/refer/signature.html">我的业绩</a> </span>';
		}
		else{
			loginInnerHTML += '<a href="/profile/mymileages.html">我的积分</a> </span>';
		}
		loginInnerHTML += '<span class="orangecolor S S">◆</span><span class="S S S"> <a href="/profile/memberinfo.html">用户中心</a> </span><strong class="orangecolor">&nbsp;<span style="cursor:hand" onclick="this.disabled=true;logout();">退出</span></strong></td></tr></table>';
	}
	else{
			loginInnerHTML += "<table width=\"400\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>";
			loginInnerHTML += "<td width=\"274\" height=\"27\" valign=\"middle\">";
			loginInnerHTML += "<input name=\"txt_username\" type=\"text\"  class=\"lg\" id=\"txt_username\" value=\"用户名/手机号\" size=\"14\" maxlength=\"32\"   onfocus=\"this.select();\"  onclick=\"document.getElementById('Layer1').style.display='none';this.style.border='#f5bc79 solid 1px'\">";
     		loginInnerHTML += " <input name=\"txt_password\" type=\"password\" class=\"lg\" id=\"txt_password\" value=\"111\" size=\"14\" maxlength=\"16\" onclick=\"$('Layer1').style.display='none';this.style.border='#f5bc79 solid 1px'\"  onfocus=\"this.value='';\">";	 
     		loginInnerHTML += " <input style=\"cursor:hand\" type=\"submit\" class=\"btn1\" value=\"登   录\" id=\"login_bar_id\"  onclick=\"return subm()\"/>";
     		loginInnerHTML += "</td>"; 
     		loginInnerHTML += "<td width=\"126\" valign=\"bottom\" align=\"right\"><a href=\"/util/resetpassword.html\"><img src=\"/images/forgetmm.gif\" width=\"56\" height=\"20\" border=\"0\" /></a> <a href=\"/member/signup.html\"><img src=\"/images/freezc.gif\" width=\"57\" height=\"20\" border=\"0\" /></a></td></tr></table>";
	}
	return loginInnerHTML;
}

function logout(){
	city.logout(function (r){
		if($("isUserCenterPanel") != null){
			window.location.href="/";
		}
		else{
			$("loginbar").innerHTML = getLoginBarShowStr("1","0");
			if($("isQueryResultPageFlag") != null){
				$("popdivbar").innerHTML = getLoginPopDivStr(r,"0");
			}
		}
	})
}

function checkmobile(){
	phoneid = trim($("mobileid").value);
	var phoneidlPat = /^((\(\d{3}\))|(\d{3}\-))?13\d{9}$/;
   	var phoneidlPat2 = /^((\(\d{3}\))|(\d{3}\-))?15\d{9}$/;
   	var phoneidlPat3 = /^((\(\d{3}\))|(\d{3}\-))?18\d{9}$/;
   	var numPat = /^\d{11}$/;
   	matchArray = phoneid.match(numPat);
   	mid=$("phonenumbererrorid");
   	if(matchArray == null){
		mid.style.display="block";
 		$("mobileid").style.border="#FF0000 solid 1px";
		mid.innerHTML='<li>手机号码只能为11位数字！</li>';
		return;
   	}
   	else{
    	matchArray=phoneid.match(phoneidlPat);
    	if (matchArray==null && phoneid.match(phoneidlPat2) == null && phoneid.match(phoneidlPat3) == null) {
 			mid.style.display="block";
 			$("mobileid").style.border="#FF0000 solid 1px";
			mid.innerHTML='<li>非13或15开头或18开头的手机号码！</li>';
			return;
    	}
    	else{
    		register.checkMobile(phoneid,function(r){
    			if( r ==  1){
    				mid.style.display="block";
					$("mobileid").style.border="#FF0000 solid 1px";
					mid.innerHTML='<li>该手机号码已被注册</li>';
					return ;
				}
				else if(r == -1){
					mid.style.display="block";
					$("mobileid").style.border="#FF0000 solid 1px";
					mid.innerHTML='<li>服务器内部错误，请稍候再试</li>';
					return ;
				}
				else if(r == 200){
					mid.style.display="block";
					$("mobileid").style.border="#FF0000 solid 1px";
					mid.innerHTML='<li>该手机号在您上次下订单时已被系统快速注册，用户名和初始密码为此手机号码，为了您帐号安全，请您登陆后及时修改密码！</li>';
					return ;
				}
				else{
				    $("userinputmobileid").value=phoneid;
    				$("ordertype").value="1";
    				document.nextstepform.submit();
				}
    		});
    	}
    }
}

function loginbar(){
	ru = $("reloginuserid");
	rp = $("reloginpsw");
	sd = $("relogininfo");
	if(ru.value == "")
	{
		ru.style.border="#FF0000 solid 1px";
		sd.style.display="block";
		sd.innerHTML='<li>用户名不能为空！</li>';
		return;
	}
	else
	{
		if(ru.value.length<6 || ru.value.length>32)
		{
			ru.style.border="#FF0000 solid 1px";
			sd.style.display="block";
			sd.innerHTML='<li>用户名长度为6-32个字符！</li>';
			return;
		}
	}
	if(rp.value=="")
	{
		rp.style.border="#FF0000 solid 1px";
		sd.style.display="block";
		sd.innerHTML='<li>密码不能为空！</li>';
		return;
	}
	else
	{
		if(rp.value.length<6 || rp.value.length>16)
		{
			rp.style.border="#FF0000 solid 1px";
			sd.style.display="block";
			sd.innerHTML='<li>密码长度为6-16个字符！</li>';
			return;
		}
	}
	city.login(ru.value,rp.value,function(data){
		s = data.substring(2);
		if(s == "-1"){
			sd.style.display="block";
			sd.innerHTML='<li>服务器内部错误，请稍候再试！</li>';
			return;
		}
		else if(s == "0"){
			ru.style.border="#FF0000 solid 1px";
			rp.style.border="#FF0000 solid 1px";
			sd.style.display="block";
			sd.innerHTML='<li>用户名或密码不正确！</li>';
			return;
		}
		else{
			$("userinputmobileid").value="";
    		$("ordertype").value="0";
			document.nextstepform.submit();
		}
   	  });
}

function getPassword(){
	var userid = trim($("userid_input_info").value);
	var email = trim($("email_input_info").value);
	if(userid == ""){
		$("userid_input_info_message_error").innerHTML = "<li>用户名不能为空</li>";
	}
	else if(email == ""){
		$("email_input_info_message_error").innerHTML = "<li>邮件地址不能为空</li>";
	}
	else{
		$("p_btn_id").disabled=true;
		$("p_btn_id").value="处理中,请稍候";
		city.resetPassword(userid,email,function(r){
			if(r == -2){
				alert("用户名或邮件地址格式不对");
			}
			else if(r == -1){
				alert("您输入的信息不匹配");
			}
			else if(r == 0){
				alert("操作失败，请稍候再试");
			}
			else{
				alert("操作成功，新密码已发送至您的邮箱中");
			}
			$("p_btn_id").disabled=false;
			$("p_btn_id").value="下一步";
		});
	}
}
