/************************************************************************
 * the next 3 functions are for keeping the navigation highlighted      *
 ************************************************************************/
function extractPageName(hrefString)
{
	var arr = hrefString.split('/');
	//return  (arr.length<2) ? hrefString : arr[arr.length-2].toLowerCase() + arr[arr.length-1].toLowerCase();    
	return  (arr.length<2) ? hrefString : arr[arr.length-1].toLowerCase();               
}

function setActiveMenu(arr, crtPage)
{
	for (var i=0; i<arr.length; i++)
	{
		if(extractPageName(arr[i].href) == crtPage)
		{
			if (arr[i].parentNode.tagName != "DIV")
			{
//	  	        alert(arr[i].tagName + ', ' + arr[i].className + ', ' + arr[i].parentNode.tagName + ', ' + arr[i].parentNode.className + ', ' + extractPageName(arr[i].href) + ', ' + crtPage);
				arr[i].className = "current";
				arr[i].parentNode.className = "current";
//	  	        alert(arr[i].tagName + ', ' + arr[i].className + ', ' + arr[i].parentNode.tagName + ', ' + arr[i].parentNode.className + ', ' + extractPageName(arr[i].href) + ', ' + crtPage);
			}
		}
	}
}

function setPage()
{
	hrefString = document.location.href ? document.location.href : document.location;

	if (document.getElementById("menunav")!=null){
//        alert(extractPageName(hrefString));
		setActiveMenu(document.getElementById("menunav").getElementsByTagName("a"), extractPageName(hrefString));
	}
}

// ONLY USE lowercase FOR ALL OPTIONS
IEMhover = function () {
    var IEMh = document.getElementById("menunav").getElementsByTagName("LI");
    for (var i = 0; i < IEMh.length; i++) {
        IEMh[i].onmouseover = function () {
            this.className += " IEMhover";
        }
        IEMh[i].onmouseout = function () {
            this.className = this.className.replace(new RegExp(" IEMhover\\b"), "");
        }
    }
}
if (window.attachEvent) window.attachEvent("onload", IEMhover);

// NOTE: If you use a ' add a slash before it like this \'
var menuside	= "center"	// MENU SIDE | left | right | center
var fixwrap		= "no"		// MAKE yes ONLY IF MENUS ARE WRAPPING
var menuwidth	= "1020"		// TOTAL MENU WIDTH TO FIX WRAP

document.write('<table cellpadding="0" cellspacing="0" border="0" class="menutable"><tr><td align="'+menuside+'">');
document.write('<table cellpadding="0" cellspacing="0" border="0" height="25"><tr><td style="height:25px">');
//document.write('<div id="nav">');
document.write('<ul id="menunav">');

// START MENU LINKS - EDIT BELOW THIS AREA

document.write('  <li style="width: 130px; height: 25px;"><a href="/index.asp">Home</a></li>');

document.write('  <li style="width: 130px; height:25px;"><a href="/about.asp">About Us</a>');
document.write('    <ul>');
document.write('      <li style="width: 110px; height: 20px;"><a href="/about.asp">Overview</a></li>');
document.write('      <li style="width: 110px; height: 20px;"><a href="/faq.asp">FAQ</a></li>');
document.write('      <li style="width: 110px; height: 20px;"><a href="/warranty.asp">Warranty</a></li>');
document.write('      <li style="width: 110px; height: 20px;"><a href="/testimonials.asp">Testimonials</a></li>');
document.write('    </ul>');
document.write('  </li>');

document.write('  <li style="width: 130px; height:25px;"><a href="/products.asp">Products</a>');
document.write('    <ul>');
document.write('      <li style="width: 110px; height: 20px;"><a href="/products.asp">Pavers & Coping</a></li>');
document.write('      <li style="width: 110px; height: 20px;"><a href="/greenshield.asp">GreenShield</a></li>');
document.write('      <li style="width: 110px; height: 20px;"><a href="/basicsteps.asp">Installation</a></li>');
document.write('    </ul>');
document.write('  </li>');

document.write('  <li style="width: 130px; height:25px;"><a href="/gallery.asp">Gallery</a>');
document.write('    <ul>');
document.write('      <li style="width: 110px; height: 20px;"><a href="/gallery.asp">Pictures</a></li>'); 
document.write('      <li style="width: 110px; height: 20px;"><a href="/visualizer.asp">Visualizer</a></li>'); 
document.write('    </ul>');
document.write('  </li>');

document.write('  <li style="width: 130px; height:25px;"><a href="/contact.asp">Contact Us</a></li>'); 
// END LINKS //

document.write('</ul>');
//document.write('</div>');
document.write('</td></tr></table>');
   if (fixwrap == "yes") {
document.write('<img src="picts/spacer.gif" width="'+menuwidth+'" height="1"><br>');
}
document.write('</td></tr></table>');

// END -->
// Set the page menu navigation to ON
setPage()
