
var Galery = Class.create({
initialize:function(){
	
	this.pos = 0;
	this.bilder = new Array();
	$$('.image').each(function(e){
		this.bilder.push(e);
	}.bind(this));
	

	if(this.bilder.length < 2){
		return;
	}		
	

	Event.observe(document.body, 'click', function(e){
		var ele = e.findElement('a.btnright');
		if(typeof(ele)!= "undefined"){
			this.nextImages();
			e.stop();
		}
		
		var ele = e.findElement('a.btnleft');
		if(typeof(ele)!= "undefined"){
			this.previousImages();
			e.stop();
		}		
	}.bind(this));
},
nextImages:function(){
	var elem = $$('#gal-con .slider')[0];
	if(typeof elem != "undefined"){
		new Effect.Move(elem, { x:-100, y: 0, mode: 'relative', duration:0.3});
	}
	
},
previousImages:function(){
	var elem = $$('#gal-con .slider')[0];
	if(typeof elem != "undefined"){
		new Effect.Move(elem, { x:+100, y: 0, mode: 'relative', duration:0.3});
	}

},
hideImages:function(){
	$$('.image').each(function(e){
		e.addClassName('invisible');
	}.bind(this));
	
}
});


