﻿// 	Author:  James Terry Riendeau, jtriende@wisc.edu//  		 University of Wisconsin-Madison////	Copyright © 2005 The Board of Regents of the University of Wisconsin System.//	All rights reserved.  Use of this script restricted to University of Wisconsin //  institutions for non-commercial purposes.  This header must remain intact.//function FloatDiv(id, sy) {	var el = document.getElementById ? document.getElementById(id) : document.all ? document.all[id] : document.layers[id];	var px = document.layers ? "" : "px";	window[id + "_obj"] = el;	if (document.layers) { 		el.style = el;	}	el.style.position = "absolute";	el.sy = el.dy = sy;  // sy = starting y coordinate; dy = delta y coordinate (change in y)	el.floatThis = function() {		var windowHeight = (typeof(window.innerWidth) == 'number') ? window.innerHeight : (document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : (document.body && document.body.clientHeight ? document.body.clientHeight : 0));		var scroll = typeof( window.pageYOffset ) == 'number' ? window.pageYOffset : (document.body && document.body.scrollTop ? document.body.scrollTop : ( document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : 0 ));		scroll += 10;		this.dy += (scroll - this.dy) / 8;  // increase the divisor for smoother scrolling		if (this.offsetHeight < windowHeight) {			if (scroll > this.sy) {				this.style.top = this.dy + px;			} else {				this.style.top = this.sy + px;			}			}		setTimeout(this.id + "_obj.floatThis()", 40);  // increase timeout to slow scrolling	}	return el;}			FloatDiv("menu", 140).floatThis();