//閫氱敤妫�鏌ョ櫥闄�  涓枃锛岃喘涔版椂楠岃瘉
j$=jQuery.noConflict();
function is_login(productId,countryId) {
	var timer;
	timer = new Date();
	rnd = timer.getTime();
	j$.get("/ajaxPhp/login_check.php?t="+rnd,function(data){
		//if(data == 1) {
			location.href = "/ordering.php?act=one&productId="+productId+"&countryId="+countryId;
		//} 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 en_is_login(productId,countryId) {
	var timer;
	timer = new Date();
	rnd = timer.getTime();
	j$.get("/ajaxPhp/login_check.php?t="+rnd,function(data){
		//if(data == 1) {
			location.href = "/ordering.php?act=one&productId="+productId+"&countryId="+countryId+"&language=3";
		//} 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 movefocus(e,id){
	var a = 0;
	var e = e || event;
	a = e.keyCode || e.which || e.charCode;
	if(a == 9){
		j$('#' + id).focus();
	}
}
function getType_2(){
	
}
function login(e){
	var a = 0;
	var e = e || event;
	a = e.keyCode || e.which || e.charCode;
	if(a == 13){
		j$('#submit').click();
	}
}



function get_backUrl() {
	var backUrl = location.href;
	j$("#backUrl").val(backUrl);
}

function userNameFocus() {
	j$("#UserName").focus();
}

function getRadio(i){
document.getElementById(i).checked=true;
getChecked(i);
}
function getChecked(i){	
	j$("#type option").each(function(){			
		if(j$(this).val()==i){
			j$(this).attr("selected","selected"); 
			getSubmit();
			}
		}) 

}

function getChecked2(i){	
	j$("#type option").each(function(){			
		if(j$(this).val()==i){
			j$(this).attr("selected","selected"); 
			getSubmit2();
			}
		}) 

}

function getType_2(){	
	var typeId=j$("#type").val(); 
	j$.get( "/ajaxPhp/admin/product.php?act="+"getTypeId2&id="+typeId,function(data){	
		     j$("#LeiXing_1").html(data);
		 });	
}
function en_getType_2(){	
	var typeId=j$("#type").val(); 
	j$.get( "/ajaxPhp/admin/product.php?act="+"engetTypeId2&id="+typeId,function(data){	
		     j$("#LeiXing_1").html(data);
		 });	
}
function en_getRadio(i){
	document.getElementById(i).checked=true;
	en_getChecked(i);
	}
function en_getChecked(i){	
	j$("#type option").each(function(){			
		if(j$(this).val()==i){
			j$(this).attr("selected","selected"); 
			en_getSubmit();
			}
		}) 

}
function en_getSubmit(){
	var productName=encodeURI(j$("#productName").val());
	var typeId=j$("#type").val();
	var typeId2=j$("#product_radio").val();	
	 j$("div.ProductsList").html('');	
	j$.ajax({	     
		   type: "GET",
		   cache:false,		 
		   url: "/product_list.php?act=search&language=3&productName="+productName+"&typeId="+typeId+"&typeId2="+typeId2,
		   success: function(msg){
		   //alert(msg[0]['ProductName']);		
		 location.href="/product_list.php?act=search&language=3productName="+productName+"&typeId="+typeId+"&typeId2="+typeId2;
		   }
		 });
	     j$("#loading").ajaxStart(function(){
   			j$(this).append("加载中...");
 	 	  });
	}	
function getSubmit(){
	var productName=encodeURI(j$("#productName").val());
	var typeId=j$("#type").val();
	var typeId2=j$("#product_radio").val();
	 j$("div.ProductsList").html('');	
	j$.ajax({	     
		   type: "GET",
		   cache:false,		 
		   url: "/product_list.php?act=search&productName="+productName+"&typeId="+typeId+"&typeId2="+typeId2,
		   success: function(msg){
		   //alert(msg[0]['ProductName']);		
		   location.href="/product_list.php?act=search&productName="+productName+"&typeId="+typeId+"&typeId2="+typeId2;
		   }
		 });
	     j$("#loading").ajaxStart(function(){
   			j$(this).append("加载中...");
 	 	  });
	}	
	
	function getSubmit2(){
	var productName=encodeURI(j$("#productName").val());
	var typeId=j$("#type").val();
	var typeId2=j$("#product_radio").val();
	 j$("div.ProductsList").html('');	
	j$.ajax({	     
		   type: "GET",
		   cache:false,		 
		   url: "/product_list_search_"+typeId+".html",
		   success: function(msg){
		   //alert(msg[0]['ProductName']);		
		   location.href="/product_list_search_"+typeId+".html";
		   }
		 });
	     j$("#loading").ajaxStart(function(){
   			j$(this).append("加载中...");
 	 	  });
	}
function getProductType2(i){
	j$("#product_radio").val(i); 	
	getSubmit();
}

function getProductType3(i){
	j$("#product_radio").val(i); 	
	getSubmit2();
}
function en_getProductType2(i){
	j$("#product_radio").val(i); 	
	en_getSubmit();
}
function getProductType2_1(i){
	j$("#product_radio").val(j$("#"+i).val()); 
}
