document.onmouseover = function ( e ) {
  if ( !e ) e = window.event;
  var el = e.target ? e.target : e.srcElement;
  while ( el != null && el.tagName != "A" )
    el = el.parentNode;
    if ( el == null )
      return;
    if ( e.preventDefault )
      e.preventDefault();
    else
      e.returnValue = true;
};

var w = 480, h = 340;
if (document.all || document.layers) {
   w = screen.availWidth;
   h = screen.availHeight;
}
var popW = 400, popH = 50;
var leftPos = (w-popW)/2, topPos = ((h-popH)/2)-80;
function show_popup(message) {
  var oPopup = window.createPopup();
  var oPopupBody = oPopup.document.body;
  oPopupBody.style.backgroundColor = "lightyellow";
  oPopupBody.style.border = "solid black 1px";
  oPopupBody.style.fontFamily = "Arial AM";
  oPopupBody.innerHTML = message;
  oPopup.show(leftPos, topPos, popW, popH, document.body);
}

function go(objForm,pageName) {
  objForm.action.value=pageName;
  if(objForm.onsubmit && !objForm.onsubmit()) return;
    objForm.submit();
  return true;
}

var alertWidth = 400, alertHeight = 40;
if (appNam.indexOf("Explorer") < 0) {
  w = screen.width;
  h = screen.height;
}
var alertLeftPos = (w-alertWidth)/2, alertTopPos = ((h-alertHeight)/2);
alertWin=null;
checkedFields = new Array;
checkedFieldsLength = 0;
function showMessage(text, fieldObject) {
  if(!alertWin) {
    alertWin = window.open('validationAlert.jsp?text='+text, null, 'status=no,resizable=no,scrollbars=no,toolbar=no,menubar=no,left='+alertLeftPos+',top='+alertTopPos+',width='+alertWidth+',height='+alertHeight);
  }
  else{
    alertWin.close();
    alertWin=null;
    alertWin = window.open('validationAlert.jsp?text='+text, null, 'status=no,resizable=no,scrollbars=no,toolbar=no,menubar=no,left='+alertLeftPos+',top='+alertTopPos+',width='+alertWidth+',height='+alertHeight);
  }
  for (kk = 0; kk < checkedFieldsLength; kk++) {
    if (checkedFields[kk] && checkedFields[kk].style) {
    	checkedFields[kk].style.backgroundColor = "#FFFFFF";
    }
  }
  if (fieldObject) {
  	fieldObject.style.backgroundColor = "#FACCCC";
  	checkedFields[checkedFieldsLength] = fieldObject;
  	checkedFieldsLength = checkedFields.length + 1;
  }
}
function showConfirm(text, evalString) {
  if(!alertWin) {
    alertWin = window.open('validationAlert.jsp?type=2&text='+text+"&evalString="+evalString, null, 'status=no,resizable=no,scrollbars=no,toolbar=no,menubar=no,left='+alertLeftPos+',top='+alertTopPos+',width='+alertWidth+',height='+alertHeight);
  }
  else{
    alertWin.close();
    alertWin=null;
    alertWin = window.open('validationAlert.jsp?type=2&text='+text+"&evalString="+evalString, null, 'status=no,resizable=no,scrollbars=no,toolbar=no,menubar=no,left='+alertLeftPos+',top='+alertTopPos+',width='+alertWidth+',height='+alertHeight);
  }
}
function non(){
  if(alertWin) {
    alertWin.close();
    alertWin=null;
  }
  else {
    alertWin=null;
  }
}
