var menutitle=new Array()
var menuwidth=206
var pos_left=561
var pos_top=95

var menutitle=new Array()
menutitle[0]="0,22"
menutitle[1]="22,34"
menutitle[2]="94,106"
menutitle[3]="142,154"
menutitle[4]="178,190"
menutitle[5]="320,332"

var menutitleheight=new Array()
var menutitletop=new Array()
var menutitlebottom=new Array()
var menusubheight=new Array()
var menuisopen=new Array()
	
for (i=0;i<=menutitle.length-1;i++) {
	var yy_height=menutitle[i].split(",")
	menutitleheight[i]=yy_height[1]-yy_height[0]
	menutitletop[i]=yy_height[0]
	menutitlebottom[i]=yy_height[1]
}

for (i=0;i<=menutitle.length-1;i++) {
	menuisopen[i]=false
}

for (i=0;i<=menutitle.length-2;i++) {
	var ii=i+1
	var yy_height1=menutitle[i].split(",")
	var yy_height2=menutitle[ii].split(",")
	menusubheight[i]=yy_height2[0]-yy_height1[1]
}
menusubheight[menutitle.length-1]=menutitleheight[menutitle.length-1]
var subheight=0
var cliptop=0
var clipbottom=0
var clipleft=0
var clipright=menuwidth
var openitem
var i_sublength=0

function initiate() {
    for (i=0;i<=menutitle.length-1;i++) {
	    menuisopen[i]=false
    }
	if (document.all) {
		for (i=0;i<=menutitle.length-1;i++) {
			cliptop=menutitletop[i]
			clipbottom=menutitlebottom[i]
			var thisitem=eval("document.all.menu"+i+".style")
			if (i==0) {
				thisitem.visibility="VISIBLE"
				thisitem.posTop=pos_top
				thisitem.posLeft=pos_left
			}
			if (i>0) {
				var i_above=i-1
				var thisitemabove=eval("document.all.menu"+i_above+".style")
				thisitem.visibility="VISIBLE"
				thisitem.posTop=thisitemabove.posTop-menusubheight[i_above]
				thisitem.posLeft=pos_left
			}
        	thisitem.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
		}
	}
	if (document.layers) {
		for (i=0;i<=menutitle.length-1;i++) {
			cliptop=menutitletop[i]
			clipbottom=menutitlebottom[i]
			var thisitem=eval("document.menu"+i)
			if (i==0) {
				thisitem.visibility="VISIBLE"
				thisitem.top=pos_top
				thisitem.left=pos_left
			}
			if (i>0) {
				var i_above=i-1
				var thisitemabove=eval("document.menu"+i_above)
				thisitem.visibility="VISIBLE"
				thisitem.top=thisitemabove.top-menusubheight[i_above]
				thisitem.left=pos_left
			}
        	thisitem.clip.left=clipleft
			thisitem.clip.right=clipright
			thisitem.clip.top=cliptop
			thisitem.clip.bottom=clipbottom
		}
	}
}

function show(openthisitem) {
	i_menus=0
	openitem=openthisitem
	subheight=0
	if (menuisopen[openitem]) {
		for (i=0;i<=menutitle.length-1;i++) {
	        menuisopen[i]=false
        }
		initiate()
	}
	else {
	if (document.all) {
		for (i=0;i<=menutitle.length-1;i++) {
			cliptop=menutitletop[i]
			clipbottom=menutitlebottom[i]
			var thisitem=eval("document.all.menu"+i+".style")
			if (i==0) {
				thisitem.posTop=pos_top
			}
			if (i>0) {
				var i_above=i-1
				var thisitemabove=eval("document.all.menu"+i_above+".style")
				thisitem.posTop=thisitemabove.posTop-menusubheight[i_above]
			}
        	thisitem.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"

		}
	}
	if (document.layers) {
		for (i=0;i<=menutitle.length-1;i++) {
			cliptop=menutitletop[i]
			clipbottom=menutitlebottom[i]
			var thisitem=eval("document.menu"+i)
			if (i==0) {
				thisitem.top=pos_top
			}
			if (i>0) {
				var i_above=i-1
				var thisitemabove=eval("document.menu"+i_above)
				thisitem.top=thisitemabove.top-menusubheight[i_above]
			}
        	thisitem.clip.left=clipleft
			thisitem.clip.right=clipright
			thisitem.clip.top=cliptop
			thisitem.clip.bottom=clipbottom
		}
	}
	scroll()
	}
}

function scroll() {
if (i_sublength<=menusubheight[openitem]) {
	if (document.all) {
		for (i=0;i<=menutitle.length-1;i++) {
			if (i!=openitem) {
				cliptop=menutitletop[i]
				clipbottom=menutitlebottom[i]
				subheight=0
				}
			if (i==openitem) {
				menuisopen[openitem]=true
				cliptop=menutitletop[i]
				clipbottom=parseInt(menutitlebottom[i])+i_sublength
				subheight=i_sublength
			}
			var thisitem=eval("document.all.menu"+i+".style")
			if (i==0) {
				thisitem.posTop=pos_top
			}
			if (i<menutitle.length-1) {
				var i_below=i+1
				var thisitembelow=eval("document.all.menu"+i_below+".style")
				thisitembelow.posTop=thisitem.posTop-menusubheight[i]+subheight
			}
        	thisitem.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
		}
	}
	if (document.layers) {
		for (i=0;i<=menutitle.length-1;i++) {
			if (i!=openitem) {
				cliptop=menutitletop[i]
				clipbottom=menutitlebottom[i]
				subheight=0
				}
			if (i==openitem) {
				menuisopen[openitem]=true
				cliptop=menutitletop[i]
				clipbottom=parseInt(menutitlebottom[i])+i_sublength
				subheight=i_sublength
			}
			var thisitem=eval("document.menu"+i)
			if (i==0) {
				thisitem.posTop=pos_top
			}
			if (i<menutitle.length-1) {
				var i_below=i+1
				var thisitembelow=eval("document.menu"+i_below)
				thisitembelow.top=thisitem.top-menusubheight[i]+subheight
			}
        	thisitem.clip.left=clipleft
			thisitem.clip.right=clipright
			thisitem.clip.top=cliptop
			thisitem.clip.bottom=clipbottom
		}
	}
	i_sublength+=2
	var timer=setTimeout("scroll()",20)
}
else {
    for (i=0;i<=menutitle.length-1;i++) {
        menuisopen[i]=false
    }
	i_sublength=0
	clearTimeout(timer)
}
}