function CheckLogin() {
	if ((document.getElementById("username").value == "") || (document.getElementById("password").value == "")) {
		alert("Please fill in all fields.");
		return;
	}
	
	var timeoutValue = 10 * 1000;
    $.ajaxSetup({timeout : timeoutValue});

	
	$.ajax({
	   type: "POST",
	   url: "Procs/CheckLogin.asp",
	   data: "username="+document.getElementById("username").value+"&password="+document.getElementById("password").value,
	   success: function(msg){
		 if (msg=="ok") {
		 	window.location = 'Personal-documents.asp';
		 }  
		 else {
			 alert("The user name or password is incorrect.");
		 }
	   },
	   error   : function(xhr, text, error) {
		   alert(text);
	   }
	});
}
