<!-- Begin

//======  Dynamic VR Design site by V.Raguimov (c) 2002  =======

//========== Functions ==============

function hideMenu() {
	hideSubMenu();
	eval('hideObj = ' + dRef + '"navM"' + sRef);
	hideObj.visibility = (visFlag ? "hidden" : "visible");
	visFlag = !visFlag;
}

function hideSubMenu() {
	for (var i=0; i<subLength; i++) {
//		eval('navObj'+i+' = document' + dRef + '["nav'+i+'"]' + sRef);
		eval('navObj'+i+'.visibility = (visFlag ? "hidden" : "visible")');
		buryPopLayer();
	}
}

function initPosit() {		// define window size, menu objects and their positions
//	alert(isNav4);
	if (NS) {
		winWdth = window.outerWidth;
//		if(window.pageYOffset){
//			winWdth -= 14;
//		}
		winHght = window.innerHeight;
	} else {
		winWdth = document.body.clientWidth;
		winHght = document.body.clientHeight;
		document.all.mainCell.style.height = winHght - baseWidth - 3;
		document.all.contentCell.style.width = winWdth - baseWidth - wdth - rghtMarg - 3;
		document.all.contentCell.style.height = winHght - baseWidth - 83;
	}
	groundX = winWdth - baseWidth - rghtMarg;
	var menuX = groundX - wdth;
	eval('navObj = ' + dRef + '"navM"' + sRef);
	eval('navObj.' + leftPos + ' = menuX');
	eval('navObj.' + topPos + ' = groundY');
	navObj.visibility = "visible";
	for (var i=0; i<subLength; i++) {
		eval('navObj'+i+' = ' + dRef + '"nav"+i' + sRef);
		eval('navObj'+i+'.' + leftPos + ' = menuX+10');
		eval('navObj'+i+'.' + topPos + ' = groundY+hght-hght'+i);
		eval('navObj'+i+'.visibility = "visible"');
	}
	eval('clsObj = ' + dRef + '"closeBox"' + sRef);
	eval('clsObj.' + leftPos + ' = menuX+88');
	eval('clsObj.' + topPos + ' = groundY');
	clsObj.visibility = "visible";
}

function doResize() {
	if (NS) {
		location.reload();
	} else {
		initPosit();
	}
}

function showSub(subm) {		// define submenu objects to slide
	hideSub(subm);
	eval('sFlag = subFlag' + subm);
	if (!sFlag) {
		setT(subm);
		for (var i=0; i<subLength; i++) {
			eval('subFlag' + i + ' = false');
		}
		eval('subFlag' + subm + ' = true');
		eval('popupObj = navObj' + subm);
		if (isNav4) {
			eval('ieObj = ' + dRef + '"nav' + subm + '"]');
		} else {
			eval('ieObj = ' + dRef + '"nav' + subm + '")');
		}
		layerFlag = true;
	} else {
		hideSub(subm);
		eval('subFlag' + subm + ' = false');
	}
}

function hideSub(subm) {		// hide all submenu objects
	for (var i=0; i<subLength; i++) {
		eval('navObj'+i+'.' + topPos + ' = groundY+hght-hght'+i);
	}
}

function setT(sb) {		// slide submenu objects
	eval('navObj' + sb + '.' + topPos + ' = parseInt(navObj' + sb + '.' + topPos + ')+' + mStep);
	eval('var limitH = hght'+sb);
	delta += mStep;
	timerID = setTimeout("setT(" + sb + ")", 10);
	if (delta >= limitH) {
		doSbmStop();
		delta = 1;
	}
}
function doSbmStop() {		// stop sliding submenu objects
	window.clearTimeout(timerID);
}

function motionDetector() {		// start events capture
	if (NS) {
		window.captureEvents(Event.MOUSEMOVE | Event.MOUSEUP);
		window.onmousemove = keepCoord;
		window.onmouseup = clickOut;
	} else {
		document.onmousemove = keepCoord;
		document.onmouseup = clickOut;
	}
}

function keepCoord(evt) {		// define cursor position
	if (NS) {
		x = evt.pageX;
		y = evt.pageY;
	} else {
		x = event.clientX;
		y = event.clientY;
	}
}

function clickOut(evt) {		// find if click occured inside menu and sub area
	keepCoord(evt);

	if (layerFlag) {
		if (NS) {
			if ((x > popupObj.left) && (x < popupObj.left + popupObj.clip.width) && (y > groundY) && (y < popupObj.top + popupObj.clip.height)) {
				keepCoord(evt);
			} else {
				buryPopLayer();
			}
		} else {
			if ((x > ieObj.offsetLeft) && (x < ieObj.offsetLeft + ieObj.offsetWidth) && (y > groundY) && (y < ieObj.offsetTop + ieObj.offsetHeight)) {
				keepCoord(evt);
			} else {
				if ((x < document.body.clientWidth) && (y < document.body.clientHeight)) {
				buryPopLayer();
				layerFlag = false;
				}
			}
		}
	}
}

function buryPopLayer() {		// hide all submenu objects and set their flags
	for (var i=0; i<subLength; i++) {
		hideSub(i);
		eval('subFlag' + i + ' = false');
	}
}

//========== Temporary and Debugging Functions ==============
//function doNothing() {
//}

// End -->


