function inheritAll() {
	for (var i = 1; i < arguments.length; i++) {
		for (x in arguments[i].prototype) {
			arguments[0].prototype[x] = arguments[i].prototype[x];
		}
	}
}

function myPlaylistVideo(videoId,videoTab){
        this.id = videoId;
        this.tab = videoTab;
}

function CNNPlaylistManager() {
	if (CNNPlaylistManager.caller != CNNPlaylistManager.getInstance) {
		if((navigator.userAgent.indexOf('Safari')==-1) && (navigator.userAgent.indexOf('Opera')==-1)) {
			throw new Error("There is no public constructor for CNNPlaylistManager.");
		}
	}
	this.slateMessage = null;
	this.jsonurls = null;
	this.tab = 'notab';
	this.t1PageType = 'Unknown T1 Page';
	this.singleUrl = null;
	this.noIEStorage = false;
	this.noCookies = false;
	this.forceSensitive = false;
	this.dataObject = null;
	this.cnnIsIntl = (location.hostname.indexOf('edition.') > -1) ? true : false; 
	this.moscarray = null;
	this.startVideo = null;
	this.playerName = null;
	this.doNotResetSynchOnPreroll = false;
	this.skipStartSlateButLoadSynch = false;
	this.sensitiveSynchDisplaying = false;
	this.playlists = new Array();
	this.activePlaylist = null;
	this.splashActive = false;
	this.isSmall = false;
	this.playStartSlate = true;
	this.playlistType = '';
	this.mosPreloaded = false;
	this.runNextUpSlate = false;
	this.vidString = 'BVP';
	this.vidContext = 'BVP';
	this.raceCondition = false;
	this.nextUpSlate = null;
	this.endSlate = null;
	this.raceVideos = 0;
	this.raceFunction = null;
	this.endSlate = false;
	this.playingFirstVideo = true;
	this.mosSlateActive = true;
	this.slateSize = '576x324';
	this.onlyCallMeOnce = false;
	this.isVideoError = false;
	this.loadFirstVideo = null;
	this.switchToMyList = false;
	this.errorObject = null;
	this.playlist = function(jsonList,pointer,tabList) {
		this.jsonList = jsonList;
		this.tabList = new Array();
		if(tabList){
			this.tabList = tabList;
		}
		this.pointer = pointer;
		this.playlistJsonObjs = null;
		this.activeJson = function() { return this.jsonList[this.pointer]; }
	}
	this.testCookies = function() {
		document.cookie = 'CNNTestCookie=yes; path=/';
		if (document.cookie.length > 0) {
			if (document.cookie.indexOf('CNNTestCookie') < 0) {
				this.noCookies = true;
			}
		} else { this.noCookies = true; }
	}
	this.advanceTo = function(playlistName,val) {
		if (this.noCookies == false) {
			if (this.splashActive) {
				this.splashActive = false;
				document.getElementById('cnnVPFlashLargeContainer').style.backgroundImage = '';
				document.getElementById('cnnVPFlashLargeContainer').innerHTML = '';
			}
			if (this.activePlaylist != playlistName) {
				if (this.activePlaylist != null && this.activePlaylist != '') {
					this.unHighlight();
				}
				this.activePlaylist = playlistName;
				this.playlists[this.activePlaylist].pointer = val;
				if (this.onlyCallMeOnce == false) {
					this.onlyCallMeOnce = true;
					CNNPlayer.getActivePlayer().setPlayerContext(this.vidContext);
					CNNPlayer.getActivePlayer().createPlayListContext(this.vidString);
				}
				CNNPlayer.getInstance('','advanceTo1').loadContent(this.playlists[this.activePlaylist].jsonList,this.playlists[this.activePlaylist].activeJson());
			} else {
				this.playlists[this.activePlaylist].pointer = val;
				CNNPlayer.getInstance('','advanceTo2').setCurrentPlayListPosition(this.playlists[this.activePlaylist].activeJson());			
			}
			this.highlight();
			this.mosPreloaded = true;
		}
	}
	this.setPlaylist = function(playlistName,callBackFunc) {
		pt = this.playlists[playlistName];
		this.getPlayer().serializerFactory = xmp.baseplayer.MetaFileLoaderFactory.getInstance().create('videoContentMeta');
		pt.playlistJsonObjs = this.getPlayer().serializerFactory.setIds(pt.jsonList, (new xmp.util.Callback('contentItemCB', CNNPlayer.playlistContentItemCB, null)));	
		this.getPlayer().serializerFactory.setAllLoadedCallback(new xmp.util.Callback('allContentItemsCB', callBackFunc, null));
		this.getPlayer().serializerFactory.load();
	}
	this.getPlayer = function() {
		return CNNPlayer.getInstance('','getPlayer');
	}
	this.unHighlight = function() {
		if (this.activePlaylist != 'hottplaylist' && this.activePlaylist != 't1playlist' && this.activePlaylist != 'saplaylist') {
			ppp = this.playlists[this.activePlaylist];
			if (this.activePlaylist != 'mosplaylist') {
				if (this.activePlaylist == 'bvpplaylist')
					classpre = 'nextup_';
				else
					classpre = 'myup_';
				unactiveClassname = 'box_item';
			} else {
				classpre = 'mos_';
				unactiveClassname = 'mos_video_box';
			}
			for (var i = 0; i < ppp.playlistJsonObjs.length; i++) {
				document.getElementById(classpre+i).className = unactiveClassname;
				if (classpre == 'myup_') {
					document.getElementById('myupgraydiv_'+i).innerHTML = '<a href="javascript:CNNPlaylistManager.getInstance().MYPMRemove('+i+');"><img name="myupgray_'+i+'" id="myupgray_'+i+'" src="http://i.l.cnn.net/cnn/video/bvp/images/close_btn.gif" width="12" height="12" alt="" border="0"></a>';
				}
			}
		}
	}
	this.highlight = function() {
		if (this.activePlaylist != 'hottplaylist' && this.activePlaylist != 't1playlist' && this.activePlaylist != 'saplaylist') {
			ppp = this.playlists[this.activePlaylist];
			if (this.activePlaylist != 'mosplaylist') {
				if (this.activePlaylist == 'bvpplaylist')
					classpre = 'nextup_';
				else
					classpre = 'myup_';
				activeClassname = 'box_item_play';
			} else {
				classpre = 'mos_';
				activeClassname = 'mos_video_box_active';
			}
			this.unHighlight();
			document.getElementById(classpre+ppp.pointer).className=activeClassname;
				if (classpre == 'myup_') {
					document.getElementById('myupgraydiv_'+ppp.pointer).innerHTML = '&nbsp;';
				}
		}
	}
	this.emailLink = function(pl) {
		this.emailThis(this.dataObject);
	}
	this.emailCurrent = function(pl) {
		this.emailThis(this.dataObject);
	}
	this.emailVideo = function() {
		this.emailThis(this.dataObject);
	}
	this.emailThis = function(obj) {
		clickTitle = this.dataObject.headline;
		clickURL = ((window.location.href.split("/"))[2])+'/video/#/'+this.dataObject.id.slice(1,this.dataObject.id.length);
		commonLoc="&fb=Y&url="+escape(getClickURL())+"&title="+escape(getClickTitle())+"&random="+Math.random()+"&partnerID="+partnerID+"&expire="+escape(getClickExpire());
		ET();
	}
	this.errorMessageGenerator = function() {
		if (this.errorObject == null) {
			return "Unspecified Fatal Error";
		}
		if (this.errorObject._code == xmp.XmpErrorCodes.FATAL_PLATFORM) {
			this.errorObject = null;
			var str = 'The web browser you are using to view this video is not supported.  Please use one of the supported browsers:';
			if (navigator.userAgent.indexOf('Windows') > -1) {
				str += '<br><b>Windows</b><br><a href="http://www.microsoft.com/windows/products/winfamily/ie/default.mspx" target="_blank">Microsoft Internet Explorer 6 and above</a><br>';
				str += '<a href="http://en.www.mozilla.com/en/firefox/" target="_blank">Firefox 1.5 and above</a>';
			}
			if (navigator.userAgent.indexOf('Mac') > -1) {
				str += '<br><b>Macintosh</b><br><a href="http://www.apple.com/support/downloads/safariupdate201.html" target="_blank">Safari 2.0.4 and above</a><br>';
				str += '<a href="http://en.www.mozilla.com/en/firefox/" target="_blank">Firefox 1.5 and above</a>';
			}
			return str;
		}
		if (this.errorObject._code == xmp.XmpErrorCodes.FATAL_PLUGIN) {
			str = ('A plugin required to play your video could not be located.<br><br>Please ensure the <a href="'+this.errorObject.plugIn.downloadUrl+'" target="_blank">'+this.errorObject.plugIn.displayName+'</a> is installed properly.');
			this.errorObject = null;
			return str;
			// plugin error
		}
		if (this.errorObject._code == xmp.XmpErrorCodes.FATAL_PLUGIN_INIT) {
			this.errorObject = null;
			return ('The video timed out attempting to play.<br><br>Please ensure that you do not have any Flash Blocking plugins active.');
		}
		if (this.errorObject._code >= xmp.XmpErrorCodes.CRITICAL_UNSPECIFIED_AJAX_ERROR && this.errorObject._code <= xmp.XmpErrorCodes.CRITICAL_PLAYER_CONNECTION) {
			this.errorObject = null;
			return ('The video system was not able to establish connectivity due to a Proxy/Firewall or network connectivity.');
		}
	}
	this.errorSlate = function() {
		if (this.activePlaylist == 'bvpplaylist' || this.activePlaylist == 'myplaylist' || this.activePlaylist == 'mosplaylist') {
			var str = '<div style="font-family:arial, sans-serif; color:#838383; font-size:11px; width: 100%; height: 100%; background-color: #f4f4f4;"><div style="padding: 138px 0px 0px 0px; text-align: center; width: 100%;"><font style="font-size: 22px;">'+this.errorMessageGenerator()+'</div></div>';
		} else {
			var str = '<div style="font-family:arial, sans-serif; color:#838383; font-size:11px; width: 100%; height: 100%; background-color: #f4f4f4;"><div style="padding: 5px 0px 0px 0px; text-align: center; width: 100%;">'+this.errorMessageGenerator()+'</div></div>';
		}
		document.getElementById('cnnVPFlashLargeContainer').innerHTML = str;
	}
	this.flashDetection = function() {
		if (
				((window.navigator.platform.toLowerCase()).indexOf('mac') > -1 &&
				new CNN_FlashDetect().detectVersion(9)) ||
				((window.navigator.platform.toLowerCase()).indexOf('mac') < 0 &&
				new CNN_FlashDetect().detectVersion(8))) {
			return true;
		} else {
			return false;
		}
	}
}

CNNPlaylistManager.__instance__ = null; 

CNNPlaylistManager.getInstance = function (playerName) {
	if (this.__instance__ == null) {
		inheritAll(CNNPlaylistManager,BVPPlaylistManager,MYPlaylistManager,MOSCPlaylistManager,HOTTPlaylistManager,T1PlaylistManager,SAPlaylistManager);
		this.__instance__ = new CNNPlaylistManager();
		this.__instance__.playerName = playerName;
		currentPlayer = playerName;
	}
	return this.__instance__;
}
CNNPlaylistManager.isBootStrapped = null;
CNNPlaylistManager.endOfVideoContent = function(advancePointerButNotContent) {
	if (CNNPlaylistManager.getInstance().switchToMyList == false) {
		CNNPlaylistManager.getInstance().switchToMyList = false;
		ppp = CNNPlaylistManager.getInstance().playlists[CNNPlaylistManager.getInstance().activePlaylist];
		if (ppp.playlistJsonObjs.length - 1 != ppp.pointer) {
			ppp.pointer++;
			CNNPlaylistManager.getInstance().highlight();
			CNNPlaylistManager.getInstance().runNextUpSlate = true;
		}
		CNNPlayer.getInstance('','endOfVideoContent').advance();
	} else {
		CNNPlaylistManager.getInstance().switchToMyList = false;
		load_Play_List('navMyPlay_List');
		CNNPlaylistManager.getInstance().advanceTo('myplaylist',0);
	}
}
CNNPlaylistManager.findImageSize = function(imageSizeArray, id) {
	for (var i = 0; i < imageSizeArray.length; i++) {
		if (imageSizeArray[i].id == id) {
			return imageSizeArray[i].resource;
		}
	}
	return ("http://i.l.cnn.net/cnn/.element/img/2.0/global/misc/"+id+".no.photo.gif");
}
CNNPlaylistManager.providedResponse = function(pObj) {
	var rstr = '';
	try {
		for (var i = 0; i < pObj.length; i++) {
			if (pObj[i].url != null && pObj[i].url != '')
				rstr += '<a href="'+pObj[i].url+'" target="_blank">'+pObj[i].source+'</a>';
			else
				rstr += pObj[i].source;
			if (i < pObj[i].length - 1)
				rstr += ', ';
		}
	} catch(err) {}
	return rstr;
}

function SAPlaylistManager() {}
SAPlaylistManager.prototype.SAConfiguration = null;
SAPlaylistManager.prototype.SALoadVideo = function(configuration) {
	if (this.flashDetection()) {
		this.SAConfiguration = configuration;
		this.jsonurls = this.SAConfiguration.videoArray;
		this.vidContext = this.SAConfiguration.vidContext;
		this.vidString = this.SAConfiguration.vidString;
		this.slateSize = this.SAConfiguration.slateSize[0]+"x"+this.SAConfiguration.slateSize[1];
		CNNPlaylistManager.isBootStrapped = SAIsBootStrapped;
		CNNPlayer.create();
	} else {
		setTimeout("CNNPlaylistManager.getInstance().SANoFlashTimer()",1000);		
	}
}
SAPlaylistManager.prototype.SABootStrapCallback = function(success) {
	if (success) {
		this.playlists['saplaylist'] = new this.playlist(this.jsonurls,this.SAConfiguration.startPoint);
		this.setPlaylist('saplaylist',SAPlaylistUICallback);
	} else {
		if (this.errorObject != null) {
			this.SAConfiguration.bootErrorHandler(this.errorObject._code);
		} else {
			this.SAConfiguration.bootErrorHandler("General Error");
		}
	}
}
SAPlaylistManager.prototype.SAWriteSplash = function() {
	this.playlistType = 'sa';
	this.playStartSlate = true;
	this.dataObject = this.playlists['saplaylist'].playlistJsonObjs[this.SAConfiguration.startPoint].getDataObject();
	CNNPlaylistManager.getInstance().advanceTo('saplaylist',this.SAConfiguration.startPoint);
}
SAPlaylistManager.prototype.SANoFlashTimer = function() {
	this.SAConfiguration.bootErrorHandler('No Flash');
}

function T1PlaylistManager() {}
T1PlaylistManager.prototype.T1LoadVideo = function(jsonurl,pageType) {
        this.singleUrl = jsonurl;
        if (this.flashDetection()) {
		if(pageType){
                        this.t1PageType = pageType;
                }else{
                        this.t1PageType = 'T1 - Unknown Page';
                }
                this.vidContext = 'CNNHomePage';
                this.vidString = 'CNNHomePage';
                this.slateSize = '256x144';
                CNNPlaylistManager.isBootStrapped = T1IsBootStrapped;
                CNNPlayer.create();
        } else {
                setTimeout("CNNPlaylistManager.getInstance().T1NoFlashTimer()",1000);
        }
}
T1PlaylistManager.prototype.T1NoFlashTimer = function() {
	document.getElementById('cnnVPFlashLargeContainer').innerHTML = '<div style="font-family:arial, sans-serif; color:#838383; font-size:11px; width: 100%; height: 100%; background-color: #f4f4f4;"><div style="padding: 5px 0px 0px 0px; text-align: center; width: 100%;">This CNN.com feature is optimized for<br>Adobe Flash Player version '+(((window.navigator.platform.toLowerCase()).indexOf('mac') > -1) ? '9' : '8')+' or higher.<br><a href="http://www.adobe.com/go/getflashplayer" target="blank"><img src="http://i.l.cnn.net/cnn/.element/img/2.0/global/noflash/install_btn.gif" class="cnnGetBtn" width="155" height="31" alt="Get Flash Player" border="0"></a></div></div>';		
}
T1PlaylistManager.prototype.T1BootStrapCallback = function() {
		this.playlists['t1playlist'] = new this.playlist(new Array(this.singleUrl),0);
		var so =new SWFObject("/video/xmp/MediaControls.swf", "mediacontrols" , "256", "51", 8, "#FFFFFF", true);
		so.addParam("allowscriptAccess", "always");
		so.addVariable("FLASHVAR_eventHandler", "CNNPlayer.getActivePlayer().handleEvent");		
		so.addVariable("FLASHVAR_layout", "SCRUBBER_ABOVE");
		so.write("t1ControlsContainer");
		this.setPlaylist('t1playlist',T1PlaylistUICallback);
}
T1PlaylistManager.prototype.T1WriteSplash = function() {
	this.playlistType = 't1';
	this.playStartSlate = true;
	this.dataObject = this.playlists['t1playlist'].playlistJsonObjs[0].getDataObject();
	callControllerMethod('setEmailEnabled',true);
	CNNPlaylistManager.getInstance().advanceTo('t1playlist',0);
}

function HOTTPlaylistManager() {}
HOTTPlaylistManager.prototype.HOTTLoadVideo = function(jsonurl) {
	this.singleUrl = jsonurl;
	if (this.flashDetection()) {
		if (this.cnnIsIntl) {
//			xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath("rootUrlMap/adMan")._map["rootUrl"] = "http://edition.cnn.com";
		}
		this.vidContext = 'CNNHotTopic';
		this.vidString = 'CNNHotTopic';
		this.slateSize = '384x216';
		CNNPlaylistManager.isBootStrapped = HOTTIsBootStrapped;
		CNNPlayer.create();		
	} else {
		setTimeout("CNNPlaylistManager.getInstance().HOTTNoFlashTimer()",1000);
	}
}
HOTTPlaylistManager.prototype.HOTTBootStrapCallback = function() {
		this.playlists['hottplaylist'] = new this.playlist(new Array(this.singleUrl),0);
		var so =new SWFObject("/video/xmp/MediaControls.swf", "mediacontrols" , "384", "47", 8, "#FFFFFF", true);
		so.addParam("allowscriptAccess", "always");
		so.addVariable("FLASHVAR_eventHandler", "CNNPlayer.getActivePlayer().handleEvent");		
		so.addVariable("FLASHVAR_layout", "SCRUBBER_ABOVE");
		so.write("htControlsContainer");
		this.setPlaylist('hottplaylist',HOTTPlaylistUICallback);
}
HOTTPlaylistManager.prototype.HOTTNoFlashTimer = function() {
	document.getElementById('cnnVPFlashLargeContainer').innerHTML = '<div style="font-family:arial, sans-serif; color:#838383; font-size:11px; width: 100%; height: 100%; background-color: #f4f4f4;"><div style="padding: 5px 0px 0px 0px; text-align: center; width: 100%;">This CNN.com feature is optimized for<br>Adobe Flash Player version '+(((window.navigator.platform.toLowerCase()).indexOf('mac') > -1) ? '9' : '8')+' or higher.<br><a href="http://www.adobe.com/go/getflashplayer" target="blank"><img src="http://i.l.cnn.net/cnn/.element/img/2.0/global/noflash/install_btn.gif" class="cnnGetBtn" width="155" height="31" alt="Get Flash Player" border="0"></a></div></div>';		
}
HOTTPlaylistManager.prototype.HOTTWriteSplash = function() {
	this.playlistType = 'hott';
	this.playStartSlate = true;
	this.HOTTContentWrite(this.playlists['hottplaylist'].playlistJsonObjs[0].getDataObject());
	CNNPlaylistManager.getInstance().advanceTo('hottplaylist',0);
}
HOTTPlaylistManager.prototype.HOTTContentWrite = function(obj) {
	this.dataObject = obj;
	callControllerMethod('setEmailEnabled',true);
	str = '';
	if (obj == null) {
		str += '<div class="cnnHtVidBoxHead"></div><div class="cnnHtVidBoxCourtesy"><img src="http://i.l.cnn.net/cnn/.element/img/2.0/global/icons/video_icon.gif" width="16" height="10" border="0" alt="" class="cnnVidIcon"> <a href="http://www.cnn.com/video/"><b>CNN VIDEO &#187;</b></a></div>';
	} else {
		str += '<div class="cnnHtVidBoxHead">'+((obj.headline != null) ? obj.headline : '')+' <span class="cnnHtVidTime">'+((obj.trt != null) ? (CNNPlayer.secondsIntoMinutes(obj.trt)) : '')+'</span></div><p>'+((obj.description != null) ? obj.description : '')+'</p><div class="cnnHtVidBoxCourtesy"><b>'+((obj.providedBy != null) ? ('Source: ' + CNNPlaylistManager.providedResponse(obj.providedBy)) : '')+'</b><br>'+((obj.dateCreated != null) ? ('<b>Added</b> '+obj.dateCreated) : '')+'<br><br><img src="http://i.l.cnn.net/cnn/.element/img/2.0/global/icons/video_icon.gif" width="16" height="10" border="0" alt="" class="cnnVidIcon"> <a href="http://www.cnn.com/video"><b>CNN VIDEO &#187;</b></a></div>';
	}
	document.getElementById('cnnHtVideoTextContent').innerHTML = str;
}


function MOSCPlaylistManager() {}
MOSCPlaylistManager.prototype.MOSCIEBannerAd = null;
MOSCPlaylistManager.prototype.MOSCBannerAdWrite = function(cnnad_url,adId) {
	this.MOSCIEBannerAd = cnnad_url;
	if (document.getElementById('cnnDefault336Space') != null) 
		childrenNodes = document.getElementById('cnnDefault336Space').childNodes;
	else
		childrenNodes = document.getElementById('adHolder').childNodes;
	var wroteIt = false;
	for (var i = 0; i < childrenNodes.length; i++) {
		if (childrenNodes[i].id != null && childrenNodes[i].id.indexOf('ad-') == 0) {
			wroteIt = true;
  		bannerDiv = document.getElementById(childrenNodes[i].id);
   		iframeId = bannerDiv.id.slice(3);
			for (var j = 0; j < window.frames.length; j++) {
    		try {
					if (window.frames[j].location.href.indexOf('domId='+iframeId) > -1) {
						window.frames[j].location.replace( cnnad_url + '&domId=' + iframeId);
   					break;
					}
    		} catch(err) {}
    	}
    break;
		}
	}
	if (wroteIt == false) {
		var iFrameHTML = '<iframe hspace="0" vspace="0" marginHeight="0" marginWidth="0" src="' + cnnad_url + '&page.allowcompete=yes&domId=' + adId + '" border="0" frameBorder="0" height="0" width="0" scrolling="no"  id="'+adId+'" style="position: absolute; visibility: hidden;" ></iframe>';
		document.getElementById('cnnDefault336Space').innerHTML = iFrameHTML;
	}
}
MOSCPlaylistManager.prototype.MOSUnload = function() {
	if (this.flashDetection()) {
		if (document.all) {
			if (!this.mosSlateActive) {
				CNNPlayer.getInstance('','Mosaic Unload').pause();
			}
		}
		else {
			if (this.mosSlateActive == false)
				CNNPlayer.getInstance('','Mosaic Unload FF').getMediaPlayer().stop();
			CNNPlayer.getInstance('','Mosaic Unload 2').fini();
			this.unHighlight();
			this.activePlaylist = null;
			document.getElementById('cnnVPFlashLargeContainer').innerHTML = '';
			document.getElementById('controlsContainer').innerHTML = '';
		}
	}
}
MOSCPlaylistManager.prototype.MOSCLoadFromArray = function(ar,startVid) {
	this.moscarray = ar;
	if(startVid != ""){
		if(this.startVideo != startVid){
			this.startVideo = startVid;
		}
	}
	this.testCookies();
	setTimeout("CNNPlaylistManager.getInstance().MOSCFlashTimer()",1000);
}
MOSCPlaylistManager.prototype.MOSCFlashTimer = function() {
	var ar = this.moscarray;
	if (this.noCookies == true) {
		setTimeout("CNNPlaylistManager.getInstance().MOSCNoCookieTimer()",1000);
	} else if (this.flashDetection()) {
		if (this.cnnIsIntl) {
//			xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath("rootUrlMap/adMan")._map["rootUrl"] = "http://edition.cnn.com";
		}
		vidString = 'VideoDefault';
		this.slateSize = '576x324';
		if (cnnDefaultTab == null || cnnDefaultTab != 'cnnSTCVideo')
			vidString = 'VideoNonDefault';
		if (typeof videoJsonUrls != "undefined") {
			if (videoJsonUrls.length < 2) {
				vidString = 'CNNMosaicSingle'+vidString;
			} else {
				vidString = 'CNNMosaicMulti'+vidString;
			}
		}
		if(this.startVideo == null){
			this.vidString = vidString;
		}else{
			this.vidString = 'CNNMosaicMultiVideoNonDefault';
		}
		this.vidContext = 'CNNMosaic';
		if (document.all) {
			if (this.mosPreloaded == false) {
				CNNPlaylistManager.isBootStrapped = MOSCIsBootStrapped;
				CNNPlayer.create();		
			} else {
				if (this.MOSCIEBannerAd != null) { this.MOSCBannerAdWrite(this.MOSCIEBannerAd); }
				if (!this.mosSlateActive) {
					CNNPlayer.getInstance('','Mosaic Flash Timer').play();
				}
			}
		}
		else {
			if (this.mosPreloaded == false) {
				CNNPlaylistManager.isBootStrapped = MOSCIsBootStrapped;
				CNNPlayer.create();		
			} else {
				this.onlyCallMeOnce = false;
				CNNPlaylistManager.getInstance().MOSCWritePlaylistUI();
				CNNPlaylistManager.getInstance().MOSCWriteSplash();
			}
		}
	} else {
		setTimeout("CNNPlaylistManager.getInstance().MOSCNoFlashTimer()",1000);
	}
}
MOSCPlaylistManager.prototype.MOSCBootStrapCallback = function() {
	var ar = this.moscarray;
	if (document.all) {
		this.mosPreloaded = true;
		this.playlists['mosplaylist'] = new this.playlist(ar,0);
		this.setPlaylist('mosplaylist',MOSCPlaylistUICallback);
	} else {
		this.playlists['mosplaylist'] = new this.playlist(ar,0);
		this.setPlaylist('mosplaylist',MOSCPlaylistUICallback);
	}
}
MOSCPlaylistManager.prototype.MOSCNoFlashTimer = function() {
	document.getElementById('cnnVPFlashLargeContainer').innerHTML = "<div class=\"cnnNoFlashContainer\"><div class=\"cnnNoFlash\"><p class=\"cnnTopGraf\">This CNN.com feature is optimized for Adobe Flash Player version "+(((window.navigator.platform.toLowerCase()).indexOf('mac') > -1) ? '9' : '8')+" or higher.<\/p><p><b>You are currently using Flash Player " + parseInt(CNN_FlashDetect.prototype.getVersion()) + "<\/b><\/p><a href=\"http://www.adobe.com/go/getflashplayer\" target=\"blank\"><img src=\"http://i.l.cnn.net/cnn/.element/img/2.0/global/noflash/install_btn.gif\" class=\"cnnGetBtn\" width=\"155\" height=\"31\" alt=\"Get Flash Player\" border=\"0\"><\/a><\/div><\/div>";	
}
MOSCPlaylistManager.prototype.MOSCNoCookieTimer = function() {
	document.getElementById('cnnVPFlashLargeContainer').innerHTML = "<div style=\"width:576px;height:324px;position:relative;background:#f4f4f4;\"><div style=\"position:absolute;top:50px;left:88px;width:400px;height:200px;background:#f4f4f4;font-family:arial, sans-serif;color:#838383;font-size:11px;\"><p style=\"margin:15px 33px 12px 33px;text-align:center;\"><b>COOKIES DISABLED</b><br><br>Please enable cookies to view CNN videos.<\/div><\/div>";	
}
MOSCPlaylistManager.prototype.MOSCWritePlaylistUI = function() {
	tempStr = '<div><img src="http://i.l.cnn.net/cnn/images/1.gif" width="1" height="6" border="0" alt=""></div>';
	playList = this.playlists['mosplaylist'].playlistJsonObjs;
	if (playList.length < 2) {
		document.getElementById('mosVidPlayList').style.display = 'none';
	}
	if (playList != null) {
		rowCounter = 0;
		for (var i = 0; i < playList.length; i++) {
			if (i == 0 )
				tempStr += '<div class="mos_video_box_active" id="mos_'+i+'">';
			else
				tempStr += '<div class="mos_video_box" id="mos_'+i+'">';
			tempStr += '<div class="mos_tz_image"><img src="' + CNNPlaylistManager.findImageSize(playList[i].getDataObject().images,"44x25")+'" width="45" height="25" alt="" border="0"></div>';
			tempStr += '<a href="#" onclick="CNNPlaylistManager.getInstance().advanceTo(\'mosplaylist\','+i+'); return false;"><b>'+playList[i].getDataObject().headline+'</b></a><br>'+CNNPlayer.secondsIntoMinutes(playList[i].getDataObject().trt);
			tempStr += '</div>';
			rowCounter++;
			if (rowCounter == 3) { tempStr += '<div class="clear"></div>'; rowCounter = 0; }
		}
		tempStr += '<div class="clear"><img src="http://i.l.cnn.net/cnn/images/1.gif" width="1" height="6" border="0" alt=""></div>';

		document.getElementById('mosVidPlayList').innerHTML = tempStr;
	}
	var so =new SWFObject("http://i.l.cnn.net/cnn/video/xmp/MediaControls.swf", "mediacontrols" , "574", "33", 8, "#FFFFFF", true);
	so.addParam("allowscriptAccess", "always");
	so.addVariable("FLASHVAR_eventHandler", "CNNPlayer.getActivePlayer().handleEvent");		
	so.write("controlsContainer");
}
MOSCPlaylistManager.prototype.MOSCWriteSplash = function() {
	this.playlistType = 'mos';
	this.playStartSlate = true;
	var startIndex = 0;
	if(this.startVideo != null){
		var foundIt = false;
		var videoArray = this.playlists['mosplaylist'].playlistJsonObjs;
		for(var i = 0; i<videoArray.length && !foundIt; i++){
			if(videoArray[i].getDataObject().location == this.startVideo || videoArray[i].getDataObject().id == this.startVideo){
				foundIt = true;
				startIndex = i;
			}
		}
	}
	this.MOSContentWrite(this.playlists['mosplaylist'].playlistJsonObjs[startIndex].getDataObject());
	CNNPlaylistManager.getInstance().advanceTo('mosplaylist',startIndex);
	this.startVideo = null;
}
MOSCPlaylistManager.prototype.MOSContentWrite = function(obj) {
	this.dataObject = obj;
	callControllerMethod('setEmailEnabled',true);
	str = '';
	if (obj == null) {
		str += '<b style="font-size:12px;"></b> <span style="color:#9b9b9b;"><span><br><br><br style="line-height:5px;"><b></b> &nbsp;&nbsp;';
	} else {
		str += '<b style="font-size:12px;">'+((obj.headline != null) ? obj.headline : '')+'</b> <span style="color:#9b9b9b;">'+((obj.trt != null) ? (CNNPlayer.secondsIntoMinutes(obj.trt)) : '')+'</span><br>'+((obj.description != null) ? obj.description : '')+'<br>';
		str += '<div style="color:#CA0002;">'
		if (obj.relateds != null) {
			for (var i = 0; i < obj.relateds.length; i++) {
				str += '&#8226; <a href="'+obj.relateds[i].url+'">'+obj.relateds[i].headline+'</a><br>';
			}
		}
		str += '</div>';
		str += '<br style="line-height:5px;">'+((obj.providedBy != null && obj.dateCreated != null) ? '<b>'+((obj.providedBy != null) ? ('Source: ' + CNNPlaylistManager.providedResponse(obj.providedBy)) : '')+'</b> &nbsp;<span style="color:#9b9b9b;">|</span>&nbsp; '+((obj.dateCreated != null) ? ('<b>Added</b> '+obj.dateCreated) : '') : '');		
	}
	document.getElementById('mosVidDesc').innerHTML = str;
}




function BVPPlaylistManager() {}
BVPPlaylistManager.prototype.BVPMNumVidsInList = 7;
BVPPlaylistManager.prototype.BVPMVideoSelected = function(videoId,section) {
	if (this.noCookies == false) {
		this.switchToMyList = false;
		load_Play_List('navNext_Up');
		if (this.splashActive) {
			this.splashActive = false;
			document.getElementById('cnnVPFlashLargeContainer').style.backgroundImage = '';
			document.getElementById('cnnVPFlashLargeContainer').innerHTML = '';
		}
		CNNPlaylistManager.getInstance().activePlaylist = null;
		tempArray = new Array();
		var l = cnnSectionData[section].length;
		for (var i = 0; i < l; i++) {
			if (cnnSectionData[section][i] == videoId) {
				tempArray = this.BVPMGeneratePlaylistFromStart(i,section);
				break;
			}
		}
		this.playlists['bvpplaylist'] = new this.playlist(tempArray,0);
		this.setPlaylist('bvpplaylist',BVPPlaylistUICallback);
	}
}
BVPPlaylistManager.prototype.BVPMGeneratePlaylistFromStart = function(startPointer,section) {
	listSize = this.BVPMNumVidsInList;
	if (listSize > cnnSectionData[section].length) { listSize = cnnSectionData[section].length; }
	tempList = new Array();
	tempList[tempList.length] = cnnSectionData[section][startPointer++];
	while (tempList.length < listSize) {
		if (startPointer == cnnSectionData[section].length) { startPointer = 0; }
		tempList[tempList.length] = cnnSectionData[section][startPointer++];
	}
	if (this.loadFirstVideo != null) {
		this.playStartSlate = false;
		var foundIt = -1;
		for (var i = 0;i < tempList.length; i++) {
			if (tempList[i] == this.loadFirstVideo) {
				foundIt = i;
			}
		}
		if (foundIt < 0) {
			tempList.pop();
		} else {
			tempList.splice(foundIt,1);
		}
		tempList.unshift(this.loadFirstVideo);
		this.loadFirstVideo = null;
	}
	this.tab = currSectionNav;
	return tempList;
}
BVPPlaylistManager.prototype.BVPMLoadSingleVideo = function(jsonURL) {
	this.playStartSlate = false;
	this.skipStartSlateButLoadSynch = true;
	this.playlists['bvpplaylist'] = new this.playlist(new Array(jsonURL),0);
	this.setPlaylist('bvpplaylist',BVPPlaylistUICallbackFromStart);
}
BVPPlaylistManager.prototype.BVPMWritePlaylistUI = function() {
	tempStr = '';
	playList = this.playlists['bvpplaylist'].playlistJsonObjs;
	if (playList != null) {
		for (var i = 0; i < playList.length; i++) {
			tempStr += '<div class="box_item" id="nextup_' + i + '"><a href="#" onclick="CNNPlaylistManager.getInstance().advanceTo(\'bvpplaylist\','+i+'); return false;"><img src="' + CNNPlaylistManager.findImageSize(playList[i].getDataObject().images,"44x25");
			tempStr += '" width="45';
			tempStr += '" height="25';
			tempStr += '" border="0" alt="" /></a><a href="#" onclick="CNNPlaylistManager.getInstance().advanceTo(\'bvpplaylist\','+i+'); return false;">' + playList[i].getDataObject().headline;
			tempStr += '</a> <span class="duration">' + CNNPlayer.secondsIntoMinutes(playList[i].getDataObject().trt);
			tempStr += '</span></div>'
		}
		WTPO_writeToLayer(tempStr, "Play_Box");
	}
	else {
		tempStr = '<div id="nextup_0" style="text-align:center;margin-top:40px;color:#949494;"><b>There are no videos in your playlist.<br>Please make your selections below.</b></div>';
		WTPO_writeToLayer(tempStr, "Play_Box");
	}
}
BVPPlaylistManager.prototype.BVPMGetSplashPlaylist = function(sec) {
	this.playlists['bvpplaylist'] = new this.playlist(this.BVPMGeneratePlaylistFromStart(((sec == 'top_stories') ? 1 : 0),sec),0);
	this.setPlaylist('bvpplaylist',BVPPlaylistUICallbackFromStart);
}
BVPPlaylistManager.prototype.BVPMWriteSplash = function() {
	this.playlistType = 'bvp';
	if (this.noCookies == false) {
			this.playStartSlate = false;
		CNNPlaylistManager.getInstance().advanceTo('bvpplaylist',0);
		this.BVPMWriteContent(this.playlists['bvpplaylist'].playlistJsonObjs[0].getDataObject());
		if (this.playlists['bvpplaylist'].playlistJsonObjs[0].getDataObject().providedBy != null) {
			document.getElementById('providedByL').innerHTML = '<b>Source: '+CNNPlaylistManager.providedResponse(this.playlists['bvpplaylist'].playlistJsonObjs[0].getDataObject().providedBy)+'</b>';
			document.getElementById('providedByS').innerHTML = '<b>Source: '+CNNPlaylistManager.providedResponse(this.playlists['bvpplaylist'].playlistJsonObjs[0].getDataObject().providedBy)+'</b>';
		}
		else {
			document.getElementById('providedByL').innerHTML = ''; 
			document.getElementById('providedByS').innerHTML = ''; 
		}
		if (this.playlists['bvpplaylist'].playlistJsonObjs[0].getDataObject().dateCreated != null) {
			document.getElementById('addedOnL').innerHTML = '<b>Added On</b> '+this.playlists['bvpplaylist'].playlistJsonObjs[0].getDataObject().dateCreated;
			document.getElementById('addedOnS').innerHTML = '<b>Added On</b> '+this.playlists['bvpplaylist'].playlistJsonObjs[0].getDataObject().dateCreated;
		}
		else {
			document.getElementById('addedOnL').innerHTML = ''; 
			document.getElementById('addedOnS').innerHTML = ''; 
		}
	} else {
		document.getElementById('cnnVPFlashLargeContainer').innerHTML = "<div class=\"cnnVideoMessageContainer\"><div class=\"cnnVideoMessage\"><p class=\"cnnTopGraf\"><b>COOKIES DISABLED</b><br><br>Please enable cookies to view CNN videos.<\/div><\/div>";
	}
}
BVPPlaylistManager.prototype.BVPMStartFromSplash = function() {
	this.splashActive = false;
	document.getElementById('cnnVPFlashLargeContainer').style.backgroundImage = '';
	document.getElementById('cnnVPFlashLargeContainer').innerHTML = '';
	CNNPlaylistManager.getInstance().BVPMVideoSelected(cnnSectionData['top_stories'][0],'top_stories');
}
BVPPlaylistManager.prototype.BVPMWriteContent = function(obj) {
	this.dataObject = obj;
	callControllerMethod('setEmailEnabled',true);
	if (obj != null) {
		str = '<div class="bvp_deschead"><b>'+((obj.headline != null) ? obj.headline : '')+'</b> <span class="bvp_desctrt">'+((obj.trt != null) ? CNNPlayer.secondsIntoMinutes(obj.trt) : '')+'</span></div>';
		str += '<div class="bvp_desctext">'+((obj.description != null) ? obj.description : '');
		str += '<div class="bvp_desclinks">'
		if (obj.relateds != null) {
			for (var i = 0; i < obj.relateds.length; i++) {
				str += '<b>&#8226;</b> <a href="'+obj.relateds[i].url+'">'+obj.relateds[i].headline+'</a><br>';
			}
		}
		str += '</div>';
		str += '</div>';
		document.getElementById('contentL').innerHTML = str;
		document.getElementById('contentS').innerHTML = str;
	} else {
		document.getElementById('contentL').innerHTML = '';
		document.getElementById('contentS').innerHTML = '';
	}
}

function MYPlaylistManager() {}
MYPlaylistManager.prototype.MYPMStorage = null;
MYPlaylistManager.prototype.MYPMLoadFromStorage = function() {
	this.playlistType = 'bvp';
	
	if (document.all) {
		try {
			document.getElementById('dataInstanceTest').load('IEStorageTest');
		} catch(err) {
			this.noIEStorage = true;
		}
	}
	
	this.testCookies();
	try{
	if (this.noIEStorage == false && this.noCookies == false) {
		this.MYPMStorage = StorageManager.getInstance().getStorage();
		this.MYPMStorage.setOnload( MYPlaylistDataIsLoaded );
		this.MYPMStorage.load();
	} else {
		this.playlists['myplaylist'] = new this.playlist(new Array(),0);
		loadFirstSection(); 
		this.MYPMWritePlaylistUI();
	}
	}catch(e){}
}
MYPlaylistManager.prototype.getCurrentVideoTab = function() {
	return this.playlists['myplaylist'].tabList[this.playlists['myplaylist'].pointer];
}
MYPlaylistManager.prototype.MYPMSaveToStorage = function() {
	if (this.MYPMStorage == null) {
		this.MYPMStorage = StorageManager.getInstance().getStorage();
	}
	for (var i = 0; i < this.playlists['myplaylist'].jsonList.length; i++) {
		if (this.MYPMStorage.contains(this.playlists['myplaylist'].jsonList[i]) == false) {
			var currentVideo = new myPlaylistVideo(this.playlists['myplaylist'].jsonList[i],this.playlists['myplaylist'].tabList[i]);
			storageRet = this.MYPMStorage.put(this.playlists['myplaylist'].jsonList[i],currentVideo,new Date(new Date().getTime() + 3*24*3600000 ));
			//storageRet = this.MYPMStorage.put(this.playlists['myplaylist'].jsonList[i],this.playlists['myplaylist'].jsonList[i],new Date(new Date().getTime() + 3*24*3600000 ));
		}
	}
	this.MYPMStorage.save();
}
MYPlaylistManager.prototype.MYPMAddToPlaylist = function(val) {
	if (this.MYPMStorage.contains(val) == false && this.playlists['myplaylist'].jsonList.length < 15) {
		this.playlists['myplaylist'].jsonList.push(val);
		this.playlists['myplaylist'].tabList.push(currSectionNav);
		if (CNNPlaylistManager.getInstance().activePlaylist == 'myplaylist') {
			CNNPlayer.getInstance('','MYPMAddToPlaylist').appendToPlayList(val);
		} else { 
			this.switchToMyList = true; 
		}
		o = 0;
		this.setPlaylist('myplaylist',MYPlaylistUICallbackFromAppend);
		try{
		this.MYPMSaveToStorage();
		}catch(e){}
		document.getElementById(val.slice(val.lastIndexOf('/')+1)).innerHTML = 'in playlist';
		load_Play_List('navMyPlay_List');
	}
}
MYPlaylistManager.prototype.MYPMDataLoadedCB = function() {
	tempJsonArray = new Array();
	tempTabArray = new Array();
	for (var i = 0; i < this.MYPMStorage.allKeys.length; i++) {
		if (this.MYPMStorage.allKeys[i].indexOf('.json') > -1) {
			var thisObj = this.MYPMStorage.dataObjects[this.MYPMStorage.allKeys[i]];
			tempJsonArray[tempJsonArray.length] = thisObj.id;
			tempTabArray[tempTabArray.length] = thisObj.tab;
		}
	}
	this.playlists['myplaylist'] = new this.playlist(tempJsonArray,0,tempTabArray);
	this.setPlaylist('myplaylist',MYPlaylistUICallback);
}
MYPlaylistManager.prototype.MYPMRemove = function(it) {
	pl = this.playlists['myplaylist'];
	toRemove = '';
	if (pl.pointer != it || CNNPlaylistManager.getInstance().activePlaylist != 'myplaylist') {
		tempArray = pl.jsonList;
		tempJsonList = new Array();
		tempTabList = new Array();
		for (i = 0; i < pl.jsonList.length; i++) {
			if (i != it) {
				tempJsonList.push(pl.jsonList[i]);
				tempTabList.push(pl.tabList[i]);
			}
			else {
				toRemove = pl.jsonList[i];
				tabToRemove = pl.tabList[i];
			}
		}
		this.playlists['myplaylist'].jsonList = tempJsonList;
		this.playlists['myplaylist'].tabList = tempTabList;
		if (CNNPlaylistManager.getInstance().activePlaylist == 'myplaylist') {
			CNNPlayer.getInstance('','MYPMRemove').removeFromPlayList(toRemove);
		}
		this.setPlaylist('myplaylist',MYPlaylistUICallbackFromAppend);
		this.MYPMStorage.remove(toRemove);
		try{
		this.MYPMSaveToStorage();
		}catch(e){}
		document.getElementById(toRemove.slice(toRemove.lastIndexOf('/')+1)).innerHTML = '<a href="javascript:CNNPlaylistManager.getInstance().MYPMAddToPlaylist(\''+toRemove+'\',\'\');" class="aplink">add to my playlist</a>';
	}
}
MYPlaylistManager.prototype.MYPMWritePlaylistUI = function() {
	tempStr = '';
	playList = this.playlists['myplaylist'].playlistJsonObjs;
	if (playList != null && playList.length > 0) {
		for (var i = 0; i < playList.length; i++) {
			tempStr += '<div class="box_item" id="myup_' + i + '"><div id="myupgraydiv_'+i+'" style="float:right;margin-top:5px;"><a href="javascript:CNNPlaylistManager.getInstance().MYPMRemove('+i+');">';
			tempStr += '<img name="myupgray_'+i+'" id="myupgray_'+i+'" src="/video/bvp/images/close_btn.gif" width="12" height="12" alt="" border="0"></a></div>';
			tempStr += '<a href="#" onclick="CNNPlaylistManager.getInstance().advanceTo(\'myplaylist\','+i+'); return false;"><img src="' + CNNPlaylistManager.findImageSize(playList[i].getDataObject().images,"44x25") + '" width="45" height="25" border="0" alt="" /></a>';
			tempStr += '<a href="#" onclick="CNNPlaylistManager.getInstance().advanceTo(\'myplaylist\','+i+'); return false;">' + playList[i].getDataObject().headline + '</a> <span class="duration">' + CNNPlayer.secondsIntoMinutes(playList[i].getDataObject().trt) + '</span></div>';
		}
		WTPO_writeToLayer(tempStr, "My_Play_Box");
		WTPO_writeToLayer('<a href="javascript:load_Play_List(\'navMyPlay_List\');"><div>MY&nbsp;PLAYLIST&nbsp;&nbsp;<span style="color:#949494;">'+playList.length+'</span></div></a>&nbsp;', 'myPlaylistQuantity');
	}
	else {
		if (this.noIEStorage == true) {
			tempStr = '<div id="myup_0" style="text-align:center;margin-top:40px;color:#949494;"><b>IE Persistent storage is disabled.<br>Please enable to use the "My Playlist" feature.</b></div>';
		}
		else if (this.noCookies == true) {
			tempStr = '<div id="myup_0" style="text-align:center;margin-top:40px;color:#949494;"><b>Persistent storage is turned off<br>due to cookies being disabled.<br>Please enable to use the "My Playlist" feature.</b></div>';
		} else {
			tempStr = '<div id="myup_0" style="text-align:center;margin-top:40px;color:#949494;"><b>There are no videos in your playlist.<br>Please make your selections below.</b></div>';
		}
		WTPO_writeToLayer(tempStr, "My_Play_Box");
		WTPO_writeToLayer('<a href="javascript:load_Play_List(\'navMyPlay_List\');"><div>MY&nbsp;PLAYLIST&nbsp;&nbsp;<span style="color:#949494;">0</span></div></a>&nbsp;', 'myPlaylistQuantity');
	}
	if (CNNPlaylistManager.getInstance().activePlaylist == 'myplaylist') {
		this.highlight();
	}
}


MYPlaylistDataIsLoaded = function() { CNNPlaylistManager.getInstance().MYPMDataLoadedCB(); }
MYPlaylistUICallback = function() { loadFirstSection(); CNNPlaylistManager.getInstance().MYPMWritePlaylistUI(); }
MYPlaylistUICallbackFromAppend = function() { CNNPlaylistManager.getInstance().MYPMWritePlaylistUI(); }
BVPPlaylistUICallback = function() { CNNPlaylistManager.getInstance().BVPMWritePlaylistUI(); CNNPlaylistManager.getInstance().advanceTo('bvpplaylist',0);}
BVPPlaylistUICallbackFromStart = function() { CNNPlaylistManager.getInstance().BVPMWritePlaylistUI(); CNNPlaylistManager.getInstance().BVPMWriteSplash()}
MOSCPlaylistUICallback = function() { CNNPlaylistManager.getInstance().MOSCWritePlaylistUI(); CNNPlaylistManager.getInstance().MOSCWriteSplash()}
HOTTPlaylistUICallback = function() { CNNPlaylistManager.getInstance().HOTTWriteSplash()}
T1PlaylistUICallback = function() { CNNPlaylistManager.getInstance().T1WriteSplash()}
SAPlaylistUICallback = function() { CNNPlaylistManager.getInstance().SAWriteSplash()}

MOSCIsBootStrapped = function(success) { 
	if (success) {
		CNNPlaylistManager.getInstance().MOSCBootStrapCallback(); 
	} else {
		CNNPlaylistManager.getInstance().errorSlate();
	}
}
HOTTIsBootStrapped = function(success) { 
	if (success) {
		CNNPlaylistManager.getInstance().HOTTBootStrapCallback(); 
	} else {
		CNNPlaylistManager.getInstance().errorSlate();
	}
}
T1IsBootStrapped = function(success) { 
	if (success) {
		CNNPlaylistManager.getInstance().T1BootStrapCallback(); 
	} else {
		CNNPlaylistManager.getInstance().errorSlate();
	}
}
SAIsBootStrapped = function(success) {
	CNNPlaylistManager.getInstance().SABootStrapCallback(success);
}

function flipBVPImage(imgName,srcName,onOff,ad) {
	if (ieVersion() == 0 || ieVersion() >= 7) {
		document.images[imgName+'Img'].src = '/video/bvp/images/'+srcName+'_'+onOff+'.png';
	}
	else {
		if (ad == null) ad = '';
		document.getElementById(imgName+'_button'+ad).runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/video/bvp/images/"+srcName+"_"+onOff+".png')";
	}
}

function makeOn() { flipBVPImage('play','play','on'); }
function makeOff() { flipBVPImage('play','play','off'); }
function emailOn() { flipBVPImage('email','email','on'); }
function emailOff() { flipBVPImage('email','email','off'); }
function moveOn1() { flipBVPImage('replay','rply','on'); } 
function moveOut1() { flipBVPImage('replay','rply','off'); }

function ieVersion() {
	var ua = window.navigator.userAgent;
  var msie = ua.indexOf ( "MSIE " );
  if ( msie > 0 )      // If Internet Explorer, return version number
  	return parseInt (ua.substring (msie+5, ua.indexOf (".", msie )));
  else                 // If another browser, return 0
    return 0;
}

CNNPlaylistManager.prototype.videoWasLinked = function(){
        var locHref = '' + location.href;
        if(locHref.indexOf('/video/#/')>-1){
                var videoUrl = locHref.slice(locHref.indexOf('/#/')+2)+".json";
                var thisVideo = this.playlists[this.activePlaylist].activeJson();
                return videoUrl==thisVideo;
        }else{
                return false;
        }
}




