
function heroRotation() {
	/**
	 * Hero image crossfader
	 * @author K Huehn
	 * @return void
	 * @options.duration sets the Fx transition time ('long' = 1000ms)
	 *  options.period sets the time between Fx transitions (in seconds)
	 *  options.select sets the class used for the “selected” thumbnail
	 *  options.hidden sets the class set on hidden slides in the rotation
	 * 
	 */
	var Promo = new Class({
	Extends:Fx.Tween,
	options:{ duration:'long', fps:100, period:8, select:'selected', hidden:'hidden', onComplete:function(){ this.element.addClass(this.options.hidden).setStyle('z-index', 2); this.element = this.slides[this.index].setStyle('z-index', 3) } },
	index:0, thumb:null, autoplay:null,
	initialize:function(slides,pagination){
	if (!slides||!pagination){return}
	this.thumbnails = pagination.getElements("a").map(function(a,b){ return a.addEvent("click", this.change.bindWithEvent(this, b)) }.bind(this));
	this.slides = slides.map(function(slide,i){ slide.setStyle('z-index', 2);
		switch(slide.getStyle('display')){
			case 'none': slide.fade('hide'); break;
			default: this.element = slide.fade('show').setStyle('z-index',3); this.thumb = this.thumbnails[i].addClass(this.options.select); this.index = i; break;
		} return slide}.bind(this));
		this.parent(this.element); delete this.subject;
		if(this.options.period>0){this.autoplay = this.advance.periodical(this.options.period*1000, this)}
	},
	advance:function(){ this.thumbnails[(this.index == this.thumbnails.length - 1) ? 0:(this.index + 1)].fireEvent('click') },
	change:function(e,i){ switch($type(e)){
		case 'event': e.stop(); if(this.autoplay){$clear(this.autoplay)} $pick(e.target,e.srcElement).fireEvent('click'); break;
		case false: default: switch($type(this.timer)){
			case false: if (this.thumb != this.thumbnails[i]){
				this.thumb.removeClass(this.options.select); this.thumb = this.thumbnails[i].addClass(this.options.select); this.slides[i].fade('show').removeClass(this.options.hidden); this.index = i; this.start('opacity', 0) } break;
			case 'number': default: return; break;
		} }
	}
	});
	new Promo($$('.indexPromoSlot p'), $$('.pagination')[0])
}

