google.load("feeds", "1");
function initializeTop5() {
	var feed = new google.feeds.Feed("http://www.cars-on-line.com/feeds/atom/top5.xml");
	feed.setNumEntries(5);
	feed.load(function(result) {
		if (!result.error) {
			var theHTML="<table width='140' height='90' cellspacing='2' cellpadding='0' border='0'><tbody><tr><td align='center' colspan='2'><a class='TOP5-HEADER' href='top5.html'><img width='136' height='22' border='0' align='bottom' naturalsizeflag='3' src='http://www.cars-on-line.com/COLrootimages/newtop5bar.gif'/></a></td><td>&nbsp;</td></tr>";
			theHTML+="<tr><td class='TOP5-HEADER'><a class='TOP5-HEADER' href='"+ result.feed.link+"'>"+ result.feed.title+"</a></td><td class='TOP5-HEADER'> Hits </td></tr>";
			var container = document.getElementById("top5");
			for (var i = 0; i < result.feed.entries.length; i++) {
				theHTML+="<tr>";
				theHTML+="<td><a class='TOP5-ITEM' href='" + result.feed.entries[i].link + "'>" + result.feed.entries[i].title + "</a></td>";
				theHTML+="<td class='TOP5-ITEM'>" + result.feed.entries[i].content + "</td>";
				theHTML+="</tr>";
			}
			theHTML+="</tbody></table>";
			container.innerHTML=theHTML;
		}
	});
}
function initializeFeaturedPostings() {
	var feed = new google.feeds.Feed("http://www.cars-on-line.com/feeds/atom/featuredPostings.xml");
	feed.setNumEntries(12);
	feed.load(function(result) {
		if (!result.error) {
			var theHTML="<table width='303' border='1' cellspacing='2' cellpadding='2'>";
				theHTML+="<tr>";
			var container = document.getElementById("featuredPostings");
			for (var i = 0; i < result.feed.entries.length; i++) {
				if ( i%2 == 0 )theHTML+="</tr><tr>";
				theHTML+="<td width='50%'><a class='FEATURED-ITEM' href='" + result.feed.entries[i].link + "' title='"+ result.feed.entries[i].content +"' >" + result.feed.entries[i].title + "</a></td>";
			}
			theHTML+="</tr>";
			theHTML+="</table>";
			container.innerHTML=theHTML;
		}
	});
}
google.setOnLoadCallback(initializeTop5);
google.setOnLoadCallback(initializeFeaturedPostings);

