
  var c=1;
  var t;

  function slideshow()
  {
    c=c+1;

    if (c==10) {
      c=1;
    }
      
    //document.getElementById('topimg').src = 'images/topview' + c + '.jpg';   
    crossfade(document.getElementById('topimg'), '/images/topview' + c + '.jpg', '2', '');
    t=setTimeout('slideshow()',4000)
  }


  idold = 0;
  function setImgBig(img){
    document.getElementById('img_big').src = 'data/imgservizio/' + img;
  }

  function accendiThumb(idnew){
    document.getElementById('span_' + idnew).style.display = 'none';
    idold = idnew
  }

  function spengiThumb(){
    document.getElementById('span_' + idold).style.display = '';
  }



  var immagini=new Array()
  function preload(){   
     var total=preload.arguments.length; // Totale immagini da preparicare
     var cc=0; // Contatore Immagini già precaricate
     for (cont=0;cont<total;cont++)
     {
          immagini[cont]=new Image();
          immagini[cont].src=preload.arguments[cont];
          immagini[cont].onload=function(){cc++;}
     }
     while(cc<total){}
     location.href= "home.asp";
  }

  function validation(rifform){
    num = rifform.elements.length;
    cont = 0;
    strMes = "";
    while (cont < num)
    {
      campo = toString(rifform.elements[cont]);
      idcampo = String(rifform.elements[cont].id);
      nomecampo = String(rifform.elements[cont].name);
      //alert(idcampo + " - " + idcampo.indexOf("ob_"));
      if (idcampo.indexOf("ob_") == 0 )
      { 
        valuecampo = String(rifform.elements[cont].value);
        if (valuecampo.length < 1 )
        {
          label = document.getElementById("lbl_" + nomecampo).innerHTML;
          strMes = strMes + "Campo " + label + " non compilato correttamente.\n";
        }
      }
      cont++;
    }
    if (strMes.length > 1 )
    {
      alert(strMes);
      return false;
    }else{
      return true;
    }
  }




function view_address() {
  address_to_replace = document.getElementById("e").firstChild; 
  real_address = address_to_replace.nodeValue.replace("[at]", "@"); 
  address_to_replace.nodeValue = real_address;  
  address_to_replace.parentNode.setAttribute("href", "mailto:"+real_address);  
} 
