$('document').ready(function(){
	//Toggle block
	$(".tbl-h-c img").bind("click",function(){
		$(this).parent().parent().parent().next().toggle("normal");
		src = $(this).attr('src');
		if (src.search("minimize") != -1) {
			newsrc = src.replace("minimize","maximize");
			$(this).attr('src',newsrc);
		}
		else {
			newsrc = src.replace("maximize","minimize");
			$(this).attr('src',newsrc);
		}
	});
	
	//Sortable 
	$(".sortable").sortable(
	{
		opacity:0.8,
		handle:'.tbl-h-c',
		tolerance:'pointer'
	});
	
	//Tooltip 
	$(".sortable .tbl-h-c").tooltip({ 
	    bodyHandler: function() { 
	        return "This block is draggable"; 
	    }, 
		track: true,
		delay: 0,
		showURL: false,
		showBody: " - ",
		extraClass: "pretty",
		fixPNG: true,
		left: -100
	});
	
	$("#wrapcentre img").tooltip({ 
		track: true,
		delay: 0,
		showURL: false,
		showBody: " - ",
		extraClass: "pretty",
		fixPNG: true,
		left: -20
	});
	
	$("#forums-stats").tooltip({ 
	    bodyHandler: function() { 
	        return "Forums statistics created by KeiMOon"; 
	    }, 
		track: true,
		delay: 0,
		showURL: false,
		showBody: " - ",
		extraClass: "pretty",
		fixPNG: true,
		left: -100
	});
});