var browserName=navigator.appName;var browserVer=parseInt(navigator.appVersion);var version="";var msie4=(browserName=="Microsoft Internet Explorer"&&browserVer>=4);if((browserName=="Netscape"&&browserVer>=3)||msie4||browserName=="Konqueror"||browserName=="Opera"){version="n3";}else{version="n2";}
function blurLink(theObject){if(msie4){theObject.blur();}}
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);}

/* E-Mail Adressen */
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);}else if(n>=0x40&&n<=0x5A){dec+=decryptCharcode(n,0x40,0x5A,offset);}else if(n>=0x61&&n<=0x7A){dec+=decryptCharcode(n,0x61,0x7A,offset);}else{dec+=enc.charAt(i);}}
return dec;}
function linkTo_UnCryptMailto(s){location.href=decryptString(s,-2);}
function addrMid() { document.write('@'); }
function addrEnd() { document.write('.'); }
function linkTo_SetMailto(a,b){location.href='mailto:'+b+'@'+a;}


/* Sprungmenu */
function MM_jumpMenu(targ,selObj,restore){ 
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

/* dynamisch posititonierter footer */
function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}
function setFooter() {
	// gueltig fuer folgende domains
	var validFooterDomainsString = "bttv.de, bttv.click-tt.de, bttv.burdadigital.de, bttvdemo.clickt-tt.de";
	var validFooterSubomainsString = "*.bttv.de, *.bttv.click-tt.de, *.bttv.burdadigital.de, *.bttvdemo.click-tt.de";

	
	if(((validFooterDomainsString.indexOf( window.location.hostname ) != -1 ) && ( validFooterDomainsString.charAt(validFooterDomainsString.indexOf( window.location.hostname )-1) == ' '))  //wenn die domain oben angegeben ist (ohne stern davor) 
	  	|| ((validFooterSubomainsString.indexOf( window.location.hostname.substr(window.location.hostname.indexOf('.')+1) ) != -1 )  && ( validFooterSubomainsString.charAt(validFooterSubomainsString.indexOf( window.location.hostname.substr(window.location.hostname.indexOf('.')) )-1) == '*')  )) { //wenn host eine sub ist und oben *.host angegeben ist
		if (document.getElementById) {
			var windowHeight = getWindowHeight();
			if (windowHeight > 0) {
				// container gesamthoehe ueber dem footer (id) eintragen
				var contentHeight = document.getElementById('container').offsetHeight + document.getElementById('tabs-external').offsetHeight;
				var footerElement = document.getElementById('footer');
				var footerHeight  = footerElement.offsetHeight;
				if (windowHeight - (contentHeight + footerHeight) >= 0) {
					footerElement.style.position = 'absolute';
					footerElement.style.top = (windowHeight - footerHeight) + 'px';
				}
				else {
					footerElement.style.position = 'static';
				}
			}
		}
	}
}


window.onload = function() {
	setFooter();
}
window.onresize = function() {
	setFooter();
}

/* socialbookmarks  */
function wt_socialbookmarks_add2favourite(Text, URL) {
	if (window.sidebar) { // firefox
		window.sidebar.addPanel(Text, URL, "");
	}
	
	else if(window.opera && window.print) { // opera
		var elem = document.createElement('a');
		elem.setAttribute('href', URL);
		elem.setAttribute('title', Text);
		elem.setAttribute('rel', 'sidebar');
		elem.click();
	}
	
	else if(document.all) { // ie
		window.external.AddFavorite(URL, Text);
	}
}

// IEPNGfix
// click-tt: loesung per css http://bttv.click.-tt.de/sources/template.css
/*
if (document.all && document.styleSheets && document.styleSheets[0] && document.styleSheets[0].addRule) {
	document.styleSheets[0].addRule('#header-logo img'  , 'behavior: url(/fileadmin/bttv/sources/iepngfix.htc)');
	document.styleSheets[0].addRule('#header-tagline img'  , 'behavior: url(/fileadmin/bttv/sources/iepngfix.htc)');
	document.styleSheets[0].addRule('#page'  , 'behavior: url(/fileadmin/bttv/sources/iepngfix.htc)');
	document.styleSheets[0].addRule('#header'  , 'behavior: url(/fileadmin/bttv/sources/iepngfix.htc)');
	document.styleSheets[0].addRule('body'  , 'behavior: url(/fileadmin/bttv/sources/iepngfix.htc)');
	document.styleSheets[0].addRule('.iepngfix'  , 'behavior: url(/fileadmin/bttv/sources/iepngfix.htc)');
}
*/