;(function($){var m=$.scrollTo=function(b,h,f){$(window).scrollTo(b,h,f)};m.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1};m.window=function(b){return $(window).scrollable()};$.fn.scrollable=function(){return this.map(function(){var b=this,h=!b.nodeName||$.inArray(b.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!h)return b;var f=(b.contentWindow||b).document||b.ownerDocument||b;return $.browser.safari||f.compatMode=='BackCompat'?f.body:f.documentElement})};$.fn.scrollTo=function(l,j,a){if(typeof j=='object'){a=j;j=0}if(typeof a=='function')a={onAfter:a};if(l=='max')l=9e9;a=$.extend({},m.defaults,a);j=j||a.speed||a.duration;a.queue=a.queue&&a.axis.length>1;if(a.queue)j/=2;a.offset=n(a.offset);a.over=n(a.over);return this.scrollable().each(function(){var k=this,o=$(k),d=l,p,g={},q=o.is('html,body');switch(typeof d){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px)?$/.test(d)){d=n(d);break}d=$(d,this);case'object':if(d.is||d.style)p=(d=$(d)).offset()}$.each(a.axis.split(''),function(b,h){var f=h=='x'?'Left':'Top',i=f.toLowerCase(),c='scroll'+f,r=k[c],s=h=='x'?'Width':'Height';if(p){g[c]=p[i]+(q?0:r-o.offset()[i]);if(a.margin){g[c]-=parseInt(d.css('margin'+f))||0;g[c]-=parseInt(d.css('border'+f+'Width'))||0}g[c]+=a.offset[i]||0;if(a.over[i])g[c]+=d[s.toLowerCase()]()*a.over[i]}else g[c]=d[i];if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],u(s));if(!b&&a.queue){if(r!=g[c])t(a.onAfterFirst);delete g[c]}});t(a.onAfter);function t(b){o.animate(g,j,a.easing,b&&function(){b.call(this,l,a)})};function u(b){var h='scroll'+b;if(!q)return k[h];var f='client'+b,i=k.ownerDocument.documentElement,c=k.ownerDocument.body;return Math.max(i[h],c[h])-Math.min(i[f],c[f])}}).end()};function n(b){return typeof b=='object'?b:{top:b,left:b}}})(jQuery);;(function($){$.fn.lazyload=function(options){var settings={threshold:0,failurelimit:0,event:"scroll",effect:"show",container:window};if(options){$.extend(settings,options);}
var elements=this;if("scroll"==settings.event){$(settings.container).bind("scroll",function(event){var counter=0;elements.each(function(){if(!$.belowthefold(this,settings)&&!$.rightoffold(this,settings)){$(this).trigger("appear");}else{if(counter++>settings.failurelimit){return false;}}});var temp=$.grep(elements,function(element){return!element.loaded;});elements=$(temp);});}
return this.each(function(){var self=this;$(self).attr("original",$(self).attr("src"));if("scroll"!=settings.event||$.belowthefold(self,settings)||$.rightoffold(self,settings)){if(settings.placeholder){$(self).attr("src",settings.placeholder);}else{$(self).removeAttr("src");}
self.loaded=false;}else{self.loaded=true;}
$(self).one("appear",function(){if(!this.loaded){$("<img />").bind("load",function(){$(self).hide().attr("src",$(self).attr("original"))
[settings.effect](settings.effectspeed);self.loaded=true;}).attr("src",$(self).attr("original"));};});if("scroll"!=settings.event){$(self).bind(settings.event,function(event){if(!self.loaded){$(self).trigger("appear");}});}});};$.belowthefold=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).height()+$(window).scrollTop();}
else{var fold=$(settings.container).offset().top+$(settings.container).height();}
return fold<=$(element).offset().top-settings.threshold;};$.rightoffold=function(element,settings){if(settings.container===undefined||settings.container===window){var fold=$(window).width()+$(window).scrollLeft();}
else{var fold=$(settings.container).offset().left+$(settings.container).width();}
return fold<=$(element).offset().left-settings.threshold;};$.extend($.expr[':'],{"below-the-fold":"$.belowthefold(a, {threshold : 0, container: window})","above-the-fold":"!$.belowthefold(a, {threshold : 0, container: window})","right-of-fold":"$.rightoffold(a, {threshold : 0, container: window})","left-of-fold":"!$.rightoffold(a, {threshold : 0, container: window})"});})(jQuery);;(function($){$.whileAsync=function(opts)
{var delay=Math.abs(opts.delay)||10,bulk=isNaN(opts.bulk)?500:Math.abs(opts.bulk),test=opts.test||function(){return true;},loop=opts.loop||function(){},end=opts.end||function(){};(function(){var t=false,begin=new Date();while(t=test())
{loop();if(bulk===0||(new Date()-begin)>bulk)
{break;}}
if(t)
{setTimeout(arguments.callee,delay);}
else
{end();}})();}
$.eachAsync=function(array,opts)
{var i=0,l=array.length,loop=opts.loop||function(){};$.whileAsync($.extend(opts,{test:function(){return i<l;},loop:function()
{var val=array[i];return loop.call(val,i++,val);}}));}
$.fn.eachAsync=function(opts)
{$.eachAsync(this,opts);return this;}})(jQuery);shortcut={'all_shortcuts':{},'add':function(shortcut_combination,callback,opt){var default_options={'type':'keydown','propagate':false,'disable_in_input':false,'target':document,'keycode':false}
if(!opt)opt=default_options;else{for(var dfo in default_options){if(typeof opt[dfo]=='undefined')opt[dfo]=default_options[dfo];}}
var ele=opt.target;if(typeof opt.target=='string')ele=document.getElementById(opt.target);var ths=this;shortcut_combination=shortcut_combination.toLowerCase();var func=function(e){e=e||window.event;if(opt['disable_in_input']){var element;if(e.target)element=e.target;else if(e.srcElement)element=e.srcElement;if(element.nodeType==3)element=element.parentNode;if(element.tagName=='INPUT'||element.tagName=='TEXTAREA')return;}
if(e.keyCode)code=e.keyCode;else if(e.which)code=e.which;var character=String.fromCharCode(code).toLowerCase();if(code==188)character=",";if(code==190)character=".";var keys=shortcut_combination.split("+");var kp=0;var shift_nums={"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":":","'":"\"",",":"<",".":">","/":"?","\\":"|"}
var special_keys={'esc':27,'escape':27,'tab':9,'space':32,'return':13,'enter':13,'backspace':8,'scrolllock':145,'scroll_lock':145,'scroll':145,'capslock':20,'caps_lock':20,'caps':20,'numlock':144,'num_lock':144,'num':144,'pause':19,'break':19,'insert':45,'home':36,'delete':46,'end':35,'pageup':33,'page_up':33,'pu':33,'pagedown':34,'page_down':34,'pd':34,'left':37,'up':38,'right':39,'down':40,'f1':112,'f2':113,'f3':114,'f4':115,'f5':116,'f6':117,'f7':118,'f8':119,'f9':120,'f10':121,'f11':122,'f12':123}
var modifiers={shift:{wanted:false,pressed:false},ctrl:{wanted:false,pressed:false},alt:{wanted:false,pressed:false},meta:{wanted:false,pressed:false}};if(e.ctrlKey)modifiers.ctrl.pressed=true;if(e.shiftKey)modifiers.shift.pressed=true;if(e.altKey)modifiers.alt.pressed=true;if(e.metaKey)modifiers.meta.pressed=true;for(var i=0;k=keys[i],i<keys.length;i++){if(k=='ctrl'||k=='control'){kp++;modifiers.ctrl.wanted=true;}else if(k=='shift'){kp++;modifiers.shift.wanted=true;}else if(k=='alt'){kp++;modifiers.alt.wanted=true;}else if(k=='meta'){kp++;modifiers.meta.wanted=true;}else if(k.length>1){if(special_keys[k]==code)kp++;}else if(opt['keycode']){if(opt['keycode']==code)kp++;}else{if(character==k)kp++;else{if(shift_nums[character]&&e.shiftKey){character=shift_nums[character];if(character==k)kp++;}}}}
if(kp==keys.length&&modifiers.ctrl.pressed==modifiers.ctrl.wanted&&modifiers.shift.pressed==modifiers.shift.wanted&&modifiers.alt.pressed==modifiers.alt.wanted&&modifiers.meta.pressed==modifiers.meta.wanted){callback(e);if(!opt['propagate']){e.cancelBubble=true;e.returnValue=false;if(e.stopPropagation){e.stopPropagation();e.preventDefault();}
return false;}}}
this.all_shortcuts[shortcut_combination]={'callback':func,'target':ele,'event':opt['type']};if(ele.addEventListener)ele.addEventListener(opt['type'],func,false);else if(ele.attachEvent)ele.attachEvent('on'+opt['type'],func);else ele['on'+opt['type']]=func;},'remove':function(shortcut_combination){shortcut_combination=shortcut_combination.toLowerCase();var binding=this.all_shortcuts[shortcut_combination];delete(this.all_shortcuts[shortcut_combination])
if(!binding)return;var type=binding['event'];var ele=binding['target'];var callback=binding['callback'];if(ele.detachEvent)ele.detachEvent('on'+type,callback);else if(ele.removeEventListener)ele.removeEventListener(type,callback,false);else ele['on'+type]=false;}};jQuery(function($){$("img").lazyload({threshold:800,placeholder:"/img/loader.gif",});$('.portfolio_headline').hide();});;jQuery(function($){var $tabs=$("#section_about").tabs({fxSlide:true,add:function(event,ui){$tabs.tabs('select',window.location.hash);}});$("#about_mind2 a[href$='#about_jakob']").click(function(){$tabs.tabs('select',1);return false;});$("#about_mind2 a[href$='#about_bene']").click(function(){$tabs.tabs('select',2);return false;});$tabs.bind('tabsshow',function(event,ui){var tab_speed='slow';switch(ui.panel.id){case'about_jakob':$("li.project:not(.tag_jn)").eachAsync({loop:function(){$(this).hide(tab_speed);}});$("li.project.tag_jn").eachAsync({loop:function(){$(this).show(tab_speed);}});break;case'about_bene':$("li.project:not(.tag_bf)").eachAsync({loop:function(){$(this).hide(tab_speed);}});$("li.project.tag_bf").eachAsync({loop:function(){$(this).show(tab_speed);}});break;case'kontakt':$("li.project").eachAsync({loop:function(){$(this).hide(tab_speed);}});break;default:$("li.project").eachAsync({loop:function(){$(this).show(tab_speed);}});break;}
$(window).trigger('scroll');});});;jQuery(function($){init_shortcuts();$('a.link_to_top').click(function(){$.scrollTo('#top',500);return false;});function init_shortcuts(){var animation_running=false;var shortcut_options={disable_in_input:true};var scroll_args={duration:400,offset:{top:1},onAfter:function(){animation_running=false;}};shortcut.add("alt+t",function(){if(animation_running)return;animation_running=true;$.scrollTo('#top',scroll_args);},shortcut_options);shortcut.add("down",function(){if(animation_running)return;var visibleNodes=getVisibleNodes();var idx=getFirstNodeBelow(visibleNodes);if(isActiveNode(visibleNodes,idx))idx+=1;if(idx>=visibleNodes.length||($().height()-$(window).height())==$().scrollTop()){idx=visibleNodes.length-1;showNavReachedLastProject();}
animation_running=true;$.scrollTo(visibleNodes.eq(idx),scroll_args);},shortcut_options);shortcut.add("up",function(){if(animation_running)return;var visibleNodes=getVisibleNodes();var idx=getFirstNodeBelow(visibleNodes)-1;if(isActiveNode(visibleNodes,idx))idx-=1;if(idx<0){idx=0;showNavReachedFirstProject();}
animation_running=true;$.scrollTo(visibleNodes.eq(idx),scroll_args);},shortcut_options);}
function getScreenTop(){return $().scrollTop()+65;}
function getToleranceValue(){return 75;}
function getVisibleNodes(){return $('ul.projects li:visible');}
function getFirstNodeBelow(nodes){nodes=$(nodes);var i=0;var x=getScreenTop();for(var i=0;i<nodes.length;i++){var node=nodes.eq(i);if(node.offset().top>x)return i;}
return nodes.length;}
function isActiveNode(nodes,idx){if(idx<=0)idx=0;else if(idx>=nodes.length)idx=nodes.length-1;var node=$(nodes).eq(idx);var dist=getScreenTop()-node.offset().top;if(dist<0)dist*=-1;return(dist<=getToleranceValue());}
function showNavReachedFirstProject(){var icon=$('.scrollnavIconFirst');if(icon.length==0){var container=$("#section_portfolio");container.append('<div class="scrollnavIcon scrollnavIconFirst"><img src="/img/project_top.png" /></div>');icon=$('.scrollnavIconFirst',container);}
icon.fadeIn(250,function(){$(this).fadeOut(750)});}
function showNavReachedLastProject(){var icon=$('.scrollnavIconLast');if(icon.length==0){var container=$("#section_portfolio");container.append('<div class="scrollnavIcon scrollnavIconLast"><img src="/img/project_bottom.png" /></div>');icon=$('.scrollnavIconLast',container);}
icon.fadeIn(250,function(){$(this).fadeOut(750)});}});