
var nHeight = getScreenHeight();
var nWidth = getScreenWidth();

function getScreenWidth() {
  return screen.width
}

function getScreenHeight() {
  return screen.height
}
function _dbDlg(msg, title, isModeless)
{
  if (title==null)
      title = "debugging message";
  if (msg==null)
		msg = "(no content)";
  _msgBox(escape(msg), 5, title, null, 800, 700, isModeless);

}

function _msgBox(msg, msgType, title, p, ww, hh, isModeless, details, x, y)
{
    var pp = this;
	if (p!=null)
		pp = p;

	
	
	if (msgType==null)
	{
		msgType = 1;
	}


	var args = new Array();
	args[0] = window;
	args[1] = title;
	args[2] = msg;
	args[3] = msgType;
    args[4] = details;
	var w = 90+msg.length*5;
	var h = 110;
	if (ww!=null)
		w = ww;
	if (hh!=null)
		h = hh;	
	var cord = _centerPopup(w, h);
    if (x!=null) {
      cord[0] = x;
    }

    if (y!=null) {
      cord[1] = y;
    }

	if (isModeless!=null && isModeless){
	  return pp.showModelessDialog("/RemoteScriptGuru/jsp/javascriptlab/common/msgBox.jsp?"+new Date().valueOf(),args,"dialogTop:"+cord[1]+"; dialogLeft:"+cord[0]+";dialogWidth:"+w+"px;dialogHeight:"+h+"px;status:0;toolbar:0;help:0;scroll:0;resizable:0");
	}else{
	  return pp.showModalDialog("/RemoteScriptGuru/jsp/javascriptlab/common/msgBox.jsp?"+new Date().valueOf(),args,"dialogTop:"+cord[1]+"; dialogLeft:"+cord[0]+";dialogWidth:"+w+"px;dialogHeight:"+h+"px;status:0;toolbar:0;help:0;scroll:0;resizable:0");
	}
}

function _centerPopup(w, h)
{
    var res = new Array();
	res[0] = (nWidth - w) / 2;
	res[1] = (nHeight - h) / 2;
	return res;
}
