$(document).ready(function() {
	// Set the active post tab on page load
		var start_active=$(".posttabs .active").attr("title");
		$(".recentposts").hide();
		$("ul#"+start_active).show();

	// When a recent post tab is clicked
	$(".posttabs a").click(function () {
		$(".posttabs .active").removeClass("active");
		$(this).addClass("active");
		$(".recentposts").hide();
		
		var content_show = $(this).attr("title");
		$("ul#"+content_show).show();
	  
		return false;
	});

	// Initiate Last.fm Albums
	var _config = {username: 'cabeeb',
		placeholder: 'lastfmrecords',
		defaultthumb: 'http://cdn.last.fm/depth/catalogue/noimage/cover_85px.gif',
		period: '7day', 
		count: 8,
		refresh: 5,
		offset: -6
	};

	lastFmRecords.init(_config);	
	
	// When an inspiration tab is clicked
	$(".insptabs a").click(function () {
		$(".insptabs .active").removeClass("active");
		$(this).addClass("active");
		
		var duration = $(this).attr("title");;
		$('#recentmusic li.meta').hide();
		$("#recentmusic li#"+duration).show();

		_config.period = duration;
		jQuery('#lastfmrecords').empty();
		lastFmRecords.init(_config);
  
		return false;
	});
	
	//Mousing over the spectrum
	var anitime=200;
	$("#logo").hover(
		function() {
			$("#spectrum .red").animate({width: "340px"}, anitime);
			$("#spectrum .orange").animate({width: "316px"}, anitime);
			$("#spectrum .yellow").animate({width: "292px"}, anitime);
			$("#spectrum .green").animate({width: "268px"}, anitime);
			$("#spectrum .aqua").animate({width: "244px"}, anitime);
			$("#spectrum .blue").animate({width: "220px"}, anitime);
			/*$(this).children().addClass("over");*/
			/*$(this).addClass("over");*/
		},
		function() {
			$("#spectrum .red").animate({width: "220px"}, anitime);
			$("#spectrum .orange").animate({width: "244px"}, anitime);
			$("#spectrum .yellow").animate({width: "268px"}, anitime);
			$("#spectrum .green").animate({width: "292px"}, anitime);
			$("#spectrum .aqua").animate({width: "316px"}, anitime);
			$("#spectrum .blue").animate({width: "340px"}, anitime);
		}
	);
	
});