
	var flashDivContent = new Object();
	var assetBundles = new Array();
	var moduleDependencies = new Array();

	//workaround for Flash player inline embed unload in IE
	//see http://www.longtailvideo.com/support/forums/jw-player/bug-reports/10374/javascript-error-with-embed
	var setRemoveCallback = function() {
		__flash__removeCallback = function(instance, name) {
	    	if(instance) {
	        	instance[name] = null;
	        }
	    };
	 	window.setTimeout(setRemoveCallback, 10);
	};
	setRemoveCallback();


	function set_cookie(name, value, expire) {
	   document.cookie = name + "=" + escape(value)
	   + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()))
	}

	function get_cookie(name) {
	   var search = name + "="
	   if (document.cookie.length > 0) { // if there are any cookies
	      offset = document.cookie.indexOf(search) 
	      if (offset != -1) { // if cookie exists 
	         offset += search.length 
	         // set index of beginning of value
	         end = document.cookie.indexOf(";", offset) 
	         // set index of end of cookie value
	         if (end == -1) 
	            end = document.cookie.length
	         return unescape(document.cookie.substring(offset, end))
	      } 
	   }
	}


	function delete_cookie(name, value) {
		if (get_cookie(name)) {
			document.cookie = name + "=" + escape(value) + "; expires=Thu, 01-Jan-1970 00:00:01 GMT";
		} 
	}

	function writeFlashModule(divIdDataPath, divContainerID, swfID, companionAdDivID){

		if ( ! get_cookie ( "showPreRoll" ) )
		{
		  var showPreRoll = true;

	 	  set_cookie ( "showPreRoll", "false" );

		}
		else
		{
		  var showPreRoll = get_cookie ( "showPreRoll" );

		}

		if ( ! get_cookie ( "showTakeOver" ) )
		{
		  var showTakeOver = true;

	 	  set_cookie ( "showTakeOver", "false" );

		}
		else
		{
		  var showTakeOver = get_cookie ( "showTakeOver" );

		}


		var questionMark = window.location.href.indexOf("?");
		var flashVars = questionMark < 0 ? "" : window.location.href.substr(questionMark+1);

		//var xmlDataPath = 'xml/data.xml';
		//flashVars = (flashVars.length > 0) ? flashVars + '&xmlDataPath=' + xmlDataPath : 'xmlDataPath=' + xmlDataPath;

		flashVars = (flashVars.length > 0) ? flashVars + '&preloader=../swf/hp_mediaplayer_preloader.swf&bootstrap=../modules/moduleBootstrap.swf' : 'preloader=../swf/hp_mediaplayer_preloader.swf&bootstrap=../modules/moduleBootstrap.swf';

		if (divIdDataPath != undefined) {
			flashVars = (flashVars.length > 0) ? flashVars + "&divIdDataPath=" + divIdDataPath : 'divIdDataPath=' + divIdDataPath;
			flashDivContent[divIdDataPath] = $("#"+divIdDataPath).html();
			flashDivContent['regionHero'] = $("#regionHero").html();
		}

		if (divContainerID != undefined) {
			flashVars = (flashVars.length > 0) ? flashVars + "&divContainerID=" + divContainerID : 'divContainerID=' + divContainerID;
		}

		if (companionAdDivID != undefined) {
			flashVars = (flashVars.length > 0) ? flashVars + "&companionAdDivID=" + companionAdDivID : 'companionAdDivID=' + companionAdDivID;
		}

		if (swfID != undefined) {
			flashVars = (flashVars.length > 0) ? flashVars + "&swfID=" + swfID : 'swfID=' + swfID;
		}

		if (showPreRoll != undefined) {
			flashVars = (flashVars.length > 0) ? flashVars + "&showPreRoll=" + showPreRoll : 'showPreRoll=' + showPreRoll;
		}

		if (showTakeOver != undefined) {
			flashVars = (flashVars.length > 0) ? flashVars + "&showTakeOver=" + showTakeOver : 'showTakeOver=' + showTakeOver;
		}

		var w = $('#'+divContainerID).width();
		var h = $('#'+divContainerID).height();

		var swfHTML = '<object id="'+swfID+'" name="'+swfID+'" width="'+w+'" height="'+h+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">';
		swfHTML += '<param name="movie" value="modules/JupiterModulePreloadHarness.swf" />';	
		swfHTML += '<param name="flashvars" value="'+flashVars+'" />';
		swfHTML += '<param name="wmode" value="transparent" />';
		swfHTML += '<param name="scale" value="noscale" />';
		swfHTML += '<param name="menu" value="false" />';
		swfHTML += '<param name="quality" value="best" />';
		swfHTML += '<param name="base" value="." />';
		swfHTML += '<param name="allowFullScreen" value="true" />';
		swfHTML += '<param name="allowScriptAccess" value="always" />';
		swfHTML += '<param name="align" value="T" />';
		swfHTML += '<param name="salign" value="TL" />';
		//swfHTML += '<embed src="modules/JupiterModulePreloadHarness.swf" id="'+swfID+'" name="'+swfID+'" type="application/x-shockwave-flash" allowscriptaccess="always" align="T" salign="TL" base="." allowfullscreen="true" wmode="transparent" scale="noscale" menu="false" width="'+w+'" height="'+h+'" flashvars="'+flashVars+'"></embed>';
		swfHTML += '<embed src="http://a.dolimg.com/explore/swf/code/JupiterModulePreloadHarness.swf" id="'+swfID+'" name="'+swfID+'" type="application/x-shockwave-flash" allowscriptaccess="always" align="T" salign="TL" base="." allowfullscreen="true" wmode="transparent" scale="noscale" menu="false" width="'+w+'" height="'+h+'" flashvars="'+flashVars+'"></embed>';
		swfHTML += '</object>';


		return swfHTML;
	}


	function getFlashEmbedSnippet(divIdDataPath, divContainerID, swfID, companionAdDivID, preloader){
		
		if (swfobject.hasFlashPlayerVersion("10.1.0")) {

		if ( ! get_cookie ( "showPreRoll" ) )
		{
		  var showPreRoll = true;

	 	  set_cookie ( "showPreRoll", "false" );

		}
		else
		{
		  var showPreRoll = get_cookie ( "showPreRoll" );

		}

		if ( ! get_cookie ( "showTakeOver" ) )
		{
		  var showTakeOver = true;

	 	  set_cookie ( "showTakeOver", "false" );

		}
		else
		{
		  var showTakeOver = get_cookie ( "showTakeOver" );

		}

		var questionMark = window.location.href.indexOf("?");
		var flashVars = questionMark < 0 ? "" : window.location.href.substr(questionMark+1);

		//var xmlDataPath = 'xml/data.xml';
		//flashVars = (flashVars.length > 0) ? flashVars + '&xmlDataPath=' + xmlDataPath : 'xmlDataPath=' + xmlDataPath;

		if (preloader == undefined) {
			preloader = 'http://a.dolimg.com/explore/swf/hp_mediaplayer_preloader.swf';
		}
		//flashVars = (flashVars.length > 0) ? flashVars + '&preloader=../swf/hp_mediaplayer_preloader.swf&bootstrap=../modules/moduleBootstrap.swf' : 'preloader=../swf/hp_mediaplayer_preloader.swf&bootstrap=../modules/moduleBootstrap.swf';
		flashVars = (flashVars.length > 0) ? flashVars + '&preloader=' + preloader + '&bootstrap=http://a.dolimg.com/explore/swf/code/moduleBootstrap.swf' : 'preloader=' + preloader + '&bootstrap=http://a.dolimg.com/explore/swf/code/moduleBootstrap.swf';

		if (divIdDataPath != undefined) {

			if (assetBundles.length == 0) {
				var media_assets = $("#media_assets").html();
				if (media_assets != undefined && media_assets != null && media_assets != '') {
					assetBundles.push(media_assets);
				}

				var tower_assets = $("#tower_assets").html();
				if (tower_assets != undefined && tower_assets != null && tower_assets != '') {
					assetBundles.push(tower_assets);
				}

				var character_assets = $("#character_assets").html();
				if (character_assets != undefined && character_assets != null && character_assets != '') {
					assetBundles.push(character_assets);
				}
			}

			if (moduleDependencies.length == 0) {
				var media_skin = $("#media_skin").html();
				if (media_skin != undefined && media_skin != null && media_skin != '') {
					moduleDependencies.push(media_skin);
				}

				var media_code = $("#media_code").html();
				if (media_code != undefined && media_code != null && media_code != '') {
					moduleDependencies.push(media_code);
				}

				var tower_skin = $("#tower_skin").html();
				if (tower_skin != undefined && tower_skin != null && tower_skin != '') {
					moduleDependencies.push(tower_skin);
				}

				var tower_code = $("#tower_code").html();
				if (tower_code != undefined && tower_code != null && tower_code != '') {
					moduleDependencies.push(tower_code);
				}

				var character_skin = $("#character_skin").html();
				if (character_skin != undefined && character_skin != null && character_skin != '') {
					moduleDependencies.push(character_skin);
				}

				var character_code = $("#character_code").html();
				if (character_code != undefined && character_code != null && character_code != '') {
					moduleDependencies.push(character_code);
				}
			}

			flashVars = (flashVars.length > 0) ? flashVars + "&divIdDataPath=" + divIdDataPath : 'divIdDataPath=' + divIdDataPath;
			if (flashDivContent[divIdDataPath] == undefined) {
				flashDivContent[divIdDataPath] = $("#"+divIdDataPath).html();
			}
			flashDivContent['regionHero'] = $("#regionHero").html();
		}

		if (divContainerID != undefined) {
			flashVars = (flashVars.length > 0) ? flashVars + "&divContainerID=" + divContainerID : 'divContainerID=' + divContainerID;
		}

		if (companionAdDivID != undefined) {
			flashVars = (flashVars.length > 0) ? flashVars + "&companionAdDivID=" + companionAdDivID : 'companionAdDivID=' + companionAdDivID;
		}

		if (swfID != undefined) {
			flashVars = (flashVars.length > 0) ? flashVars + "&swfID=" + swfID : 'swfID=' + swfID;
		}

		if (showPreRoll != undefined) {
			flashVars = (flashVars.length > 0) ? flashVars + "&showPreRoll=" + showPreRoll : 'showPreRoll=' + showPreRoll;
		}

		if (showTakeOver != undefined) {
			flashVars = (flashVars.length > 0) ? flashVars + "&showTakeOver=" + showTakeOver : 'showTakeOver=' + showTakeOver;
		}

		var w = $('#'+divContainerID).width();
		var h = $('#'+divContainerID).height();
		var swfHTML = '<object id="'+swfID+'" name="'+swfID+'" width="'+w+'" height="'+h+'" data="http://a.dolimg.com/explore/swf/code/JupiterModulePreloadHarness.swf" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" type="application/swf" >';
		//swfHTML += '<param name="movie" value="modules/JupiterModulePreloadHarness.swf" />';
		swfHTML += '<param name="movie" value="http://a.dolimg.com/explore/swf/code/JupiterModulePreloadHarness.swf" />';	
		swfHTML += '<param name="flashvars" value="'+flashVars+'" />';
		swfHTML += '<param name="wmode" value="transparent" />';
		swfHTML += '<param name="scale" value="noscale" />';
		swfHTML += '<param name="menu" value="false" />';
		swfHTML += '<param name="quality" value="best" />';
		swfHTML += '<param name="base" value="." />';
		swfHTML += '<param name="allowFullScreen" value="true" />';
		swfHTML += '<param name="allowScriptAccess" value="always" />';
		swfHTML += '<param name="align" value="T" />';
		swfHTML += '<param name="salign" value="TL" />';
		//swfHTML += '<embed src="modules/JupiterModulePreloadHarness.swf" id="'+swfID+'" name="'+swfID+'" type="application/x-shockwave-flash" allowscriptaccess="always" align="T" salign="TL" base="." allowfullscreen="true" wmode="transparent" scale="noscale" menu="false" width="'+w+'" height="'+h+'" flashvars="'+flashVars+'"></embed>';
		swfHTML += '<embed src="http://a.dolimg.com/explore/swf/code/JupiterModulePreloadHarness.swf" id="'+swfID+'" name="'+swfID+'" type="application/x-shockwave-flash" allowscriptaccess="always" align="T" salign="TL" base="." allowfullscreen="true" wmode="transparent" scale="noscale" menu="false" width="'+w+'" height="'+h+'" flashvars="'+flashVars+'"></embed>';
		swfHTML += '</object>';

		return swfHTML;

		} else {
			window.location = 'http://disney.go.com/home/html/index.html?flash=false';
		}
		
		
	}

	/*
	 * initHeroWithDefaultLoader
	 * 
	 * Defaults to using the default preloader.  Externalized here so we don't embed
	 * arguments into the HTML
	 */
	function initHeroWithDefaultLoader() {
		return getFlashEmbedSnippet('heroContent', 'regionHero', 'jupiterContent', 'companion-ad',
				'http://a.dolimg.com/explore/swf/loader_anim_v02.swf');
	}

	function replaySwf(track) {

		swfobject.removeSWF("jupiterContent");
		if ((BrowserDetect.browser.toLowerCase() == 'firefox' && BrowserDetect.version == 4) || isIE9()) {
			return;
		} else {
			//assetBundles = new Array();
			//moduleDependencies = new Array();

			var swfHTML = getFlashEmbedSnippet('heroContent', 'regionHero', 'jupiterContent', 'companion-ad');
			$('#regionHero').html(swfHTML);
		}

		if (track != undefined) {
			AnalyticsTrackLink(track);
		}
	}

	function replayTakeOver() {
		delete_cookie("showPreRoll", 'false');
		delete_cookie("showTakeOver", 'false');
		if (BrowserDetect.browser.toLowerCase() == 'firefox' && BrowserDetect.version == 4) {
			//slight delay to ensure cookies are deleted.
			setTimeout(function () {window.location.href = window.location.href}, 250);
		}

	}

	function replayPreRoll() {
		delete_cookie("showPreRoll", 'false');
		delete_cookie("showTakeOver", 'false');
		if (BrowserDetect.browser.toLowerCase() == 'firefox' && BrowserDetect.version == 4) {
			//slight delay to ensure cookies are deleted.
			setTimeout(function () {window.location.href = window.location.href}, 250);
		}
	}

	function getDependencies() {
		return moduleDependencies;
	}

	function getAssetStreams() {
		return assetBundles;
	}

	function getPageCTO() {
		return cto;
	}

	function getStyle(id, style){
		//alert('getStyle: ' + id)
		var element = $("#"+id);
		var cssStr = "";
		if(document.defaultView && document.defaultView.getComputedStyle){
			cssStr = document.defaultView.getComputedStyle(element, "").getPropertyValue(style);
		} else if(element.currentStyle){
			style = style.replace(/\-(\w)/g, function (strMatch, p1){
				return p1.toUpperCase();
			});
			cssStr = element.currentStyle[style];
		}
		return element.style.getPropertyValue(style);
	}


	function getStyleSheet(id) {
	//	alert('getStyleSheet: ' + id)
		var ss = '';
		if(window.ActiveXObject) {
			ss = constructStyleSheetIE(id)
		} else {
			ss = constructStyleSheet(id);
		}
		return escape(ss);
	}

	function constructStyleSheet(id) {
		var sheet = document.styleSheets[id];
		var len = sheet.cssRules.length;

		var fullStyleSheet = '';
		for (i=0;i<len;i++) {
			fullStyleSheet = fullStyleSheet + document.styleSheets[id].cssRules[i].cssText;
		}
		return fullStyleSheet;
	}

	function constructStyleSheetIE(id) {
		var sheet = document.styleSheets[id];
		var len = sheet.rules.length;
		var fullStyleSheet = '';
		for (i=0;i<len;i++) {
			fullStyleSheet = fullStyleSheet + document.styleSheets[id].rules[i].selectorText + ' { ' + document.styleSheets[id].rules[i].style.cssText + ' } ';
		}
		return fullStyleSheet;
	}

	function getNumberOfRules(sheetNum) {
		var num;
		if(window.ActiveXObject) {
			num = document.styleSheets[sheetNum].rules.length; 
		} else {
			num = document.styleSheets[sheetNum].cssRules.length;
		}
		return num;
	}


	function getInternetExplorerVersion() {
	  var ver = -1;
	  if (navigator.appName == 'Microsoft Internet Explorer')
	  {
	    var ua = navigator.userAgent;
	    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
	    if (re.exec(ua) != null)
	      ver = parseFloat( RegExp.$1 );
	  }
	  return ver;
	}


	function getStyleText(sheetNum, ruleNum) {
	        var style;
	        if(window.ActiveXObject && getInternetExplorerVersion() < 9) {
	                var split = document.styleSheets[sheetNum].rules[ruleNum].style.cssText.split(';');
	                var cleanstyle = '';
	                for (var i=0; i<split.length; i++) {
	                        tempSplit = split[i].split(':');
	                        var styleValue = convertHexToRGB(tempSplit[1]);
	                        temp = tempSplit[0].toLowerCase() + ':' + styleValue + '; ';
	                        cleanstyle += temp;
	                }

	                //lowercase tag name clean up for IE
	                var prop = document.styleSheets[sheetNum].rules[ruleNum].selectorText          
	                var propSplit = prop.split(' ');
	                var len = propSplit.length;
	                if (len > 1) {
	                        for (var y = 0; y<len; y++) {
	                                if (propSplit[y].indexOf('#') > -1 || propSplit[y].indexOf('.') > -1 ) {
	                                        break;
	                                } else {
	                                        propSplit[y] = propSplit[y].toLowerCase();
	                                }
	                        }
	                }

	                prop = '';
	                var len = propSplit.length;
	                for (var x = 0; x<len; x++) {
	                        prop += propSplit[x].replace('DIV', 'div') + ' ';
	                }
	                style = prop + ' { ' + cleanstyle + ' } ';

	        } else {
	                style = document.styleSheets[sheetNum].cssRules[ruleNum].cssText;
	        }
	        return escape(style);
	}

	function convertHexToRGB(hex) {
		if (hex.indexOf('#') > -1) {
			if (hex.length == 5) {
				var nhex = hex.substring(2,5);
				var lhex = '';
				for (var i=0;i<nhex.length;i++) {
					lhex = lhex + nhex[i] + nhex[i];
				}
				hex = ' #'+lhex;
			}
			hex = cutHex(trim(hex));
			var rgb = '';
			var r = parseInt((hex).substring(0,2),16);
			var g = parseInt((hex).substring(2,4),16);
			var b = parseInt((hex).substring(4,6),16);
			rgb = 'rgb('+r+', '+g+', '+b+')';
			return rgb;
		} else {
			return hex;
		}
	}

	function cutHex(h) {
		return (h.charAt(0)=="#") ? h.substring(1,7):h
	}


	function trim(str) {
	  s = str.replace(/^(\s)*/, '');
	  s = s.replace(/(\s)*$/, '');
	  return s;
	}


	function isDCOMInternetExplorer() {  
		return window.ActiveXObject;
	}
	

	function loadCompanionAd(url, link, divID) {
		//TODO:ad link functionality
		var element = $("#"+divID);
		if (element != null) {
			element.src = url;
		}
	}

	function resizeSWF(swfID, w, h) {

		if (w > getSWF(swfID).width) {
			w = getSWF(swfID).width;
		}

		getSWF(swfID).style.width = Number(w) + 'px';
		getSWF(swfID).style.height = Number(h) + 'px';
	}
	
	function isIE9() {
		var bool = false;
		if (isDCOMInternetExplorer() && typeof document.documentElement.style.opacity!='undefined') {
			bool = true;
		}
		return bool;
	}

	function getSWF(movieName) {
		if (isDCOMInternetExplorer()) {
			if (typeof document.documentElement.style.opacity!='undefined') {
				//IE 9 works like old school firefox
				return document[movieName];
			} else {
				//All other IE versions use window to reference content.
				return window[movieName];
			}
		} else {
	        if(document[movieName].length != undefined){
				if (BrowserDetect.browser.toLowerCase() == 'firefox' && BrowserDetect.version >= 7) {
					//FF 7 uses the object and no longer uses the embeded swf
	            	return document[movieName][0];
				} else {
					//old school FF use the embed instead of the object
					return document[movieName][1];
				}
	        }
	    	return document[movieName];
	  	}
	}

	function getDivData(id) {
		return escape(flashDivContent[id]);
	}

	function getPreRoll() {
	    return $('meta[name=pre-roll]').attr('content');
	}

	function getTakeOver() {
	    return $('meta[name=take-over]').attr('content');
	}

	function AnalyticsTrackLink(lid,lpos)
	 {
	   try{
	     cto.linkId=lid;
	     cto.linkPosition=lpos;
	     cto.trackLink();
	     //clear link tracking variables
	     cto.linkId="";
	     cto.linkPosition="";
	   }catch(e){}
	 }

	function getUnsupportedOSContentURI() {
		return 'rtmp://wdig.fcod.llnwd.net/a339/o2/disneyextreme/disneydxd/xd09132_dimg_dcom_operating_system_velvet_rope_sw.flv';
	}

	function getUnsupportedOSBusinessUnits() {
		return ["ABC",
				"ABC Cable Networks Group",
				"ABC Family",
				"Boys Target Action Block on DC",
				"Boys Target Action Block on DC (JETIX)",
				"Buena Vista Television",
				"DADTV (formerly BVTV)",
				"Disney Channel",
				"ESPN",
				"Playhouse Disney",
				"Radio Disney"];
	}

	var currentMessage;
	function handleJBSMessage(msg, messageType) {
		if(messageType) {
			switch(messageType) {
				case "com.disney.coretech.messaging.JavascriptAdapterReadyMessage":
					var flashObject = getSWF("jupiterContent");

					flashObject.watchMessageTypeName("com.disney.jupiter.messaging.ShoutOutSubmissionRequestMessage");
					break;
				case "com.disney.jupiter.messaging.ShoutOutSubmissionRequestMessage":
					//alert("Recipient Name: " + msg.recipientName + " Recipient Type: " + msg.recipientType);
					var form = getSWF("shoutOutWindowPane");
					$('#shoutoutForm').fadeIn();

					currentMessage = msg;
					showLightbox();
					//alert($('#shoutoutForm').css('display'))
					break;
				default:
					break;
			}
		}
	}

	function getCurrentMessage() {
		return currentMessage;
	}

	function clearCurrentMessage() {
		currentMessage = undefined;
	}
	
	function videoPlayerStateChange(state) {
		if (document.attachEvent && !isIE9()) {
			if (state == 'play') {
				document.documentElement.fakePlayEvent++;
			} else if (state == 'pause'){
				document.documentElement.fakePauseEvent++;
			}
		} else {
			var evt = document.createEvent("Event");
			if (state == 'play') {
				evt.initEvent("DisneyMediaPlayerPlay", true, true);
			} else if (state == 'pause'){
				evt.initEvent("DisneyMediaPlayerStop", true, true);
			}
			document.dispatchEvent(evt);
		}
	}
	
	function allModulesLoaded() {
		if (document.attachEvent && !isIE9()) {
			document.documentElement.moduleLoadComplete++;
		} else {
			var evt = document.createEvent("Event");
			evt.initEvent("onAllModulesComplete", true, true);
			document.dispatchEvent(evt);
		}
	}

	//this function is called by the overpage ad when it is interacted with.
	function sendJSEvent(evt) {
		var flashObject = getSWF("jupiterContent");
		var message_pause    	= 'com.disney.jupiter.messaging.PauseJupiterMediaPlayer';
		var message_play 	= 'com.disney.jupiter.messaging.PlayJupiterMediaPlayer';
		try {
			//overpage ad is playing, pause the video
			if (evt == 'pauseVideo') {
				flashObject.sendMessage({ messageType: message_pause });
				//overpage ad is paused/stopped, play the video
			} else if (evt == 'playVideo') {
				flashObject.sendMessage({ messageType: message_play });
			}
		} catch (e) {
			//flash object not instantiated yet.
		}
	}

	var BrowserDetect = {
		init: function () {
			this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
			this.version = this.searchVersion(navigator.userAgent)
				|| this.searchVersion(navigator.appVersion)
				|| "an unknown version";
			this.OS = this.searchString(this.dataOS) || "an unknown OS";
		},
		searchString: function (data) {
			for (var i=0;i<data.length;i++)	{
				var dataString = data[i].string;
				var dataProp = data[i].prop;
				this.versionSearchString = data[i].versionSearch || data[i].identity;
				if (dataString) {
					if (dataString.indexOf(data[i].subString) != -1)
						return data[i].identity;
				}
				else if (dataProp)
					return data[i].identity;
			}
		},
		searchVersion: function (dataString) {
			var index = dataString.indexOf(this.versionSearchString);
			if (index == -1) return;
			return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
		},
		dataBrowser: [
			{
				string: navigator.userAgent,
				subString: "Chrome",
				identity: "Chrome"
			},
			{ 	string: navigator.userAgent,
				subString: "OmniWeb",
				versionSearch: "OmniWeb/",
				identity: "OmniWeb"
			},
			{
				string: navigator.vendor,
				subString: "Apple",
				identity: "Safari",
				versionSearch: "Version"
			},
			{
				prop: window.opera,
				identity: "Opera"
			},
			{
				string: navigator.vendor,
				subString: "iCab",
				identity: "iCab"
			},
			{
				string: navigator.vendor,
				subString: "KDE",
				identity: "Konqueror"
			},
			{
				string: navigator.userAgent,
				subString: "Firefox",
				identity: "Firefox"
			},
			{
				string: navigator.vendor,
				subString: "Camino",
				identity: "Camino"
			},
			{		// for newer Netscapes (6+)
				string: navigator.userAgent,
				subString: "Netscape",
				identity: "Netscape"
			},
			{
				string: navigator.userAgent,
				subString: "MSIE",
				identity: "Explorer",
				versionSearch: "MSIE"
			},
			{
				string: navigator.userAgent,
				subString: "Gecko",
				identity: "Mozilla",
				versionSearch: "rv"
			},
			{ 		// for older Netscapes (4-)
				string: navigator.userAgent,
				subString: "Mozilla",
				identity: "Netscape",
				versionSearch: "Mozilla"
			}
		],
		dataOS : [
			{
				string: navigator.platform,
				subString: "Win",
				identity: "Windows"
			},
			{
				string: navigator.platform,
				subString: "Mac",
				identity: "Mac"
			},
			{
				   string: navigator.userAgent,
				   subString: "iPhone",
				   identity: "iPhone/iPod"
		    },
			{
				string: navigator.platform,
				subString: "Linux",
				identity: "Linux"
			}
		]

	};
	BrowserDetect.init();


$('document').ready(function() {
	//ad exists
	document.documentElement.fakePlayEvent = 0;
	document.documentElement.fakePauseEvent = 0;
	document.documentElement.moduleLoadComplete = 0;
	if ($('#overPageAd').length > 0 && $('#overPageAd').html().indexOf('<!-- Blank -->') == -1) {
		
		if ($('#region_home_overpage_ad').length > 0 && $('#region_home_overpage_ad').html() != '') {
			if ($('#region_home_overpage_ad').html().length > 5) {
				$('#overPageAd').css('padding', '7px');
			}
		}
	}
});

