var slideSwitcher;
Event.observe( window, 'load', initSlideSwitcher );

function initSlideSwitcher()
{
	slideSwitcher = new SlideSwitcher();
	Event.observe( $( 'note' ), 'click', slideSwitcher.nextSlide.bind( slideSwitcher ) );
}

var SlideSwitcher = Class.create();
SlideSwitcher.prototype = {

initialize: function()
{
	this.current = 0;
	this.availSlides = $( 'homepageHeader' ).getElementsByClassName( 'slide' );
	for (var i=0; i<this.availSlides.length; i++)
		if (this.availSlides[i].visible()) this.current = i;
	this.count = this.availSlides.length;
},

nextSlide: function()
{
	var cur_slide = this.availSlides[this.current++];
	this.current == this.count ? this.current = 0 : 0;
	var next_slide = this.availSlides[this.current];
// alert( this.current + " " + this.count );
cur_slide.hide();
next_slide.show();

//	new Effect.Parallel( [new Effect.Fade( cur_slide ), new Effect.Appear( next_slide ) ], {} );
}

};