function shark(){
	var q=document.getElementById("inputbusc").value;
	window.location="http://grooveshark.com/#/search?q="+q;
}

function cuevana(){
	var q=document.getElementById("inputbusc").value;
	window.location="http://www.cuevana.tv/#!/buscar/q:"+q;
}

function entsub(event,buscador) {
	var q=document.getElementById("inputbusc").value;

	if(buscador=='1'){
			if (event && event.which == 13) {window.location="http://grooveshark.com/#/search?q="+q;}
			else {if (window.event && window.event.keyCode == 13) {window.location="http://grooveshark.com/#/search?q="+q;}}
	}
	
	if(buscador=='2'){
		if (event && event.which == 13) {window.location="http://www.cuevana.tv/#!/buscar/q:"+q;}
		else {if (window.event && window.event.keyCode == 13) {window.location="http://www.cuevana.tv/#!/buscar/q:"+q;}}
	}

	if((buscador!='1') && (buscador!='2')){return true;}
}

function borravalue(){
document.getElementById('inputbusc').value = "";
}

function cambiobusc(vBuscador,vinputbusc){
	switch (vBuscador){	
		case 'youtube':
			document.getElementById('buscador').innerHTML = '<div id="buscadores-formulario"><a href="http://www.youtube.com"><span id="buscadores-logo-youtube"></span><a/><form method="get" action="http://www.youtube.com/results" id="form1"><input type="text" name="search_query" class="buscador-input" maxlength="2048" value="" id="inputbusc"><input type="submit" value="Buscar" id="botonbuscar"></form></div>';								 
		    document.getElementById('inputbusc').focus();
			break;	
		case 'wikipedia':
			document.getElementById('buscador').innerHTML = '<div id="buscadores-formulario"><a href="http://es.wikipedia.org"><span id="buscadores-logo-wikipedia"></span></a><form name="searchform" action="http://es.wikipedia.org/wiki/Especial:Search" id="form1"><input name="search" class="buscador-input" accesskey="f" value="" id="inputbusc"><input type="submit" name="go" class="searchButton" value="Buscar" id="botonbuscar"/></form></div>';					
		    document.getElementById('inputbusc').focus();
			break;
		case 'taringa':
			document.getElementById('buscador').innerHTML = '<div id="buscadores-formulario"><a href="http://www.taringa.net"><span id="buscadores-logo-taringa"></span></a><form method="get" action="http://buscar.taringa.net/posts?engine=taringa" id="form1"><input type="text" name="q" class="buscador-input" maxlength="2048" value="" id="inputbusc"/><input type="submit" value="Buscar" id="botonbuscar"></form></div>';
			document.getElementById('inputbusc').focus();
			break;
		case 'gmaps':
			var a1 = '<div id="buscadores-formulario"><a href="http://maps.google.com.ar"><span id="buscadores-logo-gmaps"></span></a><form method="get" action="http://maps.google.com.ar/maps?f=q&source=s_q&hl=es&geocode=" id="form1"><input type="text" name="q" class="buscador-input" maxlength="2048" value=""';		
			if (vinputbusc == "") { var a2 = 'onClick="borravalue()"'} else {var a2='';}	
			var a3 = 'id="inputbusc"><input type="submit" name="btnG" value="Buscar" id="botonbuscar"></form></div>';
			document.getElementById('buscador').innerHTML = a1+a2+a3;     
	    	if (vinputbusc == "") { document.getElementById('inputbusc').value = "ej: jujuy 1521, Rosario, Santa Fe"; }
		    document.getElementById('inputbusc').focus();
			break;		
		case 'gimages':
			document.getElementById('buscador').innerHTML = '<div id="buscadores-formulario"><a href="http://images.google.com.ar"><span id="buscadores-logo-gimages"></span></a><form method="get" action="http://images.google.com/images?hl=es" id="form1"><input type="text" name="q" class="buscador-input" maxlength="2048" value="" id="inputbusc"><input type="submit" name="btnG" value="Buscar" id="botonbuscar"></form></div>';
		    document.getElementById('inputbusc').focus();
			break;	
		case 'grooveshark':
			document.getElementById('buscador').innerHTML = '<div id="buscadores-formulario"><a href="http://www.grooveshark.com"><span id="buscadores-logo-grooveshark"></span></a><div id="form1"><input type="text" name="q" class="buscador-input" maxlength="2048" value="" id="inputbusc" onkeypress="return entsub(event,1);"><input type="button" value="Buscar" onClick="shark()" id="botonbuscar"></div></div>';
		    document.getElementById('inputbusc').focus();
			break;					
		case 'paginasblancas':
			document.getElementById('buscador').innerHTML = '<div id="buscadores-formulario" style="padding-bottom: 20px"><a href="http://www.paginasblancas.com.ar"><span id="buscadores-logo-paginasblancas"></span></a><form method="get" action="http://www.paginasblancas.com.ar/BuscarTelefonica.action?tipoBusqueda=&apellido=&telefono.area=&telefono.prefijo=&telefono.sufijo=&domicilio.calle=&domicilio.altura=&provinciasId=0&localidad.descripcion=&x=&y=" style="padding-top: 20px;"><input type="text" name="apellido" size="40" maxlength="2048" value="" id="inputbusc" class="buscador-input-tel" /> Apellido y Nombre <p style="margin-left:335px"> o por Teléfono <input type="text" name="telefono.area" size="4" maxlength="5" value="011">-<input type="text" name="telefono.prefijo" size="3" maxlength="3" value="422">-<input type="text" name="telefono.sufijo" size="4" maxlength="4" value="1111"><input type="submit" name="search" value="Buscar" id="botonbuscar"></form></p></div>';
		    document.getElementById('inputbusc').focus();
			break;
		case 'thefreedic':
			document.getElementById('buscador').innerHTML = '<div id="buscadores-formulario"><a href="http://es.thefreedictionary.com"><span id="buscadores-logo-thefreedic"></span></a><form method="get" action="http://www.thefreedictionary.com/_/search.aspx" id="form1"><input type="text" name="Word" class="buscador-input" maxlength="2048" value="" id="inputbusc" /><input type="hidden" name="charset" value="utf-8"><input type="hidden" name="SearchBy" value="0"><input type="hidden" name="tab" value="65536"><input type="submit" value="Buscar" id="botonbuscar"></form></div>';
		    document.getElementById('inputbusc').focus();
			break;						
	    case 'mercadolibre':
			document.getElementById('buscador').innerHTML = '<div id="buscadores-formulario"><a href="http://www.mercadolibre.com.ar"><span id="buscadores-logo-mercadolibre"></span></a><form method="get" action="http://www.mercadolibre.com.ar/jm/search" name="srch1" id="form1"><input type="text" class="buscador-input" maxlength="2048" name="as_word" id="inputbusc"><input type="submit" value="Buscar" id="botonbuscar"></form></div>';
		    document.getElementById('inputbusc').focus();
			break;			
		case 'flickr':
			document.getElementById('buscador').innerHTML = '<div id="buscadores-formulario"><a href="http://www.flickr.com"><span id="buscadores-logo-flickr"></span></a><form method="get" action="http://www.flickr.com/search/" id="form1"><input type="text" name="q" class="buscador-input" maxlength="2048" value="" id="inputbusc"><input type="submit" name="btnG" value="Buscar" id="botonbuscar"></form></div>';
		    document.getElementById('inputbusc').focus();
			break;		
		case 'cuevana':
			document.getElementById('buscador').innerHTML = '<div id="buscadores-formulario"><a href="http://www.cuevana.tv"><span id="buscadores-logo-cuevana"></span></a><div id="form1"><input type="text" name="q" class="buscador-input" maxlength="2048" value="" id="inputbusc" onkeypress="return entsub(event,2);"><input type="button" value="Buscar" onClick="cuevana()" id="botonbuscar"></div></div>';
		    document.getElementById('inputbusc').focus();
			break;	
	default:
			document.getElementById('buscador').innerHTML = '<div id="buscadores-formulario"><a href="http://www.google.com/webhp?hl=es"><span id="buscadores-logo-google"></span></a><form method="get" action="http://www.google.com.ar/search" target="_top" id="form1"><input type="text" name="q" class="buscador-input" maxlength="2048" value="" tabindex="1" id="inputbusc"><input type="submit" value="Buscar" id="botonbuscar" name="btnG"><br><span class="googleen"><input type="radio" name="meta" value="" checked><label for=all> la Web </label><input type="radio" name="meta" value="lr=lang_es"><label for="lgr"> páginas en español </label><input type="radio" name="meta" value="cr=countryAR"><label for="cty"> páginas de Argentina </label></span></form></div>';
			var bg = getCookie('BG');if(bg){googleBg();}
			document.getElementById('inputbusc').focus();
			break;					
	}
	if (vinputbusc != "") {document.getElementById('inputbusc').value = vinputbusc;}
	document.getElementById('inputbusc').focus();
}
