var popup = function(targetElement) {
	alert('Link with href ' + $(targetElement).attr('href') + ' activated');	
};
$(document).ready(function() {
	$.clickOrEnter('a.popup',popup);
	
	/*var options = {
		newsList: "#news",
		startDelay: 10,
		loopDelay: 3000
	}
	$().newsTicker(options);
	*/
	var options2 = {
		newsList: "ul#news2",
		startDelay: 10,
		loopDelay: 2999
	}
	$.ajax({
		type: "GET",
		url: "/rss.xml",
		dataType: "xml",
		success: function(xml) {
			$('<ul id="news2"></ul>').insertAfter('#news');
			$('<h2>News ticker displaying this site\'s feed</h2>').insertBefore('#news2');
			$(xml).find('item').each(function(){
				var desc = $(this).find('title').text();
				var link = $(this).find('link').text();
				$('<li><a href="'+link+'">'+desc+'</a></li>').appendTo('ul#news2');
			});
			$().newsTicker(options2);
		}
	});		
});
