var currentTab;	// Variable to determine which tab user is currently on.
var zTimer;		// Veriable used for timer-reset of global nav tab.

// DATA ARRAYS
// Array is populated with the Global Navigation Tab IDs.
var tabId = new Array();
tabId[0] = 'tab_1'; // repeat for each tab needed.

// Preload images used in Global Navigation
var navImages = new Array();
//navImages['tab_1Off'] = new Image(10, 10);
//navImages['tab_1Off'].src = '/wildwood/pages/images/tab_1_off.gif';
//navImages['tab_1On'] = new Image(10, 10);
//navImages['tab_1On'].src = '/wildwood/pages/images/tab_1_on.gif';
//navImages['tab_1Hover'] = new Image(10, 10);
//navImages['tab_1Hover'].src = '/wildwood/pages/images/tab_1_hover.gif';

//TODO: Repeat above block for each tab needed

//navImages['gnav_background'] = new Image(986, 112);
//navImages['gnav_background'].src = 'images/image_gnav_background.jpg';
//navImages['gnav_white_bar'] = new Image(2, 28);
//navImages['gnav_white_bar'].src = 'images/image_gnav_white_bar.jpg';

// Function to display the properly highlighted tab and sub-navigation
function doNav(oTab) {
/*
	clearTimeout(zTimer);
	// Get current tab value from hidden Field.
	currentTab = document.getElementById('currentTab').value;
	var divBlank = document.getElementById('blank');
	
	// Cycle through the Tab Id array.
	for (i = 0; i < tabId.length; i++) {
		// Get the currently looped tab's sub-navigation div.
		var divSubnav = document.getElementById('subnav_' + tabId[i]);
		
		//Get the currently looped tab's image.
		var theImage = document.getElementById('tabId[i]');
		
		// Make sure the tab's image isn't null
		if (theImage != null) {
			// Check if the function has no arguments.
			if (oTab == null)
			{
				if (tabId[i] == currentTab) {
					// The current tab is the hidden field value.
					divSubnav.style.display = '';
					theImage.src = navImages[theImage.name + 'On'].src;
				} else {
					// The current tab is not the hidden field value.
					divSubnav.style.display = 'none';
					theImage.src = navImages[theImage.name + 'Off'].src;
				}
				
				if (currentTab == '' || currentTab == null) {
					// If the hidden field has no value show the blank subnav.
					divBlank.style.display = '';
				} else {
					// Otherwise hide the blank subnav div.
					divBlank.style.display = 'none';
				}
			}
			else if (oTab.name == tabId[i]) {
				divBlank.style.display = 'none';
				divSubnav.style.display = '';
				if (oTab.name == currentTab) {
					theImage.src = navImages[theImage.name + 'On'].src;
				} else {
					theImage.src = navImages[theImage.name + 'Hover'].src;
				}
			} else {
				divSubnav.style.display = 'none';
				theImage.src = navImages[theImage.name + 'Off'].src;
			}
		}
	}
*/
}

// Function to control whether a subnav is displayed as a link
function checkSubNav(linkId, linkText, theLink) {
/*
	var currentLink = document.getElementById('currentLink').value;
	if (currentLink == linkId) {
		document.write(linkText);
	} else {
		document.write("<a href='" + theLink + "' class='subnav'>" + linkText + "</a>");
	}
*/
}

// Function to create delay before resetting navigation
function doTimer() {
	var zDelay = (1000 * 3); // Alter this to change timeout delay
	zDelay = setTimeout("doNav()", zDelay);
}
