function chklogin(m){
	var stremail = /^(([0-9a-zA-Z]+)|([0-9a-zA-Z]+[_.0-9a-zA-Z-]*[0-9a-zA-Z]+))@([a-zA-Z0-9-]+[.])+([a-zA-Z]{2,4})$/g;
	var strnull = /^[\s|　]+$/;
	var objUsername;
	var objPassword;
	if(m=='cn')
	{
		uTip="请输入正确的用户名";
		pTip="请输入密码";
	}
	else
	{
		uTip="Your User name incorrect";
		pTip="Your password is inquired!";
	}
	objUsername=document.getElementsByName('email')[0];	
	objPassword=document.getElementsByName("password")[0];	
	if(stremail.test(objUsername.value)==false){
		alert(uTip);
		objUsername.focus();
		return false;
	}
	
	if(strnull.test(objPassword.value)||objPassword.value==""){
		alert(pTip);
		objPassword.focus();
		return false;
	}
	
	document.getElementsByName("btnConfirm")[0].disabled=true;
	return true;
}
function detectCnLogin()
{
	
	var val=getCookie("exportcode");	
	if(val==null||val=="")
	{
		showLoginTxt();
	}	
}
function detectEnLogin()
{
	
	var val=getCookie("exportcode");	
	if(val==null||val=="")
	{
		showLoginTxtEn2();
	}	
	else
	{
		showLoginTxtEn();
	}
}
function showLoginTxt()
{

	document.writeln("	 <tr>");
	document.writeln("        <td height=\"45\" colspan=\"5\">		");
	document.writeln("		<table width=\"762\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" ");
	document.writeln("		 style=\"border:1px solid #AACBEC\" align=\"center\" id=\"dv_idx_login\">");
	document.writeln("	 <form action=\"/wcne/myexport/CheckLogin.php\" method=\"post\" name=\"form2\" id=\"form2\" onSubmit=\"return chklogin('cn');\">");
	document.writeln("	 <tr bgcolor=\"#EAF4FE\">");
	document.writeln("		<td width=\"180\" align=\"center\"><img src=\"images/dl.gif\" width=\"99\" height=\"34\"></td>");
	document.writeln("		<td width=\"300\">用户名：");
	document.writeln("		  <input name=\"email\" id=\"email\" type=\"text\" size=\"10\"> &nbsp;");
	document.writeln("		  密码：");
	document.writeln("		  <input name=\"password\" id=\"password\" type=\"password\" size=\"10\"></td>");
	document.writeln("		<td><input type=\"submit\" name=\"btnConfirm\" value=\" \"  class=\"cs_btn_pic\" style=\" background-image: url(images/but_dl.gif); border:0; width:49px; height:21px;\">");
	document.writeln("		 &nbsp; &nbsp; <input type=\"button\" name=\"btnCommon\" value=\" \"  ");
	document.writeln("		 onClick=\"location.href='/wcne/myexport/agreement.php'\"");
	document.writeln("		  class=\"cs_btn_pic\"  style=\" background-image: url(images/but_zc.gif); border:0; width:81px; height:21px;\"></td>");
	document.writeln("		<td width=\"100\"><a href=\"/wcne/Myexport/PasswdQuery.php\">忘记密码？</a></td>");
	document.writeln("	  </tr>");
	document.writeln("	  </form>");
	document.writeln("	</table></td></tr>");
}
function showLoginTxtEn2()
{
	document.writeln("");
document.writeln("			  <table width=\"173\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#C6C6C6\"  id=\"dv_idx_login\">");
document.writeln("			  <tr>");
document.writeln("				<td height=\"26\" bgcolor=\"#E4E2E3\"> &nbsp;<span class=\"title\">Login for members</span> </td>");
document.writeln("			  </tr>");
document.writeln("			  <tr>");
document.writeln("				<td height=\"146\" align=\"center\" bgcolor=\"#FFFFFF\">");
document.writeln("				 <table width=\"168\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
document.writeln("				   <form action=\"/wcne/myexport/CheckLogin.php\" method=\"post\"");
document.writeln("				    name=\"form2\" id=\"form2\" onSubmit=\"return chklogin('en');\"><tr>");
document.writeln("					<td height=\"33\">&nbsp;User name:</td>");
document.writeln("				   <td><input name=\"email\" id=\"email\" type=\"text\" size=\"10\"></td>");
document.writeln("				  </tr>");
document.writeln("				  <tr>");
document.writeln("					<td height=\"33\" align=\"left\">&nbsp;Password:</td>");
document.writeln("				   <td><input name=\"password\" id=\"password\"  type=\"password\" size=\"10\"></td>");
document.writeln("				 </tr>");
document.writeln("				  <tr> ");
document.writeln("					<td height=\"33\" align=\"center\"><input name=\"btnConfirm\" type=\"submit\"  class=\"cs_btn_pic\" value=\" \"");
document.writeln("					style=\" background-image: url(images/login2.gif); border:0; width:40px; height:20px;\"></td>");
document.writeln("					<td align=\"center\"><input name=\"btnCommon\" type=\"button\" ");
document.writeln("					 onClick=\"location.href='/wcne/myexport/agreement.php'\" value=\" \"");
document.writeln("					 class=\"cs_btn_pic\"  style=\" background-image: url(images/joinnow.gif); border:0; width:67px; height:20px;\"></td>");
document.writeln("				  </tr>");
document.writeln("				 <tr>");
document.writeln("				   <td height=\"33\" colspan=\"2\" align=\"center\"><a href=\"/wcne/Myexport/PasswdQuery.php\">Forget your password?<br>");
document.writeln("					 Click here!</a> </td>");
document.writeln("				   </tr></form>");
document.writeln("				 </table>	");
document.writeln("				</td>");
document.writeln("			  </tr>");
document.writeln("			</table>");
}
function showLoginTxtEn()
{
	document.writeln("<table width=\"100%\" height=\"175\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#C6C6C6\" id=\"f\">");
document.writeln("                  <tr>");
document.writeln("                    <td height=\"163\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
document.writeln("                        <tr>");
document.writeln("                          <td width=\"15\" rowspan=\"3\"></td>");
document.writeln("                          <td><div align=\"center\"><a href=\"myexport\"><img src=\"images/E2CE_b01.gif\" width=\"135\" height=\"29\" border=\"0\"></a></div></td>");
document.writeln("                          <td width=\"10\" rowspan=\"3\"></td>");
document.writeln("                        </tr>");
document.writeln("                        <tr>");
document.writeln("                          <td height=\"10\"></td>");
document.writeln("                        </tr>");
document.writeln("                        <tr>");
document.writeln("                          <td class=\"E_T4\">Post products that you suppose to export to China. E2C will show your products to Chinese buyers through our English and <a href=\"../../wcn/index.htm\" class=\"E_L2\">Chinese</a> websites.</td>");
document.writeln("                        </tr>");
document.writeln("                    </table></td>");
document.writeln("                  </tr>");
document.writeln("              </table>");
}