$(document).ready(function() {
	
	$("body").removeClass();
	var themeList = new Array("theme-blue", "theme-green", "theme-red", "theme-magenta");
	var theme = themeList[Math.floor(Math.random()*themeList.length)];
	$("body").addClass(theme);

	
	$(".infos li").hide();
	$("ul.infos li:first-child").show();
	$(".projects .sweet-links li:first-child a").addClass("active");
	$(".infos").addClass("enhance");
	$(".loading").addClass("enhance");

	$("#theme-blue").click(function(){
		$("body").removeClass();
		$("body").addClass("theme-blue");
	});
	$("#theme-green").click(function(){
		$("body").removeClass();
		$("body").addClass("theme-green");
	});
	$("#theme-red").click(function(){
		$("body").removeClass();
		$("body").addClass("theme-red");
	});
	$("#theme-magenta").click(function(){
		$("body").removeClass();
		$("body").addClass("theme-magenta");
	});
	
	$(".projects a").click(function(){
		$(".projects a").removeClass();
		$(this).addClass("active");
		$(".infos li").fadeOut('slow');
		var currentProject = $(this).attr('href');
		$(currentProject).fadeIn('slow');
		return false;
	});

	$.ajax({
	  url: "twitter-lastfm.php",
	  cache: false,
	  success: function(html){
		$("#status-ajax .loading").fadeOut('fast');
		$("#status-ajax").append(html);
		$("#status-ajax ul").hide();
		$("#status-ajax ul").slideDown('slow');
	  }
	});
	$.ajax({
	  url: "delicious.php",
	  cache: false,
	  success: function(html){
		$("#delicious-ajax .loading").fadeOut('fast');
		$("#delicious-ajax").append(html);
		$("#delicious-ajax ul").hide();
		$("#delicious-ajax ul").slideDown('slow');
	  }
	});

});