// JavaScript Document
// This function makes the delivered div visible.  It is used to swap out the
// What's happening items on hte home page.
// function for making the delivered div id visible
// The function call in the link feeds it's element ID into vis
function swapNews(vis) {
	var num_elements = 2;  // num of what's this news divs
	var newsArray = new Array(num_elements);  // arracy to contain the id references
	
	// fills the array with references to the news element ids
	for (i=0; i<num_elements; i++) {
		newsArray[i] = document.getElementById('wh' + (i+1));
	}
	
	// loops through the array comparing vis to each element.
	// if vis matches then it makes that element visible, otherwise it hides the div
	for (i=0; i<num_elements; i++) {
		if (newsArray[i] == vis) {
			newsArray[i].style.display ="block";
		}
		else {
			newsArray[i].style.display="none";
		}
	}
}