function SwapBackground () {
    
    //Get Heights of all three possible content sections
    var ContentHeight=divWhiteField.offsetHeight;
    //alert(ContentHeight);
	var NavHeight = tdFlowControl.offsetHeight;
	var RightSegmentHeight;
	var RightSegmentt = document.getElementById("RightSegment");
	if (RightSegmentt) {
	    RightSegmentHeight = RightSegmentt.offsetHeight;
	}
	else  {
	    RightSegmentHeight = 0;
	}
	
	// Figure out which one is biggest
	var GreaterHeight;
	if (ContentHeight > NavHeight) {
		GreaterHeight = ContentHeight;
		}
	else {
		GreaterHeight = NavHeight;
		}
	if (RightSegmentHeight > GreaterHeight) {
	    GreaterHeight = RightSegmentHeight;
	}
	
	//Add a buffer
	GreaterHeight += 40;
	
	//Round to the nearest 50
	var y=Math.round(GreaterHeight/50);
	var newHeight = (y+1) * 50;
	//alert(newHeight);
	
	//change background image as necessary
	var backDiv = document.getElementById("bgImage");
	backDiv.style.backgroundImage="url(images/Backgrounds/Background_" + newHeight + ".jpg)";
	
	//Adjust Background Height
	backDiv.style.height = newHeight+"px";
	
	//Position Bottom stuff appropriately
	//var bLinks = document.getElementById("lblBottomLinks");
	//bLinks.style.top = newHeight+80+"px";
	//var cRight = document.getElementById("lblCopyright")
	//cRight.style.top = newHeight + 95 + "px";
}

function SwitchPic_Down(whichButton) {
	var Button = document.getElementById(whichButton);
	Button.src="images/" + whichButton + "_On.jpg";
}

function SwitchPic_Up(whichButton) {
	//Don't proceed if submenu is open - must write
	var Button = document.getElementById(whichButton);
	Button.src="images/" + whichButton + "_Off.jpg";
}

function ClearTextbox (p) {
	var tBox=document.getElementById (p.id);
	tBox.value="";
}

function MakeGoVisible () {
	var button=document.getElementById ("DonateAndSubscribe1_btnGo");
	button.style.visibility = "visible";
}

var mnuSelected = '';
var subMnuSelected = '';

function showMenu(menu){
    //alert(document.getElementById("od").style.display);
    //document.getElementById("od").style.display="block";
	hideMenu(mnuSelected);
	document.getElementById(menu).style.visibility = 'visible';
	document.getElementById(menu).style.display="block";
	mnuSelected = menu;
}
function hideMenu(menu){
	if(mnuSelected!='')
		document.getElementById(menu).style.visibility = 'hidden';
}
function hideAllMenus() {
		document.getElementById("mnuProjects").style.visibility = 'hidden';
		document.getElementById("mnuAbout").style.visibility = 'hidden';
		if(document.getElementById("mnuResources")) {
		document.getElementById("mnuResources").style.visibility = 'hidden';}
		if(document.getElementById("mnuAssistance")) {
		document.getElementById("mnuAssistance").style.visibility = 'hidden';}
		        
}

