$(document).ready(function(){


	$("a.imprint").click(function(){
			$("#impressum").show();
		});


	/* Arbeiten Teaser Bilder Hover */
	$("div.projektImg a")
  	.mouseout(function(){
	  	$(this).animate({opacity: '1'}, 75);
    })
    .mouseover(function(){
			$(this).animate({opacity: '.5'}, 50);
	});


	/* Arbeiten Teaser Bilder Hover */
	$("div.projektImg a")
		.mouseout(function(){
			$(this).animate({opacity: '1'}, 75);
    })
    
    .mouseover(function(){
			$(this).animate({opacity: '.5'}, 50);
		});


	/* Zeige nur Arbeiten anhand des gewählten Schlagwortes an. */
	$("#navCategory ul li")
		.click(function () {
			$(".projekt")
				.show(700);

			$(".projekt:not(." + this.id + ")")
				.hide(1000);

			// entferne Klasse "selected" von allen li-Element
			$("#navCategory ul li")
				.removeClass('selected');

			// setze Klasse "selected" zu geklicktem li-Element
			$("#" + this.id)
				.addClass('selected');
		});
});

jQuery(function($){
	$('ul.galerie').galleria({
		history   : false, // deactivates the history object for bookmarking, back-button etc.
		clickNext : true, // helper for making the image clickable. Let's not have that in this example.
		insert    : undefined,	// the containing selector for our main image. 
								   					// If not found or undefined (like here), galleria will create a container 
								   					// before the ul with the class .galleria_container (see CSS)
		onImage   : function(image,caption,thumb)
		{ // let's add some image effects for demonstration purposes
				
			// fade in the image & caption
			if(! ($.browser.mozilla && navigator.appVersion.indexOf("Win")!=-1))
			{ // FF/Win fades large images terribly slow
				image.css('display','none').fadeIn(1000);
			}
			
			caption.css('display','none').fadeIn(1000);
		}
	});
});

function UnCryptMailto(s)
{
	var n = 0;
  var r = "";

  for (var i = 0; i < s.length; i++)
  {
	  n = s.charCodeAt(i);
    if (n >= 8364)
    	n = 128;

    r += String.fromCharCode(n-1);
  }

  return r;
}

function linkTo_UnCryptMailto(s)
{
	location.href=UnCryptMailto(s);
}
