function link_esterni(){
if(!document.getElementsByTagName) return;
l=document.getElementsByTagName("a");
for(i=0;i<l.length;i++){
  if(l[i].className.indexOf("ext")!=-1){
    l[i].title="Link esterno, viene aperto in una nuova finestra";
    l[i].onclick=function(){window.open(this.href);return(false)};
    }
  }
}

function hide(oggetto) {
	boxCommenti = document.getElementById(oggetto);
	boxCommenti.className = 'hide';
}
function show(oggetto,classe) {
	boxCommenti = document.getElementById(oggetto);
	boxCommenti.className = classe;
}
function show_hide(oggetto) {
	obj = document.getElementById(oggetto);
	if (obj.className == 'hide') obj.className=oggetto;
	else obj.className='hide';
}

function assegna_classe(oggetto,classe) {
	boxCommenti = document.getElementById(oggetto);
	boxCommenti.className = classe;
}

function wait() {
	show_hide('attendi');
}

function cambia_foto(nuova,testo) {
	if (testo!='') testo='Nella foto: <b>'+testo+'</b>';
	document.getElementById('descrizione_foto').innerHTML=testo;
	show_hide('attendi');
	boxCommenti = document.getElementById('foto_cane');
	boxCommenti.src = 'images/cani/'+nuova+'.jpg';
	boxCommenti.onload=wait;
}

function cambia_foto_cucciolo(nuova,testo) {
	if (testo!='') testo='Nella foto: <b>'+testo+'</b>';
	document.getElementById('descrizione_foto').innerHTML=testo;
	show_hide('attendi');
	boxCommenti = document.getElementById('foto_cane');
	boxCommenti.src = 'images/cuccioli/'+nuova+'.jpg';
	boxCommenti.onload=wait;
}

function body_init() {
	link_esterni();
}