// JavaScript Document

function GetXmlHttpObject()
{
	var xmlHttps=null;
	try
 	{
 		// Firefox, Opera 8.0+, Safari
 		xmlHttps=new XMLHttpRequest();
 	}
	catch (e)
 	{
 		//Internet Explorer
 		try
  		{
  			xmlHttps=new ActiveXObject("Msxml2.XMLHTTP");
  		}
 		catch (e)
  		{
  			xmlHttps=new ActiveXObject("Microsoft.XMLHTTP");
  		}
 	}
	return xmlHttps;
}


function loginStateChanged() 
{ 
	if(xmlHttps.readyState!=4 || xmlHttps.readyState!="complete")
	{
		document.getElementById("_login").innerHTML = "Checking Login...";
	}
	if (xmlHttps.readyState==4 || xmlHttps.readyState=="complete")
 	{ 
 		document.getElementById("_login").innerHTML=xmlHttps.responseText 
 	} 
}

function login_check()
{	
	xmlHttps=GetXmlHttpObject()
	if (xmlHttps==null)
 	{
 		alert ("Browser does not support HTTP Request")
 		return
 	} 

	var url="http://www.pep.ph/auth.php";
	
	xmlHttps.onreadystatechange=loginStateChanged;
	xmlHttps.open("GET",url,true);
	xmlHttps.send(null);
}

