// Categories
Categories = {
	initialize : function()	{
		var spans = $('.cat-item span');

		spans.each(function(index, obj) {
			$(obj).click(function() {
				document.location = $(obj).prev().attr('href');
			});
		});
	}
};

// The almighty document.ready
$(document).ready(function() {
	Categories.initialize();
	
	// initialize syntax highlighting
	dp.SyntaxHighlighter.ClipboardSwf = 'flash/clipboard.swf';
	dp.SyntaxHighlighter.HighlightAll('code');
	
	// add scrolling events
	if($('#comments-scroller') && $('#comments-container'))	{
		var link = $('#comments-scroller');
		
		link.click(function(event) {
			event.preventDefault();
			$.scrollTo($('#comments-container'), 800);
		});
	}
});