//sidenav include 03/22/2005	
	
	//var productCategory = "ola loa" //PO: debug

	//sidenavPrefix may or may not have been declared in calling page - declare it just in case
	var sidenavPrefix;
	//create an undefined "constant"
	var UNDEFINED;
	
	//if sidenavPrefix is undefined assign a default
	if(sidenavPrefix == UNDEFINED){
		sidenavPrefix = "";
	} else {
		//sidenavPrefix defined in calling page - do nothing
	}

	var productNav = new Array();
	
	//first element of each 'productSection array is product section heading
	//each element is followed by it's URL 
	//rest are subsections
	var productSection = new Array("Essential Collections", "essential-collections.html");
	productNav[0] = productSection;
	var productSection = new Array("Facial Care", "cleansers.html", "Cleansers", "cleansers.html", "Toners", "toners.html", "Masks & Scrubs", "masks-scrubs.html", "Moisturizers", "moisturizers.html", "Eye Care", "eye-care.html", "Serums", "serums-specialty.html");
	productNav[1] = productSection;
	
	//var productSection = new Array("Body Scrubs", "body-scrubs.html");
	//productNav[2] = productSection;

	//var productSection = new Array("Bath Care", "bath-care.html");
	//productNav[4] = productSection;

	//var productSection = new Array("Hand & Foot Care", "hand-foot-care.html");
	//productNav[5] = productSection;

	//var productSection = new Array("Supplements", "elixir-tonics.html", "Elixir Tonics", "elixir-tonics.html");
	//productNav[5] = productSection;

	//var productSection = new Array("Accessories", "stellarspa-accessories.html", "Stellar Spa", "stellarspa-accessories.html", "Apparel", "apparel.html");
	//productNav[5] = productSection;

	var productSection = new Array("Accessories", "stellarspa-accessories.html");
	productNav[2] = productSection;

	var productSection = new Array("Sugar Beach", "sugar-beach.html");
	productNav[3] = productSection;

	//var productSection = new Array("Travel Sizes", "travel-sizes.html");
	//productNav[7] = productSection;

	//var productSection = new Array("Gift Certificates", "gift-certificates.html");
	//productNav[8] = productSection;

	//find the section - may be a section or a subsection
	var sections = productNav.length;
	var hasSubSection = 0;
	for(index = 0; index < sections; index=index+1){
		var sectionLength = productNav[index].length;
		for (index2 = 0; index2 < sectionLength; index2=index2+2){
			//productCategory is global variable set in page
			if(productNav[index][index2].toLowerCase() == productCategory.toLowerCase()){
				if(index2 > 0){
					//category is a subsection set variables accordingly
					hasSubSection = 1;
					var currentSubSection = productNav[index][index2];
					//current section is the first item in this array - set that
					var currentSection = productNav[index][0];
				} else {
					//selected category is a main section
					var currentSection = productNav[index][index2];
					var currentSubSection = "";
				}										
			} 
		}
	}
	
	//alert(currentSection);  //PO: debug
	//alert(currentSubSection);  //PO: debug
	
	//now build nav
	var navBlob = "";
	for(index = 0; index < sections; index=index+1){
	
		var sectionLength = productNav[index].length;
		
		//beginning of section so create section heading nav
		//currentSection is global variable set in head of each page
		if(productNav[index][0] == currentSection){
			//currentSection so we'll highlight
			//navBlob += '\n\n';			
			navBlob += '<tr><td colspan="2">';
			navBlob += '<a href="' + sidenavPrefix + productNav[index][1] + '" class="sidenavheadlinkon">';
			navBlob += productNav[index][0]; 
			navBlob += '</a></td></tr>';
			//add a spacer row
			navBlob += '<tr><td colspan="2"><img src="/lib/stellarspa/v2-spacer.gif" alt="" border="0" width="1" height="3"></td></tr>';
			//navBlob += '\n';
		} else {
			//navBlob += '\n\n';			
			navBlob += '<tr><td colspan="2">';
			navBlob += '<a href="' + sidenavPrefix + productNav[index][1] + '" class="sidenavheadlink">';
			navBlob += productNav[index][0]; 
			navBlob += '</a></td></tr>';
			//add a spacer row
			navBlob += '<tr><td colspan="2"><img src="/lib/stellarspa/v2-spacer.gif" alt="" border="0" width="1" height="3"></td></tr>';
			//navBlob += '\n';
		}

		//if writing out facial care and currently selected section has no subnav then write out the subnav for facial care in order to fill up space
		if((productNav[index][0] == "Facial Care") && (!(hasSubSection))){
			for (index2 = 2; index2 < sectionLength; index2=index2+2){
				if(productNav[index][index2] == currentSubSection){
					navBlob += '<tr><td><img src="/lib/stellarspa/v2-sidenav-arrow.gif" alt="" border="0" width="10" height="10" align="absmiddle"></td>';
					navBlob += '<td>';
					navBlob += '<a href="' + sidenavPrefix + productNav[index][index2 + 1] + '" class="sidenavlinkon">'
					navBlob += productNav[index][index2]; 
					navBlob += '</a></td></tr>';
					//add a spacer row
					navBlob += '<tr><td colspan="2"><img src="/lib/stellarspa/v2-spacer.gif" alt="" border="0" width="1" height="3"></td></tr>';
					//navBlob += '\n';
				} else {
					navBlob += '<tr><td><img src="/lib/stellarspa/v2-spacer.gif" alt="" border="0" width="10" height="10" align="absmiddle"></td>';
					navBlob += '<td>';
					navBlob += '<a href="' + sidenavPrefix + productNav[index][index2 + 1] + '" class="sidenavlink">'
					navBlob += productNav[index][index2]; 
					navBlob += '</a></td></tr>';
					//add a spacer row
					navBlob += '<tr><td colspan="2"><img src="/lib/stellarspa/v2-spacer.gif" alt="" border="0" width="1" height="3"></td></tr>';
					//navBlob += '\n';
				}
			}
		}

		//now display the subnav if there is any, but only if section is current
		if(productNav[index][0] == currentSection){
			for (index2 = 2; index2 < sectionLength; index2=index2+2){
				if(productNav[index][index2] == currentSubSection){
					navBlob += '<tr><td><img src="/lib/stellarspa/v2-sidenav-arrow.gif" alt="" border="0" width="10" height="10" align="absmiddle"></td>';
					navBlob += '<td>';
					navBlob += '<a href="' + sidenavPrefix + productNav[index][index2 + 1] + '" class="sidenavlinkon">'
					navBlob += productNav[index][index2]; 
					navBlob += '</a></td></tr>';
					//add a spacer row
					navBlob += '<tr><td colspan="2"><img src="/lib/stellarspa/v2-spacer.gif" alt="" border="0" width="1" height="3"></td></tr>';
					//navBlob += '\n';
				} else {
					navBlob += '<tr><td><img src="/lib/stellarspa/v2-spacer.gif" alt="" border="0" width="10" height="10" align="absmiddle"></td>';
					navBlob += '<td>';
					navBlob += '<a href="' + sidenavPrefix + productNav[index][index2 + 1] + '" class="sidenavlink">'
					navBlob += productNav[index][index2]; 
					navBlob += '</a></td></tr>';
					//add a spacer row
					navBlob += '<tr><td colspan="2"><img src="/lib/stellarspa/v2-spacer.gif" alt="" border="0" width="1" height="3"></td></tr>';
					//navBlob += '\n';
				}
			}
		}
		
		//end of section - if any subnav and displayed put a little space below.
		//if(sectionLength > 2 && productNav[index][0] == currentSection){
			//navBlob += '<tr><td colspan="2"><img src="spacer.gif" alt="" border="0" width="1" height="4"></td></tr>';
		//}
	}

