var popup_window;

// write the status text (delayed, NS6 bugfixed)
function writeStatusText(status_text) {
  setTimeout("status=\"" + status_text + "\"",15); return true;
}

function openPopUp(_filename,_width,_height,_scroll,_resize) {  
  _status = false;
	window.opener = self;
  scrollbar = (_scroll)? ",scrollbars" : "";
  resizing = (_resize)? ",resizable" : "";
	status = (_status)? ",status=1" : "";
  if (popup_window != undefined)
    popup_window.close();
  popup_window = window.open(_filename,"_blank","width="+_width+",height="+_height+scrollbar+resizing+status);
  //if(popup_window)
  popup_window.focus();
}

function allowNumber(frmobj, e) { // return allowNumber(this, event)
  var key; var keychar;
  if (window.event)
    key = window.event.keyCode;
  else if (e)
    key = e.which;
  else
    return true;
  keychar = String.fromCharCode(key);
  // control keys
  if ((key==null) || (key==0) || (key==8) || (key==9))
    return true;
  // numbers
  else if (("0123456789").indexOf(keychar) > -1)
    return true;
  else
   return false;
}
