/************************************************
	Seiko Instruments Inc. (siiprinters.com)
	/js/activeLink.js
	Copyright © SolutionSet, 2006.
	Created by Michael Switzer	
************************************************/

function activeNavLink() {
	secNavFlag = true;
	crumbFlag = true;
	
	try	{m = document.getElementById("primaryNav").getElementsByTagName("a");}
	catch (err) {return false;}
	
	try	{n = document.getElementById("secondaryNav").getElementsByTagName("a");}
	catch (err) {secNavFlag = false;}
	
	try	{c = document.getElementById("breadcrumbs").getElementsByTagName("a");}
	catch (err) {crumbFlag = false;	}
	
	for(var i=0;i<m.length;i++) {
		if(window.location.href.toString().indexOf(m[i].href)!=-1) m[i].className = "active";
		if(crumbFlag && c[0].href.toString().indexOf(m[i].href)!=-1) m[i].className = "active";
	}
	
	if(secNavFlag) {
		for(var i=0;i<n.length;i++) {
			if(window.location.href.toString().indexOf(n[i].href)!=-1) n[i].className = "active";
			try	{
				if(c[1].href.toString().indexOf(n[i].href)!=-1) n[i].className = "active";
			} catch (err) {	}
		}
	}
	
	if(window.location.href.toLowerCase().slice(-9)!='/cseries/'){ 
        if(window.location.href.slice(-4).indexOf("com")!=-1 || window.location.href.slice(-1).indexOf("/")!=-1) m[0].className = "active";
	} 
	if(window.location.href.indexOf("index")!=-1) m[0].className = "active";
}

window.onload=function() {
	activeNavLink();
	if (document.getElementById('overview')) document.getElementById('overview').style.display = 'block';
}