function redirect (indirizzo) { 

//alert(indirizzo);
//window.location.href="http://vihxt001:apalladio@www.guritel.it/cgi-bin/session?GUFPDF";
win2=window.open("http://vihxt001:apalladio@www.guritel.it/cgi-bin/session?GUFPDF");
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('"+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://vihxt001:apalladio@www.guritel.it/cgi-bin/session?GUFPDF"

}

function aprigazzettatxt() {

window.location="http://vihxt001:apalladio@www.guritel.it/cgi-bin/session?GUFF"


}

function aprigazzettaarti() {

top.location="http://vihxt001:apalladio@www.guritel.it/cgi-bin/session?ARTI"


}


function aprigazzettaartio() {

top.location="http://vihxt001:apalladio@www.guritel.it/cgi-bin/session?ARTI/0"


}


function aprigazzettafarma() {

window.location="http://vihxt001:apalladio@www.guritel.it/cgi-bin/session?FARMA"

}


function aprisuppl() {


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/download/elencodw?listaserie=1&service=500&timestamp=1138187657103')",5000); 
win2.close()

}


function aprigazzettafarma2000() {

window.location="http://vihxt001:apalladio@www.guritel.it/cgi-bin/session?FARMA2000"

}

function aprigazzettafire() {

window.top="http://vihxt001:apalladio@www.guritel.it/cgi-bin/session?FIRE"

}


function aprigazzettarevi() {

window.location="http://vihxt001:apalladio@www.guritel.it/cgi-bin/session?revi"

}


function aprigazzettaaici() {

window.location="http://vihxt001:apalladio@www.guritel.it/cgi-bin/session?AICI"

}

function aprigazzetta12A() {

window.location="http://vihxt001:apalladio@www.guritel.it/cgi-bin/session?ARTI/12A"


}


function aprigazzetta12B() {

window.location="http://vihxt001:apalladio@www.guritel.it/cgi-bin/session?ARTI/12B"

}


function aprigazzetta12C() {

window.location="http://vihxt001:apalladio@www.guritel.it/cgi-bin/session?ARTI/12C"

}


function aprigazzettaarti2() {

window.location="http://vihxt001:apalladio@www.guritel.it/cgi-bin/session?ARTI/2"

}



function aprigazzettaarchivio() {

window.location="http://www.gazzettaufficiale.it/gurifulcrum/dispatcher?service=214&tmstp=1131377301873&task=maschera&download=si&applet=si&utentePagante=vihxt001"

}

function aprigazzettarlfin() {

window.location="http://vihxt001:apalladio@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 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 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;
