var net;if(!net){net={}}else{if(typeof net!="object"){throw new Error("net already exists and is not an object")}}if(!net.ckfiumi){net.ckfiumi={}}else{if(typeof net.ckfiumi!="object"){throw new Error("net.ckfiumi already exists and is not an object")}}if(net.ckfiumi.Ticker){throw new Error("net.ckfiumi.Ticker already exists")}var myGlobalHandlers={onCreate:function(){Element.show("loading")},onComplete:function(){if(Ajax.activeRequestCount==0){Element.hide("loading")}}};Ajax.Responders.register(myGlobalHandlers);net.ckfiumi.Feed=Class.create();net.ckfiumi.Feed.prototype={initialize:function(b,a){this.name=b;this.url=a;this.prefix="rss";this.exportArray=Array()},start:function(){var a="";try{this.request(this.url,a)}catch(b){div_avvisi.appendChild(document.createTextNode(b));Element.hide("loading")}},request:function(a,b){var c=new Ajax.Request(a,{method:"get",parameters:b,onComplete:this.manageRss.bind(this),onLoaded:this.loaded.bind(this),onSuccess:this.success.bind(this),onFailure:this.failure.bind(this),asynchronous:1});if(!c.transport){throw"Ajax non è abilitato"}},loaded:function(){$("div_avvisi").appendChild(document.createTextNode(" Loaded "))},interactive:function(){$("div_avvisi").appendChild(document.createTextNode(" Interattivo "))},success:function(){$("div_avvisi").appendChild(document.createTextNode(" Success "))},failure:function(a){$("div_avvisi").appendChild(document.createTextNode(" Failure "+a.status))},manageRssToTicker:function(b){if(b.readyState==4){if(b.status==200){response=b.responseXML.documentElement;items=response.getElementsByTagName("item");nodes=$A(items);var c=0;var a=Array();var d=this.prefix;nodes.each(function(f){title=Utf8.decode(f.getElementsByTagName("title")[0].firstChild.data);href=f.getElementsByTagName("link")[0].firstChild.data;autore=f.getElementsByTagName("dc:creator")[0].firstChild.data;descrizione=f.getElementsByTagName("description")[0].firstChild.data;a[c]='<p class="rss_title"><a href="'+href+'">'+title+"</a></p><p>"+descrizione+"</p>";c++});ticker3.set(a);ticker3.start();var e=$("div_avvisi");clearText(e);e.appendChild(document.createTextNode("OK caricato"))}else{throw new Error("qualcosa non va .... ajax gioe e dolori ??!!")}}},manageRss:function(a){if(a.readyState==4){if(a.status==200){response=a.responseXML.documentElement;items=response.getElementsByTagName("item");var b=$("div_rss");clearText(b);nodes=$A(items);var c=this.prefix;i=0;nodes.each(function(h){if(i++<5){var e=document.createElement("div");var g=document.createElement("a");g.className=c+"_title ";g.href=h.getElementsByTagName("link")[0].firstChild.data;g.appendChild(document.createTextNode(h.getElementsByTagName("title")[0].firstChild.data));var f=document.createElement("p");f.className=c+"_title ";f.appendChild(g);var k=document.createElement("span");k.className=c+"_author ";k.appendChild(document.createTextNode("by "+h.getElementsByTagName("dc:creator")[0].firstChild.data+". "));var j=document.createElement("span");j.className=c+"_desc ";str=(h.getElementsByTagName("description")[0].firstChild.data).substring(0,100);j.appendChild(document.createTextNode(str.substring(0,str.lastIndexOf(" "))+"... "));e.appendChild(f);e.appendChild(k);e.appendChild(j);b.appendChild(e)}});var d=$("div_avvisi");clearText(d);d.appendChild(document.createTextNode("OK caricato"))}else{}}}};if(document.getElementById){document.write('<style type="text/css">');document.write(".rss_title{");document.write("	font-size:x-small;");document.write("	text-decoration: underline;");document.write("	color: black;");document.write("	font-family: Arial, Helvetica, sans-serif;");document.write("}");document.write(".rss_author{");document.write("	font-size:10px;");document.write("	color: black;");document.write("	font-family: Arial, Helvetica, sans-serif;");document.write("}");document.write(".rss_desc{");document.write("	font-size:10px;");document.write("	color: black;");document.write("	font-family: Arial, Helvetica, sans-serif;");document.write("}");document.write(".rss_avvisi{");document.write("	font-size:12px;");document.write("	font-weight: bold;");document.write("	color: red;");document.write("	text-align: center;");document.write("	font-family: Arial, Helvetica, sans-serif;");document.write("}");document.write("</style>")}var feed=new net.ckfiumi.Feed("Feed","/rep/news.xml");
