
jQuery(document).ready(function() {
	
	jQuery("#media_container div.left").hide(); //Hide all content
	jQuery("#media-tabs ul.media li:first").addClass("active").show(); //Activate first tab
	jQuery("#media_container div.left:first").show(); //Show first tab content



	//On Click Event
	jQuery("#media-tabs ul.media li").click(function() {

		jQuery("#media-tabs ul.media li").removeClass("active"); //Remove any "active" class
		jQuery(this).addClass("active"); //Add "active" class to selected tab
		jQuery("#media_container div.left").hide(); //Hide all tab content

		var activeTab = jQuery(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		jQuery(activeTab).fadeIn(); //Fade in the active ID content
		//return false;
	});

});

rotateSwitch = function(){
    play = setInterval(function(){ //Set timer - this will repeat itself every 5 seconds
        $active = jQuery('#media-tabs ul.media li.active').next(); //Move to the next paging
        jQuery("#media-tabs ul.media li").removeClass("active");
        $active.addClass('active');
        
        if ( $active.length === 0) { //If paging reaches the end...
            $active = jQuery('#media-tabs ul.media li:first'); //go back to first
              
             jQuery("#media-tabs ul.media li:first").addClass("active").show(); 
        }
        jQuery("#media_container div.left").hide();
        
        var activeTab = $active.find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		jQuery(activeTab).fadeIn(); //Fade in the active ID content
        
    }, 5000); //Timer speed in milliseconds (5 seconds)
};



jQuery(document).ready(function() {
	
 rotateSwitch();





});



 





