
var elem=document.documentElement;elem.className=elem.className.replace(/\bno-js\b/,'js');(function(f,h,i){function k(a,c){var b=(a[0]||0)-(c[0]||0);return b>0||!b&&a.length>0&&k(a.slice(1),c.slice(1))}function l(a){if(typeof a!=g)return a;var c=[],b="";for(var d in a){b=typeof a[d]==g?l(a[d]):[d,m?encodeURI(a[d]):a[d]].join("=");c.push(b)}return c.join("&")}function n(a){var c=[];for(var b in a)a[b]&&c.push([b,'="',a[b],'"'].join(""));return c.join(" ")}function o(a){var c=[];for(var b in a)c.push(['<param name="',b,'" value="',l(a[b]),'" />'].join(""));return c.join("")}var g="object",m=true;try{var j=i.description||function(){return(new i("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version")}()}catch(p){j="Unavailable"}var e=j.match(/\d+/g)||[0];f[h]={available:e[0]>0,activeX:i&&!i.name,version:{original:j,array:e,string:e.join("."),major:parseInt(e[0],10)||0,minor:parseInt(e[1],10)||0,release:parseInt(e[2],10)||0},hasVersion:function(a){a=/string|number/.test(typeof a)?a.toString().split("."):/object/.test(typeof a)?[a.major,a.minor]:a||[0,0];return k(e,a)},encodeParams:true,expressInstall:"expressInstall.swf",expressInstallIsActive:false,create:function(a){if(!a.swf||this.expressInstallIsActive||!this.available&&!a.hasVersionFail)return false;if(!this.hasVersion(a.hasVersion||1)){this.expressInstallIsActive=true;if(typeof a.hasVersionFail=="function")if(!a.hasVersionFail.apply(a))return false;a={swf:a.expressInstall||this.expressInstall,height:137,width:214,flashvars:{MMredirectURL:location.href,MMplayerType:this.activeX?"ActiveX":"PlugIn",MMdoctitle:document.title.slice(0,47)+" - Flash Player Installation"}}}attrs={data:a.swf,type:"application/x-shockwave-flash",id:a.id||"flash_"+Math.floor(Math.random()*999999999),width:a.width||320,height:a.height||180,style:a.style||""};m=typeof a.useEncode!=="undefined"?a.useEncode:this.encodeParams;a.movie=a.swf;a.wmode=a.wmode||"opaque";delete a.fallback;delete a.hasVersion;delete a.hasVersionFail;delete a.height;delete a.id;delete a.swf;delete a.useEncode;delete a.width;var c=document.createElement("div");c.innerHTML=["<object ",n(attrs),">",o(a),"</object>"].join("");return c.firstChild}};f.fn[h]=function(a){var c=this.find(g).andSelf().filter(g);/string|object/.test(typeof a)&&this.each(function(){var b=f(this),d;a=typeof a==g?a:{swf:a};a.fallback=this;if(d=f[h].create(a)){b.children().remove();b.html(d)}});typeof a=="function"&&c.each(function(){var b=this;b.jsInteractionTimeoutMs=b.jsInteractionTimeoutMs||0;if(b.jsInteractionTimeoutMs<660)b.clientWidth||b.clientHeight?a.call(b):setTimeout(function(){f(b)[h](a)},b.jsInteractionTimeoutMs+66)});return c}})(jQuery,"flash",navigator.plugins["Shockwave Flash"]||window.ActiveXObject);(function($){var a={},c="doTimeout",d=Array.prototype.slice;$[c]=function(){return b.apply(window,[0].concat(d.call(arguments)))};$.fn[c]=function(){var e=d.call(arguments),f=b.apply(this,[c+e[0]].concat(e));return typeof e[0]==="number"||typeof e[1]==="number"?this:f};function b(l){var m=this,h,k={},n=arguments,i=4,g=n[1],j=n[2],o=n[3];if(typeof g!=="string"){i--;g=l=0;j=n[1];o=n[2]}if(l){h=m.eq(0);h.data(l,k=h.data(l)||{})}else{if(g){k=a[g]||(a[g]={})}}k.id&&clearTimeout(k.id);delete k.id;function f(){if(l){h.removeData(l)}else{if(g){delete a[g]}}}function e(){k.id=setTimeout(function(){k.fn()},j)}if(o){k.fn=function(p){o.apply(m,d.call(n,i))&&!p?e():f()};e()}else{if(k.fn){j===undefined?f():k.fn(j===false);return true}else{f()}}}})(jQuery);function urlencode(str){str=(str+'').toString();return encodeURIComponent(str).replace(/!/g,'%21').replace(/'/g,'%27').replace(/\(/g,'%28').replace(/\)/g,'%29').replace(/\*/g,'%2A').replace(/%20/g,'+');}
function utf8_encode(argString){var string=(argString+'');var utftext="",start,end,stringl=0;start=end=0;stringl=string.length;for(var n=0;n<stringl;n++){var c1=string.charCodeAt(n);var enc=null;if(c1<128){end++;}else if(c1>127&&c1<2048){enc=String.fromCharCode((c1>>6)|192)+String.fromCharCode((c1&63)|128);}else{enc=String.fromCharCode((c1>>12)|224)+String.fromCharCode(((c1>>6)&63)|128)+String.fromCharCode((c1&63)|128);}
if(enc!==null){if(end>start){utftext+=string.slice(start,end);}
utftext+=enc;start=end=n+1;}}
if(end>start){utftext+=string.slice(start,stringl);}
return utftext;}
function base64_encode(data){var b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var o1,o2,o3,h1,h2,h3,h4,bits,i=0,ac=0,enc="",tmp_arr=[];if(!data){return data;}
data=this.utf8_encode(data+'');do{o1=data.charCodeAt(i++);o2=data.charCodeAt(i++);o3=data.charCodeAt(i++);bits=o1<<16|o2<<8|o3;h1=bits>>18&0x3f;h2=bits>>12&0x3f;h3=bits>>6&0x3f;h4=bits&0x3f;tmp_arr[ac++]=b64.charAt(h1)+b64.charAt(h2)+b64.charAt(h3)+b64.charAt(h4);}while(i<data.length);enc=tmp_arr.join('');switch(data.length%3){case 1:enc=enc.slice(0,-2)+'==';break;case 2:enc=enc.slice(0,-1)+'=';break;}
return enc;}
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 str_replace(search,replace,subject,count){var i=0,j=0,temp='',repl='',sl=0,fl=0,f=[].concat(search),r=[].concat(replace),s=subject,ra=r instanceof Array,sa=s instanceof Array;s=[].concat(s);if(count){this.window[count]=0;}
for(i=0,sl=s.length;i<sl;i++){if(s[i]===''){continue;}
for(j=0,fl=f.length;j<fl;j++){temp=s[i]+'';repl=ra?(r[j]!==undefined?r[j]:''):r[0];s[i]=(temp).split(f[j]).join(repl);if(count&&s[i]!==temp){this.window[count]+=(temp.length-s[i].length)/f[j].length;}}}
return sa?s:s[0];}
window.log=function(){log.history=log.history||[];log.history.push(arguments);if(this.console){console.log(Array.prototype.slice.call(arguments));}};function isNumber(n){return!isNaN(parseFloat(n))&&isFinite(n);}
$(document).ready(function(){if(navigator.userAgent.match(/iPhone/i)){$("html").addClass("mobile");}
if(navigator.userAgent.match(/Android/i)){$("html").addClass("android").addClass("mobile");}
if(navigator.userAgent.match(/iPad/i)){$("html").addClass("ipad").addClass("mobile");}
if('localStorage'in window&&window['localStorage']!==null){$('html').addClass('local-storage');if($.jStorage.get('jcart_qty')){var minimart_qty=$.jStorage.get('jcart_qty');if(minimart_qty>0){$('#header .minimart span').before('<span class="qty"> ('+minimart_qty+')</span>');}}
if($.jStorage.get('lightbox')){var lightbox_qty=$.jStorage.get('lightbox').length;if(lightbox_qty>0){$('#header .lightbox span').before('<span class="qty"> ('+lightbox_qty+')</span>');}}}
$("footer ul li a, a.anchor").each(function(){$(this).append("<span> &raquo;</span>");});$("body#news ul.pagination li").each(function(){$(this).addClass("title");});if($("body#news").length){if($("li.previous").length<1){$('li.page-total').css("margin-left","235px");}
var tots=$('li.page-total').html();var new_tots=str_replace('Page ','',tots);$('li.page-total').html(str_replace(' of ','<span class="separator"> / </span>',new_tots));}
var i=document.createElement("input");if(!("placeholder"in i)){$("input[placeholder]").each(function(){var self=$(this);self.val(self.attr("placeholder")).bind({focus:function(){if(self.val()===self.attr("placeholder")){self.val("");}},blur:function(){var label=self.attr("placeholder");if(label&&self.val()===""){self.val(label);}}});});}
$("a.blank").attr("target","_blank");$('a.back').click(function(){history.back();return false;});$.easing.custom=function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;}
if($("body#home").length){$('#featured').orbit({"animation":"horizontal-push",animationSpeed:230,bullets:true,captions:true,captionAnimation:'none',});$('.slider-nav').delegate('span.left, span.right','click',function(){$(this).blur().addClass("focus").doTimeout(64,function(){$(this).removeClass("focus");})});}
$("a.toggler").addClass('toggler-off');$('#footer #categories, #footer #connect, #footer #login').hide();$.fn.toggler=function(div)
{$(div).slideToggle(175);if($(this).is('.toggler-on')){$(this).removeClass('toggler-on').addClass('toggler-off');}else{$(this).removeClass('toggler-off').addClass('toggler-on');}
return false;};$("#footer a.toggler").click(function()
{$(this).toggler($(this).attr("href"));return false;});$('a.target[href*=#], a.toggler-off').bind("click",function(){if(location.pathname.replace(/^\//,'')==this.pathname.replace(/^\//,'')&&location.hostname==this.hostname&&this.hash.replace(/#/,'')){var hash=this.hash;var target=$(hash).offset().top;$.doTimeout(300,function(){$("html:not(:animated),body:not(:animated)").animate({scrollTop:target},525,"custom",function(){});});return false;}});var imgInd=1;var imgCnt=0;var timeout=false;var animationTimes=700;if($('html.mobile').length)var animationTimes=200;$('#scroller li').each(function(){imgCnt=imgCnt+1;$(this).css("width",$(this).width()+3+"px").attr("id","s"+imgCnt);$(this).children("img,video").attr("id","img"+imgCnt);});$('#scroller li video').each(function(){$(this).parent().css("width",Number($(this).attr("width"))+3+"px");});$('#scroller-nav .tip_trigger_next, #scroller-nav-text .next, #scroller-nav-text .next1, #scroller-nav-text .next2, #scroller-nav-text .next3').bind("click",function(){nextImg();return false;});$('#scroller-nav .tip_trigger_prev, #scroller-nav-text .prev').bind("click",function(){prevImg();return false;});function getImgInd(imgObj){if(imgCnt<=0)return;return parseInt(imgObj.attr("id").replace("s",""))-1;}
$('html').keydown(function(eve){if(eve.keyCode=='37'){prevImg();}else if(eve.keyCode=='39'){nextImg();}else if(eve.keyCode=='35'){lastImg();}else if(eve.keyCode=='36'){firstImg();}});if($("html.mobile").length){$.getScript('http://www.pekkafinland.fi/js/jquery.touchwipe.1.1.1.js',function(){$("#scroller-nav").remove();$("#scroller").touchwipe({wipeLeft:function(){nextImg();},wipeRight:function(){prevImg();},min_move_x:225,min_move_y:20000});});}
function nextImg(){if(imgCnt<=0)return;if(imgInd>=imgCnt)return;imgInd=Number($("li.active").attr("id").replace("s",""));imgInd++;scrollToImg(imgInd,true);}
function prevImg(){if(imgCnt<=0)return;imgInd=Number($("li.active").attr("id").replace("s",""));imgInd--;if(imgInd>0)scrollToImg(imgInd,true);}
function firstImg(){if(imgCnt<=0)return;imgInd=1;scrollToImg(1,true);}
function lastImg(){if(imgCnt<=0)return;imgInd=imgCnt;scrollToImg(imgCnt,true);}
function scrollToImg(ind,anim,addr){if(imgCnt<=0)return;var img=$('#scroller li:nth-child('+(ind)+')');var img2=$('#scroller li:nth-child('+(ind+1)+') img');$('#scroller li img').removeClass('curimg');img2.addClass('curimg');if(ind<=1){$('#scroller-nav .prev, #scroller-nav-text .prev').addClass("disabled").removeClass("enabled");$(".tip_prev").hide();}else{$('#scroller-nav .prev, #scroller-nav-text .prev').removeClass("disabled").addClass("enabled");}
if(ind>=imgCnt){$('#scroller-nav .next, #scroller-nav-text .next, #scroller-nav .tip_trigger_next').addClass("disabled").removeClass("enabled");$(".tip_next").hide();}else{$('#scroller-nav .next, #scroller-nav-text .next, #scroller-nav .tip_trigger_next').removeClass("disabled").addClass("enabled");}
var previousWidths=0;$("#scroller li").slice(0,ind).each(function(){previousWidths=previousWidths+$(this).width();});$("#scroller-index .num").html(ind);var le=Math.floor(previousWidths-img.width());$('#scroller li').each(function(){var _ind=getImgInd($(this));if(ind!=(_ind+1)){$(this).attr("class","inactive");}else{$(this).attr("class","active");}});if(anim){if($('html.mobile').length){$('.imagecontainer').stop().animate({scrollLeft:le},animationTimes,"linear");}else{$('.imagecontainer').stop().animate({scrollLeft:le},animationTimes,"custom");}}else{$('.imagecontainer').stop().animate({scrollLeft:le},650);if($('#scroller li#s'+ind+' video').length){$('#scroller li#s'+ind+' video').trigger('play');}}
if($('#scroller li#s'+ind+' video').length){$('#scroller li#s'+ind).addClass('has-video');$("#scroller-nav .prev").attr("style","height: 415px;");$("#scroller-nav .next1, #scroller-nav .next2").attr("style","height: 0px; overflow: hidden;");$("#scroller-nav .next3").attr("style","width: 205px; margin-left: 970px;");}else{$("#scroller-nav .prev, #scroller-nav .next1, #scroller-nav .next2, #scroller-nav .next3").removeAttr("style");}
if(addr){}else{if(window.history&&window.history.replaceState){var data={foo:"bar"}
history.replaceState(data,"trololo","#"+ind);}}
if($("#scroller li#s"+ind+" .work-info").length){$("a.info").fadeIn();$(".tip_info").html($("#scroller li#s"+ind+" .work-info").html()).hide();}else{$("a.info").fadeOut();}
if($("#scroller li#s"+ind).attr('data-defer-src')){$("a.lightbox-add").fadeIn();}else{$("a.lightbox-add").fadeOut();}
$('#scroller li video').trigger('pause');if($("#scroller li#s"+ind+"").attr("data-flash")=="true"){if($("#scroller li#s"+ind+" .swf").hasClass('swf-loaded')){}else{swf_id=$("#scroller li#s"+ind+"").children('.swf').attr('id');swf_src=$("#scroller li#s"+ind+"").children('.swf').attr('data-swf-defer-src');swf_w=$("#scroller li#s"+ind+"").children('.swf').attr('data-width');swf_h=$("#scroller li#s"+ind+"").children('.swf').attr('data-height');$('#'+swf_id).delay(1200).flash({swf:swf_src,width:swf_w,height:swf_h,wmode:'transparent'});$("#scroller li#s"+ind+" .swf").addClass('swf-loaded');}}
var current_elm=$("#scroller li#s"+ind);$("#content h1#author").html('<a href="'+current_elm.attr("data-href")+'">'+current_elm.attr("data-author")+'</a>');var lazyLoader=true;if($("html.opera").length){lazyLoader=false;$("section#portfolio").css("overflow","hidden")
$('.imagecontainer').animate({left:"-"+le},10,"linear");}
var lazyAmount=2;var lazyLt=Number(ind)+(lazyAmount);var lazyGt=Number(ind)-(1);var lazyPrev=Number(ind)-(2);if(lazyLoader){$('#scroller .img:eq('+(ind-1)+')').each(function(){if($(this).hasClass('loaded')==false){$(this).attr('src',$(this).parents('li').attr('data-defer-src')).addClass('loaded');}});$('#scroller .img:eq('+lazyGt+')').each(function(){if($(this).hasClass('loaded')==false){$(this).attr('src',$(this).parents('li').attr('data-defer-src')).addClass('loaded');}});$('#scroller .img:lt('+lazyLt+'):gt('+lazyGt+')').each(function(){if($(this).hasClass('loaded')==false){$(this).attr('src',$(this).parents('li').attr('data-defer-src')).addClass('loaded');}});if(ind>3){$('#scroller .img:eq('+lazyPrev+')').each(function(){if($(this).hasClass('loaded')==false){$(this).attr('src',$(this).parents('li').attr('data-defer-src')).addClass('loaded');}});}}else{$("#scroller .img").each(function(){$(this).attr('src',$(this).parents('li').attr('data-defer-src')).addClass('loaded');});$(".imagecontainer").css("width","90000px");}}
$("#scroller li:first").addClass("first");$("#scroller li:last").addClass("last");if($("#scroller").length){if(window.location.hash!=""){var _hash=window.location.hash.substr(1);if(isNumber(_hash)){if(_hash.length>3){var _hashid=$("#scroller li[data-id="+_hash+"]").attr("id").substr(1);scrollToImg(_hashid,false,false);}else{scrollToImg(_hash,false,false);}}}else{scrollToImg(1,true,true);}}
$("body#illustrators #thumbnails a, body#cgi #thumbnails a, body#creative-agencies #thumbnails a").click(function(){var id=$(this).attr("rel").replace("s","");scrollToImg(id);$("html body").animate({scrollTop:$("#header").height()},200);return false;});$('.tabs a').click(function(){var clicked_el=$(this);var clicked_target=$("#"+$(this).attr("rel"));var anim_height=clicked_target.height();$(".tab-content").hide();$('.tabs-wrapper').animate({height:anim_height},175,function(){$(".tabs a").removeClass("active");clicked_el.addClass("active");clicked_target.fadeIn();});return false;});$('#biography').hide();function fixFooter(){var used_height=$("div#header").height()+$("div#footer").height();var min_height=200+used_height;var avail_height=$(window).height()-used_height;if($(window).height()>min_height){var target_height=avail_height;$("div#content").css("min-height",(avail_height-94)+"px");}else{$("div#content").css("min-height","400px");}}
var resizeTimer=null;$(window).bind('resize',function(){if(resizeTimer)clearTimeout(resizeTimer);resizeTimer=setTimeout(fixFooter,100);});fixFooter();var tip;$("#scroller-nav").livequery(function(){$(this).children("div").hover(function(){tip=$(this).find('.tip').remove();$('body').append(tip);imgInd=Number($("#scroller li.active").attr("id").replace("s",""));imgLast=$("#scroller li").length;if($(this).hasClass("tip_trigger_prev")&&imgInd>1)tip.fadeIn(500);if($(this).hasClass("tip_trigger_next")&&imgInd<imgLast)tip.fadeIn(500);},function(){if(typeof(tip)!="undefined"){tip.hide().remove();$(this).append(tip);}});},function(){$(this).unbind('mouseover').unbind('mouseout');}).delegate("div","mousemove",function(e){if(typeof(tip)!="undefined"){var mousex=e.pageX+20;var mousey=e.pageY+10;var tipWidth=tip.width();var tipHeight=tip.height();var tipVisX=$(window).width()-(mousex+tipWidth);var tipVisY=$(window).height()-(mousey+tipHeight);if(tipVisX<20){$(this).find('.tip').css({top:mousey,left:mousex});}if(tipVisY<20){tip.css({top:mousey,left:mousex});}else{tip.css({top:mousey,left:mousex});}}});$("#scroller-nav div").click(function(){$("span.tip").addClass("focus").doTimeout(64,function(){$(this).removeClass("focus");});});var tipp;$("#content .tip_info").removeClass('hide');$(".tip_trigger").hover(function(){tipp=$(this).find('.tip_info').remove();$('body').append(tipp);tipp.show();},function(){if(typeof(tipp)!="undefined"){tipp.hide().remove();$(this).append(tipp);}}).mousemove(function(e){if(typeof(tipp)!="undefined"){var mousex=e.pageX+20;var mousey=e.pageY+20;var tipWidth=tipp.width();var tipHeight=tipp.height();mousey=mousey-(80+tipHeight);mousex=mousex-(tipWidth/2);var tipVisX=$(window).width()-(mousex+tipWidth);var tipVisY=$(window).height()-(mousey+tipHeight);if(tipVisX<20){mousex=e.pageX-tipWidth-20;}if(tipVisY<20){mousey=e.pageY-tipHeight-20;}
if($("html.ff3").length)mousey=mousey-40;tipp.css({top:mousey,left:mousex});}}).click(function(e){if($('html.mobile').length){tipp=$(this).find('.tip_info').remove();$('body').append(tipp);tipp.show();if(typeof(tipp)!="undefined"){tipp.css({top:"630px",left:"585px"});}
$('.tip').click(function(){if(typeof(tipp)!="undefined"){tipp.hide().remove();$(this).append(tipp);}});}else{return false;}});$("body#contact-us form#freeform").submit(function(){var error=false;if($("input#name").val()==""||$("input#email").val()==""){error="Please fill in all applicable fields.";}
if(error){if(!$("p.error").length){$("form#freeform").parent('div').append('<p class="error prepend-top">'+error+'</p>');}
return false;}else{$("form#freeform").submit();}
return false;});$('a.lightbox-add').click(function(){if($('html.local-storage').length){if($('#scroller li.active').hasClass('added-to-lightbox')){}else{var _id=$("#scroller li.active").attr("data-id");var _thumb=$("#scroller li.active").attr("data-thumb");var _detail=$("#scroller li.active").attr("data-defer-src");var _author=$("#scroller li.active").attr("data-author");var vals=new Array(_id,_thumb,_detail,_author);var data=$.jStorage.get('lightbox');if(data!=null){data[data.length]=vals;}else{var data=new Array(vals);};$.jStorage.set('lightbox',data);$('#scroller li.active').addClass('added-to-lightbox');if($('#header .lightbox span.qty').length){$('#header .lightbox span.qty').html(' ('+$.jStorage.get('lightbox').length+')');}else{$('#header .lightbox span').before('<span class="qty"> ('+$.jStorage.get('lightbox').length+')</span>');}}
return false;}});if($('body#lightbox').length){var index=$.jStorage.index();var lbs=$.jStorage.get('lightbox');var download_str="";$('#content ul.lightbox-items').hide();for(var i=0,len=lbs.length;i<len;++i){_val=$.jStorage.get('lightbox')[i];$('#content ul.lightbox-items').append('<li class="span-1 left" id="'+_val[0]+'"><a href="'+_val[2]+'" class="fancy" rel="gruppe"><img src="'+_val[1]+'" width="225" height="150" alt="" class="img" /><h2 class="title">'+_val[3]+'</h2></a><span class="close"><a href="javascript:;" data-id="'+[i]+'" data-key="'+_val[0]+'">Remove</a></span></li>');download_str=download_str+=_val[2]+'|';}
$('#content ul.lightbox-items').fadeIn();if(lbs.length){$('#content p.empty').hide();$('#content a.zip-link').removeClass('hide');$('#content a.zip-link').attr("href",'../zip/'+base64_encode(download_str));}else{$('#content p.empty').removeClass('hide');}
$("a.fancy").fancybox({'transitionIn':'fade','transitionOut':'fade','speedIn':300,'speedOut':200,'overlayShow':true,'hideOnContentClick':false,'hideOnOverlayClick':true,'showCloseButton':true,'enableEscapeButton':true,'cyclic':true,'autoScale':false,'overlayColor':'#1d1d1d','overlayOpacity':0.2,'centerOnScroll':true,'showNavArrows':true});$("ul.listing li .close a").hover(function(){$(this).parent('.close').addClass('active');},function(){$(this).parent('.close').removeClass('active');}).click(function(){var current=new Array($.jStorage.get('lightbox'));var id=Number($(this).attr('data-id'));var key=Number($(this).attr('data-key'));var listItem=document.getElementById(key);var offset=$("ul.lightbox-items li").index(listItem);current[0].splice(offset,1);_updated=current;$.jStorage.set('lightbox',_updated[0]);$(this).parents('li').fadeOut(600).doTimeout(20,function(){$(this).remove();});var download_str="";for(var i=0,len=_updated[0].length;i<len;++i){log(_updated[0][i]);_val=$.jStorage.get('lightbox')[i];download_str=download_str+=_val[2]+'|';}
var url=$('head base').attr("href");$('#content a.zip-link').attr("href",url+'zip/'+base64_encode(download_str));$('#header .lightbox span.qty').html(' ('+$.jStorage.get('lightbox').length+')');if($.jStorage.get('lightbox').length==0){$('#content p.empty').show();$('#content a.zip-link').addClass('hide');$('#header a.lightbox .qty').remove();}
return false;});}});var _gaq=[['_setAccount','UA-1011169-14'],['_trackPageview']];(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=true;g.src='//www.google-analytics.com/ga.js';s.parentNode.insertBefore(g,s);}(document,'script'));

