function prepareSecondaryNav() {
	if ( !document.getElementsByTagName) return false;
	
	/* Secondary navigation array */
	var links = new Array();
	links['accommodationTab'] = new Array();
	links['accommodationTab'][0] = new Array();
	links['accommodationTab'][1] = new Array();
	links['accommodationTab'][2] = new Array();
	links['accommodationTab'][0]['linkText'] = "villas";
	links['accommodationTab'][0]['link'] = "/villas/index.php";
	links['accommodationTab'][1]['linkText'] = "villa matrix orlando";
	links['accommodationTab'][1]['link'] = "/villas/matrix.php";
	links['accommodationTab'][2]['linkText'] = "condominiums";
	links['accommodationTab'][2]['link'] = "/condominiums/index.php";
	//links['articlesTab'] = new Array();
	//links['articlesTab'][0] = new Array();
	//links['articlesTab'][1] = new Array();
	//links['articlesTab'][2] = new Array();
	//links['articlesTab'][0]['linkText'] = "gardens";
	//links['articlesTab'][0]['link'] = "/articles/sort.php";
	//links['articlesTab'][1]['linkText'] = "golf courses";
	//links['articlesTab'][1]['link'] = "/articles/sort.php";
	//links['articlesTab'][2]['linkText'] = "lakes";
	//links['articlesTab'][2]['link'] = "/articles/sort.php";
	links['golfTab'] = new Array();
	links['golfTab'][0] = new Array();
	links['golfTab'][1] = new Array();
	links['golfTab'][2] = new Array();
	links['golfTab'][0]['linkText'] = "main page";
	links['golfTab'][0]['link'] = "/golf/index.php";
	links['golfTab'][1]['linkText'] = "top golf courses in Florida";
	links['golfTab'][1]['link'] = "/golf/top-golf-courses-in-florida.php";
	links['golfTab'][2]['linkText'] = "Orlando golf courses";
	links['golfTab'][2]['link'] = "/golf/orlando-golf-courses.php";
	links['placesTab'] = new Array();
	links['placesTab'][0] = new Array();
	links['placesTab'][1] = new Array();
	links['placesTab'][2] = new Array();
	links['placesTab'][3] = new Array();
	links['placesTab'][4] = new Array();
	links['placesTab'][0]['linkText'] = "main page";
	links['placesTab'][0]['link'] = "/places/index.php";
	links['placesTab'][1]['linkText'] = "Orlando";
	links['placesTab'][1]['link'] = "/places/orlando.php";
	links['placesTab'][2]['linkText'] = "Gulf Coast";
	links['placesTab'][2]['link'] = "/places/gulf-coast.php";	
	links['placesTab'][3]['linkText'] = "Atlantic Coast";
	links['placesTab'][3]['link'] = "/places/atlantic-coast.php";
	links['placesTab'][4]['linkText'] = "The Keys";
	links['placesTab'][4]['link'] = "/places/the-keys.php";	
	links['weatherTab'] = new Array();
	links['weatherTab'][0] = new Array();
	links['weatherTab'][1] = new Array();
	links['weatherTab'][0]['linkText'] = "weather and climate";
	links['weatherTab'][0]['link'] = "/weather/index.php";
	links['weatherTab'][1]['linkText'] = "current weather conditions";
	links['weatherTab'][1]['link'] = "/weather/current-weather-conditions.php";
	links['webcamsTab'] = new Array();
	links['webcamsTab'][0] = new Array();
	links['webcamsTab'][1] = new Array();
	links['webcamsTab'][0]['linkText'] = "main page";
	links['webcamsTab'][0]['link'] = "/webcams/index.php";
	links['webcamsTab'][1]['linkText'] = "Google map";
	links['webcamsTab'][1]['link'] = "/webcams/map.php";

	var mainNav = document.getElementById("tabMenu");
	var secondaryNav = document.getElementById("secondaryNav");
	var anchors = mainNav.getElementsByTagName("a");
	for ( var i=0; i<anchors.length; i++ ) {
		anchors[i].onmouseover = function() {
			/* Remove any previous links */
			var prevLinks = secondaryNav.getElementsByTagName("ul");
			for ( var i=0; i<prevLinks.length; i++ ) {
				secondaryNav.removeChild(prevLinks[i]);
			}
			/* Show links corresponding to tab */
			var tabId = this.getAttribute("id");
			if (links[tabId]) {
				var list = addLinks(links[tabId]);
				secondaryNav.appendChild(list);
			}
			/* Change background colour of tab and secondary navigation */
			if (document.all) {
				this.style.backgroundColor = "#4488bb";
				this.style.borderBottom = "1px solid #4488bb";
				secondaryNav.style.backgroundColor = "#4488bb";
			} else {
				this.setAttribute("style", "background-color:#4488bb;border-bottom:1px solid #4488bb");
				secondaryNav.setAttribute("style", "background-color:#4488bb");
			}
		}
		anchors[i].onmouseout = function() {
			if (document.all) {
				this.style.backgroundColor = "#005588";
				this.style.borderBottom = "1px solid #333333";
			} else {
				this.setAttribute("style", "background-color:#005588;border-bottom:1px solid #333333");
			}
		}
	}
}

function addLinks(links) {
	var list = document.createElement("ul");
	for ( var i=0; i<links.length; i++ ) {
		var item = document.createElement("li");
		var anchor = document.createElement("a");
		var linkText = document.createTextNode(links[i]['linkText']);
		anchor.setAttribute("href", links[i]['link']);
		anchor.appendChild(linkText);
		item.appendChild(anchor);
		list.appendChild(item);
	}
	return list;
}