function SchichtTextZeigenOderVerstecken(NameSchicht, NameKlasse)
{
	document.getElementById(NameSchicht).className = NameKlasse;
}

function WechselHauptnav(name,basis)
{
	window.document.images[name].src = basis;
}

function SchichtSitemapZeigenOderNicht(NameSchicht)
{
	if(document.getElementById(NameSchicht).className == 'SchichtSitemapGesamtOn')
	{
		document.getElementById(NameSchicht).className = 'SchichtSitemapGesamtOff';
	}else{
		document.getElementById(NameSchicht).className = 'SchichtSitemapGesamtOn';
	}
}

function SchichtGrossbildZeigenOderNicht(NameSchicht)
{
	if(document.getElementById(NameSchicht).className == 'SchichtMagazinBildGrossOn')
	{
		document.getElementById(NameSchicht).className = 'SchichtMagazinBildGrossOff';
	}else{
		document.getElementById(NameSchicht).className = 'SchichtMagazinBildGrossOn';
	}
}


function SchichtPartnerZeigen(PartnerBildBasis, PartnerInfoText)
{
	
	// dann dasjenige einschalten
	
	document.images['PartnerPortrait'].src = PartnerBildBasis.src;
	document.getElementById('PartnerTextNameUndFunktion').innerHTML = PartnerInfoText;
}

function MailLinkGenerieren(mailnam,mailsvr,maildom,text)
{
  if(text=="")
  {
    document.write('<a href="mailto:'+mailnam+'@'+mailsvr+'.'+maildom+'">'+mailnam+'@'+mailsvr+'.'+maildom+'</a>');
  }else{
    document.write('<a href="mailto:'+mailnam+'@'+mailsvr+'.'+maildom+'">'+text+'</a>');
  }
}


function FensterOeffner(DateiName, FensterName, FensterHoehe,Fensterbreite)
{
	FensterName = window.open(DateiName, FensterName, 'width=' + Fensterbreite + ',height=' + FensterHoehe + ',scrollbars=YES');
	FensterName.focus();
}

/*--------------------------------*/

/*-- anfang cookies.js -- */


// name = string equal to the name of the instance of the object
// defaultExpiration = number of units to make the default expiration date for the cookie
// expirationUnits = 'seconds' | 'minutes' | 'hours' | 'days' | 'months' | 'years' (default is 'days')
// defaultDomain = string, default domain for cookies; default is current domain minus the server name
// defaultPath = string, default path for cookies; default is '/'
function Cookiemanager(name,defaultExpiration,expirationUnits,defaultDomain,defaultPath) {
	// remember our name
	this.name = name;
	// get the default expiration
	this.defaultExpiration = this.getExpiration(defaultExpiration,expirationUnits);
	// set the default domain to defaultDomain if supplied; if not, set it to document.domain
	// if document.domain is numeric, otherwise strip off the server name and use the remainder
	this.defaultDomain = (defaultDomain)?defaultDomain:(document.domain.search(/[a-zA-Z]/) == -1)?document.domain:document.domain.substring(document.domain.indexOf('.') + 1,document.domain.length);
	// set the default path
	this.defaultPath = (defaultPath)?defaultPath:'/';
	// initialize an object to hold all the document's cookies
	this.cookies = new Object();
	// initialize an object to hold expiration dates for the doucment's cookies
	this.expiration = new Object();
	// initialize an object to hold domains for the doucment's cookies
	this.domain = new Object();
	// initialize an object to hold paths for the doucment's cookies
	this.path = new Object();
	// set an onlunload function to write the cookies
	window.onunload = new Function (this.name+'.setDocumentCookies();');
	// get the document's cookies
	this.getDocumentCookies();
	}
// gets an expiration date for a cookie as a GMT string
// expiration = integer expressing time in units (default is 7 days)
// units = 'miliseconds' | 'seconds' | 'minutes' | 'hours' | 'days' | 'months' | 'years' (default is 'days') 
Cookiemanager.prototype.getExpiration = function(expiration,units) {
	// set default expiration time if it wasn't supplied
	expiration = (expiration)?expiration:7;
	// supply default units if units weren't supplied
	units = (units)?units:'days';
	// new date object we'll use to get the expiration time
	var date = new Date();
	// set expiration time according to units supplied
	switch(units) {
		case 'years':
			date.setFullYear(date.getFullYear() + expiration);
			break;
		case 'months':
			date.setMonth(date.getMonth() + expiration);
			break;
		case 'days':
			date.setTime(date.getTime()+(expiration*24*60*60*1000));
			break;
		case 'hours':
			date.setTime(date.getTime()+(expiration*60*60*1000));
			break;
		case 'minutes':
			date.setTime(date.getTime()+(expiration*60*1000));
			break;
		case 'seconds':
			date.setTime(date.getTime()+(expiration*1000));
			break;
		default:
			date.setTime(date.getTime()+expiration);
			break;
		}
	// return expiration as GMT string
	return date.toGMTString();
	}
// gets all document cookies and populates the .cookies property with them
Cookiemanager.prototype.getDocumentCookies = function() {
	var cookie,pair;
	// read the document's cookies into an array
	var cookies = document.cookie.split(';');
	// walk through each array element and extract the name and value into the cookies property
	var len = cookies.length;
	for(var i=0;i < len;i++) {
		cookie = cookies[i];
		// strip leading whitespace
		while (cookie.charAt(0)==' ') cookie = cookie.substring(1,cookie.length);
		// split name/value pair into an array
		pair = cookie.split('=');
		// use the cookie name as the property name and value as the value
		this.cookies[pair[0]] = pair[1];
		}
	}
// sets all document cookies
Cookiemanager.prototype.setDocumentCookies = function() {
	var expires = '';
	var cookies = '';
	var domain = '';
	var path = '';
	for(var name in this.cookies) {
		// see if there's a custom expiration for this cookie; if not use default
		expires = (this.expiration[name])?this.expiration[name]:this.defaultExpiration;
		// see if there's a custom path for this cookie; if not use default
		path = (this.path[name])?this.path[name]:this.defaultPath;
		// see if there's a custom domain for this cookie; if not use default
		domain = (this.domain[name])?this.domain[name]:this.defaultDomain;
		// add to cookie string
		cookies = name + '=' + this.cookies[name] + '; expires=' + expires + '; path=' + path + '; domain=' + domain;
		document.cookie = cookies;
		}
	return true;
	}
// gets cookie value
// cookieName = string, cookie name
Cookiemanager.prototype.getCookie = function(cookieName) {
	var cookie = this.cookies[cookieName]
	return (cookie)?cookie:false;
	}
// stores cookie value, expiration, domain and path
// cookieName = string, cookie name
// cookieValue = string, cookie value
// expiration = number of units in which the cookie should expire
// expirationUnits = 'miliseconds' | 'seconds' | 'minutes' | 'hours' | 'days' | 'months' | 'years' (default is 'days')
// domain = string, domain for cookie
// path = string, path for cookie
Cookiemanager.prototype.setCookie = function(cookieName,cookieValue,expiration,expirationUnits,domain,path) {
	this.cookies[cookieName] = cookieValue;
	// set the expiration if it was supplied 
	if (expiration) this.expiration[cookieName] = this.getExpiration(expiration,expirationUnits);
	// set path if it was supplied
	if (domain) this.domain[cookieName] = domain;
	if (path) this.path[cookieName] = path;
	return true;
	}

var cookieManager = new Cookiemanager('cookieManager',1,'years');

/*-- ende cookies.js --*/
/*--------------------*/
/*-- anfang efa_fontsize.js --*/

//var efa_default = 84;
var efa_default = 84;
var efa_increment = 10;

var max_zoom = 100;
var min_zoom = 59;

var efa_bigger = ['',
	'groesser',
	'gr&ouml;&szlig;er',
	'',
	'',
	'',
	'',
	'',
	'',
	'',
	'',
	'ClassGroesser'
	]

var efa_reset = ['',
'standard',
'original',
'',
'',
'',
'',
'',
'',
'',
'',
'ClassOriginal'
]
	
var efa_smaller = ['',
	'kleiner',
	'kleiner',
	'',
	'',
	'',
	'',
	'',
	'',
	'',
	'',
	'ClassKleiner'
	//'<' + '/p>'
	]

function Efa_Fontsize(increment,bigger,reset,smaller,def) {
	this.w3c = (document.getElementById);
	this.ms = (document.all);
	this.userAgent = navigator.userAgent.toLowerCase();
	this.isMacIE = ((this.userAgent.indexOf('msie') != -1) && (this.userAgent.indexOf('mac') != -1) && (this.userAgent.indexOf('opera') == -1));
	this.isOldOp = ((this.userAgent.indexOf('opera') != -1)&&(parseFloat(this.userAgent.substr(this.userAgent.indexOf('opera')+5)) <= 7));

	if ((this.w3c || this.ms) && !this.isOldOp && !this.isMacIE) {
		this.name = "efa_fontSize";
		this.cookieName = 'efaSize';
		this.increment = increment;
		this.def = def;
		this.defPx = Math.round(16*(def/100))
		this.base = 1;
		this.pref = this.getPref();
		this.testHTML = '<div id="efaTest" style="position:absolute;visibility:hidden;line-height:1em;">&nbsp;</div>';
		this.biggerLink = this.getLinkHtml(1,bigger);
		this.resetLink = this.getLinkHtml(0,reset);
		this.smallerLink = this.getLinkHtml(-1,smaller);
	} else {
		this.biggerLink = '';
		this.resetLink = '';
		this.smallerLink = '';
		this.efaInit = new Function('return true;');
	}

	this.allLinks = this.biggerLink + this.resetLink + this.smallerLink;
}


Efa_Fontsize.prototype.efaInit = function() {
document.writeln(this.testHTML);
this.body = (this.w3c)?document.getElementsByTagName('body')[0].style:document.all.tags('body')[0].style;
this.efaTest = (this.w3c)?document.getElementById('efaTest'):document.all['efaTest'];
var h = (this.efaTest.clientHeight)?parseInt(this.efaTest.clientHeight):(this.efaTest.offsetHeight)?parseInt(this.efaTest.offsetHeight):999;
if (h < this.defPx) this.base = this.defPx/h;
this.body.fontSize = Math.round(this.pref*this.base) + '%';
}

Efa_Fontsize.prototype.getLinkHtml = function(direction,properties) {
	//var DerLinkText = 'xx' + properties[2];
	var html = properties[0] + '<div class="SchichtLinkSchriftGroesse"><div class="SchichtLinkSchriftGroesseBuchstabe"><div class="' + properties[11] + '">A</div></div><a class="" title="' + properties[2] + '" onmouseover="this.style.cursor=\'pointer\'" onmouseout="this.style.cursor=\'default\'" onclick="efa_fontSize.setSize(' + direction + '); return false;">' + properties[2];
	//html += (properties[2])?'title="' + properties[2] + '"':'';
	html += (properties[3])?'class="' + properties[3] + '"':'';
	html += (properties[4])?'id="' + properties[4] + '"':'';
	html += (properties[5])?'name="' + properties[5] + '"':'';
	html += (properties[6])?'accesskey="' + properties[6] + '"':'';
	html += (properties[7])?'onmouseover="' + properties[7] + '"':'';
	html += (properties[8])?'onmouseout="' + properties[8] + '"':'';
	html += (properties[9])?'onfocus="' + properties[9] + '"':'';
	
	if (properties[1] == 'kleiner'){
	    //var makeimage = '<img src="img/icon_kleiner.gif" width="15" height="15" alt="Schrift verkleinern" border="0" />';
	}
	if(properties[1] == 'standard'){
		//var makeimage = '<img src="img/icon_standard.gif" width="15" height="15" alt="zurücksetzen" border="0" />';
	}
	if(properties[1] == 'groesser'){
	    //var makeimage = '<img src="img/icon_groesser.gif" width="15" height="15" alt="Schrift vergr&ouml;ßern" border="0" />';
	}    
	return html += '</a></div>';
	//alert(html);
	return html;
}

Efa_Fontsize.prototype.getPref = function() {
	var pref = this.getCookie(this.cookieName);
	if (pref) return parseInt(pref);
	else return this.def;
}

Efa_Fontsize.prototype.setSize = function(direction) {
	this.pref = (direction)?this.pref+(direction*this.increment):this.def;
	this.setCookie(this.cookieName,this.pref);
	this.body.fontSize = Math.round(this.pref*this.base) + '%';
}

Efa_Fontsize.prototype.getCookie = function(cookieName) {
	var cookie = cookieManager.getCookie(cookieName);
	return (cookie)?cookie:false;
}

Efa_Fontsize.prototype.setCookie = function(cookieName,cookieValue) {
	return cookieManager.setCookie(cookieName,cookieValue);
}

var efa_fontSize = new Efa_Fontsize(efa_increment,efa_bigger,efa_reset,efa_smaller,efa_default);

/*-- ende efa_fontsize.js --*/

/*-- anfang styleswitcher.js --*/

function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel") && a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) {
	a.disabled = false;
	cookieManager.setCookie("style", title, 365);
      }
    }
  }
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}

var cookie = cookieManager.getCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);

/*-- ende styleswitcher.js --*/

/*-- anfang smoothscroll.js --*/

/* Smooth scrolling
   Changes links that link to other parts of this page to scroll
   smoothly to those links rather than jump to them directly, which
   can be a little disorienting.
   
   sil, http://www.kryogenix.org/
   
   v1.0 2003-11-11
   v1.1 2005-06-16 wrap it up in an object
*/

var ss = {
  fixAllLinks: function() {
    // Get a list of all links in the page
    var allLinks = document.getElementsByTagName('a');
    // Walk through the list
    for (var i=0;i<allLinks.length;i++) {
      var lnk = allLinks[i];
      if ((lnk.href && lnk.href.indexOf('#') != -1) && 
          ( (lnk.pathname == location.pathname) ||
	    ('/'+lnk.pathname == location.pathname) ) && 
          (lnk.search == location.search)) {
        // If the link is internal to the page (begins in #)
        // then attach the smoothScroll function as an onclick
        // event handler
        ss.addEvent(lnk,'click',ss.smoothScroll);
      }
    }
  },

  smoothScroll: function(e) {
    // This is an event handler; get the clicked on element,
    // in a cross-browser fashion
    if (window.event) {
      target = window.event.srcElement;
    } else if (e) {
      target = e.target;
    } else return;

    // Make sure that the target is an element, not a text node
    // within an element
    if (target.nodeName.toLowerCase() != 'a') {
      target = target.parentNode;
    }
  
    // Paranoia; check this is an A tag
    if (target.nodeName.toLowerCase() != 'a') return;
  
    // Find the <a name> tag corresponding to this href
    // First strip off the hash (first character)
    anchor = target.hash.substr(1);
    // Now loop all A tags until we find one with that name
    var allLinks = document.getElementsByTagName('a');
    var destinationLink = null;
    for (var i=0;i<allLinks.length;i++) {
      var lnk = allLinks[i];
      if (lnk.name && (lnk.name == anchor)) {
        destinationLink = lnk;
        break;
      }
    }
    if (!destinationLink) destinationLink = document.getElementById(anchor);

    // If we didn't find a destination, give up and let the browser do
    // its thing
    if (!destinationLink) return true;
  
    // Find the destination's position
    var destx = destinationLink.offsetLeft; 
    var desty = destinationLink.offsetTop;
    var thisNode = destinationLink;
    while (thisNode.offsetParent && 
          (thisNode.offsetParent != document.body)) {
      thisNode = thisNode.offsetParent;
      destx += thisNode.offsetLeft;
      desty += thisNode.offsetTop;
    }
  
    // Stop any current scrolling
    clearInterval(ss.INTERVAL);
  
    cypos = ss.getCurrentYPos();
  
    ss_stepsize = parseInt((desty-cypos)/ss.STEPS);
    ss.INTERVAL =
setInterval('ss.scrollWindow('+ss_stepsize+','+desty+',"'+anchor+'")',10);
  
    // And stop the actual click happening
    if (window.event) {
      window.event.cancelBubble = true;
      window.event.returnValue = false;
    }
    if (e && e.preventDefault && e.stopPropagation) {
      e.preventDefault();
      e.stopPropagation();
    }
  },

  scrollWindow: function(scramount,dest,anchor) {
    wascypos = ss.getCurrentYPos();
    isAbove = (wascypos < dest);
    window.scrollTo(0,wascypos + scramount);
    iscypos = ss.getCurrentYPos();
    isAboveNow = (iscypos < dest);
    if ((isAbove != isAboveNow) || (wascypos == iscypos)) {
      // if we've just scrolled past the destination, or
      // we haven't moved from the last scroll (i.e., we're at the
      // bottom of the page) then scroll exactly to the link
      window.scrollTo(0,dest);
      // cancel the repeating timer
      clearInterval(ss.INTERVAL);
      // and jump to the link directly so the URL's right
      location.hash = anchor;
    }
  },

  getCurrentYPos: function() {
    if (document.body && document.body.scrollTop)
      return document.body.scrollTop;
    if (document.documentElement && document.documentElement.scrollTop)
      return document.documentElement.scrollTop;
    if (window.pageYOffset)
      return window.pageYOffset;
    return 0;
  },

  addEvent: function(elm, evType, fn, useCapture) {
    // addEvent and removeEvent
    // cross-browser event handling for IE5+,  NS6 and Mozilla
    // By Scott Andrew
    if (elm.addEventListener){
      elm.addEventListener(evType, fn, useCapture);
      return true;
    } else if (elm.attachEvent){
      var r = elm.attachEvent("on"+evType, fn);
      return r;
    } else {
      alert("Handler could not be removed");
    }
  } 
}

ss.STEPS = 25;

ss.addEvent(window,"load",ss.fixAllLinks);

 /*-- ende smoothscroll.js --*/


