var lines=25
var branch2=""
var defOffst=15
var ex=new Array(lines)
for (f=0;f<lines;f++) {
ex[f]=0}

function domenu(){

maxbranches=5
maxtwigs=5
maxleaves=10
var bigmenu=""
menu=new Array(maxbranches)

for(f=0;f<maxbranches;f++)
{menu[f]=new Array(maxtwigs)}

for(f=0;f<maxbranches;f++){
for(g=0;g<maxtwigs;g++){
menu[f][g]=new Array(maxleaves)}}

for(f=0;f<maxbranches;f++){
for(g=0;g<maxtwigs;g++){
for(h=0;h<maxleaves;h++){

menu[f][g][h]=""}}}


menu[1][0][0]="<div id=#L# name=#P# style=#position:absolute; top:40# onclick=#show1(0,60,'L1')#><a class=#Lstyle#><p>HTML Lessons</a></p></div>"
menu[1][1][0]= "<div class=#B1style# id=#L# name=#L1# onclick=#show1(1,120,'L11')#><p>&nbsp;&nbsp;&nbsp;&nbsp;Beginners</p></div>"
menu[1][1][1]= "<div class=#B2style# id=#L# name=#L11#><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=#lesson1.html# class=#htmlA#>&nbsp;Basic Stuff</a></p></div>"
menu[1][1][2]= "<div class=#B2style# id=#L# name=#L11#><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=#lesson2.html# class=#htmlA#>Formatting Text</a></p></div>"
menu[1][1][3]= "<div class=#B2style# id=#L# name=#L11#><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=#lesson3.html# class=#htmlA#>Adding some &lt;BODY&gt;</a></p></div>"
menu[1][1][4]= "<div class=#B2style# id=#L# name=#L11#><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=#lesson4.html# class=#htmlA#>Formatting Text II</a></p></div>"
menu[1][1][5]= "<div class=#B2style# id=#L# name=#L11#><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=#lesson5.html# class=#htmlA#>Linking Up</a></p></div>"
menu[1][1][6]= "<div class=#B2style# id=#L# name=#L11#><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=#lesson6.html# class=#htmlA#>Yet More Formatting</a></p></div>"
menu[1][1][7]= "<div class=#B2style# id=#L# name=#L11#><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=#lesson7.html# class=#htmlA#>Picture This</a></p></div>"
menu[1][1][8]= "<div class=#B2style# id=#L# name=#L11#><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=#lesson8.html# class=#htmlA#>Under the &lt;TABLE&gt;</a></p></div>"
menu[1][2][0]= "<div class=#B1style# id=#L# name=#L1# onclick=#show1(10,45,'L12')#><p>&nbsp;&nbsp;&nbsp;&nbsp;Advanced</p></div>"
menu[1][2][1]= "<div class=#B2style# id=#L# name=#L12#><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Line 1.2.1</p></div>"
menu[1][2][2]= "<div class=#B2style# id=#L# name=#L12#><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Line 1.2.2</p></div>"
menu[1][3][0]= "<div class=#B1style# id=#L# name=#L1#><p>&nbsp;&nbsp;&nbsp;&nbsp;Reference</p></div>"
menu[1][4][0]= "<div class=#B1style# id=#L# name=#L1#><p>&nbsp;&nbsp;&nbsp;&nbsp;Links</p></div>"
menu[2][0][0]= "<div class=#Lstyle# id=#L# name=#P# style=#position:absolute;visibility:visible; top:60# onclick=#show1(15,40,'L2')#><p>CSS Lessons</p></div>"
menu[2][1][0]= "<div class=#B1style# id=#L# name=#L2#  onclick=#show1(16,30,'L21')#><p>&nbsp;&nbsp;&nbsp;&nbsp;Lessons</p></div>"
menu[2][1][1]= "<div class=#B2style# id=#L# name=#L21#><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=#CSSIntro.html# class=#htmlA#>Introduction</a></p></div>"
menu[2][1][2]= "<div class=#B2style# id=#L# name=#L21#><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=#CSSLesson1.html# class=#htmlA#>Doing it in &lt;STYLE&gt;</a></p></div>"
menu[2][2][0]= "<div class=#B1style# id=#L# name=#L2#  onclick=#show1(19,30,'L22')#><p>&nbsp;&nbsp;&nbsp;&nbsp;Reference</p></div>"
menu[2][2][1]= "<div class=#B2style# id=#L# name=#L22#><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Line 2.2.1</p></div>"
menu[2][2][2]= "<div class=#B2style# id=#L# name=#L22#><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Line 2.2.2</p></div>"
menu[2][3][0]= "<div class=#B1style# id=#L# name=#L2#><p>&nbsp;&nbsp;&nbsp;&nbsp;Links</p></div>"
menu[3][0][0]= "<div class=#Lstyle# id=#L# name=#P# style=#position:absolute;visibility:visible; top:80#><p>Javascript Lessons</p></div>"
menu[4][0][0]= "<div class=#Lstyle# id=#L# name=#P# style=#position:absolute;visibility:visible; top:100#><p>DHTML Lessons</p></div>"


for(f=0;f<maxbranches;f++){
for(g=0;g<maxtwigs;g++){
for(h=0;h<maxleaves;h++){

bigmenu=bigmenu+menu[f][g][h]}}}

while (bigmenu.indexOf('#')!=-1)
{bigmenu=bigmenu.replace('#','"')}

document.writeln(bigmenu)
}


function show1(Lidx,Offst, Brnch){

	
	if (ex[Lidx]==0)
	
	{		ex[Lidx]=1;
		for (f=Lidx+1;f<lines;f++)
		{
			line=document.all("L",f)		
			if (line.style.visibility =="visible")
			{
				line.style.pixelTop=line.style.pixelTop+Offst
				
			}
		}
		lCount=0		
		for (f=Lidx+1;f<lines;f++)
		{	
				if (document.all("L",f).name==Brnch){ 
				document.all("L",f).style.visibility="visible"
				document.all("L",f).style.pixelTop=document.all("L",Lidx).style.pixelTop+defOffst*(1+lCount);			
				
				lCount++

				};

		}
	}
	else
	{
	for (f=Lidx+1;f<lines;f++)
		{
		
		
		line=document.all("L",f)		
		branch2=line.name.substr(0,2)
		if ((line.name ==Brnch) || (branch2 ==Brnch))
			{
			line.style.pixelTop=0
			line.style.visibility="hidden"
			if (ex[f]==1) {ex[f]=0}
			
			}
		}
		g=document.all("L",Lidx).style.pixelTop		
		
		for (f=Lidx+1;f<lines;f++)
		{
		line=document.all("L",f)		
		if (line.style.visibility =="visible")
			{
			
			if (line.name=="P")
				{
				line.style.pixelTop=g+20
				
				}
			else
				{
				line.style.pixelTop=g+defOffst
				
				}
			g=document.all("L",f).style.pixelTop;
			}
		}
	ex[Lidx]=0
	}
}
