// JavaScript Document
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(".");



var cSection = null;
var cSubsection = null;

var pn = document.location.pathname.substr(1);
var splittedPath = pn.split("/");
cDoc = splittedPath[splittedPath.length-1];
cName = cDoc.split(".");
cSection = cName[0];
subSection=cSection.split("_");
//alert(cSection);
function chBg() 
	{
	if(document.layers) 
		{
		N4=true;
		//writetext="";
		}
	if(document.all)
		{
		IE=true;
		}
	if(document.getElementById("test"))
		{
		W3C=true;
		}
	if(IE && W3C && !document.getElementById("test"))
		{
		W3C = false;
		}
	else if(IE && W3C && document.getElementById("test"))
		{
		IE = false;
		}
	// alert(cSection);
	// alert(IE +"/"+ W3C +"/"+ N4);
	if((W3C && document.getElementById(cSection)) || (IE && document.all[cSection]))
		{
		doImg(cSection,0);
		}
	else 
		{
		doImg(subSection[0],1);
		if(subSection[0]=="kontakt") changeClass('kontakt_box','mmpt_w_over');
		changeClass(subSection[1],"smptB");
		}
	}
// change IMG
function doImg(pic,stat)
	{
	if(pic && pic != 'index') document[pic].src = "i/nav/"+pic+"_f.gif";
	}
// CHANGE BORDER ATTRIBUTS
function doBorder(box,rand)
	{
	if(IE && document.all[box])
		{
		if(rand < 1) document.all[box].style.backgroundImage = "url(i/menubg.gif)";
		else document.all[box].style.backgroundImage = "url(i/submenubg.gif)";
		}
	if(W3C && document.getElementById(box))
		{
		if(rand < 1) document.getElementById(box).style.backgroundImage = "url(i/menubg.gif)";
		else document.getElementById(box).style.backgroundImage = "url(i/submenubg.gif)";
		}
	}
// change the classes
function changeClass(cp,st){
	if(IE && document.all[cp]){
			document.all[cp].className = st;
	}
	if(W3C && document.getElementById(cp)){
			document.getElementById(cp).className = st;
		//alert(st + "+" + cp);
	}
}