function changeImage(num,id,name,nid,desc,imgw,imgh,mimetype,commentcount) {
	// If id is not defined, look it up.
	if (typeof id == 'undefined') {
		try {
			$('#photoListItem_' + num + ' a').eq(0).click($('#photoListItem_' + num + ' a')[0].onclick);
			$('#photoListItem_' + num + ' a').eq(0).click();
		} catch (e) {
		}
		return;
	}
	$('ul.images li').removeClass('active');
	$('#photoListItem_'+num).toggleClass('active');
	$('div.trophyRoomActive img').attr({ 
		src: 'http://s3.amazonaws.com/weatherbynation/'+id+'-400x400.jpg'
	})
	$('div.trophyRoomActive div.imageNum span').eq(0).html(num);
	$('div.trophyRoomActive div.imageNum a').attr('href','/node/'+nid+'/edit');
	$('div.trophyRoomActive span.imageName').html(name);
	$('div.trophyRoomActive span.imageBody').html(desc);
	$('#comments-add #current_image_nid').val(nid);
	if(commentcount == 1) {
		$('#comments-add h3').html("1 Comment:");
	} else {
		$('#comments-add h3').html(commentcount + " Comments:");
	}
	$('div.trophyRoomComments[@id]').hide();
	$('#commentParent_nid-'+nid).show();
	
	num = parseInt(num);
	if (num == 1) {
		$('.previous').addClass('inactive');
	} else {
		$('.previous').removeClass('inactive');
	}
	if (num == parseInt($('div.trophyRoomActive div.imageNum span').eq(1).html())) {
		$('.next').addClass('inactive');
	} else {
		$('.next').removeClass('inactive');
	}
	
	// Print link/form
	thumbHeight = Math.ceil( (imgh/imgw)*150 );
	
	$('#rightCol.trophyRoom div.imageDetails span.printShutterfly a').show();
	$('#extPrintWrapper').hide();
	$('#shutterflyPrintForm input[@name=imraw-1]').val('http://s3.amazonaws.com/weatherbynation/'+id+'-O.jpg');
	$('#shutterflyPrintForm input[@name=imrawheight-1]').val(imgh);
	$('#shutterflyPrintForm input[@name=imrawwidth-1]').val(imgw);
	$('#shutterflyPrintForm input[@name=imthumb-1]').val('http://s3.amazonaws.com/weatherbynation/'+id+'-175x150.jpg');
	$('#shutterflyPrintForm input[@name=imthumbheight-1]').val(thumbHeight);
	
	// Clean up the comments box
	$('#rightCol.trophyRoom form#comments-add textarea').val('');
}

