//This addiitonal piece helps JQuery work within Silverstripe and the legacy fragments of Prototype
;(function($) {
	$(document).ready(function() {
 		
 		$(".BlogEntry a:has(img)").attr("rel", "gallery").colorbox();
 			
		$('#ArchiveWidget ul').hide();
		$('#ArchiveWidget h3').wrapInner('<span>');
		$('#CategoriesWidget ul').hide();
		$('#CategoriesWidget h3').wrapInner('<span>');
		$('#RecentPostWidget h3').wrapInner('<span>');
		
		$('#ArchiveWidget h3').bind("click", function(event){
			$(this).toggleClass('down');
			$("#ArchiveWidget ul").slideToggle();
			return false;
		});
		
		$('#CategoriesWidget h3').bind("click", function(event){
			$(this).toggleClass('down');
			$("#CategoriesWidget ul").slideToggle();
			return false;
		});
		
		$('#RecentPostWidget h3').bind("click", function(event){
			$(this).toggleClass('down');
			$("#RecentPostWidget ul").slideToggle();
			return false;
		});

	// Standard jQuery footer
	});
})(jQuery);
