
matchColumns=function(){ 

	var code = document.getElementById('navLinks').innerHTML;
	code = code + "<img src='http://www.american.edu/sis/images/50year2.gif' id='logo50' /></div>";
	document.getElementById('navLinks').innerHTML = code;	
	
     var divs,contDivs,maxHeight,divHeight,d; 
     // get all <div> elements in the document 
     divs=document.getElementsByTagName('div'); 
     contDivs=[]; 
     // initialize maximum height value 
     maxHeight=0; 
     // iterate over all <div> elements in the document 
     for(var i=0;i<divs.length;i++){ 
          // make collection with <div> elements with class attribute 'container' 
          if(/\bcolumn\b/.test(divs[i].className)){ 
                d=divs[i]; 
                contDivs[contDivs.length]=d; 
                // determine height for <div> element 
                if(d.offsetHeight){ 
                     divHeight=d.offsetHeight; 					
                } 

                else if(d.style.pixelHeight){ 
                     divHeight=d.style.pixelHeight;					 
                } 
                // calculate maximum height 
                maxHeight=Math.max(maxHeight,divHeight); 
          } 
     } 
     // assign maximum height value to all of container <div> elements 
     for(var i=0;i<contDivs.length;i++){ 
          contDivs[i].style.height=maxHeight + "px"; 
     } 
} 
// Runs the script when page loads 
window.onload=function(){ 
     if(document.getElementsByTagName){ 
          matchColumns();			 
     } 
} 

//Make new text window -- This function loads external links in new browser windows. The new window is 70% of the height and 85% of the width of the current window and should be centered. If the current window is not maximized or otherwise small, the new window will be even smaller.  Function checkWindowSize() gets dimensions of current window.


var newTextWindow
function makeNewTextWindow(url,hgt,wid){
	checkWindowSize();
	if (screen.availHeight){
	hgt = screen.availHeight * .7;
	wid = screen.availWidth * .85;
	}
	var right = screen.availWidth * .075;
	var down = screen.availHeight * .05;
	
	if (myWidth < wid){wid = myWidth * .8}
	if (myHeight < hgt){hgt = myHeight * .8}
	
	var parameters = "status,menubar,location,resizable,titlebar,toolbar,height=" + hgt + ",width=" + wid + ",left=" + right + ",top=" + down + ",scrollbars";
	if(!newTextWindow || newTextWindow.closed){
	newTextWindow = window.open(url,"",parameters)
	if (!newTextWindow.opener) {
	newTextWindow.opener = window;
	}
	} else {
	newTextWindow.location = url;
	newTextWindow.focus()
	}
}

var myWidth = 0, myHeight = 0;  // These will be current window's dimensions

//  This funcion gets the width and height of the current window. This information is then used so that the new window will not cover the current one.

function checkWindowSize() {
  //var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  //window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );
}

// End function to get size of current window

// This function checks to see if link is in second window. If it is, puts link in original window and closes open window

function closeOpenWindow(url){
	if (window.opener){
	window.opener.location = url;
	window.close();
	return false;
	} else {
	return true;
	}
}

var newMessageWindow;
function makeNewMessageWindow(wid,ht,msg,head){
	var winWid = parseInt(wid) + 40;
	var winHt = parseInt(ht) + 70;
	if(screen.availHeight < winHt + 100){
	winHt = screen.availHeight - 70}
	var features = "\"status,scrollbars,height=" + winHt + ",width=" + winWid + "\"";
	if(!newMessageWindow || newMessageWindow.closed){
	newMessageWindow = window.open("", "", features)
	if (!newMessageWindow.opener) {
	newMessageWindow.opener = window
	}
	var top = screen.availHeight/2 - winHt/2;
	var left = screen.availWidth/2 - winWid/2;
	newMessageWindow.moveTo(left,top);
	var winContent = "<html><head><title>More Information</title>";
	winContent += "<script language=javascript>function inMainWindow(page){window.opener.location = page\; window.close()}</script></head><body bgcolor='\#f5eed8'>";
	winContent += "";
	var heading = "More Information";
	if (head != null){heading = head}
	if (msg != null){
	winContent += "<h3 align='center'>" + heading + "</h3><p style='color: black; font-family: sans-serif; font-size: 10pt; margin-top: -.4em'>" + msg + "</p>";
	}
	
	winContent += "<p><form action='' name='but'><div align='center'><input type='button' value='Close this Window' name='btnCancel' onclick='window.close();'></form></div></p></body></html>";
	newMessageWindow.document.write(winContent);
	newMessageWindow.document.close();
	} else {
	newMessageWindow.focus()
	}
}
