
function keinspam() {
		if (document.getElementById) {
			var alltags = document.all? document.all : document.getElementsByTagName("*");
			for (i=0; i < alltags.length; i++) {
			  if (alltags[i].className == "keinspam") {
			  	var oldText = alltags[i].firstChild;
			  	var emailAddress = alltags[i].firstChild.nodeValue;
			  	var user = emailAddress.substring(0, emailAddress.indexOf("("));
			  	var website = emailAddress.substring(emailAddress.indexOf(")")+1, emailAddress.length);
			  	var newText = user+"@"+website;
			  	var a = document.createElement("a");
			  	a.href = "mailto:"+newText;
				var address = document.createTextNode(newText);
				a.appendChild(address);
				alltags[i].replaceChild(a,oldText);
			  }
			}
		}
	}
	window.onload = keinspam;
	
function chkKontaktformular()
{
 if(document.Kontaktformular.Vorname.value == "")  {
   alert("Bitte geben Sie Ihren Vornamen an!");
   document.Kontaktformular.Vorname.focus();
   return false;
  }
 if(document.Kontaktformular.Nachname.value == "")  {
   alert("Bitte geben Sie Ihren Nachnamen an!");
   document.Kontaktformular.Nachname.focus();
   return false;
  }
if(document.Kontaktformular.Telefon.value == "") {
   alert("Bitte geben Sie Ihre Telefon-Nr. an!");
   document.Kontaktformular.Telefon.focus();
   return false;
  }
if(document.Kontaktformular.Email.value == "") {
   alert("Bitte geben Sie Ihre Email an!");
   document.Kontaktformular.Email.focus();
   return false;
  }
}


var useBSNns;

if (useBSNns)
{
	if (typeof(bsn) == "undefined")
		bsn = {}
	var _bsn = bsn;
}
else
{
	var _bsn = this;
}





_bsn.Crossfader = function (divs, fadetime, delay )
{	
	this.nAct = -1;
	this.aDivs = divs;
	
	for (var i=0;i<divs.length;i++)
	{
		document.getElementById(divs[i]).style.opacity = 0;
		document.getElementById(divs[i]).style.position = "absolute";
		document.getElementById(divs[i]).style.filter = "alpha(opacity=0)";
	}
	
	this.nDur = fadetime;
	this.nDelay = delay;
		
	this._newfade();
}


_bsn.Crossfader.prototype._newfade = function()
{
	if (this.nID1)
		clearInterval(this.nID1);
	
	this.nOldAct = this.nAct;
	this.nAct++;
	if (!this.aDivs[this.nAct])	this.nAct = 0;
	
	this.nInt = 50;
	this.nTime = 0;
	
	var p=this;
	this.nID2 = setInterval(function() { p._fade() }, this.nInt);
}


_bsn.Crossfader.prototype._fade = function()
{
	this.nTime += this.nInt;
	
	var op = this._easeInOut(this.nTime, 0, 1, this.nDur);
	var ieop = op*100;
	document.getElementById( this.aDivs[this.nAct] ).style.opacity = op;
	document.getElementById( this.aDivs[this.nAct] ).style.filter = "alpha(opacity="+ieop+")";
	if (this.nOldAct > -1)
	{
		document.getElementById( this.aDivs[this.nOldAct] ).style.opacity = 1 - op;
		document.getElementById( this.aDivs[this.nOldAct] ).style.filter = "alpha(opacity="+(100 - ieop)+")";
	}
	
	if (this.nTime == this.nDur)
	{
		clearInterval( this.nID2 );
		
		var p=this;
		this.nID1 = setInterval(function() { p._newfade() }, this.nDelay);
	}
}



_bsn.Crossfader.prototype._easeInOut = function(t,b,c,d)
{
	return c/2 * (1 - Math.cos(Math.PI*t/d)) + b;
}


function hr2divhr(context) {
        switch (typeof context) {
            case 'undefined':
                context = document;
            break;
            case 'string':
                context = $(context);
            break;
        }

        var hrs = document.getElementsByTagName('hr');
        var div;

        for (var i = 0, n = hrs.length; i < n; i++) {
            div = document.createElement('div');
            div.className = 'separator';
            var p = hrs[i].parentNode;
            p.insertBefore(div, hrs[i]);
            div.appendChild(hrs[i]);
        }
    }

    window.addEvent('domready', function() {
       hr2divhr();
    });
    
window.addEvent('domready',function() {
			new SmoothScroll({ duration:700 }, window); 
		});

