
function linkizeTitles(result){

	if(result.feed.link) { result.feed.link = '/teleport/' + escape(result.feed.link.replace('http://', '').replace('https://', '').replace('?', '__2F__')); }
	if(result.feed.entries[0]) { result.feed.entries[0].link = '/teleport/' + escape(result.feed.entries[0].link.replace('http://', '').replace('https://', '').replace('?', '__2F__')); }
	if(result.feed.entries[1]) { result.feed.entries[1].link = '/teleport/' + escape(result.feed.entries[1].link.replace('http://', '').replace('https://', '').replace('?', '__2F__')); }
	if(result.feed.entries[2]) { result.feed.entries[2].link = '/teleport/' + escape(result.feed.entries[2].link.replace('http://', '').replace('https://', '').replace('?', '__2F__')); }
}

function LoadDynamicFeedControl() {
	var feeds = [ 
		{ title: 'HRT', url: 'http://www.hrt.hr/index.php?id=rss&type=100&rss=filmovi' },
		{ title: 'Popcorn', url: 'http://www.popcorn.hr/rss.php?what=vijesti' },
		{ title: 'HBO Hrvatska', url: 'http://www.hbo.hr/rss/news.xml' },
		{ title: 'Moj-film.hr', url: 'http://www.moj-film.hr/service/rss/novosti/' },
		{ title: 'MTV', url: 'http://www.mtv.com.hr/rss' },
		{ title: 'Sapunice.net', url: 'http://sapunice.net/feed/rss' },
		{ title: 'Serijala.com', url: 'http://feeds.feedburner.com/serijala' },
		{ title: 'MojTV', url: 'http://mojtv.hr/rss/handler.ashx?type=magazin' },
		{ title: 'mPortal', url: 'http://www.mportal.com.hr/RSS/Default.aspx' },
		{ title: 'Sto mu gromova', url: 'http://www.stomugromova.com/rd-rss-2' },
		{ title: 'Sedma umjetnost', url: 'http://www.sedmaumjetnost.com/feed/' },
		{ title: 'Dalje.com', url: 'http://www.dalje.com/rss/scena.xml' },
		{ title: 'Filmski.net', url: 'http://www.filmski.net/vijesti/rss/' }
	 ];
	var options = {
		numResults: 3,
		displayTime: 5000,
		fadeOutTime: 500,
		stacked: true,
		horizontal: false,
		feedLoadCallback: linkizeTitles
	}
	new GFdynamicFeedControl(feeds, 'googlefeed', options);
}

google.load('feeds', '1');
google.setOnLoadCallback(LoadDynamicFeedControl);
