// JavaScript Document

function DARTExpandingUtil_24_12(globalTemplate) {
				this.globalTemplate = globalTemplate;
				function writeExpandingFlashcode(variableName, wmode, zIndex, width, height, expandedWidth, expandedHeight, offsetTop, offsetLeft, offsetRight, offsetBottom, salign, url,queryString, exp) {
					var position = this.getPosition(offsetTop, offsetLeft);
					var mouseOutMethod = "dartCreativeDisplayManagers['" + this.globalTemplate.creativeIdentifier + "'].onMouseOut('" + variableName + "');";
					var mouseOverMethod = "dartCreativeDisplayManagers['" + this.globalTemplate.creativeIdentifier + "'].onMouseOver('" + variableName + "');";
					var styleSheet = "";
					var mouseOutOnFlashObject = this.globalTemplate.isMac() && this.globalTemplate.isFirefox();
					if(exp.expandingDivStyleSheet != "")
						styleSheet = exp.expandingDivStyleSheet + ";";

					onMouseOutSnippet = !mouseOutOnFlashObject ? 'onmouseout="' + mouseOutMethod + '"' : "";
					document.write('<div id="DIV_'+variableName+'" onmouseover="' + mouseOverMethod + '" '+ onMouseOutSnippet +' style="'+position+
								   'visibility:'+this.globalTemplate.getFlashVisibility()+';z-index:' + zIndex + ';text-align:left;'+ styleSheet +'">');

					var movie = url;
					queryString+='&td=' + escape(self.location.hostname) + "&wmode=" + wmode;
					queryString+= (this.globalTemplate.usesSalignForExpanding(salign, wmode)) ? '&scaleMode=noScale' : '';
					queryString+= (this.globalTemplate.isInAdSenseIFrame()) ? '&expEnv=adsense' : '&expEnv=basic';
					var asContextKeyWords = this.globalTemplate.getAdSenseContextKeyValues();
					if(asContextKeyWords != "") {
						queryString+= asContextKeyWords;
					}
					var html = this.globalTemplate.getObjectHtml("id", "FLASH_" + variableName, "name", "FLASH_" + variableName,
												 "WIDTH", expandedWidth, "HEIGHT", expandedHeight,
												 "movie", movie, "quality", "high", "wmode", wmode, "salign", salign,
												 "queryString",queryString, "play", "true"
												 );
					globalTemplate.writeHtml(html);
					exp.flashHtml = html;
					document.write('</div>');

					if (mouseOutOnFlashObject) {
						this.setMouseOutMethod("FLASH_"+variableName, mouseOutMethod);
					}
				}
				this.writeExpandingFlashcode = writeExpandingFlashcode;

				function setMouseOutMethod(objectId, mouseOutMethod) {
				   if(document.getElementById(objectId) != null) {
					   document.getElementById(objectId).onmouseout = new Function(mouseOutMethod);
				   }
				   else {
					   var callback = "setMouseOutMethod(\"" + objectId + "\", \"" + mouseOutMethod + "\")";
					   this.globalTemplate.registerTimeoutHandler(100, callback, this);
				   }
				}
				this.setMouseOutMethod = setMouseOutMethod;

				function getPosition(OffsetTop, OffsetLeft) {
					var position = "position:absolute;";
					position += "top:" + (0 - OffsetTop) + "px;";
					position += "left:" + (0 - OffsetLeft) + "px;";
					return position;
				}
				this.getPosition = getPosition;

				function displayImageOnBreakoutFailure(variableName, target, hRef, imgSrc, width, height, altText, exp) {
					var callback = "displayImage(\""+variableName+"\",\""+target+"\",\""+hRef+"\",\""+imgSrc+"\",\""+width+"\",\""+height+"\",\""+altText+"\",\""+exp.adserverUrl+"\")";
					this.globalTemplate.registerPageLoadHandler(callback, this);
				}
				this.displayImageOnBreakoutFailure = displayImageOnBreakoutFailure;

				function displayImage(variableName, target, hRef, imgSrc, width, height, altText, adserverUrl) {
					var iframeUtil = new DARTIFrameUtil_24_12(this.globalTemplate);
					if(!iframeUtil.isBreakoutSuccessful()) {
						var outerDiv = globalTemplate.toObject("OUTER_DIV_" + variableName);
						outerDiv.innerHTML = '<A TARGET="'+target+'" HREF="'+hRef+'"><IMG id="IMG_'+variableName+'" SRC="'+imgSrc+'" width="'+width+'" height="'+height+'" BORDER=0 alt="'+altText+'"/></A>';
						this.globalTemplate.trackBackupImageEvent(adserverUrl);
						globalTemplate.logThirdPartyBackupImageImpression("", true);
					} else {
						globalTemplate.logThirdPartyFlashDisplayImpression("", true);
					}
				}
				this.displayImage = displayImage;
			}

			function Expanding_0_1(variableName, globalTemplate) {
				var pubHideObjects = "";
				var pubHideApplets = "";
				var pubDisplayInline = "";

				this.isFSV = globalTemplate.isFSVCreative();
				this.variableName = variableName;
				this.wmode = "transparent";
				if(globalTemplate.isMac() && globalTemplate.isFirefox()) {
					this.wmode = "transparent" ;
				}
				this.zIndex = "999999";
				this.width = "706";
				this.height = "107";
				this.expandedWidth = "706";
				this.expandedHeight = "427";
				this.offsetTop = "0";
				this.offsetLeft = "0";
				this.offsetRight = "706";
				this.offsetBottom = "107"; 
				this.salign = globalTemplate.getSalign(this.expandedWidth, this.expandedHeight, this.offsetTop,this.offsetLeft,this.offsetRight,this.offsetBottom);
				this.url = 'video2.swf';
				this.queryString='click='+ escape("") + '&rid=0&JS=0&clickN=%p;click!=&FSV=' + this.isFSV + '&varName=' + variableName + '&progressiveBaseURL=' + escape('http://rmcdn.2mdn.net/MotifFiles/html/') + '&googleProgressiveBaseURL=' + escape('http://gcdn.2mdn.net/MotifFiles/html/') + '&streamingHostDomain=' + escape('rtmp://rmcdn.f.2mdn.net/ondemand') + '&streamingBasePath=' + escape('/MotifFiles/html/') + '&CDNFiles=' + escape('') + '&googleFiles=' + escape('') + '';
				this.duration = "none";
				this.startTime = "0";
				this.hideDropdowns = false;
				this.hideIframes = false;
				this.hideScrollbars = false;
				this.hideObjects = (pubHideObjects != "") ? (pubHideObjects.toLowerCase() == "true") : false;
				this.hideApplets = (pubHideApplets != "") ? (pubHideApplets.toLowerCase() == "true") : false;
				this.adserverUrl = ";";
				this.assetType = "expando";
				this.isMainAsset = true;
				this.pushContents = false;
				this.animationTime = isNaN("1.0") ? 0 : parseFloat("1.0");
				this.displayInline = true;
				this.cssProperty = "";
				this.expandingDivStyleSheet= globalTemplate.getExpandingDivStyleSheet(this.cssProperty);
			}

			function _generateExpandingFlashCode(variableName) {
				var creativeIdentifier = "GlobalTemplate_" + "0_" + (new Date()).getTime();
				var globalTemplate = new DARTGlobalTemplate_24_12(creativeIdentifier);
				dartGlobalTemplateObjects[creativeIdentifier] = globalTemplate;
				globalTemplate.logThirdPartyImpression("");
				var exp = new Expanding_0_1(variableName, globalTemplate);
				var styleSheet = "";
				if(exp.expandingDivStyleSheet != "")
					styleSheet = ";" + exp.expandingDivStyleSheet;

				if(exp.displayInline)
					document.write('<table style="display:inline;width:706px;height:107px'+styleSheet+'" border="0" cellpadding="0" cellspacing="0"> ');
				else
					document.write('<table style="width:706px;height:107px;" border="0" cellpadding="0" cellspacing="0"> ');
				document.write('<tr style="padding:0px;margin:0px;border-style:none;border-width:0px">');
				document.write('<td style="padding:0px;margin:0px;border-style:none;border-width:0px">');

				document.write('<div id="OUTER_DIV_' + variableName + '" style="position:relative;z-index:999999'+styleSheet+'">');

				if(globalTemplate.isBrowserComplient(8)) {
					var globalTemplateVersion = "24_12";
					var advertiserID = "";
					var mediaServer = "";
					var renderingId = "0";
					var altImgTarget = "";
					var altImgHRef = "";
					var altImgSrc = "' + _motifPreviewBaseURL + '";
					var altImgWidth = "706";
					var altImgHeight = "0";
					var altImgAltText = "";
					var expandingUtil = new DARTExpandingUtil_24_12(globalTemplate);
					var iframeUtil = new DARTIFrameUtil_24_12(globalTemplate);
					if(iframeUtil.isInIFrame()) {
						var paramStr = '\''+variableName+'\',\''+exp.wmode+'\',\''+exp.zIndex+'\',\''+exp.width+'\',\''+exp.height+'\',\''+exp.expandedWidth+'\',\''+exp.expandedHeight+'\',\''+exp.offsetTop+'\',\''+exp.offsetLeft+'\',\''+exp.offsetRight+'\',\''+exp.offsetBottom+'\',\''+exp.salign+'\',\''+exp.url+'\',\''+exp.queryString+'\',\''+exp.duration+'\',\''+exp.startTime+'\','+exp.hideDropdowns+','+exp.hideIframes+','+exp.hideScrollbars+','+exp.hideObjects+','+exp.hideApplets+',\''+renderingId+'\',\''+exp.adserverUrl+'\', '+exp.pushContents+','+exp.animationTime+','+exp.displayInline+',\''+exp.cssProperty+'\',\''+exp.expandingDivStyleSheet+'\'';
						var creativeType = "EXPANDO";
						var isFlashFullScreenEnabled = false;
						if(globalTemplate.dartIsFsvEnabled)
							isFlashFullScreenEnabled = globalTemplate.isFlashFullScreenSupported(exp.wmode);
						iframeUtil.writeIFrame(paramStr, globalTemplateVersion, mediaServer, advertiserID, creativeType, globalTemplate.dartIsInPreviewMode, globalTemplate.creativeIdentifier, exp.isFSV, isFlashFullScreenEnabled);
						if(!iframeUtil.isInFriendlyIFrame())
							expandingUtil.displayImageOnBreakoutFailure(variableName, altImgTarget, altImgHRef, altImgSrc, altImgWidth, altImgHeight, altImgAltText, exp);
					}
					else {
						document.write('<IMG id="' + "EXPANDO_PLACEHOLDER_" + variableName + '" SRC="images/dot.gif" style="visibility:hidden" width="706" height="107" BORDER="0" alt="">');
						expandingUtil.writeExpandingFlashcode(exp.variableName, exp.wmode, exp.zIndex, exp.width, exp.height, exp.expandedWidth, exp.expandedHeight, exp.offsetTop, exp.offsetLeft, exp.offsetRight, exp.offsetBottom, exp.salign, exp.url,exp.queryString,exp);
						var creative = globalTemplate.createCreative("ExpandingFlash", renderingId);
						creative.assets["ExpandingFlash"] = exp;
						globalTemplate.addCreativeToDisplayQueue(creative, advertiserID);
						globalTemplate.logThirdPartyFlashDisplayImpression("", false);
            //document.write('');
					}
				}
				else {
					document.write('');
					//globalTemplate.trackBackupImageEvent(exp.adserverUrl);
					//globalTemplate.logThirdPartyBackupImageImpression("", false);
				}
				document.write('</div>');
				document.write('</td> </tr> </table>');

				globalTemplate.writeSurveyURL("");
			}

			_generateExpandingFlashCode("0_1" + (new Date()).getTime());
