/* Horizontal Tiny Scrolling - a smooth scrolling script for horizontal websites
(the brother of the vertical "Tiny Scrolling")
by Marco Rosella - http://www.centralscrutinizer.it/en/design/js-php/horizontal-tiny-scrolling
                v0.1 - March 31, 2006
*/

window.onload = function() {
	scrollTips.init();
}

/* the mouse scrolling doesn't work with Opera, that hasn't a event associated to the mouse wheel */
 
var scrollTips = {
	dx : null,
	init : function() {	
		if (window.addEventListener) {
		window.addEventListener("DOMMouseScroll", this.mouseScroll, false);
		} else 	window.onmousewheel = document.onmousewheel = this.mouseScroll;
		var right = document.getElementById('arright');
		right.onmouseover = function() {this.dx=setInterval('scrollTips.arrowScroll(1)',100);return false;}
		right.onmouseout = function() { clearInterval(this.dx); return false;}
		var left = document.getElementById('arleft');
		left.onmouseover = function() {this.dx=setInterval('scrollTips.arrowScroll(0)',100);return false;}
		left.onmouseout = function() { clearInterval(this.dx); return false;}
	},

	mouseScroll : function(e) {
		if (!e) var e = window.event;
		if (window.opera) {delta = event.wheelDelta/120; delta = -delta;}
		if (e.wheelDelta <= 0 || e.detail>=0){  
		window.scrollBy(80,0);
		} else  window.scrollBy(-80,0) ; 
	} ,
	
	arrowScroll: function(val) {
		if(val==1) {
			window.scrollBy(70,0);
		} else {
			window.scrollBy(-70,0)
		}
	}
}

