// JS for kontorkoncept.dk website, requires jQuery
// @author christian jul jensen, http://mocsystems.com
// @coauthor Søren Vedel, www.mocsystems.com


equalHeightCols = {
	selectors: '#menu, #leftcol-content, #rightcol-content',

	colHeight: null,
	minHeight: null,
	resize: function() {
	    equalHeightCols.minHeight = $(window).height() - $("#logorow").height() - $("#footerrow").height()-100;
	     //$("#contentrow").height()-115;
	    //alert($(window).height());
		$(equalHeightCols.selectors)
		.each(
			function(){
				equalHeightCols.colHeight = Math.max($(this).height(),equalHeightCols.colHeight);
			}
		).each(
			function(){
//				alert(equalHeightCols.colHeight +" :: "+equalHeightCols.minHeight);
				if(equalHeightCols.colHeight > equalHeightCols.minHeight) {
					$(this).height(equalHeightCols.colHeight);
				} else {
					$(this).height(equalHeightCols.minHeight);
				}
			}
		);
	}
}


doc = {
	load : function() {
		$(document).resize(doc.resize);
		window.onresize = doc.resize;
		doc.resize();
	},

	resize : function() {
		equalHeightCols.resize();
	}
}

$(doc.load);
