$(document).ready(function(){
	$("#submit").click(function(){
	var emailPattern = /([a-zA-Z0-9_\-\.\+]+)@((\[a-z]{1,3}\.[a-z]{1,3}\.[a-z]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})/;
	var email = $("#email").val();
	var pwd = $("#paswword").val();
	if(!email || !pwd || !emailPattern.test(email)) {
		$(".InputContainer_input").addClass("InputText-error");
	    $(".InputText_errorLabel").html("Bad user name or password");
	}
	else {
		jsLogin(email, pwd);
	}
    });
    
    $("#paswword").keypress(function(e){
	if(e.keyCode==13){
	    $("#submit").click();
	}
		});
});