﻿window.name="areamediawebWindow";

	var screenWidth;
	var screenHeight;
	var windowWidth;
	var windowHeight;
	var windowLeft;
	var windowTop;

	screenWidth=screen.width;
	screenHeight=screen.height;

	function esempio(imageName, larghezza, altezza)
	{
		windowWidth = larghezza;
		windowHeight = altezza;

		windowLeft = screenWidth / 2 - windowWidth / 2;
		windowTop = screenHeight / 2 - windowHeight / 2;

		searchWin = window.open('zoom.asp?ingrandimento='+ imageName,'',
		  'scrollbars=no,resizable=no,width=' + windowWidth + ',height=' + windowHeight + ',left=' + windowLeft + ',top=' + windowTop + 
		  ',status=no,location=no,toolbar=no');
	}
	
	ATuttoSchermo();
	
	function ATuttoSchermo() {
	  window.moveTo(0,0);
	  window.resizeTo(screen.width,screen.height);
	}
	
	//funzioni AMW

  //concatena due funzioni
  function addf(f1,f2){
    return (f1?function(){f1();f2();}:f2);
  }

  //accoda la funzione alla body onload
  function addonload(f){
    if(document.onloadfatto) f(); else window.onload=addf(window.onload,f);
  }
  addonload(function(){document.onloadfatto=true;});

  //esegue l'array di funzioni l temporizzandolo
  function temporizza(t,l) {
    var n=0;

    function tempn(){
      if(n>=l.length) n=0;
      var p=l[n++]; p[0]();
      setTimeout(tempn,p[1]);
    }

    addonload(function(){setTimeout(tempn,t);});
  }

  //scandisce un array
  function xtutti(a,f){
    for(var n=0,m=a.length;n<m;++n) f(a[n]);
  }

  //scandisce un albero di nodi
  function xtuttiq(a,f){
    for(var n=0,m=a.length;n<m;++n) {
      var p=a[n]; f(p); xtuttiq(p.childNodes,f);
    }
  }

  //attiva il lampeggìo su tutti i tag che contengono color2
  addonload(function(){
    xtuttiq(document.childNodes,function(p){
      var a=p.attributes; if(a && a.color2){
      var t=a.tempo.value; temporizza(t,[
        [function(){p.color1=p.color; p.color=a.color2.value;},t],
        [function(){p.color=p.color1;},t]]);
    }});
  });

window.onbeforeprint=function(){ img5xmille.src='/popup/ws_5_x_mille_bianco.gif'; };
window.onafterprint=function(){ img5xmille.src='/popup/ws_5_x_mille.gif'; };


function chiudi_popup()

{
document.getElementById("popup-container").style.display="none";
}
