function CornersInit() {
	var corners = getElementsByClass('corners');
	for (i = 0; i < corners.length; i++) {
		corners[i].innerHTML += '<em class="tl"></em><em class="tr"></em><em class="bl"></em><em class="br"></em>';
	}
}

function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )	node = document;
	if ( tag == null ) tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if (pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}

function equalHeight(group) {
	var tallest = 0;
	group.each(function() {
		var thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}

function resizeColumns(){

	containers = $(".container");

	$(window).bind('resize', function(){
		containers.each( function(){

			// Set content column width
			var columns = $(this).children();
			column1 = columns.eq(1);
			column1.width($(this).width() - columns.eq(0).outerWidth(true) - column1.outerWidth(true) + column1.width());
		});

		// Set body columns height
		var tallest = 0;
		columns = $(containers.filter(".body")).children();
		columns.height('auto').each(function(iColumn, domColumn){
			tallest = Math.max(tallest, $(this).outerHeight(true));
		}).height(tallest);

	}).trigger('resize');
};

