(function($){  
	$.fn.timeout = function(options) {  
		var defaults = {timeout:'2000',callback:function(){return true;}}; 
		var options = $.extend(defaults, options);  
		return this.each(function() {
			var e=$(this)[0];
			setTimeout(function(){options.callback.call(e)},options.timeout);
		}); 
	}
})(jQuery); 


$(document).ready(function(){
	
	$('ul#menu-items').superfish({ 
            delay:       500,                            // one second delay on mouseout 
            animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
            speed:       400,                          // faster animation speed 
            autoArrows:  false,                           // disable generation of arrow mark-up 
            dropShadows: false                            // disable drop shadows 
        }); 
	
	$('ul#lingua > li').hover(function() {
		$('ul:first', this).show();
	 },
	 function() {
		$('ul:first', this).hide(); 
	 });
		
	 $('ul#lingua li li').hover(function() {
		$('ul:first', this).each(function() {
		  $(this).css('top', $(this).parent().position().top );
		  $(this).css('left', $(this).parent().position().left + $(this).parent().width() );
		  $(this).show();
		});
	 },
	 function() {
		$('ul:first', this).hide(); 
	 });
	 
});
