
	var RolloverGallery = function(pars){
		this.init();
	};

	RolloverGallery.prototype.init = function()
	{
		this.body			= document.getElementsByTagName('body')[0];
		Element.extend(this.body);
		this.images			= new Array();
		this.thumb_links	= this.body.getElementsByClassName('gallery_thumb');
		this.view			= this.body.getElementsByClassName('gallery_view')[0];

		for(var i=0; i<this.thumb_links.length; i++)
		{
			// make sure a reference is kept, to avoid garbage collection
			var image = new Image();
			image.src = this.thumb_links[i].href;
			this.images.push(image);		

			// cursor
			this.thumb_links[i].setStyle({
					cursor: 'default'
				}
			);

			// hover and onclick
			Event.observe(this.thumb_links[i], 'mouseover', this.mouseover_thumb.bind(this));
			Event.observe(this.thumb_links[i], 'click', this.click_thumb.bind(this));
		}
	}

	RolloverGallery.prototype.mouseover_thumb = function(event){
		this.view.src = Event.findElement(event, 'A').href;
	}

	RolloverGallery.prototype.click_thumb = function(event){
		Event.stop(event);
	}			

