/*
 * automatically aligns onclick of parent element with the href of its one containing anchor 
*/

mcd.dom.ready(function(){
	var boxes = mcd.dom.getElementsByAttribute('class', 'box', document.body, '*', true);
	
	for (var i = 0; i < boxes.length; i++) {
		mcd.dom.addClass(boxes[i], 'active_box');
		mcd.event.add(boxes[i], "click", function (event) {
			var anchor = this.getElementsByTagName('a')[0];
			
			if (anchor) {
				window.location.href = anchor.href;
			}
		});
	}
});
