
	/***** 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);
	}


	$(document).ready(function(){

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

		/***** slider produkte ****/
		$(function(){
			$('#slider_produkte').slides({
				preload: true,
				play: 5000,
				pause: 1000,
				effect: 'slide',
				randomize: false,
				slideSpeed: 1500,
				container: 'slider_box',
				hoverPause: true,
				generatePagination: false,
				generateNextPrev: true, 
				next: 'next', 
				prev: 'prev',
				animationStart: function(){
					$('#slider_produkte').find('.slider_box').css({padding:'0',margin:'0 0 0 60px'});
				},
				animationComplete: function(){
					$('#slider_produkte').find('.slider_box').css({padding:'0 60px 0 60px',margin:'0'});
				}
			});
		});
		$('#slider_produkte').find('.produktitem').each(function() {
			$(this).hover(
				function(){
					var box = $('#slider_produkte').find('.produkteinfobox');
					$('#slider_produkte').mousemove(function(e){ 
						var position = (e.pageX - $('#slider_produkte').offset().left - 75);
						if (position  <= '705') {
							box.css({ left: position }); 
						} else {
							box.css({ left: 705 }); 
						}
					});
					box.css({display:'block'});
					var mainImage = $(this).find('.small').attr("src");
					box.html( '<img src="' + mainImage + '" />');
				},
				function(){
					var box = $('#slider_produkte').find('.produkteinfobox');
					box.css({display:'none'});
					box.html( '' );
				}
			);
		});

		/***** datenbanken ****/
		$(".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;
		});


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

	});






