// JavaScript Document
function mnu_navh(v_marca,v_tipo,v_cilind,v_model)
{
	var mnu;
	
	mnu="<a href='http://www.mundomoto.es' class='enlace5' title='Inicio' onMouseOver='window.status=&quot;Volver inicio&quot;;return true' onMouseOut='window.status=&quot;www.mundomoto.es&quot;'>Inicio</a>";
	
	if(v_marca!='')
	{
	    var txt_marca=v_marca;
		txt_marca=txt_marca.charAt(0);
		txt_marca=txt_marca.toUpperCase();
		txt_marca=txt_marca + v_marca.substring(1,v_marca.length).toLowerCase();
		
		mnu=mnu + "&nbsp;<img src='http://www.mundomoto.es/img/general/sep_mnu_horz.jpg'>";
		mnu=mnu + "&nbsp;";
		mnu=mnu + "<a href='javascript:atras_marca();' class='enlace5' title='"+txt_marca+"' onMouseOver='window.status=&quot;"+txt_marca+"&quot;;return true' onMouseOut='window.status=&quot;www.mundomoto.es&quot;'>";
		mnu=mnu + txt_marca;
		mnu=mnu + "</a>";
	}
	if(v_tipo!='')
	{
	    var txt_tipo=v_tipo;
		txt_tipo=txt_tipo.charAt(0);
		txt_tipo=txt_tipo.toUpperCase();
		txt_tipo=txt_tipo + v_tipo.substring(1,v_tipo.length).toLowerCase();
		
		mnu=mnu + "&nbsp;<img src='http://www.mundomoto.es/img/general/sep_mnu_horz.jpg'>";
		mnu=mnu + "&nbsp;";
		mnu=mnu + "<a href='javascript:atras_tipo();' class='enlace5' title='"+txt_tipo+"' onMouseOver='window.status=&quot;"+txt_tipo+"&quot;;return true' onMouseOut='window.status=&quot;www.mundomoto.es&quot;'>";
		mnu=mnu + txt_tipo;
		mnu=mnu + "</a>";
	}
	if(v_cilind!='')
	{
	    var txt_cilind=v_cilind;
		txt_cilind=txt_cilind.charAt(0);
		txt_cilind=txt_cilind.toUpperCase();
		txt_cilind=txt_cilind + v_cilind.substring(1,v_cilind.length).toLowerCase();
		
		mnu=mnu + "&nbsp;<img src='http://www.mundomoto.es/img/general/sep_mnu_horz.jpg'>";
		mnu=mnu + "&nbsp;";
		mnu=mnu + "<a href='javascript:atras_cilind();' class='enlace5' title='"+txt_cilind+"' onMouseOver='window.status=&quot;"+txt_cilind+"&quot;;return true' onMouseOut='window.status=&quot;www.mundomoto.es&quot;'>";
		mnu=mnu + txt_cilind;
		mnu=mnu + "</a>";
	}
	if(v_model!='')
	{
	    var txt_model=v_model;
		txt_model=txt_model.charAt(0);
		txt_model=txt_model.toUpperCase();
		txt_model=txt_model + v_model.substring(1,v_model.length).toLowerCase();
		
		mnu=mnu + "&nbsp;<img src='http://www.mundomoto.es/img/general/sep_mnu_horz.jpg'>";
		mnu=mnu + "&nbsp;";
		mnu=mnu + "<a href='#' class='enlace5' title='"+txt_model+"' onMouseOver='window.status=&quot;"+txt_model+"&quot;;return true' onMouseOut='window.status=&quot;www.mundomoto.es&quot;'>";
		mnu=mnu + txt_model;
		mnu=mnu + "</a>";
	}
	
	document.getElementById('mnu_horz').innerHTML=mnu;
}
function funciona(v_marca,v_tipo,v_model,v_cilind)
{
	//cambiar_lista(genero,tipo,subt,marca,ofert,liq,orden,invi,verno,wom,xxxl,txt,1,model);
	//mnu_navh(genero,tipo,subt,marca,ofert,liq,orden,invi,verno,wom,xxxl,txt);
	cambia_combo_marc(v_marca,v_tipo,v_model,v_cilind);
    cambia_combo_tipo(v_marca,v_tipo,v_model,v_cilind);
	cambia_combo_model(v_marca,v_tipo,v_model,v_cilind);
	cambia_combo_cilind(v_marca,v_tipo,v_model,v_cilind);
	cambia_lista_motos(v_marca,v_tipo,v_model,v_cilind);
	mnu_navh(v_marca,v_tipo,v_cilind,v_model);
}
function tipos()
{
	var v_tipo=document.getElementById("cmb_tipo").options[document.getElementById("cmb_tipo").selectedIndex].value;
	var v_marca=document.getElementById("cmb_marc").options[document.getElementById("cmb_marc").selectedIndex].value;
	var v_model=document.getElementById("cmb_model").options[document.getElementById("cmb_model").selectedIndex].value;
	var v_cilind=document.getElementById("cmb_cilind").options[document.getElementById("cmb_cilind").selectedIndex].value;
	
	funciona(v_marca,v_tipo,v_model,v_cilind);
	chang_tipo(v_tipo);
}
function marcas()
{
	var v_tipo=document.getElementById("cmb_tipo").options[document.getElementById("cmb_tipo").selectedIndex].value;
	var v_marca=document.getElementById("cmb_marc").options[document.getElementById("cmb_marc").selectedIndex].value;
	var v_model=document.getElementById("cmb_model").options[document.getElementById("cmb_model").selectedIndex].value;
	var v_cilind=document.getElementById("cmb_cilind").options[document.getElementById("cmb_cilind").selectedIndex].value;
	
	funciona(v_marca,v_tipo,v_model,v_cilind);
	chang_marca(v_marca);
}
function model()
{
	var v_tipo=document.getElementById("cmb_tipo").options[document.getElementById("cmb_tipo").selectedIndex].value;
	var v_marca=document.getElementById("cmb_marc").options[document.getElementById("cmb_marc").selectedIndex].value;
	var v_model=document.getElementById("cmb_model").options[document.getElementById("cmb_model").selectedIndex].value;
	var v_cilind=document.getElementById("cmb_cilind").options[document.getElementById("cmb_cilind").selectedIndex].value;
	
	funciona(v_marca,v_tipo,v_model,v_cilind);
}
function cilind()
{
	var v_tipo=document.getElementById("cmb_tipo").options[document.getElementById("cmb_tipo").selectedIndex].value;
	var v_marca=document.getElementById("cmb_marc").options[document.getElementById("cmb_marc").selectedIndex].value;
	var v_model=document.getElementById("cmb_model").options[document.getElementById("cmb_model").selectedIndex].value;
	var v_cilind=document.getElementById("cmb_cilind").options[document.getElementById("cmb_cilind").selectedIndex].value;
	
	funciona(v_marca,v_tipo,v_model,v_cilind);
}
function chang_tipo(tipo)
{
	if (tipo=="")
	  tipo="transp.gif"
	else
	  tipo=tipo+".jpg";
	  
	tipo=tipo.replace(/\s+/g, '');

	var img_tipo=document.getElementById("img_tipo_moto");
	img_tipo.src="http://www.mundomoto.es/img/motos_tipos/"+ tipo;
	img_tipo.alt=tipo;
	img_tipo.title=tipo;
}
function chang_marca(marca)
{
	if (marca=="")
	  marca="transp.gif"
	else
	  marca=marca+".jpg";
	  
	marca=marca.replace(/\s+/g, '');
	
	var img_marca=document.getElementById("img_marca_moto");
	img_marca.src="http://www.mundomoto.es/img/logos/"+ marca;
	img_marca.alt=marca;
	img_marca.title=marca;
}
function atras_cilind()
{
	var v_tipo=document.getElementById("cmb_tipo").options[document.getElementById("cmb_tipo").selectedIndex].value;
	var v_marca=document.getElementById("cmb_marc").options[document.getElementById("cmb_marc").selectedIndex].value;
	var v_cilind=document.getElementById("cmb_cilind").options[document.getElementById("cmb_cilind").selectedIndex].value;
	funciona(v_marca,v_tipo,'',v_cilind);
}
function atras_tipo()
{
	var v_tipo=document.getElementById("cmb_tipo").options[document.getElementById("cmb_tipo").selectedIndex].value;
	var v_marca=document.getElementById("cmb_marc").options[document.getElementById("cmb_marc").selectedIndex].value;
	funciona(v_marca,v_tipo,'','');
}
function atras_marca()
{
	var v_marca=document.getElementById("cmb_marc").options[document.getElementById("cmb_marc").selectedIndex].value;
	funciona(v_marca,'','','');
}
function envia_ficha(v_moto)
{
	//alert("ficha.asp?v_bout="+v_bout+"\n&v_gen="+document.getElementById("retor_busq").v_gen.value+"\n&v_tipo="+document.getElementById("retor_busq").v_tipo.value+"\n&v_subt="+document.getElementById("retor_busq").v_subt.value+"\n&v_marca="+document.getElementById("retor_busq").v_marca.value+"\n&v_ofert="+document.getElementById("retor_busq").v_ofert.value+"\n&v_liq="+document.getElementById("retor_busq").v_liq.value+"\n&v_ord="+document.getElementById("retor_busq").v_ord.value+"\n&v_inv="+document.getElementById("retor_busq").v_inv.value+"\n&v_ver="+document.getElementById("retor_busq").v_ver.value+"\n&v_wom="+document.getElementById("retor_busq").v_wom.value+"\n&v_xxxl="+document.getElementById("retor_busq").v_xxxl.value+"\n&v_txt="+document.getElementById("retor_busq").v_txt.value);
	var aleat=parseInt(Math.random()*99999999999);
	window.location=("filtro_motos.asp?v_moto="+v_moto+"&rand="+aleat);
}
function displayStatusMsg(msgStr) 
{
  window.status=msgStr;
}