$(document).ready(function(){var posNr=0;var ce=$(".project").eq(posNr);var hi=$(".project").size()-1;$(".mask").each(function(){var kids=$(this).next().children().size();$(this).css("right",(15*kids-115));});$(".slideNav").each(function(){$(this).data("cd",1);});$(".slideshow").slider();var clr;var clr2;$(".hovdiv").bind("mouseover",function(){var spanwidth=$(this).width();clr=$(this).parent().parent().find(".current").find("a").css("color");clr2=$(this).find(".shdw").css("color");$(this).css("background-color","white");$(this).find(".shdw").css("color","#ffffff");$(this).find("a").css("color",clr);$(this).find("span").css({width:spanwidth-17});});$(".hovdiv").bind("mouseout",function(e){$(this).css("background-color","");$(this).find("a").css("color","white");$(this).find(".shdw").css("color",clr2);$(this).find("span").css({width:"0px"});});$(document).bind("keydown",function(k){var key=k.which;if(key==37){$('html, body').animate({scrollTop:(ce.offset().top)-70},500);var da=ce.find(".slideNav").data("cd");var ca=ce.find(".slideshow ul").children().size();if(da==1){ce.find(".slideshow ul").animate({left:-((ca-1)*550)},1050,"easeInOutExpo");ce.find(".mask").animate({right:-100},1050,"easeInOutExpo");ce.find(".slideNav").data("cd",ca);}else{ce.find(".slideshow ul").animate({left:-((da-2)*550)},1050,"easeInOutExpo");ce.find(".mask").animate({right:((ca-da+1)*15)-100},1050,"easeInOutExpo");ce.find(".slideNav").data("cd",da-1);};}else if(key==38||key==75){if(posNr==0){posNr=hi;ce=$(".project").eq(posNr);$('html, body').animate({scrollTop:(ce.offset().top)-70},500);}else{posNr=posNr-1;ce=$(".project").eq(posNr);$('html, body').animate({scrollTop:(ce.offset().top)-70},500);};}else if(key==39){$('html, body').animate({scrollTop:(ce.offset().top)-70},500);var da=ce.find(".slideNav").data("cd");var ca=ce.find(".slideshow ul").children().size();if(da==ca){ce.find(".slideshow ul").animate({left:0},1050,"easeInOutExpo");ce.find(".mask").animate({right:-(100-((ca-1)*15))},1050,"easeInOutExpo");ce.find(".slideNav").data("cd",1);}else{ce.find(".slideshow ul").animate({left:-(da*550)},1050,"easeInOutExpo");ce.find(".mask").animate({right:((ca-da-1)*15)-100},1050,"easeInOutExpo");ce.find(".slideNav").data("cd",da+1);};}else if(key==40||key==74){if(posNr==hi){posNr=0;ce=$(".project").eq(posNr);$('html, body').animate({scrollTop:(ce.offset().top)-70},500);}else{posNr=posNr+1;ce=$(".project").eq(posNr);$('html, body').animate({scrollTop:(ce.offset().top)-70},500);};}else if(key==67||key==75){var cc=$("#categories").find(".currCat");cc.removeClass("currCat").addClass("cat");if(cc.is(":last-child")){cc.parent().children(":first-child").removeClass("cat").addClass("currCat");window.open(cc.parent().children(":first-child").find("a").attr("href"),'_self','');}else{cc.next().removeClass("cat").addClass("currCat");window.open(cc.next().find("a").attr("href"),'_self','');};};});});var j=0;var imageWidth=550;var navPicWidth=15;var masksideWidth=100;jQuery.fn.slider=function(settings){settings=jQuery.extend({easeFunc:"easeInOutExpo",easeTime:1050,tooltip:false},settings);$(".slideshow").each(function(){$(this).bind("click",function(e){var pos2=$(this).offset().left;var pos=$(this).find("ul").offset().left;var delta=Math.round((pos2-pos-imageWidth)/imageWidth)*imageWidth;var forth=-(delta+imageWidth+imageWidth);var letztes=-(($(this).find("ul").children().size()-1)*imageWidth);var kinder=$(this).find("ul").children().size()
if(e.pageX-this.offsetLeft<imageWidth/2){if((pos2-pos)<imageWidth){$(this).find("ul").animate({left:letztes},settings.easeTime,settings.easeFunc);var maLetztes=-(masksideWidth-(kinder-((-letztes/imageWidth)+1))*navPicWidth);$(this).next().find(".mask").animate({right:maLetztes},settings.easeTime,settings.easeFunc);}else{$(this).find("ul").animate({left:-delta},settings.easeTime,settings.easeFunc);var maDelta=-(masksideWidth-(kinder-((delta/imageWidth)+1))*navPicWidth);$(this).next().find(".mask").animate({right:maDelta},settings.easeTime,settings.easeFunc);};}else{if(-delta-imageWidth==letztes){$(this).find("ul").animate({left:"0"},settings.easeTime,settings.easeFunc);var maZero=-(masksideWidth-(kinder-(1))*navPicWidth);$(this).next().find(".mask").animate({right:maZero},settings.easeTime,settings.easeFunc);}else{$(this).find("ul").animate({left:forth},settings.easeTime,settings.easeFunc);var maForth=-(masksideWidth-(kinder-((-forth/imageWidth)+1))*navPicWidth);$(this).next().find(".mask").animate({right:maForth},settings.easeTime,settings.easeFunc);};}});});$(".slideNav").each(function(){$(this).find("ul").find("a").each(function(z){$(this).bind("click",function(){var cnt=-(imageWidth*z);var cnt2=-(masksideWidth-($(this).parent().parent().children().size()-(z+1))*navPicWidth);$(this).parent().parent().parent().find(".mask").animate({right:cnt2},settings.easeTime,settings.easeFunc);$(this).parent().parent().parent().prev().find("ul").animate({left:cnt},settings.easeTime,settings.easeFunc);$(this).parent().parent().parent().data("cd",z+1);return(false);});});});};$(function(){$('.sn').click(function(){$('html, body').animate({scrollTop:($($(this).attr("href")).offset().top)-70},500);return false;});});