function Float(id, bumper) {
        var objFloat = document.getElementById(id);
        var refObj = document.getElementById(bumper);
        
        startMoveAt = getY(refObj);
        stopMoveAt = objFloat.offsetHeight;
        
        var agt=navigator.userAgent.toLowerCase();
        if (agt.indexOf("msie 6.") != -1) isIE6 = true;
        else isIE6 = false;

        if (agt.indexOf("msie 7.") != -1) isIE7 = true;
        else isIE7 = false;
        
        if (agt.indexOf("msie") != -1) isIE = true;
        else isIE = false;

		if (isIE) {
			startMoveAt += 11;
			
			if (isIE6 || isIE7) {
				stopMoveAt += 240;
			}
		}

        objFloat.cy = objFloat.sy = 0;

        window[id + "_obj"] = objFloat;

        objFloat.doFloat=function() {
                var currentScrollTop = getScroll().top;
                var containingElementTop = getY(refObj);
                var containingElementHeight = refObj.offsetHeight;
                var floatElementHeight = this.offsetHeight;
                var bodyHeight = document.body.clientHeight;
                var fullHeight = document.body.offsetHeight;

/*
data = 'ticket_list: ' + document.getElementById('ticket_list').offsetHeight + '<br>';
data += 'startMoveAt: ' + startMoveAt + '<br>';
data += 'stopMoveAt: ' + stopMoveAt + '<br>';
data += 'fullHeight: ' + fullHeight + '<br>';
data += 'bodyHeight: ' + bodyHeight + '<br>';
data += 'windowHeight: ' + getWindowHeight() + '<br>';
data += 'currentScrollTop: ' + currentScrollTop + '<br>';
data += 'containingElementTop: ' + containingElementTop + '<br>';
data += 'containingElementHeight: ' + containingElementHeight + '<br>';
data += 'floatElementHeight: ' + floatElementHeight + '<br>';
data += 'fullHeight - currentScrollTop: ' + (fullHeight - currentScrollTop) + '<br>';
data += 'containingElementTop + containingElementHeight - currentScrollTop: ' + (containingElementTop + containingElementHeight - currentScrollTop) + '<br>';
document.getElementById('stats').innerHTML =  data;
document.getElementById('stats_top').innerHTML =  data;
*/
                this.newLocation = 0;
                if (currentScrollTop >= startMoveAt && (containingElementTop + containingElementHeight - currentScrollTop) > stopMoveAt) {
                        if (isIE6) {
                                this.style.position = "absolute";
                                this.style.top = currentScrollTop;
                        } else {
                                this.style.position = "fixed";
                                this.style.top = "0px";
                        }
                } else if ((containingElementTop + containingElementHeight - currentScrollTop) <= stopMoveAt) {
                        this.style.position = "absolute";
                        if (isIE6 || isIE7) {
							this.style.top = (containingElementTop + containingElementHeight - floatElementHeight - 311) + 'px';
						} else {
							this.style.top = (containingElementTop + containingElementHeight - floatElementHeight) + 'px';
						}
                } else {
                        this.style.position = "absolute";
                        this.style.top = startMoveAt + "px";
                }
        setTimeout(this.id + "_obj.doFloat()", 100);
        }
        objFloat.doFloat();

        return objFloat;
}

getScroll = function () {
  var top = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
  var left = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0;
  return { 
    top: top, 
    left: left, 
    offset:{ x: left, y: top }  //  note the change, NOT an Array with added properties. 
  };  //  object
}

function getY(oElement) {
        var iReturnValue = 0;
        while( oElement != null ) {
                iReturnValue += oElement.offsetTop;
                oElement = oElement.offsetParent;
        }
        return iReturnValue;
}

function getWindowHeight() {
var windowHeight=0;
if (typeof(window.innerHeight)=='number') {
windowHeight=window.innerHeight;
}
else {
if (document.documentElement&&
document.documentElement.clientHeight) {
windowHeight=
document.documentElement.clientHeight;
}
else {
if (document.body&&document.body.clientHeight) {
windowHeight=document.body.clientHeight;
}
}
}
return windowHeight;
}

