﻿(function (e) { e.prettyPhoto = { version: "3.1.3" }; e.fn.prettyPhoto = function (h) { h = jQuery.extend({ use_container: false, use_container_left: false, specific_container: null, animation_speed: "fast", slideshow: 5000, autoplay_slideshow: false, opacity: 0.8, show_title: true, allow_resize: true, default_width: 500, default_height: 344, counter_separator_label: "/", theme: "pp_default", horizontal_padding: 0, hideflash: false, wmode: "opaque", autoplay: true, modal: false, deeplinking: false, overlay_gallery: true, keyboard_shortcuts: true, changepicturecallback: function () { }, callback: function () { }, ie6_fallback: true, markup: '<div class="pp_pic_holder"> 						<div class="ppt">&nbsp;</div> 						<div class="pp_top"> 							<div class="pp_left"></div> 							<div class="pp_middle"></div> 							<div class="pp_right"></div> 						</div> 						<div class="pp_content_container"> 							<div class="pp_left"> 							<div class="pp_right"> 								<div class="pp_content"> 									<div class="pp_loaderIcon"></div> 									<div class="pp_fade"> 										<a href="#" class="pp_expand" title="Expand the image">Expand</a> 										<div class="pp_hoverContainer"> 											<a class="pp_next" href="#">next</a> 											<a class="pp_previous" href="#">previous</a> 										</div> 										<div id="pp_full_res"></div> 										<div class="pp_details"> 											<div class="pp_nav"> 												<a href="#" class="pp_arrow_previous">Previous</a> 												<p class="currentTextHolder">0/0</p> 												<a href="#" class="pp_arrow_next">Next</a> 											</div> 											<p class="pp_description"></p> 											<div class="pp_social">{pp_social}</div> 											<a class="pp_close" href="#">Close</a> 										</div> 									</div> 								</div> 							</div> 							</div> 						</div> 						<div class="pp_bottom"> 							<div class="pp_left"></div> 							<div class="pp_middle"></div> 							<div class="pp_right"></div> 						</div> 					</div> 					<div class="pp_overlay"></div>', gallery_markup: '<div class="pp_gallery"> 								<a href="#" class="pp_arrow_previous">Previous</a> 								<div> 									<ul> 										{gallery} 									</ul> 								</div> 								<a href="#" class="pp_arrow_next">Next</a> 							</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: "", social_tools: '<div class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"><\/script></div><div class="facebook"><iframe src="http://www.facebook.com/plugins/like.php?locale=en_US&href={location_href}&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div>' }, h); var q = this, p = false, w, u, v, x, A, B, l = e(window).height(), E = e(window).width(), j = h.use_container, F = h.use_container_left, k = h.specific_container, m; doresize = true, scroll_pos = C(); e(window).unbind("resize.prettyphoto").bind("resize.prettyphoto", function () { t(); z(); }); if (h.keyboard_shortcuts) { e(document).unbind("keydown.prettyphoto").bind("keydown.prettyphoto", function (G) { if (typeof $pp_pic_holder != "undefined") { if ($pp_pic_holder.is(":visible")) { switch (G.keyCode) { case 37: e.prettyPhoto.changePage("previous"); G.preventDefault(); break; case 39: e.prettyPhoto.changePage("next"); G.preventDefault(); break; case 27: if (!settings.modal) { e.prettyPhoto.close(); } G.preventDefault(); break; } } } }); } e.prettyPhoto.initialize = function () { settings = h; if (settings.theme == "pp_default") { settings.horizontal_padding = 16; } if (settings.ie6_fallback && e.browser.msie && parseInt(e.browser.version) == 6) { settings.theme = "light_square"; } theRel = e(this).attr("rel"); galleryRegExp = /\[(?:.*)\]/; isSet = (galleryRegExp.exec(theRel)) ? true : false; pp_images = (isSet) ? jQuery.map(q, function (H, G) { if (e(H).attr("rel").indexOf(theRel) != -1) { return e(H).attr("href"); } }) : e.makeArray(e(this).attr("href")); pp_titles = (isSet) ? jQuery.map(q, function (H, G) { if (e(H).attr("rel").indexOf(theRel) != -1) { return (e(H).find("img").attr("alt")) ? e(H).find("img").attr("alt") : ""; } }) : e.makeArray(e(this).find("img").attr("alt")); pp_descriptions = (isSet) ? jQuery.map(q, function (H, G) { if (e(H).attr("rel").indexOf(theRel) != -1) { return (e(H).attr("title")) ? e(H).attr("title") : ""; } }) : e.makeArray(e(this).attr("title")); if (pp_images.length > 30) { settings.overlay_gallery = false; } set_position = jQuery.inArray(e(this).attr("href"), pp_images); rel_index = (isSet) ? set_position : e("a[rel^='" + theRel + "']").index(e(this)); i(this); if (settings.allow_resize) { e(window).bind("scroll.prettyphoto", function () { t(); }); } e.prettyPhoto.open(); return false; }; e.prettyPhoto.open = function (G) { if (typeof settings == "undefined") { settings = h; if (e.browser.msie && e.browser.version == 6) { settings.theme = "light_square"; } pp_images = e.makeArray(arguments[0]); pp_titles = (arguments[1]) ? e.makeArray(arguments[1]) : e.makeArray(""); pp_descriptions = (arguments[2]) ? e.makeArray(arguments[2]) : e.makeArray(""); isSet = (pp_images.length > 1) ? true : false; set_position = 0; i(G.target); } if (e.browser.msie && e.browser.version == 6) { e("select").css("visibility", "hidden"); } if (settings.hideflash) { e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility", "hidden"); } n(e(pp_images).size()); e(".pp_loaderIcon").show(); if (settings.deeplinking) { b(); } 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 + e(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(a("width", pp_images[set_position]))) ? a("width", pp_images[set_position]) : settings.default_width.toString(); movie_height = (parseFloat(a("height", pp_images[set_position]))) ? a("height", pp_images[set_position]) : settings.default_height.toString(); p = false; if (movie_height.indexOf("%") != -1) { movie_height = parseFloat((e(window).height() * parseFloat(movie_height) / 100) - 150); p = true; } if (movie_width.indexOf("%") != -1) { movie_width = parseFloat((e(window).width() * parseFloat(movie_width) / 100) - 150); p = 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("&nbsp;"); imgPreloader = ""; skipInjection = false; switch (D(pp_images[set_position])) { case "image": imgPreloader = new Image(); nextImage = new Image(); if (isSet && set_position < e(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 () { w = r(imgPreloader.width, imgPreloader.height); o(); }; imgPreloader.onerror = function () { alert("Image cannot be loaded. Make sure the path is correct and image exist."); e.prettyPhoto.close(); }; imgPreloader.src = pp_images[set_position]; break; case "youtube": w = r(movie_width, movie_height); movie_id = a("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; (a("rel", pp_images[set_position])) ? movie += "?rel=" + a("rel", pp_images[set_position]) : movie += "?rel=0&modestbranding=1&showinfo=0"; if (settings.autoplay) { movie += "&autoplay=1"; } toInject = settings.iframe_markup.replace(/{width}/g, w.width).replace(/{height}/g, w.height).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, movie); break; case "vimeo": w = r(movie_width, movie_height); movie_id = pp_images[set_position]; var I = /http:\/\/(www\.)?vimeo.com\/(\d+)/; var H = movie_id.match(I); movie = "http://player.vimeo.com/video/" + H[2] + "?title=0&amp;byline=0&amp;portrait=0"; if (settings.autoplay) { movie += "&autoplay=1;"; } vimeo_width = w.width + "/embed/?moog_width=" + w.width; toInject = settings.iframe_markup.replace(/{width}/g, vimeo_width).replace(/{height}/g, w.height).replace(/{path}/g, movie); break; case "quicktime": w = r(movie_width, movie_height); w.height += 15; w.contentHeight += 15; w.containerHeight += 15; toInject = settings.quicktime_markup.replace(/{width}/g, w.width).replace(/{height}/g, w.height).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, pp_images[set_position]).replace(/{autoplay}/g, settings.autoplay); break; case "flash": w = r(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, w.width).replace(/{height}/g, w.height).replace(/{wmode}/g, settings.wmode).replace(/{path}/g, filename + "?" + flash_vars); break; case "iframe": w = r(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, w.width).replace(/{height}/g, w.height).replace(/{path}/g, frame_url); break; case "ajax": doresize = false; w = r(movie_width, movie_height); doresize = true; skipInjection = true; e.get(pp_images[set_position], function (J) { toInject = settings.inline_markup.replace(/{content}/g, J); $pp_pic_holder.find("#pp_full_res")[0].innerHTML = toInject; o(); }); break; case "custom": w = r(movie_width, movie_height); toInject = settings.custom_markup; break; case "inline": myClone = e(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(e("body")).show(); doresize = false; w = r(e(myClone).width(), e(myClone).height()); doresize = true; e(myClone).remove(); toInject = settings.inline_markup.replace(/{content}/g, e(pp_images[set_position]).html()); break; } if (!imgPreloader && !skipInjection) { $pp_pic_holder.find("#pp_full_res")[0].innerHTML = toInject; o(); } }); return false; }; e.prettyPhoto.changePage = function (G) { currentGalleryPage = 0; if (G == "previous") { set_position--; if (set_position < 0) { set_position = e(pp_images).size() - 1; } } else { if (G == "next") { set_position++; if (set_position > e(pp_images).size() - 1) { set_position = 0; } } else { set_position = G; } } rel_index = set_position; if (!doresize) { doresize = true; } e(".pp_contract").removeClass("pp_contract").addClass("pp_expand"); s(function () { e.prettyPhoto.open(); }); }; e.prettyPhoto.changeGalleryPage = function (G) { if (G == "next") { currentGalleryPage++; if (currentGalleryPage > totalPage) { currentGalleryPage = 0; } } else { if (G == "previous") { currentGalleryPage--; if (currentGalleryPage < 0) { currentGalleryPage = totalPage; } } else { currentGalleryPage = G; } } slide_speed = (G == "next" || G == "previous") ? settings.animation_speed : 0; slide_to = currentGalleryPage * (itemsPerPage * itemWidth); $pp_gallery.find("ul").animate({ left: -slide_to }, slide_speed); }; e.prettyPhoto.startSlideshow = function () { if (typeof m == "undefined") { $pp_pic_holder.find(".pp_play").unbind("click").removeClass("pp_play").addClass("pp_pause").click(function () { e.prettyPhoto.stopSlideshow(); return false; }); m = setInterval(e.prettyPhoto.startSlideshow, settings.slideshow); } else { 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 false; }); clearInterval(m); m = undefined; }; e.prettyPhoto.close = function () { if ($pp_overlay.is(":animated")) { return; } 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 () { if (e.browser.msie && e.browser.version == 6) { e("select").css("visibility", "visible"); } if (settings.hideflash) { e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility", "visible"); } e(this).remove(); e(window).unbind("scroll.prettyphoto"); c(); settings.callback(); doresize = true; u = false; delete settings; }); }; function o() { e(".pp_loaderIcon").hide(); var G = null; if (j) { G = f(); projectedTop = G.Top + ((G.Height / 2) - (w.containerHeight / 2)); } else { projectedTop = scroll_pos.scrollTop + ((l / 2) - (w.containerHeight / 2)); } if (projectedTop < 0) { projectedTop = 0; } $ppt.fadeTo(settings.animation_speed, 1); $pp_pic_holder.find(".pp_content").animate({ height: w.contentHeight, width: w.contentWidth }, settings.animation_speed); $pp_pic_holder.animate({ top: projectedTop, left: (F) ? G.Left : (E / 2) - (w.containerWidth / 2), width: w.containerWidth }, settings.animation_speed, function () { $pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(w.height).width(w.width); $pp_pic_holder.find(".pp_fade").fadeIn(settings.animation_speed); if (isSet && D(pp_images[set_position]) == "image") { $pp_pic_holder.find(".pp_hoverContainer").show(); } else { $pp_pic_holder.find(".pp_hoverContainer").hide(); } if (w.resized) { e("a.pp_expand,a.pp_contract").show(); } else { e("a.pp_expand").hide(); } if (settings.autoplay_slideshow && !m && !u) { e.prettyPhoto.startSlideshow(); } settings.changepicturecallback(); u = true; }); g(); } function s(G) { $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(); G(); }); } function n(G) { (G > 1) ? e(".pp_nav").show() : e(".pp_nav").hide(); } function r(H, G) { resized = false; y(H, G); imageWidth = H, imageHeight = G; if (((B > E) || (A > l)) && doresize && settings.allow_resize && !p) { resized = true, fitting = false; while (!fitting) { if ((B > E)) { imageWidth = (E - 200); imageHeight = (G / H) * imageWidth; } else { if ((A > l)) { imageHeight = (l - 200); imageWidth = (H / G) * imageHeight; } else { fitting = true; } } A = imageHeight, B = imageWidth; } y(imageWidth, imageHeight); if ((B > E) || (A > l)) { r(B, A); } } return { width: Math.floor(imageWidth), height: Math.floor(imageHeight), containerHeight: Math.floor(A), containerWidth: Math.floor(B), contentHeight: Math.floor(v), contentWidth: Math.floor(x), resized: resized }; } function y(H, G) { H = parseFloat(H); G = parseFloat(G); $pp_details = $pp_pic_holder.find(".pp_details"); $pp_details.width(H); detailsHeight = 0; v = G; x = H; A = G; B = H; } function D(G) { if (G.match(/youtube\.com\/watch/i) || G.match(/youtu\.be/i)) { return "youtube"; } else { if (G.match(/vimeo\.com/i)) { return "vimeo"; } else { if (G.match(/\b.mov\b/i)) { return "quicktime"; } else { if (G.match(/\b.swf\b/i)) { return "flash"; } else { if (G.match(/\biframe=true\b/i)) { return "iframe"; } else { if (G.match(/\bajax=true\b/i)) { return "ajax"; } else { if (G.match(/\bcustom=true\b/i)) { return "custom"; } else { if (G.substr(0, 1) == "#") { return "inline"; } else { return "image"; } } } } } } } } } function t() { if (doresize && typeof $pp_pic_holder != "undefined") { if (j) { var G = f(); scroll_pos = C(); contentHeight = $pp_pic_holder.height(), contentwidth = $pp_pic_holder.width(); if (w != null) { projectedTop = G.Top + ((G.Height / 2) - (w.containerHeight / 2)); } else { projectedTop = G.Top + (G.Height / 2) - (contentHeight / 2); } if (projectedTop < 0) { projectedTop = 0; } if (contentHeight > l) { return; } $pp_pic_holder.css({ top: projectedTop, left: (F) ? G.Left : (E / 2) + scroll_pos.scrollLeft - (contentwidth / 2) }); } else { scroll_pos = C(); contentHeight = $pp_pic_holder.height(), contentwidth = $pp_pic_holder.width(); projectedTop = (l / 2) + scroll_pos.scrollTop - (contentHeight / 2); if (projectedTop < 0) { projectedTop = 0; } if (contentHeight > l) { return; } $pp_pic_holder.css({ top: projectedTop, left: (E / 2) + scroll_pos.scrollLeft - (contentwidth / 2) }); } } } function f() { if (j) { var H = null; if (k != null) { H = k; } else { var G = pp_images[set_position]; H = e("a[href='" + G + "']").children("img:first"); if (H == null) { H = e("a[href='" + G + "']").parent(); } } return { Top: H[0].offsetTop, Left: H[0].offsetLeft, Height: H[0].offsetHeight }; } } function C() { 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 z() { l = e(window).height(), E = e(window).width(); if (typeof $pp_overlay != "undefined") { $pp_overlay.height(e(document).height()).width(E); } } function g() { if (isSet && settings.overlay_gallery && D(pp_images[set_position]) == "image" && (settings.ie6_fallback && !(e.browser.msie && parseInt(e.browser.version) == 6))) { itemWidth = 52 + 5; navWidth = (settings.theme == "facebook" || settings.theme == "pp_default") ? 50 : 30; itemsPerPage = Math.floor((w.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; e.prettyPhoto.changeGalleryPage(goToPage); $pp_gallery_li.filter(":eq(" + set_position + ")").addClass("selected"); } else { $pp_pic_holder.find(".pp_content").unbind("mouseenter mouseleave"); } } function i(G) { 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 : ""); 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 H = 0; H < pp_images.length; H++) { if (!pp_images[H].match(/\b(jpg|jpeg|png|gif)\b/gi)) { classname = "default"; img_src = ""; } else { classname = ""; img_src = pp_images[H]; } 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 = 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 false; }); $pp_gallery.find(".pp_arrow_previous").click(function () { e.prettyPhoto.changeGalleryPage("previous"); e.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 (I) { e(this).find("a").click(function () { e.prettyPhoto.changePage(I); e.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 () { e.prettyPhoto.startSlideshow(); return false; }); } $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 () { if (!settings.modal) { e.prettyPhoto.close(); } }); e("a.pp_close").bind("click", function () { e.prettyPhoto.close(); return false; }); e("a.pp_expand").bind("click", function (I) { if (e(this).hasClass("pp_expand")) { e(this).removeClass("pp_expand").addClass("pp_contract"); doresize = false; } else { e(this).removeClass("pp_contract").addClass("pp_expand"); doresize = true; } s(function () { e.prettyPhoto.open(); }); return false; }); $pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click", function () { e.prettyPhoto.changePage("previous"); e.prettyPhoto.stopSlideshow(); return false; }); $pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click", function () { e.prettyPhoto.changePage("next"); e.prettyPhoto.stopSlideshow(); return false; }); t(); } if (!pp_alreadyInitialized && d()) { pp_alreadyInitialized = true; hashIndex = d(); hashRel = hashIndex; hashIndex = hashIndex.substring(hashIndex.indexOf("/") + 1, hashIndex.length - 1); hashRel = hashRel.substring(0, hashRel.indexOf("/")); setTimeout(function () { e("a[rel^='" + hashRel + "']:eq(" + hashIndex + ")").trigger("click"); }, 50); } return this.unbind("click.prettyphoto").bind("click.prettyphoto", e.prettyPhoto.initialize); }; function d() { url = location.href; hashtag = (url.indexOf("#!") != -1) ? decodeURI(url.substring(url.indexOf("#!") + 2, url.length)) : false; return hashtag; } function b() { if (typeof theRel == "undefined") { return; } location.hash = "!" + theRel + "/" + rel_index + "/"; } function c() { url = location.href; hashtag = (url.indexOf("#!prettyPhoto") > 0) ? true : false; if (hashtag) { location.hash = "!prettyPhoto"; } } function a(h, g) { h = h.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var f = "[\\?&]" + h + "=([^&#]*)"; var j = new RegExp(f); var i = j.exec(g); return (i == null) ? "" : i[1]; } })(jQuery); var pp_alreadyInitialized = false;
