$D = YAHOO.util.Dom;
var yuiLoadingPanel = function(conf){
    conf = conf == undefined ? new Array() : conf;
    conf.id = conf.id == undefined ? 'yuiLoadingPanel':confi.id;
    conf.header = conf.header == undefined ? 'Loading, please wait...':conf.header;
    conf.width = conf.width == undefined ? '240px':conf.width;
    this.conf = conf;    
    this.init();
};

yuiLoadingPanel.prototype = {
    init:function(){
        var loadingPanel = new YAHOO.widget.Panel(this.conf.id,{
            width:this.conf.width,
            fixedcenter:true,
            close:false,
            draggable:false,
            modal:true,
            zIndex: 9999999,
            visible:false
        });
    
        loadingPanel.setBody('<img src="http://l.yimg.com/a/i/us/per/gr/gp/rel_interstitial_loading.gif" />');
        loadingPanel.render(document.body);
        //$D.addClass(loadingPanel.id, 'tcc_lightboxLoader');
        //loadingPanel.appendToBody(document.createElement('br'));
        //$D.setStyle(loadingPanel.body, 'text-align', 'center');
        $D.addClass(document.body, 'yui-skin-sam');
        this.loadingPanel = loadingPanel;
    },
    show:function(text){
        if(text != undefined){
            this.loadingPanel.setHeader(text);
        }else{
            this.loadingPanel.setHeader(this.conf.header);
        }
        this.loadingPanel.show();
    },
    hide:function(){
        this.loadingPanel.hide();
    }
};
var loadingPanel = new yuiLoadingPanel();

