var IE = document.all?true:false;
var ff  = !document.layers && !document.all;
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;



$(document).ready(function(){
$("ul.gal_menu li").mouseenter(function(evento){	
   $("#ul"+$(this).attr("id")).css("display", "block");
   $("#ul"+$(this).attr("id")).css("visibility", "visible");
   $(this).addClass("active");
  });
$("ul.gal_menu li").mouseleave(function(evento){
   $("#ul"+$(this).attr("id")).css("display", "none");   
   $(this).removeClass("active");
 });
$("ul.gal_menu ul").mouseleave(function(evento){
   $("#"+$(this).attr("id")).css("display", "none");
  });
$("ul.gal_menu li").mouseenter(function(evento){
   $("#ul"+$(this).attr("id")).css("display", "block");
  });
$("#img_0 > img").css({"height": 222+ "px", "width":  729 + "px", "z-index": -1});


	/* Función que mueve las fotos del header combo (teaser) en sentido "hacia la derecha" */
	$("#right_img").click(function(evento) {	
		
		/* Recup. información del combo de fotos */	
		var totalElements = $("#comboFotoList > li").size();
		var activeObject = $("#comboFotoList > li.active");
		var activeObjectIndex = $("#comboFotoList > li").index(activeObject);
		if( totalElements < 2) { return 0;}
		var i=0;	
	
		/* Control del elemento activo */		
		i = (parseInt(activeObjectIndex)+1 ) % (totalElements);
		$("#comboFotoList > li").removeClass("active");
		$("#comboFotoList > li:eq("+i+")").addClass("active");
		
		/* Activamos la foto correspondiente */
		$("#comboFotoList > li").hide();
		$("#comboFotoList > li:eq("+i+")").fadeIn();
		
		/* Control de la bolita inferior derecha */
		$(".switcher > li").removeClass("active");
		$(".switcher > li:eq("+i+")").addClass("active");
		
		/* Control de la frase inferior*/
		$(".switText").hide();
		$(".switText:eq("+i+")").show();
		
		/* Limpiamos intervalos de refresco */
		clearInterval(changePhotoInterval);
		changePhotoInterval = setInterval(function(){$("#right_img").click();},20000);	
	});
	
	/* Función que mueve las fotos del header combo (teaser) en sentido "hacia la izquierda" */  
	$("#left_img").click(function(evento) {
		/* Recup. información del combo de fotos */	
		var totalElements = $("#comboFotoList > li").size();
		var activeObject = $("#comboFotoList > li.active");
		var activeObjectIndex = $("#comboFotoList > li").index(activeObject);
		var i=0;	
		if( totalElements < 2) { return 0;}	
		/* Control del elemento activo */			
		if( parseInt(activeObjectIndex)-1 < 0 ){
			i = totalElements-1;
		}
		else{
			i = parseInt(activeObjectIndex)-1;
		}
		$("#comboFotoList > li").removeClass("active");
		$("#comboFotoList > li:eq("+i+")").addClass("active");
		
		/* Activamos la foto correspondiente */
		$("#comboFotoList > li").hide();
		$("#comboFotoList > li:eq("+i+")").fadeIn();
		
		/* Control de la bolita inferior derecha */
		$(".switcher > li").removeClass("active");
		$(".switcher > li:eq("+i+")").addClass("active");
		
		/* Control de la frase inferior*/
		$(".switText").hide();
		$(".switText:eq("+i+")").show();
		
		/* Limpiamos intervalos de refresco */
		clearInterval(changePhotoInterval);
		changePhotoInterval = setInterval(function(){$("#right_img").click();},20000);	
	});  
	$("ul.switcher li span").click(function(evento){
		
 	});
  
});
  
  


  
var changePhotoInterval = setInterval(function(){$("#right_img").click();},20000);

function viewNamePoi(name){
$("#"+name).fadeIn(300);
}
  
