// JavaScript Document
function showrechercher(val)
{
	xmlHttp=GetXmlHttpObject();
    if (xmlHttp==null)
    {
        alert ("您的浏览器不支持AJAX！");
        return;
    } 
    var url="Ajax.asp?action=search&key="+val;
    xmlHttp.onreadystatechange=rechercherChanged;
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
    document.getElementById("sp1").style.display = "block";
    document.getElementById("sp2").style.display = "block";
}

function rechercherChanged()
{
    if (xmlHttp.readyState==4)
    { 
        document.getElementById("sp1").innerHTML=xmlHttp.responseText;
    }
}

function turnbg(val)
{
	document.getElementById(val).style.backgroundColor = "#f8f8f8";
}

function leftbg(val)
{
	document.getElementById(val).style.backgroundColor = "#FFFFFF";
}

function setval(val)
{
	var hiid = val.replace("w","hi");
	document.getElementById("Key").value = document.getElementById(hiid).innerHTML;
    document.getElementById("sp1").innerHTML="";
    document.getElementById("sp1").style.display = "none";
    document.getElementById("sp2").style.display = "none";
}

function sqclose()
{
	document.getElementById("Key").value = "";
    document.getElementById("sp1").style.display = "none";
    document.getElementById("sp2").style.display = "none";
}

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;
}