$(function(){
	
	
	
	// ========== START OF NAV
	//for every nav sub section
	$('.nav-sub div').each(function(){
		//copy the anchor that is inside the div and append it above (this is a hack for the hover to work, we need the element in place above the hover and inside the hover, but only want it in the html once)
		$(this).children('a').clone().prependTo( $(this).parent() );
		
		//show the code (if not shown, all height and width values are 0)
		$('#nav-upper .nav-sub div').show();
		
		//the std height for 1 line in the nav, 14px
		var normalHeight = 14;
		
		//for every <li> inside the sub section
		$(this).children('ul').children('li').each(function(){
			
			//if theres more than 1 line (if height is greater than the std height)
			if($(this).height() > normalHeight){
				
				//calculate what the width of this container SHOULD be
				var theDivide = $(this).height() / normalHeight;
				var avgWidth = 7 * ( $(this).width() / 10 );
				var width = theDivide * avgWidth;
								
				//make the height of this box normal height
				$(this).height(normalHeight);
				
				//make the width of the li the new width so box grows
				$(this).width(width);
			}	
					
		});
		// hide the code so it only appears on hover
		$('#nav-upper .nav-sub div').hide();	
	});
	// ========== END OF NAV
	
	
	
	
	
	
});

$(window).load(function() {
    // ========== START OF COLUMN EQUALIZER
	$('.content aside, .content article').equalHeightColumns();	
});
