function putBanner(unu, doi, trei) {
	if(unu==1) {
		var from = $('hiddenBanner');
		var to = $('banner_sus');
		from.style.display = '';
		to.appendChild(from);
	} 

	if(doi==1) {
		var from = $('hiddenBanner1');
		var to = $('boombanner1');
		from.style.display = '';
		to.appendChild(from);
	} 
	
	if(trei==1) {
		var from = $('hiddenBanner2');
		var to = $('boombanner2');
		from.style.display = '';
		to.appendChild(from);
	}
}


var Carousel = function(id, item_width , total_items, items_visible, position, prev, next, srcs)
{
	this.div=id;
	this.item_width = item_width;
	this.total_items = total_items;
	this.slides_left = total_items - items_visible;
	this.total_slides = this.slides_left;
	this.items_visible = items_visible;
	this.nextTb = next;
	this.prevTb = prev;
	this.srcs = srcs;
	if(position)
	{
		this.position = position;
		this.actual_slide = position + 1;
		this.slides_left -= position;
	}
	else
	{
		this.actual_slide = 1;
	}
};

Carousel.prototype = {
	moveNext: function(moveBy)
	{
		if(this.slides_left > 0)
		{
			if(moveBy)
			{
				if(this.slides_left < moveBy)
				{
					moveBy = this.slides_left;
				}
				this.actual_slide += moveBy;
				this.slides_left -= moveBy;
				new Effect.Move(this.div, {x: -this.item_width * (this.actual_slide - 1), mode: 'absolute', duration: 0.4});
			}
			else
			{
				if( this.nextTb && this.actual_slide+10 >= this.nextTb && this.nextTb<this.total_items) {
					$('carousel1Img_' + this.nextTb ).src = this.srcs[this.nextTb];
					this.nextTb++;
				}
				
				new Effect.Move(this.div, {x: -this.item_width * this.actual_slide, mode: 'absolute', duration: 0.4});
				this.actual_slide++;
				this.slides_left--;
			}
		}
	},
	
	movePrev: function(moveBy)
	{
		if(this.slides_left < this.total_slides)
		{
			if(moveBy)
			{
				if(this.total_slides % moveBy != 0 && this.slides_left == 0)
				{
					moveBy = this.total_slides % moveBy;
				}
				this.actual_slide -= moveBy;
				this.slides_left += moveBy;
				new Effect.Move(this.div, {x: -this.item_width * (this.actual_slide - 1), mode: 'absolute', duration: 0.4});
			}
			else
			{
				if( (this.prevTb || this.prevTb === 0) && this.actual_slide-3 <= this.prevTb && this.prevTb>=0) {
					$('carousel1Img_' + this.prevTb ).src = this.srcs[this.prevTb];
					this.prevTb--;
				}
				
				new Effect.Move(this.div, {x: -this.item_width * (this.actual_slide - 2), mode: 'absolute', duration: 0.4});
				this.actual_slide--;
				this.slides_left++;
			}
		} 
	},
	
	updateProgress: function(moveBy)
	{
		var x = Math.ceil(this.actual_slide / moveBy);
		if(this.slides_left == 0 && this.actual_slide % moveBy != 1)
		{
			x++;
		}
		var y = Math.ceil(this.total_items / 3);
		$('span_page').innerHTML = x + ' din ' + y;
	}
}

