$(document).ready(function()
{
    /**
     * Global configuration for tooltip tool
     */
    // Tooltip
    $.extend($.tools.tooltip.conf, { 
        //api: true,
        effect: "fade",
        position: "top left",
        offset: [0,15],
        lazy: false
        
        //tip: ".tooltip",
        //opacity: 0.75,
        //fadeInSpeed: 200,
        //fadeOutSpeed: 200,
    });
    //*
    // Tooltip plugin - dynamic position
    $.extend($.tools.tooltip.plugins.dynamic.conf, { 
        //bottom: {direction: 'down'},
    });
    //*/
    
    
    /**
     * Popup initialization
     */
    // Get default dimensions
    nDefaultWidth = $(cPopupId).width();
    nDefaultHeight = $(cPopupId).height();
    
    //CLOSING POPUP
    //Click the x event!
    $(cPopupCloseId).click(function(){
        DisablePopup();
    });
    //Click out event!
    $(cPopupBgId).click(function(){
        //DisablePopup();
    });
    //Press Escape event!
    $(document).keypress(function(e){
        if(e.keyCode==27 && nPopupStatus==1){
            DisablePopup();
        }
    });
    
    // Add this toolbox
    $.getScript('http://s7.addthis.com/js/250/addthis_widget.js#pub=xa-4acc477b1439752f', function()
    {
        $(".addthis").css({'display' : 'block'});
    });


    if($.browser.chrome)
    {
        $(".zo-extension", "#whiteline").css({'display' : 'block'});
    }


    // Clock
    $('.jclock', "#topsection").jclock();

    $(".info_menu a[rel]", "#topsection").tooltip(
    {
        // Reposition at the bottom
        position: "bottom left",
        // change class style
        onBeforeShow: function()
        {
            var oTip = this.getTip();
            if(oTip.width() > 400)
            {
                oTip.css("width", 400);
            }
            oTip.addClass("bottom");
        }
    }).dynamic();

    
    /**
     * Misc configuration
     */
    // bla bla bla
    
});
