<!--
// VARIABILI GLOBALI
var number_of_banner1=0;  
var number_of_banner2=0;  
var number_of_banner3=0;  
var number_of_banner4=0;  
var number_of_banner5=0;  
var sctr1=0;
var sctr2=0;
var sctr3=0;
var sctr4=0;
var sctr5=0;
var halt=0;
var durl1=new Array();
var durl2=new Array();
var durl3=new Array();
var durl4=new Array();
var durl5=new Array();
var isn1=new Array();
var isn2=new Array();
var isn3=new Array();
var isn4=new Array();
var isn5=new Array();
var width1=new Array();
var width2=new Array();
var width3=new Array();
var width4=new Array();
var width5=new Array();
var height1=new Array();
var height2=new Array();
var height3=new Array();
var height4=new Array();
var height5=new Array();
//var impressionArray=new Array();
var IdBannerArray1=new Array();
var IdBannerArray2=new Array();
var IdBannerArray3=new Array();
var IdBannerArray4=new Array();
var IdBannerArray5=new Array();


function Inizializza(i,NumArray)
{
	/*alert("NumArray = " + NumArray);
	alert("i = " + i);*/
	switch(NumArray)
	{
	  case "1" : 
	  number_of_banner1 = i ;
  	for (j=0;j<=number_of_banner1;j++){isn1[j]=new Image();} 
	  break;
	  case "2" :
	  number_of_banner2 = i ;
  	for (j=0;j<=number_of_banner2;j++){isn2[j]=new Image();} 
	  break;
 	  case "3" :
	  number_of_banner3 = i ;
  	for (j=0;j<=number_of_banner3;j++){isn3[j]=new Image();} 
	  break;
 	  case "4" :
	  number_of_banner4 = i ;
  	for (j=0;j<=number_of_banner4;j++){isn4[j]=new Image();} 
	  break;
 	  case "5" :
	  number_of_banner5 = i ;
  	for (j=0;j<=number_of_banner5;j++){isn5[j]=new Image();} 
	  break;
  }
}

/*function CreaArray(img,url,impression,IdBanner,i)
{
  isn[i].src=img;
  //isn[i].alt=IdBanner;
  durl[i]=url;
  //impressionArray[i]=impression;
  IdBannerArray[i]=IdBanner;
}*/

function CreaArray(img,url,width,height,IdBanner,i,NumArray)
{  
  switch(NumArray)
   {
    case "1":
     isn1[i].src=img;
     durl1[i]=url;
     width1[i]=width;
     height1[i]=height;
     IdBannerArray1[i]=IdBanner;
     break;
    case "2":
     isn2[i].src=img;
     durl2[i]=url;
     width2[i]=width;  
     height2[i]=height;   
     IdBannerArray2[i]=IdBanner;
     break;
    case "3":
     isn3[i].src=img;
     durl3[i]=url;
     width3[i]=width;     
     height3[i]=height;
     IdBannerArray3[i]=IdBanner;
     break;
    case "4":
     isn4[i].src=img;
     durl4[i]=url;
     width4[i]=width;     
     height4[i]=height;
     IdBannerArray4[i]=IdBanner;
     break;
    case "5":
     isn5[i].src=img;
     durl5[i]=url;
     width5[i]=width;     
     height5[i]=height;
     IdBannerArray5[i]=IdBanner;
     break;
   }  
}

function rotateIt1(){
if (halt!=1){
  sctr1++;
  if (sctr1>number_of_banner1-1){
   sctr1=0;
  }
  document.Banner1.src=isn1[sctr1].src;
  document.Banner1.width=width1[sctr1]  
  document.Banner1.height=height1[sctr1]  
   if(number_of_banner1 > 0)
    {
      //parent.UpDateImpression.location.href='GestioneBanner/UpdateImpression.asp?IdBanner='+IdBannerArray1[sctr1]+'';
     setTimeout("rotateIt1()",3000);
    } 
 }
 }

function rotateIt2(){
 if (halt!=1){
  sctr2++;
  if (sctr2>number_of_banner2-1){
   sctr2=0;
   }
  document.Banner2.src=isn2[sctr2].src;
  document.Banner2.width=width2[sctr2]  
  document.Banner2.height=height2[sctr2]  
   if (number_of_banner2 > 0)
    {
      //parent.UpDateImpression.location.href='GestioneBanner/UpdateImpression.asp?IdBanner='+IdBannerArray2[sctr2]+'';
     setTimeout("rotateIt2()",5000);
    } 
 }
 }

function rotateIt3(){
 if (halt!=1){
  sctr3++;
  if (sctr3>number_of_banner3-1){
   sctr3=0;
   }
  document.Banner3.src=isn3[sctr3].src;
  document.Banner3.width=width3[sctr3]  
  document.Banner3.height=height3[sctr3]  
   if (number_of_banner3 > 0)
    {
      //parent.UpDateImpression.location.href='GestioneBanner/UpdateImpression.asp?IdBanner='+IdBannerArray3[sctr3]+'';
     setTimeout("rotateIt3()",4000);
    } 
 }
 }

function rotateIt4(){
 if (halt!=1){
  sctr4++;
  if (sctr4>number_of_banner4-1){
   sctr4=0;
   }
  document.Banner4.src=isn4[sctr4].src;
  document.Banner4.width=width4[sctr4]  
  document.Banner4.height=height4[sctr4]  
   if (number_of_banner4 > 0)
    {
      //parent.UpDateImpression.location.href='GestioneBanner/UpdateImpression.asp?IdBanner='+IdBannerArray4[sctr4]+'';
     setTimeout("rotateIt4()",5000);
    } 
 }
 }
function rotateIt5(){
 if (halt!=1){
  sctr5++;
  if (sctr5>number_of_banner5-1){
   sctr5=0;
   }
  document.Banner5.src=isn5[sctr5].src;
  document.Banner5.width=width5[sctr5]  
  document.Banner5.height=height5[sctr5]  
   if (number_of_banner5 > 0)
    {
      //parent.UpDateImpression.location.href='GestioneBanner/UpdateImpression.asp?IdBanner='+IdBannerArray5[sctr5]+'';
     setTimeout("rotateIt5()",5000);
    } 
 }
 }

/* function doIt(indice){
 halt=1;
 url= 'http://'+ durl[indice];
 window.open(url,"mm");
 location.href="HomePag.asp";
 } */

function doIt(indice,NumArray,Percorso){
 halt=1;
 w=600;
 h=400;
 LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
 TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
 
 switch(NumArray)
  {
   case "1":
     url= 'http://'+ durl1[indice];
     //url= Percorso+'IncrementaVisite.asp?IdBanner='+IdBannerArray1[indice]+'&Url='+durl1[indice]+'';
     //window.open(durl1[indice],"_blank","width=" + w + ",height=" + h + ",status=yes,scrollbars=yes,resizable=yes,toolbar=yes,top=" + TopPosition + ",left=" + LeftPosition);
     //location.reload();
     break;
   case "2":
     url= 'http://'+ durl2[indice];
     //url= Percorso+'IncrementaVisite.asp?IdBanner='+IdBannerArray2[indice]+'&Url='+durl2[indice]+'';
     //window.open(durl2[indice],"_blank","width=" + w + ",height=" + h + ",status=yes,scrollbars=yes,resizable=yes,toolbar=yes,top=" + TopPosition + ",left=" + LeftPosition);
     //location.reload();
     break;
   case "3":
     url= 'http://'+ durl3[indice];
     //url= Percorso+'IncrementaVisite.asp?IdBanner='+IdBannerArray3[indice]+'&Url='+durl3[indice]+'';
     //window.open(durl3[indice],"_blank","width=" + w + ",height=" + h + ",status=yes,scrollbars=yes,resizable=yes,toolbar=yes,top=" + TopPosition + ",left=" + LeftPosition);
     //location.reload();
     break;
   case "4":
     url= 'http://'+ durl4[indice];
     //url= Percorso+'IncrementaVisite.asp?IdBanner='+IdBannerArray4[indice]+'&Url='+durl4[indice]+'';
     //window.open(durl4[indice],"_blank","width=" + w + ",height=" + h + ",status=yes,scrollbars=yes,resizable=yes,toolbar=yes,top=" + TopPosition + ",left=" + LeftPosition);
     //location.reload();
     break;
   case "5":
     //url= 'http://'+ durl5[indice];
     //url= Percorso+'IncrementaVisite.asp?IdBanner='+IdBannerArray5[indice]+'&Url='+durl5[indice]+'';
     //window.open(durl5[indice],"_blank","width=" + w + ",height=" + h + ",status=yes,scrollbars=yes,resizable=yes,toolbar=yes,top=" + TopPosition + ",left=" + LeftPosition);
     //location.reload();
     break;
  }   
 if (url!='http://') window.open(url,"_blank");
 //location.href="HomePag.asp"+NomeId+'='+ValoreId+';
 }

function dispIt(){
 //parent.window.status=durl[sctr];
 }
