Tx = {};

Tx.LightBox = function() {
	
}

Tx.LightBox._instance = null;

Tx.LightBox.getInstance = function() {
	if (Tx.LightBox._instance == null) {
		Tx.LightBox._instance = new Tx.LightBox();
	}
	return Tx.LightBox._instance;
}

Tx.LightBox.prototype.getEl = function() {
	return _e('lightBox');
}
Tx.LightBox.prototype.getElBg = function() {
	return _e('lightBoxBg');
}
Tx.LightBox.prototype.getElMain = function() {
	return _e('lightBoxMain');
}
Tx.LightBox.prototype.getElTitle = function() {
	return _e('lightBoxTitle');
}

Tx.LightBox.prototype.open = function(html, title) {
	if (YAHOO.lang.isString(html)) {
		this.setContentHtml(html);
	}
	if (YAHOO.lang.isString(title)) {
		this.setContentTitle(title);
	}	
	var reg = Trb.Util.getRegion(this.getElBg());	
    this.getElBg().style.display = 'block';
    this.getElBg().style.height = YAHOO.util.Dom.getDocumentHeight() + "px";
    this.getElBg().style.width = (YAHOO.util.Dom.getDocumentWidth()) + "px";
    this.getElBg().style.top = '0px';	
    this.getElBg().style.left = '0px';
    
    this.getEl().style.display = 'block';	
	Trb.Util.centre(this.getEl());
	if (parseInt(this.getEl().style.top) < 0) {
		this.getEl().style.top = '0px';
	}
	return false;
}

Tx.LightBox.prototype.close = function() {
	this.getElBg().style.display = 'none';
	this.getEl().style.display = 'none';
	return false;
}

Tx.LightBox.prototype.setContentHtml = function(html) {
	this.getElMain().innerHTML = html;
	return false;
}
Tx.LightBox.prototype.setContentTitle = function(title) {
	this.getElTitle().innerHTML = title;
	return false;
}