function prendiElementoDaId(id_elemento) {
 var elemento;
 if(document.getElementById)
  {elemento = document.getElementById(id_elemento);}
 else
  {elemento = document.all[id_elemento];}
 return elemento;
}

function swapimage(id,immagine) {
   var roll = prendiElementoDaId(id);
   roll.setAttribute('src','images/'+immagine);
}
function swapinput(thefield,campo){
if (thefield.defaultValue==thefield.value)
thefield.value = "";
if (campo=='password')
document.getElementById("pass").setAttribute("type","password");
} 
function backinput(thefield,campo) {
if (thefield.value=="")
thefield.value = thefield.defaultValue;
if (campo=='password')
document.getElementById("pass").setAttribute("type","password");
}