
var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only

if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change

	if(el.style.display != "block"){ //DynamicDrive.com change
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu") //DynamicDrive.com change
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}
	}
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function onloadfunction(){
if (persistmenu=="yes"){
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=get_cookie(cookiename)
if (cookievalue!="")
document.getElementById(cookievalue).style.display="block"
}
}

function savemenustate(){
var inc=1, blockid=""
while (document.getElementById("sub"+inc)){
if (document.getElementById("sub"+inc).style.display=="block"){
blockid="sub"+inc
break
}
inc++
}
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
document.cookie=cookiename+"="+cookievalue
}

if (window.addEventListener)
window.addEventListener("load", onloadfunction, false)
else if (window.attachEvent)
window.attachEvent("onload", onloadfunction)
else if (document.getElementById)
window.onload=onloadfunction

if (persistmenu=="yes" && document.getElementById)
window.onunload=savemenustate



var menu4 = new Array();
var menu4l = new Array();
var menu6 = new Array();
var menu6l = new Array();
var submenuProducts = new Array();
var submenuProductsL = new Array();
var submenuFinish = new Array();
var submenuFinishL = new Array();
var submenuCase = new Array();
var submenuCaseL = new Array();
var submenuPricing = new Array();
var submenuPricingL = new Array();
//configure below for menu items. Extend list as desired

menu4[0]="Products";
menu4[2] = "Finish Options";
menu4[1] = "Pricing";
menu4[3] = "Case Studies";

menu4[4] = "SF Showroom";
menu4[5] = "About Dfm";

menu4l[0]="http://dependablefm.com/products/index.html";
menu4l[1]="http://dependablefm.com/pricing.html";
menu4l[2]="http://dependablefm.com/options/index.html";
menu4l[3]="http://dependablefm.com/casestudies/index.html";
menu4l[4]="http://dependablefm.com/casestudies/sfshowroom1.html";
menu4l[5]="http://dependablefm.com/about/index.html";

menu6[0] = "Contact Dfm";
menu6[1] = "Home";

menu6l[0]="http://dependablefm.com/contact.html";
menu6l[1]="http://dependablefm.com/index.html";

submenuProducts[0] = "Standard Product Lines";
submenuProducts[1] = "Seating";
submenuProducts[2] = "Reception";
submenuProducts[3] = "Conference";
submenuProducts[4] = "Workstations";
submenuProducts[5] = "Private Offices";
submenuProducts[6] = "Tables";
submenuProducts[7] = "PDF Library";

submenuProductsL[0] = "http://dependablefm.com/products/casegoods.html";
submenuProductsL[1] = "http://dependablefm.com/products/seating.html";
submenuProductsL[2] = "http://dependablefm.com/products/reception.html";
submenuProductsL[3] = "http://dependablefm.com/products/conference.html";
submenuProductsL[4] = "http://dependablefm.com/products/panel.html";
submenuProductsL[5] = "http://dependablefm.com/products/execof.html";
submenuProductsL[6] = "http://dependablefm.com/products/tables.html";
submenuProductsL[7] = "http://dependablefm.com/products/pdflibrary.html";


submenuFinish[0] = "Wood Finishes";
submenuFinish[1] = "Tackboard Fabrics";
submenuFinish[2] = "Stone Options";
submenuFinish[3] = "Leather Options";


submenuFinishL[0] = "http://dependablefm.com/options/finishes.html";
submenuFinishL[1] = "http://dependablefm.com/options/tackboard.html";
submenuFinishL[2] = "http://dependablefm.com/options/stone.html";
submenuFinishL[3] = "http://dependablefm.com/options/leather.html";


submenuCase[0] = "Robert Crown Law Library";
submenuCase[1] = "Coblentz";
submenuCase[2] = "Fitzgerald";
submenuCase[3] = "Macromedia";
submenuCase[4] = "Communication Ventures";

submenuCaseL[0] = "http://dependablefm.com/casestudies/robertc1.html";
submenuCaseL[1] = "http://dependablefm.com/casestudies/coblentz.html";
submenuCaseL[2] = "http://dependablefm.com/casestudies/fitzgerald.html";
submenuCaseL[3] = "http://dependablefm.com/casestudies/macromedia.html";
submenuCaseL[4] = "http://dependablefm.com/casestudies/comven.html";

submenuPricing[0] = "Case goods";
submenuPricing[1] = "Seating";
submenuPricing[2] = "Conferencing";
submenuPricing[3] = "Reception";


submenuPricingL[0] = "http://dependablefm.com/pricing/casegoods.html";
submenuPricingL[1] = "http://dependablefm.com/pricing/Dfm_Seating_2008_v1.0.pdf";
submenuPricingL[2] = "http://dependablefm.com/pricing/conferencing.html";
submenuPricingL[3] = "http://dependablefm.com/pricing/reception.html";


document.write('<div id="menu6">');
for (i=0;i<=menu6.length-1;i++){
	
	document.write('<a href='+ menu6l[i]+'> '+menu6[i] +'</a><br/>');
	
	}
document.write('</div>');


document.write('<div id="masterdiv">');
	

document.write('<div id="menu4" style="width:inherit">');
for (i=0;i<=menu4.length-1;i++){
	k = i +1;
	document.write('<div class="menutitle" onclick="SwitchMenu(\'sub'+k+'\')"><a href="'+menu4l[i]+'"  > '+menu4[i] +' </a></div>');
}
document.write('</div>');	



document.write('<span class="submenu" id="sub1">');
document.write('<div id="menu5">');
for (i=0; i<=submenuProducts.length-1; i++){
if (i == 4){
	document.write('</div><div id="menu14">');
}
document.write('<a href='+submenuProductsL[i]+'>'+submenuProducts[i]+' </a><br>');
}
document.write('</div>');
document.write('</span>');

document.write('<span class="submenu" id="sub2">');
document.write('<div id="menuPricing">');
for (i=0; i<=submenuPricing.length-1; i++){

document.write('<a href='+submenuPricingL[i]+'>'+submenuPricing[i]+' </a><br>');
}
document.write('</div>');
document.write('</span>');

document.write('<span class="submenu" id="sub3">');
document.write('<div id="menu8">');
for (i=0; i<=submenuFinish.length-1; i++){
document.write('<a href='+submenuFinishL[i]+'>'+submenuFinish[i]+' </a><br>');
}
document.write('</div>');
document.write('</span>');

document.write('<span class="submenu" id="sub4">');
document.write('<div id="menu13">');
for (i=0; i<=submenuCase.length-1; i++){
if (i == 1)
document.write('</div><div id="menu9">');
document.write('<a href='+submenuCaseL[i]+'>'+submenuCase[i]+' </a><br>');
}
document.write('</div>');
document.write('</div>');
document.write('</span>');



document.write('<span class="submenu" id="sub5">');
document.write('</span>');

document.write('<span class="submenu" id="sub6">');
document.write('</span>');

document.write('</div>');	
document.write('</div>');	
