function handleHttpResponse() {    
if (http.readyState == 4) { 
if(http.status==200) { 
var results=http.responseText; 
var signout = "Sign Out";
var signin = "Sign In";
if(results=="Your username and password is incorrect")
{
alert(results);
}
else
{
var img = document.getElementById('change');
img.innerHTML=signout;
img.href="logout.php";
img.onclick = function func2(){alert("You have successfully logged out");img.innerHTML=signin;}
window.location = results;
}
} 
} 
}
function requestCustomerInfo() {      
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
var url="getuser.php";
url=url+"?username="+username;
url=url+"&password="+password; 
http.open("GET", url , true); 
http.onreadystatechange = handleHttpResponse; 
http.send(null); 
} 
function getHTTPObject() { 
var xmlhttp; 
if(window.XMLHttpRequest){ 
xmlhttp = new XMLHttpRequest(); 
} 
else if (window.ActiveXObject){ 
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
if (!xmlhttp){ 
xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
} 
} 
return xmlhttp; 
} 
var http = getHTTPObject(); // We create the HTTP Object 