<!-- 


	if(document.layers)
	{
		self.setTimeout("void(0);",50);
		
	}
	

// please keep these lines on when you copy the source
// made by: Nicolas - http://www.javascript-page.com

	var timerID = 0;
	var tStart  = null;

	function UpdateTimer() {
	   if(timerID) {
	      clearTimeout(timerID);
	      clockID  = 0;
	   }

	   if(!tStart)
	      tStart   = new Date();

	   var   tDate = new Date();
	   var   tDiff = tDate.getTime() - tStart.getTime();

	   tDate.setTime(tDiff);

	   document.getElementById('timer').innerHTML = "" 
	                                   + tDate.getMinutes() + ":" 
	                                   + tDate.getSeconds();
	   
	   timerID = setTimeout("UpdateTimer()", 1000);
	}

	function Start() {
	   tStart   = new Date();

	   //document.theTimer.theTime.value = "00:00";
	   document.getElementById('timer').innerHTML="00:00";

	   timerID  = setTimeout("UpdateTimer()", 1000);
	}

	function Stop() {
	   if(timerID) {
	      clearTimeout(timerID);
	      timerID  = 0;
	   }

	   tStart = null;
	}

	function Reset() {
	   tStart = null;

	   //document.theTimer.theTime.value = "00:00";
	   document.getElementById('timer').innerHTML="00:00";
	}


	
	function right(e) 
	{
		if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2))
			return false;
		else if (navigator.appName == 'Microsoft Internet Explorer' && 	(event.button == 2 || event.button == 3)) 
		{
			return false;
		}
		return true;
	}
	document.onmousedown=right;
	if (document.layers) 
		window.captureEvents(Event.MOUSEDOWN);
	window.onmousedown=right;

	
	function coordinates()
	{
		x=event.x;
		y=event.y;
		window.status("X=" + x + " Y=" + y);
	}


	
	
	function Display_Message(id,text)
	{
		document.getElementById(id).innerHTML=text;
	}

	function handlingWindowClosed()
	{
		newWindow=window.open('test','newWin','toolbar=no,resizable=yes, width=10,height=10');
		newWindow.document.write('<html><head><title>Chiusura Finestra<\/title><\/head><body><\/body><\/html>');
		newWindow.resizeBy(200,300);
		newWindow.document.write('Tutti i dati andranno persi.<br>E` necessario ripetere la procedura.');
	}


	function checkStartMainUpdate(doc,href,day,month,year)
	{
		var reply;
		var blcheckdate;
		try
		{
			blcheckdate=checkCalendar(day,month,year);
			if (blcheckdate)
			{
				reply=confirm('Confermare inizio aggiornamento ?\n» OK per procedere');
				if (reply)
				{
					
					apriPopUp(href,'popup_newlist');
					doc.disabled=true;
					popup_newlist.focus();
				}
				return reply
			}
			else
			{
				alert('Controllare la data !');
				return false;
			}	
		}
		catch(e)	
		{
			return false
		}
		
		
	}
	
	function checkCalendar(day,month,year)
	{
		try
		{
			var mesi30=new Array('11','4','6','9');
			var mesi31=new Array('1','3','5','7','8','10','12');
			var strDay=day;
			var strMonth=month;
			var strYear=year;
			var k;
			var blmese30;
			var blmese31;
			var bloutput;
			blmese30=false;
			blmese31=false;

			// controlla la presenza nei mesi 30
			for (k=0;k<4;k++)
				if (strMonth==mesi30[k])
				{
					blmese30=true;
				}
					
			if (!blmese30)
			{
			// controlla la presenza nei mesi 31
			for (k=0;k<7;k++)
				if (strMonth==mesi31[k])
				{
					blmese31=true;

				}
			}		
			bloutput=true;
			if (blmese30)
			{
				bloutput=true;
				if (strDay>30)
					bloutput=false;
			}
			else
			// allora febbraio, controllo bisestile
			{
				if (!blmese31)
				{
					var lngfinemese=28;
					bloutput=true;
					if ((strYear==2000) || ((strYear % 4==0) && (strYear % 400 != 0)))
					{
						if (strMonth==2)
							lngfinemese=29;
					}
					if (strDay > lngfinemese)
					{
						bloutput=false;

					}	
				}	
			}
			
						
			return bloutput
		}
		catch(E)	
		{
			alert('Errori : ' + E);
			return false;
		}
	}
	
	function DetectImageSize(picName,picTitle)
	{
	 try
	 {
		picURL=picName.src;

		newWindow=window.open(picURL,'newWin','toolbar=no,resizable=yes, width='+picName.width+',height='+picName.height);
		newWindow.document.write('<html><head><title>'+picTitle+'<\/title><\/head><body background="'+picURL+'" style="background-repeat:no-repeat;"><\/body><\/html>');
		newWindow.resizeBy(picName.width-newWindow.document.body.clientWidth,picName.height-newWindow.document.body.clientHeight);
		
		newWindow.focus();
	 }
	 catch(e)	
	 {
		alert ('Errori : '+ e);
	 }
   }  

	
	function EnlargeImageSize(picPath,picTitle)
	{
		var picName;
		var image;
		image=new Image();
		image.src=picPath;
	 try
	 {
		picURL=image.src;
		
		newWindow=window.open(picURL,'newWin','toolbar=no,resizable=yes, width='+image.width+',height='+image.height);
		newWindow.document.write('<html><head><title>'+picTitle+'<\/title><\/head><body background="'+picURL+'" style="background-repeat:no-repeat;"><\/body><\/html>');
		newWindow.resizeBy(image.width-newWindow.document.body.clientWidth,image.height-newWindow.document.body.clientHeight);
		
		newWindow.focus();
	 }
	 catch(e)	
	 {
		alert ('Errori : '+ e);
	 }
   }  


	function checkSection(index,div)
	{
		var strIndex=index;
		if (strIndex==0)
		{
			document.getElementById(div).innerHTML='<b>v</b> Selezionare Sezione.';
			document.frmSearch.btn_search.disabled=false;
			return false
		}
		else
		{
			document.frmSearch.btn_search.disabled=true;
			return true
		}
		
	}
	
	
	

	function checkRagsoc(ragsoc,div)
	{
		var strRagSoc=ragsoc;
		var blCheck=true;
		document.getElementById(div).innerHTML='';
		try
		{
			if (strRagSoc.length < 3)
			{
				document.getElementById(div).innerHTML='« Ragione Sociale o Codice Fiscale obbligatori.';
				blCheck=false;				
			}
		}
		catch(e)
		{
		document.getElementById(div).innerHTML='Errori : ' + e;
			blCheck=false;
		}
		
		if (blCheck)
		{
			document.getElementById(div).innerHTML='';
		}
			
		return blCheck
	}

	function showCatDescr(div,str)
	{
		try
		{
			document.getElementById(div).innerHTML=str;
			document.getElementById(div).style.border='1px solid black';
		}
		catch(e)
		{
		}
	}
	
	function hideCatDescr(div,str)
	{
		try
		{
			document.getElementById(div).innerHTML=str;
			document.getElementById(div).style.border='0px solid white';
		}
		catch(e)
		{
		}
	}

	function checkCATEGORIES(cat,div)
	{
		var strCAT=cat;
		var blCheck=true;
		var strEndDescr='';
		document.getElementById(div).innerHTML='';
		try
		{
			if (strCAT=='*')
			{
				document.getElementById(div).innerHTML='<b>v</b> Selezionare Categoria. ' + strEndDescr;
				blCheck=false;
			}	
			
					

		}
		catch(E)		
		{
			document.getElementById(div).innerHTML='Errori : ' + E;
			blCheck=false;
		}
		
		if (blCheck)
		{
			document.getElementById(div).innerHTML='';
		}
			
		return blCheck
	}

	function eraseInnerHTML(div)
	{
		try
		{
			document.getElementById(div).innerHTML='';
		}
		catch(e)
		{}
		
	}
	
	

	function checkCER(cer1,cer2,cer3,div)
	{
		var strCer1=cer1;
		var strCer2=cer2;
		var strCer3=cer3;
		var blCheck=true;
		var strEndDescr='<br>&nbsp;&nbsp;Inserire un codice rifiuto corretto.';
		document.getElementById(div).innerHTML='';
		try
		{
			if (strCer1.length < 2 || strCer2.length < 2 || strCer3.length < 2)
			{
				document.getElementById(div).innerHTML='« Codice Rifiuto obbligatorio...' + strEndDescr;
				blCheck=false;
			}	
			
			if (blCheck && (isNaN(strCer1) || isNaN(strCer2) || isNaN(strCer3)))
			{
				document.getElementById(div).innerHTML='« cifre del Codice Rifiuto non numeriche...' + strEndDescr;
				blCheck=false;					
			}
		

		}
		catch(E)		
		{
			document.getElementById(div).innerHTML='Errori : ' + E;
			blCheck=false;
		}
		
		if (blCheck)
		{
			document.getElementById(div).innerHTML='';
		}
			
		return blCheck
	}

	
	function apriPopUp(pagina,nome){
		var NewFin;
		try
		{
			NewFin=window.open(pagina,nome,'height=10,width=10,toolbar=no,scrollbars=yes,resizable=no');
			NewFin.creator=self;
		}
		catch(e)
		{
			popupBlocker()
		}
		
	}	
	
	function popupBlocker()
	{
		var strNext='pub_popup.asp';
		alert('Per visualizzare questa pagina e` necessario disabilitare il blocco popup del proprio browser');
		location='pub_popup.asp';
	}

	function Apri(str){
		var NeWin;
		try
		{
			NeWin=window.open(str,'popUp','width=10,height=10,left=2,top=2,fullscreen=no,scrollbars=yes,toolbar=no,resizable=yes');
			NeWin.creator=self;
		}
		catch(e)
		{
			popupBlocker();
		}
		
	}
	
	function apriFin(pagina,nome){
		var NeWin
		try
		{
			NeWin=open(pagina,nome,'width=200,height=200,scrollbars=yes,toolbar=no,resizable=yes')
			NeWin.creator=self;
		}
		
		catch(e)
		{
			popupBlocker();
		}
	}
	
	function apri(pagina,nome){
		var NewFin;
		try
		{
			NewFin=window.open(pagina,nome,'height=50,width=50,toolbar=no,scrollbars=yes,resizable=yes');
			NewFin.creator=self;
		}
		catch(e)
		{
			popupBlocker();
		}
		
	}	

	function checkComuni(href){
		if (document.UserData.provincia.selectedIndex==0){
			alert('selezionare una provincia');
			document.UserData.provincia.focus();
		}else{
			apri(href,'comuni');
		}
	}

	function uscita (page){
		var risp=confirm("Si desidera uscire dall'Area Ristretta ?\n» OK per uscire");
		var strPage;
		strPage=page;
		if(risp) {
			top.document.location =strPage;
		}	
	}	

	function check_exit(page)
	{
		var strPage=page;
		var reply;
		reply=confirm('Si desidera uscire dall`area ristretta ?\n» OK per uscire\n» Annulla per rimanere');
		if (reply) location=page;

	}

	function Apri_Stampa(str){
		var NeWin
		try
		{
			NeWin=open(str,'popUp','width=10,height=10,scrollbars=no,toolbar=no,resizable=no');
		}
		catch(e)
		{
			popupBlocker();
		}
		
	}	

	function reset_form(){
		var strForm;
		strForm=document.frmSearch;
		while (strForm.provincia.options.length > 1)
		{
			strForm.provincia.options[1]=null;
		}
		
		
	}


	function dis_array(str_dis){
		var arr_test=new Array();
		var str_vtr;
		try
		{
			main_vtr=str_dis.split(',');
			max_main_vtr=main_vtr.length-1;
		}
		catch(e)
		{}
	}
	
	
	function add_opt(index,str_vtr,sel)
	{
		var strtxt;
		var strval;
		var vtrTemp=new Array();
		var vtrTemp_sec=new Array();
		try
		{
			while (document.frmSearch.provincia.options.length > 1)
			{
				document.frmSearch.provincia.options[1]=null;
			}
			
			vtrTemp=main_vtr[index].split('@');
			document.frmSearch.provincia.options[0]=null;
			add_option_Prov('qualsiasi','00');
			for (var k=0;k < vtrTemp.length-1; k++)
			{
				vtrTemp_sec=vtrTemp[k].split('#');
				add_option_Prov(vtrTemp_sec[1],vtrTemp_sec[0]);
			}		
		}
		catch(e)
		{}
		

		
		return false
	}
	
	
	function add_option_Prov(txt,val){
	try
	{
		pos=document.frmSearch.provincia.length;
		var opt=new Option(txt,val);
		document.frmSearch.provincia.options[pos]=opt;	
	}
	catch(e)
	{}
	

	}
	
	

	function ApriSezione(str){
		var NeWin
		try
		{
			NeWin=open('contattiDettaglio.asp?ID='+str,'popUp','width=10,height=10,left=2,top=2,fullscreen=no,scrollbars=yes,toolbar=no,resizable=yes')
		}
		catch(e)
		{
			popupBlocker();
		}
	}

	function nothing()
	{}
	
	function apri_sub(str,nome){
		var NeWin_3,strPAGE,strNAME;
		try
		{
			strPAGE=str;
			strNAME=nome;
			NeWin_3=window.open (strPAGE,strNAME,'width=10,height=10,scrollbars=yes,left=2,top=2,toolbar=yes,resizable=yes');
			NeWin_3.creator=self;
		}
		catch(e)
		{
			popupBlocker();
		}
	}
	

function inizializza() {
	a = document.getElementsByTagName('A');
	try
	{
		for(i=0;a[i];i++) 
		{
			// INGLESE
			//norma_link_group
			if(a[i].className.indexOf('norma_link_group_eng') != -1) 
			{
				a[i].title += " [group of documents]";
			}
			
			//norma_link_single
			if(a[i].className.indexOf('norma_link_single_eng') != -1) 
			{
				a[i].title += " [single document]";
			}
			
			//norma_link_popup
			if(a[i].className.indexOf('norma_link_popup_eng') != -1) 
			{
				a[i].title += " [popup windows]";
			}
			
			//docs_link_pdf
			if(a[i].className.indexOf('docs_link_pdf_eng') != -1) 
			{
				a[i].title += " [to open the .pdf file - popup ]";
			}
			//docs_link_inner
			if(a[i].className.indexOf('docs_link_inner_eng') != -1) 
			{
				a[i].title += " [to open this document in a separate windows - popup ]";
			}
			// ITALIANO
			//norma_link_group
			if(a[i].className.indexOf('norma_link_group_ita') != -1) 
			{
				a[i].title += " [gruppo di documenti]";
			}
			
			//norma_link_single
			if(a[i].className.indexOf('norma_link_single_ita') != -1) 
			{
				a[i].title += " [documento singolo]";
			}
			
			//norma_link_popup
			if(a[i].className.indexOf('norma_link_popup_ita') != -1) 
			{
				a[i].title += " [finestra indipendente - popup]";
			}
			
			//docs_link_pdf
			if(a[i].className.indexOf('docs_link_pdf_ita') != -1) 
			{
				a[i].title += " [per aprire il documento in formato .pdf - pop up ]";
			}
			//docs_link_inner
			if(a[i].className.indexOf('docs_link_inner_ita') != -1) 
			{
				a[i].title += " [per aprire questo documento in una finestra indipendente - pop up ]";
			}
		}
	}
	catch(e)
	{}
	

}

function showItems()
{
	document.getElementById('please_wait').style.visibility='hidden';
	document.getElementById('detSpacer').style.visibility='hidden';
	
	document.getElementById('show_cer').style.visibility='visible';
	document.getElementById('show_tip').style.visibility='visible';
	document.getElementById('show_cat').style.visibility='visible';
	
}

//-- INGLESE

	function checkCER_eng(cer1,cer2,cer3,div)
	{
		var strCer1=cer1;
		var strCer2=cer2;
		var strCer3=cer3;
		var blCheck=true;
		var strEndDescr='<br>&nbsp;&nbsp;Please enter a correct waste code.';
		document.getElementById(div).innerHTML='';
		try
		{
			if (strCer1.length < 2 || strCer2.length < 2 || strCer3.length < 2)
			{
				document.getElementById(div).innerHTML='« waste code mandatory...' + strEndDescr;
				blCheck=false;
			}	
			
			if (blCheck && (isNaN(strCer1) || isNaN(strCer2) || isNaN(strCer3)))
			{
				document.getElementById(div).innerHTML='« only numbers for waste codes...' + strEndDescr;
				blCheck=false;					
			}
		

		}
		catch(E)		
		{
			document.getElementById(div).innerHTML='Errors : ' + E;
			blCheck=false;
		}
		
		if (blCheck)
		{
			document.getElementById(div).innerHTML='';
		}
			
		return blCheck
	}

function dis_array_eng(str_dis)
{
    var arr_test=new Array();
    var str_vtr;
    try
    {
        main_vtr=str_dis.split(',');
        max_main_vtr=main_vtr.length-1;
    }
    catch(e)
    {}
}
	
function add_opt_eng(index,str_vtr,sel)	
{
    var strtxt;
    var strval;
    var vtrTemp=new Array();
    var vtrTemp_sec=new Array();
    try
    {
	    while (document.frmSearch.provincia.options.length > 1)
	    {
		    document.frmSearch.provincia.options[1]=null;
	    }
    	
	    vtrTemp=main_vtr[index].split('@');
	    document.frmSearch.provincia.options[0]=null;
	    add_option_Prov('-- any --','00');
	    for (var k=0;k < vtrTemp.length-1; k++)
	    {
		    vtrTemp_sec=vtrTemp[k].split('#');
		    add_option_Prov(vtrTemp_sec[1],vtrTemp_sec[0]);
	    }		
    }
    catch(e)
    {}
    return false
}

function checkComuni_eng(href)
{
    if (document.UserData.provincia.selectedIndex==0)
    {
	    alert('choose one province');
	    document.UserData.provincia.focus();
    }
    else
    {
	    apri(href,'comuni');
    }
}
	
function checkSection_eng(index,div)
{
    var strIndex=index;
    if (strIndex==0)
    {
	    document.getElementById(div).innerHTML='<b>v</b> choose one department.';
	    document.frmSearch.btn_search.disabled=false;
	    return false
    }
    else
    {
	    document.frmSearch.btn_search.disabled=true;
	    return true
    }
}

function checkRagsoc_eng(ragsoc,div)
{
	var strRagSoc=ragsoc;
	var blCheck=true;
	document.getElementById(div).innerHTML='';
	try
	{
		if (strRagSoc.length < 3)
		{
			document.getElementById(div).innerHTML='« business name or tax code mandatory.';
			blCheck=false;				
		}
	}
	catch(e)
	{
	document.getElementById(div).innerHTML='Errors : ' + e;
		blCheck=false;
	}
	
	if (blCheck)
	{
		document.getElementById(div).innerHTML='';
	}
		
	return blCheck
}

function checkClasse_eng(classe,div)
	{
		
		var blCheck=true;
		var strEndDescr='';
		document.getElementById(div).innerHTML='';
		document.frmSearch.btn_search.disabled=false;
		
		try
		{
			if (!classe[0].checked && !classe[1].checked && !classe[2].checked)
			{
				document.getElementById(div).innerHTML='<b>v</b> choose one Recovery <b>v</b> ' + strEndDescr;
				blCheck=false;
			}
			else
			{
				blCheck=true;
			}	
		}
		catch(E)		
		{
			document.getElementById(div).innerHTML='Errors : ' + E;
			blCheck=false;
		}
		
		if (blCheck)
		{
			document.getElementById(div).innerHTML='';
		}
		return blCheck
	}
	
		
	function checkTipologia_eng(index,div)
	{
		var strIndex=index;
		document.frmSearch.btn_search.disabled=false;		

		if (strIndex==0)
		{
			document.getElementById(div).innerHTML='<b>«</b> Choose one Type.';
			return false
		}
		else
		{
			//document.frmSearch.btn_search.disabled=true;
			return true
		}
	}

function checkCATEGORIES_eng(cat,div)
	{
		var strCAT=cat;
		var blCheck=true;
		var strEndDescr='';

		document.getElementById(div).innerHTML='';
		try
		{
			if (strCAT=='*')
			{
				document.getElementById(div).innerHTML='<b>v</b> Choose one Category. ' + strEndDescr;
				blCheck=false;
			}	
			
					

		}
		catch(E)		
		{
			document.getElementById(div).innerHTML='Errors : ' + E;
			blCheck=false;
		}
		
		if (blCheck)
		{
			document.getElementById(div).innerHTML='';
		}
			
		return blCheck
	}

	
function Eng_ApriSezione(str)
{
	var NeWin
	try
	{
		NeWin=open('en_contattiDettaglio.asp?ID='+str,'popUp','width=10,height=10,left=2,top=2,fullscreen=no,scrollbars=yes,toolbar=no,resizable=yes')
	}
	catch(e)
	{
		popupBlocker();
	}
}

//-->
