
	/***** mail ****/
	var keyStr = "ABCDEFGHIJKLMNOP" +
               "QRSTUVWXYZabcdef" +
               "ghijklmnopqrstuv" +
               "wxyz0123456789+/" +
               "=";

	function e(ziel) { 
		self.location.href=('mailto:'+decode64(ziel)); 
	}

	function decode64(input) {
		var output = "";
		var chr1, chr2, chr3 = "";
		var enc1, enc2, enc3, enc4 = "";
		var i = 0;
		var base64test = /[^A-Za-z0-9\+\/\=]/g;
		if (base64test.exec(input)) {
			alert("There were invalid base64 characters in the input text.\n" +
			"Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\n" +
			"Expect errors in decoding.");
		}
		input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
		do {
			enc1 = keyStr.indexOf(input.charAt(i++));
			enc2 = keyStr.indexOf(input.charAt(i++));
			enc3 = keyStr.indexOf(input.charAt(i++));
			enc4 = keyStr.indexOf(input.charAt(i++));
			chr1 = (enc1 << 2) | (enc2 >> 4);
			chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
			chr3 = ((enc3 & 3) << 6) | enc4;
			output = output + String.fromCharCode(chr1);
			if (enc3 != 64) { output = output + String.fromCharCode(chr2); }
			if (enc4 != 64) { output = output + String.fromCharCode(chr3); }
			chr1 = chr2 = chr3 = "";
			enc1 = enc2 = enc3 = enc4 = "";
		} 
		while (i < input.length);
		return unescape(output);
	}


	var jmenu={
    show:function(elem) {
			$(elem).children('ul').eq(0).stop(1,1).animate({opacity:'show'}, 100);
			$('.mainnavi').eq(0).animate({width:'374px'}, 200);
    },
    hide: function(elem) {
			$(elem).children('ul').eq(0).stop(1,1).animate({opacity:'hide'}, 100);
	},

    show1:function(elem) {
			$('.mainnavi').eq(0).stop(1,1).animate({width:'374px'}, 200);
    },
    hide1: function(elem) {
			$('.mainnavi').eq(0).stop(1,1).animate({width:'172px'}, 200);
	}

	}

	jQuery.fn.jmenu=function(settings){   
		$(this).each(function(){
			$(this).hover(
				function(){	jmenu.show1(this);},
				function(){	jmenu.hide1(this);}
			);
		});
		$(this).find('li').each(function(){
			$(this).hover(
				function(){	jmenu.show(this);},
				function(){	jmenu.hide(this);}
			);
		});
	}


	$(document).ready(function(){

		/***** menue ****/
		$(function(){
			$('.mainnavi').jmenu();
		});

		/***** slider header ****/
		$(function(){
			$('#slider_header').slides({
				bgColor: 'none',
				preload: true,
				play: 6000,
				pause: 1000,
				container: 'slider_box',
				effect: 'fade',
				fadeSpeed: 1200,
				crossfade: true,
				hoverPause: true,
				generatePagination: true,
				generateNextPrev: false, 
				//next: 'next', 
				//prev: 'prev',
				animationStart: function(){
					$('#slider_header').find('.decker').animate({opacity:'0'},500);
					$('#slider_header').find('.deckercontent').animate({opacity:'0'},300);
				},
				animationComplete: function(){
					$('#slider_header').find('.decker').animate({opacity:'0.8'},500);
					$('#slider_header').find('.deckercontent').animate({opacity:'1'},600);
				}
			});
		});


		/***** tabs ****/
		$(".tab_content").hide();
		$("ul.tabs li:first").addClass("active").show();
		$(".tab_content:first").show();

		$("ul.tabs li").click(function() {

			$("ul.tabs li").removeClass("active");
			$(this).addClass("active");
			$(".tab_content").hide();

			var activeTab = $(this).find("a").attr("href");
			$(activeTab).fadeIn();
			return false;
		});
		
		
		/***** fancybox ****/
		$("a[rel=gallerie]").fancybox({
			'overlayShow'	: false,
			'transitionIn'	: 'elastic',
			'transitionOut'	: 'elastic'
		});


		/*** placeholder ****/
		if (!Modernizr.input.placeholder){
			$(function(){ 
				$('input[placeholder!=""]').hint();
			});
		}
		

	});






