// called by body.onload
var pageSetup = function () {

	// set input focus to first element with class="focus"
	// IE < IE9 does not support this
	var focus = null;
	if(document.getElementsByClassName)
		focus = document.getElementsByClassName("focus");
	if(focus && focus.length > 0) focus[0].focus();
	
	if(bodyload)
		bodyload.eval();
};


var bodyload = 
{
	callbacks : [],
	// add new function to body.onload
	add : function(funcName, args) {
		this.callbacks.push({"func" : funcName, "args" : args});
	},
	eval: function() {
		for( var i = 0; i<this.callbacks.length; i++) {
			try {
				var cur = this.callbacks[i];
				var func = cur.func;
				var args = cur.args;
				//var evalStr = func+"("+args+");";
				func(args);
			}
			catch(e) {
				
			}
		}
	}
};
//bodyload.add("alert","'bodyload works!!'");
