var $j = jQuery.noConflict();
$j(document).ready(function() {

    //Apply active class to active links on page
    var currentURL = currentURL = window.location;
    $j('li a[href=\''+currentURL+'\']').addClass('active');
    
    target_external_links();
   
    //Adjust element classes
    $j('#menu li:first').addClass('first');
	$j('#menu li:last').addClass('last');
    
    $j('.widget:first-child').addClass('first');
    $j('.widget:last-child').addClass('last');
    $j('.widget_nav_menu div').addClass('list-content');
    $j('.widget_pages ul').addClass('list-cThoughtsontent');
    $j('.widget_recent_entries ul').addClass('list-content');
        
    $j('.list-content li').hoverPadding();
        
    $j('.graceful').scrollGracefully();
    
    $j('#lists h2').scrollDown({ 
        content: "#lists .list-content"
    });
    
    
    
    
    
    //Snippet Buttons
$j("pre").each(function() {
	var title = $j("h2.title a:first").html();
	var snippet = $j(this).html();
	snippet = decodeHTML(snippet);
	var snippetURIFriendly = encodeURIComponent(snippet);
	var snippetHTMLEntity = htmlEncode(snippet);
	$j(this).after('<ul class="snippets_export"><li class="first"><a href="" class="copy" copy="' + snippetHTMLEntity + '">Copy To Clipboard</a></li><li><a href="snippet:add?code=' + snippetURIFriendly + '&name=' + title + '&relatedurl=' + window.location + '">Add to Snippets.app</a></li><li class="last"><a href="codaclips://<<**Title:' + title + '**>>' + snippetURIFriendly + '">Add to Coda</a></li></ul></div><div class="clear"></div>');
});

//Code Syntax
$j("pre").addClass('prettyprint');
prettyPrint(); 


$j(".copy").each(function() {
	text_to_copy = $j(this).attr("copy");
	copy_text(this, text_to_copy);
});


    
});
