$(document).ready(function() {
		
	/* Last.FM  */
	/************************/
	
	$("a.lastfm_nav").click(function() {
		var type = $(this).attr("id");
		$("#lastfm_display > .content").html("<center><img src='./images/ajax-loader.gif' /></center>");
		
		$("#lastfm_display > .content").load("./lastfm.php",{type: type},refreshLastFM);
		
	});
	
	$("#lastfm_display > .content").ready(function() {
		$("#lastfm_display > .content").html("<center><img src='./images/ajax-loader.gif' /></center>");

		$("#lastfm_display > .content").load("./lastfm.php",{type: "recentSongs"});		
	});
	
	
	/* Twitter */
	/***********************/
	
	$("a.twitter").click(function() {
		var index = $(this).attr("id");
		$("#twitter_display > .content").html("<center><img src='./images/ajax-loader.gif' /></center>");
		
		$("#twitter_display > .content").load("./twitter.php",{index: index},refreshTwitter);
		
	});
	
	$("#twitter_display > .content").ready(function() {
		$("#twitter_display > .content").html("<center><img src='./images/ajax-loader.gif' /></center>");

		$("#twitter_display > .content").load("./twitter.php",{index: "0"});		
	});
});
	
	/* Refresh Functions */
	/***********************/
function refreshLastFM(data) {
  $("#lastfm_display > .content").html(data);
}

function refreshTwitter(data) {
  $("#twitter_display > .content").html(data);
}


   /*   Normal JS stuff   */
   /****************************/

function doClear(theText) 
{
     if (theText.value == theText.defaultValue)
	{
         theText.value = ""
    }
 }

