var Splash_Carousel = new Class({
	
	initialize: function(items) {
		this.image = $('carousel_img');
		this.link = $('carousel_link');
		this.next_item_id = 1;
		this.items = items.items;
	},
	nextItem: function() {
		//alert(this.next_item_id);
		this.image.src = this.items[this.next_item_id].src;
		this.link.href = this.items[this.next_item_id].href;
		
		if (this.items[this.next_item_id].popup) {
			this.link.addClass('ringtonePopupLink');
		} else {
			this.link.removeClass('ringtonePopupLink');
		}
		
		if (this.next_item_id < (this.items.length - 1)) {
			this.next_item_id = this.next_item_id + 1;
		} else {
			this.next_item_id = 0;
		}
		
	},
	start: function() {
		//this.nextItem();
		this.nextItem.periodical(4000, this);
	}

});