function showInvHint(str)
{
if (str.length==0)
{
document.getElementById("topHint").innerHTML="";
document.getElementById("topHint").style.display="none";
return;
}
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Your browser does not support AJAX!");
return;
}
var url="http://www.drumbee.com/includes/sfk.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}

function stateChanged()
{
if (xmlHttp.readyState==4)
{
document.getElementById("topHint").style.display="block";
document.getElementById("topHint").innerHTML=xmlHttp.responseText;
}
}

function availability(name)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Your browser does not support AJAX!");
return;
}
var url="http://www.drumbee.com/availability.php";
url=url+"?name="+name;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=showPrices;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function showPrices()
{
if (xmlHttp.readyState==4)
{
document.getElementById("prices").innerHTML=xmlHttp.responseText;
var lp_id=document.getElementById('lowest_price_id').value;
document.getElementById('check_availability').innerHTML='<a rel="nofollow" class="wBut" target="_blank" href="../buy.php?id='+lp_id+'">Buy Now</a>';
}
else
{
document.getElementById('prices').innerHTML='<div class="in_progress" style="margin:15px 0 35px 0;">Loading Stores... <small>This can take a minute. Please wait...</small></div>';
document.getElementById('check_availability').innerHTML='<img src="http://www.drumbee.com/img/loading.gif" width="24" height="24" alt="" />';
}
}