$(function() {
	$.ajax( {
		url: "news.xml",
		type: 'GET',
         dataType: ($.browser.msie) ? "text" : "xml",
         error: function(xml){
	        alert("xmlファイルの読み込みに失敗しました");
	     },
		success:function(xml) {
//			alert("xmlファイルの読み込みに成功しました");
				var xmll;
                if (typeof xml == "string") {
                    xmll = new ActiveXObject("Microsoft.XMLDOM");
                    xmll.async = true;
                    xmll.loadXML(xml);
                } else {
                    xmll = xml;
                }
//               alert($(xmll).text());//alertを表示　←①

				var n = $(xmll).find("item").size();
				var item_text = "";
					$(xmll).find("item").each(function(i){
							item_text +=  "<li>";
							item_text += $("date",this).text();
							item_text +=  "　";
							if ($("liveicon",this).text() == "1" ){
								item_text +=  "<img src='images/sche/ico_live.gif' class='mgR05' />";
							}
							if ($("newicon",this).text() == "1" ){
								item_text +=  "<img src='images/sche/ico_new.gif' class='mgR05' />";
							}
							item_text +=  "<br><span class='bold'>";
							if ($("tag",this).text() != "" ){
								item_text +=  "<a href='04schedule.html#";
								item_text +=  $("tag",this).text();
								item_text +="' >";
								item_text +=$("title",this).text();
								item_text +="</a>";
							}else{
								if ($("link",this).text() != "" ){
								item_text +=  "<a href='";
									item_text +=  $("link",this).text();
									item_text +=  "' target='_blank";
									item_text +=  "' >";
									item_text +=  $("title",this).text();
									item_text +=  "</a>";
								}else{
									item_text +=  $("title",this).text();
								}
							}
							item_text +=  "</span>　</li>";
					});
			$("ul#news_xml").html(item_text);
//		alert(item_text);
		}});
});

