// JavaScript Document for Log Actions
$(document).ready(function(){
	//alert("ready");
	function genErrorMsg(msg) {
		var error;
		error = '<div class="message errormsg"><p>'+ msg +'</p></div>';
		return error;
	}
	$("#signin").submit(function(){
		
		var str = $(this).serialize();
		$.ajax({
			type: "POST",
			url: sitepath+"log.action.php",
			data: str,
			success: function(msg){
				//alert(msg);
				$("#note").ajaxComplete(function(event, request, settings){
					if(msg.indexOf("#")!=-1) {
						var submsg = msg.split("#");
						if(submsg[0] == '200') {
							window.location = submsg[1];
						}
					} else {
						result = genErrorMsg(msg);
					}
					$(this).html(result);
			});
		}});return false;
	});
});
