var Behaviour = {
	register: function(rules) {
		this.rules = rules;
		for (rule in this.rules) {
			this.reload(rule);
		}
	},

	reload: function(rule) {
		elements = $$(rule);
		for (y = 0; y < elements.length; y++) {
			this.rules[rule](elements[y]);
		}
	}
};

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}
