// JavaScript Document
//Noel's own Navigation script
var timerID
var settheAlpha
var theboolforMenu
var theboolforChild
var MenuDisappearTime
var Menuname
var storeLayerNameOld
//
var Menuchildname

//
theboolforChild = true
theboolforMenu = true
MenuDisappearTime = 3500
settheAlpha = 0;


function nmenuIn(getthelayerName) {
	Menuname = document.getElementById(getthelayerName);
	if (storeLayerNameOld != Menuname && storeLayerNameOld != null ) {
		//var temp = document.getElementById(storeLayerNameOld);
		storeLayerNameOld.style.visibility = "hidden"	
		//storeLayerNameOld = Menuname
		settheAlpha = 0
		storeLayerNameOld.style.filter = "Alpha(Opacity=0)";
	} 
	Menuname.style.visibility = "visible"
	//document.all.abt_layer.style.visibility = "visible"
	timerID = self.setTimeout("animateMenu()", 1);
	storeLayerNameOld = Menuname
	
	
	
}
function animateMenu() {

	if (settheAlpha < 80) {
		self.setTimeout("animateMenu()", 1);
		settheAlpha = settheAlpha + 20;
		//Menuname.style.filter = "Alpha(Opacity="+settheAlpha+")";
		Menuname.style.filter = "alpha(opacity="+settheAlpha+");";
		
	} else {
		//settheAlpha = 0;
		clearTimeout(timerID)
	}
} 
function nmenuOut() {

	setTimeout("animatedoutMenu()", MenuDisappearTime);
}

function animatedoutMenu() {

	if (theboolforMenu && Menuname!=null) {
		settheAlpha = 0;
		storeLayerNameOld = null;
		Menuname.style.filter = "Alpha(Opacity=0)";
		Menuname.style.visibility = "hidden"
	}
}

function stopMtimer() {
	theboolforMenu = false;
}
function startMtimer() {
	theboolforMenu = true;
}

function nclearmenu() {
	if (storeLayerNameOld != null ) {
		storeLayerNameOld.style.visibility = "hidden"	
		settheAlpha = 0
		storeLayerNameOld = null;
	} 	
}

function bringoutChild(gettheChild) {
	 Menuchildname = document.getElementById(gettheChild)
	 theboolforMenu = false;
	 Menuchildname.style.visibility = "visible";
	
}

function closeoutChild() {
	setTimeout("animateChildclose()", 500);
	theboolforChild = true;
}

function animateChildclose() {
	if (theboolforChild) {
	Menuchildname.style.visibility = "hidden";
	}
}

function stopChildtimer() {
	theboolforChild = false;
}

function startChildtimer() {
	theboolforChild = true;
}
