// JavaScript Document
 
                                                     /*LASTFM FEED*/ 
 
jQuery(document).ready( function() {
  var _config = {username: 'mrlogandavis',                 // last.fm username
                 placeholder: 'lastfmrecords',       // id of the div in HTML to use for cd covers
                 defaultthumb: 'https://dl.dropbox.com/u/44117/Picture%201.png',                                                     // image shown for no cd cover found
                 period: 'recenttracks',              // recenttracks, 7day, 3month, 6month, 12month, overall, topalbums and lovedtracks
                 count: 6,                           // number of images to show
                 refresh: 5,                        // when to get new data from last.fm (in minutes)
                 offset: 8                           // difference between your timezone and GMT.
                };

  lastFmRecords.debug();                             // log to console
  lastFmRecords.init(_config);
});


                                                     /*RETURN TO TOP*/

$(document).ready(function() {
	$('a.returntop').click(function(){
		$('html, body').animate({scrollTop:0}, 'slow'); 
	});
});


                                                     /*TOGGLE*/

 $(document).ready(function(){   
    $("a.cloud").click(function () {
      $("#cloud").slideToggle("normal");
    }); 
 }); 
 
 
              
 
 
                                                      /*TUMBLR NOTES*/ 

$(function() {
	$("a.notes-button").each(function() {
		var noteCount = parseInt($(this).html().substring(0,$(this).html().indexOf(" ")));
		if (noteCount > 0) $(this).show();
		if (noteCount > 14) $(this).addClass("fave");
	});
	$("a.notes-button").click(function(event) {
		event.preventDefault();
		var node = $("#notes-"+$(this).attr("rel"));
		$("#notes-"+$(this).attr("rel")).slideToggle();
		$.ajax({ url: $(this).attr("href")+"&jsonp=1", dataType: "jsonp", success: function(data){
			node.find(".loading").hide();
			node.find(".notes-loader").html(data).find("ol.notes li:last").append("</span>").end().slideDown();
			node.find(".notes-loader").append("<p><a href='#' class='notes-hide'>Hide Notes</a></p>");
			node.find(".notes-hide").click(function(event) {
				event.preventDefault();
				node.slideToggle();
			});
		} });
	});
});