function MyAppAlert(objId, hideCloseIcon, hideMaximizeIcon, imagePath) {
	// 'title' and 'icon' are optional
	this.alertDialog = new jt_DialogBox(objId, true, hideCloseIcon, hideMaximizeIcon, imagePath);
	this.openDialog();
	}

MyAppAlert.prototype.noDialogBox = function() {
	if (!this.alertDialog.contentArea.jtClosed) {
		return true;
	}
	return false;
}


MyAppAlert.prototype.openDialog = function() {
	if (this.noDialogBox()) {
		this.alertDialog.paintDialogBox();
	}
	this.alertDialog.show();
    var w = this.alertDialog.container.getAttribute('widthAttribute');
	if(w) this.alertDialog.setWidth(w);
    var h = this.alertDialog.container.getAttribute('heightAttribute');
	if(h) this.alertDialog.setHeight(h);
	this.alertDialog.fixTitleHeight();
	this.alertDialog.moveTo(-1, -1);
	WindowScrollDialogBox.init(this.alertDialog);
}

MyAppAlert.closeDialog = function(dialogId) {
  WindowScrollDialogBox.stop();
  var dialog = document.getElementById(dialogId);
  if (!dialog.veil) {
	  jt_BodyZ.init();
	  jt_Veil.deleteVeil(dialog.id);
  } else {
	  dialog.dialogBox.hide();
  }
}

var WindowScrollDialogBox = {
		obj : null,
		init : function(o) {
			WindowScrollDialogBox.obj = o;
			window.onscroll = function () {
				WindowScrollDialogBox.scroll();
			};
		},
		scroll: function () {
			WindowScrollDialogBox.obj.moveTo(-1, -1);
		},
		stop: function(oId) {
			var obj = WindowScrollDialogBox.obj;
			if (obj != null && obj.dialogId == oId) {
				obj = null;
			}
			if (obj == null) {
				window.onscroll = null;	
			}
		}
}

	
	

