$(document).ready(function(){	
	// Seitenleiste
	$("body#kontakt #seitenleiste").addClass("kontakt");
	$("#seitenleiste").not(".kontakt").css({"opacity": "0.60"});
	$("#seitenleiste").not(".kontakt").hover(function() {
		$(this).fadeTo('slow', 1);
	}, function() {
		$(this).fadeTo('slow', 0.60);
	});
	
	// Projekt Überlagerung
	$(".projektUeberlagerung").append("<div class=\"ueberlagerung\"></div>");
	$(".projektUeberlagerung").hover(function() {
		$(".ueberlagerung").fadeTo('slow', 0);
	}, function() {
		$(".ueberlagerung").fadeTo('slow', 1);
	});
	
	// Popup
	$("a.popup").click(function(ev){
		var href = $(this).attr("href");
		window.open(href,'Weitersagen','toolbar=0,status=0,width=548,height=325');
		ev.preventDefault();
		return false;
	});
	
	// Ungerade Zeilen
	$("tr:odd").addClass("ungerade");
								 
	// Fancybox
	$("a.fancybox").fancybox({
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'titlePosition' : 'inside',
		'titleFormat'	: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over"><strong>Bild ' + (currentIndex + 1) + ' von ' + currentArray.length + (title.length ? ':</strong> &nbsp; ' + title : '') + '</span>';
		}
	});
	$("a.iframe").fancybox({
		'titleShow' 	: false,
		'width'			: '50%',
		'height'		: '50%',
		'autoScale'		: false,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'type'			: 'iframe'
	});
	
	// Externe Links
	$("a[href][rel*=external]").attr("target","_blank").addClass("extern");

	// png Fix
	$(document).pngFix();
});
