var url = 'rss.php';
function AskRemote(url,onSuccessMethod )
{
    new Ajax.Request(url,
    {
            method:'get',     
        onSuccess: function(transport){
            var response = transport.responseXML || "";
            onSuccessMethod(response);
        }
    }); //prototype.js
	
/*	 
 $.ajax({
  type: "GET",
  url: url,
  cache: false,
  dataType: "xml",
  success: function(data){
    onSuccessMethod(data);
  }
}); 
 *///jquery.js
 

}



function updateNotice(obj)
{
	var notice=$("notice");
	var dyHTML="";
	var itemNum=3
	if (obj)
	{
		//var entry=obj.getElementsByTagName("entry");
		var entry=obj.getElementsByTagName("item");
		if (entry.length<itemNum) itemNum=entry.length;
		dyHTML+="<ul>"
		for(var i=0; i<itemNum;i++)
		{
			dyHTML+="<li><div class=\"NewsTitle\">";
			//dyHTML+="<a href=\""+ entry[i].getElementsByTagName("link")[0].getAttributeNode("href").nodeValue +"\">"+entry[i].getElementsByTagName("title")[0].firstChild.nodeValue+"</a></div>";
			//dyHTML+="<div class=\"Newsbrief\">"+subText(entry[i].getElementsByTagName("content")[0].firstChild.nodeValue,150,false)+"</div></li>";
			dyHTML+="<a href=\""+ entry[i].getElementsByTagName("link")[0].firstChild.nodeValue +"\">"+entry[i].getElementsByTagName("title")[0].firstChild.nodeValue+"</a></div>";
			dyHTML+="<div class=\"Newsbrief\">"+subText(entry[i].getElementsByTagName("description")[0].firstChild.nodeValue,150,false)+"</div></li>";
		
		}
		dyHTML+="</ul>"
		notice.update(dyHTML);
	}
}

function subText(str,num,enableHtml)
{
	var suspoint="";
	if (str.length>num) suspoint="...";
	if (enableHtml)
	{
		return str.substr(0,num)+suspoint;
	}else
	{
		return str.unescapeHTML ().escapeHTML().substr(0,num)+suspoint;
	}
	
}

AskRemote(url,updateNotice);