//	News
//	old News JS, needs cleaned
//	removes leading 0s from numbers
	var removeLeadingZeros = function(tmp) {
		if (tmp < 10) {tmp = tmp.toString().replace(/0/,"");} return tmp;
	}
//	adds leading 0s from numbers
	var addLeadingZeros = function(tmp) {
		if (String(tmp).length < 2) {tmp = "0" + tmp;} return tmp;
	}
//	receive amount to slide, slide Hot List UL left or right; used on Category Index page
	var moveList = function(obj,n) {
		var o = document.getElementById(obj);				// get the toutList ul
			o.style.left = String(n+"px");					// move toutList
	}
//	receive direction to slide (prev/next), slide Hot List UL left or right; used on Category Index page
	var slideHotList = function(dir) {
		var m = 296;										// if the function received a direction, set the movement width to 296; if not, set it to 0
		var n = 0;											// initialize n as 0; if function received a direction, it will be reset
		var UL = document.getElementById("toutList");		// get the toutList ul
		if (dir) {
			if (dir == "next") {m = m*(-1);}				// for "next" make 296 a negative number
			var c = Number(UL.style.left.replace(/px/,""));	// get the current left position of toutList
				n = c + m;									// create the new left (by adding 296 or -296 to the current left)
				var speed = 150;
				//determine the direction for the blending, if start and end are the same nothing happens
				if (c > n) {
					for(i = c; i >= n; i--) {
						setTimeout("moveList('toutList'," + i + ")",speed);
						speed++;
					}
				} else if (c < n) {
					for(i = c; i <= n; i++) {
						setTimeout("moveList('toutList'," + i + ")",speed);
						speed++;
					}
				}
		}
		var LIs = UL.getElementsByTagName("li");			// get all the LIs in toutList
		var prev = document.getElementById("hotTopicsPrev");
			prev.className = "";							// remove any class from the previous navigation link
			prev.childNodes[0].onclick = function() {		// attach an onclick event to the previous navigation link
				slideHotList("prev");
			}
		var next = document.getElementById("hotTopicsNext");
			next.className = "";							// remove any class from the next navigation link
			next.childNodes[0].onclick = function() {		// attach an onclick event to the next navigation link
				slideHotList("next");
			}
		if (n == 0) {										// if toutList is at its left-most position, disable the previous navigation link
			prev.className = "disabled";
			prev.childNodes[0].onclick = null;
		}
		if (n == (m * (LIs.length - 2))) {					// if toutList is at its right-most position, disable the next navigation link
			next.className = "disabled";
			next.childNodes[0].onclick = null;
		}
	}
//	initialize Hot List; used on Category Index page
	var initializeHotList = function() {
		if (!document.getElementById) return;
		if (!document.getElementsByTagName) return;
		if (!document.getElementById("hotTopicsSlide")) return;
		slideHotList();
	}
//	get the next/previous XML feed, create the next/previous navigation buttons, and place them into the page
	var articleNextPrevNavCallback = function(pos,response) {
		var u = location.href.split(',');
		var id = String(u[2]);
		var items = response.getElementsByTagName('item');
		for (i = 0; i < items.length; i++) {// NOTE: the data file is in descending order
			var link = items[i].getElementsByTagName('link')[0].firstChild.data;
			if (link.indexOf(id) > -1) {
				var topnav = '<ul>';
				var botnav = '<ul>';
				var p = i-1;
				if (p >= 0) {
					var prevTitle = items[p].getElementsByTagName('title')[0].firstChild.data;
					var prevLink = items[p].getElementsByTagName('link')[0].firstChild.data;
//					topnav += '<li class="prev"><a href="' +prevLink+ '">' +prevTitle+ '</a></li>';
					topnav += '<li class="prev"><a href="' +prevLink+ '" title="' + prevTitle +'"><span>Previous Article</span></a></li>';
					botnav += '<li class="prev"><a href="' +prevLink+ '"><span>Previous</span>' +prevTitle+ '</a></li>';
				}
				var n = i+1;
				if (n < items.length) {
					var nextTitle = items[n].getElementsByTagName('title')[0].firstChild.data;
					var nextLink = items[n].getElementsByTagName('link')[0].firstChild.data;
//					topnav += '<li class="next"><a href="' +nextLink+ '">' +nextTitle+ '</a></li>';
					topnav += '<li class="next"><a href="' +nextLink+ '" title="' + nextTitle + '"><span>Next Article</span></a></li>';
					botnav += '<li class="next"><a href="' +nextLink+ '"><span>Next</span>' +nextTitle+ '</a></li>';
				}
				topnav += '</ul>';
				botnav += '</ul>';
				document.getElementById('nextprevpaginationtop').innerHTML = topnav;
				document.getElementById('nextprevpaginationtop').className += ' active';
				document.getElementById('nextprevpaginationbottom').innerHTML = botnav;
				document.getElementById('nextprevpaginationbottom').className += ' active';
			}
		}
	}
//	initialize Article page's next/previous article links; used on... Article page
	var initializeArticleNextPrevNav = function() {
		if (!document.getElementById) return;
		if (!document.getElementsByTagName) return;
		if (PEOPLE.News.articledate == null || PEOPLE.News.articledate == '') return;
		arrCalendarDates.length = 0;
		addCalendarDates(PEOPLE.News.articledate,'/people/xml/nextprev/0,,' +PEOPLE.News.articledate+ ',00.xml');// example: /people/xml/nextprev/0,,10-28-2008,00.xml		
		getFeed(arrCalendarDates[0],'nextprevpaginationtop',articleNextPrevNavCallback);
	}
//	random recirc callback (overwriting version from /j/main.js)
	var randomRecircCallback = function(obj) {
		obj.response[0].sort(function() {return 0.5 - Math.random();});
		var recirc = obj.response[0][0];
		var divID = recirc.name.replace(/\./,'').replace(/ /,'').toLowerCase();
		var homeName = recirc.name;
		var homeURL = recirc.home;
		var recircURL = recirc.url;
		var recircTitle = recirc.title;
		var recircImage = recirc.image.replace(/http:\/\/preview.people.com/,'http:\/\/img2.timeinc.net').replace(/http:\/\/www.people.com/,'http:\/\/img2.timeinc.net');
		var recircDeck = recirc.deck;
		var recircCTA = recirc.cta || 'See More';
		var divTitle = 'Cute';
		if (divID === 'peoplestylewatch') divTitle = 'Style';
		if ((divID === 'peoplespecial') || (divID === 'peoplegames')) divTitle = 'Fun';
		var h =  '\n<p class="title">Daily Dose of '+divTitle+'!</p>';
			h += '\n<div id="'+divID+'" class="tout">';
			h += '\n	<div class="imgcont"><a href="'+recircURL+'"><img src="'+recircImage+'" alt="'+recircTitle+'" border="0" width="150" height="113" /></a></div>';
			h += '\n	<div class="txtcont hentry">';
			h += '\n		<p class="kicker"><a href="'+homeURL+'">'+homeName+'</a></p>';
			h += '\n		<p class="entry-title"><a href="'+recircURL+'">'+recircTitle+'</a></p>';
			h += '\n		<p class="entry-summary"><a href="'+recircURL+'">'+recircDeck+'</a></p>';
			h += '\n		<p class="more permalink"><a rel="bookmark" href="'+recircURL+'">'+recircCTA+'</a></p>';
			h += '\n	</div>';
			h += '\n</div>';
		var parent = document.getElementById('randomRecirc');
			parent.className = parent.className + ' active';
			parent.innerHTML = h;
	};
//	initialize recirc feeds; used on Main and Category pages
	var initializeNewswireFeed = function() {
		if (!document.getElementById) return;
		if (!document.getElementsByTagName) return;
		var recircArray = {
			'recircs' : [
				{
					'id'		: 'recirc1',
					'feed' 		: [
						{
							'name'  	: 'PopSugar.com',
							'json' 		: 'http://img2-short.timeinc.net/people/static/json/popsugar/feed.js',
							'site' 		: 'http://www.popsugar.com',
							'image' 	: 'http://img2.timeinc.net/people/static/i/news/logoPopSugar.gif?1',
							'display'	: 5
						}
					]
				},{
					'id'		: 'recirc2',
					'feed' 		: [
						{
							'name'  	: 'PopEater.com',
							'json' 		: 'http://img2-short.timeinc.net/people/static/json/aol_news/feed.js',
							'site' 		: 'http://www.PopEater.com',
							'image' 	: 'http://img2.timeinc.net/people/static/i/news/logoPopEater.gif?1',
							'display'	: 5
						}
					]
				},{
					'id'		: 'recirc3',
					'feed' 		: [
						{
							'name'  	: 'Celebrity-Babies.com',
							'json' 		: 'http://img2-short.timeinc.net/people/static/json/celebrity_babies/feed.js',
							'site' 		: 'http://celebritybabies.people.com/',
							'image' 	: 'http://www.people.com/people/static/i/news/logoCBB.gif',
							'display'	: 5
						}
					]
				}
			]
		};
		pushToMasterArray(recircArray);
	};
	initializeNewswireFeed();
//	initialize Partner Recirc feeds; uses Global PartnerRecirc function
	var initializeArticleRecirc = function() {
		if (!document.getElementById) return;
		if (!document.getElementsByTagName) return;
		var recircArray = {
			'recircs' : [
				{
					'id'		: 'rightcolumnrecircbottom',
					'feed' 		: [
						{
							'name'  	: 'PopSugar.com',
							'json' 		: 'http://img2-short.timeinc.net/people/static/json/popsugar/feed.js',
							'site' 		: 'http://www.popsugar.com',
							'image' 	: 'http://img2.timeinc.net/people/static/i/news/logoPopSugar.gif?1',
							'callback'	: PEOPLE.recirccallback,
							'display'	: 3
						}
					]
				},{
					'id'		: 'rightcolumnrecirc',
					'feed' 		: [
						{
							'name'  	: 'Huffington Post',
							'json' 		: 'http://img2-short.timeinc.net/people/static/json/huffingtonpost/feed.js',
							'site' 		: 'http://www.huffingtonpost.com/entertainment/',
							'image' 	: 'http://img2.timeinc.net/people/static/i/photos/logoHuffingtonPost3.gif',
							'callback'	: PEOPLE.recirccallback,
							'display'	: 3
						}
					]
				},{
					'id'		: 'randomRecirc',
					'feed' 		: [
						{
							'name'  	: 'More From PEOPLE',
							'json' 		: 'http://www.people.com/people/json/recirc/feed/0,,,00.js',
							'callback'	: randomRecircCallback
						}
					]
				},{
					'id'		: 'afterarticlerecirc',
					'type' 		: 'random',
					'display'	: 1,
					'feed' 		: [
						{
							'name'  	: 'Huffington Post',
							'json' 		: 'http://img2-short.timeinc.net/people/static/json/huffingtonpostarticle/feed.js',
							'site' 		: 'http://www.huffingtonpost.com/entertainment/',
							'image' 	: 'http://img2.timeinc.net/people/static/i/photos/logoHuffingtonPost3.gif',
							'callback'	: PEOPLE.recirccallback,
							'display'	: 2
						},{
							'name'  	: 'Huffington Post',
							'json' 		: 'http://img2-short.timeinc.net/people/static/json/huffingtonpostarticle/feed.js',
							'site' 		: 'http://www.huffingtonpost.com/entertainment/',
							'image' 	: 'http://img2.timeinc.net/people/static/i/photos/logoHuffingtonPost3.gif',
							'callback'	: PEOPLE.recirccallback,
							'display'	: 2
						},{
							'name'  	: 'EW.com',
							'json' 		: 'http://img2-short.timeinc.net/people/static/json/ew/feed.js',
							'site' 		: 'http://www.ew.com',
							'image' 	: 'http://img2.timeinc.net/people/static/i/news/logoEW.gif',
							'callback'	: PEOPLE.recirccallback,
							'display'	: 2
						}
					]
				}
			]
		};
		pushToMasterArray(recircArray);
	};
	initializeArticleRecirc();
//	collapse right column adMarketplace if no ad
	function hideAdMarketplace() {
		if (!document.getElementById("adMarketplace")) return;
		document.getElementById("adMarketplace").id = "adMarketplaceNoAds";
	}
//	this will be reset to true if the adMarketplace ad fires; if not, the initializeAdMarketplace function will hide the DIV
	var adMarketplace = "false";
//	redefines function from 0,,,00.js to set wmode to transparent
	var buildBrightcovePlayer = function(videoID) {
		var config = new Array();
			config["videoId"] = videoID;
			config["videoRef"] = null;
			config["lineupId"] = null;
			config["playerTag"] = null;
			config["autoStart"] = false;
			config["preloadBackColor"] = "#FFFFFF";
			config["width"] = 300;
			config["height"] = 320;
			config["wmode"] = "transparent";
			config["playerId"] = (brightcovePlayerID == "") ? 416421276 : brightcovePlayerID;
		createExperience(config, 8);
	}
//	append calendar JS if page requires a calendar
	var initializeCalendar = function() {
		//$('body:first').append('<script type="text/javascript" language="javascript" src="/people/static/j/news/calendar.js"></script>');
		$.getScript('/people/static/j/news/calendar.js');
	}
//	can list as many functions as you want and the loader below will load them as soon as the page is loaded
	var leftColumnFunctions = function() {
		addBookmarkDropdown("div");
		if(document.getElementById("addPeopleNews")){document.getElementById("addPeopleNews").style.position = "absolute";}
	}
//	can list as many functions as you want and the loader below will load them as soon as the page is loaded
	var pageLoadFunctions = function() {
		if(adMarketplace == "false"){hideAdMarketplace();}
		tii_attachHoverAffect("div","tout","hover","posts"); // elements to find, class to find within elements, new class to add elements, optional parent id
		tii_attachHoverAffect("li","","hover","newsCategories");
		tii_attachHoverAffect("li","","hover","specialFeaturesList");
		tii_attachHoverAffect("div","tout","hover","top10Categories");
		tii_attachHoverAffect("li","addPeopleNews","hover","middleColumn");
	}	
//	load scripts once these elements are loaded
	tii_callFunctionOnElementLoad("calendars", initializeCalendar);
	tii_callFunctionOnElementLoad("hotTopicsSlide", initializeHotList);
	tii_callFunctionOnElementLoad("leftColumn", leftColumnFunctions);
	tii_callFunctionOnElementLoad("nextprevpaginationbottom", initializeArticleNextPrevNav);
//	load scripts once full page is loaded
	tii_callFunctionOnWindowLoad(pageLoadFunctions);
// setting document.domain so polls and fbconnect will play with each other
	document.domain = 'people.com';
// new News JS
PEOPLE.News = {
	init : function() {
		if (document.getElementById('rightcolumnrecirc')) {
			var d = document.getElementById('rightcolumnrecirc');
			var h = d.innerHTML;
				d.innerHTML = '\n<p class="title">Around the Web</p>' + h;
		};
	},
	leftcolumn : function() {
		if (document.getElementById('addpeoplenews')) {PEOPLE.addpeoplenews();}; // new article template, left column
	}
};
tii_callFunctionOnElementLoad('leftColumn',PEOPLE.News.leftcolumn);
tii_callFunctionOnWindowLoad(PEOPLE.News.init);

PEOPLE.flyingrecirc = {
	bottom : '-500px',
	speed : 400,
	display : 6,
	init : function() {
		if (!$('#news').hasClass('article')) {return false;}
		$.getScript('/people/json/articles');
	},
	append : function(obj) {
		this.json = obj;
		var articleid = adFactory.params.aid, i, len = this.json.length, n;
		for (i = -1; ++i < len;) {
			n = this.json[i];
			if (n.articleid == articleid) {this.json.splice(i,1);break;}
		}
		if (this.json.length > this.display) {this.json.length = this.display;}
		this.getstarted();
	},
	getstarted : function() {
		var h, n, i, len = this.json.length, c = 'odd';
		h = '<div id="flyingrecirc">';
			h += '<p class="title"><strong>PEOPLE</strong> Most Read Stories</p>';
			h += '<div class="contentSection">';
				h += '<ul class="toutSection">';
				for (i = -1; ++i < len;) {
					n = this.json[i];
					h += '<li id="article'+n.articleid+'" class="tout hentry '+c+'">';
						h += '<div class="imgcont"><a href="'+n.url+'">'+n.img+'</a></div>';
						h += '<div class="txtcont">';
							h += '<h4 class="entry-title"><a href="'+n.url+'" rel="bookmark">'+n.headline+'</a></h4>';
							h += '<p class="more entry-permalink"><a href="'+n.url+'">'+n.cta+'</a></p>';
						h += '</div>';
					h += '</li>';
					c = (c =='odd') ? 'even' : 'odd';
				}
				h += '</ul>';
			h += '</div>';
		h += '</div>';
		$('#container').append(h);
		this.recirc = $('#flyingrecirc');
		this.slider = this.recirc.find('ul:first');
		this.count = this.slider.find('li').length;
		this.recircwidth = this.recirc.width();
		var h = this.slider.height();
		this.slider.css('position','absolute').prepend(this.slider.find('li:last')).css('left','-'+this.recircwidth+'px').parent().css('height',h+'px');
		this.addnav();
		this.sliderclick();
		$(window).scroll(function(){PEOPLE.flyingrecirc.scroll();});
	},
	isvisible : function(elem) { // altered from http://stackoverflow.com/questions/487073/jquery-check-if-element-is-visible-after-scroling
		var doctop = $(window).scrollTop(),
			docbot = doctop + $(window).height(),
			elemtop = $(elem).offset().top,
			elembot = elemtop + $(elem).height() + this.recirc.height() + 10;
		return (docbot > elembot);
	},
	scroll : function() {
		var c = PEOPLE.flyingrecirc.recirc.hasClass('showing'),
			v = PEOPLE.flyingrecirc.isvisible('#rightColumn');
		if (!c && v) {
			PEOPLE.flyingrecirc.show();
		} else if (c && !v) {
			PEOPLE.flyingrecirc.hide();
		}
	},
	show : function() {
		this.recirc.addClass('showing').animate({'bottom':'0px'},this.speed);
		omniFlyOutTracker('impression',this.getheadline());
	},
	hide : function() {
		this.recirc.removeClass('showing').animate({'bottom':this.bottom},this.speed);
		omniFlyOutTracker('close');
	},
	close : function() {
		this.recirc.removeClass('showing').animate({'bottom':this.bottom},this.speed,function(){PEOPLE.flyingrecirc.recirc.remove();PEOPLE.flyingrecirc.scroll = null;});
		omniFlyOutTracker('close');
	},
	next : function(dist) {
		this.slider.animate({'left':dist},300,function(){
			PEOPLE.flyingrecirc.slider.append(PEOPLE.flyingrecirc.slider.find('li:first')).css('left','-'+PEOPLE.flyingrecirc.recircwidth+'px');
			omniFlyOutTracker('next');
			omniFlyOutTracker('impression',PEOPLE.flyingrecirc.getheadline());
		});
	},
	previous : function(dist) {
		this.slider.animate({'left':dist},300,function(){
			PEOPLE.flyingrecirc.slider.prepend(PEOPLE.flyingrecirc.slider.find('li:last')).css('left','-'+PEOPLE.flyingrecirc.recircwidth+'px');
			omniFlyOutTracker('previous');
			omniFlyOutTracker('impression',PEOPLE.flyingrecirc.getheadline());
		});
	},
	getheadline : function() {
		return this.slider.find('li:eq(1)').find('h4').text();
	},
	addnav : function() {
		if (this.count < 2) {return;}
		var h = '<ul id="reciricnav">';
			h += '<li class="close"><a href="#">X <span>Close</span></a></li>';
			h += '<li class="previous"><a href="#">Previous</a></li>';
			h += '<li class="next"><a href="#">Next</a></li>';
			h += '</ul>';
		this.recirc.prepend(h);
		this.navclick();
	},
	navclick : function() {
		$('#reciricnav').click(function(e) {
			var html = $(e.target).html(),
				dist = PEOPLE.flyingrecirc.recircwidth;
			switch (html) {
				case 'Next':
					PEOPLE.flyingrecirc.next('-='+dist);
					break;
				case 'Previous':
					PEOPLE.flyingrecirc.previous('+='+dist);
					break;
				default:
					PEOPLE.flyingrecirc.close();
			}
			return false;
		});
	},
	sliderclick : function() {
		this.slider.click(function(e) {
			var el = $(e.target),
				p = el.parent().get(0).tagName;
			switch (p) {
				case 'A': // image
					omniFlyOutTracker('image_click',PEOPLE.flyingrecirc.getheadline()); 
					break;
				case 'H4': // headline
					omniFlyOutTracker('headline_click',PEOPLE.flyingrecirc.getheadline()); 
					break;
				case 'P': // cta
					omniFlyOutTracker('cta_click',PEOPLE.flyingrecirc.getheadline()); 
					break;
			}
		});
	}
};
tii_callFunctionOnWindowLoad(PEOPLE.flyingrecirc.init);


// ------ New Brightcove Player js (bug #33743, 33729, 33702; overwrites changes from #33584 ) ------ //

function getplayer(json){
	if (typeof celebdbvideos === 'undefined'){return;}
	for(i=0;i<celebdbvideos.length;i++){
		$.ajax({
			async: false,
			url: 'http://api.brightcove.com/services/library?command=find_video_by_reference_id&reference_id=' + celebdbvideos[i].videoid + '&video_fields=name,id,length,publisheddate,referenceid&token=z82mZPLs0IuL3IOHflrej0z20nir2iTbXFQOcgWNKfE.',
			dataType: 'jsonp',
			success: function(result){
				appendplayer(result);
			},
			error: function(){
				$('#player').innerHTML = 'We\'re sorry, but there seems to have been an error...';
			}
		});
		
	}
}

$(getplayer);

var videocount = 0;

function appendplayer(json){

	var playlistfragment = '';
	
	// Begin: display first video by default
		if (videocount == 0) {
			var playlistfragmentouter = '<ul>';
			playlistfragmentouter += '<li id="playlist1" class="current"></li>';
			playlistfragmentouter += '<li id="playlist2" class=""></li>';
			playlistfragmentouter += '<li id="playlist3" class=""></li>';
			playlistfragmentouter += '</ul>';
			$('#playlist').append(playlistfragmentouter);
		}
	// End: display first video by default

	// Compare CT video ID to BC video reference ID
	for(i=0;i<celebdbvideos.length;i++){

		if (celebdbvideos[0].videoid == json.referenceId) {

			// write the first video player to the page
			firstvidfragment = '<div id="bcPlayer' + json.id + '" class="videobox">';
			firstvidfragment += '<object id="myExperience' + json.id + '" class="BrightcoveExperience">';
			firstvidfragment += '<param name="bgcolor" value="#FFFFFF" />';
			firstvidfragment += '<param name="width" value="286" />';
			firstvidfragment += '<param name="height" value="275" />';
			firstvidfragment += '<param name="playerID" value="69609902001" />';
			firstvidfragment += '<param name="publisherID" value="416418724"/>';
			firstvidfragment += '<param name="isVid" value="true" />';
			firstvidfragment += '<param name="wmode" value="transparent" />';
			firstvidfragment += '<param name="isUI" value="true" />';
			firstvidfragment += '<param name="optimizedContentLoad" value="true" />';
			firstvidfragment += '<param name="@videoPlayer" value="' + json.id + '"/>';
			firstvidfragment += '</object>';
			firstvidfragment += '</div>';
	
			$('#player').html(firstvidfragment);

		}




		if (celebdbvideos[i].videoid == json.referenceId) {
			var videopubdate = celebdbvideos[i].pubdate; // get the Publish Date from CT
			var videotitle = celebdbvideos[i].title; // get the Video Title from CT
			var videoduration = celebdbvideos[i].duration; // get the Video Duration from CT
			var videoposition = i+1; // get the Video Title from CT
	
			// Begin: playlist fragment
				// begin content of <li>
				playlistfragment += '<span class="tout"><a href="javascript:showthisvideo(' + json.id + ',' + videoposition +  ')"><p class="date">' + videopubdate + '</p>';
				playlistfragment += '<h5>' + videotitle + '</h5>';
				playlistfragment += '<p class="length">' + videoduration + '</p></a></span>';
				playlistfragment += '<span class="bdr"></span>';
				// end content of <li>
	
				currentvideo = '';
			// End: playlist fragment
	
			videocount++;
			$('#playlist'+videoposition).append(playlistfragment);
	
		}
	}

	// Begin: Write playlist code to page
		if(videocount == celebdbvideos.length){
			brightcove.createExperiences();
		}
	// End: Write playlist code to page
}

// hide and show the correct player
function showthisvideo(currentvideoid, videoposition){
	// Begin: Writes player code for current video
	playerfragment = '<div id="bcPlayer' + currentvideoid + '" class="videobox">';
	playerfragment += '<object id="myExperience' + currentvideoid + '" class="BrightcoveExperience">';
	playerfragment += '<param name="bgcolor" value="#FFFFFF" />';
	playerfragment += '<param name="width" value="286" />';
	playerfragment += '<param name="height" value="275" />';
	playerfragment += '<param name="playerID" value="69609902001" />';
	playerfragment += '<param name="publisherID" value="416418724"/>';
	playerfragment += '<param name="isVid" value="true" />';
	playerfragment += '<param name="wmode" value="transparent" />';
	playerfragment += '<param name="isUI" value="true" />';
	playerfragment += '<param name="optimizedContentLoad" value="true" />';
	playerfragment += '<param name="@videoPlayer" value="' + currentvideoid + '"/>';
	playerfragment += '</object>';
	playerfragment += '</div>';
	$('#player').html(playerfragment);

	brightcove.createExperiences();
	// End: Writes player code for current video

	// show the current active tout
	$('#playlist').find('li').removeClass('current');
	$('#playlist'+videoposition).addClass('current');
}

// ------ End: New Brightcove Player js (bug #33743, 33729, 33702; overwrites changes from #33584 ) ------ //