
function loadGalleryPreview (imageURL) {
	$("#piece_image").css("opacity", 0.4);
	if (!$("#gallery_container").size()) {
		$("body").append("<div id=\"gallery_container\" class=\"window_expandable\"></div>");
	}
	$("#gallery_container").empty().append("<img src=\"" + imageURL + "\" alt=\"\" />");
	resizeExpandable("#gallery_container");
}

function resizeExpandable (selector) {
	if (!selector)
		selector = ".window_expandable";

	var width = $("#page_frame").width();	// $(window).width();
	$(selector).css("width", width + "px");
}

function positionFooter () {
	var height = $(window).height();
	var footerHeight = $("#page_footer").height();

	height -= footerHeight;

	$("#page_footer").css("top", height + "px");
}

function toggleDescription () {
	var width = $("#description_container").width();
	var right = $("#description_container").css("right");
	right = parseInt(right);

	if (!right)
		right = -1*width;
	else right = 0;

	$("#description_container").animate({ right: right }, "slow");
}

function showGalleryTitle (galleryURLID) {
	$("#" + galleryURLID + "_title").show();
}

function hideGalleryTitle () {
	$(".gallery_title").hide();
}

function setImage (imageID, imageSource) {
	$("#" + imageID).attr("src", imageSource);
}
