var send_pending=0;


function login() {
	if(send_pending==1) return false;
	send_pending=1;
	$("#input_submit").addClass("dis");

	$.ajax({
		url: "includes/ajax/login.php?SID="+SID,
		data: "login="+$.trim($("#input_login").val())+"&password="+$.trim($("#input_password").val()),
		type: "post",
		dataType: "script",
		cache: false,
		error: function(request) { alert("ServerSide form validation error!"); send_pending=0; },
		success: function(response) { }
	});
	return false;
}


$().ready(function(){
	$("#login_form").bind("submit",function(){ login(); return false; });
	$("#top_logo").animate({"top":"50%"},750,"easeOutElastic");
	$("input.input").addClass("white");

	setTimeout(function(){
		$("#input_submit").hide();
		$("div.form").show();
		$("input.input").animate(
			{"width":"220px","margin":"0px","border-width":"1px"},
			{duration:300, specialEasing: { width: "easeOutBack"}, complete:function(){
				$("input.input").css({"padding-right":"8px","padding-left":"40px","width":"172px"});
				$("#input_login").focus();
				$("input.input").removeClass("white");
			}}
		);
	},100);
	setTimeout(function(){	$("#input_submit").fadeIn(350);	},200);
	setTimeout(function(){	$("div.fields").fadeIn(200);		},450);
});