//	Photos
	PEOPLE.Photos = PEOPLE.Photos || [];
//	for Archive page only
	PEOPLE.Photos.Archive = function(){ // adds overlay functionality
		$('#leftColumns a.modallink').click(function() { //open modals
			$('#middleColumn div.modal').removeClass('active');
			var thisid = $(this).attr('id').split('-');
				thisid = '#' + thisid[1];
			if(thisid.length > 1) {
				var newheight = Number($('#middleColumn').height()) + 50;
				$('#modalbackground').addClass('on').height(newheight);
				$(thisid).addClass('active');
			}
			return false;
		});
		$('#middleColumn div.modal a.close').click(function() { //close modals
			$('#modalbackground').removeClass('on');
			$('#middleColumn div.modal').removeClass('active');
			return false;
		});
	};
//	initialize Partner Recirc feeds; uses Global PartnerRecirc function
	var initializePhotosRecirc = function() {
		if (!document.getElementById) return;
		if (!document.getElementsByTagName) return;
		var recircArray = {
			'recircs' : [
				{
					'id'		: 'rightRecirc',
					'type' 		: 'random',
					'display'	: 1,
					'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',
							'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',
							'display'	: 2
						},{
							'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',
							'display'	: 2
						}
					]
				},{
					'id'		: 'rightcolumnrecirc',
					'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',
						}
					]
				},{
					'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'
						}
					]
				}
			]
		};
		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]);
			}
		}
	}
	initializePhotosRecirc();
//	run functions once page is loaded
    loadTheseFunctions = function() {
        if ($('#photos.archive').length > -1) {PEOPLE.Photos.Archive();};
    };
//	run page load functions
    tii_callFunctionOnWindowLoad(loadTheseFunctions);

