function utf8_decode(str_data){var tmp_arr=[],i=0,ac=0,c1=0,c2=0,c3=0;str_data+='';while(i<str_data.length){c1=str_data.charCodeAt(i);if(c1<128){tmp_arr[ac++]=String.fromCharCode(c1);i++;}else if((c1>191)&&(c1<224)){c2=str_data.charCodeAt(i+1);tmp_arr[ac++]=String.fromCharCode(((c1&31)<<6)|(c2&63));i+=2;}else{c2=str_data.charCodeAt(i+1);c3=str_data.charCodeAt(i+2);tmp_arr[ac++]=String.fromCharCode(((c1&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}}
return tmp_arr.join('');}
function base64_decode(data){var b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var o1,o2,o3,h1,h2,h3,h4,bits,i=0,ac=0,dec="",tmp_arr=[];if(!data){return data;}
data+='';do{h1=b64.indexOf(data.charAt(i++));h2=b64.indexOf(data.charAt(i++));h3=b64.indexOf(data.charAt(i++));h4=b64.indexOf(data.charAt(i++));bits=h1<<18|h2<<12|h3<<6|h4;o1=bits>>16&0xff;o2=bits>>8&0xff;o3=bits&0xff;if(h3==64){tmp_arr[ac++]=String.fromCharCode(o1);}else if(h4==64){tmp_arr[ac++]=String.fromCharCode(o1,o2);}else{tmp_arr[ac++]=String.fromCharCode(o1,o2,o3);}}while(i<data.length);dec=tmp_arr.join('');dec=this.utf8_decode(dec);return dec;}
$(function(){$('#logo').hover(function(){$(this).animate({'opacity':0.7},300);},function(){$(this).animate({'opacity':1},300);});Cufon.replace('#planner h3, .cfont');if(!$.browser.msie){}else{$('li.nav-selected a span.navimg').animate({'opacity':1});DD_belatedPNG.fix('ul#nav li a span.navimg');if($.browser.msie&&$.browser.version=="6.0"){DD_belatedPNG.fix('.png');}}
$('.iamamail').attr('href',base64_decode('bWFpbHRvOmluZm9AY29kZWN1bHR1cmUuZGU='));$('#btn-move').scrollToTop({speed:"slow",ease:"easeOutQuad",start:0});$('.footer-column li').hover(function(){$(this).animate({'padding-left':58+'px'},{queue:false,duration:300})},function(){$(this).animate({'padding-left':53+'px'},{queue:false,duration:300})});$.navOrigin=$('.selected').css('top');$.zahl=0;$('#sidebar-nav li').hover(function(){$.zahl=1;var navInc=38;var navIndex=$('#sidebar-nav li').index($(this)[0]);var navScroll=navInc*(navIndex);if(navIndex!==4){$('li.selected').stop().animate({'top':navScroll+'px'},300);}},function(){$('.selected').stop().animate({'top':$.navOrigin},300);});$("ul#nav li:not(.nav-selected) span.navimg").animate({opacity:'0'},0);$("ul#nav li a.has-tip").hover(function(){if(!$(this).parent().hasClass('nav-selected')){$(this).children('span').stop().animate({opacity:'1'},{queue:false,duration:600});}else{$(this).children('span').stop();}
var title=$(this).children('span.navname').html();$(this).children('span.navname').stop().animate({opacity:'1','top':42},{queue:false,duration:600});},function(){if(!$(this).parent().hasClass('nav-selected')){$(this).children('span').animate({opacity:'0'},{queue:false,duration:600});$(this).children('span.navname').animate({'top':45},{duration:600});}else{$(this).children('span').stop();$(this).children('span.navname').animate({'top':45,'opacity':0},{duration:600});}});$('.tft-lupe').hover(function(){$(this).clearQueue().animate({'opacity':1},{queue:false,duration:500});$('.tft-highlight-dark').animate({'opacity':1},{queue:false,duration:300});$('.tft-highlight-white').animate({'opacity':0},{queue:false,duration:300});},function(){$(this).clearQueue().animate({'opacity':0.75},{queue:false,duration:300});$('.tft-highlight-dark').animate({'opacity':0},{queue:false,duration:300});$('.tft-highlight-white').animate({'opacity':0.6},{queue:false,duration:700});});$('.tft-lupe').click(function(){$(this).siblings('a').trigger('click');});$('.tft-content a, .p-link a').fancybox({'width':'85%','height':'85%','autoScale':false,'transitionIn':'elastic','transitionOut':'elastic','type':'iframe'});if($.browser.msie){}
$.maxSlide=-2250;$.maxSlideText=-1800;$.slideInc=375;$.slideIncText=300;$.ease='easeInOutQuad';jQuery.easing.def="easeInOutQuad";$('#next-project').click(function(){var slider=$('#tft-slider');var prev=$('#last-project');var next=$(this);var left=parseInt(slider.css('left'));var left_scroll=left-$.slideInc;var check_active=left%$.slideInc;var textslider=$('#projects-slider');var top=parseInt(textslider.css('top'));var top_scroll=top-$.slideIncText;var check_active_text=top%$.slideIncText;if(left_scroll<=-$.slideInc){prev.css({'opacity':'1'});}else{prev.css({'opacity':'0.4'});}
if(left_scroll<=$.maxSlide+$.slideInc){next.css({'opacity':'0.4'});}else{next.css({'opacity':'1'});}
if(left<=0&&check_active==0&&left_scroll>$.maxSlide){slider.stop().animate({left:left_scroll+'px'},600);textslider.animate({top:top_scroll+'px'},600);setDot(left_scroll);}
return false;});$('#last-project').click(function(){var slider=$('#tft-slider');var prev=$(this);var next=$('#next-project');var left=parseInt(slider.css('left'));var left_scroll=left+$.slideInc;var check_active=left%$.slideInc;var textslider=$('#projects-slider');var top=parseInt(textslider.css('top'));var top_scroll=top+$.slideIncText;var check_active_text=top%$.slideIncText;if(left_scroll<=-$.slideInc){prev.css({'opacity':'1'});}else{prev.css({'opacity':'0.4'});}
if(left_scroll<=$.maxSlide+$.slideInc){next.css({'opacity':'0.4'});}else{next.css({'opacity':'1'});}
if(left<0&&check_active==0){slider.animate({'left':left_scroll+'px'},{duration:500});textslider.animate({'top':top_scroll+'px'},{duration:500},setDot(left_scroll));}
return false;});$('.dot').click(function(){var slider=$('#tft-slider');var textslider=$('#projects-slider');var left=parseInt(slider.css('left'));var check_active=left%$.slideInc;if(check_active==0){var tftIndex=$('.dot').index($(this));var slideTo=tftIndex*$.slideInc*(-1);var slideTextTo=tftIndex*$.slideIncText*(-1);slider.animate({'left':slideTo+'px'},{duration:800,easing:$.ease});textslider.animate({'top':slideTextTo+'px'},{duration:800,easing:$.ease});$('.dot').removeClass('dot-selected');newIndex=Math.abs((slideTo/$.slideInc));$('.dot:eq('+newIndex+')').addClass('dot-selected');}});$('.tab').each(function(i){if(!$(this).hasClass('tab-selected')){var tab_id=$(this).attr('id');var tab_content_id='#'+tab_id+'-content';$(tab_content_id).css({'display':'none'});}});$('.tab').click(function(){if(!$(this).hasClass('tab-selected')){var tab_id=$('.tab-selected').removeClass('tab-selected').attr('id');var tab_content_id='#'+tab_id+'-content';$(tab_content_id).css({'display':'none'});tab_id=$(this).addClass('tab-selected').attr('id');tab_content_id='#'+tab_id+'-content';$(tab_content_id).css({'display':'block'});}
return false;});function setDot(left_scroll){var tftIndex=$('.tft-content').index($('.active')[0]);$('.dot').removeClass('dot-selected');newIndex=Math.abs((left_scroll/$.slideInc));$('.dot:eq('+newIndex+')').addClass('dot-selected');}
var spotlight;function activate(evt){var w=$(document).width();var h=$(document).height();spotlight.css({display:'block',width:w,height:h});var r=Math.max(175,Math.min(evt.pageX+87,w));var b=Math.max(175,Math.min(evt.pageY+87,h));var l=r-175;var t=b-175;$('.top',spotlight).attr('height',t);$('.left',spotlight).attr('width',l);$('.bottom',spotlight).attr('height',h-b);$('.right',spotlight).attr('width',w-r);}
function pushLightSwitch(switcher){if(switcher.hasClass('switch-on')){switcher.removeClass('switch-on').children('.light-on').css({'color':'#5B6067','text-decoration':'none'});switcher.children('.light-off').css({'color':'#333','text-decoration':'underline'});}else{switcher.addClass('switch-on').children('.light-on').css({'color':'#333','text-decoration':'underline'});switcher.children('.light-off').css({'color':'#5B6067','text-decoration':'none'});}}
$(function(){spotlight=$('#spotlight');$('img',spotlight).click(function(){$(document.body).unbind('mousemove',activate);var switcher=$('#light-switch');pushLightSwitch(switcher);spotlight.animate({opacity:0},function(){spotlight.css({display:'none',opacity:1});});});$('#light-switch').click(function(evt){activate(evt);var switcher=$(this);pushLightSwitch(switcher);$(document.body).mousemove(activate);return false;});});});