/*============================================================
	Owner:	Hill's Pet Nutrition
	Title:		Indoor Cat Minisite Javascript Document
	Author:	Steve Kiernan
	Date: 		11/11/09
	Desc:		This javascript document provides functionality
					needed within the "Indoor Cat" minisite pages 
					(ie. controling navigation states)
=============================================================*/

function init() { 
	setNavClass(); //call function to set the appropriate classname on the left nav element to be highlighted
}

function setNavClass() { //append appropriate className to the left nav element based off the currently rendered page
	var targObj = document.getElementById("content_2column_d"); //set variable to target element (content_2column_d)
	var navArray = document.getElementById("indoorCatNav").getElementsByTagName("li"); //build array of left nav <li> elements

	if(targObj) { //if content_2column_d is found
		if(targObj.className == "home") { //check to see if column2's className is set to "home"
			targObj = navArray[0].className = "on"; //set the classname to "on"
		}
		else if(targObj.className == "article" || targObj.className == "articleList") { //check to see if column2's className is set to "article" or "articleList"
			targObj = navArray[1].className = "on"; //set the classname to "on"
		}
		else if(targObj.className == "product") { //check to see if column2's className is set to "products"
			targObj = navArray[2].className = "on"; //set the classname to "on"
		}
	}
}

window.onload = init; //initialize JS code after HTML is finished loading
