var xmlHttp;
var AliStr;
var x, y, a, b;
var isNav = (navigator.appName.indexOf("Netscape") != -1);

function showHint() {
    //str = AliStr;
    if (str.length == 0) {
        document.getElementById("txtHint").innerHTML = "";
        return;
    }
    xmlHttp = GetXmlHttpObject()
    if (xmlHttp == null) {
        alert("Your browser does not support AJAX!");
        return;
    }
    var url = "popup.asp";
    url = url + "?q=" + escape(str)
    url = url + "&sid=" + Math.random();
    xmlHttp.onreadystatechange = stateChanged;
    xmlHttp.open("GET", url, true);
    xmlHttp.setRequestHeader("Accept-charset", "windows-1252;");
    xmlHttp.send(null);
}

function stateChanged() {
    if (xmlHttp.readyState == 4) {
        popLayer(xmlHttp.responseText);
        //alert(xmlHttp.responseText);
        //document.getElementById("txtHint").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 Ali(AliStr) {
    str = AliStr;
    setTimeout("showHint()", 10);
}
function Ali_Blank() {
    document.getElementById("txtHint").innerHTML = "";
}
function Set_Background_Color(idname) {
    document.getElementById(idname).style.backgroundColor = 'Yellow'
}
function Reset_Background_Color(idname) {
    document.getElementById(idname).style.backgroundColor = ''
}
function setupDescriptions() {
    var x = navigator.appVersion;
    y = x.substring(0, 4);
    if (y >= 4) setVariables();
}
function setVariables() {
    if (navigator.appName == "Netscape") {
        h = ".left=";
        v = ".top=";
        dS = "document.";
        sD = "";
    }
    else {
        h = ".pixelLeft=";
        v = ".pixelTop=";
        dS = "";
        sD = ".style";
    }
}

function popLayer(b) {
    //desc = "<table cellpadding=3 border=1 bgcolor=F7F7F7><td>";
    desc = "";
    desc += b;

    //desc += "</td></table>";
    if (isNav) {
        document.object1.document.write(desc);
        document.object1.document.close();
        document.object1.left = x + 25;
        document.object1.top = y;
    }
    else {
        object1.innerHTML = desc;
        eval(dS + "object1" + sD + h + (x + 25));
        eval(dS + "object1" + sD + v + y);
    }
}
function hideLayer(a) {
    if (isNav) {
        eval(document.object1.top = a);
    }
    else object1.innerHTML = "";
}
function handlerMM(e) {
    x = (isNav) ? e.pageX : event.clientX;
    y = (isNav) ? e.pageY : event.clientY;
}
if (isNav) {
    document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = handlerMM;


