// CREDITS:
// Hierarchical Menu 3.0: VERSION WITH IMAGE-BUTTONS by Urs Dudli and Peter Gehrig 
// Copyright (c) 1999 Peter Gehrig and Urs Dudli. All rights reserved.
// Permission given to use the script provided that this notice remains as is.
// Additional scripts can be found at http://www.24fun.ch.
// info@24fun.ch
// 1/25/2000

//  **********************************************************************************
loaded = true;
var menublock=new Array() 			// no need to change this
var plus_i=0 						// no need to change this
var mouseoverimage= new Array()

menublock[0]="images/newOff.GIF;"+ 	// filename first button-image
			 "images/newOn.GIF;"+	// filename rollover-image of first button-image
			 ";"+					// do not change this
			 ";"+					// do not change this
			 "Arial;"+ 				// font sublinks
			 "1;"+					// fontsize sublinks
			 "333333;"+				// fontcolor sublinks
			 "1;"+					// fontweight sublinks, 1 means bold, 0 means normal
			 "Home|#|;"+ 			// text|URL|target of mainlink
			 "NEW Curves & Swerves|featured.htm|;"+
			 "Carol's NEW Book|book.htm|;"
			 
menublock[1]="images/miniOff.GIF;"+ 		// filename second button-image
			 "images/miniOn.GIF;"+			// filename rollover-image of  second button-image
			 ";"+					// do not change this
			 ";"+					// do not change this
			 "Arial;"+ 				// font sublinks
			 "1;"+					// fontsize sublinks
			 "333333;"+				// fontcolor sublinks
			 "1;"+					// fontweight sublinks, 1 means bold, 0 means
			 "Mini Patterns|#|;"+
			 "<nobr>Quilt Patterns</nobr>|patterns.htm|;"+
			 "Featured Pattern|featured.htm|;"+	
			 "Apple Core|appleCore.htm|;"+
			 "Circle of Hearts|hearts.htm|;"+
			 "Garden Star|gardenStar.htm|;"+
			 "<nobr>Hexagon Flower Garden</nobr>|hexGarden.htm|;"+
			 "Mariner's Compass|compass.htm|;"+
			 "Giant Dahlia|dahlia.htm|;"+
			 "Drunkard's Path|templateDPath.htm|;"


menublock[2]="images/galleryOff.GIF;"+ 	// filename fourth button-image
			 "images/galleryOn.GIF;"+	// filename rollover-image of fourth button-image
			 ";"+					// do not change this
			 ";"+					// do not change this
			 "Arial;"+ 				// font sublinks
			 "1;"+					// fontsize sublinks
			 "333333;"+				// fontcolor sublinks
			 "1;"+					// fontweight sublinks, 1 means bold, 0 means
			 "Quilt Gallery|#|;"+	                    // text and URL of mainlink
		 	 "<nobr>Quilters' Photo Gallery</nobr>|gallery.htm|;"+
		 	 "<nobr>Submit your Quilt Photo</nobr>|gallerySubmit.htm|;"+
		 	 "Quilting Links|quiltLinks.htm|;"

menublock[3]="images/customOff.GIF;"+ 	// filename fourth button-image
			 "images/customOn.GIF;"+	// filename rollover-image of fourth button-image
			 ";"+					// do not change this
			 ";"+					// do not change this
			 "Arial;"+ 				// font sublinks
			 "1;"+					// fontsize sublinks
			 "333333;"+				// fontcolor sublinks
			 "1;"+					// fontweight sublinks, 1 means bold, 0 means
			 "Custom Templates|#|;"+	                  
			 "<nobr>Design Your Template</nobr>|custom.htm|;"+	
			 "<nobr>Drunkard's Path Template</nobr>|templateDPath.htm|;"

menublock[4]="images/classesOff.GIF;"+ 	// filename fourth button-image
			 "images/classesOn.GIF;"+	// filename rollover-image of fourth button-image
			 ";"+					// do not change this
			 ";"+					// do not change this
			 "Arial;"+ 				// font sublinks
			 "1;"+					// fontsize sublinks
			 "333333;"+				// fontcolor sublinks
			 "1;"+					// fontweight sublinks, 1 means bold, 0 means
			 "Classes|#|;"+	                  
			 "Lesson Topics|classes.htm|;"+	
			 "Scheduling Carol|classSchedule.htm|;"+	
			 "Next Appearance|appearance.htm|;"

menublock[5]="images/tipsOff.GIF;"+ 	// filename fourth button-image
			 "images/tipsOn.GIF;"+	// filename rollover-image of fourth button-image
			 ";"+					// do not change this
			 ";"+					// do not change this
			 "Arial;"+ 				// font sublinks
			 "1;"+					// fontsize sublinks
			 "333333;"+				// fontcolor sublinks
			 "1;"+					// fontweight sublinks, 1 means bold, 0 means
			 "Quilting Tips|#|;"+	                  
			 "<nobr>Ask Carol Message Bd</nobr>|bbs/index.shtml|;"+	
			 "Quilting Tips|tips.htm|;"

menublock[6]="images/aboutOff.GIF;"+ 	// filename fourth button-image
			 "images/aboutOn.GIF;"+	// filename rollover-image of fourth button-image
			 ";"+					// do not change this
			 ";"+					// do not change this
			 "Arial;"+ 				// font sublinks
			 "1;"+					// fontsize sublinks
			 "333333;"+				// fontcolor sublinks
			 "1;"+					// fontweight sublinks, 1 means bold, 0 means
			 "About|#|;"+	                  
			 "Carol Henry's Bio|carol.htm|;"+	
			 "Contact Information|contact.htm|;"


menublock[7]="images/ordersOff.GIF;"+ 	// filename fourth button-image
			 "images/ordersOn.GIF;"+	// filename rollover-image of fourth button-image
			 ";"+					// do not change this
			 ";"+					// do not change this
			 "Arial;"+ 				// font sublinks
			 "1;"+					// fontsize sublinks
			 "333333;"+				// fontcolor sublinks
			 "1;"+					// fontweight sublinks, 1 means bold, 0 means
			 "Purchasing Info|#|;"+	                  
			 "<nobr>How to Place an Order</nobr>|howToOrder.htm|;"+	
			 "Place Order|order.htm|;"	

// The following block is different. It contains a button without submenus.
// Take care to set the ";;;;;;" exactly as seen below.

menublock[8]="images/emailOff.GIF;"+ 	// filename third button-image
			 "images/emailOn.GIF;"+	
			  ";;;;;;"+ 	
			 "Contact Info|mailto:chenry@atlantic.net|_self;"   

             		 
// No need to change anything below	 
//  **********************************************************************************
	 
var menusplit
var urlsplit
var font_weight_sub
var font_weight_sub


var minusimg=new Image()
minusimg.src="images/downArrow.GIF"

var plusimg=new Image()
plusimg.src="images/sideArrow.GIF"
			 
var showsubmenus=new Array()
for (i=0;i<=menublock.length-1;i++) {
	
	showsubmenus[i]=-1
}

var plusminusimg=new Array()
for (i=0;i<=menublock.length-1;i++) {
	plusminusimg[i]=plusimg.src
}

for (i=0;i<=menublock.length-1;i++) {
	menusplit=menublock[i].split(";")
	mouseoverimage[i] = new Image()
	mouseoverimage[i].src = menusplit[1]
}

function mouseOver(imgurl,imgname) {
	if (document.layers) {
		var thisimg=eval("document.menu.document.img"+imgname)
		thisimg.src=imgurl
	}
	if (document.all) {
		var thisimg=eval("img"+imgname)
		thisimg.src=imgurl
	}
}

function mouseOut(imgurl,imgname) {
	if (document.layers) {
		var thisimg=eval("document.menu.document.img"+imgname)
		thisimg.src=imgurl
	}
	if (document.all) {
		var thisimg=eval("img"+imgname)
		thisimg.src=imgurl
	}
}

function openandclose(visi) {
	showsubmenus[visi]=(-1)*showsubmenus[visi]
    var menucontent=""
    if (showsubmenus[visi]==1) {plusminusimg[visi]=minusimg.src}
    if (showsubmenus[visi]==-1) {plusminusimg[visi]=plusimg.src}
    menucontent+="<table border=0 cellpadding=0 cellspacing=0>"
	for (i=0;i<=menublock.length-1;i++) {
		menusplit=menublock[i].split(";")
		urlsplit=menusplit[8].split("|")
		if (menusplit[7]==1) {font_weight_sub="<b>"}
		if (menusplit[7]==0) {font_weight_sub=""} 
		menucontent+="<tr><td>"

        
       if (menusplit[9].length==0) {
            menucontent+="</td>"
            menucontent+="<td>"
            menucontent+="<a href="+urlsplit[1]+" target="+urlsplit[2]+" onMouseOver='mouseOver(\""+menusplit[1]+"\",\""+i+"\")' onMouseOut='mouseOut(\""+menusplit[0]+"\",\""+i+"\")'>"
			
			var imgn = "img"+i
            menucontent+="<img name="+imgn+" src="+menusplit[0]+" border=0>"
            menucontent+="</td></tr>"
            plus_i++ 
        }
        
        if (menusplit[9].length!=0) {
            var thismainmenu=i+plus_i
            menucontent+="<a href='javascript:openandclose("+i+")'>"
			var imgn = "img"+i
            menucontent+="<img src='"+plusminusimg[i]+"' border=0></a></td>"
            menucontent+="<td>"
            menucontent+="<a href='javascript:openandclose("+i+")' onMouseOver='mouseOver(\""+menusplit[1]+"\",\""+i+"\")' onMouseOut='mouseOut(\""+menusplit[0]+"\",\""+i+"\")'>"
            menucontent+="<img name="+imgn+" src="+menusplit[0]+" border=0>"
            menucontent+="</a></td></tr>"
   
		    if (showsubmenus[i]==1) {
			    for (ii=9;ii<=menusplit.length-1;ii++) {
				    urlsplit=menusplit[ii].split("|")
                    menucontent+="<tr><td></td><td align=left width=129>"
    			    menucontent+=font_weight_sub
                    menucontent+="<a href="+urlsplit[1]+" target="+urlsplit[2]+">"
                    menucontent+="<font face="+menusplit[4]+" color="+menusplit[6]+" size="+menusplit[5]+">"
                    menucontent+=urlsplit[0]
                    menucontent+="</font></a>&nbsp;&nbsp;</td></tr>"
			    }
		    }
        }    
	}
    menucontent+="</table>"
	if (document.all) {
		menu.innerHTML=menucontent
	}
	if (document.layers) {
		document.menu.document.write(menucontent)
		document.menu.document.close()
	}
}
