$(document).ready(function() {
	
			$("#wrapper").css("display", "none");
		    $("#wrapper").fadeIn(2000);  
			$("a.transition").click(function(event){
				event.preventDefault();
				linkLocation = this.href;
				$("#wrapper").fadeOut(500, redirectPage);		
			});
			function redirectPage() {
				window.location = linkLocation;
			}
			
		
		  /*ROLLOVER*/
			$('ul#holder, #noticias_home .contenido_caja').children().hover(function() {
				$(this).siblings().stop().fadeTo(300,0.5);
			}, function() {
				$(this).siblings().stop().fadeTo(250,1);
			});


			//SLIDE PANEL
			// Expand Panel
			$("#open").click(function(){
				$("div#panel").slideDown("slow");
			
			});	
			
			// Collapse Panel
			$("#close").click(function(){
				$("div#panel").slideUp("slow");	
			});		
			
			// Switch buttons from "Log In | Register" to "Close Panel" on click
			$("#toggle a").click(function () {
				$("#toggle a").toggle();
			});
			
			//CAPTION ARTISTAS
			//To switch directions up/down and left/right just place a "-" in front of the top/left attribute

				//Diagnal Sliding
				$('.boxgrid.thecombo').hover(function(){
					$(".cover", this).stop().animate({left:'325px'},{queue:false,duration:600});
				}, function() {
					$(".cover", this).stop().animate({left:'0px'},{queue:false,duration:600});
				});

			//NEWSLETTER
			var selected_class = {
		      'background' : 'url(http://spaceofsoundfestival.d120.dinaserver.com/wp-content/themes/sps2011festival/images/newsletter_button_active.png) no-repeat left center', 
		      'font-weight' : 'normal'
		    }
			var inactive_class = {
		      'background' : 'url(http://spaceofsoundfestival.d120.dinaserver.com/wp-content/themes/sps2011festival/images/newsletter_button_inactive.png) no-repeat left center', 
		      'font-weight' : 'normal'
		    }
			  $('#form_nl_baja').hide();
			  $('#muestra_nl_baja').click(function() {
				$('#muestra_nl_baja').css(selected_class);
				$('#muestra_nl_alta').css(inactive_class);
				$('#form_nl_alta').hide();
			    $('#form_nl_baja').show();
			    return false;
			  });
			  $('#muestra_nl_alta').click(function() {
				$('#muestra_nl_alta').css(selected_class);
				$('#muestra_nl_baja').css(inactive_class);
				$('#form_nl_baja').hide();
			    $('#form_nl_alta').show();
			    return false;
			  });
			  
			  //Append a div with hover class to all the LI
			$('#navMenu li').append('<div class="hover"><\/div>');
			$('#navMenu li').hover(
				function() {
					$(this).children('div').fadeIn('1000');	
				}, 
				function() {
					$(this).children('div').fadeOut('1000');	
			
			});
			
			
});		//Fin de document ready
			
			
			
	/*		 $(function() {
        // set opacity to nill on page load
        $("ul#menu span").css("opacity","0");
        // on mouse over
        $("ul#menu span").hover(function () {
            // animate opacity to full
            $(this).stop().animate({
                opacity: 1
            }, 'slow');
        },
        // on mouse out
        function () {
            // animate opacity to nill
            $(this).stop().animate({
                opacity: 0
            }, 'slow');
        });
    });*/
	
	
	
			
			

	//NIVOSLIDER
	$(window).load(function() {
	    $('#slider').nivoSlider({
	        effect:'boxRainGrow', // Specify sets like: 'fold,fade,sliceDown'
	        slices:15, // For slice animations
	        boxCols: 8, // For box animations
	        boxRows: 4, // For box animations
	        animSpeed:500, // Slide transition speed
	        pauseTime:8000, // How long each slide will show
	        startSlide:0, // Set starting Slide (0 index)
	        directionNav:false, // Next & Prev navigation
	        directionNavHide:false, // Only show on hover
	        controlNav:false, // 1,2,3... navigation
	        controlNavThumbs:false, // Use thumbnails for Control Nav
	        controlNavThumbsFromRel:false, // Use image rel for thumbs
	        controlNavThumbsSearch: '.jpg', // Replace this with...
	        controlNavThumbsReplace: '_thumb.jpg', // ...this in thumb Image src
	        keyboardNav:true, // Use left & right arrows
	        pauseOnHover:false, // Stop animation while hovering
	        manualAdvance:false, // Force manual transitions
	        captionOpacity:0.8, // Universal caption opacity
	        prevText: 'Prev', // Prev directionNav text
	        nextText: 'Next', // Next directionNav text
	        beforeChange: function(){}, // Triggers before a slide transition
	        afterChange: function(){}, // Triggers after a slide transition
	        slideshowEnd: function(){}, // Triggers after all slides have been shown
	        lastSlide: function(){}, // Triggers when last slide is shown
	        afterLoad: function(){} // Triggers when slider has loaded
	    });
	});
			
	
