function showImage(){
	var imageUrl = $(this).attr("href");
	var div = $("<div>").css({
		position: "fixed",
		top: 0, left: 0, right: 0, bottom: 0,
		zIndex: 9999
	}).prependTo("body");
	var img = $("<img>").attr("src", imageUrl);
	var imgT = Math.round(div.height()/2 - img.attr("height")/2);
	img.css({margin: imgT+"px auto 0", display: "block"});
	div.bind("click", function(){ $(this).remove(); })
	.append(img)
	.append($("<div>").css({
		position: "fixed",
		top: 0, left: 0, right: 0, bottom: 0,
		backgroundColor: "#000000",
		opacity: .94,
		zIndex: -1
	}));
	
	$(window).one("resize", function(){ div.click(); });
	return false;
}
$(function(){
	$("a.show-image").click(showImage);
	
	// preloading
	$("a.show-image").each(function(){
		$("<img>").attr("src", $(this).attr("href"));
	});
})