function onAfter(curr, next, opts) {
    var index = opts.currSlide;
    $('#releasePrev')[index == 0 ? 'hide' : 'show']();
    $('#releaseNext')[index == opts.slideCount - 1 ? 'hide' : 'show']();
};

/* 2010.09.30 - i removed large chunks of retarded codes and 80% of the site that uses fading effects are now using jquery cycle... 
				i need to fix the image .hide() thing where most if not all image should reload first and fade-in to the page itself... 
				just bunch of bells and whistles from here and out.. -makki */

$(document).ready(function() {
	//language tab setting 
	//Default Action
	$(".tab_content").hide(); //Hide all content
	//$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content

	//On Click Event
	$("ul.tabs li").click(function() {
		//$("ul.tabs li").removeClass("active"); //Remove any "active" class
		//$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).parent(".tab_box").children("div").hide();
		$(activeTab).fadeIn("Slow"); //Fade in the active content
		return false;
	});
	
	//multiple tab setting
	$(".tab_box").each( function() {
		$(this).children("div:not(:first)").hide();
	});

/** begin PROFILE : for LUCAS VALENTINE  -- same as tabs action, but for profile top chart */
	$(".chart_content").hide();
	$(".chart_content:first").show();
	$("ul.chart li").click(function() {
		$(".chart_content").hide();
		var activeTab = $(this).find("a").attr("href");
		$(activeTab).fadeIn("fast");
		return false;
	});
	
	$(".chart_content_beta").hide();
	$(".chart_content_beta:first").show();
	$("ul.chart_beta li").click(function() {
		$(".chart_content_beta").hide();
		var activeTab = $(this).find("a").attr("href");
		$(activeTab).fadeIn("fast");
		return false;
	});
/* end PROFILE : for LUCAS VALENTINE **/
	
	
	/** declaring random background */
	/* okay i was trying to do it on jquery but when you think about it, this loads the jpg first which means it has to download all the fucking shit
	so im just gonna do it the php way. jquery way is just too inefficient -makki 2010.04.06 */
	//bgImageTotal=3;
	//randomNumber = Math.round(Math.random()*(bgImageTotal-1))+1;
	//imgPath=('/img/background/'+randomNumber+'.jpg');
	//$('body').css('background', ('url("'+imgPath+'") repeat-x #1e1e1e !important'));
	/* end of random background **/
	


	/** hoping to convert all the visual effects to jquery.cycle soon */
	$('#newreleases_slideshow').cycle({ 
		fx:     'scrollHorz', 
		prev:   '#releasePrev', 
		next:   '#releaseNext', 
		after:   onAfter,
		easing: 'easeInOutExpo',
		timeout: 10000,
		delay: 10000,
		pause: 1
	});
	
	
	/* this spart is for twitter in front page.. twitter script needs to load the JSON data file first in order to render the page. if the data is too slow
	the whole page pauses and stops rendering in the middle of the freaking page.. so i am wrapping the script call itself in jquery so the whole twitter parts goes
	within the domready. blogger.js seems to replace everything that goes within the ul tag so i've placed the loading gif in one of the li tag. 
	
	2010.09.30 i just realized that this script is being called in every freaking page.. i need to differenciate the very index with custom class - makki */
	
	/* 2011-01-18 - makki - no need for this anymore
	$("body.kozmtop").append(
		'<sc'+'ript type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></sc'+'ript>' +
		'<sc'+'ript type="text/javascript" src="http://twitter.com/statuses/user_timeline/ambushdesign.json?callback=twitterCallback2&amp;count=5"></sc'+'ript>'
	);
	*/
	
	
	/* new top billboard script using jquery cycle - so much more easier */
	$("#billboardcycle").cycle({
		fx: 'scrollUp',
		easing: 'easeInOutExpo',
		timeout: 15000,
		delay: 5000
	});
	
	/* for feature article's top rotationg bar thing... */
	$("#feature_cycle").cycle({
		fx: "fade",
		timeout: 20000,
		delay: -10000
	});
	
	/* right banner */
	$("#jbanner_cycle").cycle({
		fx: "fade",
		timeout: 10000,
		delay: -5000
	});

});
