$D = YAHOO.util.Dom;
$E = YAHOO.util.Event;
var yuiLoadingPanel = function(conf){
    conf = conf == null ? new Array() : conf;
    conf.id = conf.id == null ? 'yuiLoadingPanel':conf.id;
    conf.header = conf.header == null ? 'Loading...':conf.header;
    conf.width = conf.width == null ? '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,
            visible:false
        });
    
       loadingPanel.setBody(this.conf.header + 
               '<img src="http://us.i1.yimg.com/us.yimg.com/i/us/per/gr/gp/rel_interstitial_loading.gif" />');
               loadingPanel.render(document.body);
               $D.addClass(loadingPanel.id, 'tcc_lightboxLoader');
               $D.setStyle(loadingPanel.body, 'text-align', 'center');
			   $D.setStyle(loadingPanel.body, 'font-family', 'Arial, Helvetica, sans-serif');
			   $D.setStyle(loadingPanel.body, 'font-size', '10px');
			   $D.setStyle(loadingPanel.body, 'font-weight', 'bold');
               $D.addClass(document.body, 'yui-skin-sam');
        this.loadingPanel = loadingPanel;
    },
    show:function(text){
        if(text != null){
            this.loadingPanel.setBody(text + 
               '<img src="http://us.i1.yimg.com/us.yimg.com/i/us/per/gr/gp/rel_interstitial_loading.gif" />');
               this.loadingPanel.render(document.body);
               //this.loadingPanel.setHeader(text);
        }else{
	    this.loadingPanel.setHeader(this.conf.header);
	}
	this.loadingPanel.show();
    },
    hide:function(){
        this.loadingPanel.hide();
    }
};