// JavaScript Document
 
                                                     /*LASTFM FEED*/ 
 
jQuery(document).ready( function() {
  var _config = {username: 'hunson',                 // last.fm username
                 placeholder: 'lastfmrecords',       // id of the div in HTML to use for cd covers
                 defaultthumb: 'http://dl.getdropbox.com/u/598084/Zinc%20Theme/images/nocover.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.contact").click(function () {
      $("#contact").toggle("normal");
    }); 
 }); 
 
 
                                                      /*MENU DROP DOWN NAVIGATION*/
 
 $(document).ready(function(){

	$("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)

	$("ul.meta li span").click(function() { //When trigger is clicked...

		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click

		$(this).parent().hover(function() {
		}, function(){
			$(this).parent().find("ul.subnav").slideUp('normal'); //When the mouse hovers out of the subnav, move it back up
		});

		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() {
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});

});
 
 
                                                      /*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();
			});
		} });
	});
});