// Copyright (C) 1999, Tomás Boixet
// ================================

function imenu(menum,onoff) {
	changeImage('menuDiv','menu'+menum+'Img','menu'+menum+'Img'+onoff)
}

function chgImenu(div,img1,img2,mm) {
	changeImage(div,img1,img2)
	if (mm==0) hideMenu()
	else	showMenu()
}

function showMenu() {
	if(menu.wipeActive) setTimeout("showMenu()",10)
	else {
		if(menu.clipValues('r')<160) menu.wipeTo(null,160,null,null,4,10)
	}
}

function hideMenu() {
	if(menu.wipeActive) setTimeout("hideMenu()",10)
	else {
		if(menu.clipValues('r')>20) menu.wipeTo(null,20,null,null,4,10)
	}
}

function mousemenuOff() {
	if(mshow==0){
		var x = (is.ns)? e.layerX:event.offsetX
		if(x>160) hideMenu()
	}
}

var str='<DIV ID="menuDiv"><p>&nbsp;</p>'
for (var i=1;i<9;i++) {
	str=str+'<p>'
	if(i!=mmain) str=str+'<a href="main'+i+'.htm" onmouseover="imenu('+i+',1)" onmouseout="imenu('+i+',0)">'
	str=str+'<img name="p'+i+'Img" src="../images/pmenu'+i+'.gif" width="15" height="15" border="0">'
	str=str+'<img name="menu'+i+'Img" src="images/men'+i+'off.gif" width="130" height="15" border="0" hspace="6">'
	if(i!=mmain) str=str+'</a>'
	str=str+'</p>'
	preload('menu'+i+'Img0','images/men'+i+'off.gif')
	preload('menu'+i+'Img1','images/men'+i+'on.gif')
}
str=str+'</DIV>'
writeCSS(css('menuDiv',0,0,160,winH,'black','clip:rect(0,160,'+winH+',0)'))
document.write(str)
changeImage('menuDiv','menu'+mmain+'Img','menu'+mmain+'Img1')
menu = new DynLayer("menuDiv")
menu.clipTo(0,160,winH,0)
if(mshow==0) hideMenu()
menu.elm.onmouseover = showMenu
menu.elm.onmouseout = mousemenuOff
