var xmlHttp

function ShowCafe(city,id,pn) {
    xmlHttp=GetXmlHttpObject()
    if (xmlHttp==null) {
        alert ("Browser does not support HTTP Request")
        return
    }
    var url="inc/sql_ajax.php?city="+city+"&start="+id+"&pn="+pn;
    url=url+"&sid="+Math.random()
    xmlHttp.onreadystatechange=stateChanged
    xmlHttp.open("POST",url,true)
    xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    xmlHttp.send(null)
}

function stateChanged() {
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {
        document.getElementById("CafeHint").innerHTML=xmlHttp.responseText;
    }
}
function GetXmlHttpObject() {
    var xmlHttp=null;
    try {
        // Firefox, Opera 8.0+, Safari
        xmlHttp=new XMLHttpRequest();
    }
    catch (e) {
        //Internet Explorer
        try {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    return xmlHttp;
}

function fade(amt) {
    if(amt <= 100) {
        setFade(amt);
        amt += 11;
        setTimeout("fade("+amt+")", 1);
    }
}
function setFade(amt) {
        obj = document.getElementById("CafeHint");
        amt = (amt == 100)?99.999:amt
        // IE
        obj.style.filter = "alpha(opacity:"+amt+")";
        // Safari<1.2, Konqueror
        obj.style.KHTMLOpacity = amt/100;
        // Mozilla and Firefox
        obj.style.MozOpacity = amt/100;
        // Safari 1.2, newer Firefox and Mozilla, CSS3
        obj.style.opacity = amt/100;
}

