/* ------------------------------------------------------------------------ class: prettyphoto use: lightbox clone for jquery author: stephane caron (http://www.no-margin-for-errors.com) version: 3.1.6 ------------------------------------------------------------------------- */ !function(e){function t(){var e=location.href;return hashtag=-1!==e.indexof("#prettyphoto")?decodeuri(e.substring(e.indexof("#prettyphoto")+1,e.length)):!1,hashtag&&(hashtag=hashtag.replace(/<|>/g,"")),hashtag}function i(){"undefined"!=typeof therel&&(location.hash=therel+"/"+rel_index+"/")}function p(){-1!==location.href.indexof("#prettyphoto")&&(location.hash="prettyphoto")}function o(e,t){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i="[\\?&]"+e+"=([^&#]*)",p=new regexp(i),o=p.exec(t);return null==o?"":o[1]}e.prettyphoto={version:"3.1.6"},e.fn.prettyphoto=function(a){function s(){e(".pp_loadericon").hide(),projectedtop=scroll_pos.scrolltop+(i/2-f.containerheight/2),projectedtop<0&&(projectedtop=0),$ppt.fadeto(settings.animation_speed,1),$pp_pic_holder.find(".pp_content").animate({height:f.contentheight,width:f.contentwidth},settings.animation_speed),$pp_pic_holder.animate({top:projectedtop,left:j/2-f.containerwidth/2<0?0:j/2-f.containerwidth/2,width:f.containerwidth},settings.animation_speed,function(){$pp_pic_holder.find(".pp_hovercontainer,#fullresimage").height(f.height).width(f.width),$pp_pic_holder.find(".pp_fade").fadein(settings.animation_speed),isset&&"image"==h(pp_images[set_position])?$pp_pic_holder.find(".pp_hovercontainer").show():$pp_pic_holder.find(".pp_hovercontainer").hide(),settings.allow_expand&&(f.resized?e("a.pp_expand,a.pp_contract").show():e("a.pp_expand").hide()),!settings.autoplay_slideshow||p||v||e.prettyphoto.startslideshow(),settings.changepicturecallback(),v=!0}),m(),a.ajaxcallback()}function n(t){$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(){e(".pp_loadericon").show(),t()})}function r(t){t>1?e(".pp_nav").show():e(".pp_nav").hide()}function l(e,t){if(resized=!1,d(e,t),imagewidth=e,imageheight=t,(k>j||b>i)&&doresize&&settings.allow_resize&&!$){for(resized=!0,fitting=!1;!fitting;)k>j?(imagewidth=j-200,imageheight=t/e*imagewidth):b>i?(imageheight=i-200,imagewidth=e/t*imageheight):fitting=!0,b=imageheight,k=imagewidth;(k>j||b>i)&&l(k,b),d(imagewidth,imageheight)}return{width:math.floor(imagewidth),height:math.floor(imageheight),containerheight:math.floor(b),containerwidth:math.floor(k)+2*settings.horizontal_padding,contentheight:math.floor(y),contentwidth:math.floor(w),resized:resized}}function d(t,i){t=parsefloat(t),i=parsefloat(i),$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=detailsheight<=34?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=i+detailsheight,w=t,b=y+titleheight+$pp_pic_holder.find(".pp_top").height()+$pp_pic_holder.find(".pp_bottom").height(),k=t}function h(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 c(){if(doresize&&"undefined"!=typeof $pp_pic_holder){if(scroll_pos=_(),contentheight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width(),projectedtop=i/2+scroll_pos.scrolltop-contentheight/2,projectedtop<0&&(projectedtop=0),contentheight>i)return;$pp_pic_holder.css({top:projectedtop,left:j/2+scroll_pos.scrollleft-contentwidth/2})}}function _(){return self.pageyoffset?{scrolltop:self.pageyoffset,scrollleft:self.pagexoffset}:document.documentelement&&document.documentelement.scrolltop?{scrolltop:document.documentelement.scrolltop,scrollleft:document.documentelement.scrollleft}:document.body?{scrolltop:document.body.scrolltop,scrollleft:document.body.scrollleft}:void 0}function g(){i=e(window).height(),j=e(window).width(),"undefined"!=typeof $pp_overlay&&$pp_overlay.height(e(document).height()).width(j)}function m(){isset&&settings.overlay_gallery&&"image"==h(pp_images[set_position])?(itemwidth=57,navwidth="facebook"==settings.theme||"pp_default"==settings.theme?50:30,itemsperpage=math.floor((f.containerwidth-100-navwidth)/itemwidth),itemsperpage=itemsperpage";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(){return e.prettyphoto.changegallerypage("next"),e.prettyphoto.stopslideshow(),!1}),$pp_gallery.find(".pp_arrow_previous").click(function(){return e.prettyphoto.changegallerypage("previous"),e.prettyphoto.stopslideshow(),!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(){return e.prettyphoto.changepage(t),e.prettyphoto.stopslideshow(),!1})})}settings.slideshow&&($pp_pic_holder.find(".pp_nav").prepend('play'),$pp_pic_holder.find(".pp_nav .pp_play").click(function(){return e.prettyphoto.startslideshow(),!1})),$pp_pic_holder.attr("class","pp_pic_holder "+settings.theme),$pp_overlay.css({opacity:0,height:e(document).height(),width:e(window).width()}).bind("click",function(){settings.modal||e.prettyphoto.close()}),e("a.pp_close").bind("click",function(){return e.prettyphoto.close(),!1}),settings.allow_expand&&e("a.pp_expand").bind("click",function(){return 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),n(function(){e.prettyphoto.open()}),!1}),$pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click",function(){return e.prettyphoto.changepage("previous"),e.prettyphoto.stopslideshow(),!1}),$pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click",function(){return e.prettyphoto.changepage("next"),e.prettyphoto.stopslideshow(),!1}),c()}a=jquery.extend({hook:"rel",animation_speed:"fast",ajaxcallback:function(){},slideshow:5e3,autoplay_slideshow:!1,opacity:.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:'
'},a);var f,v,y,w,b,k,p,x=this,$=!1,i=e(window).height(),j=e(window).width();return doresize=!0,scroll_pos=_(),e(window).unbind("resize.prettyphoto").bind("resize.prettyphoto",function(){c(),g()}),a.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(){return settings=a,"pp_default"==settings.theme&&(settings.horizontal_padding=16),therel=e(this).attr(settings.hook),galleryregexp=/\[(?:.*)\]/,isset=galleryregexp.exec(therel)?!0:!1,pp_images=isset?jquery.map(x,function(t){return-1!=e(t).attr(settings.hook).indexof(therel)?e(t).attr("href"):void 0}):e.makearray(e(this).attr("href")),pp_titles=isset?jquery.map(x,function(t){return-1!=e(t).attr(settings.hook).indexof(therel)?e(t).find("img").attr("alt")?e(t).find("img").attr("alt"):"":void 0}):e.makearray(e(this).find("img").attr("alt")),pp_descriptions=isset?jquery.map(x,function(t){return-1!=e(t).attr(settings.hook).indexof(therel)?e(t).attr("title")?e(t).attr("title"):"":void 0}):e.makearray(e(this).attr("title")),pp_images.length>settings.overlay_gallery_max&&(settings.overlay_gallery=!1),set_position=jquery.inarray(e(this).attr("href"),pp_images),rel_index=isset?set_position:e("a["+settings.hook+"^='"+therel+"']").index(e(this)),u(this),settings.allow_resize&&e(window).bind("scroll.prettyphoto",function(){c()}),e.prettyphoto.open(),!1},e.prettyphoto.open=function(t){return"undefined"==typeof settings&&(settings=a,pp_images=e.makearray(arguments[0]),pp_titles=e.makearray(arguments[1]?arguments[1]:""),pp_descriptions=e.makearray(arguments[2]?arguments[2]:""),isset=pp_images.length>1?!0:!1,set_position=arguments[3]?arguments[3]:0,u(t.target)),settings.hideflash&&e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","hidden"),r(e(pp_images).size()),e(".pp_loadericon").show(),settings.deeplinking&&i(),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)),$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+e(pp_images).size()),"undefined"!=typeof pp_descriptions[set_position]&&""!=pp_descriptions[set_position]?$pp_pic_holder.find(".pp_description").show().html(unescape(pp_descriptions[set_position])):$pp_pic_holder.find(".pp_description").hide(),movie_width=parsefloat(o("width",pp_images[set_position]))?o("width",pp_images[set_position]):settings.default_width.tostring(),movie_height=parsefloat(o("height",pp_images[set_position]))?o("height",pp_images[set_position]):settings.default_height.tostring(),$=!1,-1!=movie_height.indexof("%")&&(movie_height=parsefloat(e(window).height()*parsefloat(movie_height)/100-150),$=!0),-1!=movie_width.indexof("%")&&(movie_width=parsefloat(e(window).width()*parsefloat(movie_width)/100-150),$=!0),$pp_pic_holder.fadein(function(){switch($ppt.html(settings.show_title&&""!=pp_titles[set_position]&&"undefined"!=typeof pp_titles[set_position]?unescape(pp_titles[set_position]):" "),imgpreloader="",skipinjection=!1,h(pp_images[set_position])){case"image":imgpreloader=new image,nextimage=new image,isset&&set_position0&&(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,movie+=o("rel",pp_images[set_position])?"?rel="+o("rel",pp_images[set_position]):"?rel=1",settings.autoplay&&(movie+="&autoplay=1"),toinject=settings.iframe_markup.replace(/{width}/g,f.width).replace(/{height}/g,f.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case"vimeo":f=l(movie_width,movie_height),movie_id=pp_images[set_position];var t=/http(s?):\/\/(www\.)?vimeo.com\/(\d+)/,i=movie_id.match(t);movie="http://player.vimeo.com/video/"+i[3]+"?title=0&byline=0&portrait=0",settings.autoplay&&(movie+="&autoplay=1;"),vimeo_width=f.width+"/embed/?moog_width="+f.width,toinject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,f.height).replace(/{path}/g,movie);break;case"quicktime":f=l(movie_width,movie_height),f.height+=15,f.contentheight+=15,f.containerheight+=15,toinject=settings.quicktime_markup.replace(/{width}/g,f.width).replace(/{height}/g,f.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case"flash":f=l(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,f.width).replace(/{height}/g,f.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+"?"+flash_vars);break;case"iframe":f=l(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,f.width).replace(/{height}/g,f.height).replace(/{path}/g,frame_url);break;case"ajax":doresize=!1,f=l(movie_width,movie_height),doresize=!0,skipinjection=!0,e.get(pp_images[set_position],function(e){toinject=settings.inline_markup.replace(/{content}/g,e),$pp_pic_holder.find("#pp_full_res")[0].innerhtml=toinject,s()});break;case"custom":f=l(movie_width,movie_height),toinject=settings.custom_markup;break;case"inline":myclone=e(pp_images[set_position]).clone().append('
').css({width:settings.default_width}).wrapinner('
').appendto(e("body")).show(),doresize=!1,f=l(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,s())}),!1},e.prettyphoto.changepage=function(t){currentgallerypage=0,"previous"==t?(set_position--,set_position<0&&(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"),n(function(){e.prettyphoto.open()})},e.prettyphoto.changegallerypage=function(e){"next"==e?(currentgallerypage++,currentgallerypage>totalpage&&(currentgallerypage=0)):"previous"==e?(currentgallerypage--,currentgallerypage<0&&(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 p?($pp_pic_holder.find(".pp_play").unbind("click").removeclass("pp_play").addclass("pp_pause").click(function(){return e.prettyphoto.stopslideshow(),!1}),p=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(){return e.prettyphoto.startslideshow(),!1}),clearinterval(p),p=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"),p(),settings.callback(),doresize=!0,v=!1,delete settings}))},!pp_alreadyinitialized&&t()&&(pp_alreadyinitialized=!0,hashindex=t(),hashrel=hashindex,hashindex=hashindex.substring(hashindex.indexof("/")+1,hashindex.length-1),hashrel=hashrel.substring(0,hashrel.indexof("/")),settimeout(function(){e("a["+a.hook+"^='"+hashrel+"']:eq("+hashindex+")").trigger("click")},50)),this.unbind("click.prettyphoto").bind("click.prettyphoto",e.prettyphoto.initialize)}}(jquery);var pp_alreadyinitialized=!1;