function vedi_immagine(divid,immagine_piccola, immagine_grande, descrizione_immagine) {
  document.getElementById('new_slideshow').style.display='inline'; 
  testo="<img src=\"[scratch indirizzo_ridotto]" + immagine_grande + " \" alt=\" " + descrizione_immagine + " \" >";
  document.getElementById(divid).innerHTML=testo;
}

function controlla() {
    var mai=document.form1.email.value;
    var tel=document.form1.telefono1.value;
    var cit=document.form1.citta.value;
    var nom=document.form1.nome.value;
    var mes='';
    if (nom =='') {
      var mes=mes + 'Campo Nome non compilato\n';
    }

    if (tel =='') {
      var mes=mes + 'Campo Telefono non compilato\n';
    }

    if (cit =='') {
      var mes=mes + 'Campo Città non compilato\n';
    }

    if (nom =='') {
      var mes=mes + 'Campo Nome non compilato\n';
    }
    if (mes != '') { 
      var mes=mes + '\nI campi richiesti risultano necessari per essere rapidamente Contattati\n\n';
      alert (mes);
    } else {
      document.form1.submit();
    }
  }

function updater_standard(a,b,c,d) {
c=unescape(c);
// alert(a + ' \n ' + b + ' \n '  + c);
if (b.indexOf('http')) {
  var sito="";
} else {
  var sito="";
};

  $(a).style.display='inline';
  $(a).style.background_color='#fff';
//  new Ajax.Updater(a,b, {parameters:c,evalScripts:true,success:a, asynchronous:true });

  if (d=='1') {
    var opt = {
      success:a,
      asynchronous:false,
      //    method: 'post',
      //    postBody: c,
      parameters: c,
       //    onSuccess: function(t) {
      onComplete: function(t) {
      $(a).innerHTML=t.responseText
      },

      on404: function(t) {
          alert('Error 404: location "' + t.statusText + '" was not found.');
      },
      onFailure: function(t) {
        alert('Error ' + t.status + ' -- ' + t.statusText);
      },
      evalScripts:true
    }
    new Ajax.Updater(a,sito + b, {method:'post',postBody:c,evalScripts:true,success:a, asynchronous:false });
    // new Ajax.Request(sito + b,opt );
  } else  {
    $(a).style.display='inline';
    $(a).style.background_color='#fff';
  //  new Ajax.Updater(a,sito + b, {parameters:'c',evalScripts:true,success:a, asynchronous:true });
    new Ajax.Updater(a,sito + b, {method:'post',postBody:c,evalScripts:true,success:a, asynchronous:true });
  };
}

function controlla_accedi() {
  var uno=document.accedi.mv_username.value;
  var due=document.accedi.mv_password.value;
  msguno="";
  msgdue="";
  if (uno =="") {
    msguno='[LOC]Login_user_e1[/LOC]';
  }
  if (due =="") {
    msgdue='[LOC]Login_pwd_e1[/LOC]';
  }
  if (document.accedi.mv_username.value.length < 1) {
    msguno='[LOC]Login_user_e1[/LOC]';
  }
  if (document.accedi.mv_password.value.length < 1) {
    msgdue='[LOC]Login_pwd_e1[/LOC]';
  }
  msgdest=msguno + ' ' + msgdue;
  
  if (msgdest.length > 2) {
    alert(msgdest);
  } else {
   document.accedi.submit();
  }
}
function controlla_registrati() {
  updater_standard('messaggio_errore','controlla_user','username=' + $('registrati_nome_utente').value,'1');
  uno="";
  due="";
  tre="";
  unol="";
  duel="";
  trel="";
  var uno=document.registrati.nome_utente.value;
  var due=document.registrati.password.value;
  var tre=document.registrati.re_pass.value;
  var unol=document.registrati.nome_utente.value.length;
  var duel=document.registrati.password.value.length;
  var trel=document.registrati.re_pass.value.length;
  msguno="";
  msgdue="";
  msgtre="";
  if (unol < 1) {
    msguno='[LOC]Login_user_e1[/LOC]';
  }
  if (duel < 1) {
    msgdue='[LOC]Login_pwd_e1[/LOC]';
  }

  if (due != tre) {
    msgtre='[LOC]Login_pwd_e3[/LOC]';
  }
  msgdest=msguno + ' ' + msgdue + ' ' + msgtre;
  
  if($('messaggio_errore').innerHTML!='') {
     msgdest="Il nome utente e' gia' in uso"; 
  }
 //  alert(msgdest) 
  if (msgdest.length > 2) {
    alert(msgdest);
  } else {
  document.registrati.submit();
  }
}


