//通用棄1�7查登附1�7  中文，购买时验证
function is_login() {
	var timer;
	timer = new Date();
	rnd = timer.getTime();
	$.get("/ajaxPhp/login_check.php?t="+rnd,function(data){
		if(data == 1) {
			location.href = "/QaSearchList.php?act=list&sub2=1";
		} else {
			ymPrompt.win("<form action='/login.php?act=login' name='loginForm'  id='loginForm' method='POST' style='padding:0px; margin:15px auto; width:300px; height:auto;'><ul style='padding:0px; margin:0px; width:100%; height:auto; font-size:12px;'><li style='list-style:none; height:20px; margin-top:10px; line-height:20px; float:left;'><span style='width:80px; float:left; display:block; text-align:right;'>账号:</span><input type='text' name='UserName' id='UserName' value='' onkeyup='movefocus(event, \"Password\");' style='width:180px; float:left; color:#666666;'/></li><li style='list-style:none; height:20px; margin-top:10px; line-height:20px;  float:left;'><span style='width:80px; float:left; display:block; text-align:right;'>密码:</span><input type='password' name='Password' id='Password' value='' onkeypress='movefocus(event, \"validate\");' style='width:180px; float:left; color:#666666;'/></li><li style='list-style:none; height:20px; margin-top:10px; line-height:20px;  float:left;'><span style='width:80px; float:left; display:block; text-align:right;'>验证码：</span><input type='text' name='validate' id='validate' onkeyup='login(event);'  style='width:100px; float:left; color:#666666;'/><img src='/inc/class/validate.php' name='validateImg' id='validateImg' style='float:left;'onclick='reloadValidate(validate,validateImg);' /></li><li style='list-style:none; height:30px; margin-top:10px; text-align:center; line-height:30px;  float:left;'><input type='submit' name='submit' id='submit' value='登陆' style='width:80px; margin-left:80px; height:30px; line-height:30px;'/><input type='button' name='' id='' value='还没有账号' onClick='back_register()' style='border:none; background:none;'/><input type='hidden' name='backUrl' id='backUrl' value='' /></li></ul></form>",350,200,"登陆!");
			get_backUrl();
			$('#UserName').focus();
		}
	});
}
function is_login1() {
	var timer;
	timer = new Date();
	rnd = timer.getTime();
	$.get("/ajaxPhp/login_check.php?t="+rnd,function(data){
		if(data == 1) {
			location.href = "/QaSearchList.php?act=list&sub3=1";
		} else {
			ymPrompt.win("<form action='/login.php?act=login' name='loginForm'  id='loginForm' method='POST' style='padding:0px; margin:15px auto; width:300px; height:auto;'><ul style='padding:0px; margin:0px; width:100%; height:auto; font-size:12px;'><li style='list-style:none; height:20px; margin-top:10px; line-height:20px; float:left;'><span style='width:80px; float:left; display:block; text-align:right;'>账号:</span><input type='text' name='UserName' id='UserName' value='' onkeyup='movefocus(event, \"Password\");' style='width:180px; float:left; color:#666666;'/></li><li style='list-style:none; height:20px; margin-top:10px; line-height:20px;  float:left;'><span style='width:80px; float:left; display:block; text-align:right;'>密码:</span><input type='password' name='Password' id='Password' value='' onkeypress='movefocus(event, \"validate\");' style='width:180px; float:left; color:#666666;'/></li><li style='list-style:none; height:20px; margin-top:10px; line-height:20px;  float:left;'><span style='width:80px; float:left; display:block; text-align:right;'>验证码：</span><input type='text' name='validate' id='validate' onkeyup='login(event);'  style='width:100px; float:left; color:#666666;'/><img src='/inc/class/validate.php' name='validateImg' id='validateImg' style='float:left;'onclick='reloadValidate(validate,validateImg);' /></li><li style='list-style:none; height:30px; margin-top:10px; text-align:center; line-height:30px;  float:left;'><input type='submit' name='submit' id='submit' value='登陆' style='width:80px; margin-left:80px; height:30px; line-height:30px;'/><input type='button' name='' id='' value='还没有账号' onClick='back_register()' style='border:none; background:none;'/><input type='hidden' name='backUrl' id='backUrl' value='' /></li></ul></form>",350,200,"登陆!");
			get_backUrl();
			$('#UserName').focus();
		}
	});
}
function getSubmit(){
	var where=encodeURI($("#where").val());
	var status=$("#status").val();		
	$.ajax({
		   type: "GET",
		   url: "/QaSearchList.php?act=list&where="+where+"&sub1=1&status="+status,		 
		   success: function(msg){ 				  		 
		   location.href="/QaSearchList.php?act=list&where="+where+"&sub1=1&status="+status;
		   }
		 });
	}
function is_login2(id) {
	var timer;
	timer = new Date();
	rnd = timer.getTime();
	$.get("/ajaxPhp/login_check.php?t="+rnd,function(data){
		if(data == 1) {
			location.href = "/QaSearchList.php?act=list&id="+id;
		} else {
			ymPrompt.win("<form action='/login.php?act=login' name='loginForm'  id='loginForm' method='POST' style='padding:0px; margin:15px auto; width:300px; height:auto;'><ul style='padding:0px; margin:0px; width:100%; height:auto; font-size:12px;'><li style='list-style:none; height:20px; margin-top:10px; line-height:20px; float:left;'><span style='width:80px; float:left; display:block; text-align:right;'>账号:</span><input type='text' name='UserName' id='UserName' value='' onkeyup='movefocus(event, \"Password\");' style='width:180px; float:left; color:#666666;'/></li><li style='list-style:none; height:20px; margin-top:10px; line-height:20px;  float:left;'><span style='width:80px; float:left; display:block; text-align:right;'>密码:</span><input type='password' name='Password' id='Password' value='' onkeypress='movefocus(event, \"validate\");' style='width:180px; float:left; color:#666666;'/></li><li style='list-style:none; height:20px; margin-top:10px; line-height:20px;  float:left;'><span style='width:80px; float:left; display:block; text-align:right;'>验证码：</span><input type='text' name='validate' id='validate' onkeyup='login(event);'  style='width:100px; float:left; color:#666666;'/><img src='/inc/class/validate.php' name='validateImg' id='validateImg' style='float:left;'onclick='reloadValidate(validate,validateImg);' /></li><li style='list-style:none; height:30px; margin-top:10px; text-align:center; line-height:30px;  float:left;'><input type='submit' name='submit' id='submit' value='登陆' style='width:80px; margin-left:80px; height:30px; line-height:30px;'/><input type='button' name='' id='' value='还没有账号' onClick='back_register()' style='border:none; background:none;'/><input type='hidden' name='backUrl' id='backUrl' value='' /></li></ul></form>",350,200,"登陆!");
			get_backUrl();
			$('#UserName').focus();
		}
	});
}
//通用棄1�7查登附1�7  英文，购买时验证
//function en_is_login(productId) {
//	var timer;
//	timer = new Date();
//	rnd = timer.getTime();
//	$.get("/ajaxPhp/login_check.php?t="+rnd,function(data){
//		if(data == 1) {
//			location.href = "/en/en_ordering.php?act=order&productId="+productId;
//		} else {
//			ymPrompt.win("<form action='/login.php?act=login' name='loginForm'  id='loginForm' method='POST' style='padding:0px; margin:15px auto; width:300px; height:auto;'><ul style='padding:0px; margin:0px; width:100%; height:auto; font-size:12px;'><li style='list-style:none; height:20px; margin-top:10px; line-height:20px; float:left;'><span style='width:80px; float:left; display:block; text-align:right;'>user name:</span><input type='text' name='UserName' id='UserName' value='' onkeyup='movefocus(event, \"Password\");' style='width:180px; float:left; color:#666666;'/></li><li style='list-style:none; height:20px; margin-top:10px; line-height:20px;  float:left;'><span style='width:80px; float:left; display:block; text-align:right;'>password:</span><input type='password' name='Password' id='Password' value='' onkeypress='movefocus(event, \"validate\");' style='width:180px; float:left; color:#666666;'/></li><li style='list-style:none; height:20px; margin-top:10px; line-height:20px;  float:left;'><span style='width:80px; float:left; display:block; text-align:right;'>identifying code:</span><input type='text' name='validate' id='validate' onkeyup='login(event);'  style='width:100px; float:left; color:#666666;'/><img src='/inc/class/validate.php' style='float:left;'/></li><li style='list-style:none; height:30px; margin-top:10px; text-align:center; line-height:30px;  float:left;'><input type='submit' name='submit' id='submit' value='GO' style='width:80px; margin-left:80px; height:30px; line-height:30px;'/><input type='button' name='' id='' value='to register' onClick='back_register()' style='border:none; background:none;'/><input type='hidden' name='backUrl' id='backUrl' value='' /></li></ul></form>",350,200,"login!");
//			get_backUrl();
//			$('#UserName').focus();
//
//		}
//	});
//}
function en_is_login() {
	var timer;
	timer = new Date();
	rnd = timer.getTime();
	$.get("/ajaxPhp/login_check.php?t="+rnd,function(data){
		if(data == 1) {
			location.href = "/QaSearchList.php?act=list&sub2=1&language=3";
		} else {
			ymPrompt.win("<form action='/login.php?act=login&language=3' name='loginForm'  id='loginForm' method='POST' style='padding:0px; margin:15px auto; width:300px; height:auto;'><ul style='padding:0px; margin:0px; width:100%; height:auto; font-size:12px;'><li style='list-style:none; height:20px; margin-top:10px; line-height:20px; float:left;'><span style='width:80px; float:left; display:block; text-align:right;'>Name:</span><input type='text' name='UserName' id='UserName' value='' onkeyup='movefocus(event, \"Password\");' style='width:180px; float:left; color:#666666;'/></li><li style='list-style:none; height:20px; margin-top:10px; line-height:20px;  float:left;'><span style='width:80px; float:left; display:block; text-align:right;'>Password:</span><input type='password' name='Password' id='Password' value='' onkeypress='movefocus(event, \"validate\");' style='width:180px; float:left; color:#666666;'/></li><li style='list-style:none; height:20px; margin-top:10px; line-height:20px;  float:left;'><span style='width:80px; float:left; display:block; text-align:right;'>Validation code：</span><input type='text' name='validate' id='validate' onkeyup='login(event);'  style='width:100px; float:left; color:#666666;'/><img src='/inc/class/validate.php' name='validateImg' id='validateImg' style='float:left;'onclick='reloadValidate(validate,validateImg);' /></li><li style='list-style:none; height:30px; margin-top:10px; text-align:center; line-height:30px;  float:left;'><input type='submit' name='submit' id='submit' value='Login' style='width:80px; margin-left:80px; height:30px; line-height:30px;'/><input type='button' name='' id='' value='No Account' onClick='back_register()' style='border:none; background:none;'/><input type='hidden' name='backUrl' id='backUrl' value='' /></li></ul></form>",350,200,"Login!");
			get_backUrl();
			$('#UserName').focus();
		}
	});
}
function en_is_login1() {
	var timer;
	timer = new Date();
	rnd = timer.getTime();
	$.get("/ajaxPhp/login_check.php?t="+rnd,function(data){
		if(data == 1) {
			location.href = "/QaSearchList.php?act=list&language=3&sub3=1";
		} else {
			ymPrompt.win("<form action='/login.php?act=login&language=3' name='loginForm'  id='loginForm' method='POST' style='padding:0px; margin:15px auto; width:300px; height:auto;'><ul style='padding:0px; margin:0px; width:100%; height:auto; font-size:12px;'><li style='list-style:none; height:20px; margin-top:10px; line-height:20px; float:left;'><span style='width:80px; float:left; display:block; text-align:right;'>Name:</span><input type='text' name='UserName' id='UserName' value='' onkeyup='movefocus(event, \"Password\");' style='width:180px; float:left; color:#666666;'/></li><li style='list-style:none; height:20px; margin-top:10px; line-height:20px;  float:left;'><span style='width:80px; float:left; display:block; text-align:right;'>Password:</span><input type='password' name='Password' id='Password' value='' onkeypress='movefocus(event, \"validate\");' style='width:180px; float:left; color:#666666;'/></li><li style='list-style:none; height:20px; margin-top:10px; line-height:20px;  float:left;'><span style='width:80px; float:left; display:block; text-align:right;'>Validation code：</span><input type='text' name='validate' id='validate' onkeyup='login(event);'  style='width:100px; float:left; color:#666666;'/><img src='/inc/class/validate.php' name='validateImg' id='validateImg' style='float:left;'onclick='reloadValidate(validate,validateImg);' /></li><li style='list-style:none; height:30px; margin-top:10px; text-align:center; line-height:30px;  float:left;'><input type='submit' name='submit' id='submit' value='Login' style='width:80px; margin-left:80px; height:30px; line-height:30px;'/><input type='button' name='' id='' value='No Account' onClick='back_register()' style='border:none; background:none;'/><input type='hidden' name='backUrl' id='backUrl' value='' /></li></ul></form>",350,200,"Login!");
			get_backUrl();
			$('#UserName').focus();
		}
	});
}
function en_getSubmit(){
	var where=$("#where").val();
	var status=$("#status").val();		
	$.ajax({
		   type: "GET",
		   url: "/QaSearchList.php?act=list&language=3&where="+where+"&sub1=1&status="+status,		 
		   success: function(msg){ 				  		 
		   location.href="/QaSearchList.php?act=list&language=3&where="+where+"&sub1=1&status="+status;
		   }
		 });
	}
function en_is_login2(id) {
	var timer;
	timer = new Date();
	rnd = timer.getTime();
	$.get("/ajaxPhp/login_check.php?t="+rnd,function(data){
		if(data == 1) {
			location.href = "/QaSearchList.php?act=list&language=3&id="+id;
		} else {
			ymPrompt.win("<form action='/login.php?act=login&language=3' name='loginForm'  id='loginForm' method='POST' style='padding:0px; margin:15px auto; width:300px; height:auto;'><ul style='padding:0px; margin:0px; width:100%; height:auto; font-size:12px;'><li style='list-style:none; height:20px; margin-top:10px; line-height:20px; float:left;'><span style='width:80px; float:left; display:block; text-align:right;'>Name:</span><input type='text' name='UserName' id='UserName' value='' onkeyup='movefocus(event, \"Password\");' style='width:180px; float:left; color:#666666;'/></li><li style='list-style:none; height:20px; margin-top:10px; line-height:20px;  float:left;'><span style='width:80px; float:left; display:block; text-align:right;'>Password:</span><input type='password' name='Password' id='Password' value='' onkeypress='movefocus(event, \"validate\");' style='width:180px; float:left; color:#666666;'/></li><li style='list-style:none; height:20px; margin-top:10px; line-height:20px;  float:left;'><span style='width:80px; float:left; display:block; text-align:right;'>验证码：</span><input type='text' name='validate' id='validate' onkeyup='login(event);'  style='width:100px; float:left; color:#666666;'/><img src='/inc/class/validate.php' name='validateImg' id='validateImg' style='float:left;'onclick='reloadValidate(validate,validateImg);' /></li><li style='list-style:none; height:30px; margin-top:10px; text-align:center; line-height:30px;  float:left;'><input type='submit' name='submit' id='submit' value='登陆' style='width:80px; margin-left:80px; height:30px; line-height:30px;'/><input type='button' name='' id='' value='No Account' onClick='back_register()' style='border:none; background:none;'/><input type='hidden' name='backUrl' id='backUrl' value='' /></li></ul></form>",350,200,"Login!");
			get_backUrl();
			$('#UserName').focus();
		}
	});
}
function movefocus(e,id){
	var a = 0;
	var e = e || event;
	a = e.keyCode || e.which || e.charCode;
	if(a == 9){
		$('#' + id).focus();
	}
}

function login(e){
	var a = 0;
	var e = e || event;
	a = e.keyCode || e.which || e.charCode;
	if(a == 13){
		$('#submit').click();
	}
}



function get_backUrl() {
	var backUrl = location.href;
	$("#backUrl").val(backUrl);
}

function userNameFocus() {
	$("#UserName").focus();
}

