﻿function grf_fx_ModuloHtml(){
	var campi = new Array()
	var stopScroll=0
	var This=this
	
	this.aggiungiCampi=function (nome){
		campi.push(nome)
	}
	
	this.avvia=function (){
		setInterval(Esecuzione,200)
		
	}

	function Esecuzione(){
		var v=0
		for (i=0;i<campi.length;i++){
			var c=document.getElementsByName(campi[i])
			for (j=0;j<campi.length;j++){
				if(stopScroll==0){
					document.documentElement.scrollTop=c[j].value
					if (document.documentElement.scrollHeight>0){stopScroll=1}
				}else{
					c[i].value=document.documentElement.scrollTop
				}
			}
		}
	}
}

