$(document).ready(function() {

	tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
	imgLoader = new Image();// preload image
	imgLoader.src = tb_pathToImage;  
  
  //ANIMACION MENU
  
	$("#encuentra, #encuentraDes").hover(function () {
	$("#encuentraDes").show();
	$("#encuentra").css("background-color","#165aa8");
	});
	$("#encuentraDes, #encuentra").hover(function () {}, function () {
	$("#encuentraDes").hide();
	$("#encuentra").css("background-color","#1f7dea");
	});
	
	$("#mundo, #mundoDes").hover(function () {
	$("#mundoDes").show();
	$("#mundo").css("background-color","#165aa8");
	});
	$("#mundoDes, #mundo").hover(function () {}, function () {
	$("#mundoDes").hide();
	$("#mundo").css("background-color","#1f7dea");
	});
	
	$("#consejos, #consejosDes").hover(function () {
	$("#consejosDes").show();
	$("#consejos").css("background-color","#165aa8");
	});
	$("#consejosDes, #consejos").hover(function () {}, function () {
	$("#consejosDes").hide();
	$("#consejos").css("background-color","#1f7dea");
	});
	
	$("#actualidad, #actualidadDes").hover(function () {
	$("#actualidadDes").show();
	$("#actualidad").css("background-color","#165aa8");
	});
	$("#actualidadDes, #actualidad").hover(function () {}, function () {
	$("#actualidadDes").hide();
	$("#actualidad").css("background-color","#1f7dea");
	});

	$("#comparte").hover(function () {$("#comparte").css("top","0");});
	$("#comparte").hover(function () {}, function () {$("#comparte").css("top","-62px");});	
	
	$("#idioma").hover(function () {$("#idioma").css("top","0");});
	$("#idioma").hover(function () {}, function () {$("#idioma").css("top","-55px");});		

	
	
	$('.misCruceros h1 a').click(function() {$('.misCruceros form').slideToggle('slow');});

	$('#listado ul').hide();
	$('#listado ul:first').show();
    $('#listado li a').click(
		
		function() {
			var checkElement = $(this).next();
			
      	if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
    	    return false;
        }
    	if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
           
		    $('#listado ul:visible').slideUp('slow',function(){checkElement.slideDown('slow');});
            
            return false;
        }

		});

});

//Funcion que controla el menu de tabs de las páginas xyo.
$(document).ready(function(){

	 // Set up a listener so that when anything with a class of 'tab' 
	 // is clicked, this function is run.
	 $('.tab').click(function () {

	  	// Remove the 'active' class from the active tab.
	  	//$('#tabs_container > .tabs > li.active')
		//  .removeClass('active');
		$('#menu_tabs > li > a.active').removeClass('active');
		
		  
	  	// Add the 'active' class to the clicked tab.
	  	//$(this).parent().addClass('active');
	  	$(this).addClass('active');

	  	// Remove the 'tab_contents_active' class from the visible tab contents.
	  	$('#tabs_container > .tab_contents_container > div.tab_contents_active')
		  .removeClass('tab_contents_active');

	  	// Add the 'tab_contents_active' class to the associated tab contents.
	  	$(this.rel).addClass('tab_contents_active');

	 });
	});


//Funcios que controla el submenu de tabs de las pï¿½ginas xyo.
$(document).ready(function(){

	 // Set up a listener so that when anything with a class of 'sub_tab' 
	 // is clicked, this function is run.
	 $('.sub_tab').click(function () {

	  	// Remove the 'active' class from the active tab.
		//$('#sub_menu_tabs > li > a.active').removeClass('active');
		$(this).parent().siblings().children('a.active').removeClass('active');

		//alert($(this).parent('#sub_menu_tabs'));
		  
	  	// Add the 'active' class to the clicked tab.
	  	//$(this).parent().addClass('active');
	  	$(this).addClass('active');

	  	// Remove the 'tab_contents_active' class from the visible tab contents.
	  	//$('#sub_menu_container > .subtab_contents_container > div.subtab_contents_active')
		//  .removeClass('subtab_contents_active');
		$(this.rel).siblings()
		  .removeClass('subtab_contents_active');

	  	// Add the 'tab_contents_active' class to the associated tab contents.
	  	$(this.rel).addClass('subtab_contents_active');

	 });
	});

function submitForm(formId){
	document.getElementById(formId).submit();
}

function nothing(){
	//Es una funciï¿½n que no hace nada para poder ponerla en los href y que no hagan nada, porque se activan mediante JQuery o thikbox
}

