PEOPLE.TVGrid = {
	latesttvnews : function(obj) {
		var latestNews = document.getElementById('latestNews');
		var o = obj.post;
		var h = '<p class="header"><a href="http://tvwatch.people.com/" title="Visit TVWatch for the latest TV News">Latest TV News</a></p>';
			h += '<ol>';
			for (i = 0; i < o.length; i++) {
				h += '<li><a href="' +o[i].link+ '">' +o[i].title+ '</a></li>';
			};
			h += '</ol>';
			h += '<p class="more"><a href="http://tvwatch.people.com/" title="Visit TVWatch for the more TV News">Read More News</a></p>';
			latestNews.innerHTML = h;
			latestNews.className = latestNews.className + ' active';
	},
	rightcolumntouts : function(obj) {
		var toutarray = [ 
			{
				"id"	: "photosMore",
				"title"	: "Photos &amp; More"
			},{
				"id"	: "dontMiss",
				"title"	: "Don&#39;t Miss"
			},{
				"id"	: "moreTVNews",
				"title"	: "More on TV News"
			}
		];
		for (i = 0; i < toutarray.length; i++) {
			var t = toutarray[i];
			var o = obj.touts[i];
			var tout = document.getElementById(t.id);
			var h  = '<p class="header">' +t.title+ '</p>';
				h += '<div class="toutSection">';
				h += o.html;
				h += '</div>';
				tout.innerHTML = h;
				tout.className = tout.className + ' active';
		};
	},
	init : function() {
		var body = document.getElementsByTagName('body')[0];
		if (document.getElementById('photosMore') && document.getElementById('dontMiss')) {
			var touts = document.createElement('script');
				touts.type = "text/javascript";
				//touts.src = "http://dev-wpcom.timeinc.net/wp-content/themes/peopfalltv/toutjs.php?touts=5,2&callback=PEOPLE.TVGrid.rightcolumntouts";
				touts.src = "http://tvwatch.people.com/wp-content/themes/vip/peopfalltv/toutjs.php?touts=4,7,5&callback=PEOPLE.TVGrid.rightcolumntouts";
			body.appendChild(touts);
		};
		if (document.getElementById('latestNews')) {
			var latest = document.createElement('script');
				latest.type = "text/javascript";
				//latest.src = "http://dev-wpcom.timeinc.net/wp-content/themes/peopfalltv/latesttvnews.php?headlines=5&callback=PEOPLE.TVGrid.latesttvnews";
				latest.src = "http://tvwatch.people.com/wp-content/themes/vip/peopfalltv/latesttvnews.php?headlines=5&callback=PEOPLE.TVGrid.latesttvnews";
			body.appendChild(latest);
		};
	}
};
tii_callFunctionOnWindowLoad(PEOPLE.TVGrid.init);
