

  function nsBrowFix(){
    if(pageWidth!=innerWidth || pageHeight!=innerHeight){
      location.reload()
    }
  }


  if(document.layers) {
    pageWidth=innerWidth
    pageHeight=innerHeight
    window.onresize=nsBrowFix
  }

  var n = navigator;
  var d = document;
  var speed = 30;
  var agent = n.userAgent.toLowerCase();
  var tid, b;

  var sniff = {
    bw: {
      ns:d.layers,
      ie:d.all && !d.getElementById,
      ie4:agent.indexOf("msie 4.") != -1,
      ie5:agent.indexOf("msie 5.") != -1,
      ie6:agent.indexOf("msie 6.") != -1,
      dom:d.getElementById,
      ns6:d.getElementById && agent.indexOf("gecko") != -1
    },
    os: {
      win:agent.indexOf("win") != -1,
      mac:agent.indexOf("mac") != -1
    }
  };

  var distance = (sniff.os.mac && sniff.bw.ns6 || sniff.os.win && sniff.bw.ie4) ? 5 : (sniff.os.mac && sniff.bw.ns) ? 6 : 4;

  function createScrollerObj(lyr1, lyr2) {
    this.container = {
    obj:(sniff.bw.ns)?d[lyr1]:sniff.bw.ie?d.all[lyr1]:d.getElementById
    (lyr1),
    css:(sniff.bw.ns)?d[lyr1]:sniff.bw.ie?d.all[lyr1].style:d.getElementById
    (lyr1).style,
    height:(sniff.bw.ns)?d[lyr1].clip.height:sniff.bw.ie?d.all
    [lyr1].offsetHeight:d.getElementById(lyr1).offsetHeight
    };
    this.content = {
    obj:(sniff.bw.ns)?d[lyr1].document[lyr2]:sniff.bw.ie?d.all
    [lyr2]:d.getElementById(lyr2),
    css:(sniff.bw.ns)?d[lyr1].document[lyr2]:sniff.bw.ie?d.all
    [lyr2].style:d.getElementById(lyr2).style,
    height:(sniff.bw.ns)?d[lyr1].document[lyr2].clip.height:sniff.bw.ie?
    d.all[lyr2].offsetHeight:d.getElementById(lyr2).offsetHeight,
    move:moveLyr,
    top:0
    };
    this.prop = {
    dif:this.container.height - this.content.height
    };
    return this;
  }

  function moveLyr(x, y) {
    this.css.left = x;
    this.css.top = y;
  }

  function scrollDown(num) {
    var obj = (eval("scroller" + num));
    b = true;
    if (obj.container.height < obj.content.height) {
      obj.content.move(0, (parseInt(obj.content.top) - distance));
      if (parseInt(obj.content.top) >= parseInt(obj.prop.dif)) {
        tid = setTimeout("scrollDown('" + num + "')", speed);
      }
      obj.content.top = parseInt(obj.content.top) - distance;
    } else {
      stopScroll();
    }
  }

  function scrollUp(num, topx) {
    var obj = (eval("scroller" + num));
    if(topx==1){
      obj.content.top = parseInt(0)+1;
    }else{
    b = true;

    if(parseInt(obj.content.top) != 0) {
      obj.content.move(0, (parseInt(obj.content.top) + distance));
      obj.content.top = parseInt(obj.content.top) +distance;
      tid = setTimeout("scrollUp('" + num + "')", speed);
    }
    }
  }

  function stopScroll() {
    clearTimeout(tid);
    b = false
  }

  function createObj(id, containerName, contentName) {
    //eval("var scroller"+id+"= new createScrollerObj("+containerName+", "+contentName+");");
    if(id==1) scroller1 = new createScrollerObj(containerName, contentName);
    if(id==2) scroller2 = new createScrollerObj(containerName, contentName);
    if(id==3) scroller3 = new createScrollerObj(containerName, contentName);
  }


