
jQuery.namespace = function() {
    var a=arguments, o=null, i, j, d;
    for (i=0; i<a.length; i=i+1) {
        d=a[i].split(".");
        o=window;
        for (j=0; j<d.length; j=j+1) {
            o[d[j]]=o[d[j]] || {};
            o=o[d[j]];
        }
    }
    return o;
};

jQuery.namespace('ibap.front');

ibap.front.common = {

    $: jQuery,
    
    displayRefreshMessage: function(){

        var $m = this.$('#refreshMessage');
        if ($m){
            setTimeout(function(){
                $m.fadeOut(1000);
            }, 3500);
        }
    },

    addLightbox: function(){

        this.$("a[rel='lightbox']").lightBox({
            containerResizeSpeed:   200,
            fixedNavigation:		true,
            imageLoading:			'/img/icons/lightbox/lightbox-ico-loading.gif',		// (string) Path and the name of the loading icon
            imageBtnPrev:			'/img/icons/lightbox/lightbox-btn-prev.gif',		// (string) Path and the name of the prev button image
            imageBtnNext:			'/img/icons/lightbox/lightbox-btn-next.gif',		// (string) Path and the name of the next button image
            imageBtnClose:			'/img/icons/lightbox/lightbox-btn-close.gif',		// (string) Path and the name of the close btn
            imageBlank:				'/img/icons/lightbox/lightbox-blank.gif',			// (string) Path and the name of a blank image (one pixel)
            dummy:					'' // for commas
        });
    },

    run: function(){
        this.displayRefreshMessage();
        this.addLightbox();
    }
};

(function($){
    $(document).ready(function(){
        ibap.front.common.run();
    });
})(jQuery);
