function control(){
if (parent.window.frames.length == 0 ){
location="http://www.setteringlese.com/default_1.html";
}
}




function impostafileallegato1() {
if((document.form3.blob.value=="")||(document.form3.blob.value== null)){
alert("Attenzione il modulo non é stato inviato!\nIl campo relativo al file da esportare risulta vuoto!");
return false;
}else{
document.form1.fileallegato.value =document.form3.blob.value;
return true;
}
}

//verifica modulo

function isblank(s){
    for(var i=0;i=s.length;i++){
        var c =s.charAt(i);
        if ((c!=' ') && (c!='\n') && (c!='\t')) return false;
    }
    return true;
}

function verify (f){
   var msg;
   var empty_fields ="";
   var errors = "";

   for (var i =0;i< f.length; i++){
       var e =f.elements[i];
       if (((e.type == "text")||(e.type=="select-one") ||(e.ytpe =="textarea")) && !e.optional) {
           if((e.value ==null) || (e.value =="")||((e.value=="si")&&(document.form1.fileallegato.value=="")) || isblank(e.value)){
           empty_fields += "\n             " + e.name;
           continue;
           }
       }
   }
if (!empty_fields && !errors) return true;
  msg  = "___________________________________________________________\n\n"
  msg += "Il modulo non é stato inviato a causa degli errori seguenti\n";
  msg += "Si prega di correggere gli errori e di inviarlo nuovamente \n";
  msg += "___________________________________________________________\n";

if (empty_fields) {
  msg += " i seguenti campi risultano vuoti o inesatti\n\n" + empty_fields + "\n";
   if (errors) msg += "\n";
}
msg += errors;
alert (msg);
return false;
}
