var initialize = new initializer();
window.onload = initialize.execute;

function initializer() {
	var parent = this;
	this.functions = new Array();
	
	this.extend = function(addFunction) {
		parent.functions.push(addFunction);
	}

	this.execute = function() {
		for (var i=0; i<parent.functions.length; i++) {
			if (typeof(parent.functions[i]) == 'function') {
				parent.functions[i]();
			}
		}
	}
}

String.prototype.jsDefine = function(jsAction, functionCode) {
	if (document.getElementById(this)) {
		if (typeof(functionCode) == 'function') {
			eval ('document.getElementById(this).' + jsAction.toLowerCase() + ' = functionCode');
		} else if (typeof(functionCode) == 'string') {
			eval ('document.getElementById(this).' + jsAction.toLowerCase() + ' = function(){' + functionCode + '}');
		} else {
			alert('Error [jsDefine()]: Please pass a function or a string.');
		}
	}
}