/*
	generic Gal Scroller
	CopyRight InfoChallenge 2007
*/

var Gal = {
	init: function(options){
		this.options = Object.extend({
			elId: 'Assets',
			velocity:1,
			area:100
		}, options || {});
		if (!$(this.options.elId)) return;
		var scrollGal = new Scroller(this.options.elId, {area: this.options.area, velocity: this.options.velocity});
		$($(this.options.elId)).addEvent('mouseover', scrollGal.start.bind(scrollGal));
		$($(this.options.elId)).addEvent('mouseout', scrollGal.stop.bind(scrollGal));
		var scrollBt = new Fx.Scroll(this.options.elId, {
			wait: false,
			duration: 2500,
			transition: Fx.Transitions.Quad.easeInOut
		});
		if (!$('gal-moove-right')) return;
		$('gal-moove-right').addEvent('mouseover', function(event) {
			scrollBt.toRight();
		});
		$('gal-moove-right').addEvent('mouseout', function(event) {
			scrollBt.stop();
		});
		if (!$('gal-moove-left')) return;
		$('gal-moove-left').addEvent('mouseover', function(event) {
			scrollBt.toLeft();
		});
		$('gal-moove-left').addEvent('mouseout', function(event) {
			scrollBt.stop();
		});

	}

};

window.addEvent('domready', Gal.init.bind(Gal));
