/**
 * Menu
 */
var lastMenu = null;
var lastMenuTop = null;
var tm = null;
var tmt = null;

function showMenu(num)
{
	hideMenu();
	if (!$('SubMenu' + num).visible()) {
		Effect.BlindDown('SubMenu' + num, {duration: 0.3});
	}
	lastMenu = num;
}

function hideMenu()
{
	if (lastMenu != null) {
//		Effect.Fade('SubMenu' + lastMenu, {duration: 0.2});
		$('SubMenu' + lastMenu).hide();
		lastMenu = null;
		if (tm != null) {
			clearTimeout(tm);
			tm = null;
		}
	}
}

var Gallery = {
	loadImage: null,

	show: function(image, thumb) {
		$$('a.thumbnail.selected').each(function (node) {
			node.removeClassName("selected");
		});
		$("GalleryImageLoading").show();
		Gallery.loadImage = new Image();
		Gallery.loadImage.onload = function() {
			$("GalleryImageLoading").hide();
			$("GalleryImage").src = Gallery.loadImage.src;
		}
		Gallery.loadImage.src = image;
		$("__gt" + thumb).addClassName('selected');
	}
}
