function alertMsg(box, message, title)
{
    $(box).modal({
		close:false,
		position: ["20%",],
		overlayId:'alertModalOverlay',
		containerId:'alertModalContainer',
		onShow: function (dialog) {
			dialog.data.find('.message').append(message);
			if(title != null)
			    dialog.data.find('.title').append(title);
		}
	});
}

// Fixes ASP.NET's behavior of default button by testing for more controls
// than just textarea where the event should not be caugt by the DefaultButton
// action. This method has to override ASP.NET's WebForm_FireDefaultButton, so
// it has to included at the bottom of the page.
function WebForm_FireDefaultButton(event, target) {
  if (event.keyCode == 13) {
    var src = event.srcElement || event.target;
    if (!(
      src
      &&
      (
        src.tagName.toLowerCase() == "textarea"
        || src.tagName.toLowerCase() == "a"
        ||
        (
          src.tagName.toLowerCase() == "input"
          &&
          (
            src.getAttribute("type").toLowerCase() == "submit"
            || src.getAttribute("type").toLowerCase() == "button"
            || src.getAttribute("type").toLowerCase() == "reset"
          )
        )
        || src.tagName.toLowerCase() == "option"
        || src.tagName.toLowerCase() == "select"
      ) 
    )) {
      var defaultButton;
      if (__nonMSDOMBrowser) {
        defaultButton = document.getElementById(target);
      }
      else {
        defaultButton = document.all[target];
      }
      if (defaultButton && typeof (defaultButton.click) != "undefined") {
        defaultButton.click();
        event.cancelBubble = true;
        if (event.stopPropagation) event.stopPropagation();
        return false;
      }
    }
  }
  return true;
}

