var s = new String("");
var saluto = true;

function trm(n){ var p; for (;p != n;) {p = n; n = p.replace(" ","")} return p;}
function ParseCookie(NomeCookie)  {
   var Stringa = document.cookie;
   var s = new String("");
   NomeCookie = trm(NomeCookie) + "=";
   i = Stringa.indexOf(NomeCookie);
   if ( i >= 0) { k = Stringa.indexOf("; ",i);
          if ( k < 0 ) {k = Stringa.length;};
          if (k > i) s = Stringa.slice(i + NomeCookie.length ,k );
          s = unescape(s);
          }
   return(s);
  }
function ParseCookies(NomeCookie)
{var Stringa = ParseCookie("Ut");
 var s = new String("");
 NomeCookie = trm(NomeCookie) + "|";
 i = Stringa.indexOf(NomeCookie);
 if ( i >= 0)
 {
   i = i + NomeCookie.length;
   var k = Stringa.indexOf("|",i);
   if ( k < 0 ) {k = Stringa.length;};
   if (k > i) {s = Stringa.slice(i ,k);
   }
 }
 return(s);
}
function trim(str)
{
   return str.replace(/^\s*|\s*$/g,"");
}
function ParseCookies1(NomeCookie)
{var Stringa = ParseCookie("Ut1");
 var s = new String("");
 NomeCookie = trm(NomeCookie) + "|";
 i = Stringa.indexOf(NomeCookie);
 if ( i >= 0)
 {
   i = i + NomeCookie.length;
   var k = Stringa.indexOf("|",i);
   if ( k < 0 ) {k = Stringa.length;};
   if (k > i) {s = Stringa.slice(i ,k);
   }
 }
 return(s);
}
function ParseCookies2(NomeCookie)
{
 var s;
 if (NomeCookie=="Login" || NomeCookie=="Password")
 {
   s = ParseCookie(NomeCookie);
   if (s!="") return(s);
   else return(ParseCookie(NomeCookie+"1"));
 }
 s=ParseCookies(NomeCookie);
 if (s!="")
    return(s);
 else
    return(ParseCookies1(NomeCookie));
}
function ParseUrl(NomeVAR)
{
 NomeVAR = NomeVAR + "=";
 var Stringa = document.URL;
 // Stringa = unescape(Stringa);
 var s = new String("")  ;
 i = Stringa.indexOf(NomeVAR);
 if ( i > 0)
  {
   k = Stringa.indexOf("&",i);
   if ( k < 0 ) {k = Stringa.length;};
   if (k > i) s = Stringa.slice(i + NomeVAR.length ,k );
  }
  return(unescape(s));
 }
function logout()
{
 var esci = confirm(" Vuoi interrompere la connessione?\n\n La prossima volta dovrai inserire nuovamente login e password\n\n per accedere ai servizi del sito GLS su questo computer.");
 if (esci)
   {
    //document.cookie = "Ut=";
    //document.cookie = "Login=";
    //document.cookie = "Password=";
	//document.cookie = 'Ut' + '=; expires=Thu, 01-Jan-70 00:00:01 GMT;';
	//document.cookie = 'Login' + '=; expires=Thu, 01-Jan-70 00:00:01 GMT;';
	//document.cookie = 'Password' + '=; expires=Thu, 01-Jan-70 00:00:01 GMT;';
	
	document.cookie='Ut'+"=GONEcbEndCookie; expires=Monday, 19-Aug-1996 05:00:00 GMT";
	document.cookie='Login'+"=GONEcbEndCookie; expires=Monday, 19-Aug-1996 05:00:00 GMT";
	document.cookie='Password'+"=GONEcbEndCookie; expires=Monday, 19-Aug-1996 05:00:00 GMT";
	
	document.location = "index.asp";
   }
}
function modify()
{
 i = ParseCookies("Tipo");
 if (i == "1")
   {
   // if ( trm(ParseCookies("Email")) == "")
   // {document.location="/scripts/cgiip.wsc/scheda_abbonato_senza_email.html?1";}
     {document.location="/scripts/cgiip.wsc/scheda_abbonato.html?vis='1'";}
   // else
   //  {document.location="/scripts/cgiip.wsc/scheda_personale_modifica_dati_abbonato.html";}
   }
 else if (i == "2")
   { document.location="/scripts/cgiip.wsc/scheda_personale_modifica_dati_occasionale.w";}
}

function head(tipo)
{
	// var classe = "'class'";
	// var tipo = "'testoblubold'";
	// var tipo1 = "'testolight'";
	var img1 = "'images/sched_pers_on.gif'";
	var img2 = "'images/sched_pers_off.gif'";
	var img3 = "'images/mod_dati_on.gif'";
	var img4 = "'images/mod_dati_off.gif'";
	var n = ParseCookies("Nome") + " " + ParseCookies("Cognome");
	var icona = (trm(ParseCookies("Tipo")) == "2")?"/img/modifica_dati.gif":"/img/schedapers.gif";
	var icona1 = (trm(ParseCookies("Tipo")) == "1")?"<img src='/img/download_2.gif' width='81' height='15' border='0'>":"";
	var js = (trm(ParseCookies("Tipo")) == "1")?"<a href='javascript:download_2()'>":"";
	if (trm(n) == "") n = ParseCookies("Azienda");
	d = new Date();
	if (d.getHours() <= 13)
	  b = "Buongiorno ";
	else
	  b = "Buonasera ";

   if (saluto)
      {
       a = "";
       if (trm(ParseCookies("Tipo")) == "1" && trm(ParseCookies("Sede")) == "RW" && trm(ParseCookies("Codice")) == "2182" )
          // a= '<td width="90%" class="testo">' + b + '<b>' + n + '</b>' + '&nbsp;&nbsp;' + '<A class="testolight" HREF="scheda_abbonato.asp?vis=1" onmouseover="this.attributes[' + classe + '].value=' + tipo + ';" onmouseout="this.attributes[' + classe + '].value=' + tipo1 + ';"> (scheda personale) </p></td>';
            a= '<td width="90%" class="testo">' + b + '<b>DEMO SERVIZI SITO GLS</b>';
       else if (trm(ParseCookies("Tipo")) == "1")
          // a= '<td width="90%" class="testo">' + b + '<b>' + n + '</b>' + '&nbsp;&nbsp;' + '<A class="testolight" HREF="scheda_abbonato.asp?vis=1" onmouseover="this.attributes[' + classe + '].value=' + tipo + ';" onmouseout="this.attributes[' + classe + '].value=' + tipo1 + ';"> (scheda personale) </p></td>';
            a= '<td width="90%" class="testo">&nbsp;&nbsp;&nbsp;' + b + '<b>' + n + '</b>' + '&nbsp&nbsp' + '<A HREF="scheda_abbonato.asp?vis=1" class="saluto">scheda personale</A></td>';
	   if (trm(ParseCookies("Tipo")) == "2")
          //a= '<td width="90%" class="testo">' + b + '<strong>' + n + '</strong>' + '<A class="testolight" HREF="scheda_personale_modifica_dati_occasionale.asp"> (modifica i tuoi dati) </a></td>';
 	        a= '<td width="90%" class="testo">&nbsp;&nbsp;&nbsp;' + b + '<b>' + n + '</b>' + '&nbsp&nbsp' + '<A HREF="scheda_personale_modifica_dati_occasionale.asp" class="saluto">scheda personale</A></td>';
	   document.write(a);
      }
      else
      {
       a = "";
 	   a = '<td width="90%"></td>';
       document.write(a);
      }
/*
	if (trm(n) != "")
	{
         a = "";
        if (tipo == 2 || tipo == 5)
         {
	        a = '<TR>';
            a = a + '<TD COLSPAN="11">';
            a = a + '<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">';
            a = a + '<TR>';
            a = a + '<TD COLSPAN="3"><IMG SRC="/img/ghost.gif" WIDTH="370" HEIGHT="1" BORDER="0" ALT=""></TD>';
            a = a + '</TR>';
            a = a + '<TR>';
            a = a + '<TD width="357" ALIGN="left" VALIGN="middle">';
            a = a + '<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD><IMG SRC="/img/ghost.gif" WIDTH="12" HEIGHT="10" BORDER="0" ALT=""></TD><TD ALIGN="left" VALIGN="middle" CLASS="cyantextthinbold">' + b + '<SPAN CLASS="blutextthinbold">' + n + ' </SPAN></TD></TR></TABLE>';
            a = a + '</TD>';
            a = a + '<TD width="80" CLASS="cyantextthinbold"><A HREF="javascript:logout()" CLASS="blutexttin"><IMG SRC="/img/esci.gif" WIDTH="39" HEIGHT="17" BORDER="0" ALT=""></A></TD>';
            a = a + '<TD width="82" CLASS="cyantextthinbold"><div align="right"></div></TD>';
            a = a + '</TR>';
            a = a + '</TABLE>';
            a = a + '</TD>';
            a = a + '<TD><IMG SRC="/img/ghost.gif" WIDTH="35" HEIGHT="41" BORDER="0" ALT=""></TD>';
            a = a + '</TR>';
         }
         else if (tipo == 3 || tipo == 1 || tipo == 6)
         {
            a = '<TR>';
            a = a + '<TD COLSPAN="12">';
            a = a + '<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">';
            a = a + '<TR>';
            a = a + '<TD COLSPAN="3"><IMG SRC="/img/ghost.gif" WIDTH="370" HEIGHT="1" BORDER="0" ALT=""></TD>';
            a = a + '<TD colspan="2"><IMG SRC="/img/ghost.gif" WIDTH="200" HEIGHT="1" BORDER="0" ALT=""></TD>';
            a = a + '<TD width="10"><IMG SRC="/img/ghost.gif" WIDTH="10" HEIGHT="1" BORDER="0" ALT=""></TD>';
            a = a + '<TD width="7" ROWSPAN="2"><IMG SRC="/img/ghost.gif" WIDTH="1" HEIGHT="41" BORDER="0" ALT=""></TD>';
            a = a + '</TR>';
            a = a + '<TR>';
            a = a + '<TD width="333" ALIGN="left" VALIGN="middle">';
            a = a + '<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD><IMG SRC="/img/ghost.gif" WIDTH="12" HEIGHT="10" BORDER="0" ALT=""></TD><TD ALIGN="left" VALIGN="middle" CLASS="cyantextthinbold">' + b + '<SPAN CLASS="blutextthinbold">' + n + ' </SPAN></TD></TR></TABLE>';
            a = a + '</TD>';
            a = a + '<TD width="65" CLASS="cyantextthinbold"><A HREF="javascript:logout()" CLASS="blutexttin"><IMG SRC="/img/esci.gif" WIDTH="39" HEIGHT="17" BORDER="0" ALT=""></A></TD>';
            a = a + '<TD width="101" CLASS="cyantextthinbold"><div align="right"></div></TD>';
         // a = a + '<TD width="99" ALIGN="right"><div align="center"><a href="' + js + '"><div align="left">';
			a = a + '<TD width="99" ALIGN="right"><div align="center">' + js + '<div align="left">';
		 // a = a + '<img src="' + icona1 + '" width="81" height="15" border="0"></div></a></div></TD>';
            a = a + '' + icona1 + '</div></a></div></TD>';
			a = a + '<TD width="135" ALIGN="right"><a href="javascript:modify()" >';
			a = a + '<img src="' + icona + '" width="128" height="15" border="0" align="absmiddle"></a></TD>';
            a = a + '<TD ALIGN="right" VALIGN="middle">&nbsp;</TD>';
            a = a + '</TR>';
            a = a + '</TABLE>';
            a = a + '</TD>';
            a = a + '</TR>';
         }
         else if (tipo == 4)
         {
            a ='<TR>';
            a = a + '<TD COLSPAN="12">';
            a = a + '<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">';
            a = a + '<TR>';
            a = a + '<TD COLSPAN="3"><IMG SRC="/img/ghost.gif" WIDTH="370" HEIGHT="1" BORDER="0" ALT=""></TD>';
            a = a + '<TD width="200"><IMG SRC="/img/ghost.gif" WIDTH="200" HEIGHT="1" BORDER="0" ALT=""></TD>';
            a = a + '<TD width="4" ROWSPAN="2"><IMG SRC="/img/ghost.gif" WIDTH="1" HEIGHT="41" BORDER="0" ALT=""></TD>';
            a = a + '</TR>';
            a = a + '<TR>';
            a = a + '<TD width="360" ALIGN="left" VALIGN="middle">';
            a = a + '<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD><IMG SRC="/img/ghost.gif" WIDTH="12" HEIGHT="10" BORDER="0" ALT=""></TD><TD ALIGN="left" VALIGN="middle" CLASS="cyantextthinbold">' + b + '<SPAN CLASS="blutextthinbold">'+ n + '</SPAN></TD></TR></TABLE>';
            a = a + '</TD>';
            a = a + '<TD width="80" CLASS="cyantextthinbold"><A HREF="javascript:logout()" CLASS="blutexttin"><IMG SRC="/img/esci.gif" WIDTH="39" HEIGHT="17" BORDER="0" ALT=""></A></TD>';
            a = a + '<TD width="82" CLASS="cyantextthinbold"><div align="right"></div></TD>';
            a = a + '<TD ALIGN="right"><A HREF="javascript:modify()" >';
			a = a + '<img src="' + icona + '" width="128" height="15" border="0"></A></TD>';
            a = a + '</TR>';
            a = a + '</TABLE>';
            a = a + '</TD>';
            a = a + '</TR>';
         }
	  document.write(a);
    }
    else
    {
       a='<TR>';
       a = a + '<TD COLSPAN="11">';
       a = a + '<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">';
       a = a + '<TR>';
       a = a + '<TD COLSPAN="3"><IMG SRC="/img/ghost.gif" WIDTH="563" HEIGHT="1" BORDER="0" ALT=""></TD>';
       a = a + '<TD WIDTH="10"><IMG SRC="/img/ghost.gif" WIDTH="10" HEIGHT="1" BORDER="0" ALT=""></TD>';
       a = a + '<TD ROWSPAN="3" WIDTH="1"><IMG SRC="/img/ghost.gif" WIDTH="1" HEIGHT="41" BORDER="0" ALT=""></TD>';
       a = a + '</TR>';
       a = a + '<TR>';
       a = a + '<TD ALIGN="right" VALIGN="middle" COLSPAN="3"><A HREF="form_registrazione_utente_registrato.html" CLASS="blutextthin">Utente registrato</A></TD>';
       a = a + '<TD ALIGN="right" VALIGN="middle" WIDTH="10"><A HREF="form_registrazione_utente_registrato.html"><IMG SRC="/img/frsx.gif" WIDTH="8" HEIGHT="12" BORDER="0" ALT=""></A></TD>';
       a = a + '</TR>';
       a = a + '<TR>';

<!-- inizio modifica occultamento link sito inglese 16_06_2003 -->

       a = a + '<TD ALIGN="right" VALIGN="middle" WIDTH="19"><DIV ALIGN="right"> <!-- <A HREF="/scripts/cgiip2.wsc/index.html"> --> <!-- <IMG SRC="/img/frdx.gif" WIDTH="8" HEIGHT="12" BORDER="0" ALT=""> --></A></DIV></TD> ';
       a = a + '<TD ALIGN="right" VALIGN="middle" WIDTH="90"><DIV ALIGN="right"> <!-- <A  HREF="/scripts/cgiip2.wsc/index.html"> --> <CLASS="blutextthin" English version></A></DIV></TD>';

<!-- fine modifica occultamento link sito inglese 16_06_2003 -->

       a = a + '<TD ALIGN="right" VALIGN="middle" WIDTH="478"><A HREF="form_registrazione_nuovo_utente.html" CLASS="blutextthin">Registrati ora</A></TD>';
       a = a + '<TD ALIGN="right" VALIGN="middle" WIDTH="10"><A HREF="form_registrazione_nuovo_utente.html"><IMG SRC="/img/frsx.gif" WIDTH="8" HEIGHT="12" BORDER="0" ALT=""></A></TD>';
       a = a + '</TR>';
       a = a + '</TABLE>';
       a = a + '</TD>';
       a = a + '<TD><IMG SRC="/img/ghost.gif" WIDTH="16" HEIGHT="41" BORDER="0" ALT=""></TD>';
       a = a + '</TR>';
       document.write(a);
    }
*/
}


function msg_saluto(tipo)
{
	var img1 = "'images/sched_pers_on.gif'";
	var img2 = "'images/sched_pers_off.gif'";
	var img3 = "'images/mod_dati_on.gif'";
	var img4 = "'images/mod_dati_off.gif'";
	var n = ParseCookies("Nome") + " " + ParseCookies("Cognome");
	var icona = (trm(ParseCookies("Tipo")) == "2")?"/img/modifica_dati.gif":"/img/schedapers.gif";
	var icona1 = (trm(ParseCookies("Tipo")) == "1")?"<img src='/img/download_2.gif' width='81' height='15' border='0'>":"";
	var js = (trm(ParseCookies("Tipo")) == "1")?"<a href='javascript:download_2()'>":"";
	if (trm(n) == "") n = ParseCookies("Azienda");
	d = new Date();
	if (d.getHours() <= 13)
	  b = "Buongiorno ";
	else
	  b = "Buonasera ";

   if (saluto)
      {
       a = "";
       if (trm(ParseCookies("Tipo")) == "1" && trm(ParseCookies("Sede")) == "RW" && trm(ParseCookies("Codice")) == "2182" )
            a= b + '<b>DEMO SERVIZI SITO GLS</b>';
       else if (trm(ParseCookies("Tipo")) == "1")
            a= b + '<br><b>' + n.toUpperCase() + '</b>';
	   if (trm(ParseCookies("Tipo")) == "2")
 	        a= b + '<br><b>' + n.toUpperCase() + '</b>';
	   document.write(a);
      }
      else
      {
       a = "";
 	   a = '<td width="90%"></td>';
       document.write(a);
      }
}


function msg_scheda_personale(tipo)
{
	var img1 = "'images/sched_pers_on.gif'";
	var img2 = "'images/sched_pers_off.gif'";
	var img3 = "'images/mod_dati_on.gif'";
	var img4 = "'images/mod_dati_off.gif'";
	var n = ParseCookies("Nome") + " " + ParseCookies("Cognome");
	var icona = (trm(ParseCookies("Tipo")) == "2")?"/img/modifica_dati.gif":"/img/schedapers.gif";
	var icona1 = (trm(ParseCookies("Tipo")) == "1")?"<img src='/img/download_2.gif' width='81' height='15' border='0'>":"";
	var js = (trm(ParseCookies("Tipo")) == "1")?"<a href='javascript:download_2()'>":"";
	if (trm(n) == "") n = ParseCookies("Azienda");
	d = new Date();
	if (d.getHours() <= 13)
	  b = "Buongiorno ";
	else
	  b = "Buonasera ";

   if (saluto)
      {
       a = "";
       if (trm(ParseCookies("Tipo")) == "1" && trm(ParseCookies("Sede")) == "RW" && trm(ParseCookies("Codice")) == "2182" )
            a= b + '<b>DEMO SERVIZI SITO GLS</b>';
       else if (trm(ParseCookies("Tipo")) == "1")
            a= '<A HREF="scheda_abbonato.asp?vis=1" ><img src="./images/holding/fixedimages/button_arrow.gif">&nbsp;Scheda personale</A>';
	   if (trm(ParseCookies("Tipo")) == "2")
 	        a= '<A HREF="scheda_personale_modifica_dati_occasionale.asp"><img src="./images/holding/fixedimages/button_arrow.gif">&nbsp;Scheda personale</A>';
	   document.write(a);
      }
      else
      {
       a = "";
 	   a = '<td width="90%"></td>';
       document.write(a);
      }
}


function head_manutenzione()

{
       a='<TR>';
       a = a + '<TD COLSPAN="11">';
       a = a + '<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">';
       a = a + '<TR>';
       a = a + '<TD COLSPAN="3"><IMG SRC="/img/ghost.gif" WIDTH="563" HEIGHT="1" BORDER="0" ALT=""></TD>';
       a = a + '<TD WIDTH="10"><IMG SRC="/img/ghost.gif" WIDTH="10" HEIGHT="1" BORDER="0" ALT=""></TD>';
       a = a + '<TD ROWSPAN="3" WIDTH="1"><IMG SRC="/img/ghost.gif" WIDTH="1" HEIGHT="41" BORDER="0" ALT=""></TD>';
       a = a + '</TR>';
       a = a + '<TR>';
       a = a + '<TD ALIGN="right" VALIGN="middle" COLSPAN="3"></TD>';
       a = a + '<TD ALIGN="right" VALIGN="middle" WIDTH="10"></TD>';
       a = a + '</TR>';
       a = a + '<TR>';



       a = a + '<TD ALIGN="right" VALIGN="middle" WIDTH="478"></TD>';
       a = a + '<TD ALIGN="right" VALIGN="middle" WIDTH="10"></TD>';
       a = a + '</TR>';
       a = a + '</TABLE>';
       a = a + '</TD>';
       a = a + '<TD><IMG SRC="/img/ghost.gif" WIDTH="16" HEIGHT="41" BORDER="0" ALT=""></TD>';
       a = a + '</TR>';
       document.write(a);
}




function download_2()
{
	var n = ParseCookies("Nome") + " " + ParseCookies("Cognome");
	if (trm(n) == "")
	  n = ParseCookies("Azienda");
	else
	  n = ParseCookies("Nome") + "&nbsp;" + ParseCookies("Cognome");
     // alert(n);
    var n = (trm(n)=="")?ParseUrl("n"):n;
    // alert(unescape(document.URL));
	d = new Date();
	if (d.getHours() <= 13)
	  b = "Buongiorno&nbsp;";
	else
	  b = "Buonasera&nbsp;";
	if ((trm(ParseCookies("Tipo"))=="") && (trm(ParseUrl("Tipo"))=="") )
	{
	 // WebBrowser.Navigate("/download_2.asp",2);
	 document.location.replace("index.asp");
	// alert(document.location);
	 document.location="download_2.asp";
	}
	else
	{
	 var vTipo = trm(ParseCookies("Tipo"));
	 vTipo = (trm(vTipo)=="")?ParseUrl("Tipo"):vTipo;
	 document.location="download_2.asp?n="+escape(n)+"&b="+b+"&Tipo=" + vTipo;
	}
}


function notizie()
{
var n = ParseCookies("Nome") + " " + ParseCookies("Cognome");
if (trm(n) == "")
  n = ParseCookies("Azienda");
else
  n = ParseCookies("Nome") + "&nbsp;" + ParseCookies("Cognome");
d = new Date();
if (d.getHours() <= 13)
  b = "Buongiorno&nbsp;";
else
  b = "Buonasera&nbsp;";
if (trm(ParseCookies("Tipo")) == "")
{
 document.location="/azienda_notiziedaexecutive.asp";
}
else
{
 document.location="/azienda_notiziedaexecutive.asp?n="+escape(n)+"&b="+b+"&Tipo="+trm(ParseCookies("Tipo"));
}
}
function lavora()
{
	var n = ParseCookies("Nome") + " " + ParseCookies("Cognome");
	if (trm(n) == "")
	  n = ParseCookies("Azienda");
	else
	  n = ParseCookies("Nome") + "&nbsp;" + ParseCookies("Cognome");
     // alert(n);
    var n = (trm(n)=="")?ParseUrl("n"):n;
    // alert(unescape(document.URL));
	d = new Date();
	if (d.getHours() <= 13)
	  b = "Buongiorno&nbsp;";
	else
	  b = "Buonasera&nbsp;";
	if ((trm(ParseCookies("Tipo"))=="") && (trm(ParseUrl("Tipo"))=="") )
	{
	 // WebBrowser.Navigate("/download_2.asp",2);
	 // ***vecchio codice *** document.location.replace("index.html");
	 /* nuovo codice */
	 document.location.replace("index.asp");
	// alert(document.location);
	 // ***vecchio codice ***  document.location="/lavora.asp";
	 /* nuovo codice */
	 document.location="lavoraconNoi.asp";
	}
	else
	{
	 var vTipo = trm(ParseCookies("Tipo"));
	 vTipo = (trm(vTipo)=="")?ParseUrl("Tipo"):vTipo;
	  // ***vecchio codice *** document.location="/lavora.asp?n="+escape(n)+"&b="+b+"&Tipo=" + vTipo;
	/* nuovo codice */
/*	document.location="lavoraconNoi.asp?n="+escape(n)+"&b="+b+"&Tipo=" + vTipo; */
	document.location="lavoraconNoi.asp?Tipo=" + vTipo;
	}
}

function lavora2()
{
	var n = ParseCookies("Nome") + " " + ParseCookies("Cognome");
	if (trm(n) == "")
	  n = ParseCookies("Azienda");
	else
	  n = ParseCookies("Nome") + "&nbsp;" + ParseCookies("Cognome");
     // alert(n);
    var n = (trm(n)=="")?ParseUrl("n"):n;
    // alert(unescape(document.URL));
	d = new Date();
	if (d.getHours() <= 13)
	  b = "Buongiorno&nbsp;";
	else
	  b = "Buonasera&nbsp;";
	if ((trm(ParseCookies("Tipo"))=="") && (trm(ParseUrl("Tipo"))=="") )
	{
	 // WebBrowser.Navigate("/download_2.asp",2);
	 // ***vecchio codice *** document.location.replace("index.html");
	 /* nuovo codice */
	 document.location.replace("index.asp");
	// alert(document.location);
	 // ***vecchio codice ***  document.location="/lavora.asp";
	 /* nuovo codice */
	 document.location="lavoraconNoi2.asp";
	}
	else
	{
	 var vTipo = trm(ParseCookies("Tipo"));
	 vTipo = (trm(vTipo)=="")?ParseUrl("Tipo"):vTipo;
	  // ***vecchio codice *** document.location="/lavora.asp?n="+escape(n)+"&b="+b+"&Tipo=" + vTipo;
	/* nuovo codice */
/*	document.location="lavoraconNoi.asp?n="+escape(n)+"&b="+b+"&Tipo=" + vTipo; */
	document.location="lavoraconNoi2.asp?Tipo=" + vTipo;
	}
}

function remote_labeling()
{
	var n = ParseCookies("Nome") + " " + ParseCookies("Cognome");
	if (trm(n) == "")
	  n = ParseCookies("Azienda");
	else
	  n = ParseCookies("Nome") + "&nbsp;" + ParseCookies("Cognome");
    var n = (trm(n)=="")?ParseUrl("n"):n;
	d = new Date();
	if (d.getHours() <= 13)
	  b = "Buongiorno&nbsp;";
	else
	  b = "Buonasera&nbsp;";
	if ((trm(ParseCookies("Tipo"))=="") && (trm(ParseUrl("Tipo"))=="") )
	{
	 document.location.replace("index.asp");
	 document.location="download_remote_labeling.asp";
	}
	else
	{
	 var vTipo = trm(ParseCookies("Tipo"));
	 vTipo = (trm(vTipo)=="")?ParseUrl("Tipo"):vTipo;
	 document.location="download_remote_labeling.asp?n="+escape(n)+"&b="+b+"&Tipo=" + vTipo;
	}
}

/* function lavora()
{
var n = ParseCookies("Nome") + " " + ParseCookies("Cognome");
if (trm(n) == "")
  n = ParseCookies("Azienda");
else
  n = ParseCookies("Nome") + "&nbsp;" + ParseCookies("Cognome");
d = new Date();
if (d.getHours() <= 13)
  b = "Buongiorno&nbsp;";
else
  b = "Buonasera&nbsp;";
if (trm(ParseCookies("Tipo")) == "")
{
 document.location="/lavora.asp";
}
else
{
 document.location="/lavora.asp?n="+escape(n)+"&b="+b+"&Tipo="+trm(ParseCookies("Tipo"));
}
}
*/
function ritiro()
{
	if (trm(ParseCookies("Tipo")) == "" && (trm(ParseUrl("Tipo"))=="") )
	{
	 document.location="prenota_ritiro_anonimo.asp";
	}
	else
	{
	  if (trm(ParseCookies("TipoSede")) == "S" )
	     document.location="prenota_ritiro_sede.asp";
	  else
	     document.location="prenota_ritiro.asp";
	}
}
function consegna()
{
	if (trm(ParseCookies("Tipo")) == "" && (trm(ParseUrl("Tipo"))=="") )
	{
	 // ***vecchio codice ***  document.location="/scripts/cgiip.wsc/verifica_consegna_anonimo.html";
	 /* nuovo codice */
	 document.location="verifica_consegna_anonimo.asp";
	}
	else if (trm(ParseCookies("Tipo")) == "1" || (trm(ParseUrl("Tipo"))=="1") )
	{
	 // ***vecchio codice ***  document.location="/scripts/cgiip.wsc/verifica_consegna_italia_abbonato_elenco.html";
	 /* nuovo codice */
	 document.location="verifica_consegna_italia_abbonato_elenco.asp";
	}
	else
	{
	 // ***vecchio codice *** document.location="/scripts/cgiip.wsc/cerca_codice_spedizione.html";
	/* nuovo codice */
	document.location="cerca_codice_spedizione.asp";
	}
}

function download()
{ /*
	var n = ParseCookies("Nome") + " " + ParseCookies("Cognome");
	if (trm(n) == "")
	  n = ParseCookies("Azienda");
	else
	  n = ParseCookies("Nome") + "&nbsp;" + ParseCookies("Cognome");
     // alert(n);
    var n = (trm(n)=="")?ParseUrl("n"):n;
    // alert(unescape(document.URL));
	d = new Date();
	if (d.getHours() <= 13)
	  b = "Buongiorno&nbsp;";
	else
	  b = "Buonasera&nbsp;";
	if ((trm(ParseCookies("Tipo"))=="") && (trm(ParseUrl("Tipo"))=="") )
	{
	 // WebBrowser.Navigate("/download.asp",2);
	 document.location.replace("index.html");
	// alert(document.location);
	 document.location="/download.asp";
	}
	else
	{
	 var vTipo = trm(ParseCookies("Tipo"));
	 vTipo = (trm(vTipo)=="")?ParseUrl("Tipo"):vTipo;
	 document.location="/download.asp?n="+escape(n)+"&b="+b+"&Tipo=" + vTipo;
	}
*/ }

function servizioclienti()
{
	if (trm(ParseCookies("Tipo")) == "" && (trm(ParseUrl("Tipo"))==""))
	{
	  // ***vecchio codice *** document.location="/scripts/cgiip.wsc/servizioclienti_form_nonregistrati.html";
	 /* nuovo codice */
	 document.location="servizioclienti_form_nonregistrati.asp";
	}
	else
	{
	  // ***vecchio codice *** document.location="/scripts/cgiip.wsc/servizioclienti_form_registrati.html";
	 /* nuovo codice */
	 document.location="servizioclienti_form_registrati.asp";
	}
}
function verifica_consegna()
{
	if (trm(ParseCookies("Tipo")) == "1")
	{
	  // ***vecchio codice *** document.location="/scripts/cgiip.wsc/verifica_consegna_italia_abbonato_elenco.html";
	 /* nuovo codice */
	document.location="verifica_consegna_italia_abbonato_elenco.asp";
	}
	else if (trm(ParseCookies("Tipo")) == "2")
	{
	 // ***vecchio codice *** document.location="/scripts/cgiip.wsc/cerca_codice_spedizione.html";
	 /* nuovo codice */
	document.location="cerca_codice_spedizione.asp";
	}
	else if (trm(ParseCookies("Tipo")) == "")
	{
	  // ***vecchio codice *** document.location="/scripts/cgiip.wsc/verifica_consegna_anonimo.html";
	 /* nuovo codice */
	document.location="verifica_consegna_anonimo.asp";
	}
}
function tornasu()
{
var wdb = document.documentElement.body;
//var puls = document.all.fdiv.style.visibility;
//var scrolling;
//var screen_width = null;
//var wdb = null;

//if (navigator.javaEnabled() && navigator.appName == "Netscape")
if (navigator.appName == "Netscape")
{
//var toolkit = java.awt.Toolkit.getDefaultToolkit();
//var screen_size = toolkit.getScreenSize();
//screen_width = screen_size.width;
wdb1 = document.body.scrollHeight;
wdb2 = document.documentElement.clientHeight
}
//else screen_width = screen.width;
else if (navigator.appName == "Microsoft Internet Explorer")
{
//wdb1 = document.body.scrollHeight;
//wdb2 = document.body.pixelHeight;
//wdb1 = window.document.body.scrollHeight;
//wdb2 = window.document.documentElement.clientHeight;
//pippo = document.body.scrollbar.value;
wdb1 =  document.body.scrollHeight;
//wdb2 = document.body.clientHeight;
wdb2 = document.body.clientHeight;
wdb3 = document.body.offsetHeight;
//wdb4 = document.body.clientHeight;
wdb4 = screen.height;
wdb5 = document.body.scroll;
}

//if (screen_width <= 800)

//var wdb = window.document.body;
//var scrolling;

//alert(wdb.clientHeight);

//if ( wdb.scrollHeight > wdb.clientHeight )




//alert(wdb1);
//alert(wdb2);
//alert(wdb3);
//alert(wdb4);
//alert(wdb5);
if (wdb1 > wdb2 + 100)
{
	//fdiv.style.visibility = "visible";
	document.getElementById('fdiv').style.visibility="visible";
	//alert("visible");
	
	//fdiv1.style.visibility = "hidden"
}
else {
	//fdiv1.style.visibility = "visible"
	
	//fdiv.style.visibility = "hidden";
	document.getElementById('fdiv').style.visibility="hidden";
	//alert("hidden");
}
/*
if (wdb1 > wdb2)

//if (document.body.scrollbar = "yes")


{
document.write('<table width="451" border="0">');
document.write('<td width="11"><div align="right"><img src="images/freccia.gif" width="10"    			height="17"></div></td>');
document.write('<td width="430" class="testo"><a href="#top">Torna su</a> </td>');
document.write('</tr></table>');
}
else {
document.write('<table width="451" border="0">');
document.write('<tr valign="top">');
document.write('<td width="11"><div align="right"></div></td>');
document.write('<td width="430">&nbsp;</td>');
document.write('</tr></table>');
}
*/
}
function TabellaHlight(objTabella)
{
var lista_td = objTabella.getElementsByTagName("td");

 for(i=0; i < lista_td.length; i++)
 {
   cella = lista_td.item(i);
   if (cella.className == "testo"  ){  cella.style.color="#FF9900";  }
   else if (cella.className == "testobold"  ){ cella.style.color="#FF9900";}
 }   
} 
function TabellaDlight(objTabella)
{
var lista_td = objTabella.getElementsByTagName("td");

 for(i=0; i < lista_td.length; i++)
 {
   cella = lista_td.item(i);
   if (cella.className == "testo"  ){cella.style.color = "#000000";}
   else if (cella.className == "testobold" ){cella.style.color = "#10296B";}
 }   
} 

function corniceL_select() {

if (navigator.appName == "Netscape")
	{
	document.write("<img src=\"images/botformleftb.gif\" width=\"13\" height=\"30\">");
	}
else if (navigator.appName == "Microsoft Internet Explorer")
	{
	document.write("<img src=\"images/botformleftb.gif\" width=\"13\" width=\"13\" height=\"31\">");
	}
else 
	{
	document.write("<img src=\"images/botformleftb.gif\" width=\"13\" width=\"13\" height=\"31\">");
	}

}

function corniceR_select() {

if (navigator.appName == "Netscape")
	{
	document.write("<img src=\"images/botformrightb.gif\" width=\"13\" height=\"30\">");
	}
else if (navigator.appName == "Microsoft Internet Explorer")
	{
	document.write("<img src=\"images/botformrightb.gif\" width=\"13\" width=\"13\" height=\"31\">");
	}
else 
	{
	document.write("<img src=\"images/botformrightb.gif\" width=\"13\" width=\"13\" height=\"31\">");
	}

}