/*
 * PixelMenu Plugin Definition
 */

(function ($) {

    // config object

    
    $.fn.pixelMenu = function(config) {

	var defaults = {
	    moreText: '+'
	};

	config = $.extend({}, defaults, config);	

       $(this).find('ul.children').each(function() {
	    var html = $(this).parent().find('a:first').html();
	    $(this).parent().find('a:first').html(html + config.moreText);
	});

	$(this).find('ul.children').css('display', 'none');
	$(this).find('li').hover(
	    function() {
		$(this).find('ul.children:first').stop().css({
		    overflow: 'hidden',
		    height: 'auto',
		    display: 'none'
		}).slideDown(500, function() {
		    $(this).css({
			overflow: 'visible'
		    })
		});
	    },
	    function() {
		$(this).find('ul.children:first').stop().slideUp(250, function() {
		    $(this).css({
			overflow: 'hidden',
			height: 'auto',
			display: 'none'
		    })
		});
	    } );
    }
})(jQuery);
