//Input BG_Change
var bkColor = "#FFFFFF";
function getEvent(e) {
  if(window.event != null) {
	return event;
   }
   return e;
}

function setBKColor(e){
 e = getEvent(e); var src =  e.srcElement || e.target; if(src != null) {
   src.style.bkColor = src.style.backgroundColor;
   src.style.backgroundColor = bkColor;
 }
}
function reSetBKColor(e){
 e = getEvent(e); var src =  e.srcElement || e.target; if(src != null) {
   src.style.backgroundColor = src.style.bkColor;
 }
}
//END BG_Change

//START AJAX
function getXMLHttpObject ( )
{
	var xmlhttp = false;
	try { xmlhttp = new XMLHttpRequest ( ); }
	catch ( e ) { try { xmlhttp = new ActiveXObject ( 'Microsoft.XMLHTTP' ); } catch ( e ){} }
	return xmlhttp;
}
/*function Ajax(){
var username = getObj ( 'username' );
var password = getObj ( 'password' );
var xmlHttp=null; // Defines that xmlHttp is a new variable.
 // Try to get the right object for different browser
 try {
    // Firefox, Opera 8.0+, Safari, IE7+
    xmlHttp = new XMLHttpRequest(); // xmlHttp is now a XMLHttpRequest.
 } catch (e) {
    // Internet Explorer
    try {
       xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
       xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
 }
 xmlHttp.onreadystatechange = function() {
    if (xmlHttp.readyState == 4)
       try { // In some instances, status cannot be retrieved and will produce 
             // an error (e.g. Port is not responsive)
          if (xmlHttp.status == 200) {
             // Set the main HTML of the body to the info provided by the 
             // Ajax Request
             document.getElementById("Login_Info").innerHTML 
                = xmlHttp.responseText;
          }
       } catch (e) {
          document.getElementById("ajax_output").innerHTML 
             = "Error on Ajax return call : " + e.description;
       }
 
 }
 xmlHttp.open("get", "login.php?username=" + escape (un.value) + "&pass=" + escape (pw.value), true ); // .open(RequestType, Source);
 xmlHttp.send(null);
}*/
	function Ajax ( )
	{
	    var xmlhttp = getXMLHttpObject ( );
	    var username = getObj ( 'username' );
	    var password = getObj ( 'password' );
	    var result = getObj ( 'login_info' );

	    if ( xmlhttp && username && password && result )
	    {
	        if ( xmlhttp )
	        {
	            //result.style.display = 'inline';
	            var checkURL = 'login.php?username=' + escape ( username.value ) + '&pass=' + escape ( password.value );
	            xmlhttp.onreadystatechange = function ( )
	            {
	                if ( xmlhttp.readyState == 4 )
	                    if ( xmlhttp.status == 200 )
	                        result.innerHTML = xmlhttp.responseText;
	                    else
	                        alert ( 'Unable to make XMLHttpRequest: ' + xmlhttp.status );
	            }
	            xmlhttp.open ( 'GET', checkURL, true );
	            xmlhttp.send ( null );
	        }
	        else
	        {
	            alert ( 'SHTIHTISIHTHIST' );
	        }
	    }
	}
 //END AJAX