function verificaBrowser(){ 
    this.ver=navigator.appVersion; 
    this.dom=document.getElementById?1:0; 
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
    this.ie4=(document.all && !this.dom)?1:0;
    this.ns5=(this.dom && parseInt(this.ver) >= 5)?1:0;
    this.ns4=(document.layers && !this.dom)?1:0;
    this.nav=(this.ie5 || this.ie4 || this.ns4 || this.ns5);
    return this;
} 

nav=new verificaBrowser();
var velocita=50;
var loop, timer; 
 
function CostruttoreOggetto(obj,base){ 
    base=(!base) ? '':'document.'+base+'.' ;
    this.el=nav.dom?document.getElementById(obj):nav.ie4?document.all[obj]:nav.ns4?eval(base+'document.'+obj):0; 
    this.css=nav.dom?document.getElementById(obj).style:nav.ie4?document.all[obj].style:nav.ns4?eval(base+'document.'+obj):0; 
    this.scrollHeight=nav.ns4?this.css.document.height:this.el.offsetHeight;
    this.clipHeight=nav.ns4?this.css.clip.height:this.el.offsetHeight;
    this.up=MuoviAreaSu;
    this.down=MuoviAreaGiu; 
    this.MuoviArea=MuoviArea;
    this.x;
    this.y;     
    this.obj = obj + "Object";
    eval(this.obj + "=this");
    return this;   
} 

function MuoviArea(x,y){ 
    this.x=x;this.y=y;
    this.css.left=this.x;
    this.css.top=this.y;     
} 
 
function MuoviAreaGiu(distanza){ 
if(this.y>-this.scrollHeight+Cont.clipHeight){ 
    this.MuoviArea(0,this.y-distanza);
    if(loop) setTimeout(this.obj+".down("+distanza+")",velocita);
		} 
}
 
function MuoviAreaSu(distanza){ 
if(this.y<0){ 
    this.MuoviArea(0,this.y-distanza);
    if(loop) setTimeout(this.obj+".up("+distanza+")",velocita);
		} 
} 
 

/*
function ScorriArea(velocita){ 
	if(init){ 
		loop=true; 
		if(velocita>0)  Area.down(velocita);
		else Area.up(velocita); 
		} 
} 

*/


function ScorriArea(velocita,AreaScroll){ 
	if(init){ 
		loop=true; 
		if(velocita>0)  AreaScroll.down(velocita);
		else AreaScroll.up(velocita); 
		} 
} 



function FermaArea(){
    loop=false;
    if(timer) clearTimeout(timer);
} 


var init;

/*

function InizializzaArea(contenitore,contenuto){ 
    nav=new verificaBrowser();
    Cont=new CostruttoreOggetto(contenitore);
    Area=new CostruttoreOggetto(contenuto,contenitore);
   //	if (nav.ns4 &&(window.innerWidth>795)) {Cont.css.left=0;Cont.css.top=0;}
   // if (nav.ns4 &&(window.innerWidth<=795)) {Cont.css.left=0;Cont.css.top=0;}
    Cont.css.visibility='visible';
    Area.MuoviArea(0,0);
    init=true;
    
} 


*/