
$(function(){
	$.ajax({
    url: 'datas/xml/topics.xml',
    type: 'GET',
    dataType: 'xml',
    timeout: 1000,
    error: function(){
        alert("Loading false");
    },
    success: function(xml){
        $(xml).find("news").each(function(){
						var date = $(this).find("date").text();
						var text = $(this).find("text").text();
						var url = $(this).find("url").text();
						var target = $(this).find("window").text();
						var tag;
						var target_window;
						
						if (url == "") {
							tag = date + "&nbsp;&nbsp;&nbsp;&nbsp;" + text;
						}
						
						else {
							if (target == "") {
								target_window = "_self";
							}
							else {
								target_window = "_blank";
							}
							tag = "<a href='" + url + "' target='" + target_window + "'>" + date + "&nbsp;&nbsp;&nbsp;&nbsp;" + text + "</a>";
						}

            $("<li></li>").html(tag).appendTo('.topicsList');
        });
				
				// marquee start
				$("#marquee").marquee({yScroll: "bottom"});
				
    }
    });
	
		
});

