
var scr_timer;
var speed = 7;

function go() {
 if ( document.getElementById("inner") )
     document.getElementById("inner").onmousedown = cncl;
     
 if ( document.getElementById("inner_promo") )
     document.getElementById("inner_promo").onmousedown = cncl;
}

function scr_start(m) {
  scr_timer = setTimeout("scr_dn("+m+")", 20);
}

function scr_stop() {
  clearTimeout(scr_timer);
}

function cncl() {
 // cncl(e)
 //  e.preventDefault();
 return false;
}

function scr_dn(m) {
  var a;
  var b;
  
  if ( (m == 1) || (m == 2) ) {
     b = document.getElementById("inner");
     a = document.getElementById("outer");
  } else {
     b = document.getElementById("inner_promo");
     a = document.getElementById("outer_promo");
  }
  
  if (isNaN(parseInt(b.style.top))) b.style.top = 0;

  if ( (m == 1) || (m == 3) )  {
    if ( (-parseInt(b.style.top))+ a.offsetHeight <  b.offsetHeight) {
      b.style.top = parseInt(b.style.top) - speed;
    }
    else {
      b.style.top = - b.offsetHeight + a.offsetHeight;
    }
  }
  
  else {
    if (parseInt(b.style.top) < 0) {
      b.style.top = parseInt(b.style.top) + speed;
    }
    else {
      b.style.top = 0;
    }
  }
  
  scr_timer = setTimeout("scr_dn("+m+")", 20);
}


