

var N4 = false; 
var IE = false; 
var W3C = false;
var init = false;

var prevStat = 'dmx';

BrName = navigator.appName;
BrNumb = navigator.appVersion.split(';');
BrPlat = navigator.platform;
BrInt = BrNumb[1].split(".");

if(document.layers) {
	N4=true;
	//writetext="";
}
if(document.all){
	IE=true;
}
if(document.getElementById){
	W3C=true;
}
if(IE && W3C && !document.getElementById("content")){
	W3C = false;
}
 
// - - FUNKTIONEN
function initPage(theMenu,subMenu){
	aktMainChap;
	aktSubChap;
	aktDetChap;
	
	
	//wXw = window.innerWidth;
	//if(!wXw){
	//	wXw = screen.availWidth;
	//}
	//modf = Math.round((wXw - 1000)*0.2);
	//alert(modf)
	//fS = 100 + modf;
	//document.getElementsByTagName("body")[0].style.fontSize=fS + "%";	
	// switch Mnu to proper state
	
	changeMe(aktMainChap,contC,"top");
	changeBox(aktSubChap,0,subMenC);
	if(aktDetChap != "" || aktDetChap == false){
		changeBox(aktDetChap,0,detMenC);
	}
	// hide Details menu 
	// - - checkout later in which case we need to - -!!!!
	if(IE) {
		if(document.all["detailNav"]){
			document.all["detailNav"].style.visibility="hidden";
		}
	}
	if(W3C) {
		if(document.getElementById("detailNav")){
			document.getElementById("detailNav").style.visibility="hidden";
		}
	}
	
}
// menu engine
function changeMe(chap,classId,menuPart){
	// activate actual
	changeBox(chap,0,classId);
	// menu top level?
	if(menuPart == "top"){
		// have we been somewhere before...
		if(OLDchapT != false && OLDchapT != chap ) {
			// so do close old menu 
			changeBox(OLDchapT,1,OLDclassIdT);
		}
		if(chap != OLDchapT) {
			// pleae remember whom to close nextTime
			OLDchapT = chap;
			OLDclassIdT = classId;
		}
	} 
}
// change the classes
function changeBox(cp,st,stCl){
	if(IE && document.all[cp]){
			document.all[cp].className = stCl[st];
	}
	if(W3C && document.getElementById(cp)){
			document.getElementById(cp).className = stCl[st];
		//alert(stCl[st] + "+" + cp);
	}
}
// sometimes forms has to be cleared
var txtClick = 0;
function clearCont(me, c){
	if(!c ||(c == true && c == 0)){
		me.value="";
		me.focus();
	}
	if(c == 0){ 
		txtClick++;
	}
}
// or senders entrys to be checked
function adrTest(adr){
	len=adr.length; at = adr.indexOf("@"); dot = adr.indexOf(".");
	if (len < 9 || at == -1 || dot == -1){
		alert("Ihre Absender-Adresse scheint nicht korrekt zu sein");
		return false;
	} else {
		return true;
	}
}
// Bilder Wechsel
function chPic(newPic){
	if(document['big']){
		document['big'].src = "i/" + newPic + ".jpg";
	}
}
function swDM(but,stat){
	meButt = rootPath + "i/" + detMenuBut[stat];
	if(document[but]){
		document[but].src = meButt;
	}
	window.status = meButt
}

