function oe(Fehler,Datei,Zeile){
	alert('Es ist der JS- Fehler: '+Fehler+', in der Datei: '+Datei+', in der Zeile: '+Zeile+'Aufgetreten.');
};
function oe2(){
	return true;	
};
window.onerror=oe;

// decrypt helper function
function decryptCharcode(n,start,end,offset) {
	n = n + offset;
	if (offset > 0 && n > end)	{
		n = start + (n - end - 1);
	} else if (offset < 0 && n < start)	{
		n = end - (start - n - 1);
	}
	return String.fromCharCode(n);
};
// decrypt string
function decryptString(enc,offset) {
	var dec = "";
	var len = enc.length;
	for(var i=0; i < len; i++)	{
		var n = enc.charCodeAt(i);
		if (n >= 0x2B && n <= 0x3A)	{
			dec += decryptCharcode(n,0x2B,0x3A,offset);	// 0-9 . , - + / :
		} else if (n >= 0x40 && n <= 0x5A)	{
			dec += decryptCharcode(n,0x40,0x5A,offset);	// A-Z @
		} else if (n >= 0x61 && n <= 0x7A)	{
			dec += decryptCharcode(n,0x61,0x7A,offset);	// a-z
		} else {
			dec += enc.charAt(i);
		}
	}
	return dec;
};
// decrypt spam-protected emails
function linkTo_UnCryptMailto(s)	{
	location.href = decryptString(s,'.($GLOBALS["TSFE"]->spamProtectEmailAddresses*-1).');
};
function decryptCharcode(n,start,end,offset) {
	n = n + offset;
	if (offset > 0 && n > end)	{
		n = start + (n - end - 1);
	} else if (offset < 0 && n < start)	{
		n = end - (start - n - 1);
	}
	return String.fromCharCode(n);
};
  // decrypt string
function decryptString(enc,offset) {
	var dec = "";
	var len = enc.length;
	for(var i=0; i < len; i++)	{
		var n = enc.charCodeAt(i);
		if (n >= 0x2B && n <= 0x3A)	{
			dec += decryptCharcode(n,0x2B,0x3A,offset);	// 0-9 . , - + / :
		} else if (n >= 0x40 && n <= 0x5A)	{
			dec += decryptCharcode(n,0x40,0x5A,offset);	// A-Z @
		} else if (n >= 0x61 && n <= 0x7A)	{
			dec += decryptCharcode(n,0x61,0x7A,offset);	// a-z
		} else {
			dec += enc.charAt(i);
		}
	}
	return dec;
};
window.opera = window.opera;
  // decrypt spam-protected emails
function linkTo_UnCryptMailto(s)	{
	location.href = decryptString(s,2);
};

var $ = function(Obj,Doc)
{
	return (Doc||document).getElementById(Obj);
};
var $T = function(Tag,Parent)
{
	Tag=Tag?Tag:'*';
	return ((document.getElementsByTagName('*').length == 0) && (Tag=='*'))?(Parent||document).all:(Parent||document).getElementsByTagName(Tag);
};
window.$GLOBALS = {};
if(navigator.appVersion.match(/MSIE/)&&!navigator.appVersion.match(/Macintosh/)&&!opera&&!navigator.appVersion.match(/Konqueror/)){
	if(navigator.appVersion.match(/MSIE/)){
		$GLOBALS.IE=true;
	}
	if(navigator.appVersion.match(/MSIE 7/)){
		$GLOBALS.IE7=true;	
	}
	if(navigator.appVersion.match(/MSIE 8/)){
		$GLOBALS.IE8=true;	
	}
}
// Blurring links:
function blurLink(theObject)	{	//
	if ($GLOBALS.IE && !$GLOBALS.IE7 && !$GLOBALS.IE8){theObject.blur();}
};
function init()
{
	var a=$T('a'), arr=[], inp = $T('input');

	for(var i=0;i<a.length;i++){
		arr[i] = a[i];
	}
	for(i=0;i<inp.length;i++){
		if(inp[i].type=='submit' || inp[i].type=='image' || inp[i].type=='reset' || inp[i].type=='file' || inp[i].type=='button' || inp[i].type=='checkbox' || inp[i].type=='radio'){
			if($GLOBALS.IE && (inp[i].type=='file')){
				continue;	
			}
			arr = arr.concat([inp[i]]);
		}
	}
	
	inp = [];
	a = arr;
	
	for(i=0;i<a.length;i++){ // http://www.tomislav.net/gestrichelte-linie-um-link-verstecken.htm
		a[i].onmousedown	= function(){this.onfocus=function(){this.blur();};};
		a[i].onmouseup		= function(){this.onfocus=function(){};};
		a[i].onmouseout		= a[i].onmouseup;
		if(a[i].firstChild && a[i].firstChild.data && (a[i].firstChild.data.indexOf('(at)')!==-1)){
			a[i].firstChild.data = a[i].firstChild.data.replace('(at)','@');
		}
	}
	if($GLOBALS.IE && !$GLOBALS.IE7 && !$GLOBALS.IE8 && $('wrapper') && $('wrapper').className && ($('wrapper').className=='taetigkeitsfelder')){
		for(var x=0; x<$T('img', $('content')).length; x++){
			var aTag = $T('img', $('content'))[x].parentNode;
			if(aTag.href.indexOf('krankenhaeuser/')>-1){
				aTag.style.display = 'inline';
				aTag.style.position = 'absolute';
				aTag.style.marginLeft = '-15px';
			}
			if(aTag.href.indexOf('krankenkassen/')>-1){
				aTag.style.display = 'inline';
				aTag.style.position = 'absolute';
				aTag.style.marginLeft = '135px';
			}
			if(aTag.href.indexOf('pharma_med_tech/')>-1){
				aTag.style.display = 'inline';
				aTag.style.position = 'absolute';
				aTag.style.marginLeft = '285px';
			}
			if(aTag.href.indexOf('pflege/')>-1){
				aTag.style.display = 'inline';
				aTag.style.marginLeft = '435px';
			}
		}
	}
}
var trim = function (val){
	return val.replace(/\s+$/,'').replace(/^\s+/,'');	
};

window.onload=init;
