function showhide(id) {
	var navLink = id+"-link";
	if (document.getElementById(id).style.display == "none") {
	  document.getElementById(id).style.display = "block";
	  document.getElementById(navLink).style.background = 'url(/img/collapse.gif) no-repeat 4px 7px';
	} else {
	  document.getElementById(id).style.display = "none";
	  document.getElementById(navLink).style.background = 'url(/img/expand.gif) no-repeat 5px 8px';
	}
}



function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}



function show_arrow(id) { 
document.getElementById(id).style.visibility = "visible";
document.getElementById(id).style.display = "block";
}

function hide_arrow(id) { 
document.getElementById(id).style.visibility = "hidden";
}

function show_text(id) { 
document.getElementById(id).style.visibility = "visible";
document.getElementById(id).style.display = "block";
}

function hide_text(id) { 
document.getElementById(id).style.visibility = "hidden";
document.getElementById(id).style.display = "none";
}

function swapImage(name) {
document.images[name].src = "images/" + name + "_f2.gif";
}
function swapImageback(name) {
document.images[name].src = "images/" + name + ".gif";;
}

var collimg = new Image();
collimg.src = "/images/collapse.gif";
var expimg = new Image();
collimg.src = "/images/expand.gif";

function ShowHideLayer(boxID) {
	/* Obtain reference for the selected boxID layer and its button */
	var box = document.getElementById("box"+boxID);
	var boxbtn = document.getElementById("btn"+boxID);
	
	/* If the selected box is currently invisible, show it */
	if(box.style.display == "none" || box.style.display=="") {
		box.style.display = "block";
 		boxbtn.src = "/img/collapse.gif";
	}
	/* otherwise hide it */
	else {
		box.style.display = "none";
		boxbtn.src = "/img/expand.gif";
	}
}


function formValidator(){
	// Make quick references to our fields
	var email = document.getElementById('email');
	
	// Check each input in the order that it appears in the form!

						if(emailValidator(email, "Please enter a valid email address")){
							return true;
						}
	
	return false;
	
}



function emailValidator() {
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	errorMessage += 'You must supply an email address<br>';
	if(document.getElementById('email').value.match(emailExp)){
		return true;
	} else {
		document.getElementById('message').innerHTML = errorMessage;
		document.getElementById('email').focus();
		return false;
	}
}









function formValidator2(){
	// Make quick references to our fields
	var email = document.getElementById('email2');
	
	// Check each input in the order that it appears in the form!

	if(emailValidator(email, "Please enter a valid email address")){
		return true;
	}
	
	return false;
	
}



function emailValidator2(elem, helperMsg){
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	if(elem.value.match(emailExp)){
		return true;
	}else{
		alert(helperMsg);
		elem.focus();
		return false;
	}
}