Function.prototype.method=function(_1,_2){
this.prototype[_1]=_2;
return this;
};
if(typeof console!="object"||!this.DEBUG){
var n=function(){
};
console={warn:n,error:n,info:n,log:n};
}
if(typeof EmbeddedPlayerUtil=="undefined"){
EmbeddedPlayerUtil={getElementPosition:function(e){
var _4=(typeof (e)=="string")?document.getElementById(e):e;
var _5=curtop=0;
if(_4.offsetParent){
_5=_4.offsetLeft;
curtop=_4.offsetTop;
while(_4=_4.offsetParent){
_5+=_4.offsetLeft;
curtop+=_4.offsetTop;
}
}
return {x:_5,y:curtop};
}};
}
if(typeof EmbeddedPlayerManager=="undefined"){
EmbeddedPlayerManager=function(){
function Constructor(){
this.BASE_LOCATION="";
this.TRACKING_JS="";
this.players;
this.companionReference;
this.lastPlayer;
this.fullscreenPlayer=null;
if(!deconcept||!deconcept.SWFObject){
console.error("Couldn't initialize EmbeddedPlayerManager. SWFObject unavailable");
return null;
}
console.info("making shared instance of embeddedPlayerManager. this message should only appear once");
this.players=new Array();
this.initOnResize();
}
with(Constructor){
method("embedPlayer",function(_6,_7,_8,_9,_a,_b,_c,_d,_e,_f,_10,_11,_12){
if(this.players[_6]){
return this.players[_6];
}
if(!document.getElementById(_6)){
var _13="";
}
var _14="";
var _15=384;
var _16=316;
if(_8){
if(typeof _8=="string"&&_8.indexOf("/")!=-1){
_14=_8;
}else{
_13=_8;
}
}
if(typeof _a=="number"&&typeof _b=="number"){
_15=_a;
_16=_b;
}
this.lastPlayer=new EmbeddedPlayer(this,_6,_7,_13,_14,_9,_15,_16,_c,_d,_e,_f,_10,_11,_12);
this.players[_6]=this.lastPlayer;
return this.lastPlayer;
});
method("setCompanion",function(_17){
this.companionReference=_17;
});
method("getCompanionReference",function(){
return this.companionReference;
});
method("getPlayer",function(_18){
try{
if(typeof _18=="undefined"){
return this.lastPlayer;
}
this.lastPlayer=this.players[_18];
return this.lastPlayer;
}
catch(e){
}
});
method("pauseAll",function(){
try{
for(var i in this.players){
if(this.players[i].id){
this.players[i].pause();
}
}
}
catch(e){
}
});
method("setActiveFullscreen",function(_1a){
this.fullscreenPlayer=_1a;
});
method("unFullscreen",function(){
this.fullscreenPlayer.fullscreen(false);
});
method("updatePositions",function(){
for(var i in this.players){
var _1c=this.players[i];
if(_1c.id){
var _1d=EmbeddedPlayerUtil.getElementPosition("placeholder_"+_1c.id);
_1c.container.style.left=_1d.x+"px";
_1c.container.style.top=_1d.y+"px";
if(navigator.userAgent.toLowerCase().indexOf("msie")>-1){
_1c.container.style.left=parseInt(_1c.container.style.left)+1+"px";
_1c.container.style.top=parseInt(_1c.container.style.top)+1+"px";
}
}
}
});
method("initOnResize",function(){
var _1e=this;
if(typeof (window.onresize)!="function"){
window.onresize=function(){
_1e.updatePositions();
};
}else{
if(!this.oldResize){
this.oldResize=window.onresize;
}
window.onresize=function(){
_1e.oldResize();
_1e.updatePositions();
};
}
});
method("resetOnResize",function(){
if(this.oldResize){
window.onresize=this.oldResize;
}else{
window.onresize=null;
}
this.initOnResize();
});
}
return new Constructor();
};
}
if(typeof EmbeddedPlayer=="undefined"){
EmbeddedPlayer=function(_1f,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_2a,_2b,_2c,_2d){
function Constructor(){
this.manager=_1f;
this.id=_20;
this.onMetadata;
this.onClearMetadata;
this.companion;
this.swf;
this.container;
this.trackingiframe;
this.companioniframe;
this.width=_25;
this.height=_26;
this.isFullscreen=false;
this.isFullscreenEnabled=(_24==true);
this.isPlayingAd=false;
this.placeholder;
this.oldWin;
this.lastScrollPos;
this.divIDList=new Array();
this.cssPropertyList1;
this.cssPropertyList2;
if(!document.getElementById("trackingiframe")){
console.log("Tracking IFrame not found, adding.");
var _2e=document.createElement("iframe");
with(_2e){
setAttribute("src","about:blank");
setAttribute("id","trackingiframe");
setAttribute("name","trackingiframe");
setAttribute("width","1");
setAttribute("height","1");
setAttribute("marginwidth","0");
setAttribute("frameborder","0");
style.position="absolute";
style.top="0px";
style.left="0px";
style.display="none";
}
document.body.appendChild(_2e);
}
this.trackingiframe=document.getElementById("trackingiframe");
this.companioniframe=document.getElementById(_21);
var _2f="player_"+_20;
var _30=new deconcept.SWFObject(embeddedPlayerManager.BASE_LOCATION+"embedded.swf",_2f,null,null,"8","#000000",true);
_30.addParam("allowScriptAccess","always");
_30.addParam("wmode","opaque");
_30.addParam("allowFullScreen","true");
if(_22){
_30.addVariable("deepLinkID",_22);
}
if(_23){
_30.addVariable("deepLinkPath",_23);
}
if(_27){
_30.addVariable("videoControls",_27);
}
if(_28!=undefined){
_30.addVariable("exitFullscreenOnVideoComplete",_28);
}
if(_29){
_30.addVariable("overrideKeyword",_29);
}
if(_2a){
_30.addVariable("overrideVideoID",_2a);
}
if(_2b){
_30.addVariable("embVal",_2b);
}
if(_2c){
_30.addVariable("configLocation",_2c);
}
if(_2d){
_30.addVariable("overrideNetworkID",_2d);
}
if(embeddedPlayerManager.BASE_LOCATION){
_30.addVariable("BASE_LOCATION",embeddedPlayerManager.BASE_LOCATION);
}
_30.addVariable("playerID",_20);
if(this.isFullscreenEnabled){
this.container=document.createElement("div");
var _31="container_"+this.id;
this.container.id=_31;
this.container.className="fullscreenPlayer";
document.body.appendChild(this.container);
with(this.container.style){
position="absolute";
width=_25+"px";
height=_26+"px";
margin="0";
padding="0";
backgroundColor="#000";
border="none";
}
this.placeholder=document.createElement("div");
this.placeholder.id="placeholder_"+this.id;
document.getElementById(_20).appendChild(this.placeholder);
with(this.placeholder.style){
width=_25+"px";
height=_26+"px";
margin="0";
padding="0";
border="none";
}
var _32=EmbeddedPlayerUtil.getElementPosition("placeholder_"+this.id);
this.container.style.left=_32.x+"px";
this.container.style.top=_32.y+"px";
if(navigator.userAgent.toLowerCase().indexOf("msie")>-1){
this.container.style.left=parseInt(this.container.style.left)+1+"px";
this.container.style.top=parseInt(this.container.style.top)+1+"px";
}
_30.setAttribute("width","100%");
_30.setAttribute("height","100%");
_30.write(_31);
}else{
_30.setAttribute("width",_25);
_30.setAttribute("height",_26);
_30.write(_20);
}
this.swf=document.getElementById(_2f);
}
with(Constructor){
method("onFullscreen",function(_33){
if(typeof _33!="boolean"){
return;
}
if(!this.isFullscreenEnabled){
console.warn("Fullscreen not enabled for this player.");
return;
}
this.isFullscreen=_33;
if(this.isFullscreen){
this.setOldWindowParameters();
window.onresize=function(){
};
try{
vp_function_fullscreenStart();
}
catch(err){
console.warn("Function call does not exist: vp_function_fullscreenStart()");
}
this.onEnterFullScreenCSS();
this.goFullScreen();
}else{
var c=this.container;
with(c.style){
top=left=right=bottom="";
}
this.placeholder.style.width=this.width+"px";
this.placeholder.style.height=this.height+"px";
var _35=EmbeddedPlayerUtil.getElementPosition("placeholder_"+this.id);
c.style.width=this.width+"px";
c.style.height=this.height+"px";
c.style.left=_35.x+"px";
c.style.top=_35.y+"px";
if(navigator.userAgent.toLowerCase().indexOf("firefox")==-1){
if(document.documentElement){
document.documentElement.style.overflow="";
if(navigator.userAgent.toLowerCase().indexOf("safari")>-1){
document.body.style.overflow="visible";
}
}else{
document.body.style.overflow="";
}
}
window.onscroll=function(){
};
this.manager.resetOnResize();
if(!document.all){
top.window.resizeTo(this.oldWin.w,this.oldWin.h);
top.window.moveTo(this.oldWin.l,this.oldWin.t);
window.scrollTo(0,this.lastScrollPos);
}else{
top.window.resizeTo(this.oldWin.w,this.oldWin.h);
top.window.moveTo(this.oldWin.l,this.oldWin.t);
window.scrollTo(0,this.lastScrollPos);
}
try{
vp_function_fullscreenEnd();
}
catch(err){
console.warn("Function call does not exist: vp_function_fullscreenEnd()");
}
this.onExitFullScreenCSS();
}
});
method("setFullScreenElementIDs",function(_36){
this.divIDList=_36.split(",");
});
method("onEnterFullScreenCSS",function(){
this.cssPropertyList1=new Array();
this.cssPropertyList2=new Array();
var _37="";
var _38="";
for(var i=0;i<this.divIDList.length;i++){
try{
if(_37!=""){
_37=_37+",";
}
if(_38!=""){
_38=_38+",";
}
_37=_37+embeddedVideoPlayerGetStyle(this.divIDList[i].toString(),"overflow");
_38=_38+embeddedVideoPlayerGetStyle(this.divIDList[i].toString(),"visibility");
console.info("ENTER-BEFORE:"+i+"|"+this.divIDList[i].toString()+"|"+embeddedVideoPlayerGetStyle(this.divIDList[i].toString(),"overflow")+"|"+embeddedVideoPlayerGetStyle(this.divIDList[i].toString(),"visibility"));
document.getElementById(this.divIDList[i].toString()).style.overflow="hidden";
document.getElementById(this.divIDList[i].toString()).style.visibility="hidden";
console.info("ENTER-AFTER:"+i+"|"+this.divIDList[i].toString()+"|"+embeddedVideoPlayerGetStyle(this.divIDList[i].toString(),"overflow")+"|"+embeddedVideoPlayerGetStyle(this.divIDList[i].toString(),"visibility"));
}
catch(err){
console.warn("onEnterFullScreenCSS:"+i+err);
}
}
this.cssPropertyList1=_37.split(",");
this.cssPropertyList2=_38.split(",");
});
method("onExitFullScreenCSS",function(){
for(var i=0;i<this.divIDList.length;i++){
try{
console.info("EXIT-BEFORE:"+i+"|"+this.divIDList[i].toString()+"|"+embeddedVideoPlayerGetStyle(this.divIDList[i].toString(),"overflow")+"|"+embeddedVideoPlayerGetStyle(this.divIDList[i].toString(),"visibility"));
document.getElementById(this.divIDList[i].toString()).style.overflow=this.cssPropertyList1[i].toString();
document.getElementById(this.divIDList[i].toString()).style.visibility=this.cssPropertyList2[i].toString();
console.info("EXIT-AFTER:"+i+"|"+this.divIDList[i].toString()+"|"+embeddedVideoPlayerGetStyle(this.divIDList[i].toString(),"overflow")+"|"+embeddedVideoPlayerGetStyle(this.divIDList[i].toString(),"visibility"));
}
catch(err){
console.warn("onExitFullScreenCSS"+err);
}
}
});
method("goFullScreen",function(){
top.window.moveTo(0,0);
if(document.all){
top.window.resizeTo(screen.availWidth,screen.availHeight);
}else{
if(document.layers||document.getElementById){
if(top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight=top.screen.availHeight;
top.window.outerWidth=top.screen.availWidth;
}
}
}
if(navigator.userAgent.toLowerCase().indexOf("mac")>-1&&navigator.userAgent.toLowerCase().indexOf("netscape")>-1){
top.window.moveTo(0,0);
}
if(navigator.userAgent.toLowerCase().indexOf("safari")>-1){
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
var _3b=this.setContainer();
window.onscroll=function(){
window.scrollTo(0,_3b);
};
window.onscroll();
var _3c=this;
window.onresize=function(){
_3c.setContainer();
};
});
method("setContainer",function(){
var c=this.container;
var _3e=0;
if(navigator.userAgent.toLowerCase().indexOf("firefox")==-1){
if(document.documentElement&&document.documentElement.scrollTop){
document.documentElement.style.overflow="hidden";
_3e=document.documentElement.scrollTop;
}else{
if(document.body.scrollTop){
if(navigator.userAgent.toLowerCase().indexOf("safari")>-1){
document.body.style.overflow="visible";
}else{
document.body.style.overflow="hidden";
}
_3e=document.body.scrollTop;
}
}
if(this.lastScrollPos==null){
this.lastScrollPos=_3e;
}
}else{
if(this.lastScrollPos==null){
this.lastScrollPos=window.pageYOffset;
}
}
var ch=0;
var cw=0;
if(typeof (window.innerWidth)=="number"){
ch=window.innerHeight;
cw=window.innerWidth;
}else{
if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){
ch=document.documentElement.clientHeight;
cw=document.documentElement.clientWidth;
}else{
if(document.body&&(document.body.clientWidth||document.body.clientHeight)){
ch=document.body.clientHeight;
cw=document.body.clientWidth;
}
}
}
with(c.style){
if(document.all&&!window.opera){
height=ch+"px";
width=cw+"px";
}else{
height="100%";
width="100%";
}
left="0px";
right="0px";
bottom="0px";
top=_3e+"px";
}
return _3e;
});
method("setOldWindowParameters",function(){
this.oldWin=new Object();
this.oldWin.l=top.window.screenX||top.window.screenLeft-4;
this.oldWin.t=top.window.screenY||top.window.screenTop-104;
if(document.all){
this.oldWin.w=document.documentElement.clientWidth+30;
this.oldWin.h=document.documentElement.clientHeight+135;
}else{
this.oldWin.h=top.window.outerHeight;
this.oldWin.w=top.window.outerWidth;
}
this.lastScrollPos=null;
});
method("onPlayVideo",function(_41){
var _42=this.isPlayingAd;
this.isPlayingAd=_41.isAd;
if(_42&&!this.isPlayingAd){
this.companion=embeddedPlayerManager.getCompanionReference();
if(this.companion!=""&&this.companion!=null){
}
}
});
method("onExecuteTrackingJS",function(_43){
if(typeof embeddedPlayerManager.TRACKING_JS=="string"&&_43!="undefined"&&_43!=undefined){
this.trackingiframe.src=embeddedPlayerManager.TRACKING_JS+_43;
}
});
method("onLoadCompanion",function(evt){
var _45="";
var _46=0;
for(var key in evt){
if(_46==0){
if(evt[key]!=undefined){
_45+=key+"="+escape(evt[key]);
}
}else{
if(evt[key]!=undefined){
_45+="&"+key+"="+escape(evt[key]);
}
}
_46+=1;
}
if(typeof embeddedPlayerManager.COMPANION_RENDERER=="string"){
this.companioniframe.src=embeddedPlayerManager.COMPANION_RENDERER+_45;
}
});
method("play",function(){
try{
this.swf.playVideo();
}
catch(e){
}
});
method("pause",function(){
try{
this.swf.pauseVideo();
}
catch(e){
}
});
method("playVideoByPathID",function(_48,_49,_4a,_4b,_4c){
try{
this.swf.playVideoByPathID(_48,_49,_4a,_4b,_4c);
}
catch(e){
}
});
method("playVideoByPath",function(_4d,_4e,_4f,_50,_51){
try{
this.swf.playVideoByPath(_4d,_4e,_4f,_50,_51);
}
catch(e){
}
});
method("browserWindowBeforeUnload",function(){
try{
if(this.isPlayingAd){
return;
}
this.swf.onBrowserWindowBeforeUnload();
}
catch(e){
}
});
method("setMetadataContainers",function(_52,_53,_54,_55){
if(typeof (_52)=="string"){
_52=document.getElementById(_52);
}
if(typeof (_53)=="string"){
_53=document.getElementById(_53);
}
if(typeof (_54)=="string"){
_54=document.getElementById(_54);
}
if(typeof (_55)=="string"){
_55=document.getElementById(_55);
}
this.onMetadata=function(_56){
if(_52){
_52.innerHTML=_56.name;
}
if(_53){
_53.innerHTML=_56.subtitle;
}
if(_54){
_54.innerHTML=_56.description;
}
if(_55){
_55.innerHTML=_56.schedule;
}
};
this.onClearMetadata=function(){
var _57="";
if(_52){
_52.innerHTML=_57;
}
if(_53){
_53.innerHTML=_57;
}
if(_54){
_54.innerHTML=_57;
}
if(_55){
_55.innerHTML=_57;
}
};
});
method("resizePlayer",function(_58,_59){
try{
this.width=_58;
this.height=_59;
var c=this.container;
with(c.style){
top=left=right=bottom="";
}
this.placeholder.style.width=this.width+"px";
this.placeholder.style.height=this.height+"px";
var _5b=EmbeddedPlayerUtil.getElementPosition("placeholder_"+this.id);
c.style.width=this.width+"px";
c.style.height=this.height+"px";
c.style.left=_5b.x+"px";
c.style.top=_5b.y+"px";
if(navigator.userAgent.toLowerCase().indexOf("msie")>-1){
c.style.left=parseInt(c.style.left)+1+"px";
c.style.top=parseInt(c.style.top)+1+"px";
}
}
catch(e){
}
});
method("toggleFullscreen",function(){
try{
this.swf.toggleFullscreen();
}
catch(e){
}
});
}
return new Constructor();
};
}
if(typeof embeddedPlayerManager=="undefined"){
embeddedPlayerManager=new EmbeddedPlayerManager();
this.onEmbeddedPlayerEvent=function(_5c,_5d,_5e){
if(typeof embeddedPlayerManager.getPlayer(_5c)=="object"&&typeof embeddedPlayerManager.getPlayer(_5c)[_5d]=="function"){
console.info("Message",_5d);
embeddedPlayerManager.getPlayer(_5c)[_5d](_5e);
}else{
console.warn("Event type %s not supported.",_5d);
}
};
this.videoplayer=function(_5f,_60,_61,_62){
if(typeof _62=="undefined"){
_62={};
}
var _63=window.onload;
window.onload=function(){
if(typeof _63=="function"){
_63();
}
var vp=embeddedPlayerManager.embedPlayer(_5f,_60,_61,_62["fullscreen"],_62["width"],_62["height"],_62["controls"],_62["exitFullscreenOnVideoComplete"]);
vp.setMetadataContainers(_62["name"],_62["subtitle"],_62["description"],_62["schedule"],_62["catalog"],_62["id"],_62["path"],_62["streamName"],_62["allowPreroll"],_62["usOnly"],_62["keywordContainer"],_62["suppressTimerContainer"],_62["thumbSmallContainer"],_62["thumbLargeContainer"]);
};
};
this.doAfterLoad=function(f){
if(typeof f!="function"){
return;
}
var _66=window.onload;
window.onload=function(){
if(typeof _66=="function"){
_66();
}
f();
};
};
}
embeddedPlayerManager.BASE_LOCATION="";
embeddedPlayerManager.TRACKING_JS="http://video.nbcuni.com/dynamic/ad_tracking.php?source=";
embeddedPlayerManager.COMPANION_RENDERER="http://video.nbcuni.com/dynamic/companionFalk.php?";
function embeddedVideoPlayerGetStyle(el,_68){
var x=document.getElementById(el);
if(x.currentStyle){
var y=x.currentStyle[_68];
}else{
if(window.getComputedStyle){
var y=document.defaultView.getComputedStyle(x,null).getPropertyValue(_68);
}
}
return y;
}
if(typeof window.onbeforeunload=="function"){
var oldBeforeUnload=window.onbeforeunload;
window.onbeforeunload=function(){
try{
oldBeforeUnload();
executeOnUnload();
}
catch(e){
}
};
}else{
window.onbeforeunload=function(){
try{
executeOnUnload();
}
catch(e){
}
};
}
function executeOnUnload(){
__flash_unloadHandler=function(){
};
__flash_savedUnloadHandler=function(){
};
if(typeof window.onunload=="function"){
var _6b=window.onunload;
window.onunload=function(){
try{
embeddedPlayerManager.getPlayer().browserWindowBeforeUnload();
deconcept.SWFObjectUtil.cleanupSWFs();
_6b();
}
catch(e){
}
};
}else{
try{
embeddedPlayerManager.getPlayer().browserWindowBeforeUnload();
window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;
}
catch(e){
}
}
}

