/*
 * @abrys.edu.pl
 */

(function($) {           
    var methods = {
        init : function(options) {
            var settings = {

            };
            if ( options ) { 
                $.extend( settings, options );
            } 
            $('#nawigacjaGora2 a').each(function(){
                var pojemnik, src, odsylacz;
                $(this).removeAttr("title");
                src = $(this).attr('href');
                odsylacz = $.url(src).fsegment(1);
                pojemnik = $('<div class="tooltip" />');
                        $.ajax({
                        type: "POST",
                        url: strona_url+'index/list/format/json',
                            data:   "odsylacz="+odsylacz,
                        dataType: 'json',
                        cache: false,
                        success: function(text){
                            pojemnik.html(text[odsylacz]);
                        },
                        complete: function(){}
                    })

                $(this).parent().append(pojemnik);

            })
            $('#nawigacjaGora2 a').tooltip(
            {
                   offset: [380, 80],
                   effect: 'slide',
                   onBeforeShow: function(){


                       
                   }
                })
//                .dynamic({ bottom: { direction: 'down', bounce: true } });
        }
    };
    $.fn.mainAbrys = function( method ) {
        if ( methods[method] ) {
            return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ));
        } else if ( typeof method === 'object' || ! method ) {
            return methods.init.apply( this, arguments );
        } else {
            $.error( 'Method ' +  method + ' does not exist on jQuery.mainAbrys' );
        }
    }
})(jQuery);

jQuery(document).ready(  
    function($)
    {  
        $('#content').mainAbrys();
    }
)
