function addLoadEvent(func) { // Manage Load Event
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            oldonload();
            func();
        }
    }
}

function addResizeEvent(func) { // Manage Resize Event
    var oldonresize = window.onresize;
    if (typeof window.onresize != 'function') {
        window.onresize = func;
    } else {
        window.onresize = function() {
            oldonresize();
            func();
        }
    }
}

try {
	document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}

function checkAll(checkname, exby) {
  for (i = 0; i < checkname.length; i++)
  checkname[i].checked = exby.checked? true:false
}

addDOMLoadEvent(function HideAllNotices() {
	//document.getElementById('infoLinkMenu1').style.display = 'none';
	Element.hide('infoLinkMenu1');
	Element.hide('infoLinkMenu2');
	Element.hide('infoLinkMenu3');
	Element.hide('infoLinkMenu4');
	Element.hide('infoLinkMenu5');
});


/** constructor 
   
       @param duration integer seconds
       @param <optional> function to run while waiting.
       
*/
   function Pause(duration, busy){
      this.duration= duration * 1000;
      this.busywork = null; // function to call while waiting.
      this.runner = 0;

      if (arguments.length == 2) {
         this.busywork = busy;
      }

      this.pause(this.duration);

   } // Pause class

   /** pause method 
   
       @param duration: integer in seconds
       
    */
    Pause.prototype.pause = function(duration){
      if ( (duration == null) || (duration < 0)) {return;}

      var later = (new Date()).getTime() + duration;

      while(true){
         if ((new Date()).getTime() > later) {
            break;
         }

         this.runner++;

         if (this.busywork != null) {
            this.busywork(this.runner);
         }

      } // while

   } // pause method