<!--
var tf = top.frames;

function MM_preloadImages() {
	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_swapImage() { 
  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 MM_swapImgRestoreTop() {
	if ( tf["mainFrame"]) {
		if ( tf["mainFrame"].document.URL.indexOf("mainFrameHome.jsp") != -1 ) {
			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_swapImgRestore() {
	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_findObj(n, d) {
  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() {
	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_changeProp(objName,x,theProp,theValue) {
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
}

function MM_setTextOfLayer(objName,x,newText) {
  if ((obj=MM_findObj(objName))!=null) with (obj)
	if (navigator.appName=='Netscape') {document.write(unescape(newText)); document.close();}
	else innerHTML = unescape(newText);
}

function MM_reloadPage(init) {  
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
	document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

function changeBanner(src, enlace){
}

function changeBanner2(src, enlace){	
}

function showEncontrar(){
}
function showEncontrar2(){
}


function hideEncontrar(){
}
function hideEncontrar2(){
}

var ilang = 0;

var codProv = 0;
var codPoblacion = 0;
var codBarrio = 0;
var cargaTodo = 'NO';

var peticion;

function recargaProvincias(idioma) {
	codProv = 0;
	if (idioma) ilang = idioma;
	recargaProvincias1();
}

function recargaProvincias1() {
	vacialstPoblaciones();
	var cmboPaises = document.getElementById('lstPaises');
	var codPais = 1;
	
	if (cmboPaises != null) codPais = cmboPaises.options[cmboPaises.selectedIndex].value;
	if (window.XMLHttpRequest) {
		peticion = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		peticion = new ActiveXObject("Microsoft.XMLHTTP");
	}
	peticion.open("GET", "/ATREA/public/datosCombo.jsp?tipoDatos=provincias&colectivo=PROF&cargaTodo=SI&codPais=" + codPais , true);
	peticion.onreadystatechange = recargaProvincias2;
	peticion.send(null);
}
function recargaProvincias2() {
	var combo = document.getElementById('lstProvincias');
	if (peticion.readyState == 4) {
		if (peticion.status == 200) {
			//  Borrar el contenido del combo
			var len = Number(combo.length) - 1;
			for (k=len; k>0; k--) {
				combo.options[k] = null;
			}
			combo.options[0].value = "-1";

			if (ilang == 3) {
				combo.options[0].text = "-distrito-";
			} else  if (ilang == 1) {
				combo.options[0].text = "-province-";
			} else {
				combo.options[0].text = "-provincia-";
			}
			combo.selectedIndex=0;

			opciones = peticion.responseXML.getElementsByTagName("opcion");
			if (opciones != null) {
				n = opciones.length;
				i = 0;
				while (i < n) {
					valor = opciones[i].getElementsByTagName("valor")[0].childNodes[0].nodeValue;
					texto = opciones[i].getElementsByTagName("texto")[0].childNodes[0].nodeValue;
					combo.length=(i+2);
					combo.options[i+1].value = valor;
					combo.options[i+1].text = texto;
					if (valor == codProv) combo.selectedIndex = i+1;
					i++;
				}
			}
			if (codProv != 0) {
				recargaPoblaciones1();
			}
		}
	}
}

function recargaPoblaciones1(codProv) {
	if (codProv == null) {
		var cmboProv = document.getElementById('lstProvincias');
		if (cmboProv.selectedIndex < 0) cmboProv.selectedIndex = 0;
		codProv = cmboProv.options[cmboProv.selectedIndex].value;
	}
	if (window.XMLHttpRequest) {
		peticion = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		peticion = new ActiveXObject("Microsoft.XMLHTTP");
	}
	peticion.open("GET", "/ATREA/public/datosCombo.jsp?tipoDatos=poblaciones&colectivo=" + marca_blanca + "&cargaTodo=" + cargaTodo + "&codProv=" + codProv , true);
	peticion.onreadystatechange = recargaPoblaciones2;
	peticion.send(null);
}
function vacialstPoblaciones () {
	combo = document.getElementById('lstPoblaciones');
	//  Borrar el contenido del combo
	var len = Number(combo.length) - 1;
	for (k=len; k>0; k--) {
		combo.options[k] = null;
	}
	combo.options[0].value = "-1";
	if (ilang == 1) {
		combo.options[0].text = "-town-";
	} else if (ilang == 3) {
		combo.options[0].text = "-freguesia-";
	} else {
		combo.options[0].text = "-poblacion-";
	}
	combo.selectedIndex = 0;
}
function recargaPoblaciones2() {
	if (peticion.readyState == 4) {
		if (peticion.status == 200) {
			combo = document.getElementById('lstPoblaciones');
			vacialstPoblaciones();

			opciones = peticion.responseXML.getElementsByTagName("opcion");
			if (opciones != null) {
				n = opciones.length;
				i = 0;
				while (i < n) {
					valor = opciones[i].getElementsByTagName("valor")[0].childNodes[0].nodeValue;
					texto = opciones[i].getElementsByTagName("texto")[0].childNodes[0].nodeValue;
					combo.length=(i+2);
					combo.options[i+1].value = valor;
					combo.options[i+1].text = texto;
					if (codPoblacion == valor) combo.selectedIndex = i+1;
					i++;
				}
			}
			if (codPoblacion != 0) {
				recargaBarrios1();
			}
		}
	}
}

function recargaBarrios1(codPoblacion) {
	if (document.getElementById('lstBarrios') == null) return;
	if (codPoblacion == null) {
		var cmboMuni = document.getElementById('lstPoblaciones');
		if (cmboMuni.selectedIndex < 0) cmboMuni.selectedIndex = 0;
		codPoblacion = cmboMuni.options[cmboMuni.selectedIndex].value;
	}
	if (window.XMLHttpRequest) {
		peticion = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		peticion = new ActiveXObject("Microsoft.XMLHTTP");
	}

	peticion.open("GET", "/ATREA/public/datosCombo.jsp?tipoDatos=barrios&colectivo=" + marca_blanca + "&cargaTodo=" + cargaTodo + "&codPlaza=" + codPoblacion , true);
	peticion.onreadystatechange = recargaBarrios2;
	peticion.send(null);
}
function vacialstBarrios () {
	combo = document.getElementById('lstBarrios');
	//  Borrar el contenido del combo
	var len = Number(combo.length) - 1;
	for (k=len; k>0; k--) {
		combo.options[k] = null;
	}
	combo.options[0].value = "-1";
	if (ilang == 1) {
		combo.options[0].text = "-area-";
	} else if (ilang == 3) {
		combo.options[0].text = "-zona-";
	} else {
		combo.options[0].text = "-zona-";
	}
	combo.selectedIndex = 0;
}
function recargaBarrios2() {
	combo = document.getElementById('lstBarrios');
	if (peticion.readyState == 4) {
		if (peticion.status == 200) {
			vacialstBarrios();

			opciones = peticion.responseXML.getElementsByTagName("opcion");
			if (opciones != null) {
				n = opciones.length;
				i = 0;
				while (i < n) {
					valor = opciones[i].getElementsByTagName("valor")[0].childNodes[0].nodeValue;
					texto = opciones[i].getElementsByTagName("texto")[0].childNodes[0].nodeValue;
					combo.length=(i+2);
					combo.options[i+1].value = valor;
					combo.options[i+1].text = texto;
					if (codBarrio == valor) combo.selectedIndex = i+1;
					i++;
				}
			}
		}
	}
}

function resaltaPest155A3(id) {
	obj = document.getElementById("imgPest" + id);
	if (obj) {
		obj.src = "/ATREA/A3/img/etique_2_sobre.gif";
	}
}

function noresaltaPest155A3(id) {
	obj = document.getElementById("imgPest" + id);
	if (obj) {
		obj.src = "/ATREA/A3/img/etique_2_off.gif";
	}
}

function resaltaPest88A3(id) {
	obj = document.getElementById("imgPest" + id);
	if (obj) {
		obj.src = "/ATREA/A3/img/etique_4_sobre.gif";
	}
}

function noresaltaPest88A3(id) {
	obj = document.getElementById("imgPest" + id);
	if (obj) {
		obj.src = "/ATREA/A3/img/etique_4_off.gif";
	}
}

