var Scroller2 = new Class({

	Implements: [Events, Options],

	options: {
		area: 20,
		velocity: 1,
		onChange: function(x, y){
			this.element.scrollTo(x, y);
		}
	},

	initialize: function(element, element2, options){
		this.setOptions(options);
		this.element = $(element);
		this.element2 = $(element2);
		this.listener = ($type(this.element2) != 'element') ? $(this.element.getDocument().body) : this.element2;
		this.timer = null;
		this.coord = this.getCoords.bind(this);
	},

	start: function(){
		this.listener.addEvent('mousemove', this.coord);
	},

	stop: function(){
		this.listener.removeEvent('mousemove', this.coord);
		this.timer = $clear(this.timer);
	},

	getCoords: function(event){
		this.page = /*(this.listener.get('tag') == 'body') ? */event.client /*: event.page*/;
		if (!this.timer) this.timer = this.scroll.periodical(50, this);
	},

	scroll: function(){
		var size = this.element2.getSize(), scroll = this.element.getScroll(), pos = this.element2.getOffsets(), change = {'x': 0, 'y': 0};
		for (var z in this.page){
			if (this.page[z] < (this.options.area + pos[z]) && scroll[z] != 0)
				change[z] = (this.page[z] - this.options.area - pos[z]) * this.options.velocity;
			else if (this.page[z] + this.options.area > (size[z] + pos[z]) && size[z] + size[z] != scroll[z])
				change[z] = (this.page[z] - size[z] + this.options.area - pos[z]) * this.options.velocity;
		}
		if (change.y || change.x) this.fireEvent('change', [scroll.x + change.x, scroll.y + change.y]);
	}

});



onBodyLoad = function(){
if($('dscrTxt')){
//var prjScrl1 = new Scroller('dscrTxt',{area: 40, velocity:0.2});
var prjScrl1 = new Scroller2('dscrTxt','dscrBack',{area: 200, velocity:0.4});
$('dscrBack').addEvent('mouseover', prjScrl1.start.bind(prjScrl1));
$('dscrBack').addEvent('mouseout', prjScrl1.stop.bind(prjScrl1));}
if (indexPage==1 && !swfobject.hasFlashPlayerVersion("6.0.0")) setTimeout(function(){location.replace("/html/index.html");},3000);

}//onBodyLoad

window.addEvent('domready', onBodyLoad);
