﻿// TopMenu scripts
var tin = new Array();
var tout = new Array();
function wait_in(index) {
	var topMenu = $("#TMC" + index);
	if (topMenu != null) {
		$("#TMC" + index).css({ 'display': 'block' });
	}
	tin[index] = null;
}
function waitout(index) {
	var topMenu = $("#TMC" + index);
	if (topMenu != null) {
		$("#TMC" + index).css({ 'display': 'none' });
	}
	tout[index] = null;
	if (tin[index] != null) {
		clearTimeout(tin[index]);
		tin[index] = null;
	}
}
function showSC(index, tpe) {
	if (tout[index] != null) {
		clearTimeout(tout[index]);
		tout[index] = null;
	}
	var topMenu = $("#TMC" + index);
	if (topMenu != null) {
		if (tin[index] == null && topMenu.css('display') == 'none') {
			tin[index] = setTimeout('wait_in(' + index + ')', 300);
		}
	}
}
function hideSC(index) {
	if (tout[index] == null) {
		tout[index] = setTimeout('waitout(' + index + ')', 100);
	}
}

