	// SITE INITIALIZATION GOES HERE.
		function setSite() {
		// cache some images
			cacheImages('/global/assets/images/bg/cal_bg_hdr.gif', '/global/assets/images/bg/cal_bg_lcap.gif', '/global/assets/images/bg/cal_bg_lcap2.gif', '/global/assets/images/bg/cal_bg_mcap.gif', '/global/assets/images/bg/cal_bg_mcap2.gif', '/global/assets/images/bg/cal_bg_rcap.gif', '/global/assets/images/bg/cal_bg_rcap2.gif', '/global/assets/images/bg/cal_bg_ucap.gif', '/global/assets/images/bg/cal_bg_ucap2.gif', '/global/assets/images/bg/cal_ovr_bg_hdr.gif', '/global/assets/images/bg/cal_ovr_bg_item.gif', '/global/assets/images/bg/cal_ovr_karet.gif', '/global/assets/images/nav/topnav_l_o.gif', '/global/assets/images/nav/topnav_l_o.png', '/global/assets/images/nav/topnav_l.gif', '/global/assets/images/nav/topnav_l.png', '/global/assets/images/nav/topnav_r_o.gif', '/global/assets/images/nav/topnav_r_o.png', '/global/assets/images/nav/topnav_r.gif', '/global/assets/images/nav/topnav_r.png', '/global/assets/images/nav/topnav_sub_l.gif', '/global/assets/images/nav/topnav_sub_r.gif');
		// begin inserting swf objects into dom
			handleDomReplace();
		// add menu support
			addMenuSupport()
		// initialize tables, if any
		//  Disabled -> Display Table 2 times
		//   if (typeof(setTables) == 'function') { setTables(); }
		// add support for sifr
			sifrSupport();
	    // replace parknames in links
			handleParkReplace();
		// handle external links
			externalLinks()
		}



		var allCals   = true;
		var allSwaps  = [];
		var allTables = [];



		function cacheImages() {
			var imgMarkup = '';
			var hiddenDiv = document.body.appendChild(document.createElement('div'));
				hiddenDiv.style.display = 'none';
			for (var loop = 0; loop < arguments.length; loop++) {
				var src = arguments[loop];
				var newImage = document.createElement('img');
					newImage = hiddenDiv.appendChild(newImage)
					newImage.src = src;
			}
		}



	// add in swf movies
		function handleDomReplace() {
		// get some divs
			var allDivs = document.getElementsByTagName('div');
		// loop through all divs
			for (var loop = 0; loop < allDivs.length; loop++) {
				var thisDiv = allDivs[loop];
			// isolate isSwfMovie divs
				if (thisDiv.getAttribute('domreplace') && thisDiv.getAttribute('domreplace') != '') {
				// get all attributes
					var attbrs     = thisDiv.attributes;
					var writeAttbrs = []
				// save custom attributes in a useful format
					for (var loop2 = 0; loop2 < attbrs.length; loop2++) {
						var name  = attbrs[loop2].name;
						var value = attbrs[loop2].value;
						if (value != '' && name != 'id' && name != 'class' && name != 'style') { writeAttbrs.push([name, value]) }
					}
					var thisElement = false;
					switch(thisDiv.getAttribute('domreplace')) {
					// handle swf movie replacement
						case 'swfMovie':
									// get some attributes
										var swfUrl      = thisDiv.getAttribute('url');
										var swfWidth    = thisDiv.getAttribute('width');
										var swfHeight   = thisDiv.getAttribute('height');
									// make movie
											thisElement = swf.movie(swfUrl, swfWidth, swfHeight, 8, '/noflash.html');
									// write params
										for (var loop3 in writeAttbrs) {
											var paramName  = writeAttbrs[loop3][0]
											var paramValue = writeAttbrs[loop3][1]
											if (parkname && paramValue.indexOf('[PARKNAME]') != -1 ) { paramValue = paramValue.split('[PARKNAME]').join(parkname); }
											thisElement.setParam(paramName, paramValue);
										}
						break;
					// handle image swapper replacement
						case 'imageSwap':
									// get some attributes
										var thisUrl     = thisDiv.getAttribute('url');
										if (parkname) { thisUrl = thisUrl.split('[PARKNAME]').join(parkname); }
										var swfWidth    = thisDiv.getAttribute('width');
										var swfHeight   = thisDiv.getAttribute('height');
										var swfRate     = thisDiv.getAttribute('rate');
										var swfInterval = thisDiv.getAttribute('interval') || false;
										thisUrl += (thisUrl.indexOf('?') == -1 ) ? '?' : '&';
										if (parkname) { thisUrl += "parkname=" + parkname; } else { thisUrl += "parkname=national"; }
									// create new swapper
										allSwaps[allSwaps.length] = new swapImg(thisUrl, swfWidth, swfHeight, swfRate, thisDiv, swfInterval);
						break;
						case 'dynTable':
										var styleArray          = thisDiv.getAttribute('data');
										var proxy               = thisDiv.getAttribute('proxy');
										allTables[styleArray]   = new dynTable(eval(styleArray), thisDiv, proxy);
						break;
						case 'calendar':
									// get some attributes
										var thisUrl             = thisDiv.getAttribute('thisUrl');
										if (parkname && thisUrl.indexOf('[PARKNAME]') != -1) { thisUrl = thisUrl.split('[PARKNAME]').join(parkname); }
										var calCount            = thisDiv.getAttribute('calCount');
										if (typeof(parkname) != 'undefined') { thisDiv.setAttribute('park', parkname); }
										var park                = thisDiv.getAttribute('park');
										var table               = thisDiv.getAttribute('table');
										allCals                 = new calHandler(thisDiv, thisUrl, calCount, park, table);
						break;
					}
				// insert DOM structure
					if (thisElement) { thisDiv.appendChild(thisElement); }
				}
			}
		}



	// add in main navigation
		function addMenuSupport() {
		//first, we must set flags for the midNav Array by the page-specific inline var
			if (typeof(midNav) != 'undefined' && typeof(activeNode) != 'undefined') { activeNode.push(true); }
		// create, and post process menus
			if (document.getElementById('topNav-bucket') && topNav) { createMajorNav(document.getElementById('topNav-bucket'), topNav, 'topNav', false, iePseudoClassSupport); }
			if (document.getElementById('midNav-bucket') && midNav) {
				if (parkname && parkname == 'national') {
					createMajorNav(document.getElementById('midNav-bucket'), midNav, 'midNav-menu',    false, setBehaviour, true);
				} else {
					createMajorNav(document.getElementById('midNav-bucket'), midNav, 'midNav-menu',    false, setBehaviour);
				}
			}
			if (document.getElementById('botNav-bucket') && botNav) { createMajorNav(document.getElementById('botNav-bucket'), botNav, 'botNav',    false, iePseudoClassSupport); }
		}



	// set sifr headers
		function sifrSupport() {
		// get some headers
			var allH1s = document.getElementsByTagName('H1');
			var allSifrText = []
		// get just the relevant elements
			for (var loop =0; loop < allH1s.length; loop++) { if (allH1s[loop].className == 'sifrText') { allSifrText.push(allH1s[loop]); } }
		// transform relevant elements
			for (var loop in allSifrText) {
				if (qrystr.print == "true") {
				// replace classname with print if querystring("print") is true
					var headObj       = allSifrText[loop];
					headObj.className = "print";
				} else {
				// get the header info
					var headObj    = allSifrText[loop]
					var headCpy    = headObj.innerHTML
					var headWidth  = headObj.offsetWidth;
					var headHeight = headObj.offsetHeight;
				// create .swf object, demand version 6
					var swfMovie = swf.movie('/global/func/sifr/futura_bold.swf', headWidth, headHeight, 8, '/noflash.html');
					if (swfMovie) {
					// if version adequate, add params
						swfMovie.setParam('wmode', 'opaque');
						swfMovie.setParam('quality', 'best');
						swfMovie.setParam('flashVars', 'txt=' + headCpy + '&textcolor=#9A9A9A&w=' + headWidth + '&h=' + headHeight);
						swfMovie.setParam('bgcolor', '#FFFFFF');
					// clear header and append swf
						headObj.innerHTML ='';
						swfMovie = headObj.appendChild(swfMovie);
						headObj.style.visibility = 'visible';
					}
				}
			}
		}



	// add in park name to links
		function handleParkReplace() {
		// get some links
			var allLinks = document.getElementsByTagName("A");
			for (var i=0; i<allLinks.length; i++) {
				var thisLink = allLinks[i];
				var href = unescape(thisLink.href);
				if (href.indexOf("[PARKNAME]") > -1) {
				// replace [PARKNAME] with parkName var
					var regEx = /\[PARKNAME\]/g;
					thisLink.href = href.replace(regEx, parkname);
				}
			}
		}



	// add popup behaviour to external linkage
		function externalLinks() {
/*			var allLinks = document.getElementsByTagName('a');
			for (var loop=0; loop < allLinks.length; loop++) {
				var thisLink   = allLinks[loop];
				var isDomain   = (thisLink.href.indexOf('//') != -1) ? true : false;
				if (isDomain) {
					var thisDomain = thisLink.href.split('//')[1].split('/')[0]
					if (thisDomain.indexOf('sixflags.com') != -1 || thisDomain == 'tickets.sixflags.com') {
						thisLink.target = '_Blank';
					}
				}
			}*/
		}
