function InitMenu() {
	var oUl = $('#menu li');
	for (i = 0; i < oUl.length; i++) {
		oUl[i].onmouseover = DMenuOver;
		oUl[i].onmouseout = DMenuOut;
	}
}

function DMenuOver() {
	this.className = 'hover';
	var tID = $(this).attr('dmenu');
	if (tID == undefined) return;
	if (isShowedDMenu[tID] == undefined) isShowedDMenu[tID] = 0;
	if (isShowedDMenu[tID] == 1) return;
	isShowedDMenu[tID] = 1;
	$('#' + tID).show();
}

function DMenuOut() {
	this.className = '';
	var tID = $(this).attr('dmenu');
	if (tID == undefined) return;
	if (isShowedDMenu[tID] == 0) return;
	isShowedDMenu[tID] = 0;
	setTimeout("DMenuOutAction('" + tID + "')", 100);
}

function DMenuOutAction(tID) {
	if (isShowedDMenu[tID] == undefined || isShowedDMenu[tID] == 1) return;
	$('#' + tID).hide();
}

function InitInteractive() {
	oDiv = $('.int-sm');
	for (i = 0; i < oDiv.length; i++) {
		if ($(oDiv[i]).attr('active') == 'on') continue;
		oDiv[i].onmouseover = function() {$(this).removeClass('opacity30');};
		oDiv[i].onmouseout = function() {$(this).addClass('opacity30');};
		$(oDiv[i]).addClass('opacity30');
	}
	oDiv = $('.int-big');
	for (i = 0; i < oDiv.length; i++) {
		oDiv[i].onmouseover = function() {
			$(this).removeClass('opacity80');
			var oDivChilds = $('#ref_' + $(this).attr('ref') + ' > div');
			for (j = 0; j < oDivChilds.length; j++) {
				if ($(oDivChilds[j]).attr('active') == 'on') continue;
				$(oDivChilds[j]).removeClass('opacity30');
			}
		};
		oDiv[i].onmouseout = function() {
			$(this).addClass('opacity80');
			var oDivChilds = $('#ref_' + $(this).attr('ref') + ' > div');
			for (j = 0; j < oDivChilds.length; j++) {
				if ($(oDivChilds[j]).attr('active') == 'on') continue;
				$(oDivChilds[j]).addClass('opacity30');
			}
		};
		$(oDiv[i]).addClass('opacity80');
	}
}
