$(document).ready(function() 
{
	if(typeof doToolManSort == 'function') { doToolManSort(); }
	$("input[type='checkbox']").css({border:0}) // For win/ie
	if( $('#portfolio').length > 0 ) {
	  $("a.thumbnail").fancybox({
	    'titlePosition' : 'inside', 
	    'overlayColor'  : '#fff', 
	    'overlayOpacity': '0.8', 
	    'centerOnScroll': true, 
	    'padding'       : 0, 
	    'showCloseButton':false, 
	    'cyclic'        : true,
	    'titleFormat'   : function(title, currentArray, currentIndex, currentOpts) { var t = $('#portfolio li:eq(' + currentIndex +') span.title').html(); if( t ) { return '<div id="fancybox-custom-title">' + t + '</div>'; } }
	  });
	  $("a.thumbnail").tooltip({
        showURL: false, 
        track: false
    });
	}
});

$('.delete')
	.livequery('click',function() {
		var title = this.getAttribute('title');
		var msg = title.split('\"');
		if( confirm('Are you sure you want to delete the page \"'+msg[1]+'\" and all of its dependent pages (including all associated images and files)? As an alternative, you may want to hide this page from users by unchecking its \'Active\' box.') )
		{
			return true;
		}
		else
		{
			return false;
		}
	});
	
$('.delete_thumb')
	.livequery('click',function() {
		var msg = this.getAttribute('title');
		if( confirm(msg+'?') )
		{
			return true;
		}
		else
		{
			return false;
		}
	});
