/*
Project: LiveInternet - Top panel links
Author:   A.Timofeev / Re.Active (www.reactant.ru)
Version:  17 Oct 2007
 */
 

/* -----------| Повторяющиеся блоки |----------- */ 
  /* - Стандартный блок - */
    function tplanel_stand(type,id)  
    {
      if (type=="opn")
      {
        document.write('<div id="'+id+'">');
          document.write('<p>');
      }
      if (type=="cls")
      {
          document.write('</p>');
        document.write('</div>');                
      }
    }
  /* - Инфоблок - */
    function tplanel_info()  
    {
      tplanel_stand ('opn','GlHdrNavMnuInfo');
          document.write('LiveInternet приглашает на <a href="http://www.liveinternet.ru/community/moscow/post54139431/">съемки шоу "Только ночью" канала ТВЦ</a>');
      tplanel_stand ('cls','');
    }
  /* - Вкладки - */
    function tplanel_tabs(id,name,url)
    {
      document.write('<li id="'+id+'">'+name+'<strong><span><em><a href="'+url+'">'+name+'</a></em></span></strong></li>');
    }
  /* - Форма авторизации - */  
    function tplanel_aform(id_show)
    {  
      document.write('<form id="GlHdrNavMnuForm" style="display:none;" onKeyDown="checkKey(\'GlHdrNavMnuForm\');" action="/member.php" method="post" name="aut">');
        tplanel_stand ('opn','GlHdrNavMnuLogin');
          document.write('<b>Логин:</b> <b>Пароль:</b>');
        tplanel_stand ('cls','');
        tplanel_stand ('opn','GlHdrNavMnuInputs');
          document.write('<input type="text" name="username" tabindex="1" /><input  type="password" name="password" tabindex="2" />');  
          document.write('<span><strong><a href="javascript:void(0);" onClick="document.forms[\'GlHdrNavMnuForm\'].submit();">войти</a></strong>, <a href="javascript:void(0);" onClick="show_div(\''+id_show+'\',\'GlHdrNavMnuForm\');">вернуться</a></span>');
        tplanel_stand ('cls','');
        var strurl='http://www.liveinternet.ru';
        document.write('<input type="hidden" name="s" value="" /><input type="hidden" name="url" value="'+strurl+'" /><input type="hidden" name="action" value="login" /><input type="submit" style="display:none;" />');        
      document.write('</form>');
    }  


/* -----------| Вывод блоков |----------- */
  /* - Пользователь авторизован - */  
    if (auth==1)
    {
      document.write('<div id="GlHdrNavMnuAut">');
        /* - Контролы пользователя - */  
          tplanel_stand ('opn','GlHdrNavMnuLogin');
            document.write('Вы – <a href="'+jurl+'profile/"><b>'+username+'</b></a> <span>(<a href="javascript:void(0);" onClick="show_div(\'GlHdrNavMnuForm\',\'GlHdrNavMnuAut\');">сменить</a>, <a href="/journals.php?s=&action1=login">выйти</a>)</span>');
          tplanel_stand ('cls','');
        /* - Вкладки - */
          document.write('<ul id="GlHdrNavMnuTabs">');
            tplanel_tabs('GlHdrNavMnuFrn','Друзья',''+jurl+'friends/');
            tplanel_tabs('GlHdrNavMnuBlog','В дневник',''+jurl+'');
            tplanel_tabs('GlHdrNavMnuPost','Написать','/journal_post.php?journalid='+bbuserid+'');
            tplanel_tabs('GlHdrNavMnuSett','Настройки','/journal_settings.php?journalid='+bbuserid+'');
            tplanel_tabs('GlHdrNavMnuComm','Комментарии',''+jurl+'comments/');
            tplanel_tabs('GlHdrNavMnuPri','Приват','/im.php');
          document.write('</ul>');
      document.write('</div>');
      tplanel_aform ('GlHdrNavMnuAut');
    }
  /* - Пользователь не авторизован - */  
    else
    {
      document.write('<div id="GlHdrNavMnuNoaut">');
        /* - Просим авторизоваться - */  
          tplanel_stand ('opn','GlHdrNavMnuLogin');
            document.write('<a id="GlHdrNavMnuLoginLgn" href="javascript:void(0);" onClick="show_div(\'GlHdrNavMnuForm\',\'GlHdrNavMnuNoaut\');">Вход</a> / <a id="GlHdrNavMnuLoginReg" href="http://www.liveinternet.ru/journal_register.php">Регистрация</a>&nbsp;&nbsp;Найти своихз знакомых: <a href="http://www.liveinternet.ru/importmail.php?cmd=getbook&squery=">по переписке</a>, <a href=http://www.liveinternet.ru/importmail.php?cmd=icq>из контактов ICQ</a> <span><a href="http://www.liveinternet.ru/member.php">Напоминание пароля</a></span>');
          tplanel_stand ('cls','');
      document.write('</div>');
      tplanel_aform ('GlHdrNavMnuNoaut');
    }