if (document.getElementById)
{
	// World Regions Show/Hide ==============================================
	
	addEvent(window, "load", function() {
		// World Regions List in Hero Shot Aux map
		if ($("regions-list"))
		{
			// Hide List
			regions_hide();

			// Build Button DOM
			var regionsLink   = document.createElement("a");
			regionsLink.href  = "#"; // Needs to become the link to the root-level of Geo-Jump?
			regionsLink.id    = "regions-button"

			var regionsButton = document.createElement("img");
			regionsButton.alt = "Show Regions";
			regionsButton.src = "/images/promotions/hero-shot/img-map_worldregions.gif";
			
			regionsLink.appendChild(regionsButton);
			
			// Place Button
			$("regions-list").parentNode.insertBefore(regionsLink, $("regions-list"));
			addEvent($("regions-button"), "click", regions_show);
			$("regions-button").onclick = function() { return false; };
			
			// Preload "Hide Regions" button
			//document.createElement("img").src = "./images/hero-shot/img-map_hideregions.gif";
			var hideRegionsImg = new Image();
			hideRegionsImg.src = "/images/promotions/hero-shot/img-map_hideregions.gif";
			
			if (Element.hasClassName($("regions-list"), "regions-list-open")) {
				regions_show();
			}
		}		
	});
	
	function regions_show() {
		if ($("regions-list"))
		{
			$("regions-list").style.visibility = "visible";
		}
		
		if ($("regions-button"))
		{
			removeEvent($("regions-button"), "click", regions_show);
			$("regions-button").childNodes[0].src = "/images/promotions/hero-shot/img-map_hideregions.gif";
			$("regions-button").childNodes[0].alt = "Hide Regions";
			addEvent($("regions-button"), "click", regions_hide);
		}
		
		return false;
	}
	
	function regions_hide() {
		if ($("regions-list"))
		{
			$("regions-list").style.visibility = "hidden";
		}

		if ($("regions-button"))
		{
			removeEvent($("regions-button"), "click", regions_hide);
			$("regions-button").childNodes[0].src = "/images/promotions/hero-shot/img-map_worldregions.gif";
			$("regions-button").childNodes[0].alt = "Show Regions";
			addEvent($("regions-button"), "click", regions_show);
		}
		
		return false;
	}
	
	// Hide/Show Maps =======================================================
	
	addEvent(window, "load", function() {
		if (typeof hideshow_initialize == "function") {
			hideshow_initialize();
		}
	});
	
	// Slice Geo-Jump Lists ================================================
	
	addEvent(window, "load", function() {
		// Get the list
		var contentDiv = $("content");
		
		if (contentDiv && Element.hasClassName(contentDiv, "geojump-listing")) {
			slice_list(contentDiv.getElementsByTagName("ol")[0], {
				max_lists: 5,
				min_items: 2,
				max_items: 75//,
			});
		}
	});
	
	// Filmstrip ============================================================
	
	// Create Filmstrip for Destinations Landing page
	addEvent(window, "load", function() {
		if ($("destinations-landing-filmstrip")) {
			// Setup element for updateFilmstripNav
			pagination = null;
			var lists = $("destinations-landing-filmstrip").parentNode.parentNode.getElementsByTagName("ol");

			for (var i = 0; i < lists.length; i++) {
				if (Element.hasClassName(lists[i], "filmstrip-pagination")) {
					pagination = lists[i];
					break;
				}
			}

			myFilmstrip = new fx.Filmstrip("destinations-landing-filmstrip", {
				duration: 1000,
				stepNum: 5,
				stepSize: 725,
				onComplete: function() {
					updateFilmstripNav(this.nowStop);
				}}
			);
		}
	});

	// Create Filmstrip for Destinations Highlights page
	addEvent(window, "load", function() {
		if ($("destinations-highlights-filmstrip")) {
			// Setup element for updateFilmstripNav
			pagination = null;
			var lists = $("destinations-highlights-filmstrip").parentNode.parentNode.getElementsByTagName("ol");

			for (var i = 0; i < lists.length; i++) {
				if (Element.hasClassName(lists[i], "filmstrip-pagination")) {
					pagination = lists[i];
					break;
				}
			}

			myFilmstrip = new fx.Filmstrip("destinations-highlights-filmstrip", {
				duration: 600,
				stepNum: 5,
				stepSize: 426,
				onComplete: function() {
					updateFilmstripNav(this.nowStop);
				}}
			);
		}
	});
}

// sIFR Rules ===============================================================

if(typeof sIFR == "function" && !sIFR.UA.bIsIEMac) {
		
	// Tab Content headers
	sIFR.replaceElement("div#page div#tab-content h4 span", named({
		sFlashSrc:      "/images/promotions/sifr/trade-gothic-lt-bold.swf",
		sColor:         "#003366",
		sBgColor:       "#B8E0FD",
		sWmode:         "transparent"}
	));
}
