function setMyNews(titolo,data,descrizione,img,alg){
		
	document.getElementById("newstitolo").innerHTML=titolo;
	document.getElementById("newsdata").innerHTML=data;
	document.getElementById("newstext").innerHTML='';
	document.getElementById("newstext").innerHTML=descrizione;
	document.getElementById("newsimg").setAttribute('src','http://www.molinellavacanze.it/thumb/thumb_'+img+'');
       if (alg != '0') {        
document.getElementById("allegato").innerHTML = '<img src="http://www.molinellavacanze.it/gfx/elem/adobe.gif" /> <a style="text-decoration:none;" href="http://www.molinellavacanze.it/thumb/'+ alg + '"> Download Coupon </a>';
} else {
 document.getElementById("allegato").innerHTML = '';
}
}
/*-----------------------------
	Set News and Ul
-----------------------------*/

function setNews() { 
	
	var xmldoc = xmlhttp.responseXML; 
	
	var titolo = xmldoc.getElementsByTagName('titolo');
	var descrizione = xmldoc.getElementsByTagName('descrizione'); 
	var data = xmldoc.getElementsByTagName('data');
	var image = xmldoc.getElementsByTagName('image');
        var docs = xmldoc.getElementsByTagName('doc');
   	
	if(xmlhttp.readyState==4){
	
	ul = document.getElementById("items");
	
	for(var i = 0; i < titolo.length; ++i){
		
		li = document.createElement("li");
		li.setAttribute((document.all ? 'className' : 'class'), 'content');
		liData = document.createElement("li");
		liData.setAttribute((document.all ? 'className' : 'class'), 'data');
		
		liLink = document.createElement("a");
		
		liLinkContent = document.createTextNode(titolo[i].firstChild.nodeValue);
		liLink.appendChild(liLinkContent);
		
		liDataContent = document.createTextNode(data[i].firstChild.nodeValue);
		liData.appendChild(liDataContent);
		
		desc = descrizione[i].firstChild.nodeValue;
		img=image[i].firstChild.nodeValue;
               try {
               alg = docs[i].firstChild.nodeValue;
               } catch(e){
                       alg = 0;
               }
                
		
		liLink.setAttribute('href','javascript:setMyNews("'+titolo[i].firstChild.nodeValue+'","'+data[i].firstChild.nodeValue+'","'+desc+'","'+img+'","'+alg+'")');
		
		li.appendChild(liLink);
		ul.appendChild(li);	
		ul.appendChild(liData);	
		
	}
		document.getElementById("newstitolo").appendChild(document.createTextNode(titolo[0].firstChild.nodeValue));
		document.getElementById("newsdata").appendChild(document.createTextNode(data[0].firstChild.nodeValue));
		document.getElementById("newstext").appendChild(document.createTextNode(descrizione[0].firstChild.nodeValue));
		document.getElementById("newsimg").setAttribute('src','http://www.molinellavacanze.it/thumb/thumb_'+image[0].firstChild.nodeValue+'');
                
try {
                if (docs[0].firstChild.nodeValue != '')
                document.getElementById("allegato").innerHTML = '<img src="http://www.molinellavacanze.it/gfx/elem/adobe.gif" /> <a style="text-decoration:none;" href="http://www.molinellavacanze.it/thumb/'+ docs[0].firstChild.nodeValue + '"> Download Coupon </a>';
} catch (e) {}
	}
	
}
