	var debugMode = window.location.toString().toQueryParams().OmnitureDebug;

	/**
	 * Popup function. 	
	 */
	function doPopup(url, name, specs){
		try {
	    	window.open(url, name || 'myPopup', specs || 'width=400,height=500,toolbars=false');		
		} catch(e) {
			alert("Error: " + e.message);
		} 
	}

	/**
 	 * Track swfaddress change
 	 * 
 	 * @param ev SWFAddressEvent
 	 */
	
	var trackPageView = function(ev){
		/*
		@var ev.pathNames array Array of folder names in new location
		@var ev.path string Pathname of new location
		*/
		trackEvent(ev.path);
	}
	
	function trackEvent(path){
		if (path.substring(0,1) == "/" || path.substring(0,1) == ":") path = path.substring(1);
		var pathArray = path.split('/');
		
		try{
		
			// Only log to console when it exists
			try {
				console.log("Omniture deep link: '" +path + "'");
			}catch (_){
			
			}	
			s.linkTrackVars="prop29,hier2";
			
			s.hier2 = hier2Base.join(',')+","+ pathArray.join(',');
			s.prop29 = s.pageName+":"+pathArray.join(':');
			
			//If the link brings user to another page, we set the eVar29 for revenue contribution
			if (path.indexOf("_CTA") > 0) {
				s.linkTrackVars += ",eVar29";
				s.eVar29 = s.pageName+":"+pathArray.join(':');
				
				// Only log to console when it exists
				try {
					console.log("Omniture deep link CTA: '" +path + "'");
				}catch (_){
				
				}
			}
			
			s.tl(this,'o','Showcase tracking');
			
			if (debugMode) window.open("","stats_debugger","width=600,height=600,location=0,menubar=0,status=1,toolbar=0,resizable=1,scrollbars=1").document.write("<script language=\"JavaScript\" src=\"http://192.168.112.2O7.net/stats_debugger.php\"></"+"script>" + "<script language=\"JavaScript\">window.focus();</script>");
			
		} catch(_){
			alert("An error occurred when trying to send metrics to Omniture");
		}
		
		
	}
	
	Event.observe(window, 'load', function(){
	//ON LOAD
		$$('.noflash').invoke('show');
		
		SWFAddress.addEventListener(SWFAddressEvent.CHANGE, trackPageView);
		var params = {
			quality: "high",
			scale: "noscale",
			wmode: "window",
			allowscriptaccess: "always",
			bgcolor: "#FFFFFF"
		};
		var flashvars = {
			siteXML: "xml/site.xml"
		};
		var attributes = {id:"flashcontent"};
		swfobject.embedSWF("main.swf", "flashcontent", "100%", "100%", "10.0.0", "expressInstall.swf", flashvars, params, attributes);
		swffit.fit("flashcontent", 980, 670);
		
	});