var xmlhttp;

function InitAjax() 
{
	try 
	{
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} 
	catch (e1) 
	{
		try 
		{
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch (e2) 
		{
			xmlhttp = null;
		}
	}

	if (! xmlhttp) 
	{
		if (typeof XMLHttpRequest != "undefined") 
		{
			xmlhttp = new XMLHttpRequest();
		} 
	}
	
	xmlhttp.onreadystatechange = DataReceived
}

function  DataReceived()
{
			switch (xmlhttp.readyState) 
			{
				case 4:
					try 
					{
						if ( xmlhttp.responseText == "OK" )
						    location.href="members/home.aspx";
						else
						    alert(xmlhttp.responseText);
					}
					catch ( e ) {  }
					break;
			}
}

function ShowLogin()
{

    var userId="";
    var pass="";
    
    if ( UserID )
        userId=UserID.value;
    else
        userId=document.all.UserID.value;

    if ( Password )
        pass=Password.value;
    else
        pass=document.all.Password.value;
    
    
    if ( userId.length ==0 )
    {
		alert('Please enter your ID, then click Log In.\n\nIf you do not know your ID or if you have trouble logging in, please e-mail support@ielassoc.org.');
		return;
    }
    if ( pass.length==0 )
    {
		alert('Please enter your password, then click Log In.\n\nIf you do not know your password or if you have trouble logging in, please e-mail support@ielassoc.org.');
		return;
    }
    
    var url="members/LoginMember.aspx?UID=" + userId + "&pass=" + pass;
	InitAjax();
	xmlhttp.open("GET", url);
	xmlhttp.onreadystatechange = DataReceived;
	xmlhttp.send(null);
}
        


		

