function toggle(a){a.toggle()}if(function(a,b){function c(a){var b=a.length,c=ka.type(a);return!ka.isWindow(a)&&(!(1!==a.nodeType||!b)||"array"===c||"function"!==c&&(0===b||"number"==typeof b&&b>0&&b-1 in a))}function d(a){var b=za[a]={};return ka.each(a.match(ma)||[],function(a,c){b[c]=!0}),b}function e(a,c,d,e){if(ka.acceptData(a)){var f,g,h=ka.expando,i=a.nodeType,j=i?ka.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||d!==b||"string"!=typeof c)return k||(k=i?a[h]=ba.pop()||ka.guid++:h),j[k]||(j[k]=i?{}:{toJSON:ka.noop}),("object"==typeof c||"function"==typeof c)&&(e?j[k]=ka.extend(j[k],c):j[k].data=ka.extend(j[k].data,c)),g=j[k],e||(g.data||(g.data={}),g=g.data),d!==b&&(g[ka.camelCase(c)]=d),"string"==typeof c?(f=g[c],null==f&&(f=g[ka.camelCase(c)])):f=g,f}}function f(a,b,c){if(ka.acceptData(a)){var d,e,f=a.nodeType,g=f?ka.cache:a,i=f?a[ka.expando]:ka.expando;if(g[i]){if(b&&(d=c?g[i]:g[i].data)){ka.isArray(b)?b=b.concat(ka.map(b,ka.camelCase)):b in d?b=[b]:(b=ka.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;for(;e--;)delete d[b[e]];if(c?!h(d):!ka.isEmptyObject(d))return}(c||(delete g[i].data,h(g[i])))&&(f?ka.cleanData([a],!0):ka.support.deleteExpando||g!=g.window?delete g[i]:g[i]=null)}}}function g(a,c,d){if(d===b&&1===a.nodeType){var e="data-"+c.replace(Ba,"-$1").toLowerCase();if(d=a.getAttribute(e),"string"==typeof d){try{d="true"===d||"false"!==d&&("null"===d?null:+d+""===d?+d:Aa.test(d)?ka.parseJSON(d):d)}catch(a){}ka.data(a,c,d)}else d=b}return d}function h(a){var b;for(b in a)if(("data"!==b||!ka.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function i(){return!0}function j(){return!1}function k(){try{return Y.activeElement}catch(a){}}function l(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}function m(a,b,c){if(ka.isFunction(b))return ka.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return ka.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(Qa.test(b))return ka.filter(b,a,c);b=ka.filter(b,a)}return ka.grep(a,function(a){return ka.inArray(a,b)>=0!==c})}function n(a){var b=Ua.split("|"),c=a.createDocumentFragment();if(c.createElement)for(;b.length;)c.createElement(b.pop());return c}function o(a,b){return ka.nodeName(a,"table")&&ka.nodeName(1===b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function p(a){return a.type=(null!==ka.find.attr(a,"type"))+"/"+a.type,a}function q(a){var b=eb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function r(a,b){for(var c,d=0;null!=(c=a[d]);d++)ka._data(c,"globalEval",!b||ka._data(b[d],"globalEval"))}function s(a,b){if(1===b.nodeType&&ka.hasData(a)){var c,d,e,f=ka._data(a),g=ka._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)ka.event.add(b,c,h[c][d])}g.data&&(g.data=ka.extend({},g.data))}}function t(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!ka.support.noCloneEvent&&b[ka.expando]){e=ka._data(b);for(d in e.events)ka.removeEvent(b,d,e.handle);b.removeAttribute(ka.expando)}"script"===c&&b.text!==a.text?(p(b).text=a.text,q(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),ka.support.html5Clone&&a.innerHTML&&!ka.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&bb.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}function u(a,c){var d,e,f=0,g=typeof a.getElementsByTagName!==W?a.getElementsByTagName(c||"*"):typeof a.querySelectorAll!==W?a.querySelectorAll(c||"*"):b;if(!g)for(g=[],d=a.childNodes||a;null!=(e=d[f]);f++)!c||ka.nodeName(e,c)?g.push(e):ka.merge(g,u(e,c));return c===b||c&&ka.nodeName(a,c)?ka.merge([a],g):g}function v(a){bb.test(a.type)&&(a.defaultChecked=a.checked)}function w(a,b){if(b in a)return b;for(var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=yb.length;e--;)if(b=yb[e]+c,b in a)return b;return d}function x(a,b){return a=b||a,"none"===ka.css(a,"display")||!ka.contains(a.ownerDocument,a)}function y(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=ka._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&x(d)&&(f[g]=ka._data(d,"olddisplay",C(d.nodeName)))):f[g]||(e=x(d),(c&&"none"!==c||!e)&&ka._data(d,"olddisplay",e?c:ka.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function z(a,b,c){var d=rb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function A(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=ka.css(a,c+xb[f],!0,e)),d?("content"===c&&(g-=ka.css(a,"padding"+xb[f],!0,e)),"margin"!==c&&(g-=ka.css(a,"border"+xb[f]+"Width",!0,e))):(g+=ka.css(a,"padding"+xb[f],!0,e),"padding"!==c&&(g+=ka.css(a,"border"+xb[f]+"Width",!0,e)));return g}function B(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=kb(a),g=ka.support.boxSizing&&"border-box"===ka.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=lb(a,b,f),(0>e||null==e)&&(e=a.style[b]),sb.test(e))return e;d=g&&(ka.support.boxSizingReliable||e===a.style[b]),e=parseFloat(e)||0}return e+A(a,b,c||(g?"border":"content"),d,f)+"px"}function C(a){var b=Y,c=ub[a];return c||(c=D(a,b),"none"!==c&&c||(jb=(jb||ka("',inline_markup:'
{content}
',custom_markup:"",social_tools:'
Tweet
'},f);var r,s,t,u,v,w,x,y=this,z=!1,A=a(window).height(),B=a(window).width();return doresize=!0,scroll_pos=n(),a(window).unbind("resize.prettyphoto").bind("resize.prettyphoto",function(){m(),o()}),f.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(){return settings=f,"pp_default"==settings.theme&&(settings.horizontal_padding=16),theRel=a(this).attr(settings.hook),galleryRegExp=/\[(?:.*)\]/,isSet=!!galleryRegExp.exec(theRel),pp_images=isSet?jQuery.map(y,function(b){return-1!=a(b).attr(settings.hook).indexOf(theRel)?a(b).attr("href"):void 0}):a.makeArray(a(this).attr("href")),pp_titles=isSet?jQuery.map(y,function(b){return-1!=a(b).attr(settings.hook).indexOf(theRel)?a(b).find("img").attr("alt")?a(b).find("img").attr("alt"):"":void 0}):a.makeArray(a(this).find("img").attr("alt")),pp_descriptions=isSet?jQuery.map(y,function(b){return-1!=a(b).attr(settings.hook).indexOf(theRel)?a(b).attr("title")?a(b).attr("title"):"":void 0}):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)),q(this),settings.allow_resize&&a(window).bind("scroll.prettyphoto",function(){m()}),a.prettyPhoto.open(),!1},a.prettyPhoto.open=function(b){return"undefined"==typeof settings&&(settings=f,pp_images=a.makeArray(arguments[0]),pp_titles=a.makeArray(arguments[1]?arguments[1]:""),pp_descriptions=a.makeArray(arguments[2]?arguments[2]:""),isSet=pp_images.length>1,set_position=arguments[3]?arguments[3]:0,q(b.target)),settings.hideflash&&a("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","hidden"),i(a(pp_images).size()),a(".pp_loaderIcon").show(),settings.deeplinking&&c(),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+a(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(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(),z=!1,-1!=movie_height.indexOf("%")&&(movie_height=parseFloat(a(window).height()*parseFloat(movie_height)/100-150),z=!0),-1!=movie_width.indexOf("%")&&(movie_width=parseFloat(a(window).width()*parseFloat(movie_width)/100-150),z=!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,l(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+=e("rel",pp_images[set_position])?"?rel="+e("rel",pp_images[set_position]):"?rel=1",settings.autoplay&&(movie+="&autoplay=1"),toInject=settings.iframe_markup.replace(/{width}/g,r.width).replace(/{height}/g,r.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case"vimeo":r=j(movie_width,movie_height),movie_id=pp_images[set_position];var b=/http(s?):\/\/(www\.)?vimeo.com\/(\d+)/,c=movie_id.match(b);movie="http://player.vimeo.com/video/"+c[3]+"?title=0&byline=0&portrait=0",settings.autoplay&&(movie+="&autoplay=1;"),vimeo_width=r.width+"/embed/?moog_width="+r.width,toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,r.height).replace(/{path}/g,movie);break;case"quicktime":r=j(movie_width,movie_height),r.height+=15,r.contentHeight+=15,r.containerHeight+=15,toInject=settings.quicktime_markup.replace(/{width}/g,r.width).replace(/{height}/g,r.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay); break;case"flash":r=j(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,r.width).replace(/{height}/g,r.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+"?"+flash_vars);break;case"iframe":r=j(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,r.width).replace(/{height}/g,r.height).replace(/{path}/g,frame_url);break;case"ajax":doresize=!1,r=j(movie_width,movie_height),doresize=!0,skipInjection=!0,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,g()});break;case"custom":r=j(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=!1,r=j(a(myClone).width(),a(myClone).height()),doresize=!0,a(myClone).remove(),toInject=settings.inline_markup.replace(/{content}/g,a(pp_images[set_position]).html())}imgPreloader||skipInjection||($pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject,g())}),!1},a.prettyPhoto.changePage=function(b){currentGalleryPage=0,"previous"==b?(set_position--,set_position<0&&(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"),h(function(){a.prettyPhoto.open()})},a.prettyPhoto.changeGalleryPage=function(a){"next"==a?(currentGalleryPage++,currentGalleryPage>totalPage&&(currentGalleryPage=0)):"previous"==a?(currentGalleryPage--,currentGalleryPage<0&&(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 x?($pp_pic_holder.find(".pp_play").unbind("click").removeClass("pp_play").addClass("pp_pause").click(function(){return a.prettyPhoto.stopSlideshow(),!1}),x=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(){return a.prettyPhoto.startSlideshow(),!1}),clearInterval(x),x=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(){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=!0,s=!1,delete settings}))},!pp_alreadyInitialized&&b()&&(pp_alreadyInitialized=!0,hashIndex=b(),hashRel=hashIndex,hashIndex=hashIndex.substring(hashIndex.indexOf("/")+1,hashIndex.length-1),hashRel=hashRel.substring(0,hashRel.indexOf("/")),setTimeout(function(){a("a["+f.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger("click")},50)),this.unbind("click.prettyphoto").bind("click.prettyphoto",a.prettyPhoto.initialize)}}(jQuery);var pp_alreadyInitialized=!1;!function(a){"use strict";var b={1:{image:"../images/blog-images/big-images/blog1.jpg",title:"A popular Sed ut perspiciatis unde omnis iste natus error.",text:"A popular Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae.",comment:10},2:{image:"../images/blog-images/big-images/blog2.jpg",title:"A popular Sed ut perspiciatis unde omnis iste natus error.",text:"A popular Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae.",comment:10},3:{image:"../images/blog-images/big-images/blog3.jpg",title:"A popular Sed ut perspiciatis unde omnis iste natus error.",text:"A popular Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae.",comment:10}},c="";a(function(){setTimeout(function(){a("#preloader").animate({opacity:"0"},300,function(){a("#preloader").hide(),a("#haeder").css("top",a("#home .flexslider").height())}),a(".left-menu, .right-content").animate({opacity:"1"},500)},800),a(".images-bg").each(function(){a(this).css({"background-image":"url("+a("img",this).hide().attr("src")+")",height:a(window).height()})}),a(".portfolio-with-details .flexslider, .service .flexslider").flexslider({slideshowSpeed:5e3}),a(".portfolio-image.flexslider").flexslider({slideshow:!1}),a(".flexslider.home-page").flexslider({slideshowSpeed:5e3,after:function(b){var c=a(".flex-active-slide",b).find(".home-title"),d="";c.hasClass("left")?d="bounceInLeft":c.hasClass("top")?d="flipInX":c.hasClass("zoom")&&(d="bounceIn"),c.addClass(d+" animated"),c.one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){c.removeClass(d+" animated")})}}),a(".twitter-block").flexslider({animation:"slide"}),setTimeout(function(){a(".twitter-block .slides").css("transform","translate3d(-"+a(".twitter-block .flex-active-slide").width()+"px, 0px, 0px)")},1100),a(".flexslider .button-down, #portfolioLink").on("click",function(b){if((!a(b.target).parents("#portfolioLink")||"A"!=b.target.nodeName)&&!a(".home-page").hasClass("animate")||a(b.target).hasClass("button-down"))return a(".home-page").addClass("animate"),a(".main-navi a").removeClass("active"),setTimeout(function(){a(".portfolio").removeClass("animate")}),a(".player").length&&a(".mb_YTVPPlaypause").trigger("click"),c.length?c.addClass("active"):a("#portfolioLink").addClass("active"),!1}),a(".main-navi").on("click","#showHideMenu",function(){return a(".left-menu").hasClass("animate")?(a(".left-menu").removeClass("animate"),a(window).width()<=480?a(".left-menu").css("left",-180):a(window).width()<=640?a(".left-menu").css("left",-200):a(".left-menu").css("left",-280),a(".main-navi").css("margin-right",15)):(a(".left-menu").addClass("animate"),a(".left-menu").css("left",0),a(".main-navi").css("margin-right",0)),!1}),a(".right-images").on("click","span",function(){c=a(".main-navi a.active, .main-navi > div.active"),a(".main-block").addClass("animate"),a(".main-navi a, .main-navi > div").removeClass("active"),a("#portfolioLink").addClass("active")}),a(".flex-direction-nav .flex-next").addClass("glyph fa-angle-right").text(""),a(".flex-direction-nav .flex-prev").addClass("glyph fa-angle-left").text(""),a(".button-close, .details-close").on("click",function(){return c.length&&(a(".main-navi a, .main-navi > div").removeClass("active"),c.addClass("active")),a(".main-block").removeClass("animate"),!1}),a("#homeLink").on("click",function(){return a(".home-page").removeClass("animate"),c=a(".main-navi a.active, .main-navi > div.active"),a(".main-navi a, .main-navi > div").removeClass("active"),a(this).addClass("active"),a(".player").length&&a(".mb_YTVPPlaypause").trigger("click"),!1}),setTimeout(function(){a("#fourColumn .scroller").gridrotator({columns:4,rows:999,animType:"fadeInOut",animSpeed:1e3,interval:2e3,step:1,w1024:{rows:999,columns:3},w768:{rows:999,columns:3},w480:{rows:999,columns:2},w320:{rows:999,columns:1}}),a("#threeColumn .scroller").gridrotator({columns:3,rows:999,animType:"fadeInOut",animSpeed:1e3,interval:2e3,step:1,w1024:{rows:999,columns:2},w768:{rows:999,columns:2},w480:{rows:999,columns:2},w320:{rows:999,columns:1}});var b=document.querySelector("#masonry");if(b){new Masonry(b,{itemSelector:".item"})}},500),a(".portfolio.horizontal li").each(function(){a(this).css("background-image","url("+a("img",this).attr("src")+")"),a("img",this).attr("src","../images/1x1.png")}),setTimeout(function(){a(".about div[data-style]").each(function(){a(this).attr("style",a(this).attr("data-style"))})},1e3),a(".skill .amount").each(function(){var b=a(this).html();a(this).html("0%");var c=this;setTimeout(function(){a(c).countTo({from:0,to:b,speed:1e3,formatter:function(a,b){return a.toFixed(b.decimals)+"%"}})},1e3)}),a(".filter a").on("click",function(){return a(".filter a").removeClass("active"),a(this).addClass("active"),a(".portfolio li, .masonry-wrapper .item").addClass("unactive"),"all"==a(this).text().toLowerCase()?a(".portfolio li, .masonry-wrapper .item").removeClass("unactive"):a('.portfolio li[data-class="'+a(this).text().toLowerCase()+'"], .masonry-wrapper .item[data-class="'+a(this).text().toLowerCase()+'"]').removeClass("unactive"),!1}),a(".portfolio").on("mouseenter","li",function(){a(this).hasClass("unactive")||a(this).parent().addClass("animate")}).on("mouseleave","li",function(){a(this).parent().removeClass("animate")}),a(".masonry-wrapper").on("mouseenter","> div",function(){a(this).hasClass("unactive")||a(this).parent().addClass("animate")}).on("mouseleave","> div",function(){a(this).parent().removeClass("animate")}),a(".show-more").on("click",function(){var c="";for(var d in b)c+='
'+b[d].title+'

'+b[d].text+'

AdminPhotographyComments'+b[d].comment+'
25nov
';a(".left-content-text").append(c),a(this).remove(),setTimeout(function(){a(".blog-block").css("opacity",1)},200)}),a(".player").length&&setTimeout(function(){a(".player").mb_YTPlayer()},2e3),a(".picker-btn").length&&(a(".picker-btn").on("click",function(){0==parseInt(a(".color-picker").css("right"))?a(".color-picker").stop().animate({right:-160},500):a(".color-picker").stop().animate({right:0},500)}),a(".color-picker .pwrapper div.color").on("click",function(){a("body").removeClass("lightgreen blue green lightred red yellow turquoise pink purple"),a("body").addClass(a(this).attr("data-color"))}),a(".color-picker .pwrapper div.bg").on("click",function(){a("body").removeClass("white black"),a("body").addClass(a(this).attr("data-color")),"black"==a(this).attr("data-color")?a("#clientLogo img").each(function(){var b=a(this).attr("src");a(this).attr("src",b.replace(/clients\//,"clients/black-"))}):a("#clientLogo img").each(function(){var b=a(this).attr("src");a(this).attr("src",b.replace(/clients\/black-/,"clients/"))})}))})}(jQuery),$(window).load(function(){$(".flexslider").flexslider({animation:"slide",animationLoop:!0,itemWidth:350,itemMargin:1,minItems:2,maxItems:4,controlNav:!0,directionNav:!0,move:1,slideshowSpeed:3e3,animationSpeed:600,pauseOnHover:!0})}),$(document).ready(function(){$("a[rel^='prettyPhoto']").prettyPhoto({social_tools:!1,theme:"dark_rounded",deeplinking:false,allow_resize:!0})}),function(a){var b={bindHover:function(b){b.hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")})},bindShHover:function(b){b.hover(function(){a(this).addClass("sh-ui-state-hover")},function(){a(this).removeClass("sh-ui-state-hover")})},bindShDateClicked:function(b){b.hover(function(){a(this).addClass("sh-ui-state-hover")},function(){a(this).removeClass("sh-ui-state-hover")})},showProgress:function(b,c){if(c){var d=a(".sh-widget",b),e=a("
");d.prepend(e)}else a(".sh-widget > .ui-progress",b).remove()},getWidth:function(b){var c=a(b).width();return 0==c&&(c=a(b).parent().attr("data-width")),a(b).parent().attr("data-width",c),c},handleResize:function(){a(".sh-widget-calendar").each(function(){var c=b.getWidth(this),d=Math.floor(c/213),e=a(this).attr("data-monthcount");d>e&&(d=e),4==e&&3==d&&(d=2),6==e&&d>3&d<6&&(d=3),8==e&&d>4&d<8&&(d=4),12==e&&5==d&&(d=4),12==e&&d>6&&d<12&&(d=6);var f=a(this).attr("data-cols");d!=f&&(a(this).removeClass("col-"+f),a(this).addClass("col-"+d),a(this).attr("data-cols",d))})},ajaxLoad:function(c,d,e,f,g,h,i,j,k,l,m,n,o){var p="https:"==location.protocol?"https:":"http:",q=j?"//localhost.":"//www.",r=j?":"+location.port:"",s=p+q+k+r+"/services/widget.svc/getcalendarhtml";j&&(s=p+"//"+document.domain+r+"/services/widget.svc/getcalendarhtml"),l||(s=q+k+r+"/services/widget.svc/GetCalendarHtmlNoCache",j&&(s=p+"//"+document.domain+r+"/services/widget.svc/GetCalendarHtmlNoCache")),b.showProgress(c,!0),a.ajax({url:s+"?propertyid="+d+"&year="+e+"&month="+f+"&monthcount="+g+"&culture="+h+"&referrer="+i+"&monthsBack="+m+"&monthsAhead="+n,context:document.body,dataType:"jsonp",jsonpCallback:"sh_calendar_widget_callback"}).done(function(a){o(a)}).fail(function(a,b,c){}).always(function(a){b.showProgress(c,!1)})},load:function(c,d,e){var f=d.propertyid,g=void 0!=d.monthcount?d.monthcount:null,h=void 0!=d.year?d.year:null,i=void 0!=d.month?d.month:null,j=void 0!=d.culture?d.culture:null,k=void 0!=d.referrer?d.referrer:"",l=d.localhost,m=void 0==d.useCache||"false"!=d.useCache,n=void 0!=d.host?d.host:"spain-holiday.com",o=void 0!=d.monthsbackallowed?d.monthsbackallowed:null,p=void 0!=d.monthsforwardallowed?d.monthsforwardallowed:null,q=jQuery.Event("optionsUsed");q.options=d,a(c).trigger(q),b.ajaxLoad(c,f,h,i,g,j,k,l,n,m,o,p,function(f){c.html(f),a(".overlay",c).height(a(c).height()),b.init(c,d),e&&e(this)})},init:function(c,d){var e=c.find(">:first-child");b.bindHover(a("a",e)),b.bindShHover(a("td span",e)),""!=d.title&&a(".sh-calendar-title",c).text(d.title),a("a.sh-calendar-prev:not(.ui-state-disabled), a.sh-calendar-next:not(.ui-state-disabled)",e).on("click",function(){d=a.extend(d,{year:a(this).attr("data-year"),month:a(this).attr("data-month")}),b.load(c,d)}),a(".ui-datepicker-calendar a[data-date]",e).on("click",function(b){b.preventDefault();var e=a(this).attr("data-date").split("-"),f=new Date(e[0],e[1]-1,e[2]),b=jQuery.Event("dateClicked");b.clickedDate=f,b.currentOptions=d,a(c).trigger(b)}),a(window).resize(function(a){b.handleResize()}),b.handleResize()}};a.fn.shCalendar=function(c,d){return this.each(function(){var e=a.extend({propertyid:a(this).attr("data-propertyid"),monthcount:a(this).attr("data-monthcount"),title:a(this).attr("data-title"),culture:a(this).attr("data-culture"),referrer:a(this).attr("data-referrer"),useCache:a(this).attr("data-useCache"),host:a(this).attr("data-host"),monthsbackallowed:a(this).attr("data-monthsbackallowed"),monthsforwardallowed:a(this).attr("data-monthsforwardallowed")},c);b.load(a(this),e,d)})}}(jQuery),function(a){var b={bindHover:function(b){b.hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")})},bindShHover:function(b){b.hover(function(){a(this).addClass("sh-ui-state-hover")},function(){a(this).removeClass("sh-ui-state-hover")})},showProgress:function(b,c){if(c){var d=a(".sh-widget",b),e=a("
");d.prepend(e)}else a(".sh-widget > .ui-progress",b).remove()},ajaxLoad:function(c,d,e,f,g,h,i,j){var k="https:"==location.protocol?"https:":"http:",l=h?"//localhost.":"//www.",m=h?":"+location.port:"",n=k+l+i+m+"/services/widget.svc/getpricehtml";h&&(n=k+"//"+document.domain+m+"/services/widget.svc/getpricehtml"),b.showProgress(c,!0),a.ajax({url:n+"?propertyid="+d+"¤cy="+e+"&culture="+f+"&referrer="+g,context:document.body,dataType:"jsonp",jsonpCallback:"sh_price_widget_callback"}).done(function(a){j(a)}).fail(function(a,b,c){}).always(function(a){b.showProgress(c,!1)})},load:function(c,d,e){var f=d.propertyid,g=void 0!=d.currency?d.currency:0,h=void 0!=d.culture?d.culture:null,i=void 0!=d.referrer?d.referrer:"",j=d.localhost,k=void 0!=d.host?d.host:"spain-holiday.com";b.ajaxLoad(c,f,g,h,i,j,k,function(f){c.html(f),a(".overlay",c).height(a(c).height()),b.init(c,d),e&&e(this)})},init:function(c,d){var e=c.find(">:first-child");b.bindHover(a(".row",e)),b.bindShHover(a("td span",e)),""!=d.title&&a(".sh-widget-title",c).text(d.title),a("select",e).change(function(){d=a.extend(d,{currency:a(this).val()}),b.load(c,d)})}};a.fn.shPrice=function(c,d){return this.each(function(){var e=a.extend({propertyid:a(this).attr("data-propertyid"),currency:a(this).attr("data-currency"),title:a(this).attr("data-title"),culture:a(this).attr("data-culture"),referrer:a(this).attr("data-referrer"),host:a(this).attr("data-host")},c);b.load(a(this),e,d)})}}(jQuery); /* ------------------------------------------------------------------------ Class: prettyPhoto Use: Lightbox clone for jQuery Author: Stephane Caron (http://www.no-margin-for-errors.com) Version: 3.1.6 ------------------------------------------------------------------------- */ (function($) { $.prettyPhoto = {version: '3.1.6'}; $.fn.prettyPhoto = function(pp_settings) { pp_settings = jQuery.extend({ hook: 'rel', /* the attribute tag to use for prettyPhoto hooks. default: 'rel'. For HTML5, use "data-rel" or similar. */ animation_speed: 'fast', /* fast/slow/normal */ ajaxcallback: function() {}, slideshow: 5000, /* false OR interval time in ms */ autoplay_slideshow: false, /* true/false */ opacity: 0.80, /* Value between 0 and 1 */ show_title: true, /* true/false */ allow_resize: true, /* Resize the photos bigger than viewport. true/false */ allow_expand: true, /* Allow the user to expand a resized image. true/false */ default_width: 500, default_height: 344, counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */ theme: 'pp_default', /* light_rounded / dark_rounded / light_square / dark_square / facebook */ horizontal_padding: 20, /* The padding on each side of the picture */ hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */ wmode: 'opaque', /* Set the flash wmode attribute */ autoplay: true, /* Automatically start videos: True/False */ modal: false, /* If set to true, only the close button will close the window */ deeplinking: true, /* Allow prettyPhoto to update the url to enable deeplinking. */ overlay_gallery: true, /* If set to true, a gallery will overlay the fullscreen image on mouse over */ overlay_gallery_max: 30, /* Maximum number of pictures in the overlay gallery */ keyboard_shortcuts: true, /* Set to false if you open forms inside prettyPhoto */ changepicturecallback: function(){}, /* Called everytime an item is shown/changed */ callback: function(){}, /* Called when prettyPhoto is closed */ ie6_fallback: true, markup: '
\
 
\
\
\
\
\
\
\
\
\
\
\
\ Expand \
\ next \ previous \
\
\
\
\ Previous \

0/0

\ Next \
\

\
{pp_social}
\ Close \
\
\
\
\
\
\
\
\
\
\
\
\
', gallery_markup: '', image_markup: '', flash_markup: '', quicktime_markup: '', iframe_markup: '', inline_markup: '
{content}
', custom_markup: '', social_tools: '
' /* html or false to disable */ }, pp_settings); // Global variables accessible only by prettyPhoto var matchedObjects = this, percentBased = false, pp_dimensions, pp_open, // prettyPhoto container specific pp_contentHeight, pp_contentWidth, pp_containerHeight, pp_containerWidth, // Window size windowHeight = $(window).height(), windowWidth = $(window).width(), // Global elements pp_slideshow; doresize = true, scroll_pos = _get_scroll(); // Window/Keyboard events $(window).unbind('resize.prettyphoto').bind('resize.prettyphoto',function(){ _center_overlay(); _resize_overlay(); }); if(pp_settings.keyboard_shortcuts) { $(document).unbind('keydown.prettyphoto').bind('keydown.prettyphoto',function(e){ if(typeof $pp_pic_holder != 'undefined'){ if($pp_pic_holder.is(':visible')){ switch(e.keyCode){ case 37: $.prettyPhoto.changePage('previous'); e.preventDefault(); break; case 39: $.prettyPhoto.changePage('next'); e.preventDefault(); break; case 27: if(!settings.modal) $.prettyPhoto.close(); e.preventDefault(); break; }; // return false; }; }; }); }; /** * Initialize prettyPhoto. */ $.prettyPhoto.initialize = function() { settings = pp_settings; if(settings.theme == 'pp_default') settings.horizontal_padding = 16; // Find out if the picture is part of a set theRel = $(this).attr(settings.hook); galleryRegExp = /\[(?:.*)\]/; isSet = (galleryRegExp.exec(theRel)) ? true : false; // Put the SRCs, TITLEs, ALTs into an array. pp_images = (isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr(settings.hook).indexOf(theRel) != -1) return $(n).attr('href'); }) : $.makeArray($(this).attr('href')); pp_titles = (isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr(settings.hook).indexOf(theRel) != -1) return ($(n).find('img').attr('alt')) ? $(n).find('img').attr('alt') : ""; }) : $.makeArray($(this).find('img').attr('alt')); pp_descriptions = (isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr(settings.hook).indexOf(theRel) != -1) return ($(n).attr('title')) ? $(n).attr('title') : ""; }) : $.makeArray($(this).attr('title')); if(pp_images.length > settings.overlay_gallery_max) settings.overlay_gallery = false; set_position = jQuery.inArray($(this).attr('href'), pp_images); // Define where in the array the clicked item is positionned rel_index = (isSet) ? set_position : $("a["+settings.hook+"^='"+theRel+"']").index($(this)); _build_overlay(this); // Build the overlay {this} being the caller if(settings.allow_resize) $(window).bind('scroll.prettyphoto',function(){ _center_overlay(); }); $.prettyPhoto.open(); return false; } /** * Opens the prettyPhoto modal box. * @param image {String,Array} Full path to the image to be open, can also be an array containing full images paths. * @param title {String,Array} The title to be displayed with the picture, can also be an array containing all the titles. * @param description {String,Array} The description to be displayed with the picture, can also be an array containing all the descriptions. */ $.prettyPhoto.open = function(event) { if(typeof settings == "undefined"){ // Means it's an API call, need to manually get the settings and set the variables settings = pp_settings; pp_images = $.makeArray(arguments[0]); pp_titles = (arguments[1]) ? $.makeArray(arguments[1]) : $.makeArray(""); pp_descriptions = (arguments[2]) ? $.makeArray(arguments[2]) : $.makeArray(""); isSet = (pp_images.length > 1) ? true : false; set_position = (arguments[3])? arguments[3]: 0; _build_overlay(event.target); // Build the overlay {this} being the caller } if(settings.hideflash) $('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','hidden'); // Hide the flash _checkPosition($(pp_images).size()); // Hide the next/previous links if on first or last images. $('.pp_loaderIcon').show(); if(settings.deeplinking) setHashtag(); // Rebuild Facebook Like Button with updated href 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); } // Fade the content in if($ppt.is(':hidden')) $ppt.css('opacity',0).show(); $pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity); // Display the current position $pp_pic_holder.find('.currentTextHolder').text((set_position+1) + settings.counter_separator_label + $(pp_images).size()); // Set the description if(typeof pp_descriptions[set_position] != 'undefined' && 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(); } // Get the dimensions movie_width = ( parseFloat(getParam('width',pp_images[set_position])) ) ? getParam('width',pp_images[set_position]) : settings.default_width.toString(); movie_height = ( parseFloat(getParam('height',pp_images[set_position])) ) ? getParam('height',pp_images[set_position]) : settings.default_height.toString(); // If the size is % based, calculate according to window dimensions percentBased=false; if(movie_height.indexOf('%') != -1) { movie_height = parseFloat(($(window).height() * parseFloat(movie_height) / 100) - 150); percentBased = true; } if(movie_width.indexOf('%') != -1) { movie_width = parseFloat(($(window).width() * parseFloat(movie_width) / 100) - 150); percentBased = true; } // Fade the holder $pp_pic_holder.fadeIn(function(){ // Set the title (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; // Inject the proper content switch(_getFileType(pp_images[set_position])){ case 'image': imgPreloader = new Image(); // Preload the neighbour images nextImage = new Image(); if(isSet && set_position < $(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(){ // Fit item to viewport pp_dimensions = _fitToViewport(imgPreloader.width,imgPreloader.height); _showContent(); }; imgPreloader.onerror = function(){ alert('Image cannot be loaded. Make sure the path is correct and image exist.'); $.prettyPhoto.close(); }; imgPreloader.src = pp_images[set_position]; break; case 'youtube': pp_dimensions = _fitToViewport(movie_width,movie_height); // Fit item to viewport // Regular youtube link movie_id = getParam('v',pp_images[set_position]); // youtu.be link 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('?')); // Strip anything after the ? if(movie_id.indexOf('&') > 0) movie_id = movie_id.substr(0,movie_id.indexOf('&')); // Strip anything after the & } movie = 'http://www.youtube.com/embed/'+movie_id; (getParam('rel',pp_images[set_position])) ? movie+="?rel="+getParam('rel',pp_images[set_position]) : movie+="?rel=1"; if(settings.autoplay) movie += "&autoplay=1"; toInject = settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie); break; case 'vimeo': pp_dimensions = _fitToViewport(movie_width,movie_height); // Fit item to viewport movie_id = pp_images[set_position]; var regExp = /http(s?):\/\/(www\.)?vimeo.com\/(\d+)/; var match = movie_id.match(regExp); movie = 'http://player.vimeo.com/video/'+ match[3] +'?title=0&byline=0&portrait=0'; if(settings.autoplay) movie += "&autoplay=1;"; vimeo_width = pp_dimensions['width'] + '/embed/?moog_width='+ pp_dimensions['width']; toInject = settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,movie); break; case 'quicktime': pp_dimensions = _fitToViewport(movie_width,movie_height); // Fit item to viewport pp_dimensions['height']+=15; pp_dimensions['contentHeight']+=15; pp_dimensions['containerHeight']+=15; // Add space for the control bar toInject = settings.quicktime_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay); break; case 'flash': pp_dimensions = _fitToViewport(movie_width,movie_height); // Fit item to viewport 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,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+'?'+flash_vars); break; case 'iframe': pp_dimensions = _fitToViewport(movie_width,movie_height); // Fit item to viewport frame_url = pp_images[set_position]; frame_url = frame_url.substr(0,frame_url.indexOf('iframe')-1); toInject = settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,frame_url); break; case 'ajax': doresize = false; // Make sure the dimensions are not resized. pp_dimensions = _fitToViewport(movie_width,movie_height); doresize = true; // Reset the dimensions skipInjection = true; $.get(pp_images[set_position],function(responseHTML){ toInject = settings.inline_markup.replace(/{content}/g,responseHTML); $pp_pic_holder.find('#pp_full_res')[0].innerHTML = toInject; _showContent(); }); break; case 'custom': pp_dimensions = _fitToViewport(movie_width,movie_height); // Fit item to viewport toInject = settings.custom_markup; break; case 'inline': // to get the item height clone it, apply default width, wrap it in the prettyPhoto containers , then delete myClone = $(pp_images[set_position]).clone().append('
').css({'width':settings.default_width}).wrapInner('
').appendTo($('body')).show(); doresize = false; // Make sure the dimensions are not resized. pp_dimensions = _fitToViewport($(myClone).width(),$(myClone).height()); doresize = true; // Reset the dimensions $(myClone).remove(); toInject = settings.inline_markup.replace(/{content}/g,$(pp_images[set_position]).html()); break; }; if(!imgPreloader && !skipInjection){ $pp_pic_holder.find('#pp_full_res')[0].innerHTML = toInject; // Show content _showContent(); }; }); return false; }; /** * Change page in the prettyPhoto modal box * @param direction {String} Direction of the paging, previous or next. */ $.prettyPhoto.changePage = function(direction){ currentGalleryPage = 0; if(direction == 'previous') { set_position--; if (set_position < 0) set_position = $(pp_images).size()-1; }else if(direction == 'next'){ set_position++; if(set_position > $(pp_images).size()-1) set_position = 0; }else{ set_position=direction; }; rel_index = set_position; if(!doresize) doresize = true; // Allow the resizing of the images if(settings.allow_expand) { $('.pp_contract').removeClass('pp_contract').addClass('pp_expand'); } _hideContent(function(){ $.prettyPhoto.open(); }); }; /** * Change gallery page in the prettyPhoto modal box * @param direction {String} Direction of the paging, previous or next. */ $.prettyPhoto.changeGalleryPage = function(direction){ if(direction=='next'){ currentGalleryPage ++; if(currentGalleryPage > totalPage) currentGalleryPage = 0; }else if(direction=='previous'){ currentGalleryPage --; if(currentGalleryPage < 0) currentGalleryPage = totalPage; }else{ currentGalleryPage = direction; }; slide_speed = (direction == 'next' || direction == 'previous') ? settings.animation_speed : 0; slide_to = currentGalleryPage * (itemsPerPage * itemWidth); $pp_gallery.find('ul').animate({left:-slide_to},slide_speed); }; /** * Start the slideshow... */ $.prettyPhoto.startSlideshow = function(){ if(typeof pp_slideshow == 'undefined'){ $pp_pic_holder.find('.pp_play').unbind('click').removeClass('pp_play').addClass('pp_pause').click(function(){ $.prettyPhoto.stopSlideshow(); return false; }); pp_slideshow = setInterval($.prettyPhoto.startSlideshow,settings.slideshow); }else{ $.prettyPhoto.changePage('next'); }; } /** * Stop the slideshow... */ $.prettyPhoto.stopSlideshow = function(){ $pp_pic_holder.find('.pp_pause').unbind('click').removeClass('pp_pause').addClass('pp_play').click(function(){ $.prettyPhoto.startSlideshow(); return false; }); clearInterval(pp_slideshow); pp_slideshow=undefined; } /** * Closes prettyPhoto. */ $.prettyPhoto.close = function(){ if($pp_overlay.is(":animated")) return; $.prettyPhoto.stopSlideshow(); $pp_pic_holder.stop().find('object,embed').css('visibility','hidden'); $('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animation_speed,function(){ $(this).remove(); }); $pp_overlay.fadeOut(settings.animation_speed, function(){ if(settings.hideflash) $('object,embed,iframe[src*=youtube],iframe[src*=vimeo]').css('visibility','visible'); // Show the flash $(this).remove(); // No more need for the prettyPhoto markup $(window).unbind('scroll.prettyphoto'); clearHashtag(); settings.callback(); doresize = true; pp_open = false; delete settings; }); }; /** * Set the proper sizes on the containers and animate the content in. */ function _showContent(){ $('.pp_loaderIcon').hide(); // Calculate the opened top position of the pic holder projectedTop = scroll_pos['scrollTop'] + ((windowHeight/2) - (pp_dimensions['containerHeight']/2)); if(projectedTop < 0) projectedTop = 0; $ppt.fadeTo(settings.animation_speed,1); // Resize the content holder $pp_pic_holder.find('.pp_content') .animate({ height:pp_dimensions['contentHeight'], width:pp_dimensions['contentWidth'] },settings.animation_speed); // Resize picture the holder $pp_pic_holder.animate({ 'top': projectedTop, 'left': ((windowWidth/2) - (pp_dimensions['containerWidth']/2) < 0) ? 0 : (windowWidth/2) - (pp_dimensions['containerWidth']/2), width:pp_dimensions['containerWidth'] },settings.animation_speed,function(){ $pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(pp_dimensions['height']).width(pp_dimensions['width']); $pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed); // Fade the new content // Show the nav if(isSet && _getFileType(pp_images[set_position])=="image") { $pp_pic_holder.find('.pp_hoverContainer').show(); }else{ $pp_pic_holder.find('.pp_hoverContainer').hide(); } if(settings.allow_expand) { if(pp_dimensions['resized']){ // Fade the resizing link if the image is resized $('a.pp_expand,a.pp_contract').show(); }else{ $('a.pp_expand').hide(); } } if(settings.autoplay_slideshow && !pp_slideshow && !pp_open) $.prettyPhoto.startSlideshow(); settings.changepicturecallback(); // Callback! pp_open = true; }); _insert_gallery(); pp_settings.ajaxcallback(); }; /** * Hide the content...DUH! */ function _hideContent(callback){ // Fade out the current picture $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(){ $('.pp_loaderIcon').show(); callback(); }); }; /** * Check the item position in the gallery array, hide or show the navigation links * @param setCount {integer} The total number of items in the set */ function _checkPosition(setCount){ (setCount > 1) ? $('.pp_nav').show() : $('.pp_nav').hide(); // Hide the bottom nav if it's not a set. }; /** * Resize the item dimensions if it's bigger than the viewport * @param width {integer} Width of the item to be opened * @param height {integer} Height of the item to be opened * @return An array containin the "fitted" dimensions */ function _fitToViewport(width,height){ resized = false; _getDimensions(width,height); // Define them in case there's no resize needed imageWidth = width, imageHeight = height; if( ((pp_containerWidth > windowWidth) || (pp_containerHeight > windowHeight)) && doresize && settings.allow_resize && !percentBased) { resized = true, fitting = false; while (!fitting){ if(pp_containerWidth > windowWidth - 38){ imageWidth = (windowWidth - 38); imageHeight = (height/width) * imageWidth; } else if(pp_containerHeight > windowHeight - 100) { imageHeight = (windowHeight - 100); imageWidth = (width/height) * imageHeight; } else { fitting = true; }; pp_containerHeight = imageHeight, pp_containerWidth = imageWidth; }; if((pp_containerWidth > windowWidth) || (pp_containerHeight > windowHeight)){ _fitToViewport(pp_containerWidth,pp_containerHeight) }; _getDimensions(imageWidth,imageHeight); }; return { width:Math.floor(imageWidth), height:Math.floor(imageHeight), containerHeight:Math.floor(pp_containerHeight), containerWidth:Math.floor(pp_containerWidth) + (settings.horizontal_padding * 2), contentHeight:Math.floor(pp_contentHeight), contentWidth:Math.floor(pp_contentWidth), resized:resized }; }; /** * Get the containers dimensions according to the item size * @param width {integer} Width of the item to be opened * @param height {integer} Height of the item to be opened */ function _getDimensions(width,height){ width = parseFloat(width); height = parseFloat(height); // Get the details height, to do so, I need to clone it since it's invisible $pp_details = $pp_pic_holder.find('.pp_details'); $pp_details.width(width); detailsHeight = parseFloat($pp_details.css('marginTop')) + parseFloat($pp_details.css('marginBottom')); $pp_details = $pp_details.clone().addClass(settings.theme).width(width).appendTo($('body')).css({ 'position':'absolute', 'top':-10000 }); detailsHeight += $pp_details.height(); detailsHeight = (detailsHeight <= 34) ? 36 : detailsHeight; // Min-height for the details $pp_details.remove(); // Get the titles height, to do so, I need to clone it since it's invisible $pp_title = $pp_pic_holder.find('.ppt'); $pp_title.width(width); titleHeight = parseFloat($pp_title.css('marginTop')) + parseFloat($pp_title.css('marginBottom')); $pp_title = $pp_title.clone().appendTo($('body')).css({ 'position':'absolute', 'top':-10000 }); titleHeight += $pp_title.height(); $pp_title.remove(); // Get the container size, to resize the holder to the right dimensions pp_contentHeight = height + detailsHeight; pp_contentWidth = width; pp_containerHeight = pp_contentHeight + titleHeight + $pp_pic_holder.find('.pp_top').height() + $pp_pic_holder.find('.pp_bottom').height(); pp_containerWidth = width; } function _getFileType(itemSrc){ if (itemSrc.match(/youtube\.com\/watch/i) || itemSrc.match(/youtu\.be/i)) { return 'youtube'; }else if (itemSrc.match(/vimeo\.com/i)) { return 'vimeo'; }else if(itemSrc.match(/\b.mov\b/i)){ return 'quicktime'; }else if(itemSrc.match(/\b.swf\b/i)){ return 'flash'; }else if(itemSrc.match(/\biframe=true\b/i)){ return 'iframe'; }else if(itemSrc.match(/\bajax=true\b/i)){ return 'ajax'; }else if(itemSrc.match(/\bcustom=true\b/i)){ return 'custom'; }else if(itemSrc.substr(0,1) == '#'){ return 'inline'; }else{ return 'image'; }; }; function _center_overlay(){ if(doresize && typeof $pp_pic_holder != 'undefined') { scroll_pos = _get_scroll(); contentHeight = $pp_pic_holder.height(), contentwidth = $pp_pic_holder.width(); projectedTop = (windowHeight/2) + scroll_pos['scrollTop'] - (contentHeight/2); if(projectedTop < 0) projectedTop = 0; if(contentHeight > windowHeight) return; $pp_pic_holder.css({ 'top': projectedTop, 'left': (windowWidth/2) + scroll_pos['scrollLeft'] - (contentwidth/2) }); }; }; function _get_scroll(){ if (self.pageYOffset) { return {scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset}; } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict return {scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft}; } else if (document.body) {// all other Explorers return {scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft}; }; }; function _resize_overlay() { windowHeight = $(window).height(), windowWidth = $(window).width(); if(typeof $pp_overlay != "undefined") $pp_overlay.height($(document).height()).width(windowWidth); }; function _insert_gallery(){ if(isSet && settings.overlay_gallery && _getFileType(pp_images[set_position])=="image") { itemWidth = 52+5; // 52 beign the thumb width, 5 being the right margin. navWidth = (settings.theme == "facebook" || settings.theme == "pp_default") ? 50 : 30; // Define the arrow width depending on the theme itemsPerPage = Math.floor((pp_dimensions['containerWidth'] - 100 - navWidth) / itemWidth); itemsPerPage = (itemsPerPage < pp_images.length) ? itemsPerPage : pp_images.length; totalPage = Math.ceil(pp_images.length / itemsPerPage) - 1; // Hide the nav in the case there's no need for links if(totalPage == 0){ navWidth = 0; // No nav means no width! $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; // Set the proper width to the gallery items $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; $.prettyPhoto.changeGalleryPage(goToPage); $pp_gallery_li.filter(':eq('+set_position+')').addClass('selected'); }else{ $pp_pic_holder.find('.pp_content').unbind('mouseenter mouseleave'); // $pp_gallery.hide(); } } function _build_overlay(caller){ // Inject Social Tool markup into General markup if(settings.social_tools) facebook_like_link = settings.social_tools.replace('{location_href}', encodeURIComponent(location.href)); settings.markup = settings.markup.replace('{pp_social}',''); $('body').append(settings.markup); // Inject the markup $pp_pic_holder = $('.pp_pic_holder') , $ppt = $('.ppt'), $pp_overlay = $('div.pp_overlay'); // Set my global selectors // Inject the inline gallery! if(isSet && settings.overlay_gallery) { currentGalleryPage = 0; toInject = ""; for (var i=0; i < pp_images.length; i++) { if(!pp_images[i].match(/\b(jpg|jpeg|png|gif)\b/gi)){ classname = 'default'; img_src = ''; }else{ classname = ''; img_src = pp_images[i]; } toInject += "
  • "; }; toInject = settings.gallery_markup.replace(/{gallery}/g,toInject); $pp_pic_holder.find('#pp_full_res').after(toInject); $pp_gallery = $('.pp_pic_holder .pp_gallery'), $pp_gallery_li = $pp_gallery.find('li'); // Set the gallery selectors $pp_gallery.find('.pp_arrow_next').click(function(){ $.prettyPhoto.changeGalleryPage('next'); $.prettyPhoto.stopSlideshow(); return false; }); $pp_gallery.find('.pp_arrow_previous').click(function(){ $.prettyPhoto.changeGalleryPage('previous'); $.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; // 52 beign the thumb width, 5 being the right margin. $pp_gallery_li.each(function(i){ $(this) .find('a') .click(function(){ $.prettyPhoto.changePage(i); $.prettyPhoto.stopSlideshow(); return false; }); }); }; // Inject the play/pause if it's a slideshow if(settings.slideshow){ $pp_pic_holder.find('.pp_nav').prepend('Play') $pp_pic_holder.find('.pp_nav .pp_play').click(function(){ $.prettyPhoto.startSlideshow(); return false; }); } $pp_pic_holder.attr('class','pp_pic_holder ' + settings.theme); // Set the proper theme $pp_overlay .css({ 'opacity':0, 'height':$(document).height(), 'width':$(window).width() }) .bind('click',function(){ if(!settings.modal) $.prettyPhoto.close(); }); $('a.pp_close').bind('click',function(){ $.prettyPhoto.close(); return false; }); if(settings.allow_expand) { $('a.pp_expand').bind('click',function(e){ // Expand the image if($(this).hasClass('pp_expand')){ $(this).removeClass('pp_expand').addClass('pp_contract'); doresize = false; }else{ $(this).removeClass('pp_contract').addClass('pp_expand'); doresize = true; }; _hideContent(function(){ $.prettyPhoto.open(); }); return false; }); } $pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').bind('click',function(){ $.prettyPhoto.changePage('previous'); $.prettyPhoto.stopSlideshow(); return false; }); $pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').bind('click',function(){ $.prettyPhoto.changePage('next'); $.prettyPhoto.stopSlideshow(); return false; }); _center_overlay(); // Center it }; if(!pp_alreadyInitialized && getHashtag()){ pp_alreadyInitialized = true; // Grab the rel index to trigger the click on the correct element hashIndex = getHashtag(); hashRel = hashIndex; hashIndex = hashIndex.substring(hashIndex.indexOf('/')+1,hashIndex.length-1); hashRel = hashRel.substring(0,hashRel.indexOf('/')); // Little timeout to make sure all the prettyPhoto initialize scripts has been run. // Useful in the event the page contain several init scripts. setTimeout(function(){ $("a["+pp_settings.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger('click'); },50); } return this.unbind('click.prettyphoto').bind('click.prettyphoto',$.prettyPhoto.initialize); // Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once }; function getHashtag(){ var url = location.href; hashtag = (url.indexOf('#prettyPhoto') !== -1) ? decodeURI(url.substring(url.indexOf('#prettyPhoto')+1,url.length)) : false; if(hashtag){ hashtag = hashtag.replace(/<|>/g,''); } return hashtag; }; function setHashtag(){ if(typeof theRel == 'undefined') return; // theRel is set on normal calls, it's impossible to deeplink using the API location.hash = theRel + '/'+rel_index+'/'; }; function clearHashtag(){ if ( location.href.indexOf('#prettyPhoto') !== -1 ) location.hash = "prettyPhoto"; } function getParam(name,url){ name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexS = "[\\?&]"+name+"=([^&#]*)"; var regex = new RegExp( regexS ); var results = regex.exec( url ); return ( results == null ) ? "" : results[1]; } })(jQuery); var pp_alreadyInitialized = false; // Used for the deep linking to make sure not to call the same function several times.