function updateStylesheets() {
	var i,a,s;
	a=document.getElementsByTagName('link');
	for(i=0;i<a.length;i++) {
		s=a[i];
		if(s.rel.toLowerCase().indexOf('stylesheet')>=0&&s.href) {
			var h=s.href.replace(/(&|\\?)forceReload=d /,'');
			s.href=h+(h.indexOf('?')>=0?'&':'?')+'forceReload='+(new Date().valueOf());
		}
	}
}
function parseFAU(zona,pathT,azione,key,asyncRequest){	
/*if (azione=="logo") {alert(azione)}*/
/*		alert(pathT+azione+asyncRequest)*/
		var xmlDoc = asyncRequest.responseXML;
			aa=0;
			while (1){
			    try {
			    if (!(xmlDoc.childNodes[aa].tagName==null)){

			var properties = xmlDoc.childNodes[aa];
			var countT=properties.length;
/*			alert(xmlDoc.childNodes[aa].tagName)*/
			a=0;
			idx=0;
			while (1){
			    try {
			    b=0;
			    if (!(xmlDoc.childNodes[aa].childNodes[a].tagName==null)){
				result=xmlDoc.childNodes[aa].childNodes[a].tagName;
				var newnod = document.createElement(result);
				var numi = document.getElementById(pathT);
				newnod.setAttribute('id','n'+idx);
				newnod.setAttribute('class',result);
				numi.appendChild(newnod);
				testo="";
				urle="";
				titolo='';
//				newnod.innerHTML+=testo;
// 				newnod.innerHTML+="<BR>";
				idx+=1;
				testo="";
				urle="";
				titolo="";
				summary="";
				datat="";
				namet="";
				content="";
				imag="";
				while(1){
				try {
				    //alert(b+"xxx"+xmlDoc.childNodes[0].childNodes[a].childNodes[b].tagName);
				    if (!(xmlDoc.childNodes[aa].childNodes[a].childNodes[b].tagName==null)){
					  tagge=xmlDoc.childNodes[aa].childNodes[a].childNodes[b].tagName;
					  var newsottonod = document.createElement(tagge);
					  newsottonod.setAttribute('class',tagge);
					  newnod.appendChild(newsottonod);
					  if(tagge=="urle"){
					      urle=xmlDoc.childNodes[aa].childNodes[a].childNodes[b].firstChild.nodeValue;
      // 					testo="</li><li><div class=\"view-item view-item-"+pathT+"\"><div class=\"view-field view-data-node-title\"><a href=\""+xmlDoc.childNodes[aa].childNodes[a].firstChild.nodeValue+">"+xmlDoc.childNodes[aa].childNodes[a].firstChild.nodeValue+"</a></div></div>";
      // 					testo="<BR>"+xmlDoc.childNodes[aa].childNodes[a].firstChild.nodeValue+"class"+result;
					  }else if(tagge=="titolo"){
					      titolo=xmlDoc.childNodes[aa].childNodes[a].childNodes[b].firstChild.nodeValue;
					  }else if(tagge=="date"){
					      datat=xmlDoc.childNodes[aa].childNodes[a].childNodes[b].firstChild.nodeValue;
					  }else if(tagge=="name"){
					      namet=xmlDoc.childNodes[aa].childNodes[a].childNodes[b].firstChild.nodeValue;
					  }else if(tagge=="summary"){
					      summary=xmlDoc.childNodes[aa].childNodes[a].childNodes[b].firstChild.nodeValue;
					  }else if(tagge=="content"){
					      content=xmlDoc.childNodes[aa].childNodes[a].childNodes[b].firstChild.nodeValue;
					  }else if(tagge=="imgg"){
					      imag=xmlDoc.childNodes[aa].childNodes[a].childNodes[b].firstChild.nodeValue;
					  }
/*					  newsottonod.innerHTML+=xmlDoc.childNodes[aa].childNodes[a].childNodes[b].firstChild.nodeValue+"class"+tagge+"-";*/
					  c=0;
				    }//else{alert(b)}
				}catch(e){break;}
				b+=1;
			      }
/*alert(azione)*/
			      if(titolo.length>0){
					  if(azione=="bottoni"){
					      testo+="<li><div class=\"view-item view-item-"+pathT+"\"><div class=\"view-field view-data-node-title\">"
					      testo+="<a href=\"#"+"oceano"+"\" onClick= \" caricaXML('"+"oceano"+"','post','" + pathT +"','"+ titolo.substring(1,titolo.length-1) + "') \" >"+titolo.substring(1,titolo.length-1)+",<BR>"+datat+"</BR></a></li>";
					      testo+="<p>"+summary+"</p>";   
//					  alert("aa"+titolo.substring(1,titolo.length-1)+"cc")
// 					  alert("aa"+pathT+"cc")
					  }else if(azione=="logo"){
					      testo+="<p><span onmouseout=\"window.status=' '\" onmouseover=\"window.status='http://paura.anche.no/'\" style=\"text-decoration: none; font-weight: 900; color: rgb(230, 10, 83); cursor: pointer;\" onclick=\"window.open('http://paura.anche.no/', '', 'menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes');\"><img style=\"margin-left: 30px; border: 1px solid rgb(255, 255, 255);\" src=\"http://www.autistici.org/campagne/paura.gif\" width=\"100\" height=\"100 ></span><br><br><br>";
					      testo+="<a href=\"http://www.informa-azione.info/antifascismo\"><img style=\"margin-left: 30px; border: 1px solid rgb(255, 255, 255);\" src=\"http://www.informa-azione.info/files/antifa_piccola.jpg\" width=\"100\" height=\"100></a></p>"
					  }else if (azione=="post"){
					      if(key==titolo.substring(1,titolo.length-1)){
					      testo+="<p>"+datat+"</p>";
						    testo+="<h1 class=\"title\">"+titolo+"</h1><div class=\"node\">";
						    if(imag.length>0){
							testo+="<BR><img src =\""+imag+"\" width=\"200\" height=\"150\"/>";
						    }
/*						    testo+="<p>"+summary+"</p>";    */
						    testo+="<p>"+content+"</p>";
						    testo+="<div class=\"content\"><span class=\"print-link\"></span><p><i>fonte "+namet+"</i></p></div></div>"
					      }
					  }else if (azione=="postTOT"){
					      testo+="<p>"+datat+"</p>";
					      testo+="<h1 class=\"title\">"+titolo+"</h1><div class=\"node\">";		      
						    if(imag.length>0){
							testo+="<BR><img src =\""+imag+"\" width=\"200\" height=\"150\"/>";
						    }
/*					      testo+="<p>"+summary+"</p>";    */
					      testo+="<p>"+content+"</p>";
						    testo+="<div class=\"content\"><span class=\"print-link\"></span><p><i>fonte "+namet+"</i></p></div></div>"
					  }
/*					      alert(testo)*/
			      newsottonod.innerHTML=testo;
			      }
		}
	    }catch(e){break;}
	    a+=1;
	  }// end function stateChange
	  }
	  }catch(e){break;}
	  aa+=1;
	  }
	  updateStylesheets();
}
function cancTAG(res){
    var cell = document.getElementById(res);
    try{
    if ( cell.hasChildNodes() ){
	while ( cell.childNodes.length >= 1 ){
	    try{
	    if ( cell.childNodes.hasChildNodes() ){
		while ( cell.childNodes.childNodes.length >= 1 ){
		    try{
		    if ( cell.childNodes.childNodes.hasChildNodes() ){
			while ( cell.childNodes.childNodes.childNodes.length >= 1 ){
			    cell.childNodes.childNodes.removeChild( cell.childNodes.childNodes.firstChild );       	
			}
		    }
		    }catch(e){}
		    cell.childNodes.removeChild( cell.childNodes.firstChild );	    
		}
	    }
	    }catch(e){}
	    cell.removeChild( cell.firstChild );       
	}
      }
    }catch(e){}
}
