/*****************************************************/
/* Require:											 */
/* OnLoad declare									 */
/* 	"dojox.fx.easing"								 */
/*****************************************************/
//dojo.require("dojox.fx.easing");


dojo.declare("FloatScroll", null, {
			 
        constructor: function(eleID, speed, easingFunction, start_position_buffer)
		{
			this.eleID					= eleID;
        	this.speed					= speed;
			this.easingFunction			= easingFunction;
			this.start_position_buffer	= start_position_buffer;
			this.init(); //class Initialization
        },
		init: function()
		{
			dojo.connect(window, 'onscroll', dojo.hitch(this, 'onscrollHandler', 0, 100));
			
		},
		onscrollHandler: function()
		{
			var browser=navigator.appName;  //Browser Name
			var scroll_Y;
			if (browser=="Microsoft Internet Explorer") scroll_Y = document.documentElement.scrollTop; else scroll_Y = window.pageYOffset;
			scroll_Y = scroll_Y -this.start_position_buffer;
			if(scroll_Y<0) scroll_Y=0;
			
			dojo.animateProperty({
			  node: dojo.byId(this.eleID),
			  easing: dojox.fx.easing[this.easingFunction],
			  duration: this.speed,
			  properties: {
				left: 0,
				top: scroll_Y
			  }
			}).play();
		}
});