// JavaScript Document control the height of the rows for kelly container inner pages

function heightAdjust(){
	
	//establish initial variables
	var spHeight = document.getElementById('specials').offsetHeight;
	var mainHeight = document.getElementById('intro').offsetHeight; 
	var maxHeight;
	var mainImgHeight = 225;
	var listHeight = document.getElementById('vertnav').offsetHeight; 
	
	//determine the height of the intro plus the main image
	var mainArea = mainHeight + mainImgHeight;
	var navArea = spHeight + listHeight
	
	//determine the tallest area between the nav area and the main area
	if(navArea > mainArea){
		
		maxHeight = navArea;
		
	}else{
		
		maxHeight = mainArea;
		
	}
	
	//resize the divs accordingly
	document.getElementById('specials').style.height = (maxHeight - listHeight)+'px';
	document.getElementById('intro').style.height = (maxHeight - 225)+'px';
	
}

window.onload = function(){
	heightAdjust();
}