/*
JAD Rotator by Marco Paoli
Flipper Banner rotator Auto System
Integrated with Root AutoScan software
Made by Marco Paoli
www.marcopaoli.net
tutti i diritti riservati
*/

function not(){
alert('Funzione in fase di implementazione');
}
/*
Flipper Banner rotator Auto System
Integrated with Root AutoScan software
Made by Marco Paoli
www.marcopaoli.net
*/
function changeImage(r,i)
{
r.src=i;
}

function goFlipURL()
{
  document.location = urlSet[currentFlip];
}

function flipFlipper(imageSet,speed)
{
  currentFlip ++;
  if (currentFlip == imageSet.length)
    currentFlip=0;
  changeImage(document.flip,imageSet[currentFlip]);
  setTimeout("flipFlipper(imageSet,speed)", speed)
}

function FlipperLong(width,height,s,images)
{
/* si: start index 
** i: current index
** ei: end index
** cc: current count
*/
 speed = s;
 si = 0; 
 ci=0;
 cc=0;
 imageSet = new Array();
 ei = images.length;
  for (i=1;i<ei;i++) {
    if (images.charAt(i) == ' ') {
      imageSet[cc] = images.substring(si,i);
      cc++;
      si=i+1;
      }
    }
  currentFlip = 0;
   
 document.write("<center><img name='flip' border='0'");
 //		if (width >0)
 //  	document.write("width="+width);
if (height >0)
document.write(" height=" +height);
  document.writeln(" src=" +imageSet[0]+ "></center>");

  setTimeout("flipFlipper(imageSet,speed)", speed)
}

function Flipper(width,height,images,speed)
{
  FlipperLong(width,height,speed,images);
}

function FlipperLnk(width,height,images,urls,speed)
{
  FlipperLinkLong(width,height,speed,images,urls);  
}



function FlipperLinkLong(width,height,s,images,urls)
{
/* si: start index 
** i: current index
** ei: end index
** cc: current count
*/
 speed = s;
 imageSet = new Array();
 urlSet = new Array();

 si = 0; 
 ci=0;
 cc=0;
 ei = images.length;
  for (i=1;i<ei;i++) {
    if (images.charAt(i) == ' ') {
      imageSet[cc]= images.substring(si,i);
      cc++;
      si=i+1;
      }
    }

 si = 0; 
 ci=0;
 ccu=0;
 ei = urls.length;
  for (i=1;i<ei;i++) {
    if (urls.charAt(i) == ' ') {
      urlSet[ccu]= urls.substring(si,i);
      ccu++;
      si=i+1;
      }
    }

  currentFlip = 0;
   
 document.write("<a href=\"javascript:goFlipURL()\"><img name='flip'");
 document.write("<img name='flip' border='0'");
 if (width >0)
    document.write("width="+width);
 if (height >0)
    document.write(" height=" +height);
  document.writeln(" src=" +imageSet[0]+ "></a>");

  setTimeout("flipFlipper(imageSet,speed)", speed)
}

function FlipperLink(width,height,images,urls)
{
  speed=2000;
  FlipperLinkLong(width,height,speed,images,urls);
}


function validate()
{
	val = document.forms[0].visione.value;

	if (val == 0)
	{
	alert("ATTENZIONE!\nPer proseguire è necessario  dichiarare di aver preso visione dell'informativa relativa al trattamento dei dati personali");
	return false;
	}
		/*
	if ((document.forms[0].consenso.value!=1 ))
	{
	alert("ATTENZIONE!\nPer proseali");
	return false;
	}
		*/
		
		else
		{
		return true;
		
		}


}


function Aprifinestra(doc){
	window.open(doc,"schermo","toolbar=no,directories=no,menubar=no,width=400,height=400,location=no,resizable=no,scrollbars=yes");
}

