// JavaScript Document
function CrearXHR(){
	var ref=false;
	
	try{
		ref=new ActiveXObject('Msxml2.XMLHTTP');
		}catch(e1){
			try{
				ref=new ActiveXObject('Microsoft.XMLHTTP');
				}catch(e2){
					ref=false;
				}
			
		}
		if(!ref && (typeof XMLHttpRequest !='undefined' || window.XMLHttpRequest)){
			ref=new XMLHttpRequest();
		}
		return ref;
}
var error_mensaje="";
var submitte=false;
function vallogi(f){
	
	var elemento=document.getElementById('mensaje');
	
	
	
	var er_loginmas=/([0-9\s\+\-\_]|[a-z]|[A-Z]|á|é|í|ó|ú|ñ|ü|\.|_)$/
	var er_clavemas=/([0-9\s\+\-\_]|[a-z]|[A-Z]|á|é|í|ó|ú|ñ|ü|\.|_)$/
	
	var error=false;
	
	if (submitte == true) {
    alert("Ya ha enviado los datos del formulario. Pulse Aceptar y espere a que termine el proceso.");
    return false;
    }
	
	
	if(!er_loginmas.test(document.form1.loginmas.value)){
	error_mensaje=error_mensaje+"* Contenido del campo Usuario no valido. <br>";
	error=true;
	}
	if(!er_clavemas.test(document.form1.clavemas.value)){
	error_mensaje=error_mensaje+"* Contenido del campo Clave no valido. <br>";
	error=true;
	}
	
	if(error){	
	elemento.innerHTML='<p>'+error_mensaje+'</p>';
	error_mensaje="";
    return false;
	}else {		
	
    submitte = true;
    return true;	
    }
	
}

var error_mensajeb="";
var submitteb=false;
function valpro(g){
	
	var elementopro=document.getElementById('mensajepro');
	
	
	
	var er_provincia=/([0-9\s\+\-\_]|[a-z]|[A-Z]|á|é|í|ó|ú|ñ|ü|\.|_)$/
	
	
	var errorb=false;
	
	if (submitteb == true) {
    alert("Ya ha enviado los datos del formulario. Pulse Aceptar y espere a que termine el proceso.");
    return false;
    }
	
	
	if(!er_provincia.test(document.form1.provincia.value)){
	error_mensajeb=error_mensajeb+"* Contenido del campo Provincia no valido. <br>";
	errorb=true;
	}
	
	
	if(errorb){	
	elementopro.innerHTML='<p>'+error_mensajeb+'</p>';
	error_mensajeb="";
    return false;
	}else {		
	
    submitteb = true;
    return true;	
    }
	
}

var error_mensajec="";
var submittec=false;
function valcan(h){
	
	var elementocan=document.getElementById('mensajecan');
	
	
	
	var er_provincia=document.form1.provincia.selectedIndex
	var er_canton=/([0-9\s\+\-\_]|[a-z]|[A-Z]|á|é|í|ó|ú|ñ|ü|\.|_)$/
	
	
	var errorc=false;
	
	if (submittec == true) {
    alert("Ya ha enviado los datos del formulario. Pulse Aceptar y espere a que termine el proceso.");
    return false;
    }
	
	if(er_provincia==0){
	error_mensajec=error_mensajec+"* Debe seleccionar una Provincia. <br>";
	errorc=true;
	}
	if(!er_canton.test(document.form1.canton.value)){
	error_mensajec=error_mensajec+"* Contenido del campo Cantón no valido. <br>";
	errorc=true;
	}
	
	
	if(errorc){	
	elementocan.innerHTML='<p>'+error_mensajec+'</p>';
	error_mensajec="";
    return false;
	}else {		
	
    submittec = true;
    return true;	
    }
	
}

var error_mensajed="";
var submitted=false;
function valmar(k){
	
	var elementomar=document.getElementById('mensajemar');
	
	
	
	var er_marca=/([0-9\s\+\-\_]|[a-z]|[A-Z]|á|é|í|ó|ú|ñ|ü|\.|_)$/
	var er_file1=/([0-9\s\+\-\_]|[a-z]|[A-Z]|á|é|í|ó|ú|ñ|ü|\.|_)$/
	
	
	var errord=false;
	
	if (submitted == true) {
    alert("Ya ha enviado los datos del formulario. Pulse Aceptar y espere a que termine el proceso.");
    return false;
    }
	
	if(!er_marca.test(document.form1.marca.value)){
	error_mensajed=error_mensajed+"* Contenido del campo Marca no valido. <br>";
	errord=true;
	}
	if(!er_file1.test(document.form1.file1.value)){
	error_mensajed=error_mensajed+"* Contenido del campo Imagen no valido. <br>";
	errord=true;
	}
	
	
	if(errord){	
	elementomar.innerHTML='<p>'+error_mensajed+'</p>';
	error_mensajed="";
    return false;
	}else {		
	
    submitted = true;
    return true;	
    }
	
}

var error_mensajee="";
var submittee=false;
function valmode(l){
	
	var elementomo=document.getElementById('mensajemo');
	
	
	
	var er_marca=document.form1.marca.selectedIndex
	var er_modelo=/([0-9\s\+\-\_]|[a-z]|[A-Z]|á|é|í|ó|ú|ñ|ü|\.|_)$/
	
	
	var errore=false;
	
	if (submittee == true) {
    alert("Ya ha enviado los datos del formulario. Pulse Aceptar y espere a que termine el proceso.");
    return false;
    }
	
	if(er_marca==0){
	error_mensajee=error_mensajee+"* Debe seleccionar una Marca. <br>";
	errore=true;
	}
	if(!er_modelo.test(document.form1.modelo.value)){
	error_mensajee=error_mensajee+"* Contenido del campo Modelo no valido. <br>";
	errore=true;
	}
	
	
	if(errore){	
	elementomo.innerHTML='<p>'+error_mensajee+'</p>';
	error_mensajee="";
    return false;
	}else {		
	
    submittee = true;
    return true;	
    }
	
}

var error_mensajef="";
var submittef=false;
function valcolor(m){
	
	var elementocol=document.getElementById('mensajecol');
	
	
	
	var er_color=/([0-9\s\+\-\_]|[a-z]|[A-Z]|á|é|í|ó|ú|ñ|ü|\.|_)$/
	
	
	var errorf=false;
	
	if (submittef == true) {
    alert("Ya ha enviado los datos del formulario. Pulse Aceptar y espere a que termine el proceso.");
    return false;
    }
	
	
	if(!er_color.test(document.form1.color.value)){
	error_mensajef=error_mensajef+"* Contenido del campo Color no valido. <br>";
	errorf=true;
	}
	
	
	if(errorf){	
	elementocol.innerHTML='<p>'+error_mensajef+'</p>';
	error_mensajef="";
    return false;
	}else {		
	
    submittef = true;
    return true;	
    }
	
}

var error_mensajeg="";
var submitteg=false;
function valsonido(n){
	
	var elementoson=document.getElementById('mensajeson');
	
	
	
	var er_descripcion=/([0-9\s\+\-\_]|[a-z]|[A-Z]|á|é|í|ó|ú|ñ|ü|\.|_)$/
	
	
	var errorg=false;
	
	if (submitteg == true) {
    alert("Ya ha enviado los datos del formulario. Pulse Aceptar y espere a que termine el proceso.");
    return false;
    }
	
	
	if(!er_descripcion.test(document.form1.descripcion.value)){
	error_mensajeg=error_mensajeg+"* Contenido del campo Descripción no valido. <br>";
	errorg=true;
	}
	
	
	if(errorg){	
	elementoson.innerHTML='<p>'+error_mensajeg+'</p>';
	error_mensajeg="";
    return false;
	}else {		
	
    submitteg = true;
    return true;	
    }
	
}


var error_mensajeh="";
var submitteh=false;
function valser(h){
	
	var elementoser=document.getElementById('ensajeservi');
	
	
	
	var er_nombre=/([0-9\s\+\-\_]|[a-z]|[A-Z]|á|é|í|ó|ú|ñ|ü|\.|_)$/
	var er_provincias=document.form1.provincias.selectedIndex
	var er_cantones=document.form1.cantones.selectedIndex
	var er_direccion=/([0-9\s\+\-\_]|[a-z]|[A-Z]|á|é|í|ó|ú|ñ|ü|\.|_)$/
	var er_telefono=/([0-9\s\_])$/
	var er_filese=/([0-9\s\+\-\_]|[a-z]|[A-Z]|á|é|í|ó|ú|ñ|ü|\.|_)$/
	var er_correo=/(.+\@.+\..+)$/
	var er_paginaw=/([0-9\s\+\-\_]|[a-z]|[A-Z]|á|é|í|ó|ú|ñ|ü|\.|_)$/
	var er_contacto=/([0-9\s\+\-\_]|[a-z]|[A-Z]|á|é|í|ó|ú|ñ|ü|\.|_)$/
	
	var errorh=false;
	
	if (submitteh == true) {
    alert("Ya ha enviado los datos del formulario. Pulse Aceptar y espere a que termine el proceso.");
    return false;
    }
	
	
	if(!er_nombre.test(document.form1.nombre.value)){
	error_mensajeh=error_mensajeh+"* Contenido del campo Nombre / Razón Social no valido. <br>";
	errorh=true;
	}
	if(er_provincias==0){
	error_mensajeh=error_mensajeh+"* Contenido del campo Provincia no valido. <br>";
	errorh=true;
	}
	if(er_cantones==0){
	error_mensajeh=error_mensajeh+"* Contenido del campo Cantón no valido. <br>";
	errorh=true;
	}
	if(!er_direccion.test(document.form1.direccion.value)){
	error_mensajeh=error_mensajeh+"* Contenido del campo Dirección no valido. <br>";
	errorh=true;
	}
	if(!er_telefono.test(document.form1.telefono.value)){
	error_mensajeh=error_mensajeh+"* Contenido del campo Teléfono no valido. <br>";
	errorh=true;
	}
	if(!er_filese.test(document.form1.filese.value)){
	error_mensajeh=error_mensajeh+"* Contenido del campo Logo no valido. <br>";
	errorh=true;
	}
	if(!er_correo.test(document.form1.correo.value)){
	error_mensajeh=error_mensajeh+"* Contenido del campo E-mail no valido. <br>";
	errorh=true;
	}
	if(!er_paginaw.test(document.form1.paginaw.value)){
	error_mensajeh=error_mensajeh+"* Contenido del campo Página Web no valido. <br>";
	errorh=true;
	}
	if(!er_contacto.test(document.form1.contacto.value)){
	error_mensajeh=error_mensajeh+"* Contenido del campo Contacto no valido. <br>";
	errorh=true;
	}
	
	if(errorh){	
	elementoser.innerHTML='<p>'+error_mensajeh+'</p>';
	error_mensajeh="";
    return false;
	}else {		
	
    submitteh = true;
    return true;	
    }
	
}

var error_mensajehb="";
var submittehb=false;
function valserb(hb){
	
	var elementoserb=document.getElementById('ensajeservi');
	
	
	
	var er_nombreb=/([0-9\s\+\-\_]|[a-z]|[A-Z]|á|é|í|ó|ú|ñ|ü|\.|_)$/
	var er_provinciasb=document.form1.provincias.selectedIndex
	var er_cantonesb=document.form1.cantones.selectedIndex
	var er_direccionb=/([0-9\s\+\-\_]|[a-z]|[A-Z]|á|é|í|ó|ú|ñ|ü|\.|_)$/
	var er_telefonob=/([0-9\s\_])$/
	
	var er_correob=/(.+\@.+\..+)$/
	var er_paginawb=/([0-9\s\+\-\_]|[a-z]|[A-Z]|á|é|í|ó|ú|ñ|ü|\.|_)$/
	var er_contactob=/([0-9\s\+\-\_]|[a-z]|[A-Z]|á|é|í|ó|ú|ñ|ü|\.|_)$/
	
	var errorhb=false;
	
	if (submitteh == true) {
    alert("Ya ha enviado los datos del formulario. Pulse Aceptar y espere a que termine el proceso.");
    return false;
    }
	
	
	if(!er_nombreb.test(document.form1.nombre.value)){
	error_mensajehb=error_mensajehb+"* Contenido del campo Nombre / Razón Social no valido. <br>";
	errorhb=true;
	}
	if(er_provinciasb==0){
	error_mensajehb=error_mensajehb+"* Contenido del campo Provincia no valido. <br>";
	errorhb=true;
	}
	if(er_cantonesb==0){
	error_mensajehb=error_mensajehb+"* Contenido del campo Cantón no valido. <br>";
	errorhb=true;
	}
	if(!er_direccionb.test(document.form1.direccion.value)){
	error_mensajehb=error_mensajehb+"* Contenido del campo Dirección no valido. <br>";
	errorhb=true;
	}
	if(!er_telefonob.test(document.form1.telefono.value)){
	error_mensajehb=error_mensajehb+"* Contenido del campo Teléfono no valido. <br>";
	errorhb=true;
	}
	
	if(!er_correob.test(document.form1.correo.value)){
	error_mensajehb=error_mensajehb+"* Contenido del campo E-mail no valido. <br>";
	errorhb=true;
	}
	if(!er_paginawb.test(document.form1.paginaw.value)){
	error_mensajehb=error_mensajehb+"* Contenido del campo Página Web no valido. <br>";
	errorhb=true;
	}
	if(!er_contactob.test(document.form1.contacto.value)){
	error_mensajehb=error_mensajehb+"* Contenido del campo Contacto no valido. <br>";
	errorhb=true;
	}
	
	if(errorhb){	
	elementoserb.innerHTML='<p>'+error_mensajehb+'</p>';
	error_mensajehb="";
    return false;
	}else {		
	
    submittehb = true;
    return true;	
    }
	
}

var error_mensajepre="";
var submittepre=false;
function valpre(g){
	
	var elementopre=document.getElementById('mensajepre');
	
	
	
	var er_tipopaque=/([0-9\s\+\-\_]|[a-z]|[A-Z]|á|é|í|ó|ú|ñ|ü|\.|_)$/
	var er_precioanu=/([0-9\s\+\-\_]|[a-z]|[A-Z]|á|é|í|ó|ú|ñ|ü|\.|_)$/
	var er_precioto=/([0-9\s\+\-\_]|[a-z]|[A-Z]|á|é|í|ó|ú|ñ|ü|\.|_)$/
	
	var errorpre=false;
	
	if (submittepre == true) {
    alert("Ya ha enviado los datos del formulario. Pulse Aceptar y espere a que termine el proceso.");
    return false;
    }
	
	
	if(!er_tipopaque.test(document.form1.tipopaque.value)){
	error_mensajepre=error_mensajepre+"* Contenido del campo Tipo Paquete no valido. <br>";
	errorpre=true;
	}
	if(!er_precioanu.test(document.form1.precioanu.value)){
	error_mensajepre=error_mensajepre+"* Contenido del campo Precio x Anuncio no valido. <br>";
	errorpre=true;
	}
	if(!er_precioto.test(document.form1.precioto.value)){
	error_mensajepre=error_mensajepre+"* Contenido del campo Prrecio Total no valido. <br>";
	errorpre=true;
	}
	
	
	if(errorpre){	
	elementopre.innerHTML='<p>'+error_mensajepre+'</p>';
	error_mensajepre="";
    return false;
	}else {		
	
    submittepre= true;
    return true;	
    }
	
}



//----------------------------------------------------
function paginacion(targ,selObj,restore){
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}
function planes(numero,np){
	
	var pn;
	pn=parseInt(numero);
	error_poli="";
	switch(pn){
	case 1:
	var elementopoli=document.getElementById('mensajepoli');
	if(!document.form1.politica.checked){
	error_poli="* Debe seleccionar la casilla para indcar que acepto las Politicas y Condiciones Generales." 
	elementopoli.innerHTML='<p>'+error_poli+'</p>';
	error_poli="";
	}else{
	window.location='keygen.php?pln='+np;
	}
	break;
	case 2:
	window.location='forma_pago1.php';
	break;
	case 3:
	window.location='index.php';
	break;
	}

}

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}
function panel(nmenu){

	var menu=parseInt(nmenu);
	
	switch(menu){
		case 1:
		window.location='pprovincia.php';
		break;
		case 2:
		window.location='list_provincia.php';
		break;
		case 3:
		window.location='pcanton.php';
		break;
		case 4:
		window.location='list_canton.php';
		break;
		case 5:
		window.location='pmarca.php';
		break;
		case 6:
		window.location='list_marca.php';
		break;
		case 7:
		window.location='pmodelo.php';
		break;
		case 8:
		window.location='list_modelo.php';
		break;
		case 9:
		window.location='pcolor.php';
		break;
		case 10:
		window.location='list_color.php';
		break;
		case 11:
		window.location='psonido.php';
		break;
		case 12:
		window.location='list_sonido.php';
		break;
		case 13:
		window.location='bus_plan1.php';
		break;
		case 14:
		window.location='ptvehiculo.php';
		break;
		case 15:
		window.location='list_tvehiculo.php';
		break;
		case 16:
		window.location='pcilindrada.php';
		break;
		case 17:
		window.location='list_cilindrada.php';
		break;
		case 18:
		window.location='pcombustible.php';
		break;
		case 19:
		window.location='list_combustible.php';
		break;
		case 20:
		window.location='pasiento.php';
		break;
		case 21:
		window.location='list_asiento.php';
		break;
		case 22:
		window.location='pprecio.php';
		break;
		case 23:
		window.location='list_precio.php';
		break;
		case 24:
		window.location='prepuestos.php';
		break;
		case 25:
		window.location='list_repuesto.php';
		break;
		case 26:
		window.location='ptalleres.php';
		break;
		case 27:
		window.location='list_taller.php';
		break;
		case 28:
		window.location='paccesorios.php';
		break;
		case 29:
		window.location='list_accesorio.php';
		break;
		case 30:
		window.location='pservicioc.php';
		break;
		case 31:
		window.location='list_servicioc.php';
		break;
		case 32:
		window.location='pclientes.php';
		break;
		case 33:
		window.location='ppreciocon.php';
		break;
		case 34:
		window.location='list_preciocon.php';
		break;
	
	}
	
}
function favori(url,titulo){
if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) {
//var url="http://www.tudireccion.com/"; //Cambia esta dirección por la de tu web
//var titulo="El nombre de mi web"; //Cambia esta nombre por el de tu web
window.external.AddFavorite(url,titulo);
}
//Para Netscape y Firefox
else {
if(navigator.appName == "Netscape"){
//alert ("Presione Crtl+D para agregar a este sitio en sus Bookmarks");  //Puedes personalizar este mensaje
window.sidebar.addPanel(titulo,url,"");
}
}

}

function filtroveh(targ,selObj,restore){
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}


function paginacionbus(targ,selObj,restore){
	
	if(document.getElementById('ubicacion').selectedIndex !=0 || document.getElementById('estilo').selectedIndex !=0 || document.getElementById('marca').selectedIndex !=0 || document.getElementById('modelo').selectedIndex !=0 || document.getElementById('precio').selectedIndex !=0 || document.getElementById('anio').selectedIndex !=0 || document.getElementById('combustible').selectedIndex !=0  ){
	var ubi=document.getElementById('ubicacion').value;
	var esti=document.getElementById('estilo').value;
	var marc=document.getElementById('marca').value;
	var mode=document.getElementById('modelo').value;
	var prec=document.getElementById('precio').value;
	var ani=document.getElementById('anio').value;
	var combu=document.getElementById('combustible').value;
	var strvars="ubi="+ubi+"&esti="+esti+"&marc="+marc+"&mode="+mode+"&prec="+prec+"&ani="+ani+"&combu="+combu;
	
	eval(targ+".location='list_busqueda.php?"+strvars+"'");
	if (restore) selObj.selectedIndex=0;
	
	}
}

 function selUbicaion(objubi){
 var objub=objubi;
 
 for(i=0; i < document.getElementById('ubicacion').length; i++){
   if(document.getElementById('ubicacion').options[i].value==objub){
     document.getElementById('ubicacion').options[i].selected=true;
   }
 }
}

 function selEstilo(objestil){
 var objesti=objestil;
 
 for(j=0; j < document.getElementById('estilo').length; j++){
   if(document.getElementById('estilo').options[j].value==objesti){
     document.getElementById('estilo').options[j].selected=true;
   }
 }
}

 function selMarca(objmarc){
 var objmar=objmarc;
 
 for(k=0; k < document.getElementById('marca').length; k++){
   if(document.getElementById('marca').options[k].value==objmar){
     document.getElementById('marca').options[k].selected=true;
   }
 }
}

 function selModelo(objmodel){
 var objmode=objmodel;
 
 for(l=0; l < document.getElementById('modelo').length; l++){
   if(document.getElementById('modelo').options[l].value==objmode){
     document.getElementById('modelo').options[l].selected=true;
   }
 }
}

 function selPrecio(objprecio){
 var objpreci=objprecio;
 
 for(m=0; m < document.getElementById('precio').length; m++){
   if(document.getElementById('precio').options[m].value==objpreci){
     document.getElementById('precio').options[m].selected=true;
   }
 }
}

 function selAnio(objanio){
 var objani=objanio;
 
 for(n=0; n < document.getElementById('anio').length; n++){
   if(document.getElementById('anio').options[n].value==objani){
     document.getElementById('anio').options[n].selected=true;
   }
 }
}

 function selCombustible(objcombus){
 var objcombu=objcombus;
 
 for(p=0; p < document.getElementById('combustible').length; p++){
   if(document.getElementById('combustible').options[p].value==objcombu){
     document.getElementById('combustible').options[p].selected=true;
   }
 }
}


function NuevaBusqueda(){
	
	document.getElementById('ubicacion').options[0].selected=true;
	document.getElementById('estilo').options[0].selected=true;
	document.getElementById('marca').options[0].selected=true;
	document.getElementById('modelo').options[0].selected=true;
	document.getElementById('precio').options[0].selected=true;
	document.getElementById('anio').options[0].selected=true;
	document.getElementById('combustible').options[0].selected=true;
	
	var ubi=document.getElementById('ubicacion').value;
	var esti=document.getElementById('estilo').value;
	var marc=document.getElementById('marca').value;
	var mode=document.getElementById('modelo').value;
	var prec=document.getElementById('precio').value;
	var ani=document.getElementById('anio').value;
	var combu=document.getElementById('combustible').value;
	var strvars="ubi="+ubi+"&esti="+esti+"&marc="+marc+"&mode="+mode+"&prec="+prec+"&ani="+ani+"&combu="+combu;
	
	window.location='list_busqueda.php?'+strvars;
}


//**************************************************************************************

function paginacionbusb(targ,selObj,restore){
	
	if(document.getElementById('provincias').selectedIndex !=0 || document.getElementById('cantones').selectedIndex !=0 || document.getElementById('distrito').selectedIndex !=0 || document.getElementById('marca').selectedIndex !=0 || document.getElementById('tipo').selectedIndex !=0   ){
	var provi=document.getElementById('provincias').value;
	var canto=document.getElementById('cantones').value;
	var distri=document.getElementById('distrito').value;
	var marca=document.getElementById('marca').value;
	var cate=document.getElementById('tipo').value;
	
	
	var strvars="provi="+provi+"&canto="+canto+"&distri="+distri+"&marca="+marca+"&cate="+cate;
	
	eval(targ+".location='list_busquedar.php?"+strvars+"'");
	if (restore) selObj.selectedIndex=0;
	
	}
}

function paginacionbusc(targ,selObj,restore){
	
	if(document.getElementById('provincias').selectedIndex !=0 || document.getElementById('cantones').selectedIndex !=0 || document.getElementById('distrito').selectedIndex !=0 || document.getElementById('marca').selectedIndex !=0 || document.getElementById('tipo').selectedIndex !=0   ){
	var provi=document.getElementById('provincias').value;
	var canto=document.getElementById('cantones').value;
	var distri=document.getElementById('distrito').value;
	var marca=document.getElementById('marca').value;
	var cate=document.getElementById('tipo').value;
	
	
	var strvars="provi="+provi+"&canto="+canto+"&distri="+distri+"&marca="+marca+"&cate="+cate;
	
	eval(targ+".location='list_busquedaa.php?"+strvars+"'");
	if (restore) selObj.selectedIndex=0;
	
	}
}

function paginacionbusd(targ,selObj,restore){
	
	if(document.getElementById('provincias').selectedIndex !=0 || document.getElementById('cantones').selectedIndex !=0 || document.getElementById('distrito').selectedIndex !=0 || document.getElementById('marca').selectedIndex !=0 || document.getElementById('tipo').selectedIndex !=0   ){
	var provi=document.getElementById('provincias').value;
	var canto=document.getElementById('cantones').value;
	var distri=document.getElementById('distrito').value;
	var marca=document.getElementById('marca').value;
	var cate=document.getElementById('tipo').value;
	
	
	var strvars="provi="+provi+"&canto="+canto+"&distri="+distri+"&marca="+marca+"&cate="+cate;
	
	eval(targ+".location='list_busquedat.php?"+strvars+"'");
	if (restore) selObj.selectedIndex=0;
	
	}
}

function paginacionbuse(targ,selObj,restore){
	
	if(document.getElementById('provincias').selectedIndex !=0 || document.getElementById('cantones').selectedIndex !=0 || document.getElementById('distrito').selectedIndex !=0 || document.getElementById('marca').selectedIndex !=0 ){
	var provi=document.getElementById('provincias').value;
	var canto=document.getElementById('cantones').value;
	var distri=document.getElementById('distrito').value;
	var marca=document.getElementById('marca').value;
	
	
	
	var strvars="provi="+provi+"&canto="+canto+"&distri="+distri+"&marca="+marca;
	
	eval(targ+".location='list_busquedaal.php?"+strvars+"'");
	if (restore) selObj.selectedIndex=0;
	
	}
}
function paginacionbusf(targ,selObj,restore){
	
	if(document.getElementById('provincias').selectedIndex !=0 || document.getElementById('cantones').selectedIndex !=0 || document.getElementById('distrito').selectedIndex !=0 || document.getElementById('marca').selectedIndex !=0 ){
	var provi=document.getElementById('provincias').value;
	var canto=document.getElementById('cantones').value;
	var distri=document.getElementById('distrito').value;
	var marca=document.getElementById('marca').value;
	
	
	
	var strvars="provi="+provi+"&canto="+canto+"&distri="+distri+"&marca="+marca;
	
	eval(targ+".location='list_busquedalub.php?"+strvars+"'");
	if (restore) selObj.selectedIndex=0;
	
	}
}

function paginacionbusg(targ,selObj,restore){
	
	if(document.getElementById('provincias').selectedIndex !=0 || document.getElementById('cantones').selectedIndex !=0 || document.getElementById('distrito').selectedIndex !=0 || document.getElementById('marca').selectedIndex !=0 ){
	var provi=document.getElementById('provincias').value;
	var canto=document.getElementById('cantones').value;
	var distri=document.getElementById('distrito').value;
	var marca=document.getElementById('marca').value;
	
	
	
	var strvars="provi="+provi+"&canto="+canto+"&distri="+distri+"&marca="+marca;
	
	eval(targ+".location='list_busquedalav.php?"+strvars+"'");
	if (restore) selObj.selectedIndex=0;
	
	}
}

 function selProvincia(objprovi){
 var objpro=objprovi;
 
 for(i=0; i < document.getElementById('provincias').length; i++){
   if(document.getElementById('provincias').options[i].value==objpro){
     document.getElementById('provincias').options[i].selected=true;
   }
 }
}

 function selCanton(objcanto){
 var objcan=objcanto;
 
 for(j=0; j < document.getElementById('cantones').length; j++){
   if(document.getElementById('cantones').options[j].value==objcan){
     document.getElementById('cantones').options[j].selected=true;
   }
 }
}

 function selMarcab(objmarcb){
 var objmarb=objmarcb;
 
 for(k=0; k < document.getElementById('marca').length; k++){
   if(document.getElementById('marca').options[k].value==objmarb){
     document.getElementById('marca').options[k].selected=true;
   }
 }
}

 function selDistrito(objdistri){
 var objdis=objdistri;
 
 for(l=0; l < document.getElementById('distrito').length; l++){
   if(document.getElementById('distrito').options[l].value==objdis){
     document.getElementById('distrito').options[l].selected=true;
   }
 }
}


function selDistritob(objdistri){
 var objdis=objdistri;
 
 for(l=0; l < document.getElementById('zona').length; l++){
   if(document.getElementById('zona').options[l].value==objdis){
     document.getElementById('zona').options[l].selected=true;
   }
 }
}

 function selCategoria(objcatego){
 var objcate=objcatego;
 
 for(m=0; m < document.getElementById('tipo').length; m++){
   if(document.getElementById('tipo').options[m].value==objcate){
     document.getElementById('tipo').options[m].selected=true;
   }
 }
}


function NuevaBusquedab(){
	
	document.getElementById('provincias').options[0].selected=true;
	document.getElementById('cantones').options[0].selected=true;
	document.getElementById('distrito').options[0].selected=true;
	document.getElementById('marca').options[0].selected=true;
	document.getElementById('tipo').options[0].selected=true;
	
	
	var provi=document.getElementById('provincias').value;
	var canto=document.getElementById('cantones').value;
	var distri=document.getElementById('distrito').value;
	var marca=document.getElementById('marca').value;
	var cate=document.getElementById('tipo').value;
	
	
	var strvars="provi="+provi+"&canto="+canto+"&distri="+distri+"&marca="+marca+"&cate="+cate;
	
	window.location='list_busquedar.php?'+strvars;
}

function NuevaBusquedac(){
	
	document.getElementById('provincias').options[0].selected=true;
	document.getElementById('cantones').options[0].selected=true;
	document.getElementById('distrito').options[0].selected=true;
	document.getElementById('marca').options[0].selected=true;
	document.getElementById('tipo').options[0].selected=true;
	
	
	var provi=document.getElementById('provincias').value;
	var canto=document.getElementById('cantones').value;
	var distri=document.getElementById('distrito').value;
	var marca=document.getElementById('marca').value;
	var cate=document.getElementById('tipo').value;
	
	
	var strvars="provi="+provi+"&canto="+canto+"&distri="+distri+"&marca="+marca+"&cate="+cate;
	
	window.location='list_busquedaa.php?'+strvars;
}

function NuevaBusquedad(){
	
	document.getElementById('provincias').options[0].selected=true;
	document.getElementById('cantones').options[0].selected=true;
	document.getElementById('distrito').options[0].selected=true;
	document.getElementById('marca').options[0].selected=true;
	document.getElementById('tipo').options[0].selected=true;
	
	
	var provi=document.getElementById('provincias').value;
	var canto=document.getElementById('cantones').value;
	var distri=document.getElementById('distrito').value;
	var marca=document.getElementById('marca').value;
	var cate=document.getElementById('tipo').value;
	
	
	var strvars="provi="+provi+"&canto="+canto+"&distri="+distri+"&marca="+marca+"&cate="+cate;
	
	window.location='list_busquedat.php?'+strvars;
}

function NuevaBusquedae(){
	
	document.getElementById('provincias').options[0].selected=true;
	document.getElementById('cantones').options[0].selected=true;
	document.getElementById('distrito').options[0].selected=true;
	document.getElementById('marca').options[0].selected=true;
	
	
	
	var provi=document.getElementById('provincias').value;
	var canto=document.getElementById('cantones').value;
	var distri=document.getElementById('distrito').value;
	var marca=document.getElementById('marca').value;
	
	
	
	var strvars="provi="+provi+"&canto="+canto+"&distri="+distri+"&marca="+marca;
	
	window.location='list_busquedaal.php?'+strvars;
}
function NuevaBusquedaf(){
	
	document.getElementById('provincias').options[0].selected=true;
	document.getElementById('cantones').options[0].selected=true;
	document.getElementById('distrito').options[0].selected=true;
	document.getElementById('marca').options[0].selected=true;
	
	
	
	var provi=document.getElementById('provincias').value;
	var canto=document.getElementById('cantones').value;
	var distri=document.getElementById('distrito').value;
	var marca=document.getElementById('marca').value;
	
	
	
	var strvars="provi="+provi+"&canto="+canto+"&distri="+distri+"&marca="+marca;
	
	window.location='list_busquedalub.php?'+strvars;
}

function NuevaBusquedag(){
	
	document.getElementById('provincias').options[0].selected=true;
	document.getElementById('cantones').options[0].selected=true;
	document.getElementById('distrito').options[0].selected=true;
	document.getElementById('marca').options[0].selected=true;
	
	
	
	var provi=document.getElementById('provincias').value;
	var canto=document.getElementById('cantones').value;
	var distri=document.getElementById('distrito').value;
	var marca=document.getElementById('marca').value;
	
	
	
	var strvars="provi="+provi+"&canto="+canto+"&distri="+distri+"&marca="+marca;
	
	window.location='list_busquedalav.php?'+strvars;
}