// ensures formatting is performed correctly

function matchColumns() {
     var divs, contDivs, maxHeight, divHeight, d; 
     divs = document.getElementsByTagName('div'); 
     contDivs = []; 
     maxHeight = 0; 
     for (var i=0; i < divs.length ; i++) { 
          if(/\bcolumn\b/.test(divs[i].className)){ 
                d=divs[i]; 
                contDivs[contDivs.length]=d; 
                if(d.offsetHeight){ 
                     divHeight=d.offsetHeight; 					
                } 
                else if(d.style.pixelHeight){ 
                     divHeight=d.style.pixelHeight;					 
                } 
                maxHeight=Math.max(maxHeight,divHeight);
          } 
     } 

     for(var i=0;i<contDivs.length;i++){ 
          contDivs[i].style.height=maxHeight + "px"; 
     } 
} 

// for the navigation bar

function navigationHighlight() {	
	setUpHighlight("about", "#CC9900", "#FFCC00");
	setUpHighlight("programs", "#CC6600", "#F49213");
	setUpHighlight("community", "#993300", "#C0730F");
	setUpHighlight("facilities", "#652201", "#993300");
}

function setUpHighlight(identifier, onColor, offColor) {
	var lk = document.getElementById("link_" + identifier);
	if (lk == null) return;
	var div = document.getElementById("menu_" + identifier);
	
	// closures to get events handled correctly
	lk.onmouseover = function(dvi, lki) {
						return function() { 
							dvi.style.backgroundColor = onColor; 
						}
					}(div,lk);
	lk.onmouseout = function(dvi, lki) {
						return function() { 
							dvi.style.backgroundColor = offColor; 
						}
					}(div,lk);	
	
}


window.onload=function(){ 
     if(document.getElementsByTagName){ 
          matchColumns();			 
     } 
	 navigationHighlight();

} 
