(function($) {

    $.fn.spasticNav = function(options) {

        options = $.extend({
            overlap: 125,
            speed: 500,
            reset: 1500,
            color: '#F29322',
            easing: 'easeOutExpo'
        }, options);

        return this.each(function() {

            var nav = $(this),
	 		blob,
	 		reset;

            blob = $('#blob', nav);
            $('li:not(#blob)', nav).hover(function() {
                // mouse over
                clearTimeout(reset);
                blob.animate(
					{
					    left: $(this).position().left,
					    width: $(this).width()
					},
					{
					    duration: options.speed,
					    easing: options.easing,
					    queue: false
					}
				);
				if ($(this).attr('id') == "botpol") { $("#titpol").fadeIn("slow"); $("#despol").fadeIn("slow"); }
				if ($(this).attr('id') == "botloc") { $("#titloc").fadeIn("slow"); $("#desloc").fadeIn("slow"); }
				if ($(this).attr('id') == "botpar") { $("#titpar").fadeIn("slow"); $("#despar").fadeIn("slow"); }
				if ($(this).attr('id') == "botele") { $("#titele").fadeIn("slow"); $("#desele").fadeIn("slow"); }

                // Mostrar la descripcion de la opcion

            }, function() {
                // mouse out
                /*reset = setTimeout(function() {
                blob.animate({
                width : currentPageItem.outerWidth(),
                left : currentPageItem.position().left
                }, options.speed)
                }, options.reset);*/

                // Ocultar de la opcion su descripcion
                if ($(this).attr('id') == "botpol") { $("#titpol").fadeOut("slow"); $("#despol").fadeOut("slow"); }
                if ($(this).attr('id') == "botloc") { $("#titloc").fadeOut("slow"); $("#desloc").fadeOut("slow"); }
                if ($(this).attr('id') == "botpar") { $("#titpar").fadeOut("slow"); $("#despar").fadeOut("slow"); }
                if ($(this).attr('id') == "botele") { $("#titele").fadeOut("slow"); $("#desele").fadeOut("slow"); }

            });

        }); // end each

    };

})(jQuery);
