function DHTMLPopup(width, height, containerID) {
	this._width = width;
	this._height = height;
    this._containerID = containerID;
}
// TODO if 4 parameter in constructor will be true, than set autoheight
DHTMLPopup.prototype._width = 0;

DHTMLPopup.prototype._height = 0;

DHTMLPopup.prototype._containerID = 0;

DHTMLPopup.prototype._content = '';

DHTMLPopup.prototype._left = function() {
    var clW = document.compatMode == 'CSS1Compat' && !window.opera ? document.documentElement.clientWidth : document.body.clientWidth;
    return clW/2 - (this._width/2) + 'px';
}

DHTMLPopup.prototype._scrollTop = function() {
    return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
}

DHTMLPopup.prototype._top = function() {
    var clH = document.compatMode == 'CSS1Compat' && !window.opera ? document.documentElement.clientHeight : document.body.clientHeight;
    return this._scrollTop() + clH/2 - (this._height/2) + 'px';
}

DHTMLPopup.prototype.setContent = function(content) {
    this._content = content;
}

DHTMLPopup.prototype.show = function() {
    var html =
        '<div id="dhtmlpopup">' +
        '   <div id="dhtmlpopup-content">' + this._content + '</div>' +
        '   <div id="dhtmlpopup-overlay">' +
        '</div>';

    document.getElementById(this._containerID).innerHTML = html;
    document.getElementById('dhtmlpopup-overlay').style.height = document.body.scrollHeight + 'px';
    var popup = document.getElementById('dhtmlpopup-content');
    popup.style.left = this._left();
    popup.style.top = this._top(); 
    popup.style.width = this._width + 'px';
    popup.style.height = this._height + 'px';
}