<!-- Begin

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

//========== Global vars ==============

var MtimerID = "";		// menu downward timer
var MRtimerID = "";		// menu upward timer
var HtimerID = "";		// menu hide timer
var MdeltaX, MdeltaY,MposX,MposY,MlimitW,MlimitH;

function doInit() {		// define window size, menu object and start sliding
	if (NS) {
		winWdth = window.outerWidth;
		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);
	MdeltaX = Math.ceil((winWdth-baseTop-rghtMarg)/2/denom);
	MdeltaY = Math.ceil((winHght-baseTop-hght)/denom);
	MsetT();
}

function MsetT() {		// slide menu downward
	eval('MposX = parseInt(navObj.' + leftPos + ')');
	eval('MposY = parseInt(navObj.' + topPos + ')');
//	eval('navObj.' + leftPos + ' += MdeltaX');
//	eval('navObj.' + topPos + ' += MdeltaY');

	eval('navObj.' + leftPos + ' = parseInt(navObj.' + leftPos + ')+' + MdeltaX);
	eval('navObj.' + topPos + ' = parseInt(navObj.' + topPos + ')+' + MdeltaY);

	MlimitW = (winWdth - wdth - baseTop - rghtMarg)/2;
	MlimitH = winHght - hght;
	MtimerID = setTimeout("MsetT()", 10);
	if ((MposX >= MlimitW) || (MposY >= MlimitH)) {
		doReverse();
	}
}
function doReverse() {		// slide menu upward
	window.clearTimeout(MtimerID);
	eval('MposX = parseInt(navObj.' + leftPos + ')');
	eval('MposY = parseInt(navObj.' + topPos + ')');
	eval('navObj.' + leftPos + ' = parseInt(navObj.' + leftPos + ')+' + MdeltaX);
	eval('navObj.' + topPos + ' = parseInt(navObj.' + topPos + ')-' + MdeltaY);
	MRtimerID = setTimeout("doReverse()", 10);
	if ((MposX >= (groundX - wdth)) || (MposY <= groundY)) {
		MdoStop();
	}
}

function MdoStop() {		// stop sliding menu and call for initial positioning
	window.clearTimeout(MRtimerID);
	initPosit();
	HtimerID = setTimeout("hideMenu()", 2000);
}


//========== Temporary and Debugging Functions ==============
function allStop() {		// abort all sliding
	window.clearTimeout(MtimerID);
	window.clearTimeout(MRtimerID);
	window.clearTimeout(HtimerID);
	initPosit();
}

// End -->

