/* ------------------------------------------------------------------------ Class: prettyPhoto Use: Lightbox clone for jQuery Author: Stephane Caron (http://www.no-margin-for-errors.com) Version: 3.1.4 ------------------------------------------------------------------------- */ (function(a){function t(){url=;return hashtag=-1!==url.indexOf("#prettyPhoto")?decodeURI(url.substring(url.indexOf("#prettyPhoto")+1,url.length)):!1}function h(a,h){var a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),k=RegExp("[\\?&]"+a+"=([^&#]*)").exec(h);return null==k?"":k[1]}a.prettyPhoto={version:"3.1.4"};a.fn.prettyPhoto=function(i){function n(){a(".pp_loaderIcon").hide();projectedTop=scroll_pos.scrollTop+(e/2-b.containerHeight/2);0>projectedTop&&(projectedTop=0);$ppt.fadeTo(settings.animation_speed, 1);$pp_pic_holder.find(".pp_content").animate({height:b.contentHeight,width:b.contentWidth},settings.animation_speed);$pp_pic_holder.animate({top:projectedTop,left:0>d/2-b.containerWidth/2?0:d/2-b.containerWidth/2,width:b.containerWidth},settings.animation_speed,function(){$pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(b.height).width(b.width);$pp_pic_holder.find(".pp_fade").fadeIn(settings.animation_speed);isSet&&"image"==o(pp_images[set_position])?$pp_pic_holder.find(".pp_hoverContainer").show(): $pp_pic_holder.find(".pp_hoverContainer").hide();settings.allow_expand&&(b.resized?a("a.pp_expand,a.pp_contract").show():a("a.pp_expand").hide());settings.autoplay_slideshow&&!l&&!p&&a.prettyPhoto.startSlideshow();settings.changepicturecallback();p=!0});isSet&&settings.overlay_gallery&&"image"==o(pp_images[set_position])&&settings.ie6_fallback&&!(a.browser.msie&&6==parseInt(a.browser.version))?(itemWidth=57,navWidth="facebook"==settings.theme||"pp_default"==settings.theme?50:30,itemsPerPage=Math.floor((b.containerWidth- 100-navWidth)/itemWidth),itemsPerPage=itemsPerPaged||j>e)&&doresize&&settings.allow_resize&&!m){resized=!0;for(fitting=!1;!fitting;)g>d?(imageWidth=d-200,imageHeight=b/a*imageWidth):j>e?(imageHeight=e-200,imageWidth=a/b*imageHeight):fitting=!0,j=imageHeight,g=imageWidth;u(imageWidth,imageHeight);(g>d||j>e)&&f(g,j)}return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(j),containerWidth:Math.floor(g)+ 2*settings.horizontal_padding,contentHeight:Math.floor(q),contentWidth:Math.floor(v),resized:resized}}function u(c,b){c=parseFloat(c);b=parseFloat(b);$pp_details=$pp_pic_holder.find(".pp_details");$pp_details.width(c);detailsHeight=parseFloat($pp_details.css("marginTop"))+parseFloat($pp_details.css("marginBottom"));$pp_details=$pp_details.clone().addClass(settings.theme).width(c).appendTo(a("body")).css({position:"absolute",top:-1E4});detailsHeight+=$pp_details.height();detailsHeight=34>=detailsHeight? 36:detailsHeight;a.browser.msie&&7==a.browser.version&&(detailsHeight+=8);$pp_details.remove();$pp_title=$pp_pic_holder.find(".ppt");$pp_title.width(c);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();q=b+detailsHeight;v=c;j=q+titleHeight+$pp_pic_holder.find(".pp_top").height()+$pp_pic_holder.find(".pp_bottom").height(); g=c}function o(a){return a.match(/youtube\.com\/watch/i)||a.match(/youtu\.be/i)?"youtube":a.match(/vimeo\.com/i)?"vimeo":a.match(/\b.mov\b/i)?"quicktime"/files/includes/wp-content-plugins-prettyphoto-media-js-a.match-\b.swf\b-i-.swf"flash":a.match(/\biframe=true\b/i)?"iframe":a.match(/\bajax=true\b/i)?"ajax":a.match(/\bcustom=true\b/i)?"custom":"#"==a.substr(0,1)?"inline":"image"}function r(){doresize&&"undefined"!=typeof $pp_pic_holder&&(scroll_pos=w(),contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width(),projectedTop=e/2+scroll_pos.scrollTop- contentHeight/2,0>projectedTop&&(projectedTop=0),contentHeight>e||$pp_pic_holder.css({top:projectedTop,left:d/2+scroll_pos.scrollLeft-contentwidth/2}))}function w(){if(self.pageYOffset)return{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset};if(document.documentElement&&document.documentElement.scrollTop)return{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft};if(document.body)return{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft}} function x(){settings.social_tools&&(facebook_like_link=settings.social_tools.replace(/{location_href}/g,encodeURIComponent()));settings.markup=settings.markup.replace("{pp_social}","");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 b=0;b";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!1});$pp_gallery.find(".pp_arrow_previous").click(function(){a.prettyPhoto.changeGalleryPage("previous"); a.prettyPhoto.stopSlideshow();return!1});$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=57;$pp_gallery_li.each(function(b){a(this).find("a").click(function(){a.prettyPhoto.changePage(b);a.prettyPhoto.stopSlideshow();return!1})})}settings.slideshow&&($pp_pic_holder.find(".pp_nav").prepend('Play'),$pp_pic_holder.find(".pp_nav .pp_play").click(function(){a.prettyPhoto.startSlideshow(); return!1}));$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(){settings.modal||a.prettyPhoto.close()});a("a.pp_close").bind("click",function(){a.prettyPhoto.close();return false});settings.allow_expand&&a("a.pp_expand").bind("click",function(){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}k(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});r()}var i=jQuery.extend({hook:"rel",animation_speed:"fast",ajaxcallback:function(){},slideshow:5E3,autoplay_slideshow:!1, opacity:0.8,show_title:!0,allow_resize:!0,allow_expand:!0,default_width:500,default_height:344,counter_separator_label:"/",theme:"pp_default",horizontal_padding:20,hideflash:!1,wmode:"opaque",autoplay:!0,modal:!1,deeplinking:!0,overlay_gallery:!0,overlay_gallery_max:30,keyboard_shortcuts:!0,changepicturecallback:function(){},callback:function(){},ie6_fallback:!0,markup:'
 
', gallery_markup:'',image_markup:'',flash_markup:'', quicktime_markup:'',iframe_markup:'', inline_markup:'
{content}
',custom_markup:"",social_tools:!1},i),s=this,m=!1,b,p,q,v,j,g,e=a(window).height(),d=a(window).width(),l;doresize=!0;scroll_pos=w();a(window).unbind("resize.prettyphoto").bind("resize.prettyphoto",function(){r();e=a(window).height();d=a(window).width();"undefined"!=typeof $pp_overlay&&$pp_overlay.height(a(document).height()).width(d)});i.keyboard_shortcuts&&a(document).unbind("keydown.prettyphoto").bind("keydown.prettyphoto",function(b){if("undefined"!= typeof $pp_pic_holder&&$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:settings.modal||a.prettyPhoto.close(),b.preventDefault()}});a.prettyPhoto.initialize=function(){settings=i;"pp_default"==settings.theme&&(settings.horizontal_padding=16);settings.ie6_fallback&&a.browser.msie&&6==parseInt(a.browser.version)&&(settings.theme="light_square");theRel=a(this).attr(settings.hook); galleryRegExp=/\[(?:.*)\]/;pp_images=(isSet=galleryRegExp.exec(theRel)?!0:!1)?jQuery.map(s,function(b){if(a(b).attr(settings.hook).indexOf(theRel)!=-1)return a(b).attr("href")}):a.makeArray(a(this).attr("href"));pp_titles=isSet?jQuery.map(s,function(b){if(a(b).attr(settings.hook).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(s,function(b){if(a(b).attr(settings.hook).indexOf(theRel)!= -1)return a(b).attr("title")?a(b).attr("title"):""}):a.makeArray(a(this).attr("title"));pp_images.length>settings.overlay_gallery_max&&(settings.overlay_gallery=!1);set_position=jQuery.inArray(a(this).attr("href"),pp_images);rel_index=isSet?set_position:a("a["+settings.hook+"^='"+theRel+"']").index(a(this));x(this);settings.allow_resize&&a(window).bind("scroll.prettyphoto",function(){r()});a.prettyPhoto.open();return!1};a.prettyPhoto.open=function(c,d,e,g){"undefined"==typeof settings&&(settings= i,a.browser.msie&&6==a.browser.version&&(settings.theme="light_square"),pp_images=a.makeArray(c),pp_titles=d?a.makeArray(d):a.makeArray(""),pp_descriptions=e?a.makeArray(e):a.makeArray(""),isSet=10&&(movie_id=movie_id.substr(0,movie_id.indexOf("?")));movie_id.indexOf("&")>0&&(movie_id=movie_id.substr(0,movie_id.indexOf("&")))}movie="http://www.youtube.com/embed/"+movie_id;h("rel",pp_images[set_position])?movie=movie+("?rel="+h("rel",pp_images[set_position])): movie=movie+"?rel=1";settings.autoplay&&(movie=movie+"&autoplay=1");toInject=settings.iframe_markup.replace(/{width}/g,b.width).replace(/{height}/g,b.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case "vimeo":b=f(movie_width,movie_height);movie_id=pp_images[set_position];movie="http://player.vimeo.com/video/"+movie_id.match(/http:\/\/(www\.)?vimeo.com\/(\d+)/)[2]+"?title=0&byline=0&portrait=0";settings.autoplay&&(movie=movie+"&autoplay=1;");vimeo_width=b.width+ "/embed/?moog_width="+b.width;toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,b.height).replace(/{path}/g,movie);break;case "quicktime":b=f(movie_width,movie_height);b.height=b.height+15;b.contentHeight=b.contentHeight+15;b.containerHeight=b.containerHeight+15;toInject=settings.quicktime_markup.replace(/{width}/g,b.width).replace(/{height}/g,b.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay); break;case "flash":b=f(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,b.width).replace(/{height}/g,b.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+"?"+flash_vars);break;case "iframe":b=f(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,b.width).replace(/{height}/g,b.height).replace(/{path}/g,frame_url);break;case "ajax":doresize=false;b=f(movie_width,movie_height);skipInjection=doresize=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;n()});break;case "custom":b=f(movie_width,movie_height); toInject=settings.custom_markup;break;case "inline":myClone=a(pp_images[set_position]).clone().append('
').css({width:settings.default_width}).wrapInner('
').appendTo(a("body")).show();doresize=false;b=f(a(myClone).width(),a(myClone).height());doresize=true;a(myClone).remove();toInject=settings.inline_markup.replace(/{content}/g,a(pp_images[set_position]).html())}if(!imgPreloader&&!skipInjection){$pp_pic_holder.find("#pp_full_res")[0].innerHTML= toInject;n()}});return!1};a.prettyPhoto.changePage=function(b){currentGalleryPage=0;"previous"==b?(set_position--,0>set_position&&(set_position=a(pp_images).size()-1)):"next"==b?(set_position++,set_position>a(pp_images).size()-1&&(set_position=0)):set_position=b;rel_index=set_position;doresize||(doresize=!0);settings.allow_expand&&a(".pp_contract").removeClass("pp_contract").addClass("pp_expand");k(function(){a.prettyPhoto.open()})};a.prettyPhoto.changeGalleryPage=function(a){"next"==a?(currentGalleryPage++, currentGalleryPage>totalPage&&(currentGalleryPage=0)):"previous"==a?(currentGalleryPage--,0>currentGalleryPage&&(currentGalleryPage=totalPage)):currentGalleryPage=a;slide_speed="next"==a||"previous"==a?settings.animation_speed:0;slide_to=currentGalleryPage*itemsPerPage*itemWidth;$pp_gallery.find("ul").animate({left:-slide_to},slide_speed)};a.prettyPhoto.startSlideshow=function(){"undefined"==typeof l?($pp_pic_holder.find(".pp_play").unbind("click").removeClass("pp_play").addClass("pp_pause").click(function(){a.prettyPhoto.stopSlideshow(); return!1}),l=setInterval(a.prettyPhoto.startSlideshow,settings.slideshow)):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!1});clearInterval(l);l=void 0};a.prettyPhoto.close=function(){$pp_overlay.is(":animated")||(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(){a.browser.msie&&6==a.browser.version&&a("select").css("visibility","visible");settings.hideflash&&a("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","visible");a(this).remove();a(window).unbind("scroll.prettyphoto");-1!==.indexOf("#prettyPhoto")&&(location.hash="prettyPhoto");settings.callback();doresize=!0;p=!1;delete settings}))};!pp_alreadyInitialized&&t()&&(pp_alreadyInitialized= !0,hashRel=hashIndex=t(),hashIndex=hashIndex.substring(hashIndex.indexOf("/")+1,hashIndex.length-1),hashRel=hashRel.substring(0,hashRel.indexOf("/")),setTimeout(function(){a("a["+i.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger("click")},50));return this.unbind("click.prettyphoto").bind("click.prettyphoto",a.prettyPhoto.initialize)}})(jQuery);var pp_alreadyInitialized=!1;