\n';
divHTML += ' \n';
divHTML += '
\n';
divHTML += '
\n';
divHTML += '
\n';
divHTML += '
'+pos.cta+'
\n';
divHTML += '
\n';
divHTML = document.getElementById(pos.id).innerHTML + divHTML + '\n';
document.getElementById(pos.id).innerHTML = divHTML;
};
var checkScript = function(pos) {
var recircInt = setInterval(function() {
var name = pos.name.replace(/\./,'').replace(/ /,'');
if (document.getElementById('recirc-'+name)) {
pos.response = new Array(feed);
feed = null; detachScript(name); recircCallback(pos);
if(nextFeed < lastFeed) { getStarted(); };
clearInterval(recircInt);
}
},500);
};
var detachScript = function(name) {
elem = document.getElementById('recirc-'+name);
elem.parentNode.removeChild(elem);
};
var attachScript = function(pos) {
var name = pos.name.replace(/\./,'').replace(/ /,'');
var script = document.createElement('script');
script.setAttribute('type','text/javascript');
script.setAttribute('language','javascript');
script.setAttribute('id','recirc-'+name);
script.setAttribute('src',pos.json);
document.body.appendChild(script);
checkScript(pos);
};
var getStarted = function() {
nextFeed++;
if (document.getElementById(arr[nextFeed].id)) {
arr[nextFeed].callback = (arr[nextFeed].callback) ? arr[nextFeed].callback : recircCallback;
arr[nextFeed].display = (arr[nextFeed].display) ? arr[nextFeed].display : 3;
arr[nextFeed].cta = (arr[nextFeed].cta) ? arr[nextFeed].cta : 'More news at '+arr[nextFeed].name;
attachScript(arr[nextFeed]);
} else {
if(nextFeed < lastFeed) { getStarted(); };
}
};
var init = function() {
if (arr.length > 0) {
nextFeed = -1;
lastFeed = arr.length-1;
getStarted();
}
};
init();
}
// initialize Partner Recirc feeds on photo channel page
var initializeGlobalRecirc = function() {
if (!document.getElementById) return;
if (!document.getElementsByTagName) return;
var recircArray = {
'recircs' : [
{
'id' : 'globalrecirc',
'feed' : [
{
'name' : 'InStyle.com',
'json' : 'http://www.people.com/people/static/json/instyle_parties/feed.js',
'site' : 'http://www.instyle.com',
'image' : 'http://img2.timeinc.net/people/static/i/photos/logoInstyle.gif'
},{
'name' : 'PopEater.com',
'json' : 'http://www.people.com/people/static/json/aol_news/feed.js',
'site' : 'http://www.PopEater.com',
'image' : 'http://img2.timeinc.net/people/static/i/news/logoPopEater.gif'
},{
'name' : 'FoxNews.com',
'json' : 'http://www.people.com/people/static/json/foxnews/feed.js',
'site' : 'http://www.foxnews.com',
'image' : 'http://img2.timeinc.net/people/static/i/news/logoFoxNews.gif'
},{
'name' : 'EW.com',
'json' : 'http://www.people.com/people/static/json/ew/feed.js',
'site' : 'http://www.ew.com',
'image' : 'http://img2.timeinc.net/people/static/i/news/logoEW.gif'
},{
'name' : 'Huffington Post',
'json' : 'http://www.people.com/people/static/json/huffingtonpost/feed.js',
'site' : 'http://www.huffingtonpost.com/entertainment/',
'image' : 'http://img2.timeinc.net/people/static/i/photos/logoHuffingtonPost3.gif'
}
]
}/*,{ // example of how to do random recircs in a single container; to randomize order, but show both, change 'display' to 2
'id' : 'globalrecirc',
'type' : 'random',
'display' : 1,
'feed' : [
{
'name' : 'Huffington Post',
'json' : 'http://www.people.com/people/static/json/huffingtonpost/feed.js',
'site' : 'http://www.huffingtonpost.com/entertainment/',
'image' : 'http://img2.timeinc.net/people/static/i/photos/logoHuffingtonPost3.gif'
},{
'name' : 'USATODAY.com',
'json' : 'http://www.people.com/people/static/json/usatoday/feed.js',
'site' : 'http://www.usatoday.com',
'image' : 'http://img2.timeinc.net/people/static/i/photos/logoUSAToday.gif'
}
]
}*/
]
};
for (var a = 0; a < recircArray.recircs.length; a++) {
var tempArray = new Array(recircArray.recircs[a]);
var last = tempArray[0].feed.length;
if (tempArray[0].type && tempArray[0].type == 'random') {
tempArray[0].feed.sort(function() {return 0.5 - Math.random();});
last = tempArray[0].display;
}
for (var f = 0; f < last; f++) {
var ids = tempArray[0].id.split(',');
var thisID = (ids.length > 1) ? ids[f] : tempArray[0].id;
tempArray[0].feed[f].id = thisID;
MasterArray.push(tempArray[0].feed[f]);
}
}
}
initializeGlobalRecirc();
// start recirc feed process
var startRecircFeeds = function() {
var n = new PartnerRecirc();
}
// 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() {
addBookmarkDropdown("li");
startRecircFeeds();
}
tii_callFunctionOnWindowLoad(pageLoadFunctions);
// builds the embeddable Brightcove player
var buildEmbeddedBrightcovePlayer = function(videoID,chann,peoplechann,packageid) {
var config = new Array();
config["videoId"] = videoID;
if(!chann){ var chann = ""; }
if(!peoplechann){ var peoplechann = ""; }
if(!packageid){ var packageid = ""; }
config["additionalAdTargetingParams"] = ';chan='+chann+';pchan='+peoplechann+';pckge='+packageid;
config["videoRef"] = null;
config["lineupId"] = null;
config["playerTag"] = null;
config["autoStart"] = false;
config["preloadBackColor"] = "#FFFFFF";
config["width"] = 466;
config["height"] = 402;
config["playerId"] = 1803212252;
createExperience(config, 8);
}