function expandFirst() {
	document.getElementById(expandFirst.arguments[0]).style.display = "block";
	for (var i=1; i<expandFirst.arguments.length; i++) {
		document.getElementById(expandFirst.arguments[i]).style.display = "none";
	}
}

function expandCollapse() {
	for (var i=0; i<expandCollapse.arguments.length; i++) {
		var element = document.getElementById(expandCollapse.arguments[i]);
		element.style.display = (element.style.display == "none") ? "block" : "none";
	}
}

function mailpage(pageName, pageURL){
	mail_str = "mailto:?subject=Page to check out ";
	mail_str += "&body=I thought you might be interested in this page.";
	mail_str += ". You can view it at, " + escape(location.href);
	location.href = mail_str;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function doDaMenu() {
//new code Mar 2010 to handle IE bugs
	//determine the name of the page
	var thisPage = window.location.href;
	//check to see if it ends in a '/', if so then we are at the site's url - eg www.sitedomain.com/
	if(thisPage.substring(thisPage.length-1, thisPage.length) == '/'){
		var pageName = 'index';
	}else{
		//if not, then we are at a URL that ends in the page name and so we need to isolate that and check it against the nav bar to highlight the right button
		//split up the URL
		var splitArray = thisPage.split('.');
		//we can assume that the page name is the second to last bit of the array
		var halfwayThere = splitArray[splitArray.length - 2];
		//should the page be in a directory (e.g www.domain.com/directory/page.php), we need to drop off all the slash stuff
		//GABB - NEED TO TEST THIS OUTSIDE TEST ONCE IT IS UP AND RUNNING
		var pageSplit = halfwayThere.split('/');
		var pageName = pageSplit[pageSplit.length - 1];
		if(navigator.appName == "Microsoft Internet Explorer"){
			var el = document.getElementById("textLinkListNavWrap");
			var gDivList = el.getElementsByTagName('li');
			for(i=0;i<gDivList.length;i++){
				for ( var i in el.getElementsByTagName('li') ){
						if(i == pageName){
							gDivList[i].className = "active";
							break;
						}
				}
			}
		}else{
			var theMenuItems = document.getElementsByName('menuItem');
			//determine how many div's to look at
			for(i=0;i<theMenuItems.length;i++){
				if(theMenuItems[i].id == pageName){
				theMenuItems[i].className = "active";
				break;
			}
			}
		}
	}
}
