﻿var submenuTimer = -1;
var submenuIndex = -1;

function showSubmenu(item) {
	if (submenuTimer != -1) {
		clearTimeout(submenuTimer);
	}
	if (submenuIndex != -1) {
		hideSubmenu(submenuIndex);
	}
	submenuIndex = item;
	if (x = document.getElementById(item)) {
		x.className = 'visible';
	}
}

function outSubmenu() {
	submenuTimer = setTimeout("hideSubmenu();", 250);
}

function hideSubmenu() {
	submenuTimer = -1;
	if (x = document.getElementById(submenuIndex)) {
		x.className = '';
	}
	submenuIndex = -1;
}

var thumbnailTimer = -1;
var thumbnailIndex = -1;

function showThumbnail(item) {
	if (thumbnailTimer != -1) {
		clearTimeout(thumbnailTimer);
	}
	if (thumbnailIndex != -1) {
		hideThumbnail(thumbnailIndex);
	}
	thumbnailIndex = item;
	if (x = document.getElementById(item)) {
		x.className = 'thumbnailActive';
	}
}

function outThumbnail() {
	thumbnailTimer = setTimeout("hideThumbnail();", 250);
}

function hideThumbnail() {
	thumbnailTimer = -1;
	if (x = document.getElementById(thumbnailIndex)) {
		x.className = 'thumbnail';
	}
	thumbnailIndex = -1;
}

function showLightBox(src) {
	document.getElementById('lightboxImage').src = src;
	document.getElementById('lightbox').style.display = '';
}

function hideLightBox() {
	document.getElementById('lightbox').style.display = 'none';
	document.getElementById('lightboxImage').src = 'img/loading.gif';
}

