var LINECOLOR;
if(top.MasterColor)
{
	LINECOLOR=top.MasterColor;	// Farbe des Unterstriches bei Mouse-Over
}
else
{
	LINECOLOR="FFC913";	// Farbe des Unterstriches bei Mouse-Over
}
var BGCOLOR="#FFFFFF"; // allg. Hintergrundfarbe
var SRVNAV_FONTCOLOR_NORMAL="#939393"; // Schriftfarbe d. Service-Nav. normal
var SRVNAV_FONTCOLOR_GLOW="#000000"; // Schriftfarbe d. Service-Nav. fokussiert

window.onerror=catcherr;
function catcherr()
{
}

// Browser-Detection
function getIEVersionNumber() {
	var ua = navigator.userAgent;
	var MSIEOffset = ua.indexOf("MSIE ");
	if (MSIEOffset == -1) {
		return 0;
	} else {
		return parseFloat(ua.substring(MSIEOffset + 5, ua.indexOf(";", MSIEOffset)));
	}
}

var version=parseFloat(navigator.appVersion), agent=navigator.userAgent.toLowerCase();
var opera=(agent.indexOf('opera')!=-1)?true:false;
var ie=((document.all)&&(version>=4.0)&&(!opera))?true:false;
var ie4=(agent.indexOf('msie 4')>=0)?true:false;
var ie50=(agent.indexOf('msie 5.0')>=0)?true:false;
var nn4=document.layers?true:false;
var nn6=((version>=5.0)&&((agent.indexOf('netscape')>=0)||(agent.indexOf('gecko')>=0)))?true:false;
var dom=nn6||opera;
var mac=(agent.indexOf("mac")!=-1)?true:false;
var fFilters=(!mac&&ie)?true:false;
var fGadgets=true;

var ie55 = getIEVersionNumber() >= 5.5;


function fToggleLayer(objId, vbShow){

	dom = xGetElementById(objId)

	if (vbShow) {
		dom.style.display = 'block';
	} else {
		dom.style.display = 'none';
	}

}

function hideLayer(id)
{
	var lo1;
	if(ie)
	{
		lo1=document.all[id];
		if (lo1)
		{
			lo1.style.visibility="hidden";
		}
	}
	else if(dom)
	{
		lo1=document.getElementById(id);
		if (lo1)
		{
			lo1.style.visibility="hidden";
		}
	}
	else if(nn4)
	{
		document.layers[id].visibility="hide";
	}
}
function showLayer(id)
{
	var lo1;
	if(ie)
	{
		lo1=document.all[id];
		if (lo1)
		{
			lo1.style.visibility="visible";
		}
	}
	else if(dom)
	{
		lo1=document.getElementById(id);
		if (lo1)
		{
			lo1.style.visibility="visible";
		}
	}
	else if(nn4)
	{
		document.layers[id].visibility="show";
	}
}
function setText(lay,txt)
{
	if(ie)
	{
		document.all[lay].innerHTML=txt;
	}
	else if(dom)
	{
		document.getElementById(lay).innerHTML=txt;
	}
	else if(nn4)
	{
		var f=document.layers[lay].document;
		f.open();
		f.writeln(txt);
		f.close();
	}
}
function setFocus(id)
{
	var e;
	if(ie)
	{
		e=document.all[id];
	}
	else if(dom)
	{
		e=document.getElementById(id);
	}
	if(e)
	{
		e.focus();
		e.select();
	}
}
function setWaiting(id,text)
{
	var e;
	if(ie)
	{
		e=document.all[id];
	}
	else if(dom)
	{
		e=document.getElementById(id);
	}
	if(e)
	{
		e.value=text;
		e.disabled=true;
	}
	return true;
}

// Main-Menue + Service-Menue steuern
var timerID=null;
var setmenu_cc=0;
function setmenu(mainmenu,servicenav)
{
	if(timerID)
	{
		clearTimeout(timerID);
	}
	setmenu_cc++;
	if(setmenu_cc == 4)
	{
		return;
	}
	if((parent.menu) && (parent.menu.isMENU))
	{
		if(parent.menu.menuLoaded == 1)
		{
			parent.menu.srvnavClick(servicenav);
			parent.menu.setMenu(mainmenu);
			return;
		}
		else
		{
			timerID=setTimeout("setmenu(\'" + mainmenu + "\'," + servicenav + ")", 500);
		}
	}
	else
	{
		timerID=setTimeout("setmenu(\'" + mainmenu + "\'," + servicenav + ")", 500);
	}
}
function setsidemenu(id)
{
	// Eintrag im Submenu links auswaehlen
	if((parent.sidemenu)&&(parent.sidemenu.isSIDEMENU))
	{
		parent.sidemenu.selectitem(id);
	}
}
function zoomImage(filename,winname,w,h)
{
	// Popup mit grossem Bild oeffnen:
	if(w==null || h==null)
	{
		w=518; 
		h=565;
	}
	if(winname==null)
	{
		winname= "Dornbracht";
	}
	var l=(screen.width) ? (screen.width-w)/2 : 0;
	var t=(screen.height) ? (screen.height-h)/2 : 0;
	var win = window.open(filename, winname, "toolbar=no,scrollbars=no,location=no,directories=no,status=no,menubar=no,resizable=no,width="+w+",height="+h+",left="+l+",top="+t);
	if(win)
	{
		win.opener=self;
	}
	//if (win) {win.opener=top;}
	var z=parseFloat(navigator.appVersion);
	if(navigator.appName.substring(0,8) == "Netscape" || z > 4)
	{
		win.focus();
	}
}
function zoom(filename,winname,w,h)
{
	if(w==null || h==null)
	{
		w=518; 
		h=565;
	}
	if(winname==null)
	{
		winname= "Dornbracht";
	}
	var l=(screen.width) ? (screen.width-w)/2 : 0;
	var t=(screen.height) ? (screen.height-h)/2 : 0;
	var win= window.open(filename, winname, "toolbar=no,scrollbars=no,location=no,directories=no,status=no,menubar=no,resizable=no,width="+w+",height="+h+",left="+l+",top="+t);
	if(win)
	{
		win.opener=self;
	}
	//if (win) {win.opener=top;}
	var z=parseFloat(navigator.appVersion);
	if(navigator.appName.substring(0,8) == "Netscape" || z > 4)
	{
		win.focus();
	}
}
function zoomscroll(filename,winname,w,h)
{
	if(w==null || h==null)
	{
		w=518; 
		h=565;
	}
	if(winname==null)
	{
		winname="Dornbracht";
	}
	var l=(screen.width) ? (screen.width-w)/2 : 0;
	var t=(screen.height) ? (screen.height-h)/2 : 0;
	var win=window.open(filename, winname, "toolbar=no,scrollbars=yes,location=no,directories=no,status=no,menubar=no,resizable=yes,width="+w+",height="+h+",left="+l+",top="+t);
	if(win)
	{
		win.opener=self;
	}
	var z=parseFloat(navigator.appVersion);
	if(navigator.appName.substring(0,8) == "Netscape" || z > 4)
	{
		win.focus();
	}
}

function openWinExt(vsTitle,vsUrl,weite,hoehe)
{
	var width=screen.width;
	var oben=(screen.availHeight-hoehe)/2;
	var links=(screen.availWidth-weite)/2;
	var param="width="+weite+",height="+hoehe+",resizable=0,scrollbars=no,menubar=0,status=0,xscreen=0,yscreen=0,left="+links+",top="+oben;
	return window.open(vsTitle,vsUrl,param);
}

function openWin(vsTitle,vsUrl,weite,hoehe) 
{
	 openWinExt(vsTitle,vsUrl,weite,hoehe);
}

function toggleBtn(Bildname,BildSrc,vbOnOff)
{
	//var ButCol=top.MasterColor;
	var ButCol=LINECOLOR;
	var lsBild;
	if(document.images)
	{
		if (BildSrc!='')
		{
			lsBild=BildSrc;
			if (vbOnOff==1)
			{
				var i=lsBild.lastIndexOf(".");
				lsBild=lsBild.substring(0,i)+"_"+ButCol+"_on"+lsBild.substring(i,lsBild.length);
			}
		}
		else
		{
			lsBild="images/"+Bildname;
			if (vbOnOff==1)
			{
				lsBild+="_on";
			}
			lsBild+=".gif";
		}
    	document.images[Bildname].src=lsBild;
	}
}

function Copy2Clip(key, myText, myMsg)
{
// Microsoft Internet Explorer ab Version 5.

	window.clipboardData.setData("Text", myText);
	if (myMsg != null) {
		alert(myMsg);
	}
	return ;

	var trElements = document.all.tags("tr");
	var i;
	for(i = 0; i < trElements.length; ++i)
	{
		if(key.parentElement.parentElement.parentElement == trElements[i].parentElement)
		{
			window.clipboardData.setData("Text", trElements[i].innerText);
		}
	}
}

