function showGallery(galleryFolder) {
	var galleryCode;
	
	document.getElementById("flashContainer").style.display = "block";
	document.getElementById("flashContainer").style.height = getInnerHeight().toString() + "px";
	document.getElementById("flashContainer").style.top = getScrollTop().toString() + "px";
	//document.getElementById("html").style.overflow = "hidden";
	//document.getElementById("body").style.overflow = "hidden";
	
	galleryCode = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="100%" height="100%">\n';
	galleryCode += '<param name="movie" value="/wp-content/galleries/picagallery.swf?galleryRoot=/wp-content/galleries/' + galleryFolder + '/" />\n';
	galleryCode += '<param name="wmode" value="transparent" />\n';
	galleryCode += '<param name="quality" value="high" />\n';
	galleryCode += '<embed src="/wp-content/galleries/picagallery.swf?galleryRoot=/wp-content/galleries/' + galleryFolder + '/" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100%" height="100%" wmode="transparent"></embed>\n';
	galleryCode += '</object>';
	
	document.getElementById("flashContainer").innerHTML = galleryCode;
	
	return false;
}

function closeGallery() {
	document.getElementById("flashContainer").style.display = "none";
	//document.getElementById("html").style.overflow = "auto";
	//document.getElementById("body").style.overflow = "auto";
}

/*window.onresize = function() {
	document.getElementById("flashContainer").style.height = getInnerHeight().toString() + "px";
	document.getElementById("flashContainer").style.top = getScrollTop().toString() + "px";
}*/

// Helper functions

function getInnerHeight() {
	if (self.innerHeight) // all except Explorer
	{
		return self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode
	{
		return document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		return document.body.clientHeight;
	}
}

function getScrollTop() {
	if (self.pageYOffset) // all except Explorer
	{
		return self.pageYOffset;
	}
	else if (document.documentElement && document.documentElement.scrollTop)
		// Explorer 6 Strict
	{
		return document.documentElement.scrollTop;
	}
	else if (document.body) // all other Explorers
	{
		return document.body.scrollTop;
	}
}