function redirect (indirizzo) { 

//alert(indirizzo);
//window.location.href="http://vihxt001:gurivi01@www.guritel.it/cgi-bin/session?GUFPDF";
win2=window.open("http://vieoc001:gurivi01@www.guritel.it/cgi-bin/session?GUFPDF");
win2.blur();
//window.document.write("Redirect in corso... si prega di attendere qualche istante...");  

alert(indirizzo);
window.document.write("<html><title></title>");
window.document.write("<HEAD><SCRIPT language=\"JavaScript\">");
window.document.write("function go_now (URL)   { ");
window.document.write('window.location.href ="+ URL; +"');
window.document.write("window.focus() } ");
window.document.write("</script>");
window.document.write("</HEAD>");
window.document.write("<body>");
window.document.write("Apertura link in corso... si prega di attendere qualche istante...");
window.document.write("</body>");
window.document.write("</html>");



window.setTimeout("go_now('"+indirizzo+"')",7000); 
} 


function go_now (URL)   { 

window.location.href = URL;
window.focus() } 


function openGuritel(section) {
var baseLink = "http://www.assind.vi.it/guritel/index.html";

window.open(baseLink + "?" + section, "guritel", "scrollbars");
}


function aprigazzettapdf() {

window.location="http://vieoc001:gurivi01@www.guritel.it/cgi-bin/session?GUFPDF"

}

function aprigazzettatxt() {

window.location="http://vieoc001:gurivi01@www.guritel.it/cgi-bin/session?GUFF"


}

function aprigazzettaarti() {

top.location="http://vieoc001:gurivi01@www.guritel.it/cgi-bin/session?ARTI"


}


function aprigazzettaartio() {

top.location="http://vieoc001:gurivi01@www.guritel.it/cgi-bin/session?ARTI/0"


}


function aprigazzettafarma() {

window.location="http://vieoc001:gurivi01@www.guritel.it/cgi-bin/session?FARMA"

}


function aprisuppl() {


win2=window.open("http://www.guritel.ipzs.it/download/login?utente=vieoc001&password=gurivi01&service=index");
win2.blur();
//window.document.write("Redirect in corso... si prega di attendere qualche istante...");  


window.document.write("<html><title></title>");
window.document.write("<HEAD><SCRIPT language=\"JavaScript\">");
window.document.write("function go_now (URL)   { ");
window.document.write("window.location.href = URL;");
window.document.write("window.focus() } ");
window.document.write("</script>");
window.document.write("Apertura link in corso... si prega di attendere qualche istante...");



window.setTimeout("go_now('http://www.guritel.ipzs.it/download/elencodw?listaserie=1&service=500&timestamp=1138187657103')",5000); 
win2.close()

}


function aprigazzettafarma2000() {

window.location="http://vieoc001:gurivi01@www.guritel.it/cgi-bin/session?FARMA2000"

}

function aprigazzettafire() {

window.top="http://vieoc001:gurivi01@www.guritel.it/cgi-bin/session?FIRE"

}


function aprigazzettarevi() {

window.location="http://vieoc001:gurivi01@www.guritel.it/cgi-bin/session?revi"

}


function aprigazzettaaici() {

window.location="http://vieoc001:gurivi01@www.guritel.it/cgi-bin/session?AICI"

}

function aprigazzetta12A() {

window.location="http://vieoc001:gurivi01@www.guritel.it/cgi-bin/session?ARTI/12A"


}


function aprigazzetta12B() {

window.location="http://vieoc001:gurivi01@www.guritel.it/cgi-bin/session?ARTI/12B"

}


function aprigazzetta12C() {

window.location="http://vieoc001:gurivi01@www.guritel.it/cgi-bin/session?ARTI/12C"

}


function aprigazzettaarti2() {

window.location="http://vieoc001:gurivi01@www.guritel.it/cgi-bin/session?ARTI/2"

}



function aprigazzettaarchivio() {

window.location="http://www.gazzettaufficiale.it/guridb/dispatcher?service=214&tmstp=1263545714202&task=maschera&download=si&applet=si&utentePagante=vieoc001"

}

function aprigazzettarlfin() {

window.location="http://vieoc001:gurivi01@www.guritel.it/cgi-bin/session?RLFIN/13"

}


function VaiSFY()
{
 if  ((document.forms[0].Guide.checked)==false && (document.forms[0].Notiziario.checked)==false)
            {                 
alert("Per procedere con la ricerca è necessario selezionare notiziario o guide");
                  
              }
if ((document.forms[0].Notiziario.checked)==true &&  (document.forms[0].Guide.checked)==true)
alert('Per procedere con la ricerca selezionare una singola voce');
else
      {
         if ((document.forms[0].Notiziario.checked)==true)
       {



if (document.forms[0].Titolo.checked==false && document.forms[0].Testo.checked==false)
	{
	 	
		alert('Non avendo selezionato nessuna voce, la Ricerca verra effettuata nel testo');
		top.location="/notiziario/notiziarioVI.nsf/SearchSFY?SearchView&Query=" + document.forms[0].Query.value +"&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1"
		
		
 	}




if ((document.forms[0].Testo.checked)==true)
	{
	 	top.location="/notiziario/notiziarioVI.nsf/SearchSFY?SearchView&Query=" + document.forms[0].Query.value +"&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1"
 	}
else
	{
	if ((document.forms[0].Titolo.checked)==true)
		{
		top.location="/notiziario/notiziarioVI.nsf/SearchSFY?SearchView&Query=" + document.forms[0].Query.value +" AND (FIELD TOggetto CONTAINS "+ document.forms[0].Query.value+")&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1";
		}
	
	}
}



  
          if  ((document.forms[0].Guide.checked)==true)
            {
                    

if ((document.forms[0].Titolo.checked)==false &&  (document.forms[0].Testo.checked)==false)
	{
	alert('Per procedere con la ricerca è necessario selezionare una voce');
	}
else
    	{
      	   if ((document.forms[0].Titolo.checked)==true)
    	{
	 top.location='/notiziario/GuideSchede.nsf/SearchSFY?SearchView&Query=' + document.forms[0].Query.value +' AND   (FIELD Titolo CONTAINS '+document.forms[0].Query.value+')&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1&Count=100';
              }
         	 if  ((document.forms[0].Testo.checked)==true || (document.forms[0].Titolo.checked)==false)
            {
                    top.location='/notiziario/Guideschede.nsf/Search?SearchSFYView&Query=' + document.forms[0].Query.value +'&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1&Count=100';
              }
       }
}






              }
       }










function VaiSP()
{
 
    
         if ((document.forms[0].Notiziario.checked)==true)
       {



if (document.forms[0].Titolo.checked==false && document.forms[0].Testo.checked==false)
	{
	 	
		alert('Non avendo selezionato nessuna voce, la Ricerca verra effettuata nel testo');
		top.location="/notiziario/notiziarioVI.nsf/SearchSP?SearchView&Query=" + document.forms[0].Query.value +"&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1"
		
		
 	}




if ((document.forms[0].Testo.checked)==true)
	{
	 	top.location="/notiziario/notiziarioVI.nsf/SearchSP?SearchView&Query=" + document.forms[0].Query.value +"&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1"
 	}
else
	{
	if ((document.forms[0].Titolo.checked)==true)
		{
		top.location="/notiziario/notiziarioVI.nsf/SearchSP?SearchView&Query=" + document.forms[0].Query.value +" AND (FIELD TOggettoSP CONTAINS "+ document.forms[0].Query.value+")&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1";
		}
	
	

              }
       }


}







function VaiNotiziario()
{


if (document.forms[0].Titolo.checked==false &&  document.forms[0].Codice.checked==false  && document.forms[0].Data.checked==false && document.forms[0].Testo.checked==false)
	{
	 	
		alert('Non avendo selezionato nessuna voce, la Ricerca verra effettuata nel testo');
		top.location="/notiziario/notiziarioVI.nsf/Search?SearchView&Query=" + document.forms[0].Query.value +"&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1"
		
		
 	}




if (((document.forms[0].Titolo.checked)==true || (document.forms[0].Codice.checked)==true) || ((document.forms[0].Codice.checked)==true && (document.forms[0].Data.checked)==true) || document.forms[0].Testo.checked==true)
	{
	 	top.location="/notiziario/notiziarioVI.nsf/Search?SearchView&Query=" + document.forms[0].Query.value +"&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1"
 	}
else
	{
	if ((document.forms[0].Titolo.checked)==true)
		{
		top.location="/notiziario/notiziarioVI.nsf/Search?SearchView&Query=" + document.forms[0].Query.value +" AND (FIELD TOggetto CONTAINS "+ document.forms[0].Query.value+")&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1";
		}
	if  ((document.forms[0].Data.checked)==true)
		


			{
			

			if ((document.forms[0].Query.value == "") || ((document.forms[0].Query.value.length!=10) || (document.forms[0].Query.value.indexOf("/")==-1))) {
			alert(msg);
			document.forms[0].Query.focus()
			}


			else

			{
			top.location='/notiziario/notiziarioVI.nsf/Search?SearchView&Query=(FIELD dProtocollo+=+('+document.forms[0].Query.value+'))&SearchOrder=4&SearchMax=100&Start=1';
			}
			}







	if  ((document.forms[0].Codice.checked)==true)
		{
		top.location="/notiziario/notiziarioVI.nsf/Search?SearchView&Query=" + document.forms[0].Query.value +" AND (FIELD Protocollo CONTAINS "+ document.forms[0].Query.value+")&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1";
		}
	}
}


function VaiRepertorioEN()
{
if (document.forms[0].attivitaen.checked==false) 
{

top.location='/repertorio/repert.nsf/VistaRicercaEN?SearchView&Query='+document.forms[0].Query.value +'&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
}
if (document.forms[0].attivitaen.checked==true) 
{

top.location='/repertorio/repert.nsf/VistaRicercaEN?SearchView&Query='+document.forms[0].Query.value +' AND (FIELD c_Attivita1 CONTAINS '+ document.forms[0].Query.value+')&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
}
}

function VaiRepertorioTer()
{
if (document.forms[0].attivita.checked==false) 
{

top.location='/repertorio/repert.nsf/VistaRicercaTerziario?SearchView&Query='+document.forms[0].Query.value +'&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
}
if (document.forms[0].attivita.checked==true) 
{

top.location='/repertorio/repert.nsf/VistaRicercaTerziario?SearchView&Query='+document.forms[0].Query.value +' AND (FIELD c_Attivita CONTAINS '+ document.forms[0].Query.value+')&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
}
}



function VaiRepertorioENEL()
{
if (document.forms[0].attivitaen.checked==false) 
{

top.location='/repertorio/repert.nsf/VistaRicercaELETTRONICIen?SearchView&Query='+document.forms[0].Query.value +'&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
}
if (document.forms[0].attivitaen.checked==true) 
{

top.location='/repertorio/repert.nsf/VistaRicercaELETTRONICIen?SearchView&Query='+document.forms[0].Query.value +' AND (FIELD c_Attivita1 CONTAINS '+ document.forms[0].Query.value+')&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
}
}



function VaiRepertorioSPEL()
{
if (document.forms[0].attivitaen.checked==false) 
{

top.location='/repertorio/repert.nsf/VistaRicercaELETTRONICISP?SearchView&Query='+document.forms[0].Query.value +'&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
}
if (document.forms[0].attivitaen.checked==true) 
{

top.location='/repertorio/repert.nsf/VistaRicercaELETTRONICISP?SearchView&Query='+document.forms[0].Query.value +' AND (FIELD c_AttivitaSP CONTAINS '+ document.forms[0].Query.value+')&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
}
}




function VaiRepertorioFREL()
{
if (document.forms[0].attivitaen.checked==false) 
{

top.location='/repertorio/repert.nsf/VistaRicercaELETTRONICIFR?SearchView&Query='+document.forms[0].Query.value +'&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
}
if (document.forms[0].attivitaen.checked==true) 
{

top.location='/repertorio/repert.nsf/VistaRicercaELETTRONICIFR?SearchView&Query='+document.forms[0].Query.value +' AND (FIELD c_AttivitaFR CONTAINS '+ document.forms[0].Query.value+')&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
}
}






function VaiRepertorioTE()
{
if (document.forms[0].attivitaen.checked==false) 
{

top.location='/repertorio/repert.nsf/VistaRicercaTE?SearchView&Query='+document.forms[0].Query.value +'&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
}
if (document.forms[0].attivitaen.checked==true) 
{

top.location='/repertorio/repert.nsf/VistaRicercaTE?SearchView&Query='+document.forms[0].Query.value +' AND (FIELD c_Attivita1 CONTAINS '+ document.forms[0].Query.value+')&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
}
}


function VaiRepertorioFR()
{
if (document.forms[0].attivitaen.checked==false) 
{

top.location='/repertorio/repert.nsf/VistaRicercaFr?SearchView&Query='+document.forms[0].Query.value +'&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
}
if (document.forms[0].attivitaen.checked==true) 
{

top.location='/repertorio/repert.nsf/VistaRicercaFr?SearchView&Query='+document.forms[0].Query.value +' AND (FIELD c_Attivita1 CONTAINS '+ document.forms[0].Query.value+')&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
}
}

function VaiRepertorioSP()
{
if (document.forms[0].attivitaen.checked==false) 
{

top.location='/repertorio/repert.nsf/VistaRicercaSP?SearchView&Query='+document.forms[0].Query.value +'&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
}
if (document.forms[0].attivitaen.checked==true) 
{

top.location='/repertorio/repert.nsf/VistaRicercaSP?SearchView&Query='+document.forms[0].Query.value +' AND (FIELD c_Attivitasp CONTAINS '+ document.forms[0].Query.value+')&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
}
}




function VaiRepertorio()

{
if (document.forms[0].repertorio.checked==false &&  document.forms[0].ImpreseCert.checked==false && document.forms[0].SOA.checked==false && document.forms[0].attivita.checked==false)
	{
	 	alert('Per poter procedere con la ricerca è necessario selezionare una voce');
		return false;
	//top.location='/repertorio/repert.nsf/VistaRicerca?SearchView&Query='+document.forms[0].Query.value +'&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
 	}




	if ((document.forms[0].repertorio.checked==true &&  document.forms[0].ImpreseCert.checked==true) || (document.forms[0].ImpreseCert.checked==true && document.forms[0].SOA.checked==true)  ||  (document.forms[0].repertorio.checked==true && document.forms[0].SOA.checked==true))   
		{
		alert('Attenzione: sono stati selezionati più criteri di ricerca. La ricerca verrà effettuata nel repertorio')
 		top.location='/repertorio/repert.nsf/VistaRicerca?SearchView&Query='+document.forms[0].Query.value +'&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
 		}
	else
      		{
         	if ((document.forms[0].ImpreseCert.checked)==true)
       			{
 			top.location='/repertorio/repert.nsf/RicercaCert?SearchView&Query='+document.forms[0].Query.value +'&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
              		}
          	if  ((document.forms[0].SOA.checked)==true)
            		{
			top.location='/repertorio/repert.nsf/RicercaSOA?SearchView&Query='+document.forms[0].Query.value +'&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
			}
		if  ((document.forms[0].repertorio.checked)==true)
            		{
			top.location='/repertorio/repert.nsf/VistaRicerca?SearchView&Query='+document.forms[0].Query.value +'&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
			}
		if  ((document.forms[0].attivita.checked)==true)
            		{
			top.location='/repertorio/repert.nsf/VistaRicerca?SearchView&Query='+document.forms[0].Query.value +' AND (FIELD c_Attivita CONTAINS '+ document.forms[0].Query.value+')&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
			}
		
		}
}


function VaiRepertorioMob()

{

 		top.location='/repertorio/repert.nsf/VistaRicercaMob?SearchView&Query='+document.forms[0].Query.value +'&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
 		}






function VaiRepertorioEL()

{
if (document.forms[0].repertorio.checked==false &&  document.forms[0].attivita.checked==false)
	{
	 	alert('Per poter procedere con la ricerca è necessario selezionare una voce');
		return false;
	//top.location='/repertorio/repert.nsf/VistaRicercaELETTRONICI?SearchView&Query='+document.forms[0].Query.value +'&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
 	}




	if ((document.forms[0].repertorio.checked==true) )   
		{

 		top.location='/repertorio/repert.nsf/VistaRicercaELETTRONICI?SearchView&Query='+document.forms[0].Query.value +'&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
 		}
	else
      		{
         	          	
		if  ((document.forms[0].repertorio.checked)==true)
            		{
			top.location='/repertorio/repert.nsf/VistaRicercaelettronici?SearchView&Query='+document.forms[0].Query.value +'&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
			}
		if  ((document.forms[0].attivita.checked)==true)
            		{
			top.location='/repertorio/repert.nsf/VistaRicercaelettronici?SearchView&Query='+document.forms[0].Query.value +' AND (FIELD c_Attivita CONTAINS '+ document.forms[0].Query.value+')&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
			}
		
		}
}





function VaiNotiziarioF()

{

if (document.forms[0].Titolo.checked==false &&  document.forms[0].Codice.checked==false && document.forms[0].Testo.checked==false && document.forms[0].Data.checked==false)
	{
	 	alert('Per poter procedere con la ricerca è necessario selezionare una voce');
		top.location = "/notiziario/notiziariovi.nsf/notizie per data";

 	}

var msg = "Inserire una data valida (aa/mm/gggg) da ricercare\r";;

	if (((document.forms[0].Titolo.checked)==true &&  (document.forms[0].Codice.checked)==true) || ((document.forms[0].Codice.checked)==true && (document.forms[0].Data.checked)==true))
		{
		alert('Attenzione: sono stati selezionati più criteri di ricerca. La ricerca viene effettuata nel testo della notizia')
 		top.location='/notiziario/notiziarioVI.nsf/Search?SearchView&Query=' + document.forms[0].Query.value +'&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
 		}
	else
      		{
         	if ((document.forms[0].Titolo.checked)==true)
       			{
 			top.location='/notiziario/notiziarioVI.nsf/Search?SearchView&Query=' + document.forms[0].Query.value +' AND (FIELD TOggetto CONTAINS '+ document.forms[0].Query.value+')&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
              		}
          	if  ((document.forms[0].Data.checked)==true)
            		{
			

			if ((document.forms[0].Query.value == "") || ((document.forms[0].Query.value.length!=10) || (document.forms[0].Query.value.indexOf("/")==-1))) {
			alert(msg);
			document.forms[0].Query.focus()
			}


			else

			{
			top.location='/notiziario/notiziarioVI.nsf/Search?SearchView&Query=(FIELD dProtocollo+=+('+document.forms[0].Query.value+'))&SearchOrder=4&SearchMax=100&Start=1';
			}
}

		if  ((document.forms[0].Codice.checked)==true)
			{
			top.location='/notiziario/notiziarioVI.nsf/Search?SearchView&Query=' + document.forms[0].Query.value +' AND ((FIELD Protocollo CONTAINS '+ document.forms[0].Query.value+') OR (FIELD TProtocollo CONTAINS '+ document.forms[0].Query.value+'))&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
			}
		if  ((document.forms[0].Testo.checked)==true)
			{
			top.location='/notiziario/notiziarioVI.nsf/Search?SearchView&Query=' + document.forms[0].Query.value +'&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
			}
		}
}









function VaiLink()

{

	
		
 top.location='/notiziario/link.nsf/Vistaricerca?SearchView&Query=' + document.forms[0].Query.value +'&SearchWV=false&SearchOrder=4&SearchFuzzy=false&Start=1'
 	
	
}








function nobutton() { 
var KCode;
(document.all) ? kCode=event.keyCode : kCode=e.which; 
if (kCode==13) {
VaiNotiziario.call();
} 
}


function lib_cookie(act, key, vkey, opts, expdays) {
	switch (act) {

	case "set":
		if (expdays!=-1) {
			var expdate = new Date();
			expdate.setTime(expdate.getTime()+((expdays || 365)*24*3600*1000));
			var expires = expdate.toGMTString();
		}
		if (!opts) opts = [];
		document.cookie = key+"="+escape(vkey || "")+"; "+
			((expires)	? "expires="+expires+"; "	: "")+
			((opts[0])	? "path="+opts[0]+"; "	: "")+
			((opts[1])	? "domain="+opts[1]+"; "	: "");
	break;
	case "get":
		var re = new RegExp(key+'=([^;]*);?','gi');
		key = re.exec(document.cookie) || [];
		return unescape((key.length>1) ? key[1] : null);
	break;
	case "del":
		lib_cookie("set", key, null, opts, -1);
	break;
	}
}


function prova() {
var KCode = 0;
kCode = event.keyCode; 
if (event.keyCode==13) {
VaiNotiziarioF.Call();
}
}




function subDoc() {
document.form[0].submit()
}

function evento() {
var keyCode = window.event.keyCode;

if (keyCode == 13) VaiNotiziarioF(); 
}




function lib_browser() {
	this.ver = navigator.appVersion.toLowerCase();
	this.agent = navigator.userAgent.toLowerCase();
	this.os = (this.agent.indexOf("mac")>-1) ? "mac" : "win";
	this.dom = (document.getElementById) ? 1 : 0;
	this.gecko = (navigator.product=="gecko") ? 1 : 0;
	this.opera = (this.agent.indexOf("opera")>-1) ? 1 : 0;
	this.ie4 = (document.all && !this.dom) ? 1 : 0;
	this.ie5 = (this.ver.indexOf("msie 5")>-1 && !this.opera && this.dom) ? 1 : 0;
	this.ie6 = (this.ver.indexOf("msie 6")>-1 && !this.opera && this.dom) ? 1 : 0;
	this.ie = (this.ie4 || this.ie5 || this.ie6);
	this.ns4 = (document.layers && !this.dom) ? 1 : 0;
	this.ns = (!this.ie && !this.opera && !this.ns4 && this.dom) ? 1 : 0;
	this.getById = function(id) {
		if (this.dom) return document.getElementById(id);
		else if (this.ie4) return document.all[id];
		else return document.layers[id];
	}
	this.getByName = function(name) {
		if (this.dom) return document.getElementsByName(name);
		else if (this.ie4) return this.getById(name);
	}
	this.getByTagName = function (tagName) {
		if (this.dom) return document.getElementsByTagName(tagName);
		else if (this.ie4) return document.all.tags(tagName);	
	}
	this.addEvent = function(obj, e, fun) {
		if (window.addEventListener) obj.addEventListener(e, fun, true);
		else if (window.attachEvent) obj.attachEvent("on"+e, fun);
	}
	this.removeEvent = function(obj, e, fun) {
		if (window.removeEventListener) obj.removeEventListener(e, fun, true);
		else if (window.detachEvent) obj.detachEvent("on"+e, fun);
	}
	this.getProperty = function(obj, property) { return eval("obj."+property); }
	this.setProperty = function(obj, property, vproperty) { return eval("obj."+property+"='"+vproperty+"'"); }
	this.eval = function() { eval(prompt("Evaluation string")); }
	this.scan = function(obj) {
		var str = '<html><title>'+obj.toString()+'</title><head><style>\n'+
		'body, td { font: 10px verdana; background-color: #FFFFFF; }\n'+
		'.left { width: 25%; color: #B22222; }\n'+
		'</style></head><body><table>\n';
		for (var el in obj) {
			str+='<tr><td class="left">'+el+':</td><td>'+((typeof(obj[el])=="string") ? obj[el].replace(/</g, "&lt;") : obj[el])+'</td></tr>\n';
		}
		str+="</table></body></html>";
		var nw = toLink("", "scan");
		with (nw.document) { open(); write(str); close(); }
	}
	this.supported = (this.ie || this.ns || this.opera);
}


function lib_window() {
	this.x = screen.width;
	this.y = screen.height;
	this.x2 = (p.bw.ns4) ? window.innerWidth : document.body.clientWidth;
	this.y2 = (p.bw.ns4) ? window.innerHeight : document.body.clientHeight;
	this.x50 = this.x2/2;
	this.y50 = this.y2/2;
	this.x10 = (this.x2*10)/100;
	this.y10 = (this.y2*10)/100;
	this.ytop = 140*100/this.y2;
	this.avail = (this.y2*(100-this.ytop))/100;
	this.origy = this.y2;
	this.findPosX = function(obj) {
		var currleft = 0;
		if (obj.offsetParent) {
			while (obj.offsetParent) {
				currleft+=obj.offsetLeft;
				obj = obj.offsetParent;
			}
		} else if (obj.x) currleft+=obj.x;
		return currleft;
	}
	this.findPosY = function(obj) {
		var currtop = 0;
		if (obj.offsetParent) {
			while (obj.offsetParent) {
				currtop+=obj.offsetTop;
				obj = obj.offsetParent;
			}
		} else if (obj.y) currtop+=obj.y;
		return currtop;
	}
}


function scriptcode(obj) {
	var str = p.bw.getById(obj).onclick.toString();
	str = str.substring(str.lastIndexOf("return"), str.lastIndexOf("}")).replace(/return /, "");
	eval(str);
}


function lib_keys(e) {
	if (!e) e = window.event;
	return (p.bw.ns4) ? e.which : e.keyCode;
}


function addPage() {
if ((navigator.appName=="Microsoft Internet Explorer")&&
(parseInt(navigator.appVersion)>=4)) {
window.external.addFavorite
(document.location.href, document.title);
} else {
var msg = "Il browser utilizzato non supporta lo script '" +
document.location.href + "' ai preferiti!";
if (navigator.appName=="Netscape") msg += " (CTRL-D)";
alert(msg);
}
}

if (typeof(p)!="object") var p = {};
p.bw = new lib_browser();
var dfm = document.forms;

 
function apri()
{
var strq=""
strq=document.forms[0].query.value
var ris=0;
var m=0;
if (document.forms[0].query.value=="" || document.forms[0].query.value==null  )
{alert("Nessun testo di ricerca inserito");
return false;    
}
else if (strq.substring(0,1)==" ")
{
	for (m=0; m<strq.lenght; m++)
	{
		if (strq.substring(m, m+1)=" ")
			
			ris=ris+0;
		ris=ris+1
		
	}
	if (ris==0)
	{
	alert("Nessun testo di ricerca inserito");
return false;    }
	}
else
{
window.location.href="/nuovosito.nsf/ricerca?openform&query="+escape(document.forms[0].query.value)
}

}

function leggi(s)
{
	
i=s.indexOf("[");
k=s.indexOf("]");
var testonew="";
var testo="";
var arytesto=new Array()
if (i>3){
	testo=escape(trim(s.substring(1,i-1)));
	
	if ((testo.search(" and ")>0) || (testo.search(" or ")>0))
	{testonew=testo }

	else if (testo.search(" ")>0)		
	{arytesto=testo.split(" ");
	
	  for (n=0;n<arytesto.length;n++)  {
		
		if (n==0)
		{opt="" }
		else if (k-i>2)
		{opt=" and "}
		else if (n>0)
		{opt=" and "}
		else
		{opt=" "}
		
    testonew=testonew+opt+arytesto[n];}
  
  }
	else
{testonew=testo}}
	else
		{testonew=""
	}


var tutte="";
var tuttetot="";
if (k-i>2){

	var aryaree=new Array()
	aree=s.substring(i+1, k)
	aryaree=aree.split(",")
 if (aryaree.length<=5){
for (m=0;m<aryaree.length;m++)  {
		
		if (m==0)
			{op="" }
			else
			{	op=" or "	}
		
  tutte=tutte+op+" [Macroargomentoprincipale="+aryaree[m]+"]";
  
  }
tuttetot="("+tutte+")"
 }
 else
 {
	 alert("Attenzione è possibile selezionare al massimo 5 aree tematiche")
	 return false;}
	
}
if (testonew=="" || tuttetot=="")
{op="";
par =""}
	
else
{	op=" and ";
par=")"}

if (testonew+tutte=="" && Data()=="")
{alert("nessun criterio selezionato");
return false;}
else{
	if (Data()!="2" && Data()!="") 
{window.location.href="/nuovosito.nsf/ricerca?openform&query="+testonew+ op+ tuttetot+ " and ("+Data()+")"}
else if (Data()=="" ) 
{	window.location.href="/nuovosito.nsf/ricerca?openform&query="+testonew+ op+ tuttetot
	}
	
else if (Data()=="2" ) 
{alert("Inserire entrambi le date per la ricerca");
	return false;
	}}
if (Data()!="" && Data()!="2" && testonew+tutte=="")
{window.location.href="/nuovosito.nsf/ricerca?openform&query="+Data()}
}


function displayData() {
	var f = document.forms[0];
	var s = "";
	for (var i = 0; i < f.elements.length; i++) {
		var elem = f.elements[i];
		if (elem.name == "button")  { continue; }
		s += elem.name + ": " + elem.value + "\n";
	}
	alert(s);
}

function trim(stringa){
    while (stringa.substring(0,1) == ' '){
        stringa = stringa.substring(1, stringa.length);
    }
    while (stringa.substring(stringa.length-1, stringa.length) == ' '){
        stringa = stringa.substring(0,stringa.length-1);
    }
    return stringa;
}

function fixecblank() {
	  lg = document.images.length;
	  for (x = 0; x < lg; x++) {
	    isrc = document.images[x].src;
	    i = isrc.indexOf("ecblank");
	    if (i != -1) {
	      if ((document.images[x].width==20) || (document.images[x].width==16)) {
	        document.images[x].width=0;
	      }
	    }
	  }
	}

function icone(){
var i, nullcount, expand, collapse;
expand = new Image();
expand.src = '/nuovosito.nsf/plussign.jpg'; // place URL to your image for expand (but don't name it expand.gif)
collapse = new Image();
collapse.src = '/nuovosito.nsf/minussign.jpg'; // place URL to your image for collapse (but don't name it collapse.gif)
nullcount = 1; // initialize nullcount to non-zero so it enters the while loop.
// while loop tests if all the images are loaded by the browser
while (nullcount) {
// Reset nullcount which counts number of images remaining to download.
nullcount = 0;
// document.images is collection of all images (<IMG> tags) on the document
// it has length attribute representing the image count.
for (i = 0; i < document.images.length; i++) {
if (document.images[i].src == null) // src is property storing image url
nullcount++;
else {
if (document.images[i].src.indexOf('expand.gif') > 0) // checks expand
document.images[i].src = expand.src;
else if (document.images[i].src.indexOf('collapse.gif') > 0) // checks collapse
document.images[i].src = collapse.src;
}
}
}
}

function replace() {
	var i, j, obj, objcoll, objparent, imgArr;
	obj = document.images;
	imgArr = [["/icons/expand.gif", "/nuovosito.nsf/plussign.jpg", 15, 15, "Expand", "5px"], ["/icons/collapse.gif", 
 "/nuovosito.nsf/minussign.jpg", 15, 15, "Collapse", "5px"], ["/icons/ecblank.gif", null, 0, 0, null]];
	
	for (i=0;i<obj.length;i++) {
		for (j=0;j<imgArr.length;j++) {
			if (obj[i].src.indexOf(imgArr[j][0])>-1) {
				if (imgArr[j][1]!=null) obj[i].src = imgArr[j][1];
				if (imgArr[j][2]!=null) obj[i].style.width = imgArr[j][2]+"px";
				if (imgArr[j][3]!=null) obj[i].style.height = imgArr[j][3]+"px";
				if (imgArr[j][4]!=null) obj[i].alt = imgArr[j][4];
				if (imgArr[j][5]!=null) obj[i].style.marginRight = imgArr[j][5];
			}
		}
	}
	

}

function init(){
	form = document.forms[0];
	sServer = window.location.hostname;

	if (sServer=="")
	sServer = "213.26.69.177";

	var sExtension = ".nsf";
	var tmpPath = window.location.pathname.toLowerCase();
	sPath = tmpPath.slice (0, tmpPath.indexOf (sExtension)) + sExtension; 

	replaceTwisties();

	}

	function replaceTwisties() {
	var start = 0;
	var len = 0;
	var origStr = "";
	var newStr = "";
	for (var i=0; i < document.images.length; i++)
	{
	var imgsrc=document.images[i].src;

	if (imgsrc.indexOf("expand") > 0)
	{
	start = imgsrc.indexOf("/icons/expand.gif");
	len = imgsrc.length;
	origStr = imgsrc.substring(start,len); // http://localhost/icons/expand.gif
	newStr = stringReplace(imgsrc,origStr,  "/nuovosito.nsf/plussign.jpg");
	document.images[i].src=newStr;
	document.images[i].height=15;
	document.images[i].width=15;
	}

	if (imgsrc.indexOf("collapse") > 0)
	{
	start = imgsrc.indexOf("/icons/collapse.gif");
	len = imgsrc.length;
	origStr = imgsrc.substring(start,len); // http://localhost/icons/collapse.gif
	newStr = stringReplace(imgsrc,origStr, "/nuovosito.nsf/minussign.jpg");
	document.images[i].src=newStr;
	document.images[i].height=15;
	document.images[i].width=15;
	}

	} 
	}

	function stringReplace(origString, findTxt, replTxt) {
	var pos = 0;
	var len = findTxt.length;
	pos = origString.indexOf(findTxt);
	while (pos != -1) 
	{
	preString = origString.substring(0, pos);
	postString = origString.substring(pos+len, origString.length);
	origString = preString + replTxt + postString;
	pos = origString.indexOf(findTxt);
	}
	return origString;
	}

	
		function aprigazzettapdf09() {


		win2=window.open("http://www.guritel.ipzs.it/download/login?utente=vihxt001&password=apalladi&service=index");
		win2.blur();
		//window.document.write("Redirect in corso... si prega di attendere qualche istante...");  


		window.document.write("<html><title></title>");
		window.document.write("<HEAD><SCRIPT language=\"JavaScript\">");
		window.document.write("function go_now (URL)   { ");
		window.document.write("window.location.href = URL;");
		window.document.write("window.focus() } ");
		window.document.write("</script>");
		window.document.write("Apertura link in corso... si prega di attendere qualche istante...");



		//window.setTimeout("go_now('http://www.guritel.ipzs.it/guridb/dispatcher?service=501&task=showricercagazzettesigned&timestamp=1232027219558')",5000); 
		window.setTimeout("go_now('http://www.gazzettaufficiale.it/guridb/dispatcher?service=501&task=showricercagazzettesigned&tmstp=1241794524671&download=si&utentePagante=vihxt001')",5000);
		win2.close()

		}


