/**************************************************************************************************************/
// Create xmlhttp object based on browsertype
function getHTTPObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
	  xmlhttp.overrideMimeType("text/xml"); 
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}
/**************************************************************************************************************/
// Define global variables to be used throughout
var tableBusy = false;
var tableHttp = getHTTPObject();
var step1Over = false;
var row = "";
/**************************************************************************************************************/

/*********************************************************/
//	Update Member Fields
/*********************************************************/

function updateBio(newValue)
{
	
	if (!tableBusy)
	{		
		var url = "actions.php?pmode=updateBio&bio=" + newValue + "&hash=" + Math.random();					
		tableHttp.open("POST", url, true);
		tableHttp.onreadystatechange = updateBioResponse;
		tableBusy = true;
		tableHttp.send(null);
	}
}

function updateBioResponse()
{
	if (tableHttp.readyState == 4)
	{
		if (tableHttp.responseText.indexOf('invalid') == -1)
		{
			try
			{
				var output = tableHttp.responseText;
				alert(output);
				tableBusy = false;
			} // end try 
			catch(e)
			{
				alert("Error: " + e) ;
			} // end try catch
		} // end if response index -1
	} // end if readystate 4
} // end tableresponse function


function updatefname(newValue)
{
	
	if (!tableBusy)
	{		
		var url = "actions.php?pmode=updatefname&fname=" + newValue + "&hash=" + Math.random();			
		tableHttp.open("POST", url, true);
		tableHttp.onreadystatechange = updatefnameResponse;
		tableBusy = true;
		tableHttp.send(null);
	}
}

function updatefnameResponse()
{
	if (tableHttp.readyState == 4)
	{
		if (tableHttp.responseText.indexOf('invalid') == -1)
		{
			try
			{
				var output = tableHttp.responseText;
				alert(output);
				tableBusy = false;
			} // end try 
			catch(e)
			{
				alert("Error: " + e) ;
			} // end try catch
		} // end if response index -1
	} // end if readystate 4
} // end tableresponse function


function updatelname(newValue)
{
	
	if (!tableBusy)
	{		
		var url = "actions.php?pmode=updatelname&lname=" + newValue + "&hash=" + Math.random();			
		tableHttp.open("POST", url, true);
		tableHttp.onreadystatechange = updatelnameResponse;
		tableBusy = true;
		tableHttp.send(null);
	}
}

function updatelnameResponse()
{
	if (tableHttp.readyState == 4)
	{
		if (tableHttp.responseText.indexOf('invalid') == -1)
		{
			try
			{
				var output = tableHttp.responseText;
				alert(output);
				tableBusy = false;
			} // end try 
			catch(e)
			{
				alert("Error: " + e) ;
			} // end try catch
		} // end if response index -1
	} // end if readystate 4
} // end tableresponse function

