<!-- Hide from JavaScript-Impaired Browsers

/* --------------------------------------------------------- */
/* Scrolling iframe News */
/* A=self.frames[0] => news (problemi con AdSense) ; */
function Scrol(x)
{
        A=self.frames[0] ;
        if (x == "stop")
        { clearInterval(B) }
        if (x == "su")
        { B = setInterval ('news.scrollBy(0, -8)', 100) }
        if (x == "giu")
        { B = setInterval ('news.scrollBy(0, 8)', 100) }
}


/* --------------------------------------------------------- */
/* login form */

function Login(form) {

document.login.submit();
var username = form.username.value;
var password = form.password.value;

var Dir=new Array();
Dir["mariella"]="/denied/mariella.shtml";
Dir["admin"]="/webmaster/index.shtml";
Dir["andrea"]="/seatexsails/index.html";
Dir["parassita"]="/seatexsails/iparassiti.html";
Dir["sergio"]="/nm/index.shtml";
Dir["gigi"]="/tender/index.shtml";
Dir["centrosurf"]="/centrosurf/index.html";
Dir["lamula"]="/nordest/index.shtml";
Dir["lorenzo"]="/nm/index.shtml";

var Url = window.location.hostname + Dir[form.username.value];

if (username && password && Url) {
var htsite = "http://" + username + ":" + password + "@" + Url;
//alert(window.location);
//alert(htsite);
window.location=htsite;
//alert(htsite);
}
else {
alert("Please enter your username and password.");
   }
}


/* --------------------------------------------------------- */
/* Banner rotation */

/* First, if you load fewer or more than 6 sponsors
   into your rotator, change the "sponnr" variable
   to the actual number of sponsor .gifs you plan to
   load. */

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


/* The sponsor .gif names are loaded into the isn[x]
   sponsor images array.  You may load any number of
   sponsor images (.gif or .jpg or both) into this
   array. They must all be the same size, however.
   Substitute your own .gif filenames for the ones
   shown here. Note that the first .gif must appear
   in the isn[0] array element. */

/* isn[0].src="/img/banner.gif"; */
isn[0].src="/img/banner_TdU.gif";
isn[1].src="/img/banner_BW.jpg";
/*isn[2].src="/img/banner_dna.jpg";*/



/* Finally, replace the URL's below with those of
   your sponsors IN THE SAME ORDER. */

var durl=new Array();

durl[0]="http://www.torredegliulivi.it";
durl[1]="http://www.bestwind.it/";
/*durl[2]="http://www.dnasurfshop.com/";*/

/* This script is set to rotate every 10 seconds.
   (5000=5 seconds, so 30000 would equal 30, etc)
   You should change the number in the setTimeout()
   call below for the number of seconds you wish. */

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

/* This code will work just fine with or without
   frames.  However, if you are in frames and wish
   to replicate the TARGET="_top" call to remove
   frames, change the location.href call to:
    parent.location.href=durl[sctr];
   below. */

function doIt(){
 halt=1;
 parent.location.href=durl[sctr];
/* location.href=durl[sctr]; */
 }

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


/* --------------------------------------------------------- */
 function popupPage(URL,w,h) {
   var windowprops =
   "location=no, scrollbars=yes, menubars=no,toolbars=no,resizable=yes" +
   ",left=" + 100 + ",top=" + 100 + ",width=" + w + ",height=" + h;
   popup = window.open(URL,"popup",windowprops);
 }


/* --------------------------------------------------------- */
 Today = new Date();
 Anno=Today.getFullYear();

 function Sfiga(Anno) {
   eval("location='/cgi-pradelafam/getweekchart.cgi?Anno="+Anno+"'");
 }

 function GetIt(Anno,Mese) {
   eval("location='/cgi-pradelafam/gettable.cgi?Mese="+Mese+"&Anno="+Anno+"'");
 }

 function GetIt0(Anno,Mese) {
   eval("location='/tender/wind/gettable.cgi?Mese="+Mese+"&Anno="+Anno+"'");
 }

 function GetIt1(Anno,Mese) {
   eval("location='/seatexsails/gettable.cgi?Mese="+Mese+"&Anno="+Anno+"'");
  }

 function GetIt2(Anno,Mese) {
   eval("location='/cgi-pradelafam/getgraph.cgi?Mese="+Mese+"&Anno="+Anno+"'");
  }

 function GetIt3(Anno) {
   eval("location='/cgi-pradelafam/getbarchart.cgi?Anno="+Anno+"'");
  }


/* --------------------------------------------------------- */
 function SelectDate() {
 today = new Date();
 document.Scelta.Mese.options.selectedIndex = today.getMonth();
 // Netscape: getYear() started from 0 in 1900 (year 2000 = 100)
 Anno = today.getYear();
 // Workaround Y2K problem;
 if (Anno < 1000) Anno += 1900;
 // Current year index selection 
 document.Scelta.Anno.options.selectedIndex = Anno - 1999;
 }


/* --------------------------------------------------------- */
 function DataDiOggi() {
 var mydate=new Date() ;
 var year=mydate.getYear() ;
 if (year < 1000) year += 1900 ;
 var day=mydate.getDay();
 var month=mydate.getMonth() ;
 var daym=mydate.getDate();
 if (daym<10) daym="0"+daym ;
 
 var dayarray=new Array("Domenica","Lunedi'","Martedi'","Mercoledi'","Giovedi'","Venerdi'","Sabato")
 
 var montharray=new Array("Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre")
 
 document.write("<B><font size='1' color='white'>"
 + "Pradelafam - Porto di Tignale (BS) - Lake Garda - "
 + dayarray[day] + " "
 + daym + " "
 + montharray[month] + " "
 + year + " </font></B>");
 }


/* --------------------------------------------------------- */
/* Webcam image refresh */
var t = 60 // interval in seconds
imgsrc = "";
function ErrorImg() {
setTimeout("LoadImg()", t*1000);
}
function LoadImg() {
if (imgsrc == "") imgsrc = document.images.pradelafam.src;
document.images.pradelafam.onload = "";
tmp = new Date();
tmp = "?"+tmp.getTime();
document.images.pradelafam.src = imgsrc+tmp;
setTimeout("LoadImg()", t*1000);
}


// End Hiding -->
