msnbc.namespace("msnbc.components.video"); msnbc.components.video.FlashBridge = msnbc.core.EventDispatcher.extend({ init: function(id, flashObj, repDiv, surveyDiv){ this._super(); this.vID = id; this.repObj = $('#'+repDiv)[0]; this.adUrls = {}; this.adRef = "/"; this.collapseAfterAd = true; this.adLoaded = false; this.flashObj = flashObj; this.repDiv = repDiv; this.surveyDiv = surveyDiv; this.origTitle = document.title; }, onVideoChange: function(head, videoId) { if (videoId) { try { document.title = this.origTitle+ " - Video: " + head; //document.title = this.origTitle+ " - " + this.flashObj.titlePrefix + ": " + head; //document.title = this.flashObj.titlePrefix + ": " + head; window.status = this.flashObj.titlePrefix; //window.status = this.flashObj.titlePrefix; this.setQuery(videoId); this.dispatchEvent("onTitleChange",{title:head, id:videoId}); } catch(e) { } } }, playVideo: function(s, guid, override) { if (override) { this.overridePlayer(s, guid, override); } else { this.flashObj.flashObj.vPlayer(s); ///if (window.location.hash == "") { /// window.location = window.location + "#video"; ///} } }, launch: function(s) { var v = window.open("http://www.msnbc.msn.com/id/21134540/vp/" + s + "#" + s, "_top"); }, setId: function(s) { s = s.replace(/root1/, ""); this.adRef = s + "/adMC"; }, setQuery: function(qs) { // window.location.hash = "#" + qs; }, adCall: function(s) { // x xx x this.flashObj.flashObj.TGotoLabel(this.adRef, s); this.flashObj.flashObj.TPlay(this.adRef); }, expandAd: function() { this.adCall("NGAPExpand"); if (this.collapseAfterAd) { setTimeout(this.vID + ".collapseAd()", 1000); } this.collapseAfterAd = false; }, collapseAd: function() { this.adCall("NGAPCollapse"); }, msnPreRoll: function(adDataObj) { this.collapseAfterAd = adDataObj.collapseOnLoad; this.adUrls = adDataObj.trackgroup; }, report: function(rUrl) { if (this.flashObj.report) { var iRep = document.createElement("img"); iRep.src = rUrl; this.repObj.appendChild(iRep); } }, track: function(s) { this.report(s); }, getSess: function() { var tm = new Date(); var sed = Math && Math.random ? Math.floor(Math.random() * 10000000000000) : tm.getTime(), sess = 's' + Math.floor(tm.getTime() / 10800000) % 10 + sed; return sess; }, neilson: function(head, bAd, sourceName, videoId) { if (videoId) { try { document.title = this.origTitle+ " - " + this.flashObj.titlePrefix + ": " + head; //document.title = this.flashObj.titlePrefix + ": " + head; window.status = this.flashObj.titlePrefix; //window.status = this.flashObj.titlePrefix; this.setQuery(videoId); this.dispatchEvent("onTitleChange",{title:head, id:videoId}); } catch(e) { } } var nUrl = "http://secure-us.imrworldwide.com/cgi-bin/m?ci=us-400132"; nUrl += "&tl=dav0-" + escape(head) + ((bAd) ? "&c3=st,a": "") + "&c6=vc,c03&cg=" + escape(sourceName); nUrl += "&cc=1&rnd=" + (Math.random() * 10000000000000000); this.report(nUrl); }, comscore: function(bAd, sourceName) { var nUrl = "http://beacon.securestudies.com/scripts/beacon.dll?CXNID=3000001&CDID=Msnbc&CPID=en-us&CGID=" + ((bAd) ? "010000": "020000") + "&CBID=" + sourceName + "&rn=" + (Math.floor(Math.random() * 10000000000000000)); this.report(nUrl); }, omMsnbc: function(aProps) { var setProp = function(s) { if (s) { return s; } return ""; }; /* s_msn.prop1 = setProp(aProps[1]); s_msn.prop2 = setProp(aProps[2]); s_msn.prop4 = setProp(aProps[4]); s_msn.prop5 = setProp(aProps[5]); s_msn.prop7 = this.flashObj.omnitureIdentity + "|" + this.flashObj.config; s_msn.prop15 = setProp(aProps[15]); s_msn.prop16 = setProp(aProps[16]); s_msn.prop26 = setProp(aProps[26]); s_msn.prop35 = setProp(aProps[35]); s_msn.prop37 = this.flashObj.flash; s_msn.prop42 = setProp(aProps[42]); s_msn.prop43 = setProp(aProps[43]); s_msn.prop44 = setProp(aProps[44]); s_msn.prop45 = setProp(aProps[45]); s_msn.prop47 = setProp(aProps[47]); s_msn.prop38 = setProp(aProps[38]); if (s_msn.prop16 != "Video Up Next") { s_msn.pageName = s_msn.prop16 + "|" + s_msn.prop4 + "|" + s_msn.prop5 + "|" + s_msn.prop15 + "|" + this.flashObj.omnitureIdentity + "|" + s_msn.prop2; } else { s_msn.pageName = s_msn.prop16; }; if (s_msn.prop43 || s_msn.prop47 || s_msn.prop35) {}; if (this.flashObj.report && (!(s_msn.prop44 == "navigation clicks"))) { var s_code = s_msn.t(); }; */ }, omniture: function(party, prop37, prop38) { switch (party) { case "msn": var tm = new Date(); var t = tm.getDate() + '/' + tm.getMonth() + '/' + tm.getYear() + ' ' + tm.getHours() + ':' + tm.getMinutes() + ':' + tm.getSeconds() + ' ' + tm.getDay() + ' ' + tm.getTimezoneOffset(); try { var rf = document.referrer; rf = (rf) ? rf: location; } catch(e) { var rf = ""; }; var msUrl = "http://msnportal.112.2o7.net/b/ss/msnportalvideotransform,msnportalenusvideo/0/FAS-1.1/" + this.getSess() + "?[AQB]&ndh=1&t=" + t + "&s=" + this.flashObj.omniscreen + "&ce=UTF-8&ns=msnportal&ch=MSNvideo^msnbc&c3=MSNvideo^msnbc&server=www.msnbc.msn.com&c1=MSNvideo^msnbc^" + this.flashObj.omnitureIdentity + "&c2=en-us&" + prop37 + ((prop37.indexOf("contentstart") > -1) ? "&events=event3": "") + "&referrer=" + rf + "&c28=" + rf + "&[AEQ]?"; this.report(msUrl.replace(/18424767/, "NBC Sports")); break; } }, fsC: function(a, b) { if (a.toLowerCase().indexOf("url") == 0) { var w = window.open(this.adUrls[a.toLowerCase()]); } else { if (a == "adLoaded") { setTimeout(this.vID + ".expandAd()", 1); this.adLoaded = true; } if (a == "expand") { setTimeout(this.vID + ".expandAd()", 1); } if (a == "collapse") { this.adCall("NGAPCollapse"); } if (this.adUrls[a.toLowerCase()]) { this.report(this.adUrls[a.toLowerCase()]); } if (a.toLowerCase() == "ngapreplay") { this.report(this.adUrls["replay"]); this.adCall("NGAPExpand"); } } }, doTPS: function(url, img) { if (img) { this.report(img); } if (!url) { if (img.indexOf(".js") > 0) { url = img; } else { return; } } var sDiv = document.getElementById(this.surveyDiv); sDiv.appendChild(document.createElement("