//
function leggidato(NameOfCookie){
    if (document.cookie.length > 0) {              
    begin = document.cookie.indexOf(NameOfCookie+"=");       
    if (begin != -1) {           
      begin += NameOfCookie.length+1;       
      end = document.cookie.indexOf(";", begin);
      if (end == -1) end = document.cookie.length;
        return unescape(document.cookie.substring(begin, end));
    } 
  }
  return null;
}
//
var checkregistrazione = leggidato("CookieRegistrazione");
var checkutente = leggidato("CookieUser");
var checkpw = leggidato("CookiePw");
//
var location_ref = document.location.href;
//
var code = "";
//
code = code + "<!-- Inizio LOGIN  -->";
code = code + "";
code = code + "<div id='login'  class='formlogin'>";
code = code + "<form id='form_login' class='formlogin' action='login.php' method='post' name='form_login'>";
code = code + "<table class='formlogin' width='100%' border='0' cellspacing='0' cellpadding='0' align='right'>";
code = code + "<tr height='20'>";
code = code + "<td align='right' valign='middle' height='20'>";

if (checkregistrazione == 'KO') { // se non corrispondono utente e password
code = code + "<div id='messaggiologin'><span class=\"Login\">Utente non registrato | </span> <b><a id=\"chiudilogin\" class=\"chiudilogin\" href='#'  onmouseover=\"btn_chiudi.src='immagini/btn_chiudi1_over.png';\" onmouseout=\"btn_chiudi.src='immagini/btn_chiudi1.png';\" >chiudi </a></b></div></td>";
code = code + "<td width=\"7\" height=\"20\"></td>";
code = code + "<td width=\"20\" height=\"20\"><a href=\"#\"><img id=\"btn_chiudi\" class=\"chiudilogin\" src=\"immagini/btn_chiudi1.png\" alt='' name=\"btn_chiudi1\" height=\"16\" width=\"16\" border='0' onmouseover=\"chiudilogin.className='chiudilogin-over';this.src='immagini/btn_chiudi1_over.png';\" onmouseout=\"chiudilogin.className='chiudilogin';this.src='immagini/btn_chiudi1.png';\"></a></td>";
code = code + "</tr>";
code = code + "<tr height='20'>";
code = code + "<td align='right' valign='top' height='20'><font color=\"white\">User&nbsp;</font> <input class=\"input1\" type='text' name='user' id='usr' size=\"13\" tabindex='1'></td>";
code = code + "<td valign='middle' width='7' height='20'></td>";
code = code + "<td class='recuperapassword' valign='middle' width='20' height='20'></td>";
code = code + "</tr>";
code = code + "<tr height='22'>";
code = code + "<td align='right' valign='top' height='22'><font color=\"white\">Pw&nbsp;</font> <input class=\"input1\" type='password' name='pw' id='pw'size=\"13\" tabindex='2'></td>";
}
//
else {
code = code + "<div id='messaggiologin'><span class=\"Login\">Login</span><font color=\"#ffffff\"> <b>Inserisci i tuoi dati | &nbsp;&nbsp;&nbsp;&nbsp;</b></font><b><a id=\"chiudilogin\" class=\"chiudilogin\" href=\"#\" onmouseover=\"btn_chiudi.src='immagini/btn_chiudi1_over.png';\" onmouseout=\"btn_chiudi.src='immagini/btn_chiudi1.png';\">chiudi </a></b></div></td>";
code = code + "<td width=\"7\" height=\"20\"></td>";
code = code + "<td width=\"20\" height=\"20\"><a href=\"#\"><img id=\"btn_chiudi\" class=\"chiudilogin\" src=\"immagini/btn_chiudi1.png\" alt='' name=\"btn_chiudi1\" height=\"16\" width=\"16\" border='0' onmouseover=\"chiudilogin.className='chiudilogin-over';this.src='immagini/btn_chiudi1_over.png';\" onmouseout=\"chiudilogin.className='chiudilogin';this.src='immagini/btn_chiudi1.png';\"></a></td>";
code = code + "</tr>";
code = code + "<tr height='20'>";
code = code + "<td align='right' valign='top' height='20'><font color=\"white\">User&nbsp;</font> <input class=\"input1\" type='text' name='user' id='usr' size=\"13\" tabindex='1'></td>";
code = code + "<td valign='middle' width='7' height='20'></td>";
code = code + "<td class='recuperapassword' valign='middle' width='20' height='20'></td>";
code = code + "</tr>";
code = code + "<tr height='22'>";
code = code + "<td align='right' valign='top' height='22'><font color=\"white\">Pw&nbsp;</font> <input class=\"input1\" type='password' name='pw' id='pw'size=\"13\" tabindex='2'></td>";
}
//
code = code + "<input type='hidden' name='hiddenlocation' value='"+location_ref+"'>";
code = code + "<td valign='middle' width='0' height='22'></td>";
code = code + "<td align='left' valign='middle' width='20' height='22'>";
code = code + "<img src='immagini/tasto_entra.gif' onmouseover=\"this.src='immagini/tasto_entra_hover.gif';\" onmouseout=\"this.src='immagini/tasto_entra.gif';\" onclick='sendlogin();' alt='' height='12' width='28' border='0'></td>";
code = code + "</tr>";
code = code + "<tr height='6'>";
code = code + "<td align='right' valign='top' height='6'></td>";
code = code + "<td valign='middle' width='7' height='6'></td>";
code = code + "<td align='left' valign='middle' width='20' height='6'></td>";
code = code + "</tr>";
code = code + "</table>";
code = code + "</form>";
code = code + "";
code = code + "<table class='formlogin-sotto' width='100%' border='0' cellspacing='0' cellpadding='0' align='right'>";
code = code + "<tr height='30'>";
code = code + "<td align='right' valign='middle' height='30'><b><a class='recuperapassword' href='#'>Hai dimenticato<br>";
code = code + "<img src='immagini/spacer.gif' alt='' height='11' width='10' align='left' border='0'>la password?</a></b></td>";
code = code + "<td width='7' height='30'></td>";
code = code + "<td class='recuperapassword' width='20' height='30'><img src='immagini/freccia.png' onmouseover=\"this.src='immagini/freccia_over.png';\" onmouseout=\"this.src='immagini/freccia.png';\" alt='' height='15' width='15' border='0'></td>";
code = code + "</tr>";
code = code + "<tr height='22'>";
code = code + "<td align='right' valign='middle' height='22'>";
code = code + "Non ancora<br>";
code = code + "registrato?";
code = code + "</td>";
code = code + "<td width='7' height='22'></td>";
code = code + "<td width='20' height='22'></td>";
code = code + "</tr>";
code = code + "<tr height='22'>";
code = code + "<td align='right' valign='middle' height='22'>";
code = code + "<b><a class='registrati' href='#'>Registrati<br>";
code = code + "subito</a></b>";
code = code + "</td>";
code = code + "<td width='7' height='22'></td>";
code = code + "<td class='registrati' width='20' height='22'><img src='immagini/freccia.png' onmouseover=\"this.src='immagini/freccia_over.png';\" onmouseout=\"this.src='immagini/freccia.png';\" alt='' height='15' width='15' border='0'></td>";
code = code + "</tr>";
code = code + "</table>";
code = code + "";
code = code + "<div id='richiestapassword'>";
code = code + "<form id='recupera_password' class='formlogin' action='#' method='post' name='recupera_password'>";
code = code + "<br>";
code = code + "<img src='immagini/spacer.gif' alt='' height='93' width='72' align='left' border='0'><span class='Login'>Recupera password</span><br>";
code = code + "<br>";
code = code + "";
code = code + "Hai dimenticato la tua password? <br>";
code = code + "Inserisci l'indirizzo e-mail <br>";
code = code + "con il quale ti sei registrato <br>";
code = code + "e ti invieremo le informazioni <br>";
code = code + "di accesso.<br>";
code = code + "<input class='input' type='text' name='email' size='19' tabindex='2'><button class='chiudipw' name='buttonName' type='button'> </button>";
code = code + "</form>";
code = code + "</div>";
code = code + "";
code = code + "</div>";
code = code + "";
code = code + "";
code = code + "<!-- FIne LOGIN -->";
//
document.write(code);
//


