// JavaScript Document
var xmlHttpX1;

function login(u, p)
{
	xmlHttpX1 = GetXmlHttpObjectX1();
	if(xmlHttpX1 == null)
	{
		alert("Your browser does not support AJAX!");
		return;
	}
	
	var urlX1 = "login.asp?un=" + document.getElementById("username").value + "&ps=" + document.getElementById("password").value;
	var anticacheX1 = (urlX1.indexOf("?") != -1) ? "&" + new Date().getTime() : "?" + new Date().getTime();
	xmlHttpX1.open("GET", urlX1 + anticacheX1, true);
	xmlHttpX1.onreadystatechange = stateChangedX1;
	xmlHttpX1.send(null);
}

function stateChangedX1()
{ 
	if (xmlHttpX1.readyState==4)
	{ 
	document.getElementById("divLoginMSG").innerHTML=xmlHttpX1.responseText;
	}
	else
	{
	document.getElementById("divLoginMSG").innerHTML="Please wait. Login in progress...";
	}
}


function GetXmlHttpObjectX1()
{
var xmlHttpX1=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttpX1=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttpX1=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttpX1=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttpX1;
}


