framework_baseURL="http://video.nbcuni.com/framework/";
this.DEBUG=true;
if(typeof console!="object"||!this.DEBUG){
var n=function(){
};
console={warn:n,error:n,info:n,log:n};
}
Function.prototype.method=function(_1,_2){
this.prototype[_1]=_2;
return this;
};
if(typeof FrameworkManager=="undefined"){
FrameworkManager=function(_3){
function Constructor(){
this.manager=(_3)?_3:this;
this.data=new Object();
this.useListArray=new Array();
this.paramInclude="include";
this.paramExclude="exclude";
this.paramEnvironment="env";
this.requiredCoreIncludes=",ErrorManager,EventsManager";
this.environment="";
this.baseLocation=(typeof framework_baseURL=="undefined"||framework_baseURL==null)?"http://video.nbcuni.com/framework/":framework_baseURL;
this.initialize();
}
with(Constructor){
method("parseQuerystring",function(_4){
var _5=new Object();
if(!_4){
return _5;
}
var _6=_4.split(/[;&]/);
for(var i=0;i<_6.length;i++){
var _8=_6[i].split("=");
if(!_8||_8.length!=2){
continue;
}
var _9=unescape(_8[0]);
var _a=unescape(_8[1]);
_a=_a.replace(/\+/g," ");
_5[_9]=_a;
}
return _5;
});
method("initialize",function(){
this.loadData();
var _b=document.getElementsByTagName("script");
var _c=_b[_b.length-1].src.replace(/^[^\?]+\??/,"");
var _d=this.parseQuerystring(_c);
this.environment=(_d[this.paramEnvironment]==null||_d[this.paramEnvironment]=="")?"prod":_d[this.paramEnvironment];
var _e=(_d[this.paramInclude]==""||_d[this.paramInclude]==null)?"":_d[this.paramInclude];
if(_e!=""){
var _f=this.returnArray(_d[this.paramInclude]+this.requiredCoreIncludes,",");
for(var i=0;i<_f.length;i++){
if(this.validateObject(_f[i],this.data)){
this.useListArray=this.getDependencies(_f[i],this.useListArray);
this.useListArray=this.addToArray(_f[i],this.useListArray,false,this.data[_f[i]].objectIncludeOrder);
}
}
}else{
for(prop in this.data){
this.useListArray=this.addToArray(prop,this.useListArray,false,this.data[prop].objectIncludeOrder);
}
}
var _11=(_d[this.paramExclude]==""||_d[this.paramExclude]==null)?"":_d[this.paramExclude];
if(_11!=""){
var _12=this.returnArray(_d[this.paramExclude],",");
for(var i=0;i<_12.length;i++){
this.useListArray=this.removeFromArray(_12[i],this.useListArray);
}
}
for(var i=0;i<this.useListArray.length;i++){
document.write("<scr"+"ipt src=\""+this.baseLocation+this.data[this.useListArray[i]].objectPath+"/"+this.useListArray[i]+".js\" type=\"text/javascript\"></scr"+"ipt>");
}
return true;
});
method("getDependencies",function(_13,_14){
if(this.validateObject(_13,this.data)){
if(this.data[_13].objectDependencies==""){
return _14;
}else{
var _15=this.returnArray(this.data[_13].objectDependencies,",");
for(var i=0;i<_15.length;i++){
_14=this.addToArray(_15[i],_14,false,this.data[_15[i]].objectIncludeOrder);
_14=this.getDependencies(_15[i],_14);
}
}
return _14;
}
return _14;
});
method("validateObject",function(_17,_18){
var _19=false;
for(prop in _18){
if(prop==_17){
_19=true;
}
}
return _19;
});
method("addToArray",function(_1a,_1b,_1c,_1d){
var _1e=false;
if(!(_1c==true||_1c==null||typeof _1c=="undefined")){
if(this.findInArray(_1a,_1b)>-1){
_1e=true;
}
}
if(_1e==false){
if(!(isNaN(_1d))){
if(_1d>_1b.length){
_1b[_1b.length]=_1a;
}else{
_1b.splice(_1d,0,_1a);
}
}else{
switch(_1d){
case "start":
_1b.splice(0,0,_1a);
break;
case "end":
_1b[_1b.length]=_1a;
break;
default:
_1b[_1b.length]=_1a;
}
}
}
return _1b;
});
method("returnArray",function(_1f,_20){
_1f=_1f.split(_20).join(",");
return eval("new Array("+"'"+_1f.replace(/\,/g,"','")+"'"+")");
});
method("findInArray",function(_21,_22){
var _23=-1;
for(var i=0;i<_22.length;i++){
if(_22[i]==_21){
_23=i;
}
}
return _23;
});
method("removeFromArray",function(_25,_26){
var _27=false;
if(this.findInArray(_25,_26)>-1){
_26.splice(this.findInArray(_25,_26),1);
}
return _26;
});
method("buildMainObj",function(_28,_29,_2a,_2b,_2c,_2d){
var _2e=new Object();
_2e.objectName=_28;
_2e.fileName=_29;
_2e.objectPath=_2a;
_2e.objectDependencies=_2b;
_2e.objectIncludeOrder=_2c;
_2e.createBaseObject=_2d;
return _2e;
});
method("loadData",function(){
this.data.DebugManager=this.buildMainObj("debugManager","DebugManager.js","core","",0,true);
this.data.SystemDetectionManager=this.buildMainObj("systemDetectionManager","SystemDetectionManager.js","core","",0,true);
this.data.swfobject=this.buildMainObj("swfobject","swfobject.js","core","",0,false);
this.data.ErrorManager=this.buildMainObj("errorManager","ErrorManager.js","core","SystemDetectionManager",1,true);
this.data.EventsManager=this.buildMainObj("eventsManager","EventsManager.js","core","DebugManager",1,true);
this.data.HashManagerMD5=this.buildMainObj("hashManagerMD5","HashManagerMD5.js","core","DebugManager",1,true);
this.data.StyleManager=this.buildMainObj("styleManager","StyleManager.js","core","DebugManager",1,true);
this.data.OverlayManager=this.buildMainObj("overlayManager","OverlayManager.js","core","DebugManager,StyleManager,EventsManager",3,true);
this.data.SocialBookmarkManager=this.buildMainObj("socialBookmarkManager","SocialBookmarkManager.js","products","DebugManager,StyleManager,EventsManager,OverlayManager","end",true);
this.data.WidgetManager=this.buildMainObj("widgetManager","WidgetManager.js","products","DebugManager,OverlayManager","end",true);
this.data.EmbeddedPlayerManager=this.buildMainObj("embeddedPlayerManager","EmbeddedPlayerManager.js","products","DebugManager,EventsManager,swfobject,OverlayManager,WidgetManager","end",false);
});
}
return new Constructor();
};
}
if(typeof frameworkManager=="undefined"){
frameworkManager=new FrameworkManager();
document.write("<scr"+"ipt src=\""+frameworkManager.baseLocation+"FrameworkManager_helper.js\" type=\"text/javascript\"></scr"+"ipt>");
}

