var $j = jQuery.noConflict();
jQuery(document).ready(function($j){
	$j("#facebox").overlay({

		top: 'center',
		mask: {
			color: '#000',
			loadSpeed: 500,
			opacity: 0.5
		},
		closeOnClick: true,
		load:true,
		
	onClose : function (event, tabIndex) {
		$j("#jquery_jplayer_1").jPlayer("pause");
		$j(this).blur();
		return false;		
	}
});

$j(".close").click(function() {
	$j("#jquery_jplayer_1").jPlayer("pause");
	$j(this).blur();
	return false;
});


	
	$j('.fadein img:gt(0)').hide();
	    setInterval(function(){
	      $j('.fadein :first-child').fadeOut(2000)
	         .next('img').fadeIn(2000)
	         .end().appendTo('.fadein');}, 
	      6000);

				//Default Action
				$j(".tab_content").hide(); //Hide all content
				$j("ul.tabs li.first").addClass("active").show(); //Activate first tab
				$j("#tab1").show(); //Show first tab content


				//On Click Event
				$j("ul.tabs li").click(function($e) {
					$j("ul.tabs li").removeClass("active"); //Remove any "active" class
					$j(this).addClass("active"); //Add "active" class to selected tab
					$j(".tab_content").hide(); //Hide all tab content
					var activeTab = $j(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
					$j(activeTab).fadeIn(); //Fade in the active content
					fleXenv.fleXcrollMain(activeTab.slice(1));
					//fleXenv.fleXcrollMain("tab1");
					//fleXenv.fleXcrollMain("tab2");
					//fleXenv.fleXcrollMain("tab3");
					return false;
				});

			});
	
	$j("a.fancybox").fancybox({
			'transitionIn'	:	'elastic',
			'transitionOut'	:	'elastic',
			'speedIn'		:	600, 
			'speedOut'		:	200, 
			'overlayShow'	:	true,
			'hideOnContentClick' : true,
			'showNavArrows' : true,
			'titlePosition' : 'over'
		});
		
	$j("a.playerlyrics").fancybox({
			'width' : 400,
			'height' : 500,
			'type' : 'iframe',
			'scrolling' : 'yes'
		});
	

			$j(function() {
			    $j(".discography_slider_vertical").jCarouselLite({
			        btnNext: ".next",
			        btnPrev: ".prev",
					mouseWheel: true,
					scroll:3,
					visible:3,
					vertical:true
			    });
			});
			$j(function() {
			    $j(".discography_slider_horizontal").jCarouselLite({
			        btnNext: ".next",
			        btnPrev: ".prev",
					mouseWheel: true,
					scroll:4,
					visible:4,
					vertical:false
			    });

				$j(".replace_button").click(function($e) {
					$j("#channel_video_player").replaceWith("<div id=\"channel_video_player\"><p>It worked!</p></div>");
				});

				$j('div.f_comments a').click(function(){ 
					if($j(this).text()=='Hide Comments [-]'){
						$j(this).text('Show Comments [+]');
						$j(this).parent().next().hide();
					} else {
						$j(this).text('');
						$j(this).parent().next().show();
					}
					return false;
				});
}); 

