function woogle(){
	
	var st=document.getElementById("st").value;
	
	var wlr=document.getElementById("wooglelineright");
	var wll=document.getElementById("wooglelineleft");
	var wr=document.getElementById("woogleresults");
	
	if(st==''){
		
		wlr.style.display="none";
		wll.style.display="none";
		wr.style.display="none";
		
	}else{
		
		wlr.style.display="block";
		wll.style.display="block";
		wr.style.display="block";
	
		xmlHttp=GetXmlHttpObject();
		var url="inc/woogle.php?st="+st;
		xmlHttp.onreadystatechange=stateChanged;
		xmlHttp.open("POST",url,true);
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader("Content-length", url.length);
		xmlHttp.send(null);

	}

}

function stateChanged() { 
	if (xmlHttp.readyState==4){ 
		document.getElementById("wooglesearchresults").innerHTML=xmlHttp.responseText;
	}
}


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 woogleselect(prod){
	document.getElementById("st").value=prod;
	document.wooglesearch.submit();
}

function prodadded(id){
	//alert(id);
	document.getElementById("wooglecart").style.display="block";
	document.getElementById("woogleadded"+id).style.display="block";
	document.getElementById("wooglebuy"+id).style.display="none";
}
