/* Pages */

    page   = 0;
    mcount = 300;
    pcount = 0;

    function pages() {

          this.set_page = function (num) {
            page = num-1;
            return ;
          }
          this.hide_pages = function () {
              for (i=0; i<mcount; i++) {
                  if (get_elem('page_'+i)) {
                      get_elem('page_'+i).style.display='none';
                      pcount++;
                  }
              }
          }
          this.show_page = function () {
              if (get_elem('page_'+page)) {
                  get_elem('page_'+page).style.display='block';
              }
          }
    }

    function set_page(p) {
          ppp=new pages();
          ppp.set_page(p);
          ppp.hide_pages();
          ppp.show_page();
          show_pps(p);
window.scroll(0,0);
          return ;
    }

    function get_pcount() {
        return pcount;
    }

    function show_pps(p_inp) {
        /* hide */

        for (i=0; i<pcount; i++) {
            if (get_elem('pp_'+i))
               get_elem('pp_'+i).className='';
        }

        /* show */
        if (get_elem('pp_'+p_inp)) {
            get_elem('pp_'+p_inp).className='pp_act';
        }
    }

    function build_pages() {
        document.write("<div class=\"pages_foot\">");
        //document.write("страницы<br><br>");
        for (i=1; i<pcount+1; i++) {
            document.write("<a id='pp_"+i+"' href=\"javascript:set_page("+i+");\">"+i+"</a>");
            if (i!=pcount) {
                document.write(" / ");
            }
        }
        document.write("&nbsp;&gt;&gt;");
        show_pps(page+1);
        document.write("</div>");
    }

/* --- */