if(!document.getElementById){
  if(document.all)
  document.getElementById=function(){
    if(typeof document.all[arguments[0]]!="undefined")
    return document.all[arguments[0]]
    else
    return null
  }
  else if(document.layers)
  document.getElementById=function(){
    if(typeof document[arguments[0]]!="undefined")
    return document[arguments[0]]
    else
    return null
  }
}

function openWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function showDialog(myDialogURL,Width,Height) {
	var myDialogArgs;
	if (window.showModalDialog) {
		myDialogArgs = window.showModalDialog(myDialogURL,self,'dialogWidth:' + Width + 'px;dialogHeight:' + Height + 'px;help:no;resizable:no;status:no;center:yes');
	} else {
		myWin = window.open(myDialogURL,'modal','height=' + Height + ',width=' + Width + ',toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,modal=yes');
		scrnW = window.screen.width;
		scrnH = window.screen.height;
		myWin.moveTo(((scrnW / 2) - Width),((scrnH / 2) - Height));
	}
  return myDialogArgs;
}

function checkEnter(event)
{ 
	var theForm = document.forms.form;
	if (event.keyCode==13 && isWhitespace(theForm.SrchType.value))
		return false;
}

function checkSearch() {
	var actionError = "";
	var theForm = document.forms.form;
	if (!isWhitespace(theForm.SrchType.value))
		theForm.butFind.disabled = false
	else
		theForm.butFind.disabled = true;
}

function addOnloadEvent(fnc){
	/*
	USAGE:
	addOnloadEvent(myFunctionName);
	// Or to pass arguments
	addOnloadEvent(function(){ myFunctionName('myArgument') });
	*/

  if ( typeof window.addEventListener != "undefined" )
    window.addEventListener( "load", fnc, false );
  else if ( typeof window.attachEvent != "undefined" ) {
    window.attachEvent( "onload", fnc );
  }
  else {
    if ( window.onload != null ) {
      var oldOnload = window.onload;
      window.onload = function ( e ) {
        oldOnload( e );
        window[fnc]();
      };
    }
    else 
      window.onload = fnc;
  }
}