function setHeight(home) {
  if (parent == window) {
	//location.href='http://www.ncc.commnet.edu/default.asp';
	location.href='http://www.ncc.commnet.edu/default.asp?page=' + location.pathname;  
    }else{ 
        if(!document.all)
            parent.document.getElementById('page').style.height = 'auto'; //need to reset height for new doc in non-IE
        var contentHeight = document.getElementById('content').scrollHeight; //the height of the iframe content div
        var navHeight = document.getElementById('nav').scrollHeight;
        var photoHeight = document.getElementById('photo').scrollHeight;
        var newHeight = 0;
        if(home)
            newHeight = max(max(contentHeight,navHeight),photoHeight) -3; // take the largest value, add 110 to compensate for top
        else
            newHeight = max(max(contentHeight,navHeight),photoHeight) + 75;
        parent.document.getElementById('page').style.height = newHeight;
    }
}

function position(){
	var aWidth;
	if(document.all)
		aWidth = document.body.clientWidth;
	else
		aWidth = innerWidth;
	if(aWidth > 800)
		document.getElementById('container').style.left = (aWidth-760)/2;
	else
		document.getElementById('container').style.left = 0;

	document.getElementById('container').style.visibility = 'visible';
}

function max(num1, num2){
    if(num1 > num2)
        return num1;
    return num2;
}
function writePageTitle(){
    //write the strip
    var numImages = 14;
    var imageNum = Math.round(Math.random()*(numImages-1));
    document.getElementById('pageStrip').innerHTML = '<img src="http://www.ncc.commnet.edu/images/strip' + imageNum + '.jpg">';
    //write the title
    var nodes = document.getElementsByTagName('title');
    document.getElementById('pageTitle').innerHTML = nodes[0].text;
}


