/* Create an 'ord' number so that it can later be passed to a flash movie. this will enable us to play video ads in flash movies. to fix the caching problem on nick.com right now we're not passing the ord num. to flash movies. -=Dhimiter=- -=03/01/03=- more work will be needed to turn this back on, since we're now using FlashVars to pass other args. -=Boyer=- -=08/14/04=- */ if (isNaN(document.axel)) document.axel = Math.random() + ""; ord = document.axel * 1000000000000000000; /* Construct bandwidth parameter if no throughput can be determined in /common/header/insightfirst.jhtml D.Hannon 11.26.03 */ var bps = document.cSpeed?"&bps="+document.cSpeed:""; /* Embed Object */ function embedObject(src,id,width,height,args) { if ((width.indexOf("%")>0)&&(detect.browser.ie == false)) { width = width.substring(0,width.indexOf("%")); percent = width / 100; width = detect.browser.getWidth() * percent; } if ((height.indexOf("%")>0)&&(detect.browser.ie == false)) { height = height.substring(0,height.indexOf("%")); percent = height / 100; height = detect.browser.getHeight() * percent; } if (location.hostname == "www.nick.com" || location.hostname == "www.nick.com") { this.staticHost = "http://static.nick.com"; } else if (location.hostname == "www.nickjr.com") { this.staticHost = "http://static.nickjr.com"; } else { this.staticHost = ""; } this.height = height||144; this.width = width ||176; this.src = src; this.id = id; this.args = args; this.embed = new Function("writeEmbed(this)"); this.debug = new Function("showDebug(this)"); } /* Write Embed Controls what is written Alternate Content should go here */ function writeEmbed(obj) { document.write(getEmbed(obj)); } // Debug function showDebug(obj) { alert(getEmbed(obj)); } /* Print parameters. Since the syntax of the object and embed tags are stable, parameters to them can be passed as an array. embed syntax is name=value object syntax is */ function getArgs(obj) { var args = obj.args; var out = ''; if(args!=null) { // Sets wmode to opaque by default. if (args['wmode']) { } else { args['wmode'] = "opaque"; } // Set wmode to opaque by default (except on win2000) // wmode has a tendency to crash IE on win2000 /* if (detect.platform.os == 'Win2000') { delete args['wmode']; } */ for (a in args) { if (a == "codebase"){} else if (pcie) { out += ' '; } else { out += ' ' + a + '=' + args[a] + "\n"; } } if(args["useStaticDomain"] == "true"){ if (pcie){ out += ' '; }else{ out += ' domain=' + obj.staticHost + "\n"; } } } return out; } /* Figure out which Plugin and what type of embed to use This may eventually be replaced by checking the dot-extension rather than having type passed in. It could also be a little faster using if/elseif. */ function getEmbed(obj) { var s = obj.src.split("?"); var ext = s[0].substring(s[0].lastIndexOf('.'),s[0].length); var out=''; /* checking for jhtml - assuming its the asxmaker call for adding in video intro or outro ads. - greg graf */ if (ext == ".jhtml") { out += embedWmp(obj); } if (ext == ".swf") { if(obj.args["useContainer"] == "false"){ out += embedFlash(obj); }else{ out += embedFlashContainer(obj); } } if ((ext == ".rm")||(ext == ".ra")||(ext==".smil")) { out += embedReal(obj); } /* erena added the .wmv -- hoping to add that extention to detection */ if ((ext == ".asf")||(ext==".asx") || (ext == ".wmv") || (ext == ".wma") ) { if (ext == ".asx") { var handle = obj.src.substring(0,obj.src.lastIndexOf('.asx')); obj.src = handle + ".asx"; } out += embedWmp(obj); } if (ext == ".mov") { out += embedQuicktime(obj); } if (ext == ".dcr") { out += embedShockwave(obj); } if (ext == ".grv") { out += embedGroove(obj); } if ((ext == ".cmo") || (ext == ".vmo")) { out += embedVirtools(obj); } return out; } function embedFlash(obj) { var flArgs = obj.args; var out = ''; var swfSrc; if(flArgs["useStaticDomain"] == "true"){ swfSrc = obj.staticHost.concat(obj.src); }else{ swfSrc = obj.src; } // lego fix // var testArray = Array("jsString", "atoro", "ewkii", "uparu", "aller", "kongu", "test" ); var found; var testString = top.document.location.pathname; var temp = testString.lastIndexOf("/"); var tempString = testString.substr(temp+1); var temp2 = tempString.lastIndexOf("."); var temp3 = (tempString.lastIndexOf("_")+1); tempString = tempString.substr(temp3, temp2-temp3); var swfFound; var swfTestString = swfSrc; var swfTemp = (swfTestString.lastIndexOf(".")-6); var swfTempString = swfTestString.substr(swfTemp+1); var swfTemp2 = swfTempString.lastIndexOf("."); swfTempString = swfTempString.substr(0, swfTemp2); for(i = 0; i < testArray.length; i++) { if(swfTempString == testArray[i]) { alert("ding!") found = testArray[i]; break; } } if (pcie && found != swfTempString) { out += '"; } out += getArgs(obj); out += getClose(); return out; } function embedFlashContainer(obj) { var out = ''; var flArgs = obj.args; var swfSrc; var domain; var containerPath; if (flArgs["wmode"]) { } else { flArgs["wmode"] = "opaque"; } if(flArgs["useStaticDomain"] == "true"){ swfSrc = obj.staticHost.concat(obj.src); domain = obj.staticHost; containerPath = obj.staticHost.concat("/dynamo/droplets/detect/multimedia/loader.swf"); }else{ swfSrc = obj.src; domain = ""; containerPath = "/dynamo/droplets/detect/multimedia/loader.swf"; } flArgs["paramList"] += ":domain"; out += ''; return out; } function embedReal(obj) { if ((obj.src.indexOf('://')<0)||(obj.src.indexOf('://')>4)) { obj.src = getPluginServerPath('real') + obj.src; } // Everything gets a smil, mainly so MacIE doesn't pop 2 players. var autosmil = "/dynamo/droplets/detect/autosmil.smil?src="; obj.src = autosmil + obj.src; var out = ''; // True for now <----------------------------------------- var showControls = true; // Real uses 2 embeds (player and controller) so we dump it into a table var tableCenter = '
| '; if (pcie) { // Image Window out += ' |