(function($){var restore_dims=function(){$('img[data-recalc-dims]').each(function recalc(){var $this=$(this);if(this.complete){if($this.data('lazy-src')&&$this.attr('src')!==$this.data('lazy-src')){$this.load(recalc);return;} var width=this.width,height=this.height;if(width&&width>0&&height&&height>0){$this.attr({width:width,height:height});reset_for_retina(this);}} else{$this.load(recalc);}});},reset_for_retina=function(img){$(img).removeAttr('data-recalc-dims').removeAttr('scale');};$(document).ready(restore_dims);if('on'in $.fn){$(document.body).on('post-load',restore_dims);}else{$(document).delegate('body','post-load',restore_dims);}})(jQuery); ;function epdofitvids(e) { if (_EPYT_.epresponsiveselector.constructor !== Array) { _EPYT_.epresponsiveselector = JSON.parse(_EPYT_.epresponsiveselector); } e.fn.fitVidsEP=function(t){var n={customSelector:null};if(!document.getElementById("fit-vids-style")){var r=document.createElement("div"),i=document.getElementsByTagName("base")[0]||document.getElementsByTagName("script")[0],s="­";r.className="fit-vids-style";r.id="fit-vids-style";r.style.display="none";r.innerHTML=s;i.parentNode.insertBefore(r,i)}if(t){e.extend(n,t)}return this.each(function(){var t=_EPYT_.epresponsiveselector;if(n.customSelector){t.push(n.customSelector)}var r=e(this).find(t.join(","));r=r.not("object object");r.each(function(){var t=e(this);if(this.tagName.toLowerCase()==="embed"&&t.parent("object").length||t.parent(".fluid-width-video-wrapper").length){return}var n=this.tagName.toLowerCase()==="object"||t.attr("height")&&!isNaN(parseInt(t.attr("height"),10))?parseInt(t.attr("height"),10):t.height(),r=!isNaN(parseInt(t.attr("width"),10))?parseInt(t.attr("width"),10):t.width(),i=n/r;if(!t.attr("id")){var s="fitvid"+Math.floor(Math.random()*999999);t.attr("id",s)}t.wrap('
').parent(".fluid-width-video-wrapper").css("padding-top",i*100+"%");t.removeAttr("height").removeAttr("width")})})}; e(document).ready(function(){e("body").fitVidsEP();}); return true; } try {epdofitvids(window.jQuery);} catch (err){} ;WPGroHo=jQuery.extend({my_hash:'',data:{},renderers:{},syncProfileData:function(hash,id){if(!WPGroHo.data[hash]){WPGroHo.data[hash]={};jQuery('div.grofile-hash-map-'+hash+' span').each(function(){WPGroHo.data[hash][this.className]=jQuery(this).text();});} WPGroHo.appendProfileData(WPGroHo.data[hash],hash,id);},appendProfileData:function(data,hash,id){for(var key in data){if(jQuery.isFunction(WPGroHo.renderers[key])){return WPGroHo.renderers[key](data[key],hash,id,key);} jQuery('#'+id).find('h4').after(jQuery('

').html(data[key]));}}},WPGroHo);jQuery(document).ready(function(){Gravatar.profile_cb=function(h,d){WPGroHo.syncProfileData(h,d);};Gravatar.my_hash=WPGroHo.my_hash;Gravatar.init('body','#wpadminbar');}); ;var addComment={moveForm:function(a,b,c,d){var e,f=this,g=f.I(a),h=f.I(c),i=f.I("cancel-comment-reply-link"),j=f.I("comment_parent"),k=f.I("comment_post_ID");if(g&&h&&i&&j){f.respondId=c,d=d||!1,f.I("wp-temp-form-div")||(e=document.createElement("div"),e.id="wp-temp-form-div",e.style.display="none",h.parentNode.insertBefore(e,h)),g.parentNode.insertBefore(h,g.nextSibling),k&&d&&(k.value=d),j.value=b,i.style.display="",i.onclick=function(){var a=addComment,b=a.I("wp-temp-form-div"),c=a.I(a.respondId);if(b&&c)return a.I("comment_parent").value="0",b.parentNode.insertBefore(c,b),b.parentNode.removeChild(b),this.style.display="none",this.onclick=null,!1};try{f.I("comment").focus()}catch(l){}return!1}},I:function(a){return document.getElementById(a)}}; ;/** HoverIntent minified */ (function(e){e.fn.hoverIntent=function(t,n,r){var i={sensitivity:7,interval:100,timeout:0};i=e.extend(i,n?{over:t,out:n}:t);var s,o,u,a;var f=function(e){s=e.pageX;o=e.pageY};var l=function(t,n){n.hoverIntent_t=clearTimeout(n.hoverIntent_t);if(Math.abs(u-s)+Math.abs(a-o) »'),s=function(t){var n=e(this),r=u(n);clearTimeout(r.sfTimer);n.showSuperfishUl().siblings().hideSuperfishUl()},o=function(t){var r=e(this),i=u(r),o=n.op;var a=function(){o.retainPath=e.inArray(r[0],o.$path)>-1;r.hideSuperfishUl();if(o.$path.length&&r.parents("li."+o.hoverClass).length<1){o.onIdle.call();e.proxy(s,o.$path,t)()}};if(t.type!=="mouseleave"&&t.type!=="focusout"){a()}else{clearTimeout(i.sfTimer);i.sfTimer=setTimeout(a,o.delay)}},u=function(t){if(t.hasClass(r.menuClass)){e.error("Superfish requires you to update to a version of hoverIntent that supports event-delegation, such as this one: https://github.com/joeldbirch/onHoverIntent")}var i=t.closest("."+r.menuClass)[0];n.op=n.o[i.serial];return i},a=function(t){var r="li:has(ul)";if(!n.op.useClick){if(e.fn.hoverIntent&&!n.op.disableHI){t.hoverIntent(s,o,r)}else{t.on("mouseenter",r,s).on("mouseleave",r,o)}}t.on("focusin","li",s).on("focusout","li",o).on("click","a",l).on("touchstart","a",f)},f=function(){var t=e(this);if(!t.next("ul").is(":visible")){e(this).data("follow",false)}},l=function(t){var r=e(this),i=r.next("ul"),u=r.data("follow")===false?false:true;if(i.length&&(n.op.useClick||!u)){t.preventDefault();if(!i.is(":visible")){e.proxy(s,r.parent(),t)()}else if(n.op.useClick&&u){e.proxy(o,r.parent(),t)()}}},c=function(t,n){if(n.autoArrows){t.children("a").each(function(){h(e(this))})}},h=function(e){e.addClass(r.anchorClass).append(i.clone())};return this.addClass(r.menuClass).each(function(){var i=this.serial=n.o.length;var s=e.extend({},n.defaults,t);var o=e(this);var u=o.find("li:has(ul)");s.$path=o.find("li."+s.pathClass).slice(0,s.pathLevels).each(function(){e(this).addClass(s.hoverClass+" "+r.bcClass).filter("li:has(ul)").removeClass(s.pathClass)});n.o[i]=n.op=s;c(u,s);a(o);u.not("."+r.bcClass).hideSuperfishUl();s.onInit.call(this)})};var t=e.fn.superfish;t.o=[];t.op={};t.c={bcClass:"sf-breadcrumb",menuClass:"sf-js-enabled",anchorClass:"sf-with-ul",arrowClass:"sf-sub-indicator"};t.defaults={hoverClass:"sfHover",pathClass:"overideThisToUse",pathLevels:1,delay:800,animation:{opacity:"show"},animationOut:{opacity:"hide"},speed:"normal",speedOut:"fast",autoArrows:true,disableHI:false,useClick:false,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){},onIdle:function(){}};e.fn.extend({hideSuperfishUl:function(){var n=t.op,r=this,i=n.retainPath===true?n.$path:"";n.retainPath=false;var s=e("li."+n.hoverClass,this).add(this).not(i).find(">ul").stop().animate(n.animationOut,n.speedOut,function(){s=e(this);s.parent().removeClass(n.hoverClass);n.onHide.call(s);if(t.op.useClick){r.children("a").data("follow",false)}});return this},showSuperfishUl:function(){var e=t.op,n=this,r=this.find(">ul:hidden");r.parent("li").addClass(e.hoverClass);e.onBeforeShow.call(r);r.stop().animate(e.animation,e.speed,function(){e.onShow.call(r);n.children("a").data("follow",true)});return this}})})(jQuery); /** Supersubs Minified */ (function(e){e.fn.supersubs=function(t){var n=e.extend({},e.fn.supersubs.defaults,t);return this.each(function(){var t=e(this);var r=e.meta?e.extend({},n,t.data()):n;var i=e('

').css({padding:0,position:"absolute",top:"-999em",width:"auto"}).appendTo(t).width();e("#menu-fontsize").remove();$ULs=t.find("ul");$ULs.each(function(t){var n=$ULs.eq(t);var s=n.children();var u=s.children("a");var a=s.css("white-space","nowrap").css("float");var f=n.add(s).add(u).css({"float":"none",width:"auto"}).end().end()[0].clientWidth/i;f+=r.extraWidth;if(f>r.maxWidth){f=r.maxWidth}else if(ful",this);var n=t.css("left")!==undefined?"left":"right";t.css(n,f)})})})};e.fn.supersubs.defaults={minWidth:9,maxWidth:25,extraWidth:0}})(jQuery); ;(function($){function infinityMenu(){$('ul.sf-menu, .menu ul').supersubs({minWidth:16,maxWidth:27,extraWidth:1}).superfish({delay:100,speed:'fast',animation:{opacity:'show',height:'show'},dropShadows:false});$('ul.sf-menu li:last-child a, .menu ul li:last-child a').css('border-bottom','none');} function infinityEqualHeightCols(){var contentHeight=$('#content').height();var sidebarHeight=$('#sidebar').height();var highestCol=Math.max(contentHeight,sidebarHeight);if(contentHeight>1):parseInt(o.left,10)+mid)+'px',top:(o.top=='auto'?tp.y-ep.y+(target.offsetHeight>>1):parseInt(o.top,10)+mid)+'px'})} el.setAttribute('role','progressbar') self.lines(el,self.opts) if(!useCssAnimations){var i=0,start=(o.lines-1)*(1-o.direction)/2,alpha,fps=o.fps,f=fps/o.speed,ostep=(1-o.opacity)/(f*o.trail/100),astep=f/o.lines;(function anim(){i++;for(var j=0;j>1)+'px'})} for(;i',attr)} sheet.addRule('.spin-vml','behavior:url(#default#VML)') Spinner.prototype.lines=function(el,o){var r=o.length+o.width,s=2*r function grp(){return css(vml('group',{coordsize:s+' '+s,coordorigin:-r+' '+-r}),{width:s,height:s})} var margin=-(o.width+o.length)*2+'px',g=css(grp(),{position:'absolute',top:margin,left:margin}),i function seg(i,dx,filter){ins(g,ins(css(grp(),{rotation:360/o.lines*i+'deg',left:~~dx}),ins(css(vml('roundrect',{arcsize:o.corners}),{width:r,height:o.width,left:o.radius,top:-o.width>>1,filter:filter}),vml('fill',{color:o.color,opacity:o.opacity}),vml('stroke',{opacity:0}))))} if(o.shadow) for(i=1;i<=o.lines;i++) seg(i,-2,'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)') for(i=1;i<=o.lines;i++)seg(i) return ins(el,g)} Spinner.prototype.opacity=function(el,i,val,o){var c=el.firstChild o=o.shadow&&o.lines||0 if(c&&i+o').addClass('jp-carousel-overlay').css({'position':'absolute','top':0,'right':0,'bottom':0,'left':0});var buttons='';if(1===Number(jetpackCarouselStrings.is_logged_in)){} buttons=$('');caption=$('

');photo_info=$('').append(caption);imageMeta=$('
').addClass('jp-carousel-image-meta').css({'float':'right','margin-top':'20px','width':'250px'});imageMeta.append(buttons).append('').append('').append('');titleAndDescription=$('
').addClass('jp-carousel-titleanddesc').css({'width':'100%','margin-top':imageMeta.css('margin-top')});var commentFormMarkup='';commentForm=$(commentFormMarkup).css({'width':'100%','margin-top':'20px','color':'#999'});comments=$('
').addClass('jp-carousel-comments').css({'width':'100%','bottom':'10px','margin-top':'20px'});var commentsLoading=$('').css({'width':'100%','bottom':'10px','margin-top':'20px'});var leftWidth=($(window).width()-(screenPadding*2))-(imageMeta.width()+40);leftWidth+='px';leftColWrapper=$('
').addClass('jp-carousel-left-column-wrapper').css({'width':Math.floor(leftWidth)}).append(titleAndDescription).append(commentForm).append(comments).append(commentsLoading);var fadeaway=$('
').addClass('jp-carousel-fadeaway');info=$('
').addClass('jp-carousel-info').css({'top':Math.floor(($(window).height()/100)*proportion),'left':screenPadding,'right':screenPadding}).append(photo_info).append(imageMeta);if(window.innerWidth<=760){photo_info.remove().insertAfter(titleAndDescription);info.prepend(leftColWrapper);} else{info.append(leftColWrapper);} var targetBottomPos=($(window).height()-parseInt(info.css('top'),10))+'px';nextButton=$('
').addClass('jp-carousel-next-button').css({'right':'15px'});previousButton=$('
').addClass('jp-carousel-previous-button').css({'left':0});nextButton.add(previousButton).css({'position':'fixed','top':'40px','bottom':targetBottomPos,'width':screenPadding});gallery=$('
').addClass('jp-carousel').css({'position':'absolute','top':0,'bottom':targetBottomPos,'left':0,'right':0});close_hint=$('').css({position:'fixed'});container=$('
').addClass('jp-carousel-wrap').addClass('jp-carousel-transitions');if('white'===jetpackCarouselStrings.background_color){container.addClass('jp-carousel-light');} container.css({'position':'fixed','top':0,'right':0,'bottom':0,'left':0,'z-index':2147483647,'overflow-x':'hidden','overflow-y':'auto','direction':'ltr'}).hide().append(overlay).append(gallery).append(fadeaway).append(info).append(nextButton).append(previousButton).append(close_hint).appendTo($('body')).click(function(e){var target=$(e.target),wrap=target.parents('div.jp-carousel-wrap'),data=wrap.data('carousel-extra'),slide=wrap.find('div.selected'),attachment_id=slide.data('attachment-id');data=data||[];if(target.is(gallery)||target.parents().add(target).is(close_hint)){container.jp_carousel('close');}else if(target.hasClass('jp-carousel-commentlink')){e.preventDefault();e.stopPropagation();$(window).unbind('keydown',keyListener);container.animate({scrollTop:parseInt(info.position()['top'],10)},'fast');$('#jp-carousel-comment-form-submit-and-info-wrapper').slideDown('fast');$('#jp-carousel-comment-form-comment-field').focus();}else if(target.hasClass('jp-carousel-comment-login')){var url=jetpackCarouselStrings.login_url+'%23jp-carousel-'+attachment_id;window.location.href=url;}else if(target.parents('#jp-carousel-comment-form-container').length){var textarea=$('#jp-carousel-comment-form-comment-field').blur(function(){$(window).bind('keydown',keyListener);}).focus(function(){$(window).unbind('keydown',keyListener);});var emailField=$('#jp-carousel-comment-form-email-field').blur(function(){$(window).bind('keydown',keyListener);}).focus(function(){$(window).unbind('keydown',keyListener);});var authorField=$('#jp-carousel-comment-form-author-field').blur(function(){$(window).bind('keydown',keyListener);}).focus(function(){$(window).unbind('keydown',keyListener);});var urlField=$('#jp-carousel-comment-form-url-field').blur(function(){$(window).bind('keydown',keyListener);}).focus(function(){$(window).unbind('keydown',keyListener);});if(textarea&&textarea.attr('id')===target.attr('id')){$(window).unbind('keydown',keyListener);$('#jp-carousel-comment-form-submit-and-info-wrapper').slideDown('fast');}else if(target.is('input[type="submit"]')){e.preventDefault();e.stopPropagation();$('#jp-carousel-comment-form-spinner').spin('small','white');var ajaxData={action:'post_attachment_comment',nonce:jetpackCarouselStrings.nonce,blog_id:data['blog_id'],id:attachment_id,comment:textarea.val()};if(!ajaxData['comment'].length){gallery.jp_carousel('postCommentError',{'field':'jp-carousel-comment-form-comment-field','error':jetpackCarouselStrings.no_comment_text});return;} if(1!==Number(jetpackCarouselStrings.is_logged_in)){ajaxData['email']=emailField.val();ajaxData['author']=authorField.val();ajaxData['url']=urlField.val();if(1===Number(jetpackCarouselStrings.require_name_email)){if(!ajaxData['email'].length||!ajaxData['email'].match('@')){gallery.jp_carousel('postCommentError',{'field':'jp-carousel-comment-form-email-field','error':jetpackCarouselStrings.no_comment_email});return;}else if(!ajaxData['author'].length){gallery.jp_carousel('postCommentError',{'field':'jp-carousel-comment-form-author-field','error':jetpackCarouselStrings.no_comment_author});return;}}} $.ajax({type:'POST',url:jetpackCarouselStrings.ajaxurl,data:ajaxData,dataType:'json',success:function(response){if('approved'===response.comment_status){$('#jp-carousel-comment-post-results').slideUp('fast').html('').slideDown('fast');}else if('unapproved'===response.comment_status){$('#jp-carousel-comment-post-results').slideUp('fast').html('').slideDown('fast');}else{$('#jp-carousel-comment-post-results').slideUp('fast').html('').slideDown('fast');} gallery.jp_carousel('clearCommentTextAreaValue');gallery.jp_carousel('getComments',{attachment_id:attachment_id,offset:0,clear:true});$('#jp-carousel-comment-form-button-submit').val(jetpackCarouselStrings.post_comment);$('#jp-carousel-comment-form-spinner').spin(false);},error:function(){gallery.jp_carousel('postCommentError',{'field':'jp-carousel-comment-form-comment-field','error':jetpackCarouselStrings.comment_post_error});return;}});}}else if(!target.parents('.jp-carousel-info').length){container.jp_carousel('next');}}).bind('jp_carousel.afterOpen',function(){$(window).bind('keydown',keyListener);$(window).bind('resize',resizeListener);gallery.opened=true;resizeListener();}).bind('jp_carousel.beforeClose',function(){var scroll=$(window).scrollTop();$(window).unbind('keydown',keyListener);$(window).unbind('resize',resizeListener);$(window).scrollTop(scroll);}).bind('jp_carousel.afterClose',function(){if(history.pushState){history.pushState('',document.title,window.location.pathname+window.location.search);}else{last_known_location_hash='';window.location.hash='';} gallery.opened=false;}).on('transitionend.jp-carousel ','.jp-carousel-slide',function(e){if('transform'===e.originalEvent.propertyName){var transitionMultiplier=((Date.now()-transitionBegin)/1000)/e.originalEvent.elapsedTime;container.off('transitionend.jp-carousel');if(transitionMultiplier>=2){$('.jp-carousel-transitions').removeClass('jp-carousel-transitions');}}});$('.jp-carousel-wrap').touchwipe({wipeLeft:function(e){e.preventDefault();gallery.jp_carousel('next');},wipeRight:function(e){e.preventDefault();gallery.jp_carousel('previous');},preventDefaultEvents:false});$('.jetpack-likes-widget-unloaded').each(function(){jetpackLikesWidgetQueue.push(this.id);});nextButton.add(previousButton).click(function(e){e.preventDefault();e.stopPropagation();if(nextButton.is(this)){gallery.jp_carousel('next');}else{gallery.jp_carousel('previous');}});}};var methods={testForData:function(gallery){gallery=$(gallery);return!(!gallery.length||!gallery.data('carousel-extra'));},testIfOpened:function(){return!!('undefined'!==typeof(gallery)&&'undefined'!==typeof(gallery.opened)&&gallery.opened);},openOrSelectSlide:function(index){if(!$(this).jp_carousel('testIfOpened')){$(this).jp_carousel('open',{start_index:index});}else{gallery.jp_carousel('selectSlideAtIndex',index);}},open:function(options){var settings={'items_selector':'.gallery-item [data-attachment-id], .tiled-gallery-item [data-attachment-id]','start_index':0},data=$(this).data('carousel-extra');if(!data){return;} prepareGallery(data);if(gallery.jp_carousel('testIfOpened')){return;} originalOverflow=$('body').css('overflow');$('body').css('overflow','hidden');originalHOverflow=$('html').css('overflow');$('html').css('overflow','hidden');jQuery('.slim-likes-widget').find('iframe').css('display','inline-block').css('width','60px');container.data('carousel-extra',data);return this.each(function(){var $this=$(this);if(options){$.extend(settings,options);} if(-1===settings.start_index){settings.start_index=0;} container.trigger('jp_carousel.beforeOpen').fadeIn('fast',function(){container.trigger('jp_carousel.afterOpen');gallery.jp_carousel('initSlides',$this.find(settings.items_selector),settings.start_index).jp_carousel('selectSlideAtIndex',settings.start_index);});gallery.html('');});},selectSlideAtIndex:function(index){var slides=this.jp_carousel('slides'),selected=slides.eq(index);if(0===selected.length){selected=slides.eq(0);} gallery.jp_carousel('selectSlide',selected,false);return this;},close:function(){$('body').css('overflow',originalOverflow);$('html').css('overflow',originalHOverflow);return container.trigger('jp_carousel.beforeClose').fadeOut('fast',function(){container.trigger('jp_carousel.afterClose');});},next:function(){var slide=gallery.jp_carousel('nextSlide');container.animate({scrollTop:0},'fast');if(slide){this.jp_carousel('selectSlide',slide);}},previous:function(){var slide=gallery.jp_carousel('prevSlide');container.animate({scrollTop:0},'fast');if(slide){this.jp_carousel('selectSlide',slide);}},resetButtons:function(current){if(current.data('liked')){$('.jp-carousel-buttons a.jp-carousel-like').addClass('liked').text(jetpackCarouselStrings.unlike);}else{$('.jp-carousel-buttons a.jp-carousel-like').removeClass('liked').text(jetpackCarouselStrings.like);}},selectedSlide:function(){return this.find('.selected');},setSlidePosition:function(x){transitionBegin=Date.now();return this.css({'-webkit-transform':'translate3d('+x+'px,0,0)','-moz-transform':'translate3d('+x+'px,0,0)','-ms-transform':'translate('+x+'px,0)','-o-transform':'translate('+x+'px,0)','transform':'translate3d('+x+'px,0,0)'});},updateSlidePositions:function(animate){var current=this.jp_carousel('selectedSlide'),galleryWidth=gallery.width(),currentWidth=current.width(),previous=gallery.jp_carousel('prevSlide'),next=gallery.jp_carousel('nextSlide'),previousPrevious=previous.prev(),nextNext=next.next(),left=Math.floor((galleryWidth-currentWidth)*0.5);current.jp_carousel('setSlidePosition',left).show();gallery.jp_carousel('fitInfo',animate);var direction=lastSelectedSlide.is(current.prevAll())?1:-1;if(1===direction){if(!nextNext.is(previous)){nextNext.jp_carousel('setSlidePosition',galleryWidth+next.width()).show();} if(!previousPrevious.is(next)){previousPrevious.jp_carousel('setSlidePosition',-previousPrevious.width()-currentWidth).show();}}else{if(!nextNext.is(previous)){nextNext.jp_carousel('setSlidePosition',galleryWidth+currentWidth).show();}} previous.jp_carousel('setSlidePosition',Math.floor(-previous.width()+(screenPadding*0.75))).show();next.jp_carousel('setSlidePosition',Math.ceil(galleryWidth-(screenPadding*0.75))).show();},selectSlide:function(slide,animate){lastSelectedSlide=this.find('.selected').removeClass('selected');var slides=gallery.jp_carousel('slides').css({'position':'fixed'}),current=$(slide).addClass('selected').css({'position':'relative'}),attachmentId=current.data('attachment-id'),previous=gallery.jp_carousel('prevSlide'),next=gallery.jp_carousel('nextSlide'),previousPrevious=previous.prev(),nextNext=next.next(),animated,captionHtml;gallery.jp_carousel('loadFullImage',current);caption.hide();if(next.length===0&&slides.length<=2){$('.jp-carousel-next-button').hide();}else{$('.jp-carousel-next-button').show();} if(previous.length===0&&slides.length<=2){$('.jp-carousel-previous-button').hide();}else{$('.jp-carousel-previous-button').show();} animated=current.add(previous).add(previousPrevious).add(next).add(nextNext).jp_carousel('loadSlide');slides.not(animated).hide();gallery.jp_carousel('updateSlidePositions',animate);gallery.jp_carousel('resetButtons',current);container.trigger('jp_carousel.selectSlide',[current]);gallery.jp_carousel('getTitleDesc',{title:current.data('title'),desc:current.data('desc')});gallery.jp_carousel('loadLikes',attachmentId);gallery.jp_carousel('updateLikesWidgetVisibility',attachmentId);if(next.length>0){gallery.jp_carousel('loadLikes',next.data('attachment-id'));} if(previous.length>0){gallery.jp_carousel('loadLikes',previous.data('attachment-id'));} var imageMeta=current.data('image-meta');gallery.jp_carousel('updateExif',imageMeta);gallery.jp_carousel('updateFullSizeLink',current);gallery.jp_carousel('updateMap',imageMeta);gallery.jp_carousel('testCommentsOpened',current.data('comments-opened'));gallery.jp_carousel('getComments',{'attachment_id':attachmentId,'offset':0,'clear':true});$('#jp-carousel-comment-post-results').slideUp();if(current.data('caption')){captionHtml=$('
').text(current.data('caption')).html();if(captionHtml===$('
').text(current.data('title')).html()){$('.jp-carousel-titleanddesc-title').fadeOut('fast').empty();} if(captionHtml===$('
').text(current.data('desc')).html()){$('.jp-carousel-titleanddesc-desc').fadeOut('fast').empty();} caption.html(current.data('caption')).fadeIn('slow');}else{caption.fadeOut('fast').empty();} $(next).add(previous).each(function(){gallery.jp_carousel('loadFullImage',$(this));});window.location.hash=last_known_location_hash='#jp-carousel-'+attachmentId;},slides:function(){return this.find('.jp-carousel-slide');},slideDimensions:function(){return{width:$(window).width()-(screenPadding*2),height:Math.floor($(window).height()/100*proportion-60)};},loadSlide:function(){return this.each(function(){var slide=$(this);slide.find('img').one('load',function(){slide.jp_carousel('fitSlide',false);});});},bestFit:function(){var max=gallery.jp_carousel('slideDimensions'),orig=this.jp_carousel('originalDimensions'),orig_ratio=orig.width/orig.height,w_ratio=1,h_ratio=1,width,height;if(orig.width>max.width){w_ratio=max.width/orig.width;} if(orig.height>max.height){h_ratio=max.height/orig.height;} if(w_ratio')[0].src=$(items[start_index]).data('gallery-src');} var useInPageThumbnails=items.first().closest('.tiled-gallery.type-rectangular').length>0;items.each(function(i){var src_item=$(this),attachment_id=src_item.data('attachment-id')||0,comments_opened=src_item.data('comments-opened')||0,image_meta=src_item.data('image-meta')||{},orig_size=src_item.data('orig-size')||'',thumb_size={width:src_item[0].naturalWidth,height:src_item[0].naturalHeight},title=src_item.data('image-title')||'',description=src_item.data('image-description')||'',caption=src_item.parents('.gallery-item').find('.gallery-caption').html()||'',src=src_item.data('gallery-src')||'',medium_file=src_item.data('medium-file')||'',large_file=src_item.data('large-file')||'',orig_file=src_item.data('orig-file')||'';var tiledCaption=src_item.parents('div.tiled-gallery-item').find('div.tiled-gallery-caption').html();if(tiledCaption){caption=tiledCaption;} if(attachment_id&&orig_size.length){title=gallery.jp_carousel('texturize',title);description=gallery.jp_carousel('texturize',description);caption=gallery.jp_carousel('texturize',caption);var image=$('').attr('src','data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7').css('width','100%').css('height','100%');var slide=$('').hide().css({'left':i1){args.max_width=args.max_width*window.devicePixelRatio;args.max_height=args.max_height*window.devicePixelRatio;} if(large_width>=args.max_width||large_height>=args.max_height){return args.large_file;} if(medium_width>=args.max_width||medium_height>=args.max_height){return args.medium_file;} return args.orig_file;},originalDimensions:function(){var splitted=$(this).data('orig-size').split(',');return{width:parseInt(splitted[0],10),height:parseInt(splitted[1],10)};},format:function(args){if('object'!==typeof args){args={};} if(!args.text||'undefined'===typeof args.text){return;} if(!args.replacements||'undefined'===typeof args.replacements){return args.text;} return args.text.replace(/{(\d+)}/g,function(match,number){return typeof args.replacements[number]!=='undefined'?args.replacements[number]:match;});},shutterSpeed:function(d){if(d>=1){return Math.round(d*10)/10+'s';} var df=1,top=1,bot=1;var tol=1e-8;while(df!==d&&Math.abs(df-d)>tol){if(df1){bot=Math.round(bot/top);top=1;} if(bot<=1){return'1s';} return top+'/'+bot+'s';},parseTitleDesc:function(value){if(!value.match(' ')&&value.match('_')){return'';} $(['CIMG','DSC_','DSCF','DSCN','DUW','GEDC','IMG','JD','MGP','PICT','Imagen','Foto','DSC','Scan','SANY','SAM','Screen Shot [0-9]+']).each(function(key,val){var regex=new RegExp('^'+val);if(regex.test(value)){value='';return;}});return value;},getTitleDesc:function(data){var title='',desc='',markup='',target;target=$('div.jp-carousel-titleanddesc','div.jp-carousel-wrap');target.hide();title=gallery.jp_carousel('parseTitleDesc',data.title)||'';desc=gallery.jp_carousel('parseTitleDesc',data.desc)||'';if(title.length||desc.length){if($('
').text(title).html()===$('
').text(desc).html()){title='';} markup=(title.length)?'':'';markup+=(desc.length)?'':'';target.html(markup).fadeIn('slow');} $('div#jp-carousel-comment-form-container').css('margin-top','20px');$('div#jp-carousel-comments-loading').css('margin-top','20px');},updateLikesWidgetVisibility:function(attachmentId){if('undefined'===typeof jetpackLikesWidgetQueue){return;} $('.jp-carousel-buttons .jetpack-likes-widget-wrapper').css('display','none').each(function(){var widgetWrapper=$(this);if(widgetWrapper.attr('data-attachment-id')==attachmentId){widgetWrapper.css('display','inline-block');return false;}});},loadLikes:function(attachmentId){var dataCarouselExtra=$('.jp-carousel-wrap').data('carousel-extra');var blogId=dataCarouselExtra.likes_blog_id;if($('#like-post-wrapper-'+blogId+'-'+attachmentId).length===0){var protocol='http';var originDomain='http://wordpress.com/';if(dataCarouselExtra.permalink.length){protocol=dataCarouselExtra.permalink.split(':')[0];if((protocol!=='http')&&(protocol!=='https')){protocol='http';} var parts=dataCarouselExtra.permalink.split('../index.html');if(parts.length>=2){originDomain=protocol+'://'+parts[2];}} var dataSource=protocol+'://widgets.wp.com/likes/#blog_id='+encodeURIComponent(blogId)+'&post_id='+encodeURIComponent(attachmentId)+'&slim=1&origin='+encodeURIComponent(originDomain);if('en'!==jetpackCarouselStrings.lang){dataSource+='&lang='+encodeURIComponent(jetpackCarouselStrings.lang);} var likesWidget=$('').attr('name','like-post-frame-'+blogId+'-'+attachmentId).attr('src',dataSource).css('display','inline-block');var likesWidgetWrapper=$('
').addClass('jetpack-likes-widget-wrapper jetpack-likes-widget-unloaded slim-likes-widget').attr('id','like-post-wrapper-'+blogId+'-'+attachmentId).attr('data-src',dataSource).attr('data-name','like-post-frame-'+blogId+'-'+attachmentId).attr('data-attachment-id',attachmentId).css('display','none').css('vertical-align','middle').append(likesWidget).append('
');$('.jp-carousel-buttons').append(likesWidgetWrapper);}},updateExif:function(meta){if(!meta||1!==Number(jetpackCarouselStrings.display_exif)){return false;} var $ul=$('');$.each(meta,function(key,val){if(0===parseFloat(val)||!val.length||-1===$.inArray(key,['camera','aperture','shutter_speed','focal_length'])){return;} switch(key){case'focal_length':val=val+'mm';break;case'shutter_speed':val=gallery.jp_carousel('shutterSpeed',val);break;case'aperture':val='f/'+val;break;} $ul.append('
  • '+jetpackCarouselStrings[key]+'
    '+val+'
  • ');});$('div.jp-carousel-image-meta ul.jp-carousel-image-exif').replaceWith($ul);},updateFullSizeLink:function(current){if(!current||!current.data){return false;} var original=current.data('orig-file').replace(/\?.+$/,''),origSize=current.data('orig-size').split(','),permalink=$(''+gallery.jp_carousel('format',{'text':jetpackCarouselStrings.download_original,'replacements':origSize})+'').addClass('jp-carousel-image-download').attr('href',original).attr('target','_blank');$('div.jp-carousel-image-meta a.jp-carousel-image-download').replaceWith(permalink);},updateMap:function(meta){if(!meta.latitude||!meta.longitude||1!==Number(jetpackCarouselStrings.display_geo)){return;} var latitude=meta.latitude,longitude=meta.longitude,$metabox=$('div.jp-carousel-image-meta','div.jp-carousel-wrap'),$mapbox=$('
    '),style='&scale=2&style=feature:all|element:all|invert_lightness:true|hue:0x0077FF|saturation:-50|lightness:-5|gamma:0.91';$mapbox.addClass('jp-carousel-image-map').html('\ \
    \ \ ').prependTo($metabox);},testCommentsOpened:function(opened){if(1===parseInt(opened,10)){$('.jp-carousel-buttons').fadeIn('fast');commentForm.fadeIn('fast');}else{$('.jp-carousel-buttons').fadeOut('fast');commentForm.fadeOut('fast');}},getComments:function(args){clearInterval(commentInterval);if('object'!==typeof args){return;} if('undefined'===typeof args.attachment_id||!args.attachment_id){return;} if(!args.offset||'undefined'===typeof args.offset||args.offset<1){args.offset=0;} var comments=$('.jp-carousel-comments'),commentsLoading=$('#jp-carousel-comments-loading').show();if(args.clear){comments.hide().empty();} $.ajax({type:'GET',url:jetpackCarouselStrings.ajaxurl,dataType:'json',data:{action:'get_attachment_comments',nonce:jetpackCarouselStrings.nonce,id:args.attachment_id,offset:args.offset},success:function(data){if(args.clear){comments.fadeOut('fast').empty();} $(data).each(function(){var comment=$('
    ').addClass('jp-carousel-comment').attr('id','jp-carousel-comment-'+this['id']).html('
    '+ this['gravatar_markup']+'
    '+'
    '+ this['author_markup']+'
    '+'
    '+ this['date_gmt']+'
    '+'
    '+ this['content']+'
    ');comments.append(comment);clearInterval(commentInterval);commentInterval=setInterval(function(){if(($('.jp-carousel-overlay').height()-150)<$('.jp-carousel-wrap').scrollTop()+$(window).height()){gallery.jp_carousel('getComments',{attachment_id:args.attachment_id,offset:args.offset+10,clear:false});clearInterval(commentInterval);}},300);});var current=$('.jp-carousel div.selected');if(current&¤t.data&¤t.data('attachment-id')!=args.attachment_id){comments.fadeOut('fast');comments.empty();return;} $('.jp-carousel-overlay').height($(window).height()+titleAndDescription.height()+commentForm.height()+((comments.height()>0)?comments.height():imageMeta.height())+200);comments.show();commentsLoading.hide();},error:function(xhr,status,error){console.log('Comment get fail...',xhr,status,error);comments.fadeIn('fast');commentsLoading.fadeOut('fast');}});},postCommentError:function(args){if('object'!==typeof args){args={};} if(!args.field||'undefined'===typeof args.field||!args.error||'undefined'===typeof args.error){return;} $('#jp-carousel-comment-post-results').slideUp('fast').html('').slideDown('fast');$('#jp-carousel-comment-form-spinner').spin(false);},setCommentIframeSrc:function(attachment_id){var iframe=$('#jp-carousel-comment-iframe');if(iframe&&iframe.length){iframe.attr('src',iframe.attr('src').replace(/(postid=)\d+/,'$1'+attachment_id));iframe.attr('src',iframe.attr('src').replace(/(%23.+)?$/,'%23jp-carousel-'+attachment_id));}},clearCommentTextAreaValue:function(){var commentTextArea=$('#jp-carousel-comment-form-comment-field');if(commentTextArea){commentTextArea.val('');}},nextSlide:function(){var slides=this.jp_carousel('slides');var selected=this.jp_carousel('selectedSlide');if(selected.length===0||(slides.length>2&&selected.is(slides.last()))){return slides.first();} return selected.next();},prevSlide:function(){var slides=this.jp_carousel('slides');var selected=this.jp_carousel('selectedSlide');if(selected.length===0||(slides.length>2&&selected.is(slides.first()))){return slides.last();} return selected.prev();},loadFullImage:function(slide){var image=slide.find('img:first');if(!image.data('loaded')){image.on('load.jetpack',function(){image.off('load.jetpack');$(this).closest('.jp-carousel-slide').css('background-image','');});if(!slide.data('preview-image')||(slide.data('thumb-size')&&slide.width()>slide.data('thumb-size').width)){image.attr('src',image.closest('.jp-carousel-slide').data('src'));}else{image.attr('src',slide.data('preview-image'));} image.data('loaded',1);}}};$.fn.jp_carousel=function(method){if(methods[method]){return methods[method].apply(this,Array.prototype.slice.call(arguments,1));}else if(typeof method==='object'||!method){return methods.open.apply(this,arguments);}else{$.error('Method '+method+' does not exist on jQuery.jp_carousel');}};$(document.body).on('click','div.gallery,div.tiled-gallery',function(e){if(!$(this).jp_carousel('testForData',e.currentTarget)){return;} if($(e.target).parent().hasClass('gallery-caption')){return;} e.preventDefault();e.stopPropagation();$(this).jp_carousel('open',{start_index:$(this).find('.gallery-item, .tiled-gallery-item').index($(e.target).parents('.gallery-item, .tiled-gallery-item'))});});$(window).on('hashchange',function(){var hashRegExp=/jp-carousel-(\d+)/,matches,attachmentId,galleries,selectedThumbnail;if(!window.location.hash||!hashRegExp.test(window.location.hash)){return;} if(window.location.hash===last_known_location_hash){return;} last_known_location_hash=window.location.hash;matches=window.location.hash.match(hashRegExp);attachmentId=parseInt(matches[1],10);galleries=$('div.gallery, div.tiled-gallery');galleries.each(function(_,galleryEl){$(galleryEl).find('img').each(function(imageIndex,imageEl){if($(imageEl).data('attachment-id')===parseInt(attachmentId,10)){selectedThumbnail={index:imageIndex,gallery:galleryEl};return false;}});if(selectedThumbnail){$(selectedThumbnail.gallery).jp_carousel('openOrSelectSlide',selectedThumbnail.index);}});});if(window.location.hash){$(window).trigger('hashchange');}});(function($){$.fn.touchwipe=function(settings){var config={min_move_x:20,min_move_y:20,wipeLeft:function(){},wipeRight:function(){},wipeUp:function(){},wipeDown:function(){},preventDefaultEvents:true};if(settings){$.extend(config,settings);} this.each(function(){var startX;var startY;var isMoving=false;function cancelTouch(){this.removeEventListener('touchmove',onTouchMove);startX=null;isMoving=false;} function onTouchMove(e){if(config.preventDefaultEvents){e.preventDefault();} if(isMoving){var x=e.touches[0].pageX;var y=e.touches[0].pageY;var dx=startX-x;var dy=startY-y;if(Math.abs(dx)>=config.min_move_x){cancelTouch();if(dx>0){config.wipeLeft(e);}else{config.wipeRight(e);}} else if(Math.abs(dy)>=config.min_move_y){cancelTouch();if(dy>0){config.wipeDown(e);}else{config.wipeUp(e);}}}} function onTouchStart(e) {if(e.touches.length===1){startX=e.touches[0].pageX;startY=e.touches[0].pageY;isMoving=true;this.addEventListener('touchmove',onTouchMove,false);}} if('ontouchstart'in document.documentElement){this.addEventListener('touchstart',onTouchStart,false);}});return this;};})(jQuery);;var NO_JQUERY={};(function(window,$,undefined){if(!("console"in window)){var c=window.console={};c.log=c.warn=c.error=c.debug=function(){};} if($===NO_JQUERY){$={fn:{},extend:function(){var a=arguments[0];for(var i=1,len=arguments.length;i=0&&element.offsetHeight>=0&&element.style.display!="none"&&elementOffset.top+elementSize.height>viewportOffset.top&&elementOffset.topviewportOffset.left&&elementOffset.leftelementOffset.left?'right':(viewportOffset.left+viewportSize.width)<(elementOffset.left+elementSize.width)?'left':'both');visiblePartY=(viewportOffset.top>elementOffset.top?'bottom':(viewportOffset.top+viewportSize.height)<(elementOffset.top+elementSize.height)?'top':'both');visiblePartsMerged=visiblePartX+"-"+visiblePartY;if(!inView||inView!==visiblePartsMerged){$element.data('inview',visiblePartsMerged).trigger('inview',[true,visiblePartX,visiblePartY]);}}else if(inView){$element.data('inview',false).trigger('inview',[false]);}}}} $(w).bind("scroll resize",function(){viewportSize=viewportOffset=null;});if(!documentElement.addEventListener&&documentElement.attachEvent){documentElement.attachEvent("onfocusin",function(){viewportOffset=null;});} setInterval(checkInView,250);})(jQuery);;var jetpackLikesWidgetQueue=[];var jetpackLikesWidgetBatch=[];var jetpackLikesMasterReady=false;function JetpackLikespostMessage(message,target){if('string'===typeof message){try{message=JSON.parse(message);}catch(e){return;}} pm({target:target,type:'likesMessage',data:message,origin:'*'});} function JetpackLikesBatchHandler(){var requests=[];jQuery('div.jetpack-likes-widget-unloaded').each(function(){if(jetpackLikesWidgetBatch.indexOf(this.id)>-1){return;} jetpackLikesWidgetBatch.push(this.id);var regex=/like-(post|comment)-wrapper-(\d+)-(\d+)-(\w+)/,match=regex.exec(this.id),info;if(!match||match.length!==5){return;} info={blog_id:match[2],width:this.width};if('post'===match[1]){info.post_id=match[3];}else if('comment'===match[1]){info.comment_id=match[3];} info.obj_id=match[4];requests.push(info);});if(requests.length>0){JetpackLikespostMessage({event:'initialBatch',requests:requests},window.frames['likes-master']);}} function JetpackLikesMessageListener(event){if('undefined'===typeof event.event){return;} if('masterReady'===event.event){jQuery(document).ready(function(){jetpackLikesMasterReady=true;var stylesData={event:'injectStyles'},$sdTextColor=jQuery('.sd-text-color'),$sdLinkColor=jQuery('.sd-link-color');if(jQuery('iframe.admin-bar-likes-widget').length>0){JetpackLikespostMessage({event:'adminBarEnabled'},window.frames['likes-master']);stylesData.adminBarStyles={background:jQuery('#wpadminbar .quicklinks li#wp-admin-bar-wpl-like > a').css('background'),isRtl:('rtl'===jQuery('#wpadminbar').css('direction'))};} if(!window.addEventListener){jQuery('#wp-admin-bar-admin-bar-likes-widget').hide();} stylesData.textStyles={color:$sdTextColor.css('color'),fontFamily:$sdTextColor.css('font-family'),fontSize:$sdTextColor.css('font-size'),direction:$sdTextColor.css('direction'),fontWeight:$sdTextColor.css('font-weight'),fontStyle:$sdTextColor.css('font-style'),textDecoration:$sdTextColor.css('text-decoration')};stylesData.linkStyles={color:$sdLinkColor.css('color'),fontFamily:$sdLinkColor.css('font-family'),fontSize:$sdLinkColor.css('font-size'),textDecoration:$sdLinkColor.css('text-decoration'),fontWeight:$sdLinkColor.css('font-weight'),fontStyle:$sdLinkColor.css('font-style')};JetpackLikespostMessage(stylesData,window.frames['likes-master']);JetpackLikesBatchHandler();jQuery(document).on('inview','div.jetpack-likes-widget-unloaded',function(){jetpackLikesWidgetQueue.push(this.id);});});} if('showLikeWidget'===event.event){jQuery('#'+event.id+' .post-likes-widget-placeholder').fadeOut('fast',function(){jQuery('#'+event.id+' .post-likes-widget').fadeIn('fast',function(){JetpackLikespostMessage({event:'likeWidgetDisplayed',blog_id:event.blog_id,post_id:event.post_id,obj_id:event.obj_id},window.frames['likes-master']);});});} if('clickReblogFlair'===event.event){wpcom_reblog.toggle_reblog_box_flair(event.obj_id);} if('showOtherGravatars'===event.event){var $container=jQuery('#likes-other-gravatars'),$list=$container.find('ul'),offset,rowLength,height,scrollbarWidth;$container.hide();$list.html('');$container.find('.likes-text span').text(event.total);jQuery.each(event.likers,function(i,liker){$list.append('
  • '+liker.name+'
  • ');});offset=jQuery('[name=\''+event.parent+'\']').offset();$container.css('left',offset.left+event.position.left-10+'px');$container.css('top',offset.top+event.position.top-33+'px');rowLength=Math.floor(event.width/37);height=(Math.ceil(event.likers.length/rowLength)*37)+13;if(height>204){height=204;} $container.css('height',height+'px');$container.css('width',rowLength*37-7+'px');$list.css('width',rowLength*37+'px');$container.fadeIn('slow');scrollbarWidth=$list[0].offsetWidth-$list[0].clientWidth;if(scrollbarWidth>0){$container.width($container.width()+scrollbarWidth);$list.width($list.width()+scrollbarWidth);}}} pm.bind('likesMessage',function(e){JetpackLikesMessageListener(e);});jQuery(document).click(function(e){var $container=jQuery('#likes-other-gravatars');if($container.has(e.target).length===0){$container.fadeOut('slow');}});function JetpackLikesWidgetQueueHandler(){var $wrapper,wrapperID,found;if(!jetpackLikesMasterReady){setTimeout(JetpackLikesWidgetQueueHandler,500);return;} if(jetpackLikesWidgetQueue.length>0){found=false;while(jetpackLikesWidgetQueue.length>0){wrapperID=jetpackLikesWidgetQueue.splice(0,1)[0];if(jQuery('#'+wrapperID).hasClass('jetpack-likes-widget-unloaded')){found=true;break;}} if(!found){setTimeout(JetpackLikesWidgetQueueHandler,500);return;}}else if(jQuery('div.jetpack-likes-widget-unloaded').length>0){JetpackLikesBatchHandler();wrapperID=jQuery('div.jetpack-likes-widget-unloaded').first()[0].id;if(!wrapperID){setTimeout(JetpackLikesWidgetQueueHandler,500);return;}} if('undefined'===typeof wrapperID){setTimeout(JetpackLikesWidgetQueueHandler,500);return;} $wrapper=jQuery('#'+wrapperID);$wrapper.find('iframe').remove();if($wrapper.hasClass('slim-likes-widget')){$wrapper.find('.post-likes-widget-placeholder').after('');}else{$wrapper.find('.post-likes-widget-placeholder').after('');} $wrapper.removeClass('jetpack-likes-widget-unloaded').addClass('jetpack-likes-widget-loading');$wrapper.find('iframe').load(function(e){var $iframe=jQuery(e.target);$wrapper.removeClass('jetpack-likes-widget-loading').addClass('jetpack-likes-widget-loaded');JetpackLikespostMessage({event:'loadLikeWidget',name:$iframe.attr('name'),width:$iframe.width()},window.frames['likes-master']);if($wrapper.hasClass('slim-likes-widget')){$wrapper.find('iframe').Jetpack('resizeable');}});setTimeout(JetpackLikesWidgetQueueHandler,250);} JetpackLikesWidgetQueueHandler();;var sharing_js_options;if(sharing_js_options&&sharing_js_options.counts){var WPCOMSharing={done_urls:[],twitter_count:{},get_counts:function(){var https_url,http_url,url,urls,id,service,service_url;if('undefined'===typeof WPCOM_sharing_counts){return;} for(url in WPCOM_sharing_counts){id=WPCOM_sharing_counts[url];if('undefined'!==typeof WPCOMSharing.done_urls[id]){continue;} https_url=url.replace(/^http:\/\//i,'https:///');http_url=url.replace(/^https:\/\//i,'http://');urls={twitter:['https://cdn.api.twitter.com/1/urls/count.json?callback=WPCOMSharing.update_twitter_count&url='+ encodeURIComponent(http_url),'https://cdn.api.twitter.com/1/urls/count.json?callback=WPCOMSharing.update_twitter_count&url='+ encodeURIComponent(https_url)],linkedin:['https://www.linkedin.com/countserv/count/share?format=jsonp&callback=WPCOMSharing.update_linkedin_count&url='+ encodeURIComponent(url)],pinterest:[window.location.protocol+'//api.pinterest.com/v1/urls/count.json?callback=WPCOMSharing.update_pinterest_count&url='+ encodeURIComponent(url)],facebook:[window.location.protocol+'//graph.facebook.com/?callback=WPCOMSharing.update_facebook_count&ids='+ encodeURIComponent(url)]};for(service in urls){if(!jQuery('a[data-shared=sharing-'+service+'-'+id+']').length){continue;} while((service_url=urls[service].pop())){jQuery.getScript(service_url);} WPCOMSharing.bump_sharing_count_stat(service);} WPCOMSharing.done_urls[id]=true;}},get_permalink:function(url){var rxTrailingSlash,formattedSlashUrl;if('https:'===window.location.protocol){url=url.replace(/^http:\/\//i,'https:///');}else{url=url.replace(/^https:\/\//i,'http://');} if(!(url in WPCOM_sharing_counts)){rxTrailingSlash=/\/$/,formattedSlashUrl=rxTrailingSlash.test(url)?url.replace(rxTrailingSlash,''):url+'/';if(formattedSlashUrl in WPCOM_sharing_counts){url=formattedSlashUrl;}} return url;},update_facebook_count:function(data){var url,permalink;if(!data){return;} for(url in data){if(!data.hasOwnProperty(url)||!data[url].shares){continue;} permalink=WPCOMSharing.get_permalink(url);if(!(permalink in WPCOM_sharing_counts)){continue;} WPCOMSharing.inject_share_count('sharing-facebook-'+WPCOM_sharing_counts[permalink],data[url].shares);}},update_twitter_count:function(data){if('number'===typeof data.count){var permalink=WPCOMSharing.get_permalink(data.url);if(!WPCOMSharing.twitter_count[permalink]){WPCOMSharing.twitter_count[permalink]=0;} WPCOMSharing.twitter_count[permalink]+=data.count;if(WPCOMSharing.twitter_count[permalink]>0){WPCOMSharing.inject_share_count('sharing-twitter-'+WPCOM_sharing_counts[permalink],WPCOMSharing.twitter_count[permalink]);}}},update_linkedin_count:function(data){if('undefined'!==typeof data.count&&(data.count*1)>0){WPCOMSharing.inject_share_count('sharing-linkedin-'+WPCOM_sharing_counts[data.url],data.count);}},update_pinterest_count:function(data){if('undefined'!==typeof data.count&&(data.count*1)>0){WPCOMSharing.inject_share_count('sharing-pinterest-'+WPCOM_sharing_counts[data.url],data.count);}},inject_share_count:function(id,count){var $share=jQuery('a[data-shared='+id+'] > span');$share.find('.share-count').remove();$share.append('');},format_count:function(count){if(count<1000){return count;} if(count>=1000&&count<10000){return String(count).substring(0,1)+'K+';} return'10K+';},bump_sharing_count_stat:function(service){new Image().src=document.location.protocol+'//pixel.wp.com/g.gif?v=wpcom-no-pv&x_sharing-count-request='+service+'&r='+Math.random();}};} (function($){var $body,$sharing_email;$.fn.extend({share_is_email:function(){return /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(this.val());}});$body=$(document.body).on('post-load',WPCOMSharing_do);$(document).on('ready',function(){$sharing_email=$('#sharing_email');$body.append($sharing_email);WPCOMSharing_do();});function WPCOMSharing_do(){var $more_sharing_buttons;if('undefined'!==typeof WPCOMSharing){WPCOMSharing.get_counts();} $more_sharing_buttons=$('.sharedaddy a.sharing-anchor');$more_sharing_buttons.click(function(){return false;});$('.sharedaddy a').each(function(){if($(this).attr('href')&&$(this).attr('href').indexOf('share=')!==-1){$(this).attr('href',$(this).attr('href')+'&nb=1');}});$more_sharing_buttons.on('click',function(){var $more_sharing_button=$(this),$more_sharing_pane=$more_sharing_button.parents('div:first').find('.inner');if($more_sharing_pane.is(':animated')){return;} if(true===$more_sharing_pane.data('justSlid')){return;} $sharing_email.slideUp(200);$more_sharing_pane.css({left:$more_sharing_button.position().left+'px',top:$more_sharing_button.position().top+$more_sharing_button.height()+3+'px'}).slideToggle(200);});if(document.ontouchstart===undefined){$more_sharing_buttons.hover(function(){var $more_sharing_button=$(this),$more_sharing_pane=$more_sharing_button.parents('div:first').find('.inner'),timer;if(!$more_sharing_pane.is(':animated')){timer=setTimeout(function(){var handler_item_leave,handler_item_enter,handler_original_leave,handler_original_enter,close_it;$sharing_email.slideUp(200);$more_sharing_pane.data('justSlid',true);$more_sharing_pane.css({left:$more_sharing_button.position().left+'px',top:$more_sharing_button.position().top+$more_sharing_button.height()+3+'px'}).slideDown(200,function(){$more_sharing_button.data('hasoriginal',true).data('hasitem',false);setTimeout(function(){$more_sharing_pane.data('justSlid',false);},300);if($more_sharing_pane.find('.share-google-plus-1').size()){return;} $more_sharing_pane.mouseleave(handler_item_leave).mouseenter(handler_item_enter);$more_sharing_button.mouseleave(handler_original_leave).mouseenter(handler_original_enter);});handler_item_leave=function(){$more_sharing_button.data('hasitem',false);if($more_sharing_button.data('hasoriginal')===false){var timer=setTimeout(close_it,800);$more_sharing_button.data('timer2',timer);}};handler_item_enter=function(){$more_sharing_button.data('hasitem',true);clearTimeout($more_sharing_button.data('timer2'));};handler_original_leave=function(){$more_sharing_button.data('hasoriginal',false);if($more_sharing_button.data('hasitem')===false){var timer=setTimeout(close_it,800);$more_sharing_button.data('timer2',timer);}};handler_original_enter=function(){$more_sharing_button.data('hasoriginal',true);clearTimeout($more_sharing_button.data('timer2'));};close_it=function(){$more_sharing_pane.data('justSlid',true);$more_sharing_pane.slideUp(200,function(){setTimeout(function(){$more_sharing_pane.data('justSlid',false);},300);});$more_sharing_button.unbind('mouseleave',handler_original_leave).unbind('mouseenter',handler_original_enter);$more_sharing_pane.unbind('mouseleave',handler_item_leave).unbind('mouseenter',handler_item_leave);return false;};},200);$more_sharing_button.data('timer',timer);}},function(){$more_sharing_buttons.each(function(){clearTimeout($(this).data('timer'));});$more_sharing_buttons.data('timer',false);});} $(document).click(function(){$more_sharing_buttons.each(function(){clearTimeout($(this).data('timer'));});$more_sharing_buttons.data('timer',false);$('.sharedaddy .inner').slideUp();});$('.sharedaddy ul').each(function(){if('yep'===$(this).data('has-click-events')){return;} $(this).data('has-click-events','yep');var printUrl=function(uniqueId,urlToPrint){$('body:first').append('');};$(this).find('a.share-print').click(function(){var ref=$(this).attr('href'),do_print=function(){if(ref.indexOf('#print')===-1){var uid=new Date().getTime();printUrl(uid,ref);}else{print();}};if($(this).parents('.sharing-hidden').length>0){$(this).parents('.inner').slideUp(0,function(){do_print();});}else{do_print();} return false;});$(this).find('a.share-press-this').click(function(){var s='';if(window.getSelection){s=window.getSelection();}else if(document.getSelection){s=document.getSelection();}else if(document.selection){s=document.selection.createRange().text;} if(s){$(this).attr('href',$(this).attr('href')+'&sel='+encodeURI(s));} if(!window.open($(this).attr('href'),'t','toolbar=0,resizable=1,scrollbars=1,status=1,width=720,height=570')){document.location.href=$(this).attr('href');} return false;});$('a.share-email',this).on('click',function(){var url=$(this).attr('href');if($sharing_email.is(':visible')){$sharing_email.slideUp(200);}else{$('.sharedaddy .inner').slideUp();$('#sharing_email .response').remove();$('#sharing_email form').show();$('#sharing_email form input[type=submit]').removeAttr('disabled');$('#sharing_email form a.sharing_cancel').show();if('object'===typeof grecaptcha&&'function'===typeof grecaptcha.reset){grecaptcha.reset();} $sharing_email.css({left:$(this).offset().left+'px',top:$(this).offset().top+$(this).height()+'px'}).slideDown(200);$('#sharing_email a.sharing_cancel').unbind('click').click(function(){$('#sharing_email .errors').hide();$sharing_email.slideUp(200);$('#sharing_background').fadeOut();return false;});$('#sharing_email input[type=submit]').unbind('click').click(function(){var form=$(this).parents('form');$(this).prop('disabled',true);form.find('a.sharing_cancel').hide();form.find('img.loading').show();$('#sharing_email .errors').hide();$('#sharing_email .error').removeClass('error');if(!$('#sharing_email input[name=source_email]').share_is_email()){$('#sharing_email input[name=source_email]').addClass('error');} if(!$('#sharing_email input[name=target_email]').share_is_email()){$('#sharing_email input[name=target_email]').addClass('error');} if($('#sharing_email .error').length===0){$.ajax({url:url,type:'POST',data:form.serialize(),success:function(response){form.find('img.loading').hide();if(response==='1'||response==='2'||response==='3'){$('#sharing_email .errors-'+response).show();form.find('input[type=submit]').removeAttr('disabled');form.find('a.sharing_cancel').show();if('object'===typeof grecaptcha&&'function'===typeof grecaptcha.reset){grecaptcha.reset();}} else{$('#sharing_email form').hide();$sharing_email.append(response);$('#sharing_email a.sharing_cancel').click(function(){$sharing_email.slideUp(200);$('#sharing_background').fadeOut();return false;});}}});return false;} form.find('img.loading').hide();form.find('input[type=submit]').removeAttr('disabled');form.find('a.sharing_cancel').show();$('#sharing_email .errors-1').show();return false;});} return false;});});$('li.share-email, li.share-custom a.sharing-anchor').addClass('share-service-visible');}})(jQuery);