//@copyright MMV - Jon Smartvar aPath = Array();var sPath = '<a href="index.html" title="The Shop">The Shop</a>';var bURLFound = false;var sHTML = '';function urlFullEncode(str) {//	str = escape(str);//	str = str.replace(/\£/g, '%a3');	str = str.replace(/_/g, '%5f');	str = str.replace(/\./g, '%2e');	str = str.replace(/\&/g, '%26');	return str;}function getPageName() {	var sPath = window.location.pathname;	var sPage = '';		if ( sPath.indexOf('/') > -1 ) {		sPage = sPath.substring(sPath.lastIndexOf('/') + 1);	}	else {		sPage = sPath.substring(sPath.lastIndexOf('\\') + 1);	}	return sPage;}function locateMenuItem(sectObj, sURL, iBranchNo) {	var sectID;	for (var i=1; i<(sectObj.length+1); i++) {		if (bURLFound) return false;		aPath[iBranchNo] = i;		sectID = (sectObj[i].sURL.indexOf('SECTIONID=')>-1)?sectObj[i].sURL.substring(sectObj[i].sURL.indexOf('SECTIONID=')+10,sectObj[i].sURL.lastIndexOf('&')):sectObj[i].sURL;		if (sectID.toLowerCase() == sURL.toLowerCase()) {			bURLFound = true;			return false;		}		if (!bURLFound && sectObj[i].pChild) {			locateMenuItem(sectObj[i].pChild, sURL, iBranchNo+1)		}	}	if (!bURLFound) aPath.pop();}function writeMenu(sectObj, iBranchNo) {	sHTML += '<ul>';	var sID;	var sClass;	for (var i=1; i<(sectObj.length+1); i++) {		sID = (iBranchNo==0)?'top':'sub';		sClass = (iBranchNo==0)?'class="submenu' + i + '"':(aPath[iBranchNo]==i)?'class="on"':'';		//sID = (aPath[iBranchNo]==i)?(iBranchNo==0)?'top-section-on':'sub-section_on':(iBranchNo==0)?'top_section':'sub-section';		sHTML += '<li><a href="' + sectObj[i].sURL + '" id="' + sID + '" ' + sClass + ' title="' + sectObj[i].sName.toLowerCase() + '" onFocus="blur()">' + sectObj[i].sName.toLowerCase() + '</a>';				if (aPath[iBranchNo]==i) {			sPath += '<b> >> </b><a href="' + sectObj[i].sURL + '" title="' + sectObj[i].sName.toLowerCase() + '">' + sectObj[i].sName.toLowerCase() + '</a>';			if (sectObj[i].pChild) writeMenu(sectObj[i].pChild, iBranchNo+1);		}	}	sHTML += '</li></ul>';}function displayMenu() {	//alert(urlFullEncode(getPageName()));	locateMenuItem(section_tree, urlFullEncode(getPageName()), 0);	writeMenu(section_tree, 0);	var objNav = document.getElementById('nav');	objNav.innerHTML = sHTML;	var objPath = document.getElementById('site-path');	objPath.innerHTML = sPath;}