var i; 
var imagenes = new Array("2009/fondo_promo_guias.gif","2009/fondo_promo_organiza.gif","2009/fondo_promo_que.gif","2009/fondo_promo_donde.gif","2009/fondo_promo.gif"); 
var lista_imagenes = new Array(); 
var cambia = 2;
var ant = document.createElement('DIV');
var ant_img = document.createElement('A');
var nav = "";
var mostrarsiempre = "";

function navegador (){
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
		var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
		if ((ieversion<7)) {
			nav = "ie6"	
		}
	}
	
}


function mostrar(menu,img){

	if (cambia==2){
		ant="contenido_asi";
		ant_img = "asi";		
		if (menu != "contenido_asi"){
			cambia=1;
		} else {
			cambia=0;	
		}
	}
	
	navegador();


	if(ant!=menu){cambia=1}
	
	if (cambia==1){		
		document.getElementById(menu).style.visibility="visible"; 
		document.getElementById(menu).style.display="block"; 
		document.getElementById(img).style.background= "url(2009/images/fondo_menu_on.gif)"; 
		
		if (menu=="contenido_asi"){
			document.getElementById(img).style.color = "#8fbee9";
			document.getElementById("banda_izquierda").style.background = "#8fbee9";
			document.getElementById("promocion").style.background = "url(2009/images/fondo_promo.gif)";
			if (nav=="ie6") {
				document.getElementById("promocion").style.background = "url(2009/images/fondo_promo_ie.gif)";
			}
		} else if (menu=="contenido_donde"){
			document.getElementById(img).style.color = "#d29a18";
			document.getElementById("banda_izquierda").style.background = "#ffce5b";
			document.getElementById("promocion").style.background = "url(2009/images/fondo_promo_donde.gif)";
			if (nav=="ie6") {
				document.getElementById("promocion").style.background = "url(2009/images/fondo_promo_donde_ie.gif)";
			}			
		} else if (menu=="contenido_que"){
			document.getElementById(img).style.color = "#466275";
			document.getElementById("banda_izquierda").style.background = "#466275";
			document.getElementById("promocion").style.background = "url(2009/images/fondo_promo_que.gif)";
			if (nav=="ie6") {
				document.getElementById("promocion").style.background = "url(2009/images/fondo_promo_que_ie.gif)";
			}			
		} else if (menu=="contenido_organiza"){
			document.getElementById(img).style.color = "#d19b6f";
			document.getElementById("banda_izquierda").style.background = "#f1d2b9";
			document.getElementById("promocion").style.background = "url(2009/images/fondo_promo_organiza.gif)";
			if (nav=="ie6") {
				document.getElementById("promocion").style.background = "url(2009/images/fondo_promo_organiza_ie.gif)";
			}			
		} else if (menu=="contenido_guias"){
			document.getElementById(img).style.color = "#ff361d";
			document.getElementById("banda_izquierda").style.background = "#ff361d";
			document.getElementById("promocion").style.background = "url(2009/images/fondo_promo_guias.gif)";
			if (nav=="ie6") {
				document.getElementById("promocion").style.background = "url(2009/images/fondo_promo_guias_ie.gif)";
			}			
		}

		
		borrar(ant,ant_img);
		ant=menu;
		ant_img = img;
		cambia=0;		
	}
	
} 

function mostrar2_2(menu,img){
	
	if (cambia==1){		
		document.getElementById(menu).style.visibility="visible"; 
		document.getElementById(menu).style.display="block"; 
		document.getElementById(img).style.background= "url(2009/images/fondo_menu_on.gif)"; 
		
		borrar(ant,ant_img);
		ant=menu;
		ant_img = img;
		cambia=0;		

		if (menu=="contenido_asi"){
			document.getElementById(img).style.color = "#8fbee9";
		} else if (menu=="contenido_donde"){
			document.getElementById(img).style.color = "#d29a18";
		} else if (menu=="contenido_que"){
			document.getElementById(img).style.color = "#466275";
		} else if (menu=="contenido_organiza"){
			document.getElementById(img).style.color = "#d19b6f";
		} else if (menu=="contenido_guias"){
			document.getElementById(img).style.color = "#ff361d";
		}
		


	}
	
	
	
}



function mostrar2_1(menu,img){
	
		if (img=='asi'){
			document.getElementById('contenido_asi').style.visibility="visible"; 
			document.getElementById('contenido_asi').style.display="block"; 
			document.getElementById('asi').style.background= "url(2009/images/fondo_menu_on.gif)"; 
			document.getElementById('asi').style.color = "#8fbee9";
		   	borrar('contenido_donde','donde');
			borrar('contenido_guias','guias');
			borrar('contenido_que','que');
			borrar('contenido_organiza','organiza');
		} else if (img=='donde'){
			document.getElementById('contenido_donde').style.visibility="visible"; 
			document.getElementById('contenido_donde').style.display="block"; 
			document.getElementById('donde').style.background= "url(2009/images/fondo_menu_on.gif)"; 
			document.getElementById('donde').style.color = "#d29a18";
			borrar('contenido_asi','asi');
			borrar('contenido_que','que');
			borrar('contenido_organiza','organiza');
			borrar('contenido_guias','guias');
		} else if (img=='que'){
			document.getElementById('contenido_que').style.visibility="visible"; 
			document.getElementById('contenido_que').style.display="block"; 
			document.getElementById('que').style.background= "url(2009/images/fondo_menu_on.gif)"; 
			document.getElementById('que').style.color = "#466275";
			borrar('contenido_asi','asi');
			borrar('contenido_donde','donde');
			borrar('contenido_guias','guias');
			borrar('contenido_organiza','organiza');
		} else if (img=='organiza'){
			document.getElementById('contenido_organiza').style.visibility="visible"; 
			document.getElementById('contenido_organiza').style.display="block"; 
			document.getElementById('organiza').style.background= "url(2009/images/fondo_menu_on.gif)"; 
			document.getElementById('organiza').style.color = "#d19b6f";
			borrar('contenido_asi','asi');
			borrar('contenido_donde','donde');
			borrar('contenido_guias','guias');
			borrar('contenido_que','que');
		} else if (img=='guias'){
			document.getElementById('contenido_guias').style.visibility="visible"; 
			document.getElementById('contenido_guias').style.display="block"; 
			document.getElementById('guias').style.background= "url(2009/images/fondo_menu_on.gif)"; 
			document.getElementById('guias').style.color = "#d19b6f";
			borrar('contenido_asi','asi');
			borrar('contenido_donde','donde');
			borrar('contenido_organiza','organiza');
			borrar('contenido_que','que');
		}
      
	
} 

function mostrarinicio(){
	inic(mostrarsiempre);
}

function inic(categoria){
        
		mostrarsiempre = categoria;
		if ((categoria==1) || (categoria==8)){
			
			document.getElementById('contenido_asi').style.visibility="visible"; 
			document.getElementById('contenido_asi').style.display="block"; 
			document.getElementById('asi').style.background= "url(2009/images/fondo_menu_on.gif)"; 
			document.getElementById('asi').style.color = "#8fbee9";
		} else if ((categoria==3) || (categoria==10)){
			document.getElementById('contenido_donde').style.visibility="visible"; 
			document.getElementById('contenido_donde').style.display="block"; 
			document.getElementById('donde').style.background= "url(2009/images/fondo_menu_on.gif)"; 
		   	document.getElementById('donde').style.color = "#d29a18";
		} else if ((categoria==2) || (categoria==9)){
			document.getElementById('contenido_que').style.visibility="visible"; 
			document.getElementById('contenido_que').style.display="block"; 
			document.getElementById('que').style.background= "url(2009/images/fondo_menu_on.gif)"; 
		   	document.getElementById('que').style.color = "#466275";
		} else if ((categoria==4) || (categoria==11)){
			document.getElementById('contenido_organiza').style.visibility="visible"; 
			document.getElementById('contenido_organiza').style.display="block"; 
			document.getElementById('organiza').style.background= "url(2009/images/fondo_menu_on.gif)"; 
		    	document.getElementById('organiza').style.color = "#d19b6f";			
		}
		
		
	
}


function borrar(bmenu,bimg){
	document.getElementById(bmenu).style.visibility="hidden"; 
	document.getElementById(bmenu).style.display="none"; 
	document.getElementById(bimg).style.background= "url(2009/images/fondo_menu_off.gif)"; 
	document.getElementById(bimg).style.color = "#fff";
	
}

function desplegar(capa){
	
	navegador();
    
	if (nav=="ie6") {
		
		if (capa == "espanol"){
			document.getElementById("ingles").style.visibility = "visible";	
			document.getElementById("ingles").style.display = "block";
			document.getElementById("aleman").style.visibility = "visible";	
			document.getElementById("aleman").style.display = "block";
			document.getElementById("portugues").style.visibility = "visible";	
			document.getElementById("portugues").style.display = "block";
		}
		if (capa == "direccion") {
			document.getElementById(capa).style.visibility = "visible";	
			document.getElementById(capa).style.display = "block";

			if ((document.URL == "http://www.turismohuelva.org/index.php") || (document.URL == "http://www.turismohuelva.org/") ){
				document.getElementById("banda_izquierda").style.marginTop = "-106px";
				document.getElementById("banda_dcha").style.marginTop = "13px";
			} else {
				document.getElementById("banda_izquierda").style.marginTop = "-98px";
				document.getElementById("menu").style.marginTop = "57";	
				document.getElementById("contenido").style.marginTop = "105";	
			}
		} else {
			if ((document.URL == "http://www.turismohuelva.org/index.php") || (document.URL == "http://www.turismohuelva.org/") ){
				document.getElementById("banda_izquierda").style.marginTop = "-56px";
				document.getElementById("banda_dcha").style.marginTop = "63px";
			} else {
				document.getElementById("banda_izquierda").style.marginTop = "-48px";	
				document.getElementById("menu").style.marginTop = "107";	
				document.getElementById("contenido").style.marginTop = "155";	
			}
			
		}
	}
}

function plegar(capa){
	navegador();
    if (nav=="ie6") {
		if (capa == "espanol"){
			document.getElementById("ingles").style.visibility = "hidden";	
			document.getElementById("ingles").style.display = "none";
			document.getElementById("aleman").style.visibility = "hidden";	
			document.getElementById("aleman").style.display = "none";
			document.getElementById("portugues").style.visibility = "hidden";	
			document.getElementById("portugues").style.display = "none";
		} else if (capa == "direccion"){
			document.getElementById(capa).style.visibility = "hidden";	
			document.getElementById(capa).style.display = "none";			
		}
		if ((document.URL == "http://www.turismohuelva.org/index.php") || (document.URL == "http://www.turismohuelva.org/") ){
			document.getElementById("banda_izquierda").style.marginTop = "-14px";	
			document.getElementById("banda_dcha").style.marginTop = "105px";
		} else {
			document.getElementById("banda_izquierda").style.marginTop = "0";	
			document.getElementById("menu").style.marginTop = "155";	
			document.getElementById("contenido").style.marginTop = "203";	
		}
		
	}			
}

function cargarimagenes(){
	for(i in imagenes){ 
		lista_imagenes[i] = new Image(); 
		lista_imagenes[i].src = "2009/images" + imagenes[i]; 
	} 
}	

function imprimirPagina() {
  if (window.print)
    window.print();
  else
    alert("El navegador no soporta la funci&oacute; de impresi&oacute desde la web. Actualice a un navegador m&aacute; moderno o realice la impresi&oacute;n desde el men&uacute; superior");
}