function whereToBuy(str)
{
if (str.length==0)
  { 
  document.getElementById("txtHint").innerHTML="";
  return;
  }
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="buy.php";
url=url+"?state="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function greenbox(item,txt)
{
if (txt.length==0)
  { 
  document.getElementById("txtHint").innerHTML="";
  return;
  }
 if (txt=="howto") {
 document.getElementById("greentabs").style.backgroundImage="url(images/greentabb.png)" ;
 }
 else {
 document.getElementById("greentabs").style.backgroundImage="url(images/greentaba.png)" ;
 }
 
 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="greenbox.php";
url=url+"?item="+item;
url=url+"&txt="+txt;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=greenboxChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

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 stateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("vendorbox").innerHTML=xmlHttp.responseText;
document.getElementById("vendorbox").style.display="block" ;
}
}

function greenboxChanged() 
{
if (xmlHttp.readyState==4)
{ 
document.getElementById("greentxt").innerHTML=xmlHttp.responseText;

}
}

function hidevendor()
{
document.getElementById("vendorbox").style.display="none" ;
}

function changeimage(image,caption){
document.getElementById("mainimage").src="images/uploads/" + image + "_Main Image.png" ;
document.getElementById("caption").innerHTML=caption ;
}

function displaytest(imagename) {
	var imgstring = "<img src=\"images/uploads/" ;
	imgstring = imgstring + imagename ;
	imgstring = imgstring + "\" border = 0 style=\"display : block ; padding : 0px ; margin : 0px\"  /></div>" ;
	document.getElementById("testimg").style.display="block" ;
	document.getElementById("testimg").innerHTML = imgstring ;
}

function hidetest() {
	document.getElementById("testimg").style.display="none" ;
}

startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
window.onload=startList;

