﻿var timer = new Array(8);
var prevIndex;

function menuOverHandler(index, id) {
	clearTimeout(timer[index]);
	$("#" + id).fadeIn('fast');
	if (prevIndex != index) {
		hideMenuHandler(prevIndex, id);
	}
}

function menuOutHandler(index, id) {
	timer[index] = setTimeout("hideMenuHandler(\"" + id + "\")", 400);
	prevIndex = index;
}

function hideMenuHandler(id) {
	$("#" + id).fadeOut('fast');
}

function overSubMenu(index) {
	clearTimeout(timer[index]);
}