var headline_interval;
var handle;
function sticker() {
		if(handle){
			$('#update-target ul').html('').appendTo('#update-target ul');;
			$(".carousel").jCarouselLite({reset: 1});
		}
		
		$.ajax({
			type: "GET",
			url: "parsexml.php", //Requesting parsexml.php
			dataType: "xml", //Make sure that you specify the type of file you expecting (XML)
			success:function(xml){
				$(xml).find('item').each(
					function(){
                        // var id_text = $(this).attr('id');
						 var id_text = $(this).find('pubDate').text();
                         var name_text = $(this).find('title').text();
						 var link_text = $(this).find('link').text();
						 
                         $('<li></li>')
                             .html('<a href="'+link_text+'" target="_blank">' + name_text + '</a>')
                             .appendTo('#update-target ul');
                     }); //close each(
				myCarousel();
				handle = 1;
				$('#update-target ul li:odd').css('background', '#ffd2ff');
				$('#update-target ul li:odd').hover(function(){
					$(this).css('background', '#ff95ff');
				},
				function(){
					$(this).css('background', '#ffd2ff');
				});
				//headline_interval = setInterval(sticker,150000);
			}
		});
}

$(function () {
	sticker();
});