/**
 * ---------------------------
 * Client: Anti-Kraak
 * URL: http://www.anti-kraak.nl
 * Author: Harmen Janssen, Dutch Internet Works
 *
 * ---------------------------
 */

/**
 * General namespace
 */
var anti_kraak = {
	/**
	 * Initialize all objects
	 */
	init: function () {
		for (var i in this) {
			if (typeof this[i].init == 'function') {
				this[i].init ();
			}
		}
	},
	roundify: {
		init: function () {
			// add collections of elements that need rounded corners here
			var targets = [];
			var mainnav = $('main-navigation');
			if (mainnav) {
				targets.push ([$('main-navigation')]);
				targets.push ($('main-navigation').$$('a'));
			}
			targets.push ([$('aside')]);
			for (var i=0,tl=targets.length; i<tl; i++) {
				for (var j=0,til=targets[i].length; j<til; j++) {
					if (!targets[i][j]) {
						continue;
					}
					for (var k=0,classes=['tl','tr','bl','br'],cl=classes.length;k<cl;k++) {
						var b = document.createElement ('b');
						b.className = classes[k];
						targets[i][j].appendChild (b);
					}
				}
			}
		}
	}
};

/**
 * Initialize general namespace
 */
anti_kraak.init ();