// ClassSite is used to store random functions that 
// are needed but not really part of any other class
var REQUIRE_ONCE = REQUIRE_ONCE || new Object(); 

var classSite = function(){
	this.popupWindows = new Array();
};

//addLoadEvent will take the incoming function and append
//it to the window.onload event handler. 
classSite.prototype.addLoadEvent = function( func ){
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

classSite.prototype.toString = function(){ return "class Site"; }


//Load a required JSFile ONCE
classSite.prototype.loadJSFile = function( fileName ){
	if ( fileName in REQUIRE_ONCE == false  ){
		document.write("<SCRIPT LANGUAGE='JavaScript' SRC='" + fileName +  "' TYPE='text/javascript'><\/SCRIPT>");
		REQUIRE_ONCE[fileName]++;
	}
}



classSite.prototype.popupWindow = function(WindowName, URL, Array_No, winStats){
    if (this.popupWindows[Array_No] != null && this.popupWindows[Array_No].open){
            this.popupWindows[Array_No].close();
    }

	//Assign the popup window to a handler.
   this.popupWindows[Array_No] = window.open(URL,WindowName,winStats);
}



var globalClass = new classSite();
//alert("test" + globalClass);

