// Parks.js

//variables
var submitted = false;


//functions
function toggleHelp(targetId)
{
	target = document.all(targetId);
	if(target.style.display == "none")
	{
		target.style.display = "";
	}
	else 
	{
		target.style.display = "none";
	}
}


function showAll()
{
	for (var x=0; x < showAllDivs.length; x++)
	{
		showAllDivs[x].style.display = "";		
	}
	
	document.getElementById('show').innerHTML = "<a style='font-weight: bold; cursor: hand;' onclick='hideAll()'>HIDE ALL</a>";
		
}

function hideAll()
{
	for (var x=0; x < showAllDivs.length; x++)
	{
		showAllDivs[x].style.display = "none";
	}
	
	document.getElementById('show').innerHTML = "<a style='font-weight: bold; cursor: hand;' onclick='showAll()'>SHOW ALL</a>";
	
}


function SetEventValueOnSubmit(eventValue)
{
	if(!submitted)
    {
    	form.EVENT.value = eventValue;
      	submitted = true;
      	return true;
    }
    else
    {
      	alert("Currently processing");
      	return false;
    } 
}


function ConfirmAction(event)
{
  	if (confirm("Are you sure you want to proceed?"))
  	{
  		SetEventValueOnSubmit(event);
  	}
  	else
  		return false;  
}

function toggleDetails(targetId)
{
	target = document.all(targetId);
	if(target.style.display == "none")
		target.style.display = "";
	else
		target.style.display = "none";
}

function valButton(btn) 
{
	var cnt = -1;
	
	for (var i=0; i < btn.length; i++) 
	{
   		if (btn[i].checked) 
   		{
   			cnt = i; 
   			i = btn.length;
   		}
   	}
	if (cnt > -1) 
		return btn[cnt].value;
	
	else 
		return null;
}

var firstTime2 = true;

function showAccountMenu(){
  
	if (firstTime2 == true || document.getElementById("AccountMenu").style.visibility == "hidden") {
		document.getElementById("AccountMenu").style.visibility = "visible";
		firstTime2 = false;  
	} else {
		document.getElementById("AccountMenu").style.visibility = "hidden"   
	} 
}

function clearAccountMenu(){
	document.getElementById("AccountMenu").style.visibility = "hidden"   
} 

