// Create an array to hold all references to scripts we need to load.

var __onloads = new Array();
var __resets = new Array();

// General function to load all scripts defined in the array.

function initialize(){
	for(var i = 0; i < __onloads.length; i++){
		__onloads[i]();
		}
	}

// Call the initializer when the page finished loading.

window.onload = function(){ initialize(); }

// Function to add function references to the onload array.
//
// Usage: set_onload(functionname);

function set_onload(str_function){
	__onloads[__onloads.length] = str_function;
	}

// Function to add function references to the reset array.
// To be used to restore default values on form reset buttons.
//
// Usage: set_onreset(functionname);

function set_onreset(str_function){
	__resets[__resets.length] = str_function;
	}

// Function to invoke the registered resets.
// To be executed from a form reset button.
//
// Usage: <input type="reset" onclick="formreset();"..../>

function formreset(){
	for(var i = 0; i < __resets.length; i++){
		__resets[i]();
		}
	}

