
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function musica() {
try{
  x0=1;
  y0=1;
  xx=90;
  yy=70;
  opt="toolbar=0,location=0,directories=0,titlebar=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width="+xx+",height="+yy+",screenX="+x0+",screenY="+y0;
  Audio=window.open("Audio","Audio",opt);
  Audio.opener.focus();
  Audio.location="audio.php";
  Audio.resizeTo(xx,yy);
  Audio.moveTo(x0,y0);
  Audio.opener.focus();
}catch(e){ return;
}}

function apri(url) {
  x0=1;
  y0=1;
  xx=700;
  yy=screen.availHeight;
  opt="toolbar=0,location=0,directories=0,titlebar=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width="+xx+",height="+yy+",screenX="+x0+",screenY="+y0;
  winann=window.open("winann","winann",opt);
	winann.resizeTo(xx,yy);
	winann.moveTo(x0,y0);
	winann.location=url;
	winann.focus();
}

function Disabilita(frm){
    for(i=0;i<frm.length;i++){
      var tempobj=frm.elements[i]
      if((tempobj.type.toLowerCase()=="submit")||(tempobj.type.toLowerCase()=="button")){
        tempobj.disabled=true
      }
    }
}

function funblank(dove,nome,xx,yy,opt){
  x0=1;
  y0=1;
  if(opt=="1"){
	  opt="toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width="+xx+",height="+yy+",screenX="+x0+",screenY="+y0;
  }
  if(opt=="2"){
	  opt="toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,copyhistory=0,width="+xx+",height="+yy+",screenX="+x0+",screenY="+y0;
  }
  if(opt=="3"){
    opt="toolbar=1,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,copyhistory=0,width="+xx+",height="+yy+",screenX="+x0+",screenY="+y0;
  }
	try{
     nome=window.open('',nome,opt);
	   nome.moveTo(x0,y0);
     nome.resizeTo(xx,yy);
  }catch(e){}
	if(dove){ nome.location=dove; }
	nome.focus();
}

function jsTrim(stringa){
			while (stringa.charAt(0) == " " && stringa.length >1 )
				stringa = stringa.substring(1, stringa.length);
			while (stringa.charAt(stringa.length-1) == " ")
			stringa = stringa.substring(0, stringa.length-1);
			return stringa;
}



var slideShowSpeed = 3000
var crossFadeDuration = 4
var Pic = new Array()
Pic[0] = 'images/panorama-versilia1.jpg'
Pic[1] = 'images/panorama-versilia2.jpg'
Pic[2] = 'images/panorama-versilia3.jpg'
Pic[3] = 'images/panorama-versilia4.jpg'
Pic[4] = 'images/panorama-versilia8.jpg'
Pic[5] = 'images/panorama-versilia9.jpg'
Pic[6] = 'images/panorama-versilia10.jpg'
Pic[7] = 'images/panorama-versilia11.jpg'
Pic[8] = 'images/panorama-versilia12.jpg'
Pic[9] = 'images/panorama-versilia13.jpg'
Pic[10] = 'images/panorama-versilia14.jpg'
var t
var j = 0
var p = Pic.length
var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}
function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}
