function invia(lingua) {
  var mandatory;
  var fieldMandatory = new Array(1);
  var lunFieldMandatory = 1;
  fieldMandatory[0] = "this.moduloForm.e_mail";
  
  for(var i=0;i<lunFieldMandatory;i++) {
     mandatory = eval(fieldMandatory[i]).value;
     if(mandatory == "")   {
		if(lingua == "ita") 
        	alert("ATTENZIONE: inserire l'indirizzo email.");
		else if(lingua == "ger") 
        	alert("ACTHTUNG: das email Feld ist obligatorisch.");
		else if(lingua == "ing") 
        	alert("ATTENTION: the email field is compulsory.");
			
		eval(fieldMandatory[i]).value = "";
        eval(fieldMandatory[i]).focus();
        return false;
     }
     else continue;
  }
      document.moduloForm.submit();
    return(true);
}


function openFoto(struttura) {
   var winl = (screen.width - 750) / 2; 
   var wint = (screen.height - 700) / 2; 
   window.open('http:../foto/phpslideshow.php?directory='+struttura,'Galleria','scrollbars=yes,resizable=yes,width=750,height=700,top='+wint+',left='+winl+',status=no,location=no,toolbar=no');
}

var remoteWin1;
function newWindowCent(newUrltoOpen, width, height) { 
   var winl = (screen.width - width) / 2; 
   var wint = (screen.height - height) / 2; 
   if(remoteWin1 && remoteWin1.close) { 
       remoteWin1.close(); 
       remoteWin1 = null; 
   } 
   else { 
       remoteWin1 = null; 
   } 
   if (remoteWin1 == null) { 
       remoteWin1 = window.open("","remoteWin1", 
          'toolbar=0,location=0,directories=0,statusbar=0,status=0,menubar=0,scrollbars=0,resizable=0,menubar=no,copyhistory=no,width=' + width + ',height=' +  height + ',top='+wint+',left='+winl ); 
       remoteWin1.location.href=newUrltoOpen; 
    } 
}

var remoteWin2;
function newWindow2Cent(newUrltoOpen, width, height) { 
   var winl = (screen.width - width) / 2; 
   var wint = (screen.height - height) / 2; 
   if(remoteWin2 && remoteWin2.close) { 
       remoteWin2.close(); 
       remoteWin2 = null; 
   } 
   else { 
       remoteWin2 = null; 
   } 
   if (remoteWin2 == null) { 
       remoteWin2 = window.open("","remoteWin2", 
          'toolbar=0,location=0,directories=0,statusbar=0,status=0,menubar=0,scrollbars=1,resizable=1,menubar=no,copyhistory=no,width=' + width + ',height=' +  height + ',top='+wint+',left='+winl ); 
       remoteWin2.location.href=newUrltoOpen; 
    } 
}


defaultStatus = "- www.vieste.net -";



/*  
   Inserire il numero di banner da far girare
   al posto del 2 che trovate inserito in questo esempio alla 
   voce : number_of_sponsors=2;  */

//defaultStatus="";
number_of_sponsors=2;

var sctr=0;
var isn=new Array();
for (i=0;i<number_of_sponsors;i++){
 isn[i]=new Image();
}

/* Le immagini sono caricate nell'array isn[x]
   Il numero fra parentesi []ne indica la posizione,
   dove anche lo 0 è un numero a tutti gli effetti.
   Specificare fra virgolette il nome dell'immagine e 
   la sua estensione che potrebbe essere di tipo gif o jpg,
   completa di eventuale percorso per poterla raggiungere nel caso in cui
   fosse posizionata in una cartella o indirizzo URL diverso da quello
   in cui si trova lo script Script.
   L'immagine [0] sarà quella caricata per prima. */


isn[0].src="./_img/ban-san-francesco.gif";
isn[1].src="./_img/ban-hotel-more.gif";


/* Stessa cosa vale per l'URL da richiamare associato all'immagine. 
Questi sono caricati nell'array durl[x] dove anche in questo caso 
il numero fra parentesi quadrte [] indica la posizione, che dovrà corrispondere allo
stesso numero della relativa immagine associata nell'array precedente. */



var durl=new Array();
durl[0]="http://www.vieste.net/redir.php?id=145&ling=ITA";
durl[1]="http://www.vieste.net/redir.php?id=146&ling=ITA";


/*  Qui sotto il timer ch eregola il tempo fra un cambio 
	banner e l'altro, è espresso in millisecondi. 
	Al momento è impostato a 10 secondi: 10000
	(ovviamente 5000=5 secondi,  30000 = 30 sec, ecc ecc)
    Per cui, volendo ridurre o aumentare il tempo, si dovra incrementare
	o decrementare questo numero. */


function rotateIt(){
  sctr++;
  if (sctr>number_of_sponsors-1){
   sctr=0;
   }
  document.sponsor.src=isn[sctr].src;
  setTimeout("rotateIt()",7500);
}

/* Questo script puo lavorare in siti con o senza frames. 
   Se dall'interno di un frame si vole aprire il link a tutto schermo  TARGET="_top" 
   si dovrà modifcare l'istruzione:  
   location.href 
   con 
   parent.location.href=durl[sctr];  */


/*function doIt(){
 location.href=durl[sctr];
 }*/
 
 function doIt(){
var urlbanner=durl[sctr];
weblink=window.open(urlbanner);}


function dispIt(){
 parent.window.status=durl[sctr];
 }






