// BUILD LAYERS/OBJECTS 

function altBuildDeck()	{ if (NoScripts)  //alternative image if low level browser
{ 	var htmlStr = ""
	htmlStr =htmlStr
	+ "<table border='6' cellpadding='0' cellspacing='0' bgcolor='#b5846b'><tr><td>"
	+ "<img src='deck6.jpg' width='426' height='282'>"
	+ "</td></tr></table>";
	document.write(htmlStr);
}
}

function buildDeck() {	if (!NoScripts)
{	var htmlStr = ""
	for (var i=1; i<7; i++) 
	{	htmlStr += cbObject("deck"+i,25,20)
		+ "<table border='6' cellpadding='0' cellspacing='0' bgcolor='#b5846b'><tr><td>"
		+ "<img src='deck" + i + ".jpg' width='426' height='282'>"
		+ "</td></tr></table>"
		+ cbObjEnd;
	}
	document.write(htmlStr);
	for (var i=1; i<7; i++) 
	{	j= 7-i;
		eval(cbObj + cbLB + "deck" + i + cbRB + cbIndex + "='" + j + "';");
	}
}}

function showDeck() { if (!NoScripts)
{	clearInterval(intervalID);
	x=0; 
	stage=stage+1;
	if (stage == 7)
	{	// start over and pause at first stage
		stage = 0;
		for (var i=1; i<7; i++) 
		{	eval(cbObj + cbLB + "deck" + i + cbRB + cbVisibility + "='" + cbVisible + "';");
			cbClipLeft("deck"+i,0);
		}
	}
	else {	if (stage==6)
	{	var lastStage=stage-1;
		eval(cbObj + cbLB + "deck" + lastStage + cbRB + cbVisibility + "='" + cbHidden + "';");
	}
	else {	if (stage==1)
	{	// don't clear last stage
		intervalID = setInterval("curtain()",50);
	}
	else 
	{	var lastStage=stage-1;
		eval(cbObj + cbLB + "deck" + lastStage + cbRB + cbVisibility + "='" + cbHidden + "';");
		intervalID = setInterval("curtain()",50);
	}}}
}}

function curtain() 
{	x=x+10;
	if (x > 426)
	{	clearInterval(intervalID);
	}
	cbClipLeft("deck"+stage,x);
}	

// INCLUDE HOVER FUNCTIONS

function over(item) 
{	clearTimeout(timerID1);
	if (defaultMenu == null)
	{	defaultMenu = "1"
		var name;
		for (i in menu)
		{	name = "n" + i;
			if (eval("document." + name + ".src.indexOf('_on')")!=-1)
			{	defaultMenu = i;
				lastMenu = i;
				break;
			}
		}
	}
	source = "images/point";
	document.images["n"+lastMenu].src=source+".gif";
	document.images["n"+item].src=source+"_on.gif";
	cbHide(menu[lastMenu]['name']);
	cbShow(menu[item]['name']);
	window.status = menu[item]["status"];
	lastMenu = item; 
}

function out() 
{	timerID1=setTimeout("timedOut()",200);
}

function timedOut() 
{	document.images["n"+lastMenu].src=source+".gif";
	document.images["n"+defaultMenu].src=source+"_on.gif";
	cbHide(menu[lastMenu]['name']);
	window.status = "";
	lastMenu = defaultMenu;
}

function subOver(item) 
{	clearTimeout(timerID1);	
	source = "images/subnav/point";
	eval("document." + item + ".src = source + '_on.gif';");
	lastItem = item;
}

function subOut() 
{	source = "images/subnav/point";
	eval("document." + lastItem + ".src = source + '.gif';");
	// document.images[lastItem].src = source + '.gif';   doesn't work when nested in a layer
}


function turnOver() {
	what = window.event.srcElement;
	if ((what.tagName == "IMG") && (what.name != "on")) {
		what.src = what.src.substring(0,(what.src.indexOf(".gif"))) + "_over.gif";
		window.event.cancelBubble = true;
	}
}

function turnOff() {
	what = window.event.srcElement
	if ((what.tagName == "IMG") && (what.name != "on")) {
		what.src = what.src.substring(0,(what.src.indexOf("_over.gif"))) + ".gif";
		window.event.cancelBubble = true;
	}
}

