/*
 * Mootools Class for element Cross-fading.
 * 
 */
var DupliumCarousel = new Class({
	
	Extends: Carousel,
	 
	options: {
		trigger: '#trigger a'
		
	},
	
	initMessages: function(){
		
		// initialize the parent
		this.parent();
		
		// init the trigger
		if ($type(this.options.trigger) == 'element')
			this.trigger = this.options.trigger;
		else
			this.trigger = $(document).getElement(this.options.trigger);
			
		// get the links	
		this.links = new Array();
		
		this.messages.each(function(message, index) {
			
			var link_container = message.getElement('p.link').hide();
			var link = link_container.getElement('a');
			
			this.links[index] = link;
			
		}, this);
				
	},
	
	updateControls: function() {
		
		this.parent();
		this.trigger.title = this.links[this.current_message].title;
		this.trigger.href = this.links[this.current_message].href;
		
	}
	
	
});
	

