$(document).ready(function(){ 
	var loading = $("#content");	
	
	//show loading bar  
	function showLoading(){  
   		loading.addClass("bg"); 
   	}  
   	//hide loading bar  
  	function hideLoading(){  
  		loading.removeClass("bg");
  		//loading.fadeTo(1000, 0);  
  		//content.slideDown();  
  	};  
	
	
	$('.slideshow').cycle({
		fx: 'fade', 
    	speed:  8000   // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});
	
	    
    $("a.sub").hover(function(){
    	$('a.sub').parent().find("ul.subnav").slideDown('fast').show();
    },function(){
    	$('a.sub').parent().hover(function() {  
		}, function(){  
			$('a.sub').parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up  
		});  		
    });
    
  	$("a.sub_2").hover(function(){
    	$('a.sub_2').parent().find("ul.subnav").slideDown('fast').show();
    },function(){
    	$('a.sub_2').parent().hover(function() {  
		}, function(){  
			$('a.sub_2').parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up  
		});  		
    });
    
    if($("#relleno").length != 0){
    	showLoading();
    	$("#content").load("modulos/ES/home.php",hideLoading);
    }
    
    $("a[rel=home]").click(function(){
    	loading.html("");	
    	showLoading();
    	$("#content").load("modulos/ES/home.php",hideLoading);
    });
    
      $("#search").toggle(
      function () {
        $("div#seek").animate({height: "500px"}).animate({height: "400px"}, "fast"); 
      },
      function () {
        $("div#seek").animate({height: "0px"}, "slow");
      });



    
    
    
});  