// Browser Detection //

    var agt = navigator.userAgent.toLowerCase();

	var is_major = parseInt(navigator.appVersion);
	var is_minor = parseFloat(navigator.appVersion);
	
	// Browser Family -------- CSS File You Need To Edit
	
	// Internet Explorer ----- ie.css
	var is_ie    = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
	
	// Mozilla Family -------- main.css
	var is_moz   = ((agt.indexOf("gecko") != -1) && (agt.indexOf("khtml") == -1));
	
	// Safari, Konqueror ----- khtml.css
	var is_khtml = (agt.indexOf("khtml") != -1);
	
	// Opera Family ---------- opera.css
	var is_opera = (agt.indexOf("opera") != -1);

// end Browser Detection



function setRollovers() {

	// adds rollover events and sets current page
	// requires any size array of miages to reside under an element with the id 'main-nav' 
	// this affects ALL image tags under the 'main-nav' element!!!!
	
	var x = document.getElementById('main-nav').getElementsByTagName('img');
	
	for (var i = 0; i < x.length; i++) {
		if (x[i].className != 'active' && x[i].className != 'no-rollover') {
			x[i].onmouseover = new Function('rollOver(this.id)');
			x[i].onmouseout  = new Function('rollOff(this.id)');
		}
	}

}


function rollOver(section) {
	document.getElementById(section).src = "assets/images/n_" + section + "_o.gif";
}

function rollOff(section) {
	document.getElementById(section).src = "assets/images/n_" + section + ".gif";
}

function sidebar(section) {
	var theUL = document.getElementById('second-nav-items');
	var itemList = '';

	// don't run this unless we're actually in a section
	if (sn[section]) {
		for (var i = 0; i <= sn[section].length - 1; i++) {
			var menuItemInfo = sn[section][i].split("||");

			var link = nav_links[i].pathname;
			if (link.substring(0, 1) != '/') link = '/' + link; // fiddle IE's view of the link
			if (link == selected) {
				activeLink = ' class="active"';
			}

			itemList += '<li'+ activeLink +'><a href="' + menuItemInfo[1] +'">'+ menuItemInfo[0] +'</a></li>';
			alert(itemList);
		}
	}

	theUL.innerHTML = itemList;
}

function printPage() {
	window.print();
	return false;
}


// moved HC tracking code here because it can't exist in an XSLT template
function L10Analytics() {
	
	var L10success = 0; L10sections=""; L10points=""; L10cRef=""; L10cRefType=""; L10cPage="";
	var L10qstr,L10pc,L10ref,L10a,L10pg; L10pg = document.URL.toString(); L10ref = document.referrer;
	if(top.document.location==document.referrer || (document.referrer == "" && top.document.location != "")) {L10ref=top.document.referrer;}
	L10qStr = "pg="+escape(L10pg)+"&ref="+escape(L10ref)+"&os="+escape(navigator.userAgent)+"&nn="+escape(navigator.appName)+"&nv="+escape(navigator.appVersion)+"&nl="+escape(navigator.language)+"&sl="+escape(navigator.systemLanguage)+"&sa="+L10success+"&sec="+L10sections+"&pts="+L10points+"&cR="+escape(L10cRef)+"&cRT="+escape(L10cRefType)+"&cPg="+escape(L10cPage);
	if(navigator.appVersion.substring(0,1) > "3") { L10d = new Date(); L10qStr = L10qStr+"&cd="+screen.colorDepth+"&sx="+screen.width+"&sy="+screen.height+"&tz="+L10d.getTimezoneOffset();}
	<!-- The L10 Hit Counter logo and links must not be removed or altered -->
	if((location.href.substr(0,6)=="https:") || (location.href.substr(0,6)=="HTTPS:")) { L10pc="https"; } else { L10pc="http"; }
	var trackingCode = '<a href="http://www.infantswim.com/L10Apps/L10HC/L10HC_Reporter.html" target="_blank"><img src="'+ L10pc +'://www.infantswim.com/L10Apps/L10HC/L10HC_Counter.php?'+ L10qStr +'" alt="LevelTen Hit Counter 4.0" style="width: 68px; height: 32px; " \/><\/a>';
		
	return trackingCode
	
}

