/* JavaScript for Antec-Online Navigation */
/* Author: Andi Kuhn, eMail: a.kuhn@andi.com */
/* Version: 01, date: 01-09-12 */

// detect uncapable browsers:
agent = navigator.userAgent
browserVer = 2
if (agent.indexOf("a/4",6) == 6) browserVer = 1
else {
	if (agent.indexOf("a/3",6) == -1) browserVer = 2
	else browserVer = 1
}
Loaded = false;
// executed when page is loaded:
function initiate(){
	LowLightAllBoxes(); // give all boxes default state norm
	if (DoBoxHigh) NewBoxStates(DoBoxHigh); // erste box wird high wenn nicht chapter "products" (DoBoxHigh liegt in nav.htm)
	Loaded = true;
}	
// executed on mouse over:
function MouseOver(id){
	if (Loaded)	HighLight(id);
}
// executed on mouse out:
function MouseOut(id){
	if (Loaded)	LowLight(id);
}
// executed on click:
function Click(id){
	LowLightAllBoxes(); // give all boxes default state norm
	NewBoxStates(id);
}


// make HighLight of box:
function HighLight(id){
		eval("document.box_" +id+ ".src = '"+path_to_basedir+"/images/general/nav_submenu_box_high.gif'");
}
// make LowLight of box:
function LowLight(id){
		eval("document.box_" +id+ ".src = box_" +id+ "status");
}
//give all boxes default state norm
function LowLightAllBoxes(){
	for(i = 0; i < NumberOfSubmenus; i++){
		IdOfSubmenu = i+""
		eval("box_" +IdOfSubmenu+ "status = '"+path_to_basedir+"/images/general/nav_submenu_box_norm.gif'");
		eval("document.box_" +IdOfSubmenu+ ".src = box_" +IdOfSubmenu+ "status");
		if (document.all) document.all['nav_'+IdOfSubmenu].style.color = '#ffffff'; //make all text white (IE only)
	}
}

function NewBoxStates(id){
	// highlight clicked box and set default state to "high":
	eval("document.box_" +id+ ".src = '"+path_to_basedir+"/images/general/nav_submenu_box_high.gif'");
	eval("box_" +id+ "status = '"+path_to_basedir+"/images/general/nav_submenu_box_high.gif'");
	if (document.all) document.all['nav_'+id].style.color = '#ff9c00'; // make clicked text orange (IE only)
}	
