function layout() {
	c = document.getElementById('contentcontainer');
	l = document.getElementById('border-left');
	r = document.getElementById('border-right');
	// set the height
	if (c.offsetHeight > l.offsetHeight) {
		l.style.height = r.style.height = c.offsetHeight + 'px';
	} else {
		c.style.height = l.offsetHeight + 'px';
	}
	// correct the width
	if (window.innerWidth <= 832) {
		l.style.width = '14px';
	}
	if (window.innerWidth > 832) {
		l.style.width = '7%';
	}
}

window.addEvent('domready', function() {
	// thanks yuffster!
	$$("a[href^='http://']","a[href^='https://']").each(function(link) {
		url = link.getProperty('href');
		if(url.indexOf(document.location.host) >= 0)
			return;
		
		link.addEvent('click', function() {
			title = link.getProperty('title')
			if(title && title.indexOf('exits/')>=0) {
				desc = '/' + title.substring(title.indexOf('exits/'));
			} else {
				// strip out the http(s)://
				url = link.getProperty('href');
				desc = '/exits/' + url.substring(url.indexOf('//')+2);
			}
			urchinTracker(desc);
		});
	});
})

/* add on to mootools provided by digitarold 
 * http://dev.digitarald.de/form.html 
 * adds the setValue() function to select lists */
/**
 * Element - setValue / populate
 * 
 * @version		1.0rc1
 * 
 * @license		MIT-style license
 * @author		Harald Kirschner <mail [at] digitarald.de>
 * @copyright	Author
 */
Element.extend({

	setValue: function(val) {
		switch(this.getTag()){
			case 'select':
				this.selectedIndex = -1;
				if (!val) break;
				if ($type(val) != 'array') val = [val];
				$each(this.options, function(opt){
					opt.selected = val.test($pick(opt.value, opt.text));
				});
				break;
			case 'input':
				if (['checkbox', 'radio'].test(this.type)) {
					this.checked = ($type(val) == 'array') ? val.test(this.value) : (val == this.value);
					break;
				}
				if (!['hidden', 'text', 'password'].test(this.type)) break;
			case 'textarea': this.value = $type(val) ? val : '';
		}
	},

	populate: function(obj) {
		this.getFormElements().each(function(el){
			el.setValue(obj[el.name] || null);
		});
	}

});
