// JavaScript Document
var hspeed = 0;
var hanimation;
var state = "idle";
var hscrolled;
var speedlimit = (window.navigator.appName.indexOf("Explorer")>-1)?15:5;
var reaction = (window.navigator.appName.indexOf("Explorer")>-1)?50:50;
var accel = (window.navigator.appName.indexOf("Explorer")>-1)?1:5;

function doClickRight() {
	state = "right";
}

function doClickLeft() {
	state = "left";
}

function doCancelAnimation() {
	state = "idle";
}

function doAnimation() {
	if (state != "idle") {
		if (state == "right") {
			hspeed += (hspeed<=speedlimit)?accel:0;
		} else if (state == "left") {
			hspeed -= (hspeed>=(-1*speedlimit))?accel:0;
		}
	} else {
		hspeed += (hspeed!=0)?((hspeed<0)?accel:(-1*accel)):(0);
	}
	hscrolled.scrollLeft += hspeed;
}

function initHScroller() {
	document.getElementById("hsb_l").onmousedown = doClickLeft;
	document.getElementById("hsb_l").onmouseup = doCancelAnimation;
	document.getElementById("hsb_l").onmouseout = doCancelAnimation;
	document.getElementById("hsb_r").onmousedown = doClickRight;
	document.getElementById("hsb_r").onmouseup = doCancelAnimation;
	document.getElementById("hsb_r").onmouseout = doCancelAnimation;
	hscrolled = document.getElementById("h_scroller");
	if (window.navigator.appName.toUpperCase().indexOf("OPERA")>-1) {
		hscrolled.style.overflowX = "scroll";
		hscrolled.style.overflowY = "scroll";
		hscrolled.style.overflow = "scroll";
	}
	hanimation = window.setInterval(doAnimation,reaction);
}


function showbigimg(bgpic)
	{
		var bigPlace = document.getElementById("bigDiv");
		bigPlace.src = bgpic;
	}
