function redimensionar(imagen,imagenSRC, w){
	document.images[imagen].onload = "";
	ObjImagen = new Image;
	ObjImagen.src = imagenSRC; 
	if (ObjImagen.width > w)
	{
		if(ObjImagen.height >= ObjImagen.width){
			div = ObjImagen.height / w;
			document.images[imagen].width = ObjImagen.width /div;
			document.images[imagen].height = w;
		} 
		else{
			div = ObjImagen.width / w;
			document.images[imagen].height = ObjImagen.height /div;
			document.images[imagen].width = w;
		}
	}
	document.images[imagen].src = imagenSRC;
	document.images[imagen].style.visibility = "visible";
	document.images[imagen].style.display = "";
}

function abreMapaWeb(ruta){
	window.open(ruta+'mapaweb.asp','MapaWeb','width=650,height=606,scrollbars=yes, locationbars=no,status=no');
}

function abreRepresentantes(){
	window.open('representantes.asp','Representantes','width=650,height=500,scrollbars=yes, locationbars=no,status=no');
}

function abreSEPALOCALIZACION(){
	window.open('sepa_localizacion.asp','SEPA_Localizacion','width=650,height=500,scrollbars=yes, locationbars=no,status=no');
}

function abreSEPATRAMITES(){
	window.open('sepa_tramites.asp','SEPA_Tramites','width=650,height=500,scrollbars=yes, locationbars=no,status=no');
}

function lnkMapa(url){
	window.opener.document.location=url;
}
function alternar_img (nombre,Fuente){
	img= new Object ();
	imagen = nombre;
	imagen.src = Fuente;
}
function validarformulario(campos){
	for(i=0;i<campos.length;i++){
		obj=eval("document.f."+campos[i]);
		if (obj.value == ""){
			alert("Ha de rellenar el campo ["+obj.name+"]");
			obj.focus();
			return;
		}
	}
	document.f.submit();
}