
function ourWindowWidth(){
  if (window.innerWidth){
    return (window.innerWidth);             // Mozilla
  }

  if (document.documentElement.clientWidth)
    return document.documentElement.clientWidth;    // IE6

  if (document.body.clientWidth)
    return document.body.clientWidth;               // IE DHTML-compliant any other
}

function ourWindowHeight(){
  if (window.innerHeight){
    return (window.innerHeight);        // Mozilla
  }

  if (document.documentElement.clientHeight)
    return document.documentElement.clientHeight;    // IE6

  if (document.body.clientHeight)
    return document.body.clientHeight;               // IE DHTML-compliant any other
}


function playSound(theSound) {
  var thissound = eval("document."+theSound);
  thissound.Play();
}


function preInit(func) {
  // This gloriousness is required for Firefox, which bombs if you try to access any DOM objects that haven't loaded.
  // Oh yeah, and Firefox takes its sweet-a$$ time loading the DOM tree also.  You will never appreciate how long it
  // took me to figure this out.  (You're welcome.)  JBA

  this.func = func;   // set local static var to the passed func the first call

  var domReady = ( typeof document.getElementsByTagName != 'undefined' && 
                   (document.getElementsByTagName('body')[0] != null || document.body != null)
                   //>>> && document.getElementById('something') != null
                 );

  if ( domReady ) {
    this.func();
  }
  else {
    // DOM is not loaded yet.  Try again in half a second:
    setTimeout('preInit()', 500);
  }
}

