// The following line is critical for menu operation, and must appear only once.
menunum=0;menus=new Array();_d=document;function addmenu(){menunum++;menus[menunum]=menu;}function dumpmenus(){mt="<script language=javascript>";for(a=1;a<menus.length;a++){mt+=" menu"+a+"=menus["+a+"];"}mt+="<\/script>";_d.write(mt)}

//Please leave the above line intact. The above also needs to be enabled if it not already enabled unless this file is part of a multi pack.



////////////////////////////////////
// Editable properties START here //
////////////////////////////////////
effect = "";

hide_spacer=false;
timegap=500				// The time delay for menus to remain visible
followspeed=5			// Follow Scrolling speed
followrate=40			// Follow Scrolling Rate
suboffset_top=0;		// Sub menu offset Top position 
suboffset_left=-1;		// Sub menu offset Left position
strSubNavWidth=100;

is_ns4=(_d.layers)?true:false
is_ns6=(navigator.userAgent.indexOf("Gecko")!=-1)?true:false
is_mac=(navigator.appVersion.indexOf("Mac")!=-1)?true:false
if(is_ns4){
	suboffset_top=-1;			// Sub menu offset Top position 
}
if(is_mac){					// If Browser is MAC
	suboffset_top=-4;			// Sub menu offset Top position 
	suboffset_left=0;			// Sub menu offset Left position
	if(is_ns6){				// If Browser is MAC and Netscape 6
		suboffset_top=0;		// Sub menu offset Top position 
		suboffset_left=-1;		// Sub menu offset Left position
		hide_spacer=true;
	}
	if(is_ns4){				// If Browser is MAC and Netscape 4
		suboffset_top=-1;		// Sub menu offset Top position 
		suboffset_left=-1;		// Sub menu offset Left position
	}
}


style1=[				// style1 is an array of properties. You can have as many property arrays as you need. This means that menus can have their own style.
"bbbbbb",				// Mouse Off Font Color
"000000",				// Mouse Off Background Color
"orange",				// Mouse On Font Color
"000000",				// Mouse On Background Color
"000000",				// Menu Border Color 
11,						// Font Size in pixels
"normal",				// Font Style (italic or normal)
"bold",					// Font Weight (bold or normal)
"Arial, Verdana",		// Font Name
0,						// Menu Item Padding
"",						// Sub Menu Image (Leave this blank if not needed)
,						// 3D Border & Separator bar
"666666",				// 3D High Color
"000099",				// 3D Low Color
,						// Current Page Item Font Color (leave this blank to disable)
,						// Current Page Item Background Color (leave this blank to disable)
"",						// Top Bar image (Leave this blank to disable)
"ffffff",				// Menu Header Font Color (Leave blank if headers are not needed)
"",						// Menu Header Background Color (Leave blank if headers are not needed)
]
style2=[				// style1 is an array of properties. You can have as many property arrays as you need. This means that menus can have their own style.
"FFFFFF",				// Mouse Off Font Color
"000000",				// Mouse Off Background Color
"FFE600",				// Mouse On Font Color
"000000",				// Mouse On Background Color
"FFFFFF",				// Menu Border Color 
11,						// Font Size in pixels
"normal",				// Font Style (italic or normal)
"bold",					// Font Weight (bold or normal)
"Arial, Verdana",		// Font Name
3,						// Menu Item Padding
"arrow.gif",			// Sub Menu Image (Leave this blank if not needed)
,						// 3D Border & Separator bar
"666666",				// 3D High Color
"000099",				// 3D Low Color
"000000",				// Current Page Item Font Color (leave this blank to disable)
"FFFFFF",				// Current Page Item Background Color (leave this blank to disable)
"",						// Top Bar image (Leave this blank to disable)
"ffffff",				// Menu Header Font Color (Leave blank if headers are not needed)
"000099",				// Menu Header Background Color (Leave blank if headers are not needed)
]
style3=[				// style1 is an array of properties. You can have as many property arrays as you need. This means that menus can have their own style.
"FFFFFF",				// Mouse Off Font Color
"000000",				// Mouse Off Background Color
"FFE600",				// Mouse On Font Color
"000000",				// Mouse On Background Color
"FFFFFF",				// Menu Border Color 
11,						// Font Size in pixels
"normal",				// Font Style (italic or normal)
"bold",					// Font Weight (bold or normal)
"Arial, Verdana",		// Font Name
3,						// Menu Item Padding
"",						// Sub Menu Image (Leave this blank if not needed)
,						// 3D Border & Separator bar
"666666",				// 3D High Color
"000099",				// 3D Low Color
"000000",				// Current Page Item Font Color (leave this blank to disable)
"ffffff",				// Current Page Item Background Color (leave this blank to disable)
"",						// Top Bar image (Leave this blank to disable)
"ffffff",				// Menu Header Font Color (Leave blank if headers are not needed)
"000099",				// Menu Header Background Color (Leave blank if headers are not needed)
]


addmenu(menu=[		// This is the array that contains your menu properties and details
"mainmenu",			// Menu Name - This is needed in order for the menu to be called
,					// Menu Top - The Top position of the menu in pixels
,					// Menu Left - The Left position of the menu in pixels
,					// Menu Width - Menus width in pixels
1,					// Menu Border Width 
"center",					// Screen Position - here you can use "center;left;right;middle;top;bottom" or a combination of "center:middle"
style1,				// Properties Array - this is set higher up, as above
1,					// Always Visible - allows the menu item to be visible at all time (1=on/0=off)
"left",				// Alignment - sets the menu elements text alignment, values valid here are: left, right or center
effect,				// Filter - Text variable for setting transitional effects on menu activation - see above for more info
,					// Follow Scrolling - Tells the menu item to follow the user down the screen (visible at all times) (1=on/0=off)
1, 					// Horizontal Menu - Tells the menu to become horizontal instead of top to bottom style (1=on/0=off)
0,					// Keep Alive - Keeps the menu visible until the user moves over another menu or clicks elsewhere on the page (1=on/0=off)
,					// Position of TOP sub image left:center:right
,					// Set the Overall Width of Horizontal Menu to 100% and height to the specified amount (Leave blank to disable)
,					// Right To Left - Used in Hebrew for example. (1=on/0=off)
,					// Open the Menus OnClick - leave blank for OnMouseover (1=on/0=off)
,					// ID of the div you want to hide on MouseOver (useful for hiding form elements)
,					// Reserved for future use
,					// Reserved for future use
,					// Reserved for future use



,"<img src='" + sections_sections[1].nav_image_off  + "' border=0>","show-menu=section1",		top_sections[1].url + " swapimage=" + sections_sections[1].nav_image_on,"",1
,"<img src='" + sections_sections[2].nav_image_off  + "' border=0>","show-menu=section2",		top_sections[2].url + " swapimage=" + sections_sections[2].nav_image_on,"",1 // "Description Text", "URL", "Alternate URL", "Status", "Separator Bar"
,"<img src='" + sections_sections[3].nav_image_off  + "' border=0>","show-menu=section3",		top_sections[3].url + " swapimage=" + sections_sections[3].nav_image_on,"",1
,"<img src='" + sections_sections[4].nav_image_off  + "' border=0>","show-menu=section4",		top_sections[4].url + " swapimage=" + sections_sections[4].nav_image_on,"",1
,"<img src='" + sections_sections[5].nav_image_off  + "' border=0>","show-menu=section5",		top_sections[5].url + " swapimage=" + sections_sections[5].nav_image_on,"",1
,"<img src='" + sections_sections[6].nav_image_off  + "' border=0>","show-menu=section6",		top_sections[6].url + " swapimage=" + sections_sections[6].nav_image_on,"",1
,"<img src='" + sections_sections[7].nav_image_off  + "' border=0>","show-menu=section7",		top_sections[7].url + " swapimage=" + sections_sections[7].nav_image_on,"",1

])

	function setmenu(curr_section, k, menu) {
		menu[k] = curr_section.name
		if (curr_section.sections.length > 0){
			menu[k+1] = "show-menu=" + curr_section.name
		}else{
			menu[k+1] = curr_section.url
		}
		menu[k+4]=1;
	}
	function addcurrentlevel(curr_section, menuname, intLevel, strParent){
		if (menuname.length>0){
			menuid = menuname;
		}else {
			menumod=""
			for (e=0;e<curr_section.parent_id;e++){
				menumod = menumod + " "
			}
			menuid = curr_section.name + menumod;
		}
		
		
		if ((strParent.length>2)&&(menuid!=top_sections[1].name)&&(menuid!=top_sections[3].name)){
			if(hide_spacer){
				menuid = menuid;
			}else{
				menuid = menuid;// + "<img src=/spacer.gif border=0 height=9 width=" + 6*(22 - menuid.length) + ">";
			}
		}
		
		if (strParent.length > 2){
			stylenum = style3;
		}else{
			stylenum = style2;
		}


		if ((curr_section.sections.length>0)&&(curr_section.section_type!=4)&&(curr_section.section_type!=1)){		
			menu=[menuid,
				,,strSubNavWidth,1,"",stylenum,,"left",effect,,,,,,,,,,,,
				]
			kl=0
			blnMenuHasItem=false;
			for (var k = 0; k<curr_section.sections.length; k++) {
				if (curr_section.sections[k].section_type!=4&&curr_section.sections[k].section_type!=1) { //exclude from all menus if it is an article
					blnMenuHasItem = true;
					i = 22+5*kl
					menumod=""
					for (e=0;e<curr_section.sections[k].parent_id;e++){
						menumod = menumod + " "
					}
					tempname = curr_section.sections[k].name + menumod;
					if(hide_spacer){
						tempname = tempname;
					}else{
						tempname = tempname;// + "<img src=/spacer.gif border=0 height=9 width=" + 6*(22 - tempname.length) + ">";
					}
					menu[i] = tempname
					//Only show menu level specified 
					blnSubMenuHasItem=false;
					if ((intLevel>0)&&(curr_section.sections[k].sections.length > 0)&&(curr_section.sections[k].section_type!=1)){
						for (var l=0; l<curr_section.sections[k].sections.length; l++) {
							//alert (curr_section.sections[k].sections[l].section_type)
							if (curr_section.sections[k].sections[l].section_type!=4&&curr_section.sections[k].sections[l].section_type!=1){
								blnSubMenuHasItem=true;
							}
						}
						if (blnSubMenuHasItem) {
							//unknown
							menu[i+1] = "show-menu=" + tempname
							//submenu level 1
							menu[i+2] = curr_section.sections[k].url
						}else {
							//error ??
							menu[i+1] = curr_section.sections[k].url
						}
					}else{
						//final step
						menu[i+1] = curr_section.sections[k].url
					}
					menu[i+4]=1;
					kl++;
				}
			}
			if (blnMenuHasItem){
				addmenu(menu);
			}
		}
	}
	

	function traverse_menu( curr_section, intLevel, menuname, strParent){
		strParent = strParent + curr_section.url+",";
		addcurrentlevel(curr_section, menuname, intLevel, strParent);
		if (intLevel>0){
			intLevel--;
			for (var k = 0; k<curr_section.sections.length; k++) {
				traverse_menu(curr_section.sections[k],intLevel, "", strParent);
			}
		}
	}
	
	traverse_menu(top_sections[1],0, "section1","");
	traverse_menu(top_sections[2],1, "section2","");
	traverse_menu(top_sections[3],0, "section3","");
	traverse_menu(top_sections[4],0, "section4","");
	traverse_menu(top_sections[5],0, "section5","");
	traverse_menu(top_sections[6],0, "section6","");	
	traverse_menu(top_sections[7],0, "section7","");	


///////////////////////////////////////////////////	

	

/*
		 Copyright 2002 (c) Milonic Solutions. All Rights Reserved.
		addmenu(menu=["dhtml",
		,,170,1,"",style1,,"left",,,,,,,,,,,,,
		,"Animation","http://simplythebest.net/info/dhtml_animation.html",,,0
		,"Background","http://simplythebest.net/info/dhtml_background.html",,,0
		,"Buttons","http://simplythebest.net/info/dhtml_buttons.html",,,0
		,"Calculators","http://simplythebest.net/info/dhtml_calculators.html",,,0
		,"Cookies","http://simplythebest.net/info/dhtml_cookies.html",,,0
		,"Enhancements","http://simplythebest.net/info/dhtml_enhancements.html",,,0
		,"Forms","http://simplythebest.net/info/dhtml_forms.html",,,0
		,"Image rotations","http://simplythebest.net/info/dhtml_images.html",,,0
		,"Menus","http://simplythebest.net/info/dhtml_menus.html",,,0
		,"Messages","http://simplythebest.net/info/dhtml_messages.html",,,0
		,"Password protection","http://simplythebest.net/info/dhtml_passwords.html",,,0
		,"Scrollers","http://simplythebest.net/info/dhtml_scrollers.html",,,0
		])
*/
	
	

dumpmenus();