 var floatRDiv={
 setting: {startline:100, scrollto: 0, scrollduration:1000, fadeduration:[500, 100]},
 xy: {offsetx:5, offsety:155},
 Keepfloat:function(){
		var $window=jQuery(window)
		var controlx=$window.scrollLeft() + $window.width() - this.$floatdiv.width() - this.xy.offsetx
		var controly=$window.scrollTop() + $window.height() - this.$floatdiv.height() - this.xy.offsety
		this.$floatdiv.css({left:controlx+'px', top:controly+'px'})
	},
	
	state: {isvisible:false, shouldvisible:false},
	togglecontrol:function(){
		var scrolltop=jQuery(window).scrollTop()
		if (!this.cssfixedsupport2)
			this.keepfixed()
		this.state.shouldvisible=(scrolltop>=this.setting.startline)? true : false
		// if (this.state.shouldvisible && !this.state.isvisible){
			this.$floatdiv.stop().animate({opacity:1}, this.setting.fadeduration[1])
			this.state.isvisible=true
		// }
		// else if (this.state.shouldvisible==false && this.state.isvisible){
			// this.$floatdiv.stop().animate({opacity:0}, this.setting.fadeduration[1])
			// this.state.isvisible=false
		// }
	},
init:function(){
		jQuery(document).ready(function($){
			var floatdivnew=floatRDiv
			var iebrws=document.all
			floatdivnew.cssfixedsupport2=!iebrws || iebrws && document.compatMode=="CSS1Compat" && window.XMLHttpRequest 
			floatdivnew.$body=(window.opera)? (document.compatMode=="CSS1Compat"? $('html') : $('body')) : $('html,body')
			floatdivnew.$floatdiv=$('#Links')
				.css({position:floatdivnew.cssfixedsupport2? 'fixed' : 'absolute', bottom:floatdivnew.xy.offsety, right:floatdivnew.xy.offsetx, opacity:0, cursor:'pointer'})
				.appendTo('body')
				if (document.all && !window.XMLHttpRequest && floatdivnew.$control.text()!='') //loose check for IE6 and below, plus whether control contains any text
				floatdivnew.$control.css({width:floatdivnew.$control.width()}) //IE6- seems to require an explicit width on a DIV containing text
			floatdivnew.togglecontrol()
			$(window).bind('scroll resize', function(e){
				floatdivnew.togglecontrol()
			})
		})
	}	
}

floatRDiv.init();
