var ns = (navigator.appName.indexOf("Netscape") != -1) || window.opera;
var scrolly=0;
function mb_scroll() {
  if (document.documentElement && !document.documentElement.scrollTop) {
    scrolly = 0;
  } else if (document.documentElement && document.documentElement.scrollTop) {
    scrolly = document.documentElement.scrollTop;
  } else if (document.body && document.body.scrollTop) {
    scrolly = document.body.scrollTop;
    
  }
  
  mb_move();    
}

window.onscroll = mb_scroll; 

function ge(id) {return document.getElementById(id);}

function mb_float(id) { //Przesuwa baner w pionie
  var off=OFF[id];
  var pos=1
  if(scrolly>POS[id]+TOP[id]) {
    POS[id] = POS[id]+pos;
  } else if(scrolly<POS[id]+TOP[id] && POS[id]>OFF[id]) {
    POS[id] = POS[id]-pos;
  }
  
  ge(id).style.top = POS[id]+"px";

  if(scroll!=POS[id]) {
    func = "mb_float('"+id+"')";
    a=window.setTimeout(func,5);
  }
}
function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}


function mb_float_foot(id) { //Przesuwa baner w pionie przy dole strony
  var off = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight;
//  alert(ge(id).offsetHeight);
  off -= 5+ge(id).offsetHeight;
  ge(id).style.top = off+"px";
}

function mb_over_hide(id) {
  ge(id).style.display='none';
}

function mb_over(id, off) { //ukrywa obiekt z opóźnieniem
  func = "mb_over_hide('"+id+"')";
  a=window.setTimeout(func,off*100);
}

