// JavaScript Document
	function init(){
		scr = new Scroller();
	}

	Scroller = function(){
		this.speed = 20;
		if(document.getElementById("rightScrollerBtn")){
			this.rightBtn = document.getElementById("rightScrollerBtn");
		}
		if(document.getElementById("leftScrollerBtn")){
			this.leftBtn = document.getElementById("leftScrollerBtn");
		}
		this.container = document.getElementById("container");
		this.scroller = document.getElementById("scroller");
		
		if(document.getElementById("scroller").firstChild.clientWidth){
			this.content = document.getElementById("scroller").firstChild; // For IE (7)
		}else{
			this.content = this.scroller; // For Safari
		}
		
		this.x = 0;
		this.active = false;
		this.maxX = -(Math.ceil(this.content.clientWidth / this.container.clientWidth)-1)*this.container.clientWidth;
		this.checkLimit();
	}
	
	Scroller.prototype.left = function(){
		if(this.x + this.container.clientWidth <= 0){
			if(!this.active){
				this.move(this.x + this.container.clientWidth);
			}
		}
	}
	Scroller.prototype.right = function(){
		if(this.x - this.container.clientWidth >= this.maxX){
			if(!this.active){
				this.move(this.x - this.container.clientWidth);
			}
		}
	}
	Scroller.prototype.move = function(trgX){
		this.active = true;
		this.x += (trgX - this.x)/this.speed;
		this.draw();
				
		if(trgX - this.x < 1 && trgX - this.x > -1){
			this.x = trgX;
			clearTimeout(this.timer);
			this.active = false;
			this.draw();
			this.checkLimit();
		}else{
			this.timer = setTimeout("scr.move("+trgX+")",10);
		}
		
	}
	Scroller.prototype.draw = function(){
		this.scroller.style.left = this.x+"px";
	}
	Scroller.prototype.checkLimit = function(){
		if(this.rightBtn){
			if(this.x <= this.maxX){// check left
				if(!this.active){
					this.rightBtn.style.display = "none";
				}
			}else{
				this.rightBtn.style.display = "block";
			}
		}
		if(this.leftBtn){
			if(this.x >= 0){// check right
				if(!this.active){
					this.leftBtn.style.display = "none";
				}
			}else{
				this.leftBtn.style.display = "block";
			}
		}
	}
	
	function drawPic(e,txt){
		document.getElementById('bigFoto').innerHTML = "<img src='"+e.src+"'/>";
		document.getElementById('textFoto').innerHTML = txt;
	}
	function drawDiv(html,txt){
		document.getElementById('bigFoto').innerHTML = html;
		document.getElementById('textFoto').innerHTML = txt;
	}
