function putValues(t, d){
	var tot = t;
	var dat = d;
	var oInnerHtmlTot = document.getElementById('total');
	oInnerHtmlTot.innerHTML = tot;
	var oInnerHtmlDat = document.getElementById('date');
	oInnerHtmlDat.innerHTML = dat;
}
function inputKeyPress(e,f){	if (e.keyCode == 13) doSubmit(f);	return true;}

function doSubmit(f) {	
	//if(f.q.value.length > 3){
		var query = f.q.value;	
		//f.item.value = query;	
		for (i=0;i<f.buscar.length;i++) { 		
			if (f.buscar[i].checked) { 
				context = f.buscar[i].value; 
				break; 
			}	
		}	
		if (context=="image") {
			//submitYaTV(context,query);			
			self.location.href = "http://busca.ya.com/search?buscar="+query+"&origen=header&destino=imagen";
		}else if (context=="dpd") {
			window.location.href = "http://buscador.deportistadigital.com/Search?M=sportsresults&Q=" + query;
		}else{
			self.location.href = "http://busca.ya.com/search?buscar="+query+"&origen=header&destino=web";	
		}
		
	//}else{
	//	alert("La búsqueda tiene que tener como mínimo 3 caracteres.");
	//}
}
function submitYaTV(format,query) {	
	var action = "http://www2.yatv.com/jsp/JYatvSearchResults.jsp?s=15177&mode=text&results=5&format="+format+"&query="+query;	
	if (query.length<1) 
		action = "http://www.yatv.com";	
	self.location.href = action;
}
function submitYa(f,context,query) {			
		if (context == "news") {
			//f.action = "/Search";	
			//f.Q.value = query;
			window.location.href = "http://buscador.noticias.ya.com/Search?M=newsresults&Q=" + query;
		}else if (context == "cotilla") {
			window.location.href = "http://buscador.cotillea.com/Search?M=cotillearesults&Q=" + query;	
		}else if (context == "dpd") {
			//f.action = "/Search";	
			//f.Q.value = query;
			window.location.href = "http://buscador.deportistadigital.com/Search?M=sportsresults&Q=" + query;
		} else {
			f.action = "http://buscar.ya.com/fast-cgi/tsc";
		f.submit();	
		}				
}
function GoPage(page){
  var f = document.forms["F_CURRENT"];
  f.P.value = page;
  f.submit();
}
