<!--
//(c) DATAGRAMMA SRL ALL RIGHTS RESERVED


	if (! navigator.cookieEnabled){
		location="error.asp?ERRCODE=NOCOOKIE"
	}
	

	var ah=screen.availHeight; 
	var aw=screen.availWidth;
	var reply;
	var strVer=navigator.userAgent;

	function sign_doc(file,store,path)
	{
		var strUrl = file;
		var strPath=path;
		var strStore=store;
		try
		{
			EnableButton_Inline();
			var obj = document.getElementById ("Class1");
			
			var resBool = obj.SignFile (strUrl,strStore,strPath);
			
			if (!resBool)
			{
				EnableButton_Inline();
				DisplayErrorMessage();
			}	
		}
		catch (e)
		{
			EnableButton_Inline();
			DisplayErrorMessage();
		}
	}
	
	function DisplayErrorMessage()
	{
		document.getElementById ("errore").style.visibility ="visible";
	}

	
	function EnableButton_Inline()
	{	
		try
		{
			document.getElementById ("loading").style.visibility ="hidden";
			if (document.frm_services.annulla.disabled)
			{
				
				document.frm_services.annulla.disabled=false;
				document.frm_services.download.disabled=false;
			}
		}
		catch(e)
		{
			self.setTimeout("EnableButton_Inline()",150);
		}
	}

	function conf_del_dich()
	{
		var strReply;
		var strPage;

		strReply=confirm('Cancellare dal sistema questa dichiarazione ?\n» OK per cancellare\n» Annulla per rimanere in questa pagina');

		if (strReply)
		{

			return true
		}
		else
		{
			return false
		}
	}

	
	function conf_del_dep()
	{
		var strReply;
		var strPage;

		strReply=confirm('Cancellare dal sistema il depuratore consortile legato a questa dichiarazione?\n» OK per cancellare\n» Annulla per rimanere in questa pagina\n\nLa dichiarazione non verra` cancellata.');
		
		if (strReply)
		{

			return true
		}
		else
		{
			return false
		}
	}
	
	function ask_archivio(page)
	{
		var reply;
		var strPage;
		strPage=page;
		reply=confirm('Nell\'archivio č gią presente la dichiarazione 2006 per questo complesso\nOK per visualizzarla\nAnnulla per rimanere in questa scheda');
		
		if (reply)
		{

			location=strPage;
		}

	}
	

	function ask_depCons(page)
	{
		var reply;
		var strPage;
		strPage=page;
		reply=confirm('Si desidera compilare le schede per il depuratore consortile ?\n»OK per compilare\n»Annulla per rimanere in questa scheda');
		
		if (reply)
		{

			location=strPage;
		}

	}

	function OutLine_Upload(item)
	{
		var strItem;
		strItem=item;


		

		if (strItem.length == 0)
		{
			alert('Invio non possibile\nSelezionare un file');
			return false
		}
		else
		{
			disableAllButtons();
			return true
		}


	}

	
	function disableReceivedButtons()
	{
	}
		

	function enableReceivedButtons()		
	{
		try
		{		
			if (document.upload)
			{
			//	document.upload.sign.disabled=false;
				document.upload.annulla.disabled=false;
				document.upload.download.disabled=false;		
			}	
		}
		catch (EXCobj)	
		{
			self.setTimeout("enableReceivedButtons()",200)
		}
	}
	
	
	function CheckData_Rec_Sign(urlGET,urlPOST,target)
	{
		var strGET;
		var strPOST;
		strGET=urlGET;
		strPOST=urlPOST;
		strTarget=target;
		// disabilita i bottoni
		DisableButton()
		
		// chiama l'applet
		document.applets[0].signFile(strGET,strPOST,strTarget);
		
		
		
	}
	
	function DisableButton_Inline()
	{
		try
		{
			if (!document.frm_services.annulla.disabled)
			{
				document.frm_services.download.disabled=true;
				document.frm_services.annulla.disabled=true;
			}
		}
		catch(e)	
		{
			self.setTimeout("DisableButton_Inline()",150);
		}
	}
	
	function DisableButton()
	{
	/*
		if (!document.upload.sign.disabled)
		{
			document.upload.sign.disabled=true;
		}
		
	*/	
		if (!document.upload.download.disabled)
		{
			document.upload.download.disabled=true;
		}
		
		if (!document.upload.annulla.disabled)
		{
			document.upload.annulla.disabled=true;
		}
	}
	
	
	function disableAllButtons()
	{
		
		if (! document.upload.SendData.disabled)
		{

			document.upload.SendData.disabled=true;
		}
		document.getElementById("display").style.visibility="hidden";
		document.getElementById("wait").style.visibility="visible";
		

		if (! document.frm_download.download.disabled)
		{
			document.frm_download.download.disabled=true;
			document.frm_services.annulla.disabled=true;
			document.frm_services.back.disabled=true;
		}

		
	}
	
	function DisableFormButtons(form)
	{
		if (!form.continua.disabled)
		{

			form.rifiuto.disabled=true;
			form.continua.disabled=true;



		}
		return true
	}
	
	
	function InitPage(strBase,maxelem,indexPage)
	{
		
		
	}
	
	function HideIt(layer)
	{
	/*	
		try
		{
			document.getElementById(layer).style.visibility="hidden";
		}
		catch(ExcObj)
		{}
	*/	
	}
	
	function ShowIt(layer)
	{
	/*	
		try
		{
			document.getElementById(layer).style.visibility="visible";
		}
		catch(ExcObj)
		{}
	*/	
						
	}
	
	
	
	
		
	function ScaricaDistinta (page)
	{
		var strPage=page;
		// disabilita i bottoni
		//DisableButton()	
		ApriHelp(strPage,'chiudi')
		// abilita i bottoni
		//EnableButtonInner()
	}

	function ChiudiFrame(page)
	{
		var reply;
		var strPage;
		strPage=page;
		reply=window.open(strPage,'chiudiframe','left=1,top=1,height=10,width=10,scrollbars=no,resizable=yes,status=no')
		reply.creator=top;
	}	
	
	function ApriHelp(file,tipo)
	{
		
		var strTipo=tipo;
		var strFile=file;
		var strNeWin;
		strFile=strFile+'&TIPO='+tipo
		strNeWin=window.open(strFile,'HELP_'+tipo,'left=1,top=1,width=10,height=10,scrollbars=no,resizable=yes,toolbar=no,status=no')
		strNeWin.Creator=self;
	}


		
	function nothing(){
	}

	
	function uscita (page){
		var risp=confirm("Si desidera uscire dall'Area Riservata ?\n» OK per uscire\n» Annulla per continuare la sessione corrente");
		var strPage;
		strPage=page;
		if(risp) 
		{
			top.document.location =strPage;
		}	
	}
	
	function uscita_first (page){
		var risp=confirm("Chi non avesse ancora modificato le credenziali dovra` farlo al prossimo accesso\n» OK per uscire\n» Annulla per continuare la sessione corrente");
		var strPage;
		strPage=page;
		if(risp) {
			document.location =strPage;
		}	
	}
	
	function Apri(str){
		var NeWin
		NeWin=open(str,'popUp','width=10,height=10,scrollbars=yes,toolbar=no,resizable=yes')
		NeWin.creator=self;
	}
	

	function CheckData(uid,pwd){
	return true
	}


	function apri(pagina,nome){
		var NewFin;
		NewFin=window.open(pagina,nome,'height=50,width=50,toolbar=no,scrollbars=yes,resizable=yes');
		NewFin.creator=self;
	}
	

	function check_details(page){
		var strPAGE, reply;
		strPAGE=page;
		reply=confirm('Con questa scelta lasciate la sezione di Anagrafica Generale\n» OK per proseguire\n» Annulla per rimanere in questa pagina');
		if (reply){
			location=strPAGE;
		}
	}
	
	function check_adv_search(index,page){
		var strINDEX,strPage,ID_Page;
		strINDEX=index.selectedIndex;
		strPage=page;
		if (strINDEX==0){
			alert ('selezionare almeno una provincia');
			index.focus();
		}else{
			ID_Page=window.open(strPage,'comuni','toolbars=no,scrollbars=yes,statusbar=no')
			ID_Page.creator=self;
		}
	}
	
	function not_available(item){
		var strItem;
		alert ('momentaneamente non disponibile');
		if (item.checked){
			item.ckecked=false;
		}else{
			item.ckecked=true;
		}
	}
	
	
	function begin_reg(page){
		var reply;
		var strPage;
		strPage=page;
		reply=confirm('Si e` scelto di iniziare la procedura di registrazione e di lasciare l`Area Pubblica\n» OK per iniziare la registrazione\n» Annulla per rimanere nell`Area Pubblica');
		if (reply){
			location=strPage;
		}
	}
	
	
	function check_ateco_search(index,page){
		var strINDEX,strPage,ID_Page;
		strINDEX=index.selectedIndex;
		strPage=page;
		if (strINDEX==0){
			alert ('selezionare almeno una provincia');
			index.focus();
		}else{
			ID_Page=window.open(strPage,'atteco','toolbars=no,scrollbars=yes,statusbar=no')
			ID_Page.creator=self;
		}
	}
	
	
	function loadurl(url){
		window.creator.location=url
		window.close()		
	}
	
	
	function loadurl_close(url)
	{
		top.creator.location=url;
		//window.creator.close();
		top.close();
	}

	
	function checkComuni(href){
		if (document.NewUserPData.provincia.selectedIndex==0){
			alert('selezionare una provincia');
			document.NewUserPData.provincia.focus();
		}else{
			apri(href,'comuni');
		}
	}
	

	function checkNose(href){
		if (document.NewUserPData.ID_IPPC.value==''){
			alert('selezionare Attivitą IPPC');
			document.NewUserPData.codici_IPPC.focus();
		}else{
			apri(href,'nose');
		}
	}
	

	
//-->


