function searchGo(){
    if(document.getElementById("searchTypePPO").checked == true){
      window.location.href="http://www.google.com/search" 
        + "?as_sitesearch=www.protectplanetocean.org&q="
        + escape(document.getElementById("searchPhrase").value);
    } else if(document.getElementById("searchTypeMPA").checked == true){
      window.location.href="http://mpas.appspot.com/search?q="
        +escape(document.getElementById("searchPhrase").value);
    } else {
      window.location.href="http://www.google.com/search?q="
        +escape(document.getElementById("searchPhrase").value);
    }
}
function showSubmenu(subMenuId, totalMenus) {
   for (var i = 1; i<= totalMenus; i++) {
      document.getElementById('subMenu'+i).style.display='none';
      document.getElementById('menuItem'+i).style.textDecoration='none';
   }
   try {
      document.getElementById('subMenu'+subMenuId).style.display='block';
      document.getElementById('menuItem'+subMenuId).style.textDecoration='underline';
   }
   catch(err) {
      alert(err.description);
   }
   
}
function toggleFilm(index, numFilms) {
  for (i = 0; i < numFilms; i++) {
    if (i != index) {
      document.getElementById("guestFilm"+i).style.display = "none";
    }
  }
  document.getElementById("guestFilm"+index).style.display = "";
}

function makeActiveTab(listId, nowActive) {
  tabs = document.getElementById(listId).getElementsByTagName("a");
  for (i = 0; i < tabs.length; i++) {
    tabs[i].className = "";
    document.getElementById(tabs[i].id + "Content").className = "hidden";
  }
  document.getElementById(nowActive + "Tab").className = "activeTab";
  document.getElementById(nowActive + "TabContent").className = "";
  return false;
}

function expandBox(target){
        document.getElementById(target).style.display='block';
	document.getElementById(target + "showButton").style.display='none';
	document.getElementById(target + "hideButton").style.display='block';
}
function hideBox(target){
	    document.getElementById(target).style.display='none';
	document.getElementById(target + "showButton").style.display='block';
	document.getElementById(target + "hideButton").style.display='none';
}
function swapImage(img,text){
	document.getElementById('bigPhoto').src=img;
	document.getElementById('photoCaption').innerHTML=text;
}
function expandBox2(target){
	var itemBlock = document.getElementById(target);
	
	var itemBlockStyle
	var itemBlockShowButton = document.getElementById(target + "showButton");
	if (navigator.appName == 'Microsoft Internet Explorer'){
		itemBlockStyle = itemBlock.currentStyle.display;
		
	}
	else {
		itemBlockStyle = window.getComputedStyle(itemBlock,null).getPropertyValue("display");
	}
	if (itemBlockStyle == "none"){
		itemBlock.style.display="block";
		itemBlockShowButton.style.display="none";
	}
	if (itemBlockStyle == "block"){
		itemBlock.style.display="none";
		itemBlockShowButton.style.display="block";
	}
}