var req = 0

var hpos = new Array()
var menu = new Array()
var link = new Array()
var xtra = new Array()

var fade = 0

hpos[02] = 220
hpos[03] = 330
hpos[04] = 440

menu[20] = "CATALOGUE"
menu[21] = "PHONE BIDDING"
menu[22] = "ABSENTEE BIDDING"
menu[23] = "CONDITION REPORTS"
menu[24] = "BUYING AT ELDERS"
menu[25] = "TERMS & CONDITIONS"
menu[26] = "TRANSPORT & FREIGHT"
menu[27] = "MAILING LIST"
// menu[28] = "AUCTION RESULTS"

menu[30] = "APPRAISALS"
menu[31] = "CONSIGNING WORKS"
menu[32] = "Q & A"

menu[40] = "HISTORY"
menu[41] = "OUR GALLERY"
menu[42] = "SOCIAL PAGES"

link[20] = "catalogue"
link[21] = "bidding"
link[22] = "bidding"
link[23] = "reports"
link[24] = "buyatelder"
link[25] = "terms"
link[26] = "transport"
link[27] = "mailing"
// link[28] = "realisation"

link[30] = "appraisals"
link[31] = "consigning"
link[32] = "sellingqa"

link[40] = "history"
link[41] = "ourgallery"
link[42] = "social"

xtra[20] = "Browse our online catalogue"
xtra[21] = "Instructions on placing a phone bid"
xtra[22] = "?"

xtra[30] = "How much is your Art worth?"

xtra[40] = "How Elder Fine Art was built"

function navOn() {
stream = setInterval('request()',25)
}

function request() {
if (req) { 
	req -= 1 
	if (req == 0) {
		fade = 100
		}
	}
if (fade) {
	fade -= 5
		dropBox.style.filter = 'alpha(opacity = ' + fade + ')'
		dropBox.style.opacity = (fade / 100)
	if (fade == 0) {
		dropBox.style.display = 'none'
		}
	}
switch(slideshow) {
	case 1:
		engine()
	break
	case 2:
		lilEngine()
	break	
	}
}

function overTab(ot,col) {
if (col) {
	document.getElementById('exTab' + ot).style.backgroundColor = '#202020'
	}
else {
	document.getElementById('exTab' + ot).style.backgroundColor = '#323232'
	}
}


function oMenu(om,id) {
if (fade == 0) { req = 2 }
document.images['bt' + om].src = 'gfx/but_' + om + id + '.gif'
}

function wipeMenu(wm,id) {
req = wm
if (id) { document.images['bt' + id].src = 'gfx/but_' + id + '1.gif' }
}

function listMenu(lm) {

document.images['bt' + ((lm / 10) + 1)].src = 'gfx/but_' + ((lm / 10) + 1) + '2.gif'

dropBox.style.display = 'none'
dropBox.style.left = hpos[lm / 10]
dropBox.style.filter = 'alpha(opacity = 100)'
dropBox.style.opacity = 1

req = 0
fade = 0

var text = "<table width='150px' border='0' cellspacing='0' cellpadding='0' style='margin: 0px' onmouseout='wipeMenu(30)'>"
var list = lm 

do {	
	text += "<tr><td class='dropTD' onmouseover='overTab(" + list + ",1);wipeMenu(0)' onmouseout='overTab(" + list + ")' id='exTab" + list + "'>"

//	if (xtra[list] != undefined) {
//		text += "<img src='gfx/add.gif' style='cursor: pointer' onclick='expand(" + list + ")' id='exImg" + list + "'>"
//		}
//	else {
//		text += "<img src='gfx/non.gif'>"
//		}

	text += "<a href='index.php?page=" + link[list] + "' class='menuText'>&nbsp;" + menu[list] + "</a>" 
	text += "<div class='dropEx' id='exTxt" + list + "'>"
	text += xtra[list]
	text += "</div></td></tr>"
	list += 1
	}
	while (menu[list] != undefined && (list / 10) != parseInt(list / 10))

text += "</table>"

dropBox.innerHTML = text
dropBox.style.display = 'block'
}

function expand(exp) {
tree = document.getElementById('exImg' + exp).src + ""
tree = tree.substring(tree.length - 7, tree.length)

if (tree == "sub.gif") { 
	document.getElementById('exTxt' + exp).style.display = 'none'
	document.getElementById('exImg' + exp).src = 'gfx/add.gif'
	}

if (tree == "add.gif") { 
	document.getElementById('exTxt' + exp).style.display = 'block' 
	document.getElementById('exImg' + exp).src = 'gfx/sub.gif'
	} 
}