$(document).ready(function(){
	$('#'+ activeNav).addClass('active').parents().show();
	$('#'+ activeNav).addClass('active').next().show();
	$('#leftNavUl li ul li ul li#'+ activeNav +'.active').children().show();
	
	$('#leftNav ul li ul li.active').parent().parent().parent().parent().addClass('activeParent');
	
	$('#leftNav li h4, #leftNav li h5, #leftNav li h6').click(function(){ $(this).next().toggle(0,function(){ alignColumns()}) });
	$('#leftNav li h4 a, #leftNav li h5 a, #leftNav li h6 a').parent().unbind('click');
	//$('#leftNav li h4, #leftNav li h5, #leftNav li h6').mouseover(function(){ $(this).next().addClass('mouseover').show(); });
	
	$('div.artwork').addClass('clearfix');
	$('div.artwork img, img.artwork').click(function(){ $(this).toggleClass('beeldGroot', 500); });
	if($.browser.name == 'msie' && $.browser.version < 7) alignColumns();
});

//window.onload = function(){ setTimeout('alignColumns()',1000) };

function alignColumns(){
	var leftNavUlHeight = $('#leftNavUl').height();
	var leftNavHeight = $('#leftNav').height();
	var contentHeight = $('#content').height();
	
	if($.browser.name == 'msie' && $.browser.version < 8 && $.browser.version > 6.1){
		if(leftNavUlHeight > 610){
			if(contentHeight < (leftNavUlHeight + 100)) {
				$('#leftNav').height(leftNavUlHeight + 99);
				$('#content').height(leftNavUlHeight - 110);
				$('#rightNav').height(leftNavUlHeight - 45);
			}
		}
		else {
			if(leftNavUlHeight > leftNavHeight){
				$('#leftNav').height(709);
				$('#content').height(500);
				$('#rightNav').height(565);
			}
			else {
				$('#leftNav').height($('#content').height() + 209);
				$('#rightNav').height($('#content').height() + 65);
			}
		}
	}
	else if($.browser.name == 'msie' && $.browser.version < 7){
		var heights = new Array(leftNavUlHeight, leftNavHeight, contentHeight)
		var heightest = 610;
		$(heights).each(function(){ if(this > heightest) heightest = this })
		//alert(heightest +'  '+ leftNavUlHeight +'  '+ leftNavHeight +'  '+ contentHeight);
		if(heightest == contentHeight){
			$('#leftNav').height(heightest + 210);
			$('#rightNav').height(heightest + 65);
		}
		else {
			$('#leftNav').height(heightest);
			$('#content').height(heightest - 210);
			$('#rightNav').height(heightest - 145);
		}
	}
	else {
		if(leftNavUlHeight > 610){
			if(contentHeight < (leftNavUlHeight + 100)) $('#content, #leftNav').height(leftNavUlHeight + 100);
			else $('#leftNav').height(contentHeight);
		}
		else { $('#leftNav, #content, #rightNav').height('100%'); }
	}
}