$(document).ready(function () {
	
	var idx;
	$.getFeed({
		url: 'visitors.xml',
		success: function(feed) {

 
			//Unordered List
			var html = '<ul id="items">';
 
			$(feed.items).each(function(index){
				idx = index;
				var $item = $(this);
				var name = $item.attr("title");
				var desc = $item.attr("description");

				html += '<li class="item'+index+'">' +
				desc + 
				'</li>';
			});

			html += '</ul>';
 
			$('.visitorsContent').append(html);
			
			
			if(idx == feed.items.length-1){
				$('#items').simplyScroll({
					autoMode: 'loop',
					horizontal : false,
					pauseOnHover : false,
					frameRate: 60,
					speed : 2
				});
			}
			
			
		}
	});
	
				

});
function slideSwitch() {
    var $active = $('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 300, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 5000 );
});
