
var hxmlHttp;


function askHomeQuestion()
{ 
    hideSubmit();
    hideFoster();
    hideDate();
   
hxmlHttp=GetXmlHttpObject();
if (hxmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
 
var url="ajax/triage.php";
url=url+"?action=home";
url=url+"&sid="+Math.random();
hxmlHttp.onreadystatechange=homeQStateChanged;

hxmlHttp.open("GET",url,true);
hxmlHttp.send(null);

}

function homeQStateChanged() 
{ 
   //alert(bxmlHttp.readyState);
if (hxmlHttp.readyState==4 || hxmlHttp.readyState=="complete")
 { 
   
 document.getElementById('athomelocation').innerHTML=hxmlHttp.responseText;
 } 
}


var fxmlHttp;


function askFosterQuestion()
{ 
   
    hideSubmit();
    hideHome();
    hideDate();
   
fxmlHttp=GetXmlHttpObject();
if (fxmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
 
var url="ajax/triage.php";
url=url+"?action=foster";
url=url+"&sid="+Math.random();
fxmlHttp.onreadystatechange=fosterQStateChanged;

fxmlHttp.open("GET",url,true);
fxmlHttp.send(null);
}

function fosterQStateChanged() 
{ 
  
if (fxmlHttp.readyState==4 || fxmlHttp.readyState=="complete")
 { 
     
 document.getElementById('foster').innerHTML=fxmlHttp.responseText;
 } 
}


var dxmlHttp;


function askDateAcquired(ownership)
{ 
   hideSubmit();
dxmlHttp=GetXmlHttpObject();
if (dxmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
 
var url="ajax/triage.php";
url=url+"?action=date";
url=url+"&ownership="+ownership;
url=url+"&sid="+Math.random();
dxmlHttp.onreadystatechange=dateAcquiredStateChanged;

dxmlHttp.open("GET",url,true);
dxmlHttp.send(null);
}

function dateAcquiredStateChanged() 
{ 
   //alert(bxmlHttp.readyState);
if (dxmlHttp.readyState==4 || dxmlHttp.readyState=="complete")
 { 
  
 document.getElementById('dateacquired').innerHTML=dxmlHttp.responseText;
 } 
 showSubmit();
}

function showSubmit()
{
    st="<input type='submit' name='submit' id='submit' value='Continue' />";
    document.getElementById('submitbutton').innerHTML=st;
}
function hideSubmit()
{
    st="";
    document.getElementById('submitbutton').innerHTML=st;
}
function hideHome()
{
  
    st="";
    document.getElementById('athomelocation').innerHTML=st;
}
function hideFoster()
{
    st="";
    document.getElementById('foster').innerHTML=st;
}
function hideDate()
{
    st="";
    document.getElementById('dateacquired').innerHTML=st;
}
