// JavaScript Document

function bodyDivHeight() {
	
	/*This script gets the height of the main content div and the left hand div, and sets them both to the same length - whichever is longer.
	Also adds 20px to both so that the bottom of the body will have some space after the dotted line element.*/
	var divHeight=Math.max(
		document.getElementById("rightColumnDiv").offsetHeight,
		document.getElementById("rightColumnDiv").scrollHeight,
		document.getElementById("rightColumnDiv").clientHeight,
		document.getElementById("sectionLinksDiv").offsetHeight,
		document.getElementById("sectionLinksDiv").scrollHeight,
		document.getElementById("sectionLinksDiv").clientHeight
		);
	divHeight=divHeight+20+'px';
	document.getElementById("rightColumnDiv").style.height = divHeight;
	document.getElementById("sectionLinksDiv").style.height = divHeight;
}

/*Clears the Search TextBox on enter*/
function onSearch(id) {
	if (document.getElementById(id).value == "Search") {
		document.getElementById(id).value = "";
	}
}

/* Changes the Search TextBox to have the word "Search" if it is empty when it loses focus*/
function onLeaveSearch(id) {
	if (document.getElementById(id).value == "" || document.getElementById(id).value == null) {
		document.getElementById(id).value = "Search";
	}
}
		
