function fixSWFContainerHeight(elemID, height) {
	//return;  // allow resizing?
	
	var elem = document.getElementById(elemID)
	var children = elem.childNodes;
	height = parseInt(height) + 6;
	if ( height > parseInt(elem.style.height) );
		elem.style.height = height + "px";
	
	for (var i = 0; i < children.length; i++) {
		children[i].style.height = elem.style.height;
	}
}

$(function() {
	// $(".imgWrapper img").not(".bw-copy").hide();
	$(".imgWrapper img").each(function() {
		if ( !$(this).hasClass("bw-copy") )
			$(this).hide();
	});
	
	$(".imgWrapper").hover(function() {
		$(this).children("img").eq(0).show();
		$(this).children("img").eq(1).hide();
	}, function() {
		$(this).children("img").eq(0).hide();
		$(this).children("img").eq(1).show();
	});
	
	
	// OBSOLETE!
	/*$(".post img, .page img").each(function(i) {
			var imageSrc = $(this).attr("src");
			var imageWidth = $(this).width();
			var imageHeight = $(this).height();
			var imageReplacementID = "imgWrapper-" + i;
			var imageAlt = $(this).attr("alt");
			var imageTitle = $(this).attr("title");

			// $(this).wrap("<span id=\"" + imageReplacementID + "\" class=\"imgWrapper\"></span>");
			// var replacementElem = $("#" + imageReplacementID);
			// $(replacementElem).append( "<span class=\"overlay\"></span>" );
			// $(replacementElem).children(".overlay")
			// 	.width(imageWidth)
			// 	.height(imageHeight)
			// 	.css("position", "relative")
			// 	.css("top", imageHeight*-1);
			// 
			// $(this).parents("a").width(imageWidth).height(imageHeight);

			$(this).replaceWith("<div id=\"" + imageReplacementID + "\" class=\"imgWrapper\"></div>");
			var replacementElem = $("#" + imageReplacementID);
			$(replacementElem)
				.width(imageWidth)
				.height(imageHeight)
				.css("background", "url(" + imageSrc + ") no-repeat")
				.append("<div class=\"overlay\"></div>");
			// $(replacementElem).children(".overlay")
			// 	.css("position", "relative")
			// 	.css("top", imageHeight*-1);
			if (imageAlt)
				$(replacementElem).html( "<span>" + imageAlt + "</span>" + $(replacementElem).html() );
			if (imageTitle)
				$(replacementElem).attr("title", imageTitle);
		});*/
});