jQuery(document).ready(function() {
	jQuery('div.gallery a').click(function(event) {
		event.preventDefault();
		source = jQuery(this).attr('href');
		title = jQuery(this).children(':first-child').attr('title');
		nsource = source.substring(0, source.length - 4) + '-670x400' + source.substring(source.length - 4, source.length);
		jQuery('img#main-image').attr('src', nsource).attr('title', title);
	});
});
