/******************************************************************
******************************************************************/
//global variable for storing xml requests
var xmlreq;

/******************************************************************
******************************************************************/
function loadXmlRequest(url,callBackFunc) {

  if (window.XMLHttpRequest) {
    xmlreq = new XMLHttpRequest();
    xmlreq.onreadystatechange = callBackFunc;
    xmlreq.open('GET', url, true);
    xmlreq.send(null);
  }
  else if (window.ActiveXObject) {
    xmlreq=new ActiveXObject("Microsoft.XMLHTTP");
    if (xmlreq) {
      xmlreq.onreadystatechange = callBackFunc;
      xmlreq.open("GET",url,true);
      xmlreq.send();
    }
  } 
}
/*****************************************************************
*****************************************************************/
function processPage(searchTarget) {

  callBackFunc = function xmlHttpChange() {

	if (xmlreq.readyState == 4) {

		if(xmlreq.status == 200) writePage(xmlreq.responseText,searchTarget);
		else return "Error loading page";

  	}
  }
 
  url = "availhomes.php";
  loadXmlRequest(url,callBackFunc);

}
/*****************************************************************
*****************************************************************/
function writePage(txt,searchTarget) {
  if (txt) {

	var bloodytable = document.getElementById(searchTarget);

    bloodytable.innerHTML = txt;

	}
  
}
/*****************************************************************
FUNCTION: createEmailHome
DESCRIPTION: function calls the module that create an HTML email
            of a home listing to send.
            Module opens in new pop-up window.
*****************************************************************/
function createEmailHome(homeId) {

  parms = centerParms('400','300') + ",width=400,height=300,status=no,resizeable=yes,scrollbars=yes";
  var url = "index.php?module=emailhome&homeId="+homeId;
  emailhomewin = window.open(url,"_emailhome",parms);

}
/******************************************************************
******************************************************************/
function showPicture(url)
{
  window.open(url,'_new',"width=660,height=500,resizable=yes");
  
}
/******************************************************************
******************************************************************/
function e2gallery(url)
{
  window.open(url,'_new',"width=680,height=700,resizable=yes");
  
}
/*
//EOF
*/




