
/*
	XMLからインフォメーション一覧のリストを作成します。
	
	※ 変数 catName はHTML側に記載
*/
$(document).ready(function () {
							
	var date = new Date();
		
	$.ajax({
		url: "/products/oen/info.xml?"+ date.getTime(),
		success: function(_data){
			$("category[name = '"+ catName +"'] info", _data).each(function(){
				var o = {};
				o["description"] = $(this).find("description").text();
				o["date"] = $(this).find("pubDate").text();

				var template = new HTMLTemplate(o);
				template.evaluate($("#informationContent"));
			});
		}
	});
});
	
var HTMLTemplate = function(conv){
	this.template = $('<tr><td>&nbsp;</td><td valign="top" nowrap><p class="f1">'+conv.date+'</p></td><td valign="top"><p class="f1">'+conv.description+'</p></td><td>&nbsp;</td></tr><tr><td colspan="4"><img src="/products/oen/img/top_line02.gif" width="538" height="9" vspace="3"></td></tr>');
}

HTMLTemplate.prototype.evaluate = function(dest){
	$(dest).append(this.template)
}
