
/****************************************************************
* file: 	js/ajaxproperties.js
* author:	toy
* date:		4aug09
* re:		ajax routines for properties page
*
* rev history
* [toy 9jul09]		orig version
*****************************************************************/
var spinner = "<img src='../images/spinnerbrown.gif' border='0'>";

function getFeaturedProperty(propertyID,propertyStatus) {
    // gets n sets
    var xmlHTTP = GetXmlHttpObject();
    var xmlHTTP2 = GetXmlHttpObject();
    var id = encodeURIComponent(propertyID);

    if (propertyStatus != "") {
		propStatus = "&s="+propertyStatus;
	}
	else {
		propStatus = "";
	}
    var params = "id=" + id + propStatus;

    // set up ajax call
    xmlHTTP.onreadystatechange = function() {
        if (xmlHTTP.readyState == 4) {
            document.getElementById("propertyImageD").innerHTML = xmlHTTP.responseText;
        }
        else {
            //document.getElementById("propertyImageD").innerHTML = spinner;
        }
    }

    xmlHTTP2.onreadystatechange = function() {
        if (xmlHTTP2.readyState == 4) {
            document.getElementById("propertyFactsD").innerHTML = xmlHTTP2.responseText;
        }
        else {
            //document.getElementById("propertyFactsD").innerHTML = spinner;
        }
    }

    // make ajax call
    xmlHTTP.open("POST", "ajax/getFeaturedProperty.php", true);
    xmlHTTP.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHTTP.send(params);
    xmlHTTP2.open("POST", "ajax/getFeaturedPropertyInfo.php", true);
    xmlHTTP2.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHTTP2.send(params);
}

