// navb

ns4 = (document.layers)? true:false;
ie4 = (document.all)? true:false;
ns6 = (document.documentElement)? true:false;

mycolorover = "#003366";
mycolorseite = "#ABBACA";

function bgnavb(wert){
	if (ns4) document.layers[wert].bgColor=mycolorover;
	if (ie4) document.all(wert).style.backgroundColor=mycolorover;
}

function bgnavbback(wert){
	if (ns4 && document.layers[wert]) document.layers[wert].bgColor=mycolorseite;
	if (ie4 && document.all(wert)) document.all(wert).style.backgroundColor=mycolorseite;
}

function initnavb (layer,id,max) {
	for (i=1; i<=max; i++){
		if (i != id) bgnavbback(layer+i);
	}
}

function rv (f, c){
     ctrl = document.forms[f].elements[c];   // BUG in JS? If only ONE Radio in Form, this returns UNDEF
     if (ctrl) {
        for (i=0; i < ctrl.length; i++) {
           // if (ctrl[i].checked) return ++i;
           if (ctrl[i].checked) return ctrl[i].value;
        }
     }
     return 1;          // default for price type = 1
}



var navanz = 6;
var tboxclickvalue = false;

// box ein- oder ausblenden
function tboxclick (nav) {
	if (tboxclickvalue) {
		tboxreset();
	} else {
		tboxclickvalue = true;
		tbox(nav);
	}
}

function tbox (nav) {
	if (ns4) {
		obj = eval ("document.navh"+nav+"a");
		status = "show";
	}
	else if (ns6) {
		obj = eval ("document.getElementById('navh"+nav+"a').style");
		status = "visible";
	}
	else {
		obj = eval ("document.all.navh"+nav+"a.style");
		status = "visible";
	}
	if (obj.visibility != status){
		tboxdelall();
		obj.visibility = "visible";
	}
}


// alle boxen reseten
function tboxdel () {
	if (!tboxclickvalue) {
		tboxdelall();
	}
}
function tboxreset () {
	tboxclickvalue = false;
	tboxdelall();
}

function tboxdelall () {
	for (i=1; i<=navanz; i++) {
		if (ns4) {
			eval ("document.navh"+i+"a.visibility = 'hidden';");
		}
		else if (ns6) {
			eval ("document.getElementById('navh"+i+"a').style.visibility = 'hidden';");
		}
		else {
			eval ("document.all.navh"+i+"a.style.visibility = 'hidden';");
		}
	}
}


// logik basket button anzeigen bei erster bestellung. ohne reload
function checkbaskebutton () {
	if (window.opener.basketbutton > 0) {
		navb_count = window.opener.basketbutton;
		// basket button anzeigen und pos an erste stelle
		if (document.layers) {
			obj1 = eval ("window.opener.document.navb" + navb_count);
			obj2 = eval ("window.opener.document.navbbg" + navb_count);
		} else {
			obj1 = eval ("window.opener.document.all.navb" + navb_count + ".style");
			obj2 = eval ("window.opener.document.all.navbbg" + navb_count + ".style");
		}
		obj1.top = 177;
		obj2.top = 177;
		obj1.visibility = "visible";
		obj2.visibility = "visible";
		buttonpos(navb_count);
	}
}
function checkbaskebutton_free () {
	if (window.opener.basketbutton_free > 0) {
		navb_count = window.opener.basketbutton_free;
		// basket button anzeigen und pos an erste stelle
		if (document.layers) {
			obj1 = eval ("window.opener.document.navb" + navb_count);
			obj2 = eval ("window.opener.document.navbbg" + navb_count);
		} else {
			obj1 = eval ("window.opener.document.all.navb" + navb_count + ".style");
			obj2 = eval ("window.opener.document.all.navbbg" + navb_count + ".style");
		}
		obj1.top = 177;
		obj2.top = 177;
		obj1.visibility = "visible";
		obj2.visibility = "visible";
		buttonpos(navb_count);
	}
}
// button nach unten schieben
function buttonpos (navb_count) {
	for (i=1; i<navb_count; i++) {
		if (document.layers) {
			obj1 = eval ("window.opener.document.navb" + i);
			obj2 = eval ("window.opener.document.navbbg" + i);
		} else {
			obj1 = eval ("window.opener.document.all.navb" + i + ".style");
			obj2 = eval ("window.opener.document.all.navbbg" + i + ".style");
		}
		pos = 177 + i *19;
		obj1.top = pos;
		obj2.top = pos;
	}
}


function sh (id)
{
   document.getElementById (id).style.display = (document.getElementById (id).style.display == 'block' ? 'none' : 'block');
}



code_loaded = 1;

