var xmlHttp
function getsuggest(str){
	document.getElementById('suggest_box').style.display='inline';
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
		alert ("Su navegador no soporta Ajax")
		return
	}
	var url=sefro+"suggest.php"
	url=url+"?q="+str
	url=url+"&mc="+Math.random()
	xmlHttp.onreadystatechange=stateChanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function stateChanged(){ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		document.getElementById("suggest_box").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;
}

var cadena;
function anadirQ(cadena){
	document.getElementById('bus').value = cadena;
	document.getElementById('bus').focus();
	document.getElementById('suggest_box').style.display= 'none';
	<!--document.getElementById('buscar').submit();-->
}


function ocultarBox(){
	if(document.getElementById('algo').value == 0){
	document.getElementById('suggest_box').style.display= 'none';
		
	}
}
var valor;
function setAlgo(valor){
	document.getElementById('algo').value = valor;
}