function defineSubnavArray ()
{
	var subnavIDs = new Array();
	subnavIDs[0] = "admissions";
	subnavIDs[1] = "programs";
	subnavIDs[2] = "community";
	subnavIDs[3] = "faculty";
	subnavIDs[4] = "fieldlearning";
	subnavIDs[5] = "alumni";
	subnavIDs[6] = "students";
	
	return subnavIDs;
}


function hideOthers (subnavName)
{
	var tempSubnav;
	var tempArray = defineSubnavArray();

	document.getElementById('active').style.display = 'none';
		
	for (var i=0; i<tempArray.length; i++)
	{	
		tempSubnav = tempArray[i];
	
		if (tempSubnav == subnavName)
		{
			document.getElementById(tempSubnav).style.display = 'block';
		}
		if (tempSubnav != subnavName)
		{
			document.getElementById(tempSubnav).style.display = 'none';
		}
	}
}


function displayCurrent (subnavName, currentActive)
{
	var tempSubnav;
	var tempArray = defineSubnavArray();
	
	for (var i=0; i<tempArray.length; i++)
	{	
		tempSubnav = tempArray[i];
		
		if (tempSubnav != currentActive)
		{
			document.getElementById(tempSubnav).style.display = 'none';
		}
	}
	
	document.getElementById('active').style.display = 'block';
	document.getElementById(currentActive).style.display = 'block';
}



function tallyProducts()
{

     var theForm = document.getElementById('payment-form');
     var products = document.getElementsByName('products');
     var totalField = document.getElementById('amount-paid'); 
     var total = 0;
     
     for (var i = 0; i < products.length; i++)
     {
         if (products[i].checked)
         {
            total += parseFloat(products[i].value);
         }
     }

     
     document.getElementById('amount-evt').value = total;
     document.getElementById('amount-paid').value = total;




}

function toggleSection(mySection)
{
         if( document.getElementById(mySection).style.display == 'block')
	 { 
		document.getElementById(mySection).style.display = 'none';
	 }

	 else 
	 {
	 	document.getElementById(mySection).style.display = 'block';
	 }	
}

function popUp(URL, windowWidth, windowHeight) 
{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=windowWidth,height=windowHeight,left = 540,top = 312');");
}

