// JavaScript Document
function check_submit_buscar(e){
	if(window.event){ // IE
		if(e.keyCode == 13){
			buscar_go();
		}// if tecla
	}else if(e.which){ // Netscape/Firefox/Opera
		if(e.which == 13){
			buscar_go();
		} // if tecla
	}// if verificador navegador
}
		
// plantilla
function buscar_go(){
	// obtenemos el campo de la busqueda
	campo_buscar = document.getElementById('q');
	// verificamos que el campo teng por lo menos 4 caracteres
	if(campo_buscar.value.length < 3){
		alert('por favor ingrese un criterio de búsqueda');
	}else{
		document.location = 'index.php?sub_cat=buscar&q=' + campo_buscar.value + '&';
	}
}

// JavaScript Document
function check_submit_buscar_productos(e){
	if(window.event){ // IE
		if(e.keyCode == 13){
			buscar_go_productos();
		}// if tecla
	}else if(e.which){ // Netscape/Firefox/Opera
		if(e.which == 13){
			buscar_go_productos();
		} // if tecla
	}// if verificador navegador
}

// plantilla
function buscar_go_productos(){
	// obtenemos el campo de la busqueda
	campo_buscar = document.getElementById('q');
	// verificamos que el campo teng por lo menos 4 caracteres
	if(campo_buscar.value.length < 3){
		alert('por favor ingrese un criterio de búsqueda');
	}else{
		document.location = 'index.php?sub_cat=buscar&q=' + campo_buscar.value + '&';
	}
}

function check_submit_buscar_por_linea_negocio(e,sub_cat_ln){
	if(window.event){ // IE
		if(e.keyCode == 13){
			buscar_go_por_linea_negocio(sub_cat_ln);
		}// if tecla
	}else if(e.which){ // Netscape/Firefox/Opera
		if(e.which == 13){
			buscar_go_por_linea_negocio(sub_cat_ln);
		} // if tecla
	}// if verificador navegador
}
		
// plantilla
function buscar_go_por_linea_negocio(sub_cat_ln){
	// obtenemos el campo de la busqueda
	campo_buscar = document.getElementById('q');
	// verificamos que el campo teng por lo menos 4 caracteres
	if(campo_buscar.value.length < 3){
		alert('por favor ingrese un criterio de búsqueda');
	}else{
	    if(sub_cat_ln != undefined){
		  document.location = 'index.php?sub_cat='+sub_cat_ln+'&q=' + campo_buscar.value + '&';
	    }else{
		  document.location = 'index.php?sub_cat=buscar&q=' + campo_buscar.value + '&';
	    }
	}
}

