  var c;
  var s;
  var cw;
  var pos = -500;
  var speed = 100;
  var scroller_stopped = false;
  var tw;
  var currentPage = false;
  function scrollRight() {
    if (!scroller_stopped) {
      pos--;
      if (pos < -tw) pos = 0;
      s.style.left = pos + 'px';
      scrollTimer = setTimeout ("scrollRight()",speed);
    }
  }

  function scrollLeft() {
    pos++;
    s.style.left = pos + 'px';
    scrollTimer = setTimeout ("scrollLeft()",speed);
  }

  function sLeft() {
    scrollLeft();
  }

  function sRight() {
    po1 = document.getElementById('pop');
    scrollRight();
  }
  
  function scrollStop() {
    clearTimeout(scrollTimer);
    //alert('STOP');
  }

  function initScroller(totalWidth) {
    c = document.getElementById('scroller_content');
    s = document.getElementById('scroller');
    r = document.getElementById('container');
    tw = totalWidth;
    s.innerHTML = c.innerHTML;
    cw = c.offsetWidth;
  }

  function doClose(p) {
    bt = document.getElementById('bt' + p + 'a');
    bt.className = 'bt';
    bt = document.getElementById('bt' + p + 'b');
    bt.className = 'bt';
    hidePop(p);
  }
  
  function hidePop(p) {
    po1.className = 'hide';
    men = document.getElementById('menuHider');
    s.innerHTML = c.innerHTML;
    scroller_stopped = false;
    sRight();
    men.className = 'hide';
    //alert('done');
  }

  
  function doPop(p,ppos,lang) {
    scroller_stopped = p;
    currentPage = p;
    //bt = document.getElementById('bt' + p + 'a');
    //if (!bt) bt = document.getElementById('bt' + p + 'b');
    //bt.className = 'bt';
    ajax('template/pop.php?p=' + p + '&lang=' + lang,'pop');
    po1 = document.getElementById('pop');
    po1.className = 'show';
    men = document.getElementById('menuHider');
    men.className = 'show';
    new_pos = 470 - ppos;
    if (new_pos > 0) new_pos = new_pos - tw;
    s.style.left = new_pos + 'px';
    pos = new_pos;
    foo = document.getElementById('footer');
    //document.menuForm.submit();
  }
