function cambia(elemento, ora, percorso) {
  var img_no_ora=new Array('r','i','u','t');
  var test=in_array(img_no_ora, ora);
  var lnk_img=document.getElementById("link_img");  
  var img_anteprima=document.getElementById("img_anteprima");
  var img = document.getElementById(elemento);  
  if(test==true)
  {
  	img_anteprima.style.visibility = 'visible';
   	img_anteprima.setAttribute("src", percorso);
  	lnk_img.setAttribute("href", percorso);
	document.getElementById(elemento).href=percorso+"/hour"+ora+".jpg";

  }else 
  if(test==false)
  {
  	img_anteprima.style.visibility = 'visible';
  	img_anteprima.setAttribute("src", percorso+"/hour"+ora+".jpg");
	lnk_img.setAttribute("href", percorso+"/hour"+ora+".jpg");
	document.getElementById(elemento).href=percorso+"/hour"+ora+".jpg";
  }
  alert("POPO");
}

function in_array(thaArray, elem) {
for (var i=0; i<thaArray.length && thaArray[i]!=elem; i++);
return thaArray[i]==elem;
}

function findhead1()
{
    var detectElement;
    detectElement = document.all("link_img");
    if (detectElement == "link_img")
    {
        alert("Element \'link_img\' exists");
    }

}

