(function(a){function e(a,b){a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var c="[\\?&]"+a+"=([^&#]*)";var d=new RegExp(c);var e=d.exec(b);return e==null?"":e[1]}function d(){url=location.href;hashtag=url.indexOf("#!prettyPhoto")?true:false;if(hashtag)location.hash="!prettyPhoto"}function c(){if(typeof theRel=="undefined")return;location.hash="!"+theRel+"/"+rel_index+"/"}function b(){url=location.href;hashtag=url.indexOf("#!")!=-1?decodeURI(url.substring(url.indexOf("#!")+2,url.length)):false;return hashtag}a.prettyPhoto={version:"3.1.3"};a.fn.prettyPhoto=function(f){function B(b){if(settings.social_tools)facebook_like_link=settings.social_tools.replace("{location_href}",encodeURIComponent(location.href));settings.markup=settings.markup.replace("{pp_social}",settings.social_tools?facebook_like_link:"");a("body").append(settings.markup);$pp_pic_holder=a(".pp_pic_holder"),$ppt=a(".ppt"),$pp_overlay=a("div.pp_overlay");if(isSet&&settings.overlay_gallery){currentGalleryPage=0;toInject="";for(var c=0;c<pp_images.length;c++){if(!pp_images[c].match(/\b(jpg|jpeg|png|gif)\b/gi)){classname="default";img_src=""}else{classname="";img_src=pp_images[c]}toInject+="<li class='"+classname+"'><a href='#'><img src='"+img_src+"' width='50' alt='' /></a></li>"}toInject=settings.gallery_markup.replace(/{gallery}/g,toInject);$pp_pic_holder.find("#pp_full_res").after(toInject);$pp_gallery=a(".pp_pic_holder .pp_gallery"),$pp_gallery_li=$pp_gallery.find("li");$pp_gallery.find(".pp_arrow_next").click(function(){a.prettyPhoto.changeGalleryPage("next");a.prettyPhoto.stopSlideshow();return false});$pp_gallery.find(".pp_arrow_previous").click(function(){a.prettyPhoto.changeGalleryPage("previous");a.prettyPhoto.stopSlideshow();return false});$pp_pic_holder.find(".pp_content").hover(function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeIn()},function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeOut()});itemWidth=52+5;$pp_gallery_li.each(function(b){a(this).find("a").click(function(){a.prettyPhoto.changePage(b);a.prettyPhoto.stopSlideshow();return false})})}if(settings.slideshow){$pp_pic_holder.find(".pp_nav").prepend('<a href="#" class="pp_play">Play</a>');$pp_pic_holder.find(".pp_nav .pp_play").click(function(){a.prettyPhoto.startSlideshow();return false})}$pp_pic_holder.attr("class","pp_pic_holder "+settings.theme);$pp_overlay.css({opacity:0,height:a(document).height(),width:a(window).width()}).bind("click",function(){if(!settings.modal)a.prettyPhoto.close()});a("a.pp_close").bind("click",function(){a.prettyPhoto.close();return false});a("a.pp_expand").bind("click",function(b){if(a(this).hasClass("pp_expand")){a(this).removeClass("pp_expand").addClass("pp_contract");doresize=false}else{a(this).removeClass("pp_contract").addClass("pp_expand");doresize=true}s(function(){a.prettyPhoto.open()});return false});$pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click",function(){a.prettyPhoto.changePage("previous");a.prettyPhoto.stopSlideshow();return false});$pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click",function(){a.prettyPhoto.changePage("next");a.prettyPhoto.stopSlideshow();return false});x()}function A(){if(isSet&&settings.overlay_gallery&&w(pp_images[set_position])=="image"&&settings.ie6_fallback&&!(a.browser.msie&&parseInt(a.browser.version)==6)){itemWidth=52+5;navWidth=settings.theme=="facebook"||settings.theme=="pp_default"?50:30;itemsPerPage=Math.floor((i["containerWidth"]-100-navWidth)/itemWidth);itemsPerPage=itemsPerPage<pp_images.length?itemsPerPage:pp_images.length;totalPage=Math.ceil(pp_images.length/itemsPerPage)-1;if(totalPage==0){navWidth=0;$pp_gallery.find(".pp_arrow_next,.pp_arrow_previous").hide()}else{$pp_gallery.find(".pp_arrow_next,.pp_arrow_previous").show()}galleryWidth=itemsPerPage*itemWidth;fullGalleryWidth=pp_images.length*itemWidth;$pp_gallery.css("margin-left",-(galleryWidth/2+navWidth/2)).find("div:first").width(galleryWidth+5).find("ul").width(fullGalleryWidth).find("li.selected").removeClass("selected");goToPage=Math.floor(set_position/itemsPerPage)<totalPage?Math.floor(set_position/itemsPerPage):totalPage;a.prettyPhoto.changeGalleryPage(goToPage);$pp_gallery_li.filter(":eq("+set_position+")").addClass("selected")}else{$pp_pic_holder.find(".pp_content").unbind("mouseenter mouseleave")}}function z(){o=a(window).height(),p=a(window).width();if(typeof $pp_overlay!="undefined")$pp_overlay.height(a(document).height()).width(p)}function y(){if(self.pageYOffset){return{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset}}else if(document.documentElement&&document.documentElement.scrollTop){return{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft}}else if(document.body){return{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft}}}function x(){if(doresize&&typeof $pp_pic_holder!="undefined"){scroll_pos=y();contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width();projectedTop=o/2+scroll_pos["scrollTop"]-contentHeight/2;if(projectedTop<0)projectedTop=0;if(contentHeight>o)return;$pp_pic_holder.css({top:projectedTop,left:p/2+scroll_pos["scrollLeft"]-contentwidth/2})}}function w(a){if(a.match(/youtube\.com\/watch/i)||a.match(/youtu\.be/i)){return"youtube"}else if(a.match(/vimeo\.com/i)){return"vimeo"}else if(a.match(/\b.mov\b/i)){return"quicktime"}else if(a.match(/\b.swf\b/i)){return"flash"}else if(a.match(/\biframe=true\b/i)){return"iframe"}else if(a.match(/\bajax=true\b/i)){return"ajax"}else if(a.match(/\bcustom=true\b/i)){return"custom"}else if(a.substr(0,1)=="#"){return"inline"}else{return"image"}}function v(b,c){b=parseFloat(b);c=parseFloat(c);$pp_details=$pp_pic_holder.find(".pp_details");$pp_details.width(b);detailsHeight=parseFloat($pp_details.css("marginTop"))+parseFloat($pp_details.css("marginBottom"));$pp_details=$pp_details.clone().addClass(settings.theme).width(b).appendTo(a("body")).css({position:"absolute",top:-1e4});detailsHeight+=$pp_details.height();detailsHeight=detailsHeight<=34?36:detailsHeight;if(a.browser.msie&&a.browser.version==7)detailsHeight+=8;$pp_details.remove();$pp_title=$pp_pic_holder.find(".ppt");$pp_title.width(b);titleHeight=parseFloat($pp_title.css("marginTop"))+parseFloat($pp_title.css("marginBottom"));$pp_title=$pp_title.clone().appendTo(a("body")).css({position:"absolute",top:-1e4});titleHeight+=$pp_title.height();$pp_title.remove();k=c+detailsHeight;l=b;m=k+titleHeight+$pp_pic_holder.find(".pp_top").height()+$pp_pic_holder.find(".pp_bottom").height();n=b}function u(a,b){resized=false;v(a,b);imageWidth=a,imageHeight=b;if((n>p||m>o)&&doresize&&settings.allow_resize&&!h){resized=true,fitting=false;while(!fitting){if(n>p){imageWidth=p-200;imageHeight=b/a*imageWidth}else if(m>o){imageHeight=o-200;imageWidth=a/b*imageHeight}else{fitting=true}m=imageHeight,n=imageWidth}v(imageWidth,imageHeight);if(n>p||m>o){u(n,m)}}return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(m),containerWidth:Math.floor(n)+settings.horizontal_padding*2,contentHeight:Math.floor(k),contentWidth:Math.floor(l),resized:resized}}function t(b){b>1?a(".pp_nav").show():a(".pp_nav").hide()}function s(b){$pp_pic_holder.find("#pp_full_res object,#pp_full_res embed").css("visibility","hidden");$pp_pic_holder.find(".pp_fade").fadeOut(settings.animation_speed,function(){a(".pp_loaderIcon").show();b()})}function r(){a(".pp_loaderIcon").hide();projectedTop=scroll_pos["scrollTop"]+(o/2-i["containerHeight"]/2);if(projectedTop<0)projectedTop=0;$ppt.fadeTo(settings.animation_speed,1);$pp_pic_holder.find(".pp_content").animate({height:i["contentHeight"],width:i["contentWidth"]},settings.animation_speed);$pp_pic_holder.animate({top:projectedTop,left:p/2-i["containerWidth"]/2,width:i["containerWidth"]},settings.animation_speed,function(){$pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(i["height"]).width(i["width"]);$pp_pic_holder.find(".pp_fade").fadeIn(settings.animation_speed);if(isSet&&w(pp_images[set_position])=="image"){$pp_pic_holder.find(".pp_hoverContainer").show()}else{$pp_pic_holder.find(".pp_hoverContainer").hide()}if(i["resized"]){a("a.pp_expand,a.pp_contract").show()}else{a("a.pp_expand").hide()}if(settings.autoplay_slideshow&&!q&&!j)a.prettyPhoto.startSlideshow();settings.changepicturecallback();j=true});A()}f=jQuery.extend({animation_speed:"fast",slideshow:5e3,autoplay_slideshow:false,opacity:.8,show_title:true,allow_resize:true,default_width:500,default_height:344,counter_separator_label:"/",theme:"pp_default",horizontal_padding:20,hideflash:false,wmode:"opaque",autoplay:true,modal:false,deeplinking:true,overlay_gallery:true,keyboard_shortcuts:true,changepicturecallback:function(){},callback:function(){},ie6_fallback:true,markup:'<div class="pp_pic_holder"> \n\t\t\t\t\t\t<div class="ppt"> </div> \n\t\t\t\t\t\t<div class="pp_top"> \n\t\t\t\t\t\t\t<div class="pp_left"></div> \n\t\t\t\t\t\t\t<div class="pp_middle"></div> \n\t\t\t\t\t\t\t<div class="pp_right"></div> \n\t\t\t\t\t\t</div> \n\t\t\t\t\t\t<div class="pp_content_container"> \n\t\t\t\t\t\t\t<div class="pp_left"> \n\t\t\t\t\t\t\t<div class="pp_right"> \n\t\t\t\t\t\t\t\t<div class="pp_content"> \n\t\t\t\t\t\t\t\t\t<div class="pp_loaderIcon"></div> \n\t\t\t\t\t\t\t\t\t<div class="pp_fade"> \n\t\t\t\t\t\t\t\t\t\t<a href="#" class="pp_expand" title="Expand the image">Expand</a> \n\t\t\t\t\t\t\t\t\t\t<div class="pp_hoverContainer"> \n\t\t\t\t\t\t\t\t\t\t\t<a class="pp_next" href="#">next</a> \n\t\t\t\t\t\t\t\t\t\t\t<a class="pp_previous" href="#">previous</a> \n\t\t\t\t\t\t\t\t\t\t</div> \n\t\t\t\t\t\t\t\t\t\t<div id="pp_full_res"></div> \n\t\t\t\t\t\t\t\t\t\t<div class="pp_details"> \n\t\t\t\t\t\t\t\t\t\t\t<div class="pp_nav"> \n\t\t\t\t\t\t\t\t\t\t\t\t<a href="#" class="pp_arrow_previous">Previous</a> \n\t\t\t\t\t\t\t\t\t\t\t\t<p class="currentTextHolder">0/0</p> \n\t\t\t\t\t\t\t\t\t\t\t\t<a href="#" class="pp_arrow_next">Next</a> \n\t\t\t\t\t\t\t\t\t\t\t</div> \n\t\t\t\t\t\t\t\t\t\t\t<p class="pp_description"></p> \n\t\t\t\t\t\t\t\t\t\t\t<div class="pp_social">{pp_social}</div> \n\t\t\t\t\t\t\t\t\t\t\t<a class="pp_close" href="#">Close</a> \n\t\t\t\t\t\t\t\t\t\t</div> \n\t\t\t\t\t\t\t\t\t</div> \n\t\t\t\t\t\t\t\t</div> \n\t\t\t\t\t\t\t</div> \n\t\t\t\t\t\t\t</div> \n\t\t\t\t\t\t</div> \n\t\t\t\t\t\t<div class="pp_bottom"> \n\t\t\t\t\t\t\t<div class="pp_left"></div> \n\t\t\t\t\t\t\t<div class="pp_middle"></div> \n\t\t\t\t\t\t\t<div class="pp_right"></div> \n\t\t\t\t\t\t</div> \n\t\t\t\t\t</div> \n\t\t\t\t\t<div class="pp_overlay"></div>',gallery_markup:'<div class="pp_gallery"> \n\t\t\t\t\t\t\t\t<a href="#" class="pp_arrow_previous">Previous</a> \n\t\t\t\t\t\t\t\t<div> \n\t\t\t\t\t\t\t\t\t<ul> \n\t\t\t\t\t\t\t\t\t\t{gallery} \n\t\t\t\t\t\t\t\t\t</ul> \n\t\t\t\t\t\t\t\t</div> \n\t\t\t\t\t\t\t\t<a href="#" class="pp_arrow_next">Next</a> \n\t\t\t\t\t\t\t</div>',image_markup:'<img id="fullResImage" src="{path}" />',flash_markup:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',quicktime_markup:'<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',iframe_markup:'<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',inline_markup:'<div class="pp_inline">{content}</div>',custom_markup:""},f);var g=this,h=false,i,j,k,l,m,n,o=a(window).height(),p=a(window).width(),q;doresize=true,scroll_pos=y();a(window).unbind("resize.prettyphoto").bind("resize.prettyphoto",function(){x();z()});if(f.keyboard_shortcuts){a(document).unbind("keydown.prettyphoto").bind("keydown.prettyphoto",function(b){if(typeof $pp_pic_holder!="undefined"){if($pp_pic_holder.is(":visible")){switch(b.keyCode){case 37:a.prettyPhoto.changePage("previous");b.preventDefault();break;case 39:a.prettyPhoto.changePage("next");b.preventDefault();break;case 27:if(!settings.modal)a.prettyPhoto.close();b.preventDefault();break}}}})}a.prettyPhoto.initialize=function(){settings=f;if(settings.theme=="pp_default")settings.horizontal_padding=16;if(settings.ie6_fallback&&a.browser.msie&&parseInt(a.browser.version)==6)settings.theme="light_square";theRel=a(this).attr("rel");galleryRegExp=/\[(?:.*)\]/;isSet=galleryRegExp.exec(theRel)?true:false;pp_images=isSet?jQuery.map(g,function(b,c){if(a(b).attr("rel").indexOf(theRel)!=-1)return a(b).attr("href")}):a.makeArray(a(this).attr("href"));pp_titles=isSet?jQuery.map(g,function(b,c){if(a(b).attr("rel").indexOf(theRel)!=-1)return a(b).find("img").attr("alt")?a(b).find("img").attr("alt"):""}):a.makeArray(a(this).find("img").attr("alt"));pp_descriptions=isSet?jQuery.map(g,function(b,c){if(a(b).attr("rel").indexOf(theRel)!=-1)return a(b).attr("title")?a(b).attr("title"):""}):a.makeArray(a(this).attr("title"));if(pp_images.length>30)settings.overlay_gallery=false;set_position=jQuery.inArray(a(this).attr("href"),pp_images);rel_index=isSet?set_position:a("a[rel^='"+theRel+"']").index(a(this));B(this);if(settings.allow_resize)a(window).bind("scroll.prettyphoto",function(){x()});a.prettyPhoto.open();return false};a.prettyPhoto.open=function(b){if(typeof settings=="undefined"){settings=f;if(a.browser.msie&&a.browser.version==6)settings.theme="light_square";pp_images=a.makeArray(arguments[0]);pp_titles=arguments[1]?a.makeArray(arguments[1]):a.makeArray("");pp_descriptions=arguments[2]?a.makeArray(arguments[2]):a.makeArray("");isSet=pp_images.length>1?true:false;set_position=0;B(b.target)}if(a.browser.msie&&a.browser.version==6)a("select").css("visibility","hidden");if(settings.hideflash)a("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","hidden");t(a(pp_images).size());a(".pp_loaderIcon").show();if(settings.deeplinking)c();if(settings.social_tools){facebook_like_link=settings.social_tools.replace("{location_href}",encodeURIComponent(location.href));$pp_pic_holder.find(".pp_social").html(facebook_like_link)}if($ppt.is(":hidden"))$ppt.css("opacity",0).show();$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);$pp_pic_holder.find(".currentTextHolder").text(set_position+1+settings.counter_separator_label+a(pp_images).size());if(pp_descriptions[set_position]!=""){$pp_pic_holder.find(".pp_description").show().html(unescape(pp_descriptions[set_position]))}else{$pp_pic_holder.find(".pp_description").hide()}movie_width=parseFloat(e("width",pp_images[set_position]))?e("width",pp_images[set_position]):settings.default_width.toString();movie_height=parseFloat(e("height",pp_images[set_position]))?e("height",pp_images[set_position]):settings.default_height.toString();h=false;if(movie_height.indexOf("%")!=-1){movie_height=parseFloat(a(window).height()*parseFloat(movie_height)/100-150);h=true}if(movie_width.indexOf("%")!=-1){movie_width=parseFloat(a(window).width()*parseFloat(movie_width)/100-150);h=true}$pp_pic_holder.fadeIn(function(){settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined"?$ppt.html(unescape(pp_titles[set_position])):$ppt.html(" ");imgPreloader="";skipInjection=false;switch(w(pp_images[set_position])){case"image":imgPreloader=new Image;nextImage=new Image;if(isSet&&set_position<a(pp_images).size()-1)nextImage.src=pp_images[set_position+1];prevImage=new Image;if(isSet&&pp_images[set_position-1])prevImage.src=pp_images[set_position-1];$pp_pic_holder.find("#pp_full_res")[0].innerHTML=settings.image_markup.replace(/{path}/g,pp_images[set_position]);imgPreloader.onload=function(){i=u(imgPreloader.width,imgPreloader.height);r()};imgPreloader.onerror=function(){alert("Image cannot be loaded. Make sure the path is correct and image exist.");a.prettyPhoto.close()};imgPreloader.src=pp_images[set_position];break;case"youtube":i=u(movie_width,movie_height);movie_id=e("v",pp_images[set_position]);if(movie_id==""){movie_id=pp_images[set_position].split("youtu.be/");movie_id=movie_id[1];if(movie_id.indexOf("?")>0)movie_id=movie_id.substr(0,movie_id.indexOf("?"));if(movie_id.indexOf("&")>0)movie_id=movie_id.substr(0,movie_id.indexOf("&"))}movie="http://www.youtube.com/embed/"+movie_id;e("rel",pp_images[set_position])?movie+="?rel="+e("rel",pp_images[set_position]):movie+="?rel=1";if(settings.autoplay)movie+="&autoplay=1";toInject=settings.iframe_markup.replace(/{width}/g,i["width"]).replace(/{height}/g,i["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case"vimeo":i=u(movie_width,movie_height);movie_id=pp_images[set_position];var b=/http:\/\/(www\.)?vimeo.com\/(\d+)/;var c=movie_id.match(b);movie="http://player.vimeo.com/video/"+c[2]+"?title=0&byline=0&portrait=0";if(settings.autoplay)movie+="&autoplay=1;";vimeo_width=i["width"]+"/embed/?moog_width="+i["width"];toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,i["height"]).replace(/{path}/g,movie);break;case"quicktime":i=u(movie_width,movie_height);i["height"]+=15;i["contentHeight"]+=15;i["containerHeight"]+=15;toInject=settings.quicktime_markup.replace(/{width}/g,i["width"]).replace(/{height}/g,i["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case"flash":i=u(movie_width,movie_height);flash_vars=pp_images[set_position];flash_vars=flash_vars.substring(pp_images[set_position].indexOf("flashvars")+10,pp_images[set_position].length);filename=pp_images[set_position];filename=filename.substring(0,filename.indexOf("?"));toInject=settings.flash_markup.replace(/{width}/g,i["width"]).replace(/{height}/g,i["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+"?"+flash_vars);break;case"iframe":i=u(movie_width,movie_height);frame_url=pp_images[set_position];frame_url=frame_url.substr(0,frame_url.indexOf("iframe")-1);toInject=settings.iframe_markup.replace(/{width}/g,i["width"]).replace(/{height}/g,i["height"]).replace(/{path}/g,frame_url);break;case"ajax":doresize=false;i=u(movie_width,movie_height);doresize=true;skipInjection=true;a.get(pp_images[set_position],function(a){toInject=settings.inline_markup.replace(/{content}/g,a);$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject;r()});break;case"custom":i=u(movie_width,movie_height);toInject=settings.custom_markup;break;case"inline":myClone=a(pp_images[set_position]).clone().append('<br clear="all" />').css({width:settings.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline"></div></div>').appendTo(a("body")).show();doresize=false;i=u(a(myClone).width(),a(myClone).height());doresize=true;a(myClone).remove();toInject=settings.inline_markup.replace(/{content}/g,a(pp_images[set_position]).html());break}if(!imgPreloader&&!skipInjection){$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject;r()}});return false};a.prettyPhoto.changePage=function(b){currentGalleryPage=0;if(b=="previous"){set_position--;if(set_position<0)set_position=a(pp_images).size()-1}else if(b=="next"){set_position++;if(set_position>a(pp_images).size()-1)set_position=0}else{set_position=b}rel_index=set_position;if(!doresize)doresize=true;a(".pp_contract").removeClass("pp_contract").addClass("pp_expand");s(function(){a.prettyPhoto.open()})};a.prettyPhoto.changeGalleryPage=function(a){if(a=="next"){currentGalleryPage++;if(currentGalleryPage>totalPage)currentGalleryPage=0}else if(a=="previous"){currentGalleryPage--;if(currentGalleryPage<0)currentGalleryPage=totalPage}else{currentGalleryPage=a}slide_speed=a=="next"||a=="previous"?settings.animation_speed:0;slide_to=currentGalleryPage*itemsPerPage*itemWidth;$pp_gallery.find("ul").animate({left:-slide_to},slide_speed)};a.prettyPhoto.startSlideshow=function(){if(typeof q=="undefined"){$pp_pic_holder.find(".pp_play").unbind("click").removeClass("pp_play").addClass("pp_pause").click(function(){a.prettyPhoto.stopSlideshow();return false});q=setInterval(a.prettyPhoto.startSlideshow,settings.slideshow)}else{a.prettyPhoto.changePage("next")}};a.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find(".pp_pause").unbind("click").removeClass("pp_pause").addClass("pp_play").click(function(){a.prettyPhoto.startSlideshow();return false});clearInterval(q);q=undefined};a.prettyPhoto.close=function(){if($pp_overlay.is(":animated"))return;a.prettyPhoto.stopSlideshow();$pp_pic_holder.stop().find("object,embed").css("visibility","hidden");a("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(settings.animation_speed,function(){a(this).remove()});$pp_overlay.fadeOut(settings.animation_speed,function(){if(a.browser.msie&&a.browser.version==6)a("select").css("visibility","visible");if(settings.hideflash)a("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","visible");a(this).remove();a(window).unbind("scroll.prettyphoto");d();settings.callback();doresize=true;j=false;delete settings})};if(!pp_alreadyInitialized&&b()){pp_alreadyInitialized=true;hashIndex=b();hashRel=hashIndex;hashIndex=hashIndex.substring(hashIndex.indexOf("/")+1,hashIndex.length-1);hashRel=hashRel.substring(0,hashRel.indexOf("/"));setTimeout(function(){a("a[rel^='"+hashRel+"']:eq("+hashIndex+")").trigger("click")},50)}return this.unbind("click.prettyphoto").bind("click.prettyphoto",a.prettyPhoto.initialize)};})(jQuery);var pp_alreadyInitialized=false;(function(a){a.fn.jTruncate=function(b){var c={length:300,minTrail:20,moreText:"more",lessText:"less",ellipsisText:"…",moreAni:"",lessAni:""};var b=a.extend(c,b);return this.each(function(){obj=a(this);var c=obj.html();if(c.length>b.length+b.minTrail){var d=c.indexOf(" ",b.length);if(d!=-1){var d=c.indexOf(" ",b.length);var e=c.substring(0,d);var f=c.substring(d,c.length-1);obj.html(e+'<span class="truncate_ellipsis">'+b.ellipsisText+"</span>"+'<span class="truncate_more">'+f+"</span>");obj.find(".truncate_more").css("display","none");obj.append('<div class="clearboth">'+'<a href="#" class="truncate_more_link">'+b.moreText+"</a>"+"</div>");var g=a(".truncate_more_link",obj);var h=a(".truncate_more",obj);var i=a(".truncate_ellipsis",obj);g.click(function(){if(g.text()==b.moreText){h.show(b.moreAni);g.text(b.lessText);i.css("display","none")}else{h.hide(b.lessAni);g.text(b.moreText);i.css("display","inline")}return false})}}})}})(jQuery);(function(a){var b={images:["http://dharmmotyar.googlecode.com/svn/trunk/images/spark.png","http://dharmmotyar.googlecode.com/svn/trunk/images//spark2.png","http://dharmmotyar.googlecode.com/svn/trunk/images/spark3.png","http://dharmmotyar.googlecode.com/svn/trunk/images/spark4.png"],total:50};a.firefly=function(c){a.firefly.settings=a.extend({},b,c);if(a.firefly.preloadImages()){for(i=0;i<a.firefly.settings.total;i++){a.firefly.fly(a.firefly.create(a.firefly.settings.images[a.firefly.random(a.firefly.settings.images.length)]))}}return};a.firefly.create=function(b){spark=a("<img>").attr({src:b}).hide();a(document.body).append(spark);return spark.css({position:"absolute","z-index":a.firefly.random(4),position:"absolute",top:a.firefly.random(a(window).height()-150),left:a.firefly.random(a(window).width()-150)}).show()};a.firefly.fly=function(b){a(b).animate({top:a.firefly.random(a(window).height()-150),left:a.firefly.random(a(window).width()-150)},(a.firefly.random(10)+5)*1100,function(){a.firefly.fly(b)})};a.firefly.preloadImages=function(){var b=new Object;for(i=0;i<a.firefly.settings.images.length;i++){b[i]=new Image;b[i].src=a.firefly.settings.images[i]}return true};a.firefly.random=function(a){return Math.ceil(Math.random()*a)-1}})(jQuery);window.log=function(){log.history=log.history||[];log.history.push(arguments);if(this.console){arguments.callee=arguments.callee.caller;var a=[].slice.call(arguments);typeof console.log==="object"?log.apply.call(console.log,console,a):console.log.apply(console,a)}};(function(a){function b(){}for(var c="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,timeStamp,profile,profileEnd,time,timeEnd,trace,warn".split(","),d;d=c.pop();){a[d]=a[d]||b}})(function(){try{console.log();return window.console}catch(a){return window.console={}}}());(function(a){jQuery.easing["jswing"]=jQuery.easing["swing"];jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(a,b,c,d,e){return jQuery.easing[jQuery.easing.def](a,b,c,d,e)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158;var g=0;var h=d;if(b==0)return c;if((b/=e)==1)return c+d;if(!g)g=e*.3;if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g))+c},easeOutElastic:function(a,b,c,d,e){var f=1.70158;var g=0;var h=d;if(b==0)return c;if((b/=e)==1)return c+d;if(!g)g=e*.3;if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*b)*Math.sin((b*e-f)*2*Math.PI/g)+d+c},easeInOutElastic:function(a,b,c,d,e){var f=1.70158;var g=0;var h=d;if(b==0)return c;if((b/=e/2)==2)return c+d;if(!g)g=e*.3*1.5;if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);if(b<1)return-.5*h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)+c;return h*Math.pow(2,-10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)*.5+d+c},easeInBack:function(a,b,c,d,e,f){if(f==undefined)f=1.70158;return d*(b/=e)*b*((f+1)*b-f)+c},easeOutBack:function(a,b,c,d,e,f){if(f==undefined)f=1.70158;return d*((b=b/e-1)*b*((f+1)*b+f)+1)+c},easeInOutBack:function(a,b,c,d,e,f){if(f==undefined)f=1.70158;if((b/=e/2)<1)return d/2*b*b*(((f*=1.525)+1)*b-f)+c;return d/2*((b-=2)*b*(((f*=1.525)+1)*b+f)+2)+c},easeInBounce:function(a,b,c,d,e){return d-jQuery.easing.easeOutBounce(a,e-b,0,d,e)+c},easeOutBounce:function(a,b,c,d,e){if((b/=e)<1/2.75){return d*7.5625*b*b+c}else if(b<2/2.75){return d*(7.5625*(b-=1.5/2.75)*b+.75)+c}else if(b<2.5/2.75){return d*(7.5625*(b-=2.25/2.75)*b+.9375)+c}else{return d*(7.5625*(b-=2.625/2.75)*b+.984375)+c}},easeInOutBounce:function(a,b,c,d,e){if(b<e/2)return jQuery.easing.easeInBounce(a,b*2,0,d,e)*.5+c;return jQuery.easing.easeOutBounce(a,b*2-e,0,d,e)*.5+d*.5+c}});jQuery.fn.carousel=function(a,b,c){var d=jQuery(this).children()[0];if(d){var e=jQuery(d).children().outerWidth("true"),f=jQuery(d).children(),g=f.length,h=e,j=Math.round(jQuery(this).width()/h),k=1,l=false;for(i=0;i<j;i++){jQuery(d).css("width",(g+j)*e+e+"px");jQuery(d).append(jQuery(f[i]).clone())}jQuery(a).click(function(a){if(!l){if(k==1){jQuery(d).css("left","-"+g*h+"px");k=g}else{k--}jQuery(d).animate({left:"+="+e,y:0,queue:true},"easeInOutExpo",function(){l=false});l=true}});jQuery(b).click(function(a){if(!l){if(k>g){k=2;jQuery(d).css("left","0px")}else{k++}jQuery(d).animate({left:"-="+e,y:0,queue:true},"easeInOutExpo",function(){l=false});l=true}})}};document.documentElement.className+="js_active";(function(a){a.fn.aviaSlider=function(b){var c={slides:"li",animationSpeed:900,autorotation:true,autorotationSpeed:3,appendControlls:"",slideControlls:"items",blockSize:{height:"full",width:"full"},betweenBlockDelay:60,display:"topleft",switchMovement:false,showText:true,transition:"fade",backgroundOpacity:.8,transitionOrder:["diagonaltop","diagonalbottom","topleft","bottomright","random"]};var d=a.extend(c,b);return this.each(function(){var b=a(this),c=b.find(d.slides),e=c.find("img"),f=c.length,g=c.width(),h=c.height(),i=0,k=0,l=false,m=0,n="active_item",o="",p=true,q="",r="",s="",t=[];if(d.blockSize.height=="full"){d.blockSize.height=h}if(d.blockSize.width=="full"){d.blockSize.width=g}b.methods={init:function(){var e=0,k=0,l=true,m="";c.filter(":first").css({"z-index":"5",display:"block"});while(l){i++;m="-"+e+"px -"+k+"px";a('<div class="kBlock"></div>').appendTo(b).css({zIndex:20,position:"absolute",display:"none",left:e,top:k,height:d.blockSize.height,width:d.blockSize.width,backgroundPosition:m});e+=d.blockSize.width;if(e>=g){e=0;k+=d.blockSize.height}if(k>=h){l=false}}r=b.find(".kBlock");t["topleft"]=r;t["bottomright"]=a(r.get().reverse());t["diagonaltop"]=b.methods.kcubit(r);t["diagonalbottom"]=b.methods.kcubit(t["bottomright"]);t["random"]=b.methods.fyrandomize(r);c.each(function(){a.data(this,"data",{img:a(this).find("img").attr("src")})});if(f<=1){b.aviaSlider_preloadhelper({delay:200})}else{b.aviaSlider_preloadhelper({callback:b.methods.preloadingDone});b.methods.appendControlls().addDescription()}},appendControlls:function(){if(d.slideControlls=="items"){var e=d.appendControlls||b[0];o=a("<div></div>").addClass("slidecontrolls").insertAfter(e);c.each(function(c){var d=a('<a href="#" class=" '+n+'"></a>').appendTo(o);d.bind("click",{currentSlideNumber:c},b.methods.switchSlide);n=""})}return this},addDescription:function(){if(d.showText){c.each(function(){var b=a(this),c=b.find("img").attr("alt"),e=c.split("::");if(e[0]!=""){if(e[1]!=undefined){c="<strong>"+e[0]+"</strong>"+e[1]}else{c=e[0]}}if(c!=""){a("<div></div>").addClass("feature_excerpt").html(c).css({display:"block",opacity:d.backgroundOpacity}).appendTo(b.find("a"))}})}},preloadingDone:function(){p=false;c.css({backgroundColor:"transparent",backgroundImage:"none"});if(d.autorotation){b.methods.autorotate();e.bind("click",function(){clearInterval(q)})}},autorotate:function(){q=setInterval(function(){k++;if(k==f)k=0;b.methods.switchSlide()},parseInt(d.autorotationSpeed)*1e3+d.betweenBlockDelay*i+d.animationSpeed)},switchSlide:function(e){var f=false;if(e!=undefined&&!p){if(k!=e.data.currentSlideNumber){k=e.data.currentSlideNumber}else{f=true}}if(e!=undefined)clearInterval(q);if(!p&&f==false){p=true;var g=c.filter(":visible"),h=c.filter(":eq("+k+")"),n=a.data(h[0],"data").img,u="url("+n+")";if(d.slideControlls){o.find(".active_item").removeClass("active_item");o.find("a:eq("+k+")").addClass("active_item")}s=t[d.display];c.find(">a>img").css({opacity:1,visibility:"visible"});if(d.switchMovement&&(d.display=="topleft"||d.display=="diagonaltop")){if(l==false){s=t[d.display];l=true}else{if(d.display=="topleft")s=t["bottomright"];if(d.display=="diagonaltop")s=t["diagonalbottom"];l=false}}if(d.display=="random"){s=b.methods.fyrandomize(r)}if(d.display=="all"){s=t[d.transitionOrder[m]];m++;if(m>=d.transitionOrder.length)m=0}s.css({backgroundImage:u}).each(function(c){var e=a(this);setTimeout(function(){var a=new Array;if(d.transition=="drop"){a["css"]={height:1,width:d.blockSize.width,display:"block",opacity:0};a["anim"]={height:d.blockSize.height,width:d.blockSize.width,opacity:1}}else if(d.transition=="fade"){a["css"]={display:"block",opacity:0};a["anim"]={opacity:1}}else{a["css"]={height:1,width:1,display:"block",opacity:0};a["anim"]={height:d.blockSize.height,width:d.blockSize.width,opacity:1}}e.css(a["css"]).animate(a["anim"],d.animationSpeed,function(){if(c+1==i){b.methods.changeImage(g,h)}})},c*d.betweenBlockDelay)})}return false},changeImage:function(a,b){a.css({zIndex:0,display:"none"});b.css({zIndex:3,display:"block"});s.fadeOut(d.animationSpeed*1/3,function(){p=false})},fyrandomize:function(b){var c=b.length,d=a(b);if(c==0)return false;while(--c){var e=Math.floor(Math.random()*(c+1)),f=d[c],g=d[e];d[c]=g;d[e]=f}return d},kcubit:function(b){var c=b.length,e=a(b),f=0,k=Math.ceil(h/d.blockSize.height),l=Math.ceil(g/d.blockSize.width),m=i/l,n=i/k,o=0,p=0,q=0,r=0,s=false,t=false;if(c==0)return false;for(q=0;q<c;q++){e[q]=b[f];if(f%n==0&&i-q>n||(p+1)%m==0){f-=(n-1)*p-1;p=0;o++;t=false;if(r>0){p=r;f+=(n-1)*p}}else{f+=n-1;p++}if(o%(n-1)==0&&o!=0&&r==0||s==true&&t==false){o=.1;r++;s=true;t=true}}return e}};b.methods.init()})}})(jQuery);(function(a){a.fn.aviaSlider_preloadhelper=function(b){var c={fadeInSpeed:800,delay:0,callback:""};var d=a.extend(c,b);return this.each(function(){var b=jQuery(this),c=b.find("img").css({opacity:0,visibility:"hidden",display:"block"}),e=c.length,f=[];b.operations={preload:function(){var d=true;c.each(function(c,d){var e=new Image,f=a(this);e.src=this.src;if(!e.complete){a(e).bind("error load",{currentImage:f},b.operations.showImage)}else{b.operations.showImage(f)}});return this},showImage:function(b){e--;if(b.data.currentImage!=undefined){b=b.data.currentImage}if(d.delay<=0)b.css("visibility","visible").animate({opacity:1},d.fadeInSpeed);if(e==0){if(d.delay>0){c.each(function(b,c){var e=a(this);setTimeout(function(){e.css("visibility","visible").animate({opacity:1},d.fadeInSpeed,function(){a(this).parent().removeClass("preloading")})},d.delay*(b+1))});if(d.callback!=""){setTimeout(d.callback,d.delay*c.length)}}else if(d.callback!=""){d.callback()}}}};b.operations.preload()})}})(jQuery);(function(a){function d(a){a=a.replace(/left|top/g,"0px");a=a.replace(/right|bottom/g,"100%");a=a.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");var b=a.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);return[parseFloat(b[1],10),b[2],parseFloat(b[3],10),b[4]]}if(!document.defaultView||!document.defaultView.getComputedStyle){var b=jQuery.curCSS;jQuery.curCSS=function(a,c,d){if(c==="background-position"){c="backgroundPosition"}if(c!=="backgroundPosition"||!a.currentStyle||a.currentStyle[c]){return b.apply(this,arguments)}var e=a.style;if(!d&&e&&e[c]){return e[c]}return b(a,"backgroundPositionX",d)+" "+b(a,"backgroundPositionY",d)}}var c=a.fn.animate;a.fn.animate=function(a){if("background-position"in a){a.backgroundPosition=a["background-position"];delete a["background-position"]}if("backgroundPosition"in a){a.backgroundPosition="("+a.backgroundPosition}return c.apply(this,arguments)};a.fx.step.backgroundPosition=function(b){if(!b.bgPosReady){var c=a.curCSS(b.elem,"backgroundPosition");if(!c){c="0px 0px"}c=d(c);b.start=[c[0],c[2]];var e=d(b.options.curAnim.backgroundPosition);b.end=[e[0],e[2]];b.unit=[e[1],e[3]];b.bgPosReady=true}var f=[];f[0]=(b.end[0]-b.start[0])*b.pos+b.start[0]+b.unit[0];f[1]=(b.end[1]-b.start[1])*b.pos+b.start[1]+b.unit[1];b.elem.style.backgroundPosition=f[0]+" "+f[1]}})(jQuery);var b=navigator.userAgent.indexOf("MSIE 6")>=0?true:false;var c=navigator.userAgent.indexOf("MSIE 7")>=0?true:false;if(b){a(function(){a("<div>").css({position:"absolute",top:"0px",left:"0px",backgroundColor:"black",opacity:"0.75",width:"100%",height:a(window).height(),zIndex:5e3}).appendTo("body");a("<div><p><br /><strong>Désolé, cette page ne fonctionne pas sur Internet Explorer 6 or 7.</strong><br /><br />Si vous voulez voir ce site : <a href='http://getfirefox.org'>mettez à jour votre navigateur</a>.</p>").css({backgroundColor:"white",top:"50%",left:"50%",marginLeft:-210,marginTop:-100,width:410,paddingRight:10,height:200,position:"absolute",zIndex:6e3}).appendTo("body")})}if(c){a(function(){a("<div>").css({position:"absolute",top:"0px",left:"0px",backgroundColor:"black",opacity:"0.75",width:"100%",height:a(window).height(),zIndex:5e3}).appendTo("body");a("<div><p><br /><strong>Désolé, cette page ne fonctionne pas sur Internet Explorer 6 or 7.</strong><br /><br />Si vous voulez voir ce site : <a href='http://getfirefox.org'>mettez à jour votre navigateur</a>.</p>").css({backgroundColor:"white",top:"50%",left:"50%",marginLeft:-210,marginTop:-100,width:410,paddingRight:10,height:200,position:"absolute",zIndex:6e3}).appendTo("body")})}(function(a){var b=a.event,c;b.special.smartresize={setup:function(){a(this).bind("resize",b.special.smartresize.handler)},teardown:function(){a(this).unbind("resize",b.special.smartresize.handler)},handler:function(a,b){var d=this,e=arguments;a.type="smartresize";c&&clearTimeout(c);c=setTimeout(function(){jQuery.event.handle.apply(d,e)},b==="execAsap"?0:100)}};a.fn.smartresize=function(a){return a?this.bind("smartresize",a):this.trigger("smartresize",["execAsap"])};a.fn.masonry=function(b,c){var d={getBricks:function(a,b,c){var d=c.itemSelector===undefined;b.$bricks=c.appendedContent===undefined?d?a.children():a.find(c.itemSelector):d?c.appendedContent:c.appendedContent.filter(c.itemSelector)},placeBrick:function(b,c,d,f,g){c=Math.min.apply(Math,d);for(var h=c+b.outerHeight(true),i=d.length,j=i,k=f.colCount+1-i;i--;)if(d[i]==c)j=i;b.applyStyle({left:f.colW*j+f.posLeft,top:c},a.extend(true,{},g.animationOptions));for(i=0;i<k;i++)f.colY[j+i]=h},setup:function(a,b,c){d.getBricks(a,c,b);if(c.masoned)c.previousData=a.data("masonry");c.colW=b.columnWidth===undefined?c.masoned?c.previousData.colW:c.$bricks.outerWidth(true):b.columnWidth;c.colCount=Math.floor(a.width()/c.colW);c.colCount=Math.max(c.colCount,1)},arrange:function(b,f,h){var i;if(!h.masoned||f.appendedContent!==undefined)h.$bricks.css("position","absolute");if(h.masoned){h.posTop=h.previousData.posTop;h.posLeft=h.previousData.posLeft}else{b.css("position","relative");var j=a(document.createElement("div"));b.prepend(j);h.posTop=Math.round(j.position().top);h.posLeft=Math.round(j.position().left);j.remove()}if(h.masoned&&f.appendedContent!==undefined){h.colY=h.previousData.colY;for(i=h.previousData.colCount;i<h.colCount;i++)h.colY[i]=h.posTop}else{h.colY=[];for(i=h.colCount;i--;)h.colY.push(h.posTop)}a.fn.applyStyle=h.masoned&&f.animate?a.fn.animate:a.fn.css;f.singleMode?h.$bricks.each(function(){var b=a(this);d.placeBrick(b,h.colCount,h.colY,h,f)}):h.$bricks.each(function(){var b=a(this),c=Math.ceil(b.outerWidth(true)/h.colW);c=Math.min(c,h.colCount);if(c===1)d.placeBrick(b,h.colCount,h.colY,h,f);else{var j=h.colCount+1-c,k=[];for(i=0;i<j;i++){var l=h.colY.slice(i,i+c);k[i]=Math.max.apply(Math,l)}d.placeBrick(b,j,k,h,f)}});h.wallH=Math.max.apply(Math,h.colY);b.applyStyle({height:h.wallH-h.posTop},a.extend(true,[],f.animationOptions));h.masoned||setTimeout(function(){b.addClass("masoned")},1);c.call(h.$bricks);b.data("masonry",h)},resize:function(a,b,c){c.masoned=!!a.data("masonry");var e=a.data("masonry").colCount;d.setup(a,b,c);c.colCount!=e&&d.arrange(a,b,c)}};return this.each(function(){var f=a(this),h={};h.masoned=!!f.data("masonry");var i=h.masoned?f.data("masonry").options:{},k=a.extend({},a.fn.masonry.defaults,i,b),m=i.resizeable;h.options=k.saveOptions?k:i;c=c||function(){};d.getBricks(f,h,k);if(!h.$bricks.length)return this;d.setup(f,k,h);d.arrange(f,k,h);!m&&k.resizeable&&a(window).bind("smartresize.masonry",function(){d.resize(f,k,h)});m&&!k.resizeable&&a(window).unbind("smartresize.masonry")})};a.fn.masonry.defaults={singleMode:false,columnWidth:undefined,itemSelector:undefined,appendedContent:undefined,saveOptions:true,resizeable:true,animate:false,animationOptions:{}}})(jQuery)})(window.jQuery);window.log=function(){log.history=log.history||[];log.history.push(arguments);if(this.console){console.log(Array.prototype.slice.call(arguments))}};(function(a){var b=a.write;a.write=function(c){log("document.write(): ",arguments);if(/docwriteregexwhitelist/.test(c))b.apply(a,arguments)}})(document);(function(a){function o(a){if((new Date).getTime()<d+c)return;d=(new Date).getTime();var b=a.pageX,j=a.pageY;if(h==true){var k=window.orientation?(window.orientation+180)%360/90:2,l=a.accelerationIncludingGravity,m=k%2==0?-l.x:l.y,n=k%2==0?l.y:l.x;b=k>=2?m:-m;j=k>=2?n:-n;b=(b+1)/2;j=(j+1)/2;if(b<0){b=0}else if(b>i){b=i}if(j<0){j=0}else if(b>i){j=i}}var o=b/(h==true?i:f),p=j/(h==true?i:g),q,k;for(k=e.length;k--;){q=e[k];if(q.invert!=true){q.obj.css("left",q.startX+q.xRange*o).css("top",q.startY+q.yRange*p)}else{q.obj.css("left",q.startX-q.xRange*o).css("top",q.startY-q.yRange*p)}}}function n(b){if((new Date).getTime()<d+c)return;if(m()){var e=b.accelerationIncludingGravity,f=e.x,g=e.y;if(l.xArray.length>=5){l.xArray.shift()}if(l.yArray.length>=5){l.yArray.shift()}l.xArray.push(f);l.yArray.push(g);l.xMotion=Math.round((getMax(l.xArray)-getMin(l.xArray))*1e3)/1e3;l.yMotion=Math.round((getMax(l.yArray)-getMin(l.yArray))*1e3)/1e3;if(l.xMotion>1.5||l.yMotion>1.5){if(i!=10){i=10}}if(l.xMotion>j||l.yMotion>j){k++}else{k=0}if(k>=5){h=true;a(document).unbind("mousemove.plax");a(window).bind("devicemotion",o(b))}else{h=false;a(window).unbind("devicemotion");a(document).bind("mousemove.plax",function(a){o(a)})}}}function m(){return window.DeviceMotionEvent!=undefined}var b=25,c=1/b*1e3,d=(new Date).getTime(),e=[],f=a(window).width(),g=a(window).height(),h=false,i=1,j=.05,k=0,l={xArray:[0,0,0,0,0],yArray:[0,0,0,0,0],xMotion:0,yMotion:0};a(window).resize(function(){f=a(window).width();g=a(window).height()});a.fn.plaxify=function(b){return this.each(function(){var c={xRange:0,yRange:0,invert:false};for(var d in b){if(c[d]==0){c[d]=b[d]}}c.obj=a(this);c.startX=this.offsetLeft;c.startY=this.offsetTop;if(c.invert==false){c.startX-=Math.floor(c.xRange/2);c.startY-=Math.floor(c.yRange/2)}else{c.startX+=Math.floor(c.xRange/2);c.startY+=Math.floor(c.yRange/2)}e.push(c)})};getMin=function(a){return Math.min.apply({},a)};getMax=function(a){return Math.max.apply({},a)};a.plax={enable:function(){a(document).bind("mousemove.plax",function(a){o(a)});if(m()){window.ondevicemotion=function(a){n(a)}}},disable:function(){a(document).unbind("mousemove.plax");window.ondevicemotion=undefined}};if(typeof ender!=="undefined"){a.ender(a.fn,true)}})(function(){return typeof jQuery!=="undefined"?jQuery:ender}())
