$(document).ready(function(){

	// set heights of right bar even with left.
	if ($("#primarycontent").height() > $("#secondarycontent").height()) {
		if ($("#primarycontent").height() < 1000) { // don't shrink the secondary content below 1000px
			$("#secondarycontent").css("height",1000);
		} else {
			$("#secondarycontent").css("height",$("#primarycontent").height());
		}
	} else{ 
		// alert("do nothing, primary content height = " + $("#primarycontent").height());
	}
	// hack to set the proper page height if the google map is loaded into the page. wait 3 seconds and try again.
	if ($("#body_content.about #mapbuffer").length) {
		setTimeout("tryAgain()",1000);
	}
});

function tryAgain() {
	// add the height of the map which loads more slowly since it's not part of the dom when ready is called.
	// set heights of right bar even with left.
	// don't shrink the right bar to less than 1000px or it bleeds into footer
	if ($("#primarycontent").height() + $("#body_content.about #mapbuffer").height() < 1000) {
		$("#secondarycontent").css("height",1000);
	} else {
		$("#secondarycontent").css("height",$("#primarycontent").height() + $("#body_content.about #mapbuffer").height());
	}
}

// function to delay retry
function tryAgainDelayed() {
	setTimeout("tryAgain()", 2000);
}