<script type="text/javascript">
var xmlHttp

function showUser(str, objive)
{ 
  var o = document.getElementById(objive);
	o.style.display = 'block';
 
	

var str = document.form.users.value;
var stromit = document.form.usersomit.value;
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="showresults.php"
url=url+"?q="+str+"&omit="+stromit
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("txtHint").innerHTML=xmlHttp.responseText 
// var arrows = document.getElementById(arrow);
// arrows.style.display = 'none';
 } 
}



function showCat(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="showcat.php"
url=url+"?q="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function showProduct(str,cat)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="showproduct.php"
url=url+"?q="+str+"&cat="+cat
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}


function addCart(product,price)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="updatecart.php"
url=url+"?product="+product+"&price="+price
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=cartChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function emptyCart()
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="updatecart.php"
url=url+"?product=empty&price=empty"
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=cartChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function cartChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("cart").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 ajaxFunction()
  {
  var xmlHttp;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      try
        {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
  }
  
function advancedToggle(objId, togId) {
    var o = document.getElementById(objId), t = document.getElementById(togId);
    if (o.style.display == 'none') {
	o.style.display = 'block';
	t.innerHTML = 'Hide Advanced Search';
    } else {
	o.style.display = 'none';
	t.innerHTML = 'Show Advanced Search';
    }
}
</script>