function mail(email) { 
	var email2 = email.split('*AT*').join('@');
	document.location.href = "mailto:" + email2; 
}



/*
*	RollOut-Effekt für Haupt-Menü
*/
$(document).ready(function() {
		
	$(".menu li").append("<p></p>");
	
	$(".menu li").each(function() {
		var linkText = $(this).find("a").html();
		$(this).find("p").show().html(linkText);
	}); 
	
	$(".menu li").hover(function() { 
		if ($(this).attr('class') != "active") {
			$(this).find("a").stop().animate({ 
				marginTop: "0"
			}, 250);
		}
	} , function() {
		$(this).find("a").stop().animate({
			marginTop: "-110"
		}, 250);
	});
	
});





/*
*	Background-Style-Switcher
*/
function setActiveStyleSheet(title){
	var aktiveStyle = getActiveStyleSheet(); 
    $('body').removeClass(aktiveStyle).addClass(title);
    createCookie("style", title, 365);
}

function getActiveStyleSheet(){
    var className = $('body').attr('class');
    return className;
}

function createCookie(name, value, days){
    if (days) {
        var date = new Date();
        date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
        var expires = "; expires=" + date.toGMTString();
    }
    else 
        expires = "";
    document.cookie = name + "=" + value + expires + "; path=/";
}

function readCookie(name){
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for (var i = 0; i < ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') 
            c = c.substring(1, c.length);
        if (c.indexOf(nameEQ) == 0) 
            return c.substring(nameEQ.length, c.length);
    }
    return null;
}

window.onload = function(e){
    var cookie = readCookie("style");
    var title = cookie ? cookie : 'bg01';
    setActiveStyleSheet(title);
}

window.onunload = function(e){
    var title = getActiveStyleSheet();
    createCookie("style", title, 365);
}

var cookie = readCookie("style");
var title = cookie ? cookie : 'bg01';
setActiveStyleSheet(title);





/*
*	HOVER - FOCUS - ACTIVE Funktion für IE
*/
function suckerfish(type, tag, parentId) {
	if (window.attachEvent) {
		window.attachEvent("onload", function() {
			var sfEls = (parentId==null)?document.getElementsByTagName(tag):document.getElementById(parentId).getElementsByTagName(tag);
			type(sfEls);
		});
	}
}
sfHover = function(sfEls) {
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" hover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" hover\\b"), "");
		}
	}
}
sfFocus = function(sfEls) {
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onfocus=function() {
			this.className+=" focus";
		}
		sfEls[i].onblur=function() {
			this.className=this.className.replace(new RegExp(" focus\\b"), "");
		}
	}
}
sfActive = function(sfEls) {
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmousedown=function() {
			this.className+=" active";
		}
		sfEls[i].onmouseup=function() {
			this.className=this.className.replace(new RegExp(" active\\b"), "");
		}
	}
}
sfTarget = function(sfEls) {
	var aEls = document.getElementsByTagName("A");
	document.lastTarget = null;
	for (var i=0; i<sfEls.length; i++) {
		if (sfEls[i].id) {
			if (location.hash==("#" + sfEls[i].id)) {
				sfEls[i].className+=" sftarget";
				document.lastTarget=sfEls[i];
			}
			for (var j=0; j<aEls.length; j++) {
				if (aEls[j].hash==("#" + sfEls[i].id)) aEls[j].targetEl = sfEls[i];
				aEls[j].onclick = function() {
					if (document.lastTarget) docu.lastTarget.className = document.lastTarget.className.replace(new RegExp(" sftarget\\b"), "");
					if (this.targetEl) this.targetEl.className+=" target";
					document.lastTarget=this.targetEl;
					return true;
				}
			}
		}
	}
}



