
function showPhone(listingid, default_url) {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (exc) {
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (ex) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
				xmlhttp = false;
			}
		}
	}
	if (xmlhttp) {        
        xmlhttp.onreadystatechange = function() {
            if (xmlhttp.readyState == 4) {
                if (xmlhttp.status == 200) {
                    document.getElementById("phoneLink"+listingid).className = "controlPhoneHide";
                    document.getElementById("phoneNumber"+listingid).className = "controlPhoneShow";                
                    document.getElementById("phoneNumber"+listingid).innerHTML = xmlhttp.responseText;
                }
            }
        }
        
		xmlhttp.open("GET", default_url+'/countphoneclick.php?listing_id='+listingid, true);
		xmlhttp.send(null);
	}
    /*
    document.getElementById("phoneLink"+listingid).className = "controlPhoneHide";
    document.getElementById("phoneNumber"+listingid).className = "controlPhoneShow";                
    */	
}

function showFax(listingid, default_url) {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (exc) {
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (ex) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
				xmlhttp = false;
			}
		}
	}
	if (xmlhttp) {        
        xmlhttp.onreadystatechange = function() {
            if (xmlhttp.readyState == 4) {
                if (xmlhttp.status == 200) {
                    document.getElementById("faxLink"+listingid).className = "controlPhoneHide";
                    document.getElementById("faxNumber"+listingid).className = "controlPhoneShow";                
                    document.getElementById("faxNumber"+listingid).innerHTML = xmlhttp.responseText;
                }
            }
        }
        
		xmlhttp.open("GET", default_url+'/countfaxclick.php?listing_id='+listingid, true);
		xmlhttp.send(null);
	}
	/*
    document.getElementById("faxLink"+listingid).className = "controlFaxHide";
	document.getElementById("faxNumber"+listingid).className = "controlFaxShow";
    */
}

function showEmail(listingid, default_url) {
    try {
        xmlhttp = new XMLHttpRequest();
    } catch (exc) {
        try {
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (ex) {
            try {
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {
                xmlhttp = false;
            }
        }
    }
    if (xmlhttp) {        
        xmlhttp.onreadystatechange = function() {
            if (xmlhttp.readyState == 4) {
                if (xmlhttp.status == 200) {
                    //alert(xmlhttp.responseText);
                    document.getElementById("emailLink"+listingid).className = "controlEmailHide";
                    document.getElementById("emailText"+listingid).className = "controlEmailShow";                
                    document.getElementById("emailTextAnchor"+listingid).innerHTML = xmlhttp.responseText;
                }
            }
        }
        
        xmlhttp.open("GET", default_url+'/countemailclick.php?listing_id='+listingid, true);
        xmlhttp.send(null);
    }
    /*
    document.getElementById("emailLink"+listingid).className = "controlEmailHide";
    document.getElementById("emailNumber"+listingid).className = "controlEmailShow";
    */
}

