//dynamically loads an image from the gallery
//will fade the image in if the browser supports it
//requires mootools.js

function loadImage(filename, productheading) 
{
	if($('productHeading')) {
		if(productheading) {
			$('productHeading').innerHTML = ' - ' + productheading;
		} else {
			$('productHeading').innerHTML = '';
		}

	} 

	$('galleryImage').setOpacity(0);
	$('galleryImage').src = 'images/gallery/' + filename;
	var myFx = new Fx.Style('galleryImage', 'opacity').start(0,1);
}
	
function loadGallery(event) 
{
	window.location = $('selectGallery').value;
}

window.onload = function() {
	$('selectGallery').addEvent('change', loadGallery.bindWithEvent($('selectGallery')));
	$('goButton').addEvent('click', loadGallery.bindWithEvent($('goButton')));
}
