
/* Newsletter signup dim effect */
$(document).ready(function(){
		
    		$("#dim").css("height", $(document).height());
    		
    		$(".alert").click(function(){
    			$("#dim").fadeIn();
    			return false;
			});
    		
    		$(".close").click(function(){
    			$("#dim").fadeOut();
    			return false;
			});
			
		
		});
		
		$(window).bind("resize", function(){
		 	$("#dim").css("height", $(window).height());
		});
		 

/* Social Icons on the left */
function set_social(_title, _link) {

	// this sets the "off" state
	jQuery("#top_social img").css("opacity", 0.8);
	jQuery(".cube img").css("opacity", 1.0);
	jQuery(".downloadmp3 img").css("opacity", 1.0);
	jQuery("img.free_download").css("opacity", 1.0);
		
	// this adds hover to full opacity:
	jQuery("#top_social img").hover( 
		// hover state
		function() {
			jQuery(this).css("opacity", 1.0);
		
		},
		// back to off
		function() {
		
			jQuery(this).css("opacity", 0.8);
		
		});
	
	jQuery(".cube img").hover( 
		// hover state
		function() {
			jQuery(this).css("opacity", 0.5);
		
		},
		// back to off
		function() {
		
			jQuery(this).css("opacity", 1.0);
		
		});
	
	jQuery(".downloadmp3 img").hover( 
		// hover state
		function() {
			jQuery(this).css("opacity", 0.5);
		
		},
		// back to off
		function() {
		
			jQuery(this).css("opacity", 1.0);
		
		});
	
	jQuery("img.free_download").hover( 
		// hover state
		function() {
			jQuery(this).css("opacity", 0.5);
		
		},
		// back to off
		function() {
		
			jQuery(this).css("opacity", 1.0);
		
		});
	
	
	
}


jQuery(document).ready(function(){
	
	// set the links to this site:
	set_social(document.title, document.location);

});

/* Home image slideshow */
function slideSwitch() {
    var $active = $('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 5000 );
});


	


	
