function logincheck(){
	var username = $('#username').val();
	var password = $('#password').val();
	

	$.post("buiapp/login/login.php",
  {
    user: username,
    pass: password
  },
  function(data, status){
	 
	  var relt = data;
   if(relt == 1){
		$("#submit-id-submit").html('Signing In ...');
		setTimeout('window.location.href = "dashboard.php"',2000);
	}else if(relt == "Reg"){
		$("#submit-id-submit").html('Redirecting to Register Page...');
		setTimeout(' window.location.href = "buiapp/phpClasses/registerstaff.php"',2000);
	}else if(relt == 0){
		//alert("Wrong Staff Id/Password!!!");
		$("#error").html("Wrong Staff Id/Password!!!").show();
	}
  });
	
	
	
	
}

  function myFunction() {
  var x = document.getElementById("password");
  if (x.type === "password") {
    x.type = "text";
  } else {
    x.type = "password";
  }
}