var Ventana2;



function openIT(theURL,W,H, wname,S) {

  var prop;



  if (S!='no') S="yes"



  prop = "width="+W+",height="+H+",scrollbars="+S;





if (Ventana2) {

    if (Ventana2.closed) {

      Ventana2=open(theURL,wname,prop+",location=no,status=no,directories=no,toolbar=no,resizable=no,menubar=no");

      Ventana2.focus();

    }

    else {

      Ventana2=open(theURL,wname,prop+",location=no,status=no,directories=no,toolbar=no,resizable=no,menubar=no");

      Ventana2.focus();

    }

  }

  else {

      Ventana2=open(theURL,wname,prop+",location=no,status=no,directories=no,toolbar=no,resizable=no,menubar=no");

      Ventana2.focus();

  }

}

function abrirguia(URL){

   window.open(URL,"ventana_guia","width=1000","height=600","scrollbars=NO","directories=NO","location=NO","menubar=NO","status=NO","titlebar=NO","toolbar=NO")

}



function lanzaMensaje(msg) {

  msg = msg.replace(/xxx/i, "\n");

  alert (msg);

}



function abrirVentana(URL,name,prop) {

  if (Ventana2) {

    if (Ventana2.closed) {

      Ventana2=open(URL,name,prop+",location=no,status=no,directories=no,toolbar=no,resizable=no,menubar=no");

      Ventana2.focus();

    }

    else {

      Ventana2=open(URL,name,prop+",location=no,status=no,directories=no,toolbar=no,resizable=no,menubar=no");

      Ventana2.focus();

    }

  }

  else {

      Ventana2=open(URL,name,prop+",location=no,status=no,directories=no,toolbar=no,resizable=no,menubar=no");          

      Ventana2.focus();

  }

}





// Copia el valor de un desplegable a un campo de texto de un mismo formulario.

function copia(f,ori,des) {

  var sel = 0;

  eval('sel=f.'+ori+'.options.selectedIndex');

  if (sel!=0) {

	  eval('f.'+des+'.value=f.'+ori+'.options[sel].text');

	}

}





function esVacio(s) 

{ 

    for(var i = 0; i < s.length; i++) { 

        var c = s.charAt(i); 

        if ((c != ' ') && (c != '\n') && (c != '\t')) return false; 

    } 

    return true; 

} 

 

function tieneComilla(s) 

{ 

    for(var i = 0; i < s.length; i++) { 

        var c = s.charAt(i); 

        if (c == '\'') return true; 

    } 

    return false; 

}



function validaFecha(f) {

    dia=Number(f.substring(0,2)); 

    mes=Number(f.substring(3,5)); 

    ano=Number(f.substring(6,10));



    sep1=f.charAt(2); 

    sep2=f.charAt(5); 

 

    if ((isNaN(dia) || isNaN(mes) || isNaN(ano)) || 

        (sep1!='/' || sep2!='/') ||   

        !((dia>=1 && dia<=31) && (mes>=1 && mes<=12)) || (f.length!=10)) return false; 

 

    return true; 

}





function enviar(f) {

  errors = false;

  msg = 'Se han encontrado los siguientes\nerrores en el formulario:\n\n';

  for (i=0; i < f.length; i++) {

    e = f.elements[i];

    

    if ((e.type=="select-one") || (e.type=="select-multiple")) {

      if ((e.value=="-1" || e.value=="") && (e.optional=="false")) {

        msg += '-- '+e.label+' es un campo obligatorio.\n';

        errors = true;

        continue;

      }

    }

    

    if ((e.type=="text") || (e.type == "textarea")) {

      if (((e.value == null) ||(e.value == "") || esVacio(e.value)) && (e.optional=="false")) {

        msg += '-- '+e.label+' es un campo obligatorio.\n';

        errors = true;

        continue;

      }

      

      if (e.fecha == "true" && !validaFecha(e.value)) {

        if (e.value != "") {

          msg += '-- Formato de fecha erróneo.\n';

          errors = true;

          continue;

        }

      }       

      

      if (tieneComilla(e.value)) {

        msg += '-- '+e.label+' tiene un carácter no válido.\n';

        errors = true;

        continue;

      }

    }

  }

  

  if (!errors) {

    if (confirm('Se dispone a '+f.label+' registro/s.\n\n¿Desea continuar?')) f.submit();

  }

  else alert(msg);

    

}



function enviar2(f) {

  errors = false;

  msg = 'Se han encontrado los siguientes\nerrores en el formulario:\n\n';

  for (i=0; i < f.length; i++) {

    e = f.elements[i];

    

    if ((e.type=="select-one") || (e.type=="select-multiple")) {

      if ((e.value=="-1" || e.value=="") && (e.optional=="false")) {

        msg += '-- '+e.label+' es un campo obligatorio.\n';

        errors = true;

        continue;

      }

    }

    

    if ((e.type=="text") || (e.type == "textarea")) {

      if (((e.value == null) ||(e.value == "") || esVacio(e.value)) && (e.optional=="false")) {

        msg += '-- '+e.label+' es un campo obligatorio.\n';

        errors = true;

        continue;

      }

      

      if (e.fecha == "true" && !validaFecha(e.value)) {

        if (e.value != "") {

          msg += '-- Formato de fecha erróneo.\n';

          errors = true;

          continue;

        }

      }       

      

      if (tieneComilla(e.value)) {

        msg += '-- '+e.label+' tiene un carácter no válido.\n';

        errors = true;

        continue;

      }

    }

  }

  

  if (!errors) {

    f.submit();

  }

  else alert(msg);

    

}



function enviarformulario(form){



    document.getElementById(form).submit();



}



function busca(f) {

  errors = false;

  msg = 'Se han encontrado los siguientes\nerrores en el formulario:\n\n';

  for (i=0; i < f.length; i++) {

    e = f.elements[i];

    

    if ((e.type=="select-one") || (e.type=="select-multiple")) {

      if ((e.value=="-1" || e.value=="") && (e.optional=="false")) {

        msg += '-- '+e.label+' es un campo obligatorio.\n';

        errors = true;

        continue;

      }

    }

    

    if ((e.type=="text") || (e.type == "textarea")) {

      if (((e.value == null) ||(e.value == "") || esVacio(e.value)) && (e.optional=="false")) {

        msg += '-- '+e.label+' es un campo obligatorio.\n';

        errors = true;

        continue;

      }

      

      if (e.fecha == "true" && !validaFecha(e.value)) {

        if (e.value != "") {

          msg += '-- Formato de fecha erróneo.\n';

          errors = true;

          continue;

        }

      }

      

      if (tieneComilla(e.value)) {

        msg += '-- '+e.label+' tiene un carácter no válido.\n';

        errors = true;

        continue;

      }

    }

  }

  

  if (!errors) {

    f.submit();

  }

  else alert(msg);

    

}



function confirma(URL,op) {

  if (confirm('Se dispone a '+op+' registro/s.\n\n¿Desea continuar?')) document.location=URL;

}



function recarga(f,URL) {

  f.action = URL;

  f.submit();

}



function recarga2(f,URL) {

  f.action = URL;

  enviar(f);

}





function checkall(f) {

  for (i=0; i < f.length; i++) {

    e = f.elements[i];

    e.checked = true;

  }

}



function convert(what) {

  val = eval('document.busc.'+what+'.value');

  if (val!="") {

    val = Math.ceil(val * 166.386);

    if (isNaN(val)) 

      val = '  Error en formato';

    else   

      val = '   '+val+' ptas';

    document.forms[what].texto.value = val;

    return true;

  }

  return false;

  

}





function MM_findObj(n, d) { //v4.0

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && document.getElementById) x=document.getElementById(n); return x;

}



function MM_showHideLayers() { //v3.0

  var i,p,v,obj,args=MM_showHideLayers.arguments;

  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];

    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }

    obj.visibility=v; }

}



function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}





function printit(){  

if (NS) {

    window.print() ;  

} else {

    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';

document.body.insertAdjacentHTML('beforeEnd', WebBrowser);

    WebBrowser1.ExecWB(6, 2);

WebBrowser1.outerHTML = "";  

}

}



function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}



function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}



function emutation_ToObject(id) {

		if(document.layers){

			return (document.layers[id])?eval(document.layers[id]):null;

		}

		else if(document.all && !document.getElementById){

			return (eval("window."+id))?eval("window."+id):null;

		}

		else if(document.getElementById && document.body.style) {

			return (document.getElementById(id))?eval(document.getElementById(id)):null;

		}

	}

  

function emutation_FlashWrite(miEMswf, miEMcreativewidth, miEMcreativeheight, miEMwmode, miEMbgcolor, miID){



	var emswf = miEMswf;

	var emcreativewidth = miEMcreativewidth;

	var emcreativeheight = miEMcreativeheight;

	var emwmode = miEMwmode;

	var embgcolor = miEMbgcolor;



	ntcode = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='"+ emcreativewidth +"' height='"+ emcreativeheight +"' id='"+ miID +"'>";

	ntcode +="<param name='movie' value='" + emswf + "'>";

	ntcode +="<param name='quality' value='high'>";

	ntcode +="<param name='bgcolor' value='#" + embgcolor +"'>";

	ntcode +="<param name='wmode' value='"+ emwmode +"'>";

	ntcode +="<param name='menu' value='false'>";

	ntcode +="<embed src='" + emswf + "' quality='high' wmode='" + emwmode + "' width='" + emcreativewidth + "' height='" + emcreativeheight + "' bgcolor='#" + embgcolor +"' type='application/x-shockwave-flash' menu='false' name='"+ miID +"' swLiveConnect='true'></embed></object>";

  	document.write(ntcode);

}



function emutation_FlashInnerHTML(htmlElementId,code){

  var x=emutation_ToObject(htmlElementId);

  if(x){

    if(document.getElementById||document.all){

      x.innerHTML='';

      x.innerHTML=code;

      }

    else if(document.layers){

      x.document.open();

      x.document.write(code);

      x.document.close();

      }

    }

  }



// Para alta/modificacion de usuario

function activaPaisUser (f,s) {

  var vSel = s.options[s.selectedIndex].value;

  var iSel = s.selectedIndex;

  

  if (iSel == s.options.length - 1) {

    f.txtPais.style.visibility="visible";  

    f.txtProvincia.style.visibility="visible";  

    f.txtProvincia.value = "";

    f.txtPais.value = "";

    f.selProvincia.disabled=true;

    f.selProvincia.selectedIndex = f.selProvincia.options.length - 1;

  } else {

    if ((vSel != "España") && (iSel!=0)) {

      f.txtPais.style.visibility="hidden";

      f.txtPais.value = "";

      f.txtProvincia.style.visibility="visible";  

      f.txtProvincia.value = ""

      f.selProvincia.disabled=true;

      f.selProvincia.selectedIndex = f.selProvincia.options.length - 1;

    } else {

      f.txtPais.style.visibility="hidden";  

      f.txtProvincia.style.visibility="hidden";  

      f.txtProvincia.value = "";

      f.txtPais.value = "";

      f.selProvincia.disabled=false;

      f.selProvincia.selectedIndex = 0;

    }

  }

    

}



function activaPais (selPais,selProv,txtPais,txtProv) {

  var vSel = selPais.options[selPais.selectedIndex].value;

  var iSel = selPais.selectedIndex;

  

  /// otro pais

  if (iSel == selPais.options.length - 1) {

    txtPais.style.visibility="visible";

    txtProv.style.visibility="visible";  

    txtProv.value = "";

    txtPais.value = "";

    selProv.disabled=true;

    selProv.selectedIndex = selProv.options.length - 1;

    return 1;

  } else {

  	// europa

    if ((vSel != "España") && (iSel!=0)) {

      txtPais.style.visibility="hidden";

      txtPais.value = vSel;

      txtProv.style.visibility="visible";  

      txtProv.value = "";

      selProv.disabled=true;

      selProv.selectedIndex = selProv.options.length - 1;

      return 2;

    } else {

      //españa

      txtPais.style.visibility="hidden";  

      txtProv.style.visibility="hidden";  

      txtProv.value = "";

      txtPais.value = "";

      selProv.disabled=false;

      selProv.selectedIndex = 0;

      return 3;

    }

  }

  

}



  function change_flash(id) {

    document.fBusc.provId.selectedIndex = id;

    document.fBusc.submit();

  }





	function cambia_buscador_neumaticos(tipo){

		if(tipo==1){

				document.getElementById('b_neumaticos_3').style.display='block';

                document.getElementById('menu_izquierda').style.height='480px';

                document.getElementById('menu_izquierda').style.background='url("images/fondomenu-izq22.jpg") no-repeat top';

				document.getElementById('b_neumaticos_2').style.display='none';



		}else{

				document.getElementById('b_neumaticos_3').style.display='none';

                document.getElementById('menu_izquierda').style.height='445px';

                document.getElementById('menu_izquierda').style.background='url("images/fondomenu-izq2.jpg") no-repeat top';

				document.getElementById('b_neumaticos_2').style.display='block';

		}



	}





/*  ------- Comprueba que el archivo seleccionado sea del tipo correcto antes de mandar el formulario -------- */

function comprobar_fichero(id,tipo1,tipo2){



    var fichero = document.getElementById(id).value;

    var temp = new Array();

    temp = fichero.split('.');

    extension=temp[temp.length-1].toLowerCase();

    tipo1=tipo1.toLowerCase();

    tipo2=tipo2.toLowerCase();

    if(extension == tipo1){

        fichero_valido=1;

    }else{

        if(extension == tipo2){

            fichero_valido=1;

        }else{

            fichero_valido=0;

            document.getElementById(id).value="";

            alert(" - Tipo de fichero NO valido - ");

        }

    }



}





/*  -------AJAX-------- */



/*function ocultar_loading(){

	document.getElementById('loading').style.display='none';

}

function mostrar_loading(){

	document.getElementById('loading').style.display='inline';

}*/



function nuevoAjax()

{ 

	/* Crea el objeto AJAX. Esta funcion es generica para cualquier utilidad de este tipo, por

	lo que se puede copiar tal como esta aqui */

	var xmlhttp=false;

	try

	{

		// Creacion del objeto AJAX para navegadores no IE

		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");

	}

	catch(e)

	{

		try

		{

			// Creacion del objet AJAX para IE

			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

		}

		catch(E)

		{

			if (!xmlhttp && typeof XMLHttpRequest!='undefined') xmlhttp=new XMLHttpRequest();

		}

	}

	return xmlhttp; 

}



// Declaro los selects que componen el documento HTML. Su atributo ID debe figurar aqui.

var listadoSelects=new Array();

listadoSelects[0]="marcas";

listadoSelects[1]="modelos";

listadoSelects[2]="vehiculos";



var listadoSelects2=new Array();

listadoSelects2[0]="usu_marca";

listadoSelects2[1]="usu_modelo";

listadoSelects2[2]="modelos_banner";

listadoSelects2[3]="vehiculos_banner";







function buscarEnArray(array, dato)

{

		// Retorna el indice de la posicion donde se encuentra el elemento en el array o null si no se encuentra

	var x=0;

	while(array[x])

	{

		if(array[x]==dato) return x;

		x++;

	}

	return null;

}



function cargaContenido(idSelectOrigen)

{

	// Obtengo la posicion que ocupa el select que debe ser cargado en el array declarado mas arriba

	var posicionSelectDestino=buscarEnArray(listadoSelects, idSelectOrigen)+1;

	// Obtengo el select que el usuario modifico

	var selectOrigen=document.getElementById(idSelectOrigen);

	// Obtengo la opcion que el usuario selecciono

	var opcionSeleccionada=selectOrigen.options[selectOrigen.selectedIndex].value;

	// Si el usuario eligio la opcion "Elige", no voy al servidor y pongo los selects siguientes en estado "Selecciona opcion..."

	if(opcionSeleccionada==0)

	{

		var x=posicionSelectDestino, selectActual=null;

		// Busco todos los selects siguientes al que inicio el evento onChange y les cambio el estado y deshabilito

		while(listadoSelects[x])

		{

			selectActual=document.getElementById(listadoSelects[x]);

			selectActual.length=0;



			var nuevaOpcion=document.createElement("option"); nuevaOpcion.value=0; nuevaOpcion.innerHTML="Selecciona Opci&oacute;n...";

			selectActual.appendChild(nuevaOpcion);	selectActual.disabled=true;

			x++;

		}

	}

	// Compruebo que el select modificado no sea el ultimo de la cadena

	else if(idSelectOrigen!=listadoSelects[listadoSelects.length-1])

	{

		// Obtengo el elemento del select que debo cargar

		var idSelectDestino=listadoSelects[posicionSelectDestino];

		var selectDestino=document.getElementById(idSelectDestino);

		// Creo el nuevo objeto AJAX y envio al servidor el ID del select a cargar y la opcion seleccionada del select origen

		var ajax=nuevoAjax();

		ajax.open("GET", "select_dependientes_proceso.php?select="+idSelectDestino+"&opcion="+opcionSeleccionada, true);



		ajax.onreadystatechange=function()

		{

			if (ajax.readyState==1)

			{

				// Mientras carga elimino la opcion "Selecciona Opcion..." y pongo una que dice "Cargando..."



				selectDestino.length=0;

				var nuevaOpcion=document.createElement("option"); nuevaOpcion.value=0; nuevaOpcion.innerHTML="Cargando...";

				selectDestino.appendChild(nuevaOpcion); selectDestino.disabled=true;

			}

			if (ajax.readyState==4)

			{

				selectDestino.parentNode.innerHTML=ajax.responseText;



			}

		}

		ajax.send(null);

	}

}



function cargaContenido2(idSelectOrigen)

{



	// Obtengo la posicion que ocupa el select que debe ser cargado en el array declarado mas arriba

	var posicionSelectDestino=buscarEnArray(listadoSelects2, idSelectOrigen)+1;

	// Obtengo el select que el usuario modifico

	var selectOrigen=document.getElementById(idSelectOrigen);

	// Obtengo la opcion que el usuario selecciono

	var opcionSeleccionada=selectOrigen.options[selectOrigen.selectedIndex].value;

	// Si el usuario eligio la opcion "Elige", no voy al servidor y pongo los selects siguientes en estado "Selecciona opcion..."

	if(opcionSeleccionada==0)

	{

		var x=posicionSelectDestino, selectActual=null;

		// Busco todos los selects siguientes al que inicio el evento onChange y les cambio el estado y deshabilito

		while(listadoSelects2[x])

		{

			selectActual=document.getElementById(listadoSelects2[x]);

			selectActual.length=0;



			var nuevaOpcion=document.createElement("option"); nuevaOpcion.value=0; nuevaOpcion.innerHTML="Selecciona Opci&oacute;n...";

			selectActual.appendChild(nuevaOpcion);	selectActual.disabled=true;

			x++;

		}

	}

	// Compruebo que el select modificado no sea el ultimo de la cadena

	else if(idSelectOrigen!=listadoSelects2[listadoSelects2.length-1])

	{

		// Obtengo el elemento del select que debo cargar

		var idSelectDestino=listadoSelects2[posicionSelectDestino];





		

		var selectDestino=document.getElementById(idSelectDestino);

		// Creo el nuevo objeto AJAX y envio al servidor el ID del select a cargar y la opcion seleccionada del select origen

		var ajax=nuevoAjax();

		ajax.open("GET", "select_dependientes_proceso.php?select="+idSelectDestino+"&opcion="+opcionSeleccionada+"&mas_de_dos=false", true);



		ajax.onreadystatechange=function()

		{

			if (ajax.readyState==1)

			{

				// Mientras carga elimino la opcion "Selecciona Opcion..." y pongo una que dice "Cargando..."

				selectDestino.length=0;

				var nuevaOpcion=document.createElement("option"); nuevaOpcion.value=0; nuevaOpcion.innerHTML="Cargando...";

				selectDestino.appendChild(nuevaOpcion); selectDestino.disabled=true;

			}

			if (ajax.readyState==4)

			{

				selectDestino.parentNode.innerHTML=ajax.responseText;



			}

		}

		ajax.send(null);

	}

}



function eliminaEspacios(cadena)

{

	// Funcion equivalente a trim en PHP

	var x=0, y=cadena.length-1;

	while(cadena.charAt(x)==" ") x++;

	while(cadena.charAt(y)==" ") y--;

	return cadena.substr(x, y-x+1);

}



function valida_registro_usuarios(id){



var texto;



texto ='Nota Legal \n\n Le informamos que los datos proporcionados serán incorporados a una base de datos, creada a fin de enviarle información sobre productos y servicios que puedan ser de su interés, registrada en la APD. En cumplimento de la L.O.P.D. de Carácter Personal nº 15/1.1999, del 13-12-99, ud. podrá en cualquier momento ejercitar los derechos de acceso, rectificación y cancelación de sus datos (más detalles en http://www.feuvert.es/user/proteccion_datos.php)';



valor = confirm (texto);

if (valor==true) {

    document.getElementById(id).submit();

}



}



function inscribeNewsletter(emailID, provinciaID)

{



var texto;



texto ='Nota Legal \n\n Le informamos que los datos proporcionados serán incorporados a una base de datos, creada a fin de enviarle información sobre productos y servicios que puedan ser de su interés, registrada en la APD. En cumplimento de la L.O.P.D. de Carácter Personal nº 15/1.1999, del 13-12-99, ud. podrá en cualquier momento ejercitar los derechos de acceso, rectificación y cancelación de sus datos (más detalles en http://www.feuvert.es/user/proteccion_datos.php)';



valor = confirm (texto);

if (valor==true) {



  var email=document.getElementById(emailID).value;

  var provincia=document.getElementById(provinciaID).value;

  

	var ajax=nuevoAjax();

	ajax.open("GET", "inscribe.php?email="+email+"&idprovincia="+provincia, true);

	ajax.onreadystatechange=function()

	{

		if (ajax.readyState==4)

		{

            document.getElementById(emailID).value="Escribe tu email";

            document.getElementById(provinciaID).selectedIndex = 0;

            alert("Tu email ha sido registrado correctamente. Gracias");



		}

	}

	ajax.send(null);



}

else {}

}



function ordenaNeumaticos(f,ordenarpor,descent) {

  

  f.orderby.value = ordenarpor;

  f.descent.value = descent;

  f.submit();

}



function confirmar(texto,accion){



valor = confirm (texto);

if (valor==true) {

    eval(accion);

}

else {}



}





function mostrar_ocultar(id){



    if(document.getElementById(id).style.display=='none'){

        document.getElementById(id).style.display='block';

    }



}