	//REMOVE TITLE ATTRIBUTE
	jQuery("#dropmenu a").removeAttr("title");
		
	//MENU
	jQuery("#dropmenu ul").css("display", "none").parent().children("a").append("<span>&nbsp;&nbsp;+</span>");
	jQuery("#dropmenu li").hover(function(){
		jQuery(this).find('ul:first').stop(true,true).slideDown(200);
		},function(){
		jQuery(this).find('ul:first').stop(true,true).slideUp(200);
	});
	jQuery("#dropmenu ul li a").hover(function(){
		jQuery(this).stop(true,true).animate({paddingLeft:"20px"},200);
	}, function(){
		jQuery(this).stop(true,true).animate({paddingLeft:"12px"},200);
	});	
	
	//PRETTY PHOTO
	jQuery("a[href$='jpg'],a[href$='png'],a[href$='gif']").attr({rel: "prettyPhoto"});
	jQuery(".gallery-icon > a[href$='jpg'],.gallery-icon > a[href$='png'],.gallery-icon > a[href$='gif'], #postImgs a").attr({rel: "prettyPhoto[pp_gal]"});
	jQuery("a[rel^='prettyPhoto']").prettyPhoto({
		animation_speed: 'normal', // fast/slow/normal 
		opacity: 0.35, // Value betwee 0 and 1 
		show_title: false, // true/false 
		allow_resize: true, // true/false 
		overlay_gallery: false,
		counter_separator_label: ' of ', // The separator for the gallery counter 1 "of" 2 
		theme: 'dark_square', // light_rounded / dark_rounded / light_square / dark_square 
		hideflash: true, // Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto 
		modal: false // If set to true, only the close button will close the window 
	});
	
	//SIDEBAR TOGGLE STUFF
	jQuery("#leftColumn").prepend("<div id='sideToggle'>+</div>");
	var sideToggle = jQuery("#sideToggle"),
		sidebar = jQuery('#sidebar'),
		mainContainer = jQuery('#mainContainer');
	sideToggle.click(function(){
		if(jQuery(this).hasClass('open')){
			jQuery(this).html('+');
		} else {
			jQuery(this).html('&times;');
		}
		jQuery(this).toggleClass('open');
		sidebar.toggleClass('open');
	});
	sideToggle.toggle(function(){
		sidebar.toggle(500);
		mainContainer.stop(true,true).animate({marginRight:"-237px"},300);
	},function(){
		sidebar.toggle(500);
		mainContainer.stop(true,true).animate({marginRight:"0"},500);
	});	
	
	//BACK TO TOP STUFF
	var backTop = jQuery("#backTop");
	backTop.click(function(){
		jQuery("html,body").animate({scrollTop:0},499);
	});
	jQuery(document).scroll(function(){
		if(jQuery(document).scrollTop()>0){
			backTop.stop(true,true).slideDown(200);
		} else {
			backTop.stop(true,true).slideUp(200);
		}
	});
	
	//SHOW NAVIGATION AND WIDGET TOGGLE AFTER LOAD
	var navigation = jQuery('.navigation');
	jQuery(window).load(function(){
		navigation.first().slideDown(300);
		sideToggle.slideDown(300);
	});
	
	//SONG STUFF
	var songLink = jQuery("ol.songs li a");
	songLink.live('mouseover', function(){
		jQuery(this).stop(true,true).animate({paddingLeft:"35px"},200);
	});
	songLink.live('mouseout', function(){
		jQuery(this).stop(true,true).animate({paddingLeft:"30px"},200);
	});
	//SHOW SONGS FUNCTION
	function showSongs(){
		jQuery("ol.songs li").each(function() {
			var delayAmount = jQuery(this).index() * 200;
    		jQuery(this).delay(delayAmount).animate({left:"0px"},500);
		});
	}
	//SHOW SONGS WHEN PAGE LOADS
	jQuery(window).load(function(){
		showSongs();
	});
	
	//AJAX STUFF
	jQuery("div.pagenav a").live('click',function() { 
	   
		//GET URL
		var url = jQuery(this).attr('href');
		
		//DETERMINE WHICH LINK WAS CLICKED	
		var leftSide = "-745px",
			rightSide = "745px";
		if(jQuery(this).attr("class") == "nextpostslink"){
			var first = leftSide,
				second = rightSide;
		} else {
			var first = rightSide,
				second = leftSide;	
		}
		
		//SHOW THE LOADING MESSAGE
		jQuery('.navigation').html("<div id='loading'>Loading...</div>");
		
		//ADD THE AJAX CONTAINER
		jQuery(".listingContainer").append('<div id="loadHere"></div>');
		
		//POSITION THE AJAX CONTAINER
		jQuery("#loadHere").css({left:second}).load(url + " .listing",'', function() {
			
			//GRAB THE BG IMG
			var backImg = jQuery("#loadHere .backGroundImg").html();
			
        	//LOAD BG IMG
        	if(backImg){jQuery.backstretch(backImg, {speed: 300});}
        	
        	//ANIMATE NEW ITEM
        	jQuery(this).animate({left:"0"},700);
        	
        	//IF NO NEXT LINK
        	if(!jQuery("#loadHere .nextpostslink").length){
        		jQuery("#loadHere #nextpage").append('<a class="nextpostslink" href="">&rarr;</a>');
        	}
        	
        	//ANIMTE OLD ITEM
        	jQuery(".listingContainer > .listing").animate({left:first},700,function(){
        	
       			//REMOVE OLD ITEM AND LOADING MSG
       			jQuery(".listingContainer > .listing, #loading").remove();
       			
       			//REMOVE DIV CONTAINER
       			jQuery("div > .listing").unwrap("<div></div>");
       			
       			//SHOW NAVIGATION
       			jQuery('.navigation').first().slideDown(300);
       			
       			//SHOW SONGS
       			showSongs();
       			
       			//SHOW PLAYER
       			showPlayer();
        	});
       	});
    	return false;
	});//END AJAX STUFF
	
	/*----AUDIO PLAYER STUFF---*/
	function checkPlayer(){
		var songPlaying = jQuery("ol.songs li.playing a");
		if(jQuery('#audiojs_wrapper0').hasClass('playing')){
			songPlaying.addClass('on');
		} else {
			songPlaying.removeClass('on');
		}
	}	
	// Setup the player to autoplay the next track
	var a = audiojs.createAll({
		trackEnded: function() {
			var next = jQuery('ol li.playing').next();
            if (!next.length) next = jQuery('ol li').first();
            next.addClass('playing').siblings().removeClass('playing');
            audio.load(jQuery('a', next).attr('href'));
            audio.play();
            checkPlayer();
		}
	});
        
	// Load in the first track
    var audio = a[0];
    	first = jQuery('ol a').attr('href');
	jQuery('ol li').first().addClass('playing');
    audio.load(first);

	// Load in a track on click
	jQuery('ol li').live('click',function(e) { 
    	e.preventDefault();
    	if(jQuery(this).hasClass('playing') && jQuery('#audiojs_wrapper0').hasClass('playing')){
    		audio.pause();
    		checkPlayer();
        } else {
        	jQuery(this).addClass('playing').siblings().removeClass('playing');
       		audio.load(jQuery('a', this).attr('href'));
        	audio.play();
        	checkPlayer(); 
        }
     });
        // Keyboard shortcuts
        jQuery(document).keydown(function(e) {
          var unicode = e.charCode ? e.charCode : e.keyCode;
             // right arrow
          if (unicode == 39) {
            jQuery(".nextpostslink").click();
            // left arrow
          } else if (unicode == 37) {
            jQuery(".previouspostslink").click();
            //UP KEY...
          } else if (unicode == 38) {
		 	var prev = jQuery('li.playing').prev();
            if (!prev.length) prev = jQuery('ol li').last();
            prev.click();
            return false;
		 	//DOWN KEY...
          } else if (unicode == 40) {
          	var next = jQuery('li.playing').next();
            if (!next.length) next = jQuery('ol li').first();
            next.click();
            return false;
          }
        });
    //IF PLAY/PAUSE IS CLICKED    
    jQuery('.play-pause').live('click',function() { 
        checkPlayer();
    });

	//IF NO SONGS
	function showPlayer(){
	if(!jQuery('ol.songs').length && !jQuery('#audiojs_wrapper0').hasClass('playing')){
		jQuery('.audiojs').slideUp(300);
	} else {
		jQuery('.audiojs').slideDown(300);
	}
	}
	showPlayer();
		
	//SONG TARGET
	jQuery(".post a[data-src$='mp3']").addClass("song");
	
	//MESH BACKGROUND STUFF
	function docHeight(){
		var documentHeight = jQuery(document).height();
		jQuery("#mesh").css({height:documentHeight});		
	}
	jQuery(document).ready(function(){
		docHeight();
	});
	jQuery(window).resize(function(){
		docHeight();
	});
