function currentScrollYPos() {
  var myYPos = 0;
  
  // Netscape and compatible browsers use the WINDOW object for
  // storing window's properties
  //
  if (navigator.appName.indexOf("Netscape")!= -1) {
    myYPos = window.pageYOffset;
  }
  else {
    // Internet Explorer 6 changed implementation of its DOM, renaming
    // document.body into document.documentElement
    //
    if (document.documentElement && document.documentElement.scrollTop) {
      myYPos = document.documentElement.scrollTop;
    }
    else {
      // This applies to older IE browsers
      myYPos = document.body.scrollTop;
    }
  }
  return myYPos;
}
function smoothTop() {
  var curYPos = currentScrollYPos();

  if ( curYPos > 3 ) {
    myStepY = Math.round( curYPos / 5 );
    window.scrollBy(0,-myStepY);
    myTimeoutHandle = setTimeout('smoothTop()', 25);
  }
  else { 	
	window.scrollBy(0,-curYPos);
    clearTimeout(myTimeoutHandle);
  }
  return false;
}
function checkLocation() {
  var myCurrentYPos = currentScrollYPos();
  objTop = document.getElementById('back-to-top');

  // Let's show a "go to top" button, if we are far enough from the top
  if (myCurrentYPos >= 200) {
	objTop.style.visibility = "visible";
  }

  // or hide this button, if we are too close
  else {
    if (objTop.style.visibility == "visible") objTop.style.visibility = "hidden";
  } 
 
  setTimeout("checkLocation()", 25);
}
function dropdownShortcuts() {
	var sfEls = document.getElementById("shortcuts").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" ie6hover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" ie6hover\\b"), "");
		}
	}
}

if  (window.addEventListener) window.addEventListener("load", checkLocation, false);
else if (document.getElementById) window.onload=checkLocation;

// Only IE understands this
//if (window.attachEvent) {
// window.attachEvent("onload", dropdownShortcuts);
//}
