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

var xmlHttp2 = createXmlHttpRequestObject(); 

function createXmlHttpRequestObject() 

{	

  var xmlHttp2;

  if(window.ActiveXObject)

  {

    try

    {

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

    }

    catch (e) 

    {

      xmlHttp2 = false;

    }

  }

  else

  {

    try 

    {

      xmlHttp2 = new XMLHttpRequest();

    }

    catch (e) 

    {

      xmlHttp2 = false;

    }

  }

  if (!xmlHttp2)

 

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

  else 

    return xmlHttp2;

}

function LoadStateVH()

{

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

  {

	idStateVH = document.getElementById("VacationHome").value;
	
    xmlHttp2.open("GET", "loadState.php?id="+idStateVH+"&sel=2", true);  

    xmlHttp2.onreadystatechange = handleServerResponse2;

    xmlHttp2.send(null);

  }

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

}

function handleServerResponse2() 

{

  if (xmlHttp2.readyState == 4) 

  {

    if (xmlHttp2.status == 200) 

    {

    xmlResponse2 = xmlHttp2.responseText;
    
/** ------------ Profile Customization [start][ET] ----------- **/
	iCountSelected = 0;
	for (i=0; i < document.getElementById("VacationHome").options.length; i++)
	{
	    if (document.getElementById("VacationHome").options[i].selected)
	       iCountSelected++;
	}

	if ((xmlResponse2 == "0" || xmlResponse2 == 0) || (iCountSelected > 1) ) { 
/** ------------ Profile Customization [end][ET] ------------- **/

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

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

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

	}

	else { 

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

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

	document.getElementById("VHPState").innerHTML =xmlResponse2;

		 }

	} 

    else 

    {

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

    }

  }

}	



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