var req;

function Initialize()
{
    try
    {
        req=new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch(e)
    {
        try
        {
            req=new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch(oc)
        {
            req=null;
        }
    }

    if(!req&&typeof XMLHttpRequest!="undefined")
    {
        req= new
    XMLHttpRequest();

}

} function
SendQuery(key)
    {
    Initialize(); var url="http://www.usedcduniverse.com/suggestdata.php?type="+document.form1.searchtype.value+"&a="+key;

    if(req!=null)
    {
        req.onreadystatechange = Process;
        req.open("GET", url, true);
        req.send(null);

    }

}
function Process()
{
    if (req.readyState == 4)
        {
        // only if "OK"
            if (req.status == 200)
            {
                if(req.responseText=="")
                    HideDiv("autocomplete");
                else
                {
                    ShowDiv("autocomplete");
                    document.getElementById("autocomplete").innerHTML =req.responseText;
                }
            }
            else
            {
                document.getElementById("autocomplete").innerHTML=
					"There was a problem retrieving data:<br>"+req.statusText;
            }
        }
}
function ShowDiv(divid)
{
   if (document.layers) document.layers[divid].visibility="show";
   else document.getElementById(divid).style.visibility="visible";
}

function ShowDiv1(divid)
{
   if (document.layers) document.layers[divid].display="block";
   else document.getElementById(divid).style.display="block";
}

function HideDiv(divid)
{
   if (document.layers) document.layers[divid].visibility="hide";
   else document.getElementById(divid).style.visibility="hidden";
}

function HideDiv1(divid)
{
   if (document.layers) document.layers[divid].display="none";
   else document.getElementById(divid).style.display="none";
}
function BodyLoad()
{
    HideDiv("autocomplete");
    document.form1.searchable.focus();

}
function highlight(myvalue)
{
	myvalue.style.backgroundColor="#ff6600"; 
	myvalue.style.color="white";

}
function doblur()
{
	HideDiv("autocomplete");
}
function SendQueryInv(key)
{
    Initialize(); 
    var url="http://www.usedcduniverse.com/suggestinv.php?type=Artist"+"&a="+key;
    if(req!=null)
    {
        req.onreadystatechange = ProcessInv;
        req.open("GET", url, true);
        req.send(null);

    }

}
function ProcessInv()
{
    if (req.readyState == 4)
        {
        // only if "OK"
            if (req.status == 200)
            {
            	document.getElementById("insideartist").innerHTML =req.responseText;
            }
            else
            {
                document.getElementById("insideartist").innerHTML=
					"There was a problem retrieving data:<br>"+req.statusText;
            }
        }
}
function SendQueryInv2(key)
{
    Initialize(); 
    var url="http://www.usedcduniverse.com/suggestinv2.php?type=Artist2"+"&a="+key;
    if(req!=null)
    {
        req.onreadystatechange = ProcessInv2;
        req.open("GET", url, true);
        req.send(null);

    }

}
function ProcessInv2()
{
    if (req.readyState == 4)
        {
        // only if "OK"
            if (req.status == 200)
            {
            	document.getElementById("insidealbum").innerHTML =req.responseText;
            }
            else
            {
                document.getElementById("insidealbum").innerHTML=
					"There was a problem retrieving data:<br>"+req.statusText;
            }
        }
}
function highlightinv(myvalue)
{
	myvalue.style.backgroundColor="#0b53ff"; 
	myvalue.style.color="white";
}
function normalinv(myvalue)
{
	myvalue.style.backgroundColor="white"; 
	myvalue.style.color="#333";
}
function copyinfo()
{
	document.getElementById("bname").value=document.getElementById("sname").value; 
	document.getElementById("bstreet").value=document.getElementById("sstreet").value;
	document.getElementById("bstate").value=document.getElementById("sstate").value;
	document.getElementById("bzip").value=document.getElementById("szip").value;
	document.getElementById("bcity").value=document.getElementById("scity").value;
}
function highlightadmin(myvalue)
{
	myvalue.style.backgroundColor="#ff0000"; 
	myvalue.style.color="white";
}
function normaladmin(myvalue)
{
	myvalue.style.backgroundColor="#cccccc"; 
	myvalue.style.color="#333";
}