// JavaScript Document
var d = document;
// sets of columns to balance
// note: I don't know that it makes a diff, but it
// seems safest to balance the sets from innermost
// to outermost...
var columnSets = new Array(
	// new Array( "column1", "column2" ),
	new Array( "c1", "c2", "c3" )			 
);
function setHeight() {
	// loop over the array of column sets to balance
	for( i=0; i<columnSets.length; i++ ){
		// get the heights
		var box =  columnSets[i];
		var h = 0;
		for(x=0;x<box.length;x++){
			if( d.getElementById(box[x]) ){
				div = d.getElementById(box[x]);
				// unset height and scrollHeight
				div.style.height = "auto";
				div.style.scrollHeight = "auto";
				// determine the tallest div
				test_h = div.offsetHeight;
				//alert( box[x] + ": " + test_h );
				if( test_h > h ){
					h = test_h;
				}
			}
		}
		// set the height of all divs to the tallest
		for(x=0;x<box.length;x++){
			if( d.getElementById(box[x]) ){
				div = d.getElementById(box[x]);
				div.style.height = h +"px"; 
				div.style.scrollHeight = h +"px";
			}
		}		
	} // end loop over columnSets
	// zero the margins and padding on the footer
	/* d.getElementById("footer").style.margin = "0";
	d.getElementById("footer").style.padding = "0"; */
}

window.onload = function() {
	setHeight();
}

window.onresize = function() {
  setHeight();
}


// Note that this popup leaves the user's toolbar. THIS IS DELIBERATE AND SHOULD NOT BE CHANGED - kb */
function popWin(popLink,args) {
	var pleft,ptop,pwidth,pheight;
	// gets tossed later if args is defined
	if (screen.availHeight && screen.availWidth) {
		pwidth = Math.max(600,Math.min(800,screen.availWidth/2));
		pheight = Math.max(400,Math.min(600,screen.availHeight/2));
		pleft = (screen.availWidth/2)-(pwidth/2);
		ptop = (screen.availHeight/2)-(pheight/2);
	} else {
		pwidth = 600;
		pheight = 400;
		pleft = 10;
		ptop = 10;
	}
	var wArgs = args != null ? args:"width="+pwidth+",height="+pheight+",status,resizable,scrollbars,top="+ptop+",left="+pleft;
	var targ = popLink.target != '' ? popLink.target : '_blank';
	var newWin = window.open(popLink.href,targ,wArgs);
	newWin.focus();
	return false;
}