function CargaPagina(url) {
     var x=(((screen.availWidth)-200)/2);
     var y=(((screen.availHeight)-200)/2);
    	window.document.open(url, "", "location=0,menubar=0,resizable=1,scrollbars=0,toolbar=0,width=200,height=200,left="+x+",top="+y+"");
}
function NuevoAjax(){
var xmlhttp=false;
try{
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
	try{
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
 	}catch(E){
		xmlhttp = false;
	}
}
if(!xmlhttp && typeof XMLHttpRequest!='undefined'){
	xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
function cargar(url,ti){
var contenido, banner,destacado,publicidad,izquierda,menu;
contenido = document.getElementById('principal');
banner = document.getElementById('imagenbanner');
destacado = document.getElementById('destacadoimg');
publicidad = document.getElementById('publicidad');
izquierda = document.getElementById('izquierda');
menu = document.getElementById('menu');
banner.style.height="0";
		banner.style.margin="0";
		banner.style.visibility="hidden";
		destacado.style.height="0";
		destacado.style.margin="0";
		destacado.style.visibility="hidden";
		publicidad.style.height="0";
		publicidad.style.visibility="hidden";
ajax=NuevoAjax();
ajax.open("GET", url,true);
ajax.onreadystatechange=function(){
	if(ajax.readyState==1){		
		menu.innerHTML =" <a href='/Servicios/Municipios/pueblos.nsf/index?ReadForm&amp;id="+pueblo+"' title='Pagina de inicio'>Inicio</a> <strong>&raquo;</strong> "+ti;	
		izquierda.innerHTML = "<br /><br /><br />Cargando...";	
		contenido.innerHTML = "<br /><br /><br />Cargando...";		
		contenido.style.background = "url('loader.gif') no-repeat";	
			
	}else if(ajax.readyState==4){
		if(ajax.status==200){
			contenido.innerHTML = ajax.responseText;
			//preloader.innerHTML = "Cargado.";
			contenido.style.background = "url('loaded.gif') no-repeat";
			cargar_menu("/Servicios/Municipios/pueblos.nsf/menulista.html?ReadForm&amp;id="+pueblo);
		}else if(ajax.status==404){
			//preloader.innerHTML = "La página no existe";
		}else{
			//preloader.innerHTML = "Error:".ajax.status;
		}
	}
}
ajax.send(null);
}
function cargar_menu(url){
var contenido, preloader;
contenido = document.getElementById('izquierda');
//preloader = document.getElementById('preloader');
ajax=NuevoAjax();
ajax.open("GET", url,true);
ajax.onreadystatechange=function(){
	if(ajax.readyState==1){
		contenido.innerHTML = "<br /><br /><br />Cargando...";		
		contenido.style.background = "url('loader.gif') no-repeat";
		
	}else if(ajax.readyState==4){
		if(ajax.status==200){
			contenido.innerHTML = ajax.responseText;
			//preloader.innerHTML = "Cargado.";
			contenido.style.background = "url('loaded.gif') no-repeat";
		}else if(ajax.status==404){
			//preloader.innerHTML = "La página no existe";
		}else{
			//preloader.innerHTML = "Error:".ajax.status;
		}
	}
}
ajax.send(null);
}
function cargar_contenido(url,ti){
var contenido, preloader,menu;
contenido = document.getElementById('principal');
menu = document.getElementById('menu');
//preloader = document.getElementById('preloader');
ajax=NuevoAjax();
ajax.open("GET", url,true);
ajax.onreadystatechange=function(){
	if(ajax.readyState==1){
		menu.innerHTML =" <a href='/Servicios/Municipios/pueblos.nsf/index?ReadForm&amp;id="+pueblo+"' title='Pagina de inicio'>Inicio</a> <strong>&raquo;</strong> "+ti;	
		contenido.innerHTML = "<br /><br /><br />Cargando...";		
		contenido.style.background = "url('loader.gif') no-repeat";
		
	}else if(ajax.readyState==4){
		if(ajax.status==200){
			contenido.innerHTML = ajax.responseText;
			//preloader.innerHTML = "Cargado.";
			contenido.style.background = "url('loaded.gif') no-repeat";
		}else if(ajax.status==404){
			//preloader.innerHTML = "La página no existe";
		}else{
			//preloader.innerHTML = "Error:".ajax.status;
		}
	}
}
ajax.send(null);
}
var once_per_browser=0
var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&&!document.all
var rootdomain="http://"+window.location.hostname
function ajaxinclude(url) {
var page_request = false;
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
ajax3("/Servicios/Municipios/pueblos.nsf/menulista.html?ReadForm&amp;id="+pueblo);
page_request.open('GET', url, false) //get page synchronously 
document.getElementById ('principal').innerHTML = "Cargando....";
document.getElementById ('menu').innerHTML ="<strong>&raquo;</strong> Informacion ";
page_request.send(null)
writecontent(page_request)
crossobj=ns6? document.getElementById("destacadoimg") : document.all.destacadoimg;
crossobj1=ns6? document.getElementById("imagenbanner") : document.all.imagenbanner;
crossobj2=ns6? document.getElementById("publicidad") : document.all.publicidad;
if (ie4||ns6){
crossobj1.style.height="0"
crossobj1.style.margin="0"
//crossobj1.style.border-bottom="0"
crossobj1.style.visibility="hidden"
crossobj.style.height="0"
crossobj.style.padding="0"
crossobj.style.margin="0"
//crossobj.style.border-bottom="0"
crossobj.style.visibility="hidden"
crossobj2.style.height="0"
//crossobj2.style.padding="0"
//crossobj2.style.margin="0"
//crossobj2.style.visibility="hidden"
}
else if (ns4){
crossobj.height="0"
crossobj.style.padding="0"
crossobj.visibility="hide"
}
function writecontent(page_request){
if (window.location.href.indexOf("http")==-1 || page_request.status==200)
document.getElementById ('principal').innerHTML = page_request.responseText;
}
}
// Carga en principal
function ajax2(url) {
var page_request = false;
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.open('GET', url, false) //get page synchronously 
document.getElementById ('principal').innerHTML = "Cargando....";
page_request.send(null)
writecontent2(page_request)
function writecontent2(page_request){
if (window.location.href.indexOf("http")==-1 || page_request.status==200)
document.getElementById ('principal').innerHTML = page_request.responseText;
}
}
function ajax3(url) {
var page_request = false;
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.open('GET', url, false) //get page synchronously 
document.getElementById ('izquierda').innerHTML = "Cargando....";
page_request.send(null)
writecontent3(page_request)
function writecontent3(page_request){
if (window.location.href.indexOf("http")==-1 || page_request.status==200)
document.getElementById ('izquierda').innerHTML = page_request.responseText;
}
}
// FUNCIONES COMUNES
function enviar(ids)
{
if (form1001.keywords.value!="")
parent.location.href="/Servicios/Municipios/pueblos.nsf/buscar?OpenAgent&amp;"+form1001.keywords.value 
}
function enviargoogle(ids)
{
if (form1001.keywords.value!="")
parent.location.href='http://google.com/search?q='+form1001.keywords.value+'&hl=es'; 
}
function limpiar(ids)
{
if (form1001.keywords.value!="")
form1001.keywords.value="" 
}
function atras()
{
window.history.back();
}
function pru(){
alert("Finana");
}
function cambiar(ids){
var url="/Servicios/Municipios/pueblos.nsf/";
var url1= ids.idmenu.value;
var mens =ids.idmenu.options[ids.idmenu.selectedIndex].text; 
if (ids.idmenu.value!="Actividad") {
//argar_contenido(ids.idmenu.value,mens);
 document.location.href=ids.idmenu.value
 }
}
function cambiartemas(ids){
var url="/Servicios/Municipios/pueblos.nsf/";
var url1= ids.idmenu.value;
var mens =ids.idmenu.options[ids.idmenu.selectedIndex].text; 
if (ids.idmenu.value!="Búsqueda por temas") {
//argar_contenido(ids.idmenu.value,mens);
 //document.location.href=ids.idmenu.value
document.location.href="/Servicios/Galeria/galeriafotos.nsf/tematico?OpenView&id=A04000-002&start=1&count=10&RestrictToCategory="+ids.idmenu.value
 }
}
function cambiarlugar(ids){
var url="/Servicios/Municipios/pueblos.nsf/";
var url1= ids.idmenu2.value;
var mens =ids.idmenu2.options[ids.idmenu.selectedIndex].text; 
if (ids.idmenu2.value!="Búsqueda por temas") {
//argar_contenido(ids.idmenu2.value,mens);
 //document.location.href=ids.idmenu2.value
document.location.href="/Servicios/Galeria/galeriafotos.nsf/catalogo?OpenView&id=A04000-002&star=1&count=10&RestrictToCategory="+ids.idmenu2.value
 }
}
function cambiarpagina(ids){
var url="/Servicios/Municipios/pueblos.nsf/";
var url1= ids.idmenu.value;
var mens =ids.idmenu.options[ids.idmenu.selectedIndex].text; 
if (ids.idmenu.value!="Paginas") {
//argar_contenido(ids.idmenu.value,mens);
 //document.location.href=ids.idmenu.value
document.location.href="/Servicios/IAE/iae.nsf/asociados?OpenView&id="+pueblo+""+ids.idmenu.value
 }
}
function cambiarpaginainfo(ids){
var url="/Servicios/Municipios/pueblos.nsf/";
var url1= ids.idmenu.value;
var mens =ids.idmenu.options[ids.idmenu.selectedIndex].text; 
if (ids.idmenu.value!="Paginas") {
//argar_contenido(ids.idmenu.value,mens);
 //document.location.href=ids.idmenu.value
document.location.href="/Servicios/Informacion/Informacion.nsf/porcategoriaturismo?OpenView&id=A04000-002"+ids.idmenu.value
 }
}
function cambiarpaginax(ids){
var url="/Servicios/Municipios/pueblos.nsf/";
var url1= ids.idmenu.value;
var mens =ids.idmenu.options[ids.idmenu.selectedIndex].text; 
if (ids.idmenu.value!="-1") {
//argar_contenido(ids.idmenu.value,mens);
 //document.location.href=ids.idmenu.value
document.location.href=ids.idmenu.value
 }
}
function cambiarpaginay(ids){
var url="/Servicios/Municipios/pueblos.nsf/";
var url1= ids.idmenuy.value;
var mens =ids.idmenuy.options[ids.idmenuy.selectedIndex].text; 
if (ids.idmenuy.value!="-1") {
document.location.href=ids.idmenuy.value
 }
}
function limpiar(ids){
if (ids.texto.value=="[ B u s c a d o r ]") {
ids.texto.value=""
 }
}
function buscarasociado(ids){
var url="/Servicios/Municipios/pueblos.nsf/";
//var url1= ids.aso.text.value;
//alert(window.document.forms[0].texto.value);
//var mens =ids.idmenu2.options[ids.idmenu.selectedIndex].text; 
if (window.document.forms[0].texto.value!="[ B u s c a d o r ]") {
//argar_contenido(ids.idmenu.value,mens);
 //document.location.href=ids.idmenu.value
document.location.href="/Servicios/IAE/iae.nsf/asociados?searchView&id="+pueblo+"&query="+window.document.forms[0].texto.value
}
}
function buscariae(ids){
var url="/Servicios/Municipios/pueblos.nsf/";
//var url1= ids.aso.text.value;
//alert(window.document.forms[0].texto.value);
//var mens =ids.idmenu2.options[ids.idmenu.selectedIndex].text; 
if (window.document.forms[0].texto.value!="[ B u s c a d o r ]") {
//argar_contenido(ids.idmenu.value,mens);
 //document.location.href=ids.idmenu.value
document.location.href="/Servicios/IAE/iae.nsf/buscadorturismo?searchView&query="+window.document.forms[0].texto.value
}
}
function iFrameHeight(iframeName)
{
    if(document.getElementById && !(document.all))
    {
        h = document.getElementById(iframeName).contentDocument.body.scrollHeight;
        document.getElementById(iframeName).height = h;
    }
    else if(document.all)
    {
        h = document.frames(iframeName).document.body.scrollHeight;
        document.all[iframeName].height = h;
    }
}

