
/*function Browser() {

  var ua, s, i;

  this.isIE    = false;
  this.isNS    = false;
  this.version = null;

  ua = navigator.userAgent;

  s = "Opera";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "MSIE";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  // Treat any other "Gecko" browser as NS 6.1.

  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }
}

*/

var timerid = 0;

function scrollFs(dir, content_id, container_id)
{
  timerid = window.setInterval("moveFs(" + dir + ", '" + content_id + "', '" + container_id +  "')", 1);
}

function moveFs(dir, content_id, container_id)
{
  obj = document.getElementById(content_id);
  contentHeight = getHeight(content_id);
  containerHeight = getHeight(container_id);

  if (contentHeight < containerHeight) return;

  if (dir < 0 && (parseInt(obj.style.top) + contentHeight) == containerHeight)
    return;
  if (dir > 0 && parseInt(obj.style.top) == 0)
    return;
	
  new_top = (parseInt(obj.style.top) + dir);
  
  if (new_top < containerHeight - contentHeight)
    new_top = contentHeight - containerHeight;
  else if (new_top > 0)
    new_top = 0;

  obj.style.top = new_top + "px";
}

function stopFs()
{
  window.clearInterval(timerid);
}

var IE = (document.all) ? 1 : 0;
var DOM = 0; 
if (parseInt(navigator.appVersion) >=5) {DOM=1};

function getHeight(id)
{
	if (DOM)
	  return parseInt(document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue('height', null));
	else if(IE)
	  return(document.getElementById(id).offsetHeight);
}
