 
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var PreviousPageIndex=-1;

function incrementHistory(obj)
{
	// check if we're in the anchor object, if not grab the parent	
	if (obj.nodeName != "A")
	{
		obj=obj.parentNode;
	}
	
	var obj_href="";	
	// find the href attribute
	for (var i=0; i < obj.attributes.length; i++)
	{
		if( obj.attributes[i].nodeName.toLowerCase() == "href" )
			obj_href = obj.attributes[i].nodeValue;
	}	

	if (window.location.href.indexOf(obj_href) == -1)  // as long as the link we're clicking on isn't the current location increment pageIndex
	{	
		PreviousPageIndex--;
	}
}


function btnback(){

	history.go(PreviousPageIndex);
	
	//history.back();
}

 var isDHTML = 0;
 var isLayers = 0;
 var isAll = 0;
 var isID = 0;
 
 if (document.getElementById) 
 {
	isID = 1; 
	isDHTML = 1;
 }
 else 
 {
	if (document.all) 
	{
		isAll = 1; 
		isDHTML = 1;
	}
	else 
	{
		browserVersion = parseInt(navigator.appVersion);
		if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) 
		{
			isLayers = 1; 
			isDHTML = 1;
		}
	}
 }
 
 function findDOM(objectID,withStyle) 
 {
	if (withStyle == 1) 
	{
		if (isID) 
		{ 
			return (document.getElementById(objectID).style) ; 
		}
		else 
		{ 
			if (isAll) 
			{ 
				return (document.all[objectID].style); 
			}
			else 
			{
				if (isLayers) 
				{ 
					return (document.layers[objectID]); 
				}
			};
		}
	}
	//without style
	else 
	{
		if (isID) 
		{ 
			return (document.getElementById(objectID)) ; 
		}
		else 
		{ 
			if (isAll) 
			{ 
				return (document.all[objectID]); 
			}
			else 
			{
				if (isLayers) 
				{ 
					return (document.layers[objectID]); 
				}
			};
		}
	}
 }
 
 function setVisibility(ObjectID, state)
 {
	var Obj = findDOM(ObjectID, 1);
	Obj.visibility = state;
 }

function addScrollingDiv()
{
	//if we are not in netscape place textbody contents into a scrolling div
	var isNS = 0;
	var browVer = 0;
	if(navigator.appName.indexOf('Netscape') != -1)
	{
		isNS = 1;

		//give up on detecting which Netscape since it doesn't work properly in 7.0 anyway 
		//	alert (navigator.userAgent);
		//	var pos = navigator.userAgent.indexOf('Netscape') + 8;
		//	verString = navigator.userAgent.substr(pos);
		//	var browVer = verString.substr(1,3);
		//	alert(browVer);
	}
	if (isNS == 0)
	{
        var newDiv = document.createElement('div');
        newDiv.id = "mytext";
		var tableObj = document.getElementById('textbody');
		var divObj = document.getElementById('toolbar');
		divObj.parentNode.appendChild(newDiv);
		newDiv.appendChild(tableObj);
		tableObj.style.position = 'absolute'; 
		tableObj.style.left = '0px'; 
		tableObj.style.top = '0px'; 
	}
}

function storeCaret (textEl) {
  if (textEl.createTextRange)
    textEl.caretPos = document.selection.createRange().duplicate();
}

function insertAtCaret (textEl, text) {
  if (textEl.createTextRange && textEl.caretPos) {
    var caretPos = textEl.caretPos;
    caretPos.text =
      caretPos.text.charAt(caretPos.text.length - 1) == ' ' ?
        text + ' ' : text;
  }
  else
     textEl.value  = text;
}

function translateKey(evnt) 
{
	var charcode;
	var isNS = (navigator.appName.indexOf('Netscape') != -1);
	var keyInput = 0;
	if (isNS)
	{
		keyInput = evnt.which;
	}
	else
	{
		keyInput = event.keyCode;
	}
	switch(keyInput)
	{
		case 97://a
		charcode = 0x3b1;
		break;
		case 98://b
		charcode = 0x3b2;
		break;
		case 99://c
		charcode = 0x3c7;
		break;
		case 100://d
		charcode = 0x3b4;
		break;
		case 101://e
		charcode = 0x3b5;
		break;
		case 102://f
		charcode = 0x3c6;
		break;
		case 103://g
		charcode = 0x3b3;
		break;
		case 104://h
		charcode = 0x3b7;
		break;
		case 105://i
		charcode = 0x3b9;
		break;
		case 106://j
		charcode = 0x3ba;
		break;
		case 107://k
		charcode = 0x3ba;
		break;
		case 108://l
		charcode = 0x3bb;
		break;
		case 109://m
		charcode = 0x3bc;
		break;
		case 110://n
		charcode = 0x3bd;
		break;
		case 111://o
		charcode = 0x3bf;
		break;
		case 112://p
		charcode = 0x3c0;
		break;
		case 113://q
		charcode = 0x3b8;
		break;
		case 114://r
		charcode = 0x3c1;
		break;
		case 115://s
		charcode = 0x3c3;
		break;
		case 116://t
		charcode = 0x3c4;
		break;
		case 117://u
		charcode = 0x3c5;
		break;
		case 118://v
		charcode = 0x3c6;
		break;
		case 119://w
		charcode = 0x3c9;
		break;
		case 120://x
		charcode = 0x3be;
		break;
		case 121://y
		charcode = 0x3c8;
		break;
		case 122://z
		charcode = 0x3b6;
		break;
		default:
		charcode = 0;
		break;
	}
	if (!isNS)
	{
	//	document.selection.clear();
	}
	if (charcode > 0)
	{
		if (isNS)
		{
			sText = String.fromCharCode(charcode);
			document.ACCFORM.lookfor.value = document.ACCFORM.lookfor.value + sText;
			return false;
		}
		else
		{
			event.keyCode = charcode;
		}
	}
	else
	{
		return true;
	}
}

function isOldBrowser()
{
	var isIE55 = 0;
	var isIE6 = 0;
	var isNS6 = 0;
	var isNS7 = 0;
	var userAgent = navigator.userAgent;
//	alert(userAgent);
	if (userAgent.indexOf('MSIE 5.5') > 0)
		isIE55 = 1;
	if (userAgent.indexOf('MSIE 6') > 0)
		isIE6 = 1;
	if (userAgent.indexOf('Netscape6') > 0)
		isNS6 = 1;
	if (userAgent.indexOf('Netscape/7') > 0)
		isNS7 = 1;
//	if (isIE55)
//		alert('IE 5.5');
//	if (isIE6)
//		alert('IE 6');
//	if (isNS6)
//		alert('NS 6');
//	if (isNS7)
//		alert('NS 7');
	return (!isIE55 && !isIE6 && !isNS6 && !isNS7)	
}

function warnOldBrowsers()
{
	if (isOldBrowser())	
		alert('Please note that this site uses dynamic HTML and browsers below IE 5.5 and Netscape 6 are not supported.');
}



function warnGermanOldBrowsers()
{
	if (isOldBrowser())	
		alert('Diese Seite benutzt dynamische HTML und Browser vor IE 5 und Netscape 6 k' + String.fromCharCode(246) + 'nnen nicht benutzt werden.');
}

