function w(t){
	d.write(t)
	d.close()
}
function gbid(n){
	if(document.all){
		return document.all[n]
	} else {
		return d.getElementById(n)
	}
}
function mover(n,td){
	td.style.backgroundColor='#000099'
	td.style['color']='white'
	var st=gbid('DDMSubmenu'+n).style
	st.visibility='visible'
	st.width=Math.floor(document.body.clientWidth*.23)-2
}
function menumover(n,td){
	td.style.backgroundColor='#000099'
	var st=gbid('DDMSubmenu'+n).style
	st.visibility='visible'
	st.left=td.style.left
	st.width=Math.floor(document.body.clientWidth*.23)-2
}
function mout(n,td){
	td.style.backgroundColor=''
	td.style['color']=''
	gbid('DDMSubmenu'+n).style.visibility='hidden'
}
function addsub(whichmenu, text, link){
// populate the menu array with submenu data
	// submenu will link to first word of its name:
	var ln='items.php?category_2='+text.replace(/ .+/, '')
	// if link is supplied, use that instead:
	if(arguments.length>2) ln=arguments[2]
	// make sure there is an object at whichmenu:
	if(!menu[whichmenu]) menu[whichmenu]={img:'', subs:[]}
	// make sure there is a subs array:
	if(!menu[whichmenu].subs) menu[whichmenu].subs=[]
	// add the submenu object:
	menu[whichmenu].subs[menu[whichmenu].subs.length]={text:text, link:ln}
}

d=document
menu=[]
rows=['','']
menu[1]={img:'Resources\/0.gif'}
menu[2]={img:'Resources\/0a.gif'}
menu[3]={img:'Resources\/0b.gif'}
menu[4]={img:'Resources\/0c.gif'}
addsub(1, 'decorative canes')
addsub(1, 'system canes')
addsub(1, 'cane stands', 'items.php?category_2=stands')
addsub(2, 'guns')
addsub(2, 'swords & daggers')
addsub(2, 'armour')
addsub(2, 'militaria')
addsub(3, 'news', 'news.php')
addsub(3, 'books & dvds', 'items.php?category_2=books')
addsub(3, 'history of canes', 'historyofcanes.html')
addsub(3, 'miscellaneous')
addsub(3, 'curiosa')
addsub(3, 'gifts')
addsub(4, 'about us', 'aboutus.html')
addsub(4, 'ordering', 'ordering.html')
addsub(4, 'find us', 'findingus.html')
addsub(4, 'credits', 'credits.html')
// Now we know how long the menu is, we can draw the 
// logo table cell. This is only necessary because we are using 
// a table to align the logo with the leftmost menu item, and 
// we want the table to squeeze nicely for narrow windows
w('<table width="100%" border=0 cellpadding=0 cellspacing=0><td rowspan=3>&nbsp;</td><td colspan=' +(menu.length-1) +'>')
w('<div style="margin-top:14px;margin-bottom:14px">')
w('<a href="index.html"><img src="Resources\/item3a.gif" border=0 width=526 height=26 alt=""><\/a>')
w('<\/div><\/td><td rowspan=3>&nbsp;<\/td><\/tr>')
for(var i=1; i<menu.length; i++){
	rows[0]+='<td valign=bottom class=menu onMouseOver="menumover('+i+',this)" onMouseOut="mout('+i+',this)"'
	if(i==1) rows[0]+=' style="border-left:1px solid grey"'
	rows[0]+='><img src="' +menu[i].img +'" border=0 alt=""><\/td>'
	rows[1]+='<td valign=top><div class=DDMLaySty id="DDMSubmenu' +i +'"><table class=submenu cellspacing=0>'
	for(var j=0; j<menu[i].subs.length; j++){
		rows[1]+='<tr onMouseOver="menumover('+i+',this)" onMouseOut="mout('+i+',this)"><td class=submenu onClick="window.open(\'' +menu[i].subs[j].link +'\',\'_top\');return false" onMouseOver="mover('+i+',this)" onMouseOut="mout('+i+',this)">' +menu[i].subs[j].text +'<\/td><\/tr>'
	}
	rows[1]+='<\/table><\/div><\/td>'
}
w('<tr>'+rows[0]+'<\/tr><tr>'+rows[1]+'<\/tr>')
w('<\/table>')
