

var j$ = jQuery;
$(document).ready(function(){
	j$(function(){
		
		//news latest
		$.ajax({
			type: "GET",
			url: "news_xml.php?limit=8&mode=0",
			dataType: "xml",
			success: function(xml){
					$(xml).find("item").each(function()
					{
						var t = "<dt>"+$(this).attr("date")+"</dt>";
						if( $(this).attr("link") )
						{
							t += "<dd><a href='"+$(this).attr("link")+"'>"+$(this).text()+"</a></dd>";
						}
						else
						{
							t += "<dd>"+$(this).text()+"</dd>";
						}
						j$("#latest .news-list").append(t);
						
					});
			} , 
			error : function (xml){
					j$("#latest .news-list").append("");
			}
		});
		
		//news news-release
		$.ajax({
			type: "GET",
			url: "news_xml.php?limit=8&mode=1",
			dataType: "xml",
			success: function(xml){
					$(xml).find("item").each(function()
					{
						var t = "<dt>"+$(this).attr("date")+"</dt>";
						if( $(this).attr("link") )
						{
							t += "<dd><a href='"+$(this).attr("link")+"'>"+$(this).text()+"</a></dd>";
						}
						else
						{
							t += "<dd>"+$(this).text()+"</dd>";
						}
						j$("#news-release .news-list").append(t);
						
					});
			} , 
			error : function (xml){
					j$("#news-release .news-list").append("");
			}
		});
	}); 

});