{literal}
<script type="text/javascript">
function pridajK(id){
var myConn = new XHConn();
if (!myConn){
alert('ajax v pici');
}
var fnWhenDone = function (oXML) { 
                          var response = oXML.responseText;
                          if(response.indexOf("datanode uz si k udelil. uz to nehul") > 0 ){
                                  /* 
                                  var err = 'datanode uz si k udelil. uz to nehul';
                                  document.getElementById('error_msg').innerHTML = err;
                                  document.getElementById('error_msg').className = 'error_on';
                                  // div id="error_msg" v headry
                                  */
                                  alert('nehul');
                          }else if(response.indexOf("ERROR") > 0 ){
                          
                          }else{
                                  var Knum = {/literal}{$node.k}{literal} + 1;
                                  document.getElementById('KKount').innerHTML = Knum + " K";
                          }
                  }
myConn.connect("/id/"+id+"/", "POST", "event=K", fnWhenDone);
}
</script>
{/literal}


<div id='sidebar'>
  <ul id='sidebar_info'>
    <li>
      <img src='{get_image_link id=$node.node_id}' id='sidebar_image' alt='node image'/>
    </li>
    
    <li id='sidebar_node'>
        node:
      <a href='/id/{$node.node_id}'>
        {$node.node_name|strip_tags|wordwrap:40:"<br/>":true}
      </a>
    </li>

    <li id='sidebar_template'>
        template:
      <a href='/id/{$node.template_id}'>
        {$node.template_id}
      </a>
    </li>
  
    <li id='sidebar_parent'>
        parent:
      <a href='/id/{$node.node_parent}'>
        {$node.node_parent_name|strip_tags|wordwrap:40:"<br/>":true}
      </a>
    </li>
    
    <li id='sidebar_owner'>
        owner:
      <a href='/id/{$node.node_creator}'>
        {$node.owner|strip_tags|wordwrap:40:"<br/>":true}
      </a>
    </li>
  </ul>

  {* cwbe *}

<!-- welcome to da hyperspace -->
<div id='sidebar_coord'>
    <h2 id='sidebar_coord_cwbe'>cwbe coordinatez:</h2>
    {$node.node_created|date_format:"%d.%m.%Y - %H:%M:%S"}
    <ol id='sidebar_ancestors'>
    {foreach from=$node.ancestors item=ancestor}
        <li class='sidebar_ancestornode'>
<a href='/id/{$ancestor.link}'>{$ancestor.name|stripslashes|escape:'html'}</a></li>
    {/foreach}
    <span style='sidebar_absolut'>ABSOLUT <a href='/id/{$node.node_id}/15'>K</a>YBERIA</span>
</div>



<!-- hyperspace ain't left for now -->
{* cwbe *}

  <ul id='sidebar_pemissions'>
    <li>
    <h2 id='sidebar_permtitle'>
      permissions
    </h2></li>
    
    <li id='sidebar_permyou'>
      you:
    
    <span id='sidebar_permyourw'>
        {if $permissions.r}r,{/if}
        {if $permissions.w}w,{/if}
        {$node.node_permission}
    </span>
    </li>
    
    <li id='sidebar_permsystem'>
      system:
    <span id='sidebar_permsystemaccess'>
      {$node.node_system_access}
    </span>
    </li>
   
    <li id='sidebar_permnet'>
      net:
    <span id='sidebar_permnetaccess'>
      {$node.node_external_access}
    </span>
    </li>
  </ul>

  <ul id='sidebar_templates'>
    <li id='sidebar_neurons'><a href='/id/{$node.node_id}/1961036'>neurons</a></li>
    <li><ul id='sidebar_statstemplates'>
      <li id='sidebar_stats'><a href='/id/{$node.node_id}/1961037'>stats</a></li>
      <li id='sidebar_byvisit'><a href='/id/{$node.node_id}/748131'>by_visit</a></li>
      <li id='sidebar_byK'><a href='/id/{$node.node_id}/1908499'>by_K</a></li>
    </ul></li>
    <!-- <li id='sidebar_offtopic'><a href='/id/{$node.node_id}/offtopic'>offtopic</a></li> -->
    <li id='sidebar_source'><a href='/id/{$node.node_id}/14'>source</a></li>
    <!-- <li id='sidebar_tiamat'><a href='/id/{$node.node_id}/30'>tiamat</a></li> -->
    <!-- <li id='sidebar_links'><a href='/id/{$node.node_id}/links'>links</a></li> -->
    <!-- <li id='sidebar_print'><a href='/id/{$node.node_id}/print'>print</a></li> -->
      {if $node.node_children_count neq 0}
    <li id='sidebar_byk'><a href='/id/{$node.node_id}/15'>k</a></li>
    <li id='sidebar_last'><a href='/id/{$node.node_id}/23'>last</a></li>
      {/if}
    <li id='sidebar_commanders'><a href='/id/{$node.node_id}/2224463'>commanders</a></li>
    <li id='sidebar_polls'><a href='/id/{$node.node_id}/1549314'>polls</a></li>
  </ul>

  <ul class='sidebar_nodeinfo2'>
    <li id='sidebar_viewed'>node viewed {$node.node_views} times</li>
    <li id='sidebar_desccount'>total descendants::{$node.node_descendant_count}</li>
    <li id='sidebar_children'>total children::{$node.node_children_count}</li>
  </ul>

	{if $node.node_user_subchild_count neq false or $node.k neq false or $offset neq false}
  <ul class='sidebar_NEWandKandoffset'> 
    {if $node.node_user_subchild_count neq false}
      <li id='sidebar_newsubcount'>{$node.node_user_subchild_count} NEW</li>
    {/if}
    {if $node.k neq false}
      <li id='sidbar_kcount'>{$node.k} K</li>
    {/if}
    {if $offset neq false}
      <li id='sidebar_offsetcount'>using offset:: {$offset} </li>
    {/if}
  </ul>
  {/if}

    <span id='sidebar_giveajaxK' onclick='pridajK({$node.node_id});' style='cursor: pointer;color:white;'>K</span>

  <form action='/id/{$node.node_id}/' method='post'>
  <noscript>
     <input id='sidebar_givenormk' type='submit' name='event' value='K' class='eventK' />
  </noscript>
     {* user relation buttons *}{include file='1022348.tpl'}
  </form>

  {if $node.node_creator eq $user_id or $node.node_permission eq 'master' or $node.node_permission eq 'op'}
    <span id='sidebar_configure'><a href='/id/{$node.node_id}/1961033'>configure</a></span>
  {/if}
  <span id='sidebar_show23flat'>show
  <a id='sidebar_show2' href='/id/{$node.node_id}/2'>2</a>
  <a id='sidebar_show3' href='/id/{$node.node_id}/3'>3</a>
  <a id='sidebar_showflat' href='/id/{$node.node_id}/3755160'>flat</a>
  </span>


  {if $node.external_link eq 'db://user' or $node.external_link eq 'session://user' or $node.template_id eq 7}
  <ul id='sidebar_user'>
    <li id='sidebar_userbookmarks'><a href='/id/{$node.node_id}/1970182'>bookmarks</a></li>
    <li id='sidebar_usermovement'><a href='/id/{$node.node_id}/1911535'>movement</a></li>
    <li id='sidebar_usernodeshells'><a href='/id/{$node.node_id}/1757900'>nodeshells</a></li>
    <li id='sidebar_userforums'><a href='/id/{$node.node_id}/1761254'>forums</a></li>
    <li id='sidebar_usersubmissions'><a href='/id/{$node.node_id}/1573668'>submissions</a>{if $node.node_id eq $user_id}
                                     <a id='sidebar_usersubmissionsre' href="/id/1522695">re</a>{/if}</li>
    <li id='sidebar_userarticles'><a href='/id/{$node.node_id}/1773535'>articles</a></li>
    <li id='sidebar_userblogs'><a href='/id/{$node.node_id}/1757556'>blogs</a></li>
    <li id='sidebar_userdatas'><a href='/id/{$node.node_id}/1757626'>datas</a></li>
    <li id='sidebar_userK'><a href='/id/{$node.node_id}/1752584'>K</a></li>
    <li id='sidebar_userfriends'><a href='/id/{$node.node_id}/1769388'>friends</a></li>
  </ul> 
{/if}
</div>