

/* activeDiv() used for tabs show/hide
   Takes param activeDivId.
   -If activeDivId starts with 'grad', finds all grad divs and hides them
   -If activeDivId starts with 'undr', finds all undr divs and hides them
   Takes div with matching ID: activeDivId and displays it as block element.
   Finds all LIs matching 'grad or undr' and resets their className to empty.
   Finds LI matchinf id 'li_activeDivId' and assigns className = active
   
   This function needs to be modified if additional tabs are added.
*/

function activeDiv(activeDivId){

	/* ==== For Graduate Admissions Divs ==== */
	if(activeDivId.substring(0,4) == 'grad'){
	  // ----- reset all divs, only show the new active one ---------
	  document.getElementById('grad_Deg').style.display = 'none';
	  document.getElementById('grad_Cert').style.display = 'none';
	  document.getElementById('grad_Doc').style.display = 'none';
	  
	  // ----- reset all li, apply active class to new divs li ---------
	  document.getElementById('li_grad_Deg').className = '';
	  document.getElementById('li_grad_Cert').className = '';
	  document.getElementById('li_grad_Doc').className = '';
	}


	/* ==== For Undergraduate Admissions Divs ==== */
	if(activeDivId.substring(0,4) == 'undr'){
	  // ----- reset all divs, only show the new active one ---------
	  document.getElementById('undr_Fresh').style.display = 'none';
	  document.getElementById('undr_Trans').style.display = 'none';
	  document.getElementById('undr_Int').style.display = 'none';
	  
	  // ----- reset all li, apply active class to new divs li ---------
	  document.getElementById('li_undr_Fresh').className = '';
	  document.getElementById('li_undr_Trans').className = '';
	  document.getElementById('li_undr_Int').className = '';
	}

	
	 /* ===== Display Active, set active class to li ===== */
     document.getElementById(activeDivId).style.display = 'block';
	 document.getElementById('li_'+activeDivId).className = 'active';

	
}





