var ar = new Array();
var arsub = new Array();

var idTimer;
var idTimerSub;

function divShow(idDiv) {
	divHideAll();
	if (window.document.getElementById(idDiv)) {
	window.document.getElementById(idDiv).style.display='block';
	}
}

function divHideAll() {
	divHideAllSub();
	window.clearTimeout(idTimer);
	var i;
	for (i=0; i<(ar.length); i++) {
	if (window.document.getElementById(ar[i])) {
		window.document.getElementById(ar[i]).style.display='none';
		}
	}
}

function divOver() {
	window.clearTimeout(idTimer);
}

function divOut() {
	idTimer = window.setTimeout("divHideAll()",500);
}

function divShowSub(idDiv) {
	divHideAllSub(); 
	if (window.document.getElementById(idDiv)) {
	window.document.getElementById(idDiv).style.display='block';
	}
}

function divHideAllSub() {
	window.clearTimeout(idTimerSub);
	var i;
	for (i=0; i<(arsub.length); i++) {
		if (window.document.getElementById(arsub[i])) {
		window.document.getElementById(arsub[i]).style.display='none';
		}
	}
}

function divOverSub() {
	window.clearTimeout(idTimerSub);
}

function divOutSub() {
	idTimerSub = window.setTimeout("divHideAllSub()",500);
}

// Copyright 2006-2007 javascript-array.com

var timeout	= 500;
var closetimer	= 0;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
//document.onclick = mclose;

