// JavaScript Document
jQuery.fn.action = function(string) {

	var $append_element = this;

	$append_element.prepend('<div class="action">' + string + '</div>');
		
	var $action = $('div.action');
	
	$action.hide().fadeIn('slow', function() {
		   
	});
	
	setTimeout(function () {$action.fadeOut('slow').remove()} , 2500);	
		
	return $append_element;	
	
};

jQuery(document).ready(function() {
	
	var sto = null;
	
	jQuery('span.hasmore').hover(
		function () {
			
			if (sto)
			{
				clearTimeout(sto);
			}
			jQuery(this).children('ul.dropdown').css({'display':'block'});
		}
		,
		function () { 
			sto = setTimeout("jQuery('ul.dropdown').css({'display':'none'})", 500);
		}
	);
	
	if(jQuery('div.action').length) {
		jQuery('div.action').fadeIn();
		setTimeout(function() { jQuery('div.action').fadeOut('slow').remove(); }, 2500);
	}
	
	jQuery('.delete').click(function () {
		return confirm('Click OK to delete ' + jQuery(this).attr('title'));
	});
	
	jQuery('tr.row').hover(
		function () {
			jQuery(this).addClass('hover');
		},
		function () {
			jQuery(this).removeClass('hover');
		}
	);
	
	jQuery('tr.row').click(function () {
		window.location = jQuery(this).children('td').children('a').attr('href');
	});
		
});
