var captions;

function ChangeImage(target) {
	$('photo_credit').set('tween', {
		onComplete: function() {
			$('photo_credit').innerHTML = credits[target];
			$('photo_credit').fade('in');
		}
	});
	$('photo_credit').fade('out');


	$('photo_caption').set('tween', {
		onComplete: function() {
			$('photo_caption').innerHTML = captions[target];
			$('photo_caption').fade('in');
		}
	});
	$('photo_caption').fade('out');

	slideshow.go(target);
	
	$$('.thumbnails .active')[0].removeClass('active');
	$$('.thumbnails img')[target].addClass('active');
}

function change_selector_to(id) {
	$('sizes').getChildren().each( function(target) {
		target.destroy();
	});
	var blank = new Element('option', { value: null, html: 'Please Select...' });
	blank.inject($('sizes'), 'bottom');
	
	sizes[id].each( function(element) {
		var option = new Element('option', { value: element[0], html: element[1] });
		option.inject($('sizes'), 'bottom');
	});
}