/////////////////////////////////////////////////////////////////////////////////////////

var xmlHttp = createXmlHttpRequestObject(); 

function createXmlHttpRequestObject() 

{	

  var xmlHttp;

  if(window.ActiveXObject)

  {

    try

    {

      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");

    }

    catch (e) 

    {

      xmlHttp = false;

    }

  }

  else

  {

    try 

    {

      xmlHttp = new XMLHttpRequest();

    }

    catch (e) 

    {

      xmlHttp = false;

    }

  }

  if (!xmlHttp)

 

    alert("Error creating the XMLHttpRequest object.");

  else 

    return xmlHttp;

}

function LoadState()

{

  if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)

  {

	idState = document.getElementById("State").value;

    xmlHttp.open("GET", "loadState.php?id="+idState+"&sel=0", true);  

    xmlHttp.onreadystatechange = handleServerResponse;

    xmlHttp.send(null);

  }

 else setTimeout("LoadState()", 1000);

}



function handleServerResponse() 

{

  if (xmlHttp.readyState == 4) 

  {

    if (xmlHttp.status == 200) 

    {

    xmlResponse = xmlHttp.responseText;

//MainProfile

/** ------------ Profile Customization [start][ET] ----------- **/
	if (xmlResponse == "0" || xmlResponse == 0) { 
/** ------------ Profile Customization [end][ET] ------------- **/

	document.getElementById("RowForm").style.display=""; 

	document.getElementById("RowFormS").style.display="none";  

	document.getElementById("PState").innerHTML='<select class=input_select name=State[0]><option value=0>1</option></select>';
	
	}

	else { 

	document.getElementById("RowForm").style.display="none"; 

	document.getElementById("RowFormS").style.display=""; 

	document.getElementById("PState").innerHTML =xmlResponse;

		 }

	}

    else 

    {

      alert("There was a problem accessing the server: " + xmlHttp.statusText);

    }

  }

}	

/////////////////////////////////////////////////////////////////////////////////////////
