// This started with a script from www.glassdog.com but has been altered beyond recognition
// March 2001, Andy Hardacker andy@hardacker.com
var _topOffsetInitial  = 75;
var _topOffsetScrolled = 15;
var isNN4 = document.layers?1:0;
var isIE4 = document.all?1:0;
var isNN6 = (document.getElementById && !document.all)?1:0; // should change to isDOM someday
function getTop(drifter) { 
  if(isNN4) return drifter.top; 
  if(isNN6) return (drifter.style.top == "") ? 0 : parseInt(drifter.style.top);
  return drifter.style.pixelTop;
}
var drifter, wOff=0, t=0;
function checkDrift() {
  if (isNN4 || isNN6) {
    wOff = window.pageYOffset;  
  } else {  
    wOff = document.body.scrollTop;
  }
  var step = (wOff + (wOff < _topOffsetInitial ? _topOffsetInitial : _topOffsetScrolled)- getTop(drifter))*0.2;
  if (isNN4) drifter.top += step;
  else if (document.getElementById) {
    t = parseInt(drifter.style.top,10); 
    drifter.style.top = (t+step)+"px";
  }
  else drifter.style.pixelTop += step;
}
function keepAlive() {
  // Mac IE only - move the content into view
  drifter.style.pixelTop = document.body.scrollTop + _topOffsetInitial;
}
function initDrift() {
  if( (parseInt(navigator.appVersion) < 4) || ( (navigator.appVersion.lastIndexOf('MSIE') != -1) && (navigator.appVersion.lastIndexOf('Mac') != -1) ) ) {
    return;
  }
  if (isNN4) {
    drifter = document.layers.drag;
  }	
  else if (document.getElementById) {
    drifter = document.getElementById("drag");
	drifter.style.top = _topOffsetInitial+"px";
  }	
  else {
    //document.all.drag.style.pixelTop = _topOffset;
    drifter = document.all.drag;
	drifter.style.pixeltop = _topOffsetInitial;
  }
  if((navigator.appName == "Microsoft Internet Explorer")&&(navigator.appVersion.indexOf("Mac") != -1 )&&(navigator.appVersion.indexOf("5") != -1)){
    //Mac IE 4.5 doesn't support the smooth method 
	 window.onscroll = keepAlive;
   } else {
	 var _interval = window.setInterval("checkDrift()",20);
	 //alert("int="+ _interval);
   }
}

