function showNav(prefix,menu)
{
	if (menu != '') {
		if (prefix == 'top') {
			writeHNavH(menu,loggedIn);
			highHMenuH(prefix,menu,document.getElementById("hNavhTdTop" + menu));
		} else if (prefix == 'cat') {
			highHMenuH(prefix,menu,document.getElementById("hNavhTdTopCat" + menu));
		}
	}
}//showNav

function highlightTimer(sMethod)
{
	if (sideNavHighlight != '') {
		if (sMethod == 'cancel') {
			if (hNavHTimer) clearTimeout(hNavHTimer);
		} else if (sMethod == 'start') {
			if (hNavHTimer) clearTimeout(hNavHTimer);
			hNavHTimer = setTimeout("initPage()",1000);
		}
	}
}//highlightTimer

function showHMenuH(sType,theID,theObj)
{
	var currentHighlight = '';
	if (sType == 'top') {
		currentHighlight = sideNavHighlight;
	} else if (sType == 'cat') {
		currentHighlight = catHighlight;
	}
	
	highlightTimer('cancel');
	if (theObj) {
		if (sType == 'top') {
			if (currentHighlight+'' != theID+'') {
				theObj.className = 'topRollover';
			}
		} else if (sType == 'cat') {
			if (currentHighlight+'' != theID+'') {
				theObj.className = 'catHorizontalRollover';
			}
		}
	}
	//check for images
	imgHNav('show',sType,theID,4,'',4);
}//showHMenuH

function hideHMenuH(sType,theID,theObj)
{
	var currentHighlight = '';
	if (sType == 'top') {
		currentHighlight = sideNavHighlight;
	} else if (sType == 'cat') {
		currentHighlight = catHighlight;
	}
	if (currentHighlight+'' != theID+'') {
		if (theObj) {
			if (sType == 'top') { theObj.className = 'topStandard'; } else if (sType == 'cat') { theObj.className = 'catHorizontalStandard'; }
		}
	}
	
	//check for images
	imgHNav('hide',sType,theID,3,currentHighlight,5);
	
	if (currentHighlight+'' != theID+'') { highlightTimer('start'); }
}//hideHMenuH

function highHMenuH(sType,theID,theObj)
{
	if (theObj) {
		if (sType == 'top') { theObj.className = 'topSelected'; } else if (sType == 'cat') { theObj.className = 'catHorizontalSelected'; }
	}
	imgHNav('high',sType,theID,5,'',5);
}//highHMenuH

function writeHNavH(id)
{

	// Added for SEO changes by Andrew Shemmeld
	var vfold = '../';
	if (document.getElementById('is_seo') != null) 
		{
		vfold='../../html/'; 
		}
	if (document.getElementById('is_seo_cat') != null) 
		{
		vfold='../html/'; 
		}
	if (document.getElementById('is_seo_serv') != null) 
		{
		vfold='../html/'; 
		}
	if (document.getElementById('is_seo_content') != null) 
		{
		vfold='../html/'; 
		}
	if (document.getElementById('is_seo_forum') != null) 
		{
		vfold='../html/'; 
		}
	if (document.getElementById('is_seo_faq') != null) 
		{
		vfold='../html/'; 
		}
	if (document.getElementById('is_seo_forum_msg') != null) 
		{
		vfold='../../html/'; 
		}
	//

	id = id+'';
	id = id.replace('core','Core');
	
	if (!(eval("document.getElementById('horizontalnavarea_row')"))) { return; }
	
	theCell = document.getElementById('horizontalnavarea_row');
	if (theCell) { theCell.innerHTML = ''; }
	
	var isShop = false;
	var sPrefix = '';
	var testStr = id + "no"
	if (testStr.toLowerCase().indexOf("shop") > -1) { isShop = true; }
	
	var theArray = '';
	try { theArray = eval("topkey" + id); } catch(oException) { theArray = ''; }
	if (id.search(/core/i) > -1) {
		try { id = id.replace('Core','core'); theArray = eval("topkey" + id); } catch(oException) { theArray = ''; }
	}//if
	if (theArray == '') { return; }
	
	var cellData = "";
	if (theArray.length != undefined) { cellData = "<table cellpadding='0' cellspacing='0' class='catHorizontalTable'>"; }
	
	if (cellData+'' != '') cellData += "<tr class='catHorizontalRow' valign='top'>";
	
	var theArrayCat = '';
	for (var i = 0; i < theArray.length; i++) {
		catID = theArray[i]+'';
		
		try { theArrayCat = eval("cat" + sPrefix + catID); } catch(oException) { theArrayCat = ''; }
		
		catTitle = '';
		catImg = '';
		catURL = '';
		catBgColor = '';
		catClass = 'catHorizontalStandard';
		if (theArrayCat != '') {
			catTitle = theArrayCat[1]+'';
			if (catHighlight+'' == catID+'') { 
				catImg = theArrayCat[5]+'';
				catClass = 'catHorizontalSelected';
			} else {
				catImg = theArrayCat[3]+'';
				catClass = 'catHorizontalStandard';
			}
			catURL = theArrayCat[6]+'';
			
			cellData += "<td class='"+ catClass +"' onMouseOver=\"showHMenuH('cat','"+ sPrefix + catID +"',this);\" onMouseOut=\"hideHMenuH('cat','"+ sPrefix + catID +"',this);\" onclick=\"location.href="; 		
			
			if (isShop) {
				if (catID=='ShopC') {
					cellData += "'" + vfold + "s13_shopping/view_cart.asp?nav_top_id=" + escape(id) + "&nav_cat_id=ShopC" + qDSAp + "';\"";
				} else if (catURL+'' != '') {
					cellData += "'"+ catURL +"';\"";
				} else {
					cellData += "'" + vfold + "s13_shopping/default.asp?nav_top_id=" + escape(id) + "&nav_cat_id=" + catID + ""+ qDSAp +"';\"";
				}
			} else if (catURL+'' != '') {
				catURL = catURL.replace("../", "")
					// added on 02-08-2011 to fix category direct link error.
					if (catURL.indexOf("http")>=0){
					cellData += "'"+ catURL +"';\"";
					}
					else{
					cellData += "'"+ vfold + catURL +"';\"";
					}
			} else {
				cellData += "'" + vfold + "s02_article/default.asp?nav_top_id=" + escape(id) + "&nav_cat_id=" + catID + ""+ qDSAa +"';\"";
			}
			cellData += " id='hNavhTdCat"+ catID +"'>";
			if (catImg+'' != '' && catImg != undefined && catImg+'' != 'undefined') {
				cellData += "<img hspace='0' vspace='0' border=0 src='"+ catImg +"' alt='" + catTitle.replace(/\'/gi,'\'') + "' id='hNavhImgCat"+ catID +"' name='hNavhImgCat"+ catID +"'>";
			} else {
				cellData += "<span>"+ sNavStartCH +"" + catTitle + ""+ sNavEndCH +"</span>";
			}
			
			cellData += "</td>";
		}//theArrayCat
	}//for
	if (cellData+'' != '') cellData += "</tr>";
	
	if (theArray.length != undefined) { cellData += "</table>"; }
	
	if (document.images["arr" + id]) { document.images["arr" + id].src = arr_over.src; }
	
	if (cellData+'' != '') { theCell.innerHTML = cellData; lastHighlight = id; theCell.style.display='inline'; }
	
//alert(cellData);
	

}//writeHNavH
