/*
	Javascript
*/
window.addEvent('domready', addCheckFunction);

function checkOrUnCheck() {
	var input = this.get('rel') == 'forward' ? this.getNext('input') : this.getPrevious('input');
	if (!input.get('disabled')) {
		if (input.get('checked')) {
			if (input.get('type') != 'radio') 
				input.removeProperty('checked');
		}
		else {
			input.set('checked', 'checked');
		}
		input.fireEvent('click');
	}
}


function addCheckFunction() {
	$$('.check').each(function(el){
		el.addEvent('click', checkOrUnCheck);
	});
}
