(function(e){function t(){var e=location.href;return hashtag=-1!==e.indexof("#prettyphoto")?decodeuri(e.substring(e.indexof("#prettyphoto")+1,e.length)):!1}function n(e,t){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n=regexp("[\\?&]"+e+"=([^&#]*)").exec(t);return null==n?"":n[1]}e.prettyphoto={version:"3.1.5"};e.fn.prettyphoto=function(r){function i(){e(".pp_loadericon").hide();projectedtop=scroll_pos.scrolltop+(s/2-m.containerheight/2);0>projectedtop&&(projectedtop=0);$ppt.fadeto(settings.animation_speed,1);$pp_pic_holder.find(".pp_content").animate({height:m.contentheight,width:m.contentwidth},settings.animation_speed);$pp_pic_holder.animate({top:projectedtop,left:0>x/2-m.containerwidth/2?0:x/2-m.containerwidth/2,width:m.containerwidth},settings.animation_speed,function(){$pp_pic_holder.find(".pp_hovercontainer,#fullresimage").height(m.height).width(m.width);$pp_pic_holder.find(".pp_fade").fadein(settings.animation_speed);isset&&"image"==f(pp_images[set_position])?$pp_pic_holder.find(".pp_hovercontainer").show():$pp_pic_holder.find(".pp_hovercontainer").hide();settings.allow_expand&&(m.resized?e("a.pp_expand,a.pp_contract").show():e("a.pp_expand").hide());settings.autoplay_slideshow&&!t&&!g&&e.prettyphoto.startslideshow();settings.changepicturecallback();g=!0});isset&&settings.overlay_gallery&&"image"==f(pp_images[set_position])?(itemwidth=57,navwidth="facebook"==settings.theme||"pp_default"==settings.theme?50:30,itemsperpage=math.floor((m.containerwidth-100-navwidth)/itemwidth),itemsperpage=itemsperpagex||w>s)&&doresize&&settings.allow_resize&&!d){resized=!0;for(fitting=!1;!fitting;)e>x?(imagewidth=x-30,imageheight=t/e*imagewidth):w>s?(imageheight=s-100,imagewidth=e/t*imageheight):fitting=!0,w=imageheight,e=imagewidth;(e>x||w>s)&&o(e,w);u(imagewidth,imageheight)}return{width:math.floor(imagewidth),height:math.floor(imageheight),containerheight:math.floor(w),containerwidth:math.floor(e)+2*settings.horizontal_padding,contentheight:math.floor(y),contentwidth:math.floor(b),resized:resized}}function u(t,n){t=parsefloat(t);n=parsefloat(n);$pp_details=$pp_pic_holder.find(".pp_details");$pp_details.width(t);detailsheight=parsefloat($pp_details.css("margintop"))+parsefloat($pp_details.css("marginbottom"));$pp_details=$pp_details.clone().addclass(settings.theme).width(t).appendto(e("body")).css({position:"absolute",top:-1e4});detailsheight+=$pp_details.height();detailsheight=34>=detailsheight?36:detailsheight;$pp_details.remove();$pp_title=$pp_pic_holder.find(".ppt");$pp_title.width(t);titleheight=parsefloat($pp_title.css("margintop"))+parsefloat($pp_title.css("marginbottom"));$pp_title=$pp_title.clone().appendto(e("body")).css({position:"absolute",top:-1e4});titleheight+=$pp_title.height();$pp_title.remove();y=n+detailsheight;b=t;w=y+titleheight+$pp_pic_holder.find(".pp_top").height()+$pp_pic_holder.find(".pp_bottom").height();e=t}function f(e){return e.match(/youtube\.com\/watch/i)||e.match(/youtu\.be/i)?"youtube":e.match(/vimeo\.com/i)?"vimeo":e.match(/\b.mov\b/i)?"quicktime":e.match(/\b.swf\b/i)?"flash":e.match(/\biframe=true\b/i)?"iframe":e.match(/\bajax=true\b/i)?"ajax":e.match(/\bcustom=true\b/i)?"custom":"#"==e.substr(0,1)?"inline":"image"}function l(){doresize&&"undefined"!=typeof $pp_pic_holder&&(scroll_pos=c(),contentheight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width(),projectedtop=s/2+scroll_pos.scrolltop-contentheight/2,0>projectedtop&&(projectedtop=0),contentheight>s||$pp_pic_holder.css({top:projectedtop,left:x/2+scroll_pos.scrollleft-contentwidth/2}))}function c(){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 h(){settings.social_tools&&(facebook_like_link=settings.social_tools.replace("{location_href}",encodeuricomponent(location.href)));settings.markup=settings.markup.replace("{pp_social}","");e("body").append(settings.markup);$pp_pic_holder=e(".pp_pic_holder");$ppt=e(".ppt");$pp_overlay=e("div.pp_overlay");if(isset&&settings.overlay_gallery){currentgallerypage=0;toinject="";for(var t=0;t";toinject=settings.gallery_markup.replace(/{gallery}/g,toinject);$pp_pic_holder.find("#pp_full_res").after(toinject);$pp_gallery=e(".pp_pic_holder .pp_gallery");$pp_gallery_li=$pp_gallery.find("li");$pp_gallery.find(".pp_arrow_next").click(function(){e.prettyphoto.changegallerypage("next");e.prettyphoto.stopslideshow();return!1});$pp_gallery.find(".pp_arrow_previous").click(function(){e.prettyphoto.changegallerypage("previous");e.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(t){e(this).find("a").click(function(){e.prettyphoto.changepage(t);e.prettyphoto.stopslideshow();return!1})})}settings.slideshow&&($pp_pic_holder.find(".pp_nav").prepend('play'),$pp_pic_holder.find(".pp_nav .pp_play").click(function(){e.prettyphoto.startslideshow();return!1}));$pp_pic_holder.attr("class","pp_pic_holder "+settings.theme);$pp_overlay.css({opacity:0.8,height:e(document).height(),width:e(window).width()}).bind("click",function(){settings.modal||e.prettyphoto.close()});e("a.pp_close").bind("click",function(){e.prettyphoto.close();return!1});settings.allow_expand&&e("a.pp_expand").bind("click",function(){e(this).hasclass("pp_expand")?(e(this).removeclass("pp_expand").addclass("pp_contract"),doresize=!1):(e(this).removeclass("pp_contract").addclass("pp_expand"),doresize=!0);s(function(){e.prettyphoto.open()});return!1});$pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click",function(){e.prettyphoto.changepage("previous");e.prettyphoto.stopslideshow();return!1});$pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click",function(){e.prettyphoto.changepage("next");e.prettyphoto.stopslideshow();return!1});l()}r=jquery.extend({hook:"rel",animation_speed:"fast",hd:!0,ajaxcallback:function(){},slideshow:5e3,autoplay_slideshow:!1,opacity:.8,show_title:!0,allow_resize:!0,allow_expand:!0,default_width:600,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:''},r);var p=this,d=!1,m,g,y,b,w,e,s=e(window).height(),x=e(window).width(),t;current_as_setting=r.autoplay_slideshow;current_og_setting=r.overlay_gallery;doresize=!0;scroll_pos=c();e(window).unbind("resize.prettyphoto").bind("resize.prettyphoto",function(){l();s=e(window).height();x=e(window).width();"undefined"!=typeof $pp_overlay&&$pp_overlay.height(e(document).height()).width(x)});r.keyboard_shortcuts&&e(document).unbind("keydown.prettyphoto").bind("keydown.prettyphoto",function(t){if("undefined"!=typeof $pp_pic_holder&&$pp_pic_holder.is(":visible"))switch(t.keycode){case 37:e.prettyphoto.changepage("previous");t.preventdefault();break;case 39:e.prettyphoto.changepage("next");t.preventdefault();break;case 27:settings.modal||e.prettyphoto.close(),t.preventdefault()}});e.prettyphoto.initialize=function(){settings=r;"pp_default"==settings.theme&&(settings.horizontal_padding=16);therel=e(this).attr(settings.hook);galleryregexp=/\[(?:.*)\]/;pp_images=(isset=galleryregexp.exec(therel)?!0:!1)?jquery.map(p,function(t){if(-1!=e(t).attr(settings.hook).indexof(therel))return e(t).attr("href")}):e.makearray(e(this).attr("href"));pp_titles=isset?jquery.map(p,function(t){if(-1!=e(t).attr(settings.hook).indexof(therel))return e(t).find("img").attr("alt")?e(t).find("img").attr("alt"):""}):e.makearray(e(this).find("img").attr("alt"));pp_descriptions=isset?jquery.map(p,function(t){if(-1!=e(t).attr(settings.hook).indexof(therel))return e(t).attr("title")?e(t).attr("title"):""}):e.makearray(e(this).attr("title"));pp_images.length>settings.overlay_gallery_max&&(settings.overlay_gallery=!1);1==pp_images.length?(settings.autoplay_slideshow=!1,settings.overlay_gallery=!1,e(".pp_previous, .pp_next").remove()):(settings.autoplay_slideshow=current_as_setting,settings.overlay_gallery=current_og_setting);set_position=jquery.inarray(e(this).attr("href"),pp_images);rel_index=isset?set_position:e("a["+settings.hook+"^='"+therel+"']").index(e(this));h(this);settings.allow_resize&&e(window).bind("scroll.prettyphoto",function(){l()});e.prettyphoto.open();1==pp_images.length&&e(".pp_previous, .pp_next").remove();!1===r.show_desc&&e(".pp_description").remove();return!1};e.prettyphoto.open=function(t,s,u,l){"undefined"==typeof settings&&(settings=r,pp_images=e.makearray(t),pp_titles=s?e.makearray(s):e.makearray(""),pp_descriptions=u?e.makearray(u):e.makearray(""),isset=1').css({width:settings.default_width}).wrapinner('
').appendto(e("body")).show(),doresize=!1,m=o(e(myclone).width(),e(myclone).height()),doresize=!0,e(myclone).remove(),toinject=settings.inline_markup.replace(/{content}/g,e(pp_images[set_position]).html())}!imgpreloader&&!skipinjection&&($pp_pic_holder.find("#pp_full_res")[0].innerhtml=toinject,i())});t=f(pp_images[set_position]);"youtube"==t||"vimeo"==t||"quicktime"==t||"flash"==t?e(".pp_gallery").hide():e(".pp_content").hover(function(){e(".pp_gallery:not(.disabled)").fadein()},function(){e(".pp_gallery:not(.disabled)").fadeout()});return!1};e.prettyphoto.changepage=function(t){currentgallerypage=0;"previous"==t?(set_position--,0>set_position&&(set_position=e(pp_images).size()-1)):"next"==t?(set_position++,set_position>e(pp_images).size()-1&&(set_position=0)):set_position=t;rel_index=set_position;doresize||(doresize=!0);settings.allow_expand&&e(".pp_contract").removeclass("pp_contract").addclass("pp_expand");s(function(){e.prettyphoto.open()})};e.prettyphoto.changegallerypage=function(e){"next"==e?(currentgallerypage++,currentgallerypage>totalpage&&(currentgallerypage=0)):"previous"==e?(currentgallerypage--,0>currentgallerypage&&(currentgallerypage=totalpage)):currentgallerypage=e;slide_speed="next"==e||"previous"==e?settings.animation_speed:0;slide_to=currentgallerypage*itemsperpage*itemwidth;$pp_gallery.find("ul").animate({left:-slide_to},slide_speed)};e.prettyphoto.startslideshow=function(){"undefined"==typeof t?($pp_pic_holder.find(".pp_play").unbind("click").removeclass("pp_play").addclass("pp_pause").click(function(){e.prettyphoto.stopslideshow();return!1}),t=setinterval(e.prettyphoto.startslideshow,settings.slideshow)):e.prettyphoto.changepage("next")};e.prettyphoto.stopslideshow=function(){$pp_pic_holder.find(".pp_pause").unbind("click").removeclass("pp_pause").addclass("pp_play").click(function(){e.prettyphoto.startslideshow();return!1});clearinterval(t);t=void 0};e.prettyphoto.close=function(){$pp_overlay.is(":animated")||(e.prettyphoto.stopslideshow(),$pp_pic_holder.stop().find("object,embed").css("visibility","hidden"),e("div.pp_pic_holder,div.ppt,.pp_fade").fadeout(settings.animation_speed,function(){e(this).remove()}),$pp_overlay.fadeout(settings.animation_speed,function(){settings.hideflash&&e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","visible");e(this).remove();e(window).unbind("scroll.prettyphoto");-1!==location.href.indexof("#prettyphoto")&&(location.hash="prettyphoto");settings.callback();doresize=!0;g=!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(){e("a["+r.hook+"^='"+hashrel+"']:eq("+hashindex+")").trigger("click")},50));return this.unbind("click.prettyphoto").bind("click.prettyphoto",e.prettyphoto.initialize)}})(jquery);var pp_alreadyinitialized=!1;