window.TopKarusel2 = {

	block : 'top_karusel2',
	onePos : 200,
	duration : 100,
	pos : 1,
	maxPos : 2,
	count: 3,

	next : function(e, event){

		var duration = this.duration;
		var current_pos = this.pos * this.onePos;
		current_pos = -current_pos;
		
		this.pos ++;
		if(this.pos > this.maxPos) {
			this.pos = 1;
			current_pos = 0;
			duration = 0;
		}

		this.block.set('tween', {duration: duration, transition: Fx.Transitions.linear});
		this.block.tween('left', current_pos);
		
		return false;
	},

	prev : function(e){
		var duration = this.duration;
		
		this.pos --;
		
		var after_pos = this.pos-1;
		if(this.pos == 0 ) {
			this.pos = this.maxPos;
			duration = 0;
			var after_pos = this.pos - 1;
		}
		var current_pos = after_pos * this.onePos;
		current_pos = -current_pos;
		this.block.set('tween', {duration: duration, transition: Fx.Transitions.linear});
		this.block.tween('left', current_pos);

		return false;
	},

	init : function(onepos, count){
		var self = this;
		if (typeof(onepos) !== 'undefined') {
			self.onePos = onepos; 
		}
		if (typeof(count) !== 'undefined') {
			self.count = count; 
		}
		var hp_kis = $('top_karusel2').getElements('a[rel="hp_ki"]');
		this.maxPos = hp_kis.length - this.count + 1;
		this.block = $('top_karusel2');
	}
};
