/*

	Port van MaxiDoc menu naar TYPO3 menu	

	--

	@file 		jquery.maxiMenu.js
	@version 	1.0.0b
	@date 		2010-10-21 14:44:00 +0200 (Thu, 21 Oct 2010)
	@author 	Bart

	Copyright (c) 2010 Maximedia BV <http://www.maximedia.nl>

*/
$_ = jQuery;

$_.fn.maximenu = function(options) {
	//set default options
	var defaults = {};

	var opts = $_.extend(defaults, options);
	
	return this.each(function() {
			
		//no border-bottom when there are no subitems
		if ($_(this).find('li.active li').size() == 0) {
			$_(this).find('li.active a').css('border-bottom', 'none');
		}
	
		$_(this).find('li').not('li.active').each(function() {
			$_(this).hover(
				function() {
					$_(this).addClass('hover');
					$_(this).find('ul').css('height', 'auto');
					$_(this).children('ul').addClass('hover');//.stop().hide().fadeIn(opts['timeShow']);//.stop().animate({height: 'inerhit'}, opts['timeDown'], opts['easingDown']);
				},
				function() {
					$_(this).removeClass('hover');
					//$(this).find('ul').stop().animate({height: 0}, opts['timeUp'], opts['easingUp'], function() {$(this).css('display','none').removeClass('hover')});
					$_(this).find('ul').removeClass('hover');
				});
			
		});
	});
	
}

