<script type="text/javascript" language="Javascript">
function modificaLink() {
var links = document.getElementsByTagName('a');
for (i = 0; i < links.length; i++) {
var link = links[i];
url = links[i].getAttribute('href');
if (url.substring(url.length-3, url.length)=='zip') {
icona = document.createElement('img');
icona.setAttribute('src', 'zip.gif');
icona.setAttribute('alt', 'File zip');
link.appendChild(icona);
}
else if (url.substring(url.length-3, url.length)=='pdf') {
icona = document.createElement('img');
icona.setAttribute('src', 'pdf.gif');
icona.setAttribute('alt', 'Documento PDF');
link.appendChild(icona);
}
}
}
window.onload = modificaLink;
</script>