function showLogin()
{
  var sHtml = '';
  var imode = iUsedMode;
  if ((imode == 2) && (sUser != '')) imode = 1;	//logged in, but no rights....
  
  switch( imode )
  {
    case 0:
      sHtml += '<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#C4D2DF">';
      sHtml += '  <tr>';
      sHtml += '    <td width="9px" height="9px"><img src="../images/spacer.gif" width="9" height="9" alt border="0"></td>';
      sHtml += '    <td width="159px"><img src="../images/spacer.gif" width="159" height="9" alt border="0"></td>';
      sHtml += '    <td width="9px"><img src="../images/spacer.gif" width="9" height="9" alt border="0"></td>';
      sHtml += '  </tr>';
      sHtml += '  <tr>';
      sHtml += '    <td></td>';
      sHtml += '    <td bgcolor="#5B83A7" align="center">';
      sHtml += '      <table width="159px" border="0" cellspacing="0" cellpadding="0" bgcolor="#5B83A7">';
      sHtml += '        <tr>';
      sHtml += '          <td><img src="../images/advice.gif" alt border="0" WIDTH="159" HEIGHT="71"></td>';
      sHtml += '        </tr>';
      sHtml += '      </table>';
      sHtml += '    </td>';
      sHtml += '    <td></td>';
      sHtml += '  </tr>';
      sHtml += '  <tr>';
      sHtml += '    <td></td>';
      sHtml += '    <td background="../images/bbglogin.gif">';
      sHtml += '      <table width="159px" border="0" cellspacing="0" cellpadding="0" background>';
      sHtml += '        <tr>';
      sHtml += '          <td height="1px" colspan="3" background="../images/dotline.gif"><img src="../images/spacer.gif" width="1" height="1" alt border="0"></td>';
      sHtml += '        </tr>';
      sHtml += '        <tr>';
      sHtml += '          <td width="5px" height="5px"><img src="../images/spacer.gif" width="5" height="5" alt border="0"></td>';
      sHtml += '          <td width="149px"><img src="../images/spacer.gif" width="149" height="5" alt border="0"></td>';
      sHtml += '          <td width="5px"><img src="../images/spacer.gif" width="5" height="5" alt border="0"></td>';
      sHtml += '        </tr>';
      sHtml += '        <tr>';
      sHtml += '          <td height="12px"></td>';
      sHtml += '          <td class="txtsmall"><span id="adviceLink" name="adviceLink"><a class="aheader" href="#" onclick="doAdvice(1);"><strong>Was ist das NZZ E-Paper? »</strong></a></span></td>';
      sHtml += '          <td height="12px"></td>';
      sHtml += '        </tr>';
      sHtml += '        <tr>';
      sHtml += '          <td width="5px" height="5px"><img src="../images/spacer.gif" width="5" height="5" alt border="0"></td>';
      sHtml += '          <td width="149px"><img src="../images/spacer.gif" width="149" height="5" alt border="0"></td>';
      sHtml += '          <td width="5px"><img src="../images/spacer.gif" width="5" height="5" alt border="0"></td>';
      sHtml += '        </tr>';
      sHtml += '      </table>';
      sHtml += '    </td>';
      sHtml += '    <td></td>';
      sHtml += '  </tr>';
      sHtml += '  <tr>';
      sHtml += '    <td width="9px" height="9px"><img src="../images/spacer.gif" width="9" height="9" alt border="0"></td>';
      sHtml += '    <td width="159px" height="9px"><img src="../images/spacer.gif" width="159" height="9" alt border="0"></td>';
      sHtml += '    <td width="9px" height="9px"><img src="../images/spacer.gif" width="9" height="9" alt border="0"></td>';
      sHtml += '  </tr>';
      sHtml += '</table>';
      break;
    case 1:
      if ( sUser == 'Demo' || sUser == 'Jubilee' || sUser == 'Portrait' )
      {
        sHtml += '<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#C4D2DF">';
        sHtml += '  <tr>';
        sHtml += '    <td width="9px" height="9px"><img src="../images/spacer.gif" width="9" height="9" alt border="0"></td>';
        sHtml += '    <td width="159px"><img src="../images/spacer.gif" width="159" height="9" alt border="0"></td>';
        sHtml += '    <td width="9px"><img src="../images/spacer.gif" width="9" height="9" alt border="0"></td>';
        sHtml += '  </tr>';
        sHtml += '  <tr>';
        sHtml += '    <td></td>';
        sHtml += '    <td bgcolor="#5B83A7" align="center">';
        sHtml += '      <table width="159px" border="0" cellspacing="0" cellpadding="0" bgcolor="#5B83A7">';
        sHtml += '        <tr>';
        if ( sUser == 'Demo' )
          sHtml += '          <td><img src="../images/demo.gif" alt border="0" WIDTH="159" HEIGHT="87"></td>';
        else
          if ( sUser == 'Portrait' )
            sHtml += '          <td><img src="../images/portrait.gif" alt border="0" WIDTH="159" HEIGHT="87"></td>';
          else
            sHtml += '          <td><img src="../images/jubilee.gif" alt border="0" WIDTH="159" HEIGHT="87"></td>';
        sHtml += '        </tr>';
        sHtml += '      </table>';
        sHtml += '    </td>';
        sHtml += '    <td></td>';
        sHtml += '  </tr>';
        sHtml += '  <tr>';
        sHtml += '    <td></td>';
        sHtml += '    <td background="../images/hbglogin.gif">';
        sHtml += '      <table width="159px" border="0" cellspacing="0" cellpadding="0" background>';
        sHtml += '        <tr>';
        sHtml += '          <td height="1px" colspan="3" background="../images/hdotline.gif"><img src="../images/spacer.gif" width="1" height="1" alt border="0"></td>';
        sHtml += '        </tr>';
        sHtml += '        <tr>';
        sHtml += '          <td width="5px" height="5px"><img src="../images/spacer.gif" width="5" height="5" alt border="0"></td>';
        sHtml += '          <td width="149px"><img src="../images/spacer.gif" width="149" height="5" alt border="0"></td>';
        sHtml += '          <td width="5px"><img src="../images/spacer.gif" width="5" height="5" alt border="0"></td>';
        sHtml += '        </tr>';
        sHtml += '        <tr>';
        sHtml += '          <td height="12px"></td>';
        sHtml += '          <td class="txtsmall"><span id="adviceLink" name="adviceLink"><a class="aheader" href="#" onclick="window.open( \'https://www.nzz.ch/mynzz/bestellung\', \'mynzz\'); return false;"><strong>NZZ E-Paper abonnieren »</strong></a></span></td>';
        sHtml += '          <td height="12px"></td>';
        sHtml += '        </tr>';
        sHtml += '        <tr>';
        sHtml += '          <td width="5px" height="5px"><img src="../images/spacer.gif" width="5" height="5" alt border="0"></td>';
        sHtml += '          <td width="149px"><img src="../images/spacer.gif" width="149" height="5" alt border="0"></td>';
        sHtml += '          <td width="5px"><img src="../images/spacer.gif" width="5" height="5" alt border="0"></td>';
        sHtml += '        </tr>';
        sHtml += '        <tr>';
        sHtml += '          <td height="1px" colspan="3" background="../images/hdotline.gif"><img src="../images/spacer.gif" width="1" height="1" alt border="0"></td>';
        sHtml += '        </tr>';
        sHtml += '      </table>';
        sHtml += '    </td>';
        sHtml += '    <td></td>';
        sHtml += '  </tr>';
        sHtml += '  <tr>';
        sHtml += '    <td width="9px" height="5px"><img src="../images/spacer.gif" width="9" height="5" alt border="0"></td>';
        sHtml += '    <td width="159px" bgcolor="#336699"><img src="../images/spacer.gif" width="159" height="5" alt border="0"></td>';
        sHtml += '    <td width="9px"><img src="../images/spacer.gif" width="9" height="5" alt border="0"></td>';
        sHtml += '  </tr>';
        sHtml += '  <tr>';
        sHtml += '    <td></td>';
        sHtml += '    <td background="../images/bbglogin.gif">';
        sHtml += '      <table width="159px" border="0" cellspacing="0" cellpadding="0" background>';
        sHtml += '        <tr>';
        sHtml += '          <td height="1px" colspan="3" background="../images/dotline.gif"><img src="../images/spacer.gif" width="1" height="1" alt border="0"></td>';
        sHtml += '        </tr>';
        sHtml += '        <tr>';
        sHtml += '          <td width="5px" height="5px"><img src="../images/spacer.gif" width="5" height="5" alt border="0"></td>';
        sHtml += '          <td width="149px"><img src="../images/spacer.gif" width="149" height="5" alt border="0"></td>';
        sHtml += '          <td width="5px"><img src="../images/spacer.gif" width="5" height="5" alt border="0"></td>';
        sHtml += '        </tr>';
        sHtml += '        <tr>';
        sHtml += '          <td height="12px"></td>';
        sHtml += '          <td class="txtsmall"><span id="adviceLink" name="adviceLink"><a class="aheader" href="#" onclick="doLogout();"><strong>« zurück</strong></a></span></td>';
        sHtml += '          <td height="12px"></td>';
        sHtml += '        </tr>';
        sHtml += '        <tr>';
        sHtml += '          <td width="5px" height="5px"><img src="../images/spacer.gif" width="5" height="5" alt border="0"></td>';
        sHtml += '          <td width="149px"><img src="../images/spacer.gif" width="149" height="5" alt border="0"></td>';
        sHtml += '          <td width="5px"><img src="../images/spacer.gif" width="5" height="5" alt border="0"></td>';
        sHtml += '        </tr>';
        sHtml += '      </table>';
        sHtml += '    </td>';
        sHtml += '    <td></td>';
        sHtml += '  </tr>';
        sHtml += '  <tr>';
        sHtml += '    <td width="9px" height="9px"><img src="../images/spacer.gif" width="9" height="9" alt border="0"></td>';
        sHtml += '    <td width="159px" height="9px"><img src="../images/spacer.gif" width="159" height="9" alt border="0"></td>';
        sHtml += '    <td width="9px" height="9px"><img src="../images/spacer.gif" width="9" height="9" alt border="0"></td>';
        sHtml += '  </tr>';
        sHtml += '</table>';
      }
      else
      {
        sHtml += '<table width="177px" border="0" cellspacing="0" cellpadding="0">';
        sHtml += '  <tr>';
        sHtml += '    <td width="9px" height="9px"><img src="../images/spacer.gif" width="9" height="9" alt border="0"></td>';
        sHtml += '    <td width="159px"><img src="../images/spacer.gif" width="159" height="9" alt border="0"></td>';
        sHtml += '    <td width="9px"><img src="../images/spacer.gif" width="9" height="9" alt border="0"></td>';
        sHtml += '  </tr>';
        sHtml += '  <tr>';
        sHtml += '    <td></td>';
        sHtml += '    <td background="../images/dbglogin.gif">';
        sHtml += '      <table width="159px" border="0" cellspacing="0" cellpadding="0" background="">';
        sHtml += '        <tr bgcolor="#000000">';
        sHtml += '          <td width="5px" height="16"><img src="../images/spacer.gif" width="5px" height="1px" alt="" border="0"></td>';
        sHtml += '          <td width="149px" class="txtwhitetitle">NZZ LOGIN</td>';
        sHtml += '          <td width="5px"><img src="../images/spacer.gif" width="5px" height="1px" alt="" border="0"></td>';
        sHtml += '        </tr>';
        sHtml += '        <tr>';
        sHtml += '          <td height="14px" colspan="3"><img src="../images/spacer.gif" width=1 height=1 alt="" border="0"></td>';
        sHtml += '        </tr>';
        sHtml += '        <tr>';
        sHtml += '          <td></td>';
        sHtml += '          <td class="txtsmall">angemeldet als:</td>';
        sHtml += '          <td></td>';
        sHtml += '        </tr>';
        sHtml += '        <tr>';
        sHtml += '          <td height="6px" colspan="3"></td>';
        sHtml += '        </tr>';
        sHtml += '      </table>';
        sHtml += '    </td>';
        sHtml += '    <td></td>';
        sHtml += '  </tr>';
        sHtml += '  <tr>';
        sHtml += '    <td></td>';
        sHtml += '    <td background="../images/bbglogin.gif">';
        sHtml += '      <table width="159px" border="0" cellspacing="0" cellpadding="0" background="">';
        sHtml += '        <tr>';
        sHtml += '          <td height="1" colspan="3" background="../images/dotline.gif"><img src="../images/spacer.gif" width=1 height=1 alt="" border="0"></td>';
        sHtml += '        </tr>';
        sHtml += '        <tr>';
        sHtml += '          <td width="5px" height="1"><img src="../images/spacer.gif" width="5px" height=1 alt="" border="0"></td>';
        sHtml += '          <td width="149px"><img src="../images/spacer.gif" width="149px" height="1px" alt="" border="0"></td>';
        sHtml += '          <td width="5px"><img src="../images/spacer.gif" width="5px" height="1px" alt="" border="0"></td>';
        sHtml += '        </tr>';
        sHtml += '        <tr>';
        sHtml += '          <td height="22px"></td>';
        sHtml += '          <td class="txtsmall"><strong>' + sUser + '</strong></td>';
        sHtml += '          <td></td>';
        sHtml += '        </tr>';
        sHtml += '        <tr>';
        sHtml += '          <td height="1px" colspan="3" background="../images/dotline.gif"><img src="../images/spacer.gif" width=1 height=1 alt="" border="0"></td>';
        sHtml += '        </tr>';
        sHtml += '        <tr>';
        sHtml += '          <td height="5px" colspan="3" background="../images/dbglogin.gif"><img src="../images/spacer.gif" width=1 height=1 alt="" border="0"></td>';
        sHtml += '        </tr>';
        sHtml += '      </table>';
        sHtml += '    </td>';
        sHtml += '    <td></td>';
        sHtml += '  </tr>';
        sHtml += '  <tr>';
        sHtml += '    <td></td>';
        sHtml += '    <td background="../images/bbglogin.gif">';
        sHtml += '      <table width="159px" border="0" cellspacing="0" cellpadding="0" background="">';
        sHtml += '        <tr>';
        sHtml += '          <td height="1px" colspan="3" background="../images/dotline.gif"><img src="../images/spacer.gif" width=1 height=1 alt="" border="0"></td>';
        sHtml += '        </tr>';
        sHtml += '        <tr>';
        sHtml += '          <td width="5px" height="5px"><img src="../images/spacer.gif" width="5px" height="1px" alt="" border="0"></td>';
        sHtml += '          <td width="149px"><img src="../images/spacer.gif" width="149px" height="1px" alt="" border="0"></td>';
        sHtml += '          <td width="5px"><img src="../images/spacer.gif" width="5px" height="1px" alt="" border="0"></td>';
        sHtml += '        </tr>';
        sHtml += '        <tr>';
        sHtml += '          <td></td>';
        sHtml += '          <td class="txtsmall"><a class="aheader" href="#" onclick="if (getUser() != \'global\') window.open( \'https://www.nzz.ch/mynzz\', \'mynzz\'); return false;">MyNZZ</a></td>';
        sHtml += '          <td></td>';
        sHtml += '        </tr>';
        sHtml += '        <tr>';
        sHtml += '          <td></td>';
        sHtml += '          <td class="txtsmall"><a class="aheader" href="#" onclick="doLogout();">Log-out</a></td>';
        sHtml += '          <td></td>';
        sHtml += '        </tr>';
        sHtml += '        <tr>';
        sHtml += '          <td height="5px" colspan="3"></td>';
        sHtml += '        </tr>';
        sHtml += '      </table>';
        sHtml += '    </td>';
        sHtml += '    <td></td>';
        sHtml += '  </tr>';
        sHtml += '  <tr>';
        sHtml += '    <td width="9px" height="9px"><img src="../images/spacer.gif" width="9" height="9" alt border="0"></td>';
        sHtml += '    <td width="159px"><img src="../images/spacer.gif" width="159" height="9" alt border="0"></td>';
        sHtml += '    <td width="9px"><img src="../images/spacer.gif" width="9" height="9" alt border="0"></td>';
        sHtml += '  </tr>';
        sHtml += '</table>';
      }
      break;
    case 2:
      sHtml += '<form class="login" id="formlogin" name="formlogin" action="' + sRoot + 'nzz/forms/login.asp" target="load" method="post">';
      sHtml += '<table width="177px" border="0" cellspacing="0" cellpadding="0">';
      sHtml += '  <tr>';
      sHtml += '    <td width="9px" height="9px"><img src="../images/spacer.gif" width="9" height="9" alt border="0"></td>';
      sHtml += '    <td width="159px"><img src="../images/spacer.gif" width="159" height="9" alt border="0"></td>';
      sHtml += '    <td width="9px"><img src="../images/spacer.gif" width="9" height="9" alt border="0"></td>';
      sHtml += '  </tr>';
      sHtml += '  <tr>';
      sHtml += '    <td></td>';
      sHtml += '    <td background="../images/dbglogin.gif">';
      sHtml += '      <table width="159px" border="0" cellspacing="0" cellpadding="0" background="">';
      sHtml += '      <tr bgcolor="#000000">';
      sHtml += '        <td width="5px" height="16"><img src="../images/spacer.gif" width="5px" height="1px" alt="" border="0"></td>';
      sHtml += '        <td width="149px" class="txtwhitetitle">NZZ LOGIN</td>';
      sHtml += '        <td width="5px"><img src="../images/spacer.gif" width="5px" height="1px" alt="" border="0"></td>';
      sHtml += '      </tr>';
      sHtml += '      <tr>';
      sHtml += '          <td height="4px" colspan="3"></td>';
      sHtml += '      </tr>';
//      sHtml += '      <tr>';
//      sHtml += '        <td></td>';
//      sHtml += '        <td class="txtsmall">Username</td>';
//      sHtml += '        <td></td>';
//      sHtml += '      </tr>';
//      sHtml += '      <tr>';
//      sHtml += '        <td></td>';
//      sHtml += '        <td><input type="text" id="User" name="User" size="14" style="width: 122px;" class="input" value="' + sUser + '"></td>';
//      sHtml += '        <td></td>';
//      sHtml += '      </tr>';
//      sHtml += '      <tr>';
//      sHtml += '        <td height="4px" colspan="3"></td>';
//      sHtml += '      </tr>';
//      sHtml += '      <tr>';
//      sHtml += '        <td></td>';
//      sHtml += '        <td class="txtsmall">Passwort</td>';
//      sHtml += '        <td></td>';
//      sHtml += '      </tr>';
//      sHtml += '      <tr>';
//      sHtml += '        <td></td>';
//      sHtml += '        <td><input type="password" name="Password" size="14" style="width: 122px;" class="input">&nbsp;&nbsp;<img src="../images/login.gif" width=13 height=13 border=0 alt="" onclick="doLogin()"></td>';
//      sHtml += '        <td></td>';
//      sHtml += '      </tr>';
      sHtml += '      <tr>';
      sHtml += '        <td></td>';
      sHtml += '        <td class="txtsmall">Bitte klicken Sie auf \'Login\', und melden Sie sich mit Ihrem Usernamen an.</td>';
      sHtml += '        <td></td>';
      sHtml += '      </tr>';
      sHtml += '        <tr>';
      sHtml += '          <td></td>';
      sHtml += '          <td class="txtsmall" align="right" valign="middle"><a class="aheader" href="#" onclick="doLogin(); return false;">LOGIN</a>&nbsp;&nbsp;<img src="../images/login.gif" width=13 height=13 border=0 alt="" onclick="doLogin()"></td>';
      sHtml += '          <td></td>';
      sHtml += '        </tr>';
      sHtml += '      <tr>';
      sHtml += '        <td height="4px" colspan="3"></td>';
      sHtml += '      </tr>';
      sHtml += '      <tr>';
      sHtml += '        <td height="4px" colspan="3"></td>';
      sHtml += '      </tr>';
      sHtml += '      </table>';
      sHtml += '    </td>';
      sHtml += '    <td></td>';
      sHtml += '  </tr>';
      if ( sError != '' )
      {
        sHtml += '  <tr>';
        sHtml += '    <td></td>';
        sHtml += '    <td height="1px" background="../images/dotline.gif"><img src="../images/spacer.gif" width=1 height=1 alt="" border="0"></td>';
        sHtml += '    <td></td>';
        sHtml += '  </tr>';
        sHtml += '  <tr>';
        sHtml += '    <td></td>';
        sHtml += '    <td class="txterror">';
        sHtml += sError;
        sHtml += '    </td>';
        sHtml += '    <td></td>';
        sHtml += '  </tr>';
      }  
      sHtml += '  <tr>';
      sHtml += '    <td></td>';
      sHtml += '    <td background="../images/bbglogin.gif">';
      sHtml += '      <table width="159px" border="0" cellspacing="0" cellpadding="0" background="">';
      sHtml += '        <tr>';
      sHtml += '          <td height="1px" colspan="3" background="../images/dotline.gif"><img src="../images/spacer.gif" width=1 height=1 alt="" border="0"></td>';
      sHtml += '        </tr>';
      sHtml += '        <tr>';
      sHtml += '          <td width="5px" height="5px"><img src="../images/spacer.gif" width="5px" height="1px" alt="" border="0"></td>';
      sHtml += '          <td width="149px"><img src="../images/spacer.gif" width="149px" height="1px" alt="" border="0"></td>';
      sHtml += '          <td width="5px"><img src="../images/spacer.gif" width="5px" height="1px" alt="" border="0"></td>';
      sHtml += '        </tr>';
      sHtml += '        <tr>';
      sHtml += '          <td></td>';
      sHtml += '          <td class="txtsmall"><a class="aheader" href="#" onclick="window.open( \'https://www.nzz.ch/mynzz\', \'mynzz\'); return false;">Neuanmeldung</a></td>';
      sHtml += '          <td></td>';
      sHtml += '        </tr>';
      sHtml += '        <tr>';
      sHtml += '          <td></td>';
      sHtml += '          <td class="txtsmall"><a class="aheader" href="#" onclick="window.open( \'https://www.nzz.ch/mynzz\', \'mynzz\' ); return false;">Passwort vergessen?</a></td>';
      sHtml += '          <td></td>';
      sHtml += '        </tr>';
      sHtml += '        <tr>';
      sHtml += '          <td height="5px" colspan="3"></td>';
      sHtml += '        </tr>';
      sHtml += '      </table>';
      sHtml += '    </td>';
      sHtml += '    <td></td>';
      sHtml += '  </tr>';
      sHtml += '  <tr>';
      sHtml += '    <td width="9px" height="9px"><img src="../images/spacer.gif" width="9" height="9" alt border="0"></td>';
      sHtml += '    <td width="159px"><img src="../images/spacer.gif" width="159" height="9" alt border="0"></td>';
      sHtml += '    <td width="9px"><img src="../images/spacer.gif" width="9" height="9" alt border="0"></td>';
      sHtml += '  </tr>';
      sHtml += '</table>';
      sHtml += '</form>';
      break;
  }
  deleteCode( 'login' );
  insertCode( 'login', sHtml );
}

function doLogin()
{
  //top.location.href = 'http://www.nzzlogin.ch/private/login.cgi?url=' + sBase + sRoot + 'nzz.asp';
  //top.location.href = sBase + sRoot + 'nzz.asp?ticket=testlogin';
//  var loginurl = 'https://prestaging.nzz.ch/mynzz/login?service=' + escape( sBase + sRoot + 'nzz.asp'); 
//  var loginurl = 'https://cas.nzz.ch/cas/login?service=' + escape( sBase + sRoot + 'nzz.asp') + '&gateway=true&cas=1'; 
  var loginurl = 'https://cas.nzz.ch/cas/login?service=' + escape( 'http://www.nzzglobal.ch/nzz.asp') + '&gateway=true&cas=1'; 
// alert(loginurl);
  top.location.href = loginurl;
/*
  var el;
  
  doWait();
  iAdvice = 0;
  displayElement( 'lock', false );
  displayElement( 'advice', false );
  el = getElement( 'formlogin' );
  el.submit();
 */
}

function doLogout()
{
//  parent.load.location.href = 'https://www.nzzlogin.ch/private/logout.cgi?url=' + sBase + sRoot + 'nzz/forms/logout.asp';
  var logouturl = sBase + sRoot + 'nzz/forms/logout.asp';
  top.location.href = logouturl;
/*
  setUser( '' );
  setAllowedEditions( '' );
  setError( '' );
  setStartEPaper( '' );
  startEPaper( 2 );
*/  
}

function showNoLogin()
{
  var ePopup;
  var el;
  var iNum;
  var sHtmlLinks;
  var sHtmlText;
  var ch;
  var cw;
  var h;
  var w;
  var x;
  var y;
  var cx;
  var mw;
  var mh;
  
  undoWait();
  if ( bConfiguration )
    return;
  hideNoLogin();
  cx = 0;
  if ( ie && bNavProtect )
  {
    el = getElement( 'navigator' );
    cx = getWidth( el );
  }  
  ch = getClientHeight();
  cw = getClientWidth();
  mw = cw;
  mh = ch;
  ePopup = getElement( 'lock' );
  w = getWidth( ePopup );
  h = getHeight( ePopup );
  x = mouseX - w / 2 - poX;
  y = mouseY - h - poY;
  if ( x + w > mw )
    x = mw - w - ( ie ? 0 : 2 );
  if ( x < cx )
    x = cx;
  if ( y + h > mh )
    y = mh - h - ( ie ? 0 : 2 );
  if ( y < 0 )
    y = 0;
  setLeft( ePopup, x + poX );
  setTop( ePopup, y + poY );
  if ( !ie )
    setVisible( ePopup, false );
  setVisible( ePopup, true );
  if ( oTimer != null )
    clearTimeout( oTimer );   
  oTimer = setTimeout( 'hideNoLogin();', 20000 );
}

function hideNoLogin()
{
  displayElement( 'lock', false );
  if ( oTimer != null )
    clearTimeout( oTimer );   
  oTimer = null;
}

function doDemo()
{
  iAdvice = 0;
  displayElement( 'lock', false );
  displayElement( 'advice', false );
  setUser( 'Demo' );
  setError( '' );
  setAllowedEditions( '' );
  setLastCommand( '' );
  if ( parent.getDemoUrl )
    setStartEPaper( parent.getDemoUrl() );
  startEPaper( 1 );
}

function doSpecialEdition( sUser )
{
  iAdvice = 0;
  displayElement( 'lock', false );
  displayElement( 'advice', false );
  setUser( sUser );
  setError( '' );
  setAllowedEditions( '' );
  setLastCommand( '' );
  if ( sUser == 'Jubilee' )
    setStartEPaper( '/EPaper/nzz/forms/jubilee.htm' );
  else
    setStartEPaper( '/EPaper/nzz/forms/portrait.htm' );
  startEPaper( 1 );
}

function checkLogin( action )
{
  return true;		
}


