

// Window Class

function BxWnd (sXML, sXSL)
{
    this._sXML = sXML ? sXML : aBxConfig['urlRoot'] + "Util/wnd/";   // xml url
    this._sXSL = sXSL;   // xsl url
    this._iWidth = 400; // window width
    this._iHeight = 400; // window height
}

BxWnd.prototype.show = function (title)
{
    if (!this._sXML) return false;
    if (!this._sXSL) return false;

	showScreen();

	var $this = this;

	var h = function (r)
	{		
        r = r.replace ('{title}', title);

		showHTML (r, $this.getWidth(), $this.getHeight());
		
		hideScreen();

        $this.onLoadComplete ();
	}

	new BxXslTransform (this._sXML, this._sXSL, h);

	return false;
}

BxWnd.prototype.setSize = function (iW, iH)
{
    this._iWidth = iW;
    this._iHeight = iH;
}

BxWnd.prototype.setWidth = function (i)
{
    this._iWidth = i;
}

BxWnd.prototype.getWidth = function ()
{
    return this._iWidth;
}

BxWnd.prototype.setHeight = function (i)
{
    this._iHeight = i;
}

BxWnd.prototype.getHeight = function ()
{
    return this._iHeight;
}


BxWnd.prototype.onLoadComplete = function ()
{
    return true;
}

// Message Box

BxWndMsgBox.prototype = BxWnd.prototype;

function BxWndMsgBox (title, text)
{   
    this._sXML = aBxConfig['urlRoot'] + "Util/wnd/" + text;   // xml url
    this._sXSL = aBxConfig['urlSystemXsl'] + "wnd.xsl";   // xsl url       
    this._iWidth = 300; // window width
    this._iHeight = 200; // window height

    this.show (title);   
}


