document.onkeydown=function(event){
    var e = event || window.event || arguments.callee.caller.arguments[0];
    if (e && e.keyCode == 13) {
        login();
    } 
}
/**
 * 供货商登录
 */
function login(){
    var name=$("#name").val();
	if(!name){$.showErr('请输入账号',0,'hc');return false;}
	
    var pwd=$("#password").val();
	if(!pwd){$.showErr('请输入密码',0,'hc');return false;}
	
    var verify=$("#verify").val();
	if(!verify){$.showErr('请输入验证码',0,'hc');return false;}
	
    var query= new Object();
    query = $("form[name='myform']").serialize();
    $.ajax({
        type: "POST",
        url: APP + "Supplier/Register/dologin",
        data: query,
        success: function(data){
            if(data.status == 1){
                $.showSuccess(data.info, 0, 'hc');
                window.location.href = data.url;
            }else{
                $.showErr(data.info,0,'hc');
				$("#verify_img").click();
				if(data.url){window.location.href = data.url;}
            }
        }
    });
}



