$j = jQuery;

// test with dilb01 if keeping

// this.tooltip = function(){	
// 	/* CONFIG */		
// 		xOffset = 10;
// 		yOffset = 20;		
// 		// these 2 variable determine popup's distance from the cursor
// 		// you might want to adjust to get the right result		
// 	/* END CONFIG */		
// 	$j("a.tooltip").hover(function(e){											  
// 		this.t = this.title;
// 		this.title = "";									  
// 		$j("body").append("<p id='tooltip'>"+ this.t +"</p>");
// 		$j("#tooltip")
// 			.css("top",(e.pageY - xOffset) + "px")
// 			.css("left",(e.pageX + yOffset) + "px")
// 			.fadeIn("fast");		
//     },
// 	function(){
// 		this.title = this.t;		
// 		$j("#tooltip").remove();
//     });	
// 	$j("a.tooltip").mousemove(function(e){
// 		$j("#tooltip")
// 			.css("top",(e.pageY - xOffset) + "px")
// 			.css("left",(e.pageX + yOffset) + "px");
// 	});			
// };

 
// this.screenshotPreview = function(){	
// 	/* CONFIG */
// 		
// 		xOffset = 10;
// 		yOffset = 30;
// 		
// 		// these 2 variable determine popup's distance from the cursor
// 		// you might want to adjust to get the right result
// 		
// 	/* END CONFIG */
// 	$j("a.screenshot").hover(function(e){
// 		this.t = this.title;
// 		this.title = "";	
// 		var c = (this.t != "") ? "<br/>" + this.t : "";
// 		$j("body").append("<p id='screenshot'><img src='"+ this.rel +"' alt='url preview' />"+ c +"</p>");								 
// 		$j("#screenshot")
// 			.css("top",(e.pageY - xOffset) + "px")
// 			.css("left",(e.pageX + yOffset) + "px")
// 			.fadeIn("fast");						
//     },
// 	function(){
// 		this.title = this.t;	
// 		$j("#screenshot").remove();
//     });	
// 	$j("a.screenshot").mousemove(function(e){
// 		$j("#screenshot")
// 			.css("top",(e.pageY - xOffset) + "px")
// 			.css("left",(e.pageX + yOffset) + "px");
// 	});			
// };

$j(document).ready(function(){
	// starting the script on page load
	// tooltip();
	
	//hide message_body after the first one
	$j(".message_list .message_body:gt(-1)").hide();
	
	//hide message li after the 5th
	$j(".message_list li:gt(50)").hide();

	//toggle message_body
	$j(".message_head").click(function(){
		$j(this).next(".message_body").slideToggle(500)
		return false;
	});

	//collapse all messages
	$j(".collpase_all_message").click(function(){
		$j(".message_body").slideUp(500)
		return false;
	});

	//show all messages
	$j(".show_all_message").click(function(){
		$j(this).hide()
		$j(".show_recent_only").show()
		$j(".message_list li:gt(4)").slideDown()
		return false;
	});

	//show recent messages only
	$j(".show_recent_only").click(function(){
		$j(this).hide()
		$j(".show_all_message").show()
		$j(".message_list li:gt(4)").slideUp()
		return false;
	});

});