$(function(){
	$("dd.noscript").remove();
	var month={"Jan":"01","Feb":"02","Mar":"03","Apr":"04","May":"05","Jun":"06","Jul":"07","Aug":"08","Sep":"09","Oct":"10","Nov":"11","Dec":"12"};
	var category;
	var gametitle = location.href.split("/")[3];
	if(gametitle==""||gametitle=="index.html")gametitle="gs24";
	var datacount=0;
	$.ajax({
		url: '/information/sangoku.xml',
		type: 'GET',
		dataType: 'xml',
		timeout: 1000,
		error: function(){
			//console.log("error");
		},
		success: function(xml){
			$(xml).find("item").each(function(){
				var pubdate = $(this).children("pubDate").text().split(" ");
					pubdate = "["+pubdate[3]+"-"+month[pubdate[2]]+"-"+pubdate[1]+"]";
				var title = $(this).children("title").text();
				var link = $(this).children("link").text();
				var newflag = $(this).children("new").text();
				var list = "";
				var icon = "";
				category={0:"announce",1:"event",2:"maintenance"};
				if(datacount<21) {
					(newflag==0)?(list="<dd></dd>",icon=""):list="<dd class='new'></dd>";
					$(list).html(pubdate + '<a href="' + link + '">' + title + '</a>' + icon).appendTo('dl.'+category[$(this).children("category").text()]);
					datacount++;
				}
			});
		}
	});
tabEvent();
});
function tabEvent(){
  $("#tabContainer").children("h3").click(function(){
    $("#tabContainer h3").attr("class","");
    $("#tabContainer dl").hide();
    $('dl.'+$(this).attr("id").split("_")[1]).show();
    $(this).attr("class","selected");
  });
}
