/* encoding=utf-8; eol=lf; */
var mcp,mmp,mb=0;
$(document).ready(function(){
  var lpv='версия для печати';
  if (lng=='en'){
    lpv='the version for the print';
  }else if(lng=='kk'){
    lpv='басып шығару';
  }
  $('#sb-left div.block-menu li.active-trail > a').css({'color':'#fff','background':'#17b'});
  $('#sb-left div.block-menu li li.active-trail > a').css({'color':'#000','background':'#bef'});
  $('#sb-left div.block-menu div > ul > li > a').click(function(){
    $('#sb-left div.block-menu div > ul > li > a').css({'color':'#036','background':'#9df'});
    $('#sb-left div.block-menu div > ul > li > ul').slideUp('slow');
    $(this).css({'color':'#fff','background':'#17b'}).next().stop().slideDown('fast');
    if ($(this).parent().hasClass('expanded')) return false;
  });
  $('#bottom').append('<li><a href="#mpv" onclick="return mpv()">'+lpv+'</a></li>');
  
  $('#marquee').css({'white-space':'nowrap','overflow':'hidden'}).mouseover(function(){mb=1}).mouseout(function(){mb=0});
  $('#marquee>span').css({'display':'block','float':'left'});
  mcp=parseInt($('#marquee').css('width'));
  mmp=parseInt($('#marquee>span').css('width'))*-1;
  marquee();
});
function mpv(){
  wpv=open("");
  wpv.document.open();
  wpv.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'+
  '<html xmlns="http://www.w3.org/1999/xhtml" lang="'+lng+'" xml:lang="'+lng+'" dir="ltr">'+
  '<head><title>'+$('#content h1.title').html()+'</title>'+
  '<script type="text/javascript" src="/misc/jquery.js"></script>'+
  '</head><body style="background:#fff;color:#000;"><div>'+
  '<h1>'+$('#content h1.title').html()+'</h1>'+
  '<div>'+$('#body div.content').html()+'</div>'+
  '<script type="text/javascript">'+
  '$("a").attr("onclick","return false");'+
  '$("img").css("display","block");'+
  '</script>'+
  '<br /><div><small><em>'+$('#copy').html()+'</em></small></div>'+
  '</div></body></html>'  );
  wpv.document.close();
  return false;
}
function marquee(){
  setTimeout(marquee,50);
  if(mb)return 0;
  mcp--;
  if(mcp<mmp)mcp=parseInt($('#marquee').css('width'));
  $('#marquee>span').css('margin-left',mcp);
}

