$(document).ready(function(){function o(){scrollPos=$(window).scrollTop();d.animate({scrollTop:0},300);$("#overlay").fadeTo(300,0.9,function(){$("#loading").fadeTo(200,1);var a=$('<div id="container"></div>'),b=$('<div id="p-text-container"></div>'),c=$('<div id="p-text"><b>'+i+":</b> "+j+"</div>"),f=$('<div id="p-text2">'+k+"</div>"),p=$('<div id="close"><div id="close-over"><img src="img/close-over.png" width="60" height="60" alt="Close"></div></div>');$("#overlay-content").append(a);a.append(b);
b.append(c).append(f).append(p);if(g!=""){c=$('<div id="p-link"><a href="'+g+'" target="_blank">View project</a></div>');b.append(c)}for(b=0;b<h;b++){c=$('<div id="p'+(b+1)+'" class="p-picture"><a href="#jump/'+(b+2)+'"><img src="works/'+l+"/"+(b+1)+'.jpg" width="960"></a></div>');f=$('<div class="p-picture-shadow"><img src="img/project-shadow.png" width="960" height="30" alt="Project Shadow"></div>');a.append(c);c.append(f)}q()})}function q(){$("#overlay-content").css("marginTop",$(window).height()+
500);$("#container img").imagesLoaded(function(){$("#loading").fadeTo(200,0);$("#overlay-content").show();$("#overlay-content").animate({marginTop:0},500,function(){$("#p-text").fadeTo(300,1);$("#p-text2").fadeTo(300,1);$("#p-link").fadeTo(300,1);$("#close").fadeTo(300,1);$("#close").hover(function(){$(this).find("#close-over").stop().fadeTo(200,1)},function(){$(this).find("#close-over").stop().fadeTo(500,0)});$("#close").click(function(){m();return false});if(navigator.platform=="iPad"||navigator.platform==
"iPhone"||navigator.platform=="iPod"){$("#overlay").css("height",$(document).height());$("#close").unbind("mouseenter mouseleave")}$('a[href*="#jump"]').click(function(){var a=$(this).attr("hash").split("/");jumpZiel=parseInt(a[1]);if(jumpZiel>h){jumpZiel="#p1";a=0}else{jumpZiel="#p"+a[1];a=$(jumpZiel).offset().top-10}d.animate({scrollTop:a},400);return false})})})}function m(){$("#p-text").fadeTo(200,0);$("#p-text2").fadeTo(200,0);$("#p-link").fadeTo(200,0);$("#close").fadeTo(200,0,function(){$("#overlay-content").animate({marginTop:$(window).scrollTop()+
$(window).height()+100},500,function(){$("#overlay-content").hide();$("#overlay-content").children().remove();$(window).scrollTop()==0&&scrollPos==0?$("#overlay").fadeTo(500,0,function(){$("#overlay").hide()}):d.animate({scrollTop:scrollPos},300,function(){$("#overlay").fadeTo(500,0,function(){$("#overlay").hide()})})})})}function n(a){var b=$("#bottom").offset().top-$("#contact").offset().top-4+150;a>=b&&$("#bottom").css("height",150+a-b)}$.fn.imagesLoaded=function(a){var b=this.filter("img"),c=
b.length;b.bind("load",function(){--c<=0&&a.call(b,this)});return this};var d=$.browser.safari?$("body"):$("html");$(".top").click(function(){d.animate({scrollTop:0},"slow");return false});$("a[href=#works]").click(function(){d.animate({scrollTop:0},"slow");return false});$("a[href=#about]").click(function(){var a=$("#about").offset().top;d.animate({scrollTop:a+4},600);return false});$("a[href=#contact]").click(function(){var a=$("#contact").offset().top;d.animate({scrollTop:a+4},800);return false});
$(".maske").hover(function(){$(this).find(".deckel").stop().animate({marginTop:"0"},400)},function(){$(this).find(".deckel").stop().animate({marginTop:"168"})});$(".top").hover(function(){$(this).find(".top-over").stop().fadeTo(200,1)},function(){$(this).find(".top-over").stop().fadeTo(500,0)});$("#legal-button").hover(function(){$("#legal").stop().animate({top:"0"},400)},function(){$("#legal").stop().animate({top:"-150"},200)});var r=$('<div id="overlay"></div><div id="overlay-content-middler"><div id="loading"><img src="img/loading.gif" width="32" height="32" alt="Loading"></div><div id="overlay-content"></div></div>');
$("body").append(r);if(navigator.platform=="iPad"||navigator.platform=="iPhone"||navigator.platform=="iPod"){$("#overlay").css("height",$(document).height());$(".top").unbind("mouseenter mouseleave");$("#legal-button").unbind("mouseenter mouseleave");var e;$("#legal-button").click(function(){if(e){$("#legal").stop().animate({top:"-150"},200);clearTimeout(e);e=null}else{$("#legal").animate({top:"0"},400);e=setTimeout(function(){$("#legal").stop().animate({top:"-150"},200);e=null},5E3)}})}var l=0,h=
0,i="",j="",k="",g="";$(".maske").click(function(){l=$(this).attr("id");h=$(this).find(".images").html();i=$(this).find(".info-head").html();j=$(this).find(".info-text").html();k=$(this).find(".info-text2").html();g=$(this).find(".info-link").html();o();return false});$("#overlay").click(function(){m()});n($(window).height());$(window).resize(function(){n($(window).height())})});

