<script>
    var pdfDoc = null,
        pageNum = <?=$pagenum?>,
        category = <?=$category?>,
        baseurl ='<?=$baseurl?>',
        url = '<?=$pdfile?>', 
        pageRendering = false,
        pageNumPending = null,
        nexturl = '<?=$nexturl?>',
        newcurr ='<?=$newcurr?>',
        prevurl = '<?=$prevurl?>';       
</script>

    <p id="downloadtitle">
        <?if ($promo):?>
          <a href="https://argumenti.ru/robomail/486?utm_source=argumenti.ru&utm_medium=subscript&utm_campaign=promo">Получайте «Газету на @email»</a> 
        <?else:?>  
          <?if ($filedown):?>
            <a href="<?=$fullpdf?>"><?=$downtitle?></a><span id="downarrow">↑</span> 
          <?endif?>
          <span id="downarrow">Приятного чтения ↓</span>
        <?endif?>  
    </p>

<div id="stuff-bar">
<div id="zoomnav">
  <div id="title_minus" onclick="resize_minus()">
    <span><i class="fas fa-search-minus"></i></span>
  </div>

  <div id="zoomstatus_up" class="zoomstatus">100%</div>

  <div id="title_plus" onclick="resize_plus()">
    <span><i class="fas fa-search-plus"></i></span>
  </div>

</div>

<div id="pagenav">
            
            <?if (isset($prevurl)):?>
            <div class="firstpage">
              <a href="<?=$baseurl?>1">
                <i class="fas fa-angle-double-left"></i>
              </a>
            </div>
              <div class="navpage"><a href="<?=$prevurl?>"><i class="fas fa-chevron-circle-left"></i></a></div>
            <?endif?>


            <div id="currpage">
              <select id="pages" onchange="changepage()">
                  <?for ($i = 1; $i <= $count; $i++):?>
                    <?$selected = ($page == $i) ? ' selected' : ''?>
                     <option value="<?=$i?>"<?=$selected?>><?=$i?></option>
                  <?endfor?> 
              </select>
              <i class="fas fa-chevron-down"></i>
            </div>
            
            <?if (isset($nexturl)):?>
              <div class="navpage"><a href="<?=$nexturl?>"><i class="fas fa-chevron-circle-right"></i></a></div>
              <?if (isset($endurl)):?>
                <div class="navpage"><a href="<?=$endurl?>"><i class="fas fa-angle-double-right"></i></a></div>
              <?endif?>
            <?endif?>
            
           
</div>
</div>

<div id="pdfprogress">Идет обращение к серверу...</div>

<canvas id="the-canvas">
</canvas>
<script>startpdfviewer(newcurr);</script>
<div id="stuff-bar">
<div id="zoomnav">
  <div id="title_minus" onclick="resize_minus()"> 
    <span><i class="fas fa-search-minus"></i></span>
  </div>

  <div id="title_plus" onclick="resize_plus()">
    <span><i class="fas fa-search-plus"></i></span>
  </div>

</div>

<div id="pagenav">
  <?if (isset($prevurl)):?>
    <div class="navpage"><a href="<?=$prevurl?>"><i class="fas fa-chevron-circle-left"></i></a></div>
  <?endif?>
    <div id="currpage"><?=$page?></div>
  <?if (isset($nexturl)):?>
    <div class="navpage"><a href="<?=$nexturl?>"><i class="fas fa-chevron-circle-right"></i></a></div>
  <?endif?>  
</div>
</div>


