
/**
 *  File     : navigation.js
 *  Author(s)    : Naveen Kumar
 *  Creation Date: Sep 30, 2009
 *  Functionality: This file contains all navigation related js function.
 *  Dependencies : N/A
 *  Copyright    : P&G
 *  Modifications: <Author> <Date> <Description of Modification>
 */
var primarySelId = ""; //default value of primary selected nav
var secSelId = "";// //default value of secoundry selected nav
function defaultHighLightedNav(priHigh) {
	primarySelId = priHigh;
	if (document.getElementById(priHigh + "_main")) {
		(document.getElementById(priHigh + "_main")).className = "PrimeryHightlight";
	}
}
function flyOutOn(id) {
	(document.getElementById(id + "_main")).className = "PrimeryHightlight";
	(document.getElementById(id + "_flyout")).style.display = "block";
}
function flyOutOff(id) {
	if (primarySelId != id) {
		(document.getElementById(id + "_main")).className = "";
	}
	(document.getElementById(id + "_flyout")).style.display = "none";
}
function selectCountry() {
	if ((document.getElementById("selectCountry")).style.display == "none") {
		(document.getElementById("selectCountry")).style.display = "block";
	} else {
		(document.getElementById("selectCountry")).style.display = "none";
	}
}

// function for secoundry navigation
function defaultHighLightedSecNav() {
	var isArticleClass = "no";
	var secHigh = null;
	var articleId = null;
	/*if (document.getElementById("articleId")) {
		articleId = (document.getElementById("articleId")).value;
		if (articleId != "null") {
			((document.getElementById(articleId)).getElementsByTagName("a")[0]).className = "active";
			secHigh = (document.getElementById(articleId)).className;
			isArticleClass = "yes";
		}
	}*/
	
	
	 if (((document.getElementById("secHigh")).value!="")) {
		
		secHigh = (document.getElementById("secHigh")).value;
			if(document.getElementById(secHigh)){
		if((document.getElementById(secHigh)).className){
			var secSubId=secHigh;
			secHigh=(document.getElementById(secHigh)).className;
			secSelId = secHigh;
				((document.getElementById(secSubId)).getElementsByTagName("a")[0]).className = "active";
				imagePath = "data_root/fr_CA/breeders/images/common/secondarynavigation/NAV-SECONDARY-arrowdown-black.gif";
				((document.getElementById(secHigh)).getElementsByTagName("ul")[0]).style.display = "block";
				((document.getElementById(secHigh)).getElementsByTagName("a")[0]).style.color="#7DA6D8";
				((document.getElementById(secHigh)).getElementsByTagName("a")[0]).getElementsByTagName("img")[0].src = imagePath;
		
		}else{
		secSelId = secHigh;
		var imagePath = "data_root/fr_CA/breeders/images/common/secondarynavigation/NAV-SECONDARY-arrowright-pink.gif";
		if(((document.getElementById(secHigh)).getElementsByTagName("ul")[0])){
		((document.getElementById(secHigh)).getElementsByTagName("ul")[0]).style.display = "block";
		imagePath = "data_root/fr_CA/breeders/images/common/secondarynavigation/NAV-SECONDARY-arrowdown-darkpink.gif";
		}
		
		((document.getElementById(secHigh)).getElementsByTagName("a")[0]).className = "active";
		((document.getElementById(secHigh)).getElementsByTagName("a")[0]).getElementsByTagName("img")[0].src = imagePath;
	}
	}
	}
}
/**
 *	Function : changeImageOnmouseOut()
 *	Purpose  : This function will work on mouse out on the all secondary nav.
  *	author	 : Naveen Kumar
 */
function changeImageOnmouseOut(id) {
	if (id != secSelId) {
		var imagePath = "data_root/fr_CA/breeders/images/common/secondarynavigation/NAV-SECONDARY-arrow-white.gif";
		if (document.getElementById(id)) {
			((document.getElementById(id)).getElementsByTagName("a")[0]).className = "";
			((document.getElementById(id)).getElementsByTagName("a")[0]).getElementsByTagName("img")[0].src = imagePath;
		}
	}
}
	 
 // end of changeImageOnmouseOut method	 
/**
 *	Function : changeImageOnmouseOver()
 *	Purpose  : This function will work on mouse over on the all secondary nav.
  *	author	 : Naveen Kumar
 */
function changeImageOnmouseOver(id) {
	if (id != secSelId) {
		var imagePath = "data_root/fr_CA/breeders/images/common/secondarynavigation/NAV-SECONDARY-arrowright-pink.gif";
		if (document.getElementById(id)) {
			((document.getElementById(id)).getElementsByTagName("a")[0]).className = "active";
			((document.getElementById(id)).getElementsByTagName("a")[0]).getElementsByTagName("img")[0].src = imagePath;
		}
	}
}
	 
	//end of method 


