function slideSwitch() {
    var $active = $('#home-slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#home-slideshow IMG:last');

    var $next =  $active.next().length ? $active.next()
        : $('#home-slideshow IMG:first');

    $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 );
});


/*----now the jquery doc ready stuff----*/

$(document).ready(function() {	
	
	
	
	 $('.fade').hover(function(){
		$(this).fadeTo(100, 0.5); // This sets the opacity to 100% on hover
		},function(){
		$(this).fadeTo(100, 1.0); // This sets the opacity back to 60% on mouseout
		});
		
		
	 $('.video-btn').click(function() {
	 	
	 	$.scrollTo('#featured-video');
	 	$('#player-wrap, #video-info').hide();
	 	$('#video-loading').show();
	 	
	 	var vid_id = $(this).attr("id");
	 	var my_data = 'v='+vid_id;
				 
				 
				$('#featured-video').load('/wp-content/themes/beasleyband/video-player.php?' + my_data, function() {
				  //alert('Load was performed.');
				  Cufon.refresh();
				  $('#video-loading').hide();
				  
				});
	 	
	 	
	 	return false;
	 	
	 });
		


}); //end on doc ready
