'+no_more_posts_text+'');
}
if($cff.find('.cff-album-item').length){
$cff.removeClass('cff-masonry cff-masonry-js cff-masonry-css');
}
$cff.find('.cff-more-dates').on('click', function(){
$(this).siblings('.cff-multiple-dates').slideToggle(100);
});
});
function cffGetCommentsIDArray(){
var commentsArrayIDs=[];
$('.cff-posts-wrap').each(function(){
var wrapper=$(this);
wrapper.find('.cff-item.cff-new:not(.cff-event)').each(function(){
var $self=$(this),
post_id_orig=$self.find('.cff-view-comments').attr('id'),
object_id=$self.closest('.cff-item').attr('data-object-id');
commentsArrayIDs.push(post_id_orig);
});
});
return commentsArrayIDs;
}
function cffGetFeedLocatorDataArray(){
var feedLocatorData=[];
$('.cff-timeline-feed').each(function(){
$cffPagUrl=$(this).find('.cff-pag-url');
var singleFeedLocatorData={
feedID:$cffPagUrl.attr('data-feed-id'),
postID:$cffPagUrl.attr('data-post-id'),
shortCodeAtts:$(this).attr('data-cff-shortcode').trim()=='' ? {}:JSON.parse($(this).attr('data-cff-shortcode')),
location:CffFeed.prototype.locationGuess($(this))
};
feedLocatorData.push(singleFeedLocatorData);
});
return feedLocatorData;
}
if($('.cff-timeline-feed').length&&(typeof cffdisablecommentcaching=='undefined')){
var commentsArrayIDs=cffGetCommentsIDArray(),
feedLocatorData=cffGetFeedLocatorDataArray();
$.ajax({
url: cffajaxurl,
type: 'POST',
async: true,
cache: false,
data:{
action: 'get_meta',
comments_array_ids:commentsArrayIDs,
feedLocatorData:feedLocatorData
},
success: function(data){
if(data==''||data.length < 1){
metaArr=[];
}else{
data=data.replace(/\\'/g, "'");
metaArr=JSON.parse(data);
}
$cff.each(function(){
$(this).find('.cff-item.cff-new:not(.cff-event)').each(function(){
var $self=$(this),
post_id_orig=$self.find('.cff-view-comments').attr('id'),
object_id=$self.closest('.cff-item').attr('data-object-id');
if(metaArr.hasOwnProperty(post_id_orig)&&metaArr[post_id_orig]!=""){
cffCreateComments($self, JSON.parse(metaArr[post_id_orig])['content']);
cffAddFullsizeImageURLs($self, JSON.parse(metaArr[post_id_orig])['content']);
}else{
cffGetMetaAPI($self, post_id_orig, object_id);
}});
});
},
error: function(xhr,textStatus,e){
return;
}});
}else{
$('#cff .cff-item.cff-new:not(.cff-event)').each(function(){
var $self=$(this),
post_id_orig=$self.find('.cff-view-comments').attr('id'),
object_id=$self.closest('.cff-item').attr('data-object-id');
cffGetMetaAPI($self, post_id_orig, object_id);
});
}
function cffGetMetaAPI($self, post_id_orig, object_id){
if($self.find('.cff-view-comments').length==0) return;
if(typeof object_id=='undefined'||object_id.length < 2) object_id='';
var object_id_query=''+object_id,
post_id_query='?post_id='+post_id_orig,
use_id='object',
post_comment_count=$self.find('.cff-comments .cff-count').text(),
post_likes_count=$self.find('.cff-likes .cff-count').text(),
cff_page_id=$self.attr('data-page-id');
if(typeof post_comment_count=='undefined'||post_comment_count=='') post_comment_count=0;
if(typeof $self.attr('data-comments-js')!=='undefined'){
if(typeof post_comment_count=='undefined'||post_comment_count=='') post_comment_count=1;
}
if(typeof post_likes_count=='undefined'||post_likes_count=='') post_likes_count=0;
if(typeof object_id=='undefined'||object_id.length < 2||$self.find('.cff-comments-box').hasClass('cff-shared-story')||$self.hasClass('cff-timeline-event')) use_id='post';
var timeline_event='';
if($self.hasClass('cff-timeline-event')) timeline_event='&timeline_event=true';
var usegrouptoken='',
useowntoken='';
if($self.closest('#cff').hasClass('cff-group')) usegrouptoken='&usegrouptoken=true';
if($self.closest('#cff').attr('data-own-token')=='true') useowntoken='&useowntoken=true';
shortcode_token_param=cffGetShortcodeToken($self.closest('#cff'));
var cff_is_video_post=$self.hasClass('cff-video-post') ? '&isvideo=true':'';
var url=cffsiteurl + "/custom-facebook-feed-pro/query.php?o_id=" + object_id + '&post_id='+post_id_orig + '&use_id=' + use_id + timeline_event + usegrouptoken + useowntoken + '&comments_num=' + post_comment_count + '&likes_num=' + post_likes_count + '&type=meta' + cff_is_video_post + '&pageid=' + cff_page_id + shortcode_token_param;
if($self.hasClass('cff-album')) url +='&timelinealbum=true';
if(locatefile==true&&typeof window.cff_block_editor==='undefined'){
var submitData={
action: 'cff_query',
o_id: object_id,
post_id: post_id_orig,
use_id: use_id,
comments_num: post_comment_count,
likes_num: post_likes_count,
type: 'meta',
pageid: cff_page_id,
};
if($self.hasClass('cff-video-post')){
submitData.isvideo=true;
}
if($self.hasClass('cff-timeline-event')){
submitData.timeline_event=true;
}
if($self.closest('#cff').hasClass('cff-group')){
submitData.usegrouptoken=true;
}
if($self.closest('#cff').attr('data-own-token')=='true'){
submitData.useowntoken=true;
}
if(shortcode_token_param!==''){
var token=shortcode_token_param.split('=');
submitData.at=token[1];
}
var onSuccess=function(data){
metaArray.push({'id_post':post_id_orig, 'content':data});
metaArr[ post_id_orig ]=data;
newMetaArr[ post_id_orig ]=data;
cffCreateComments($self, data);
cffAddFullsizeImageURLs($self, data);
cffSetMetaCache(metaArray);
};
cffAjax(submitData,onSuccess);
}}
var cffSetMetaCache_executed=false;
function cffSetMetaCache(newMetaArr){
if(typeof cffdisablecommentcaching!='undefined') return;
if(!cffSetMetaCache_executed){
var cffTimesCached=0,
cffCacheDelay=setTimeout(function(){
var cffCacheInterval=setInterval(function(){
cffCacheMeta(newMetaArr);
cffTimesCached++;
if(cffTimesCached==2) clearInterval(cffCacheInterval);
}, 3000);
cffCacheMeta(newMetaArr);
}, 500);
cffSetMetaCache_executed=true;
}
function cffCacheMeta(newMetaArr){
var jsonstring=JSON.stringify(newMetaArr);
var opts={
url: cffajaxurl,
type: 'POST',
async: true,
cache: false,
data:{
action: 'cache_meta',
metadata: jsonstring
},
success: function(response){
return;
},
error: function(xhr,textStatus,e){
return;
}};
$.ajax(opts);
}}
function cffGetParameterByName(name, url){
name=name.replace(/[\[\]]/g, "\\$&");
var regex=new RegExp("[?&]" + name + "(=([^]*)|&|#|$)"),
results=regex.exec(url);
if(!results) return null;
if(!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
function cffLinkify(inputText){
var replacedText, replacePattern1, replacePattern2, replacePattern3;
replacePattern1=/(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim;
replacedText=inputText.replace(replacePattern1, '
$1 ');
replacePattern2=/(^|[^\/])(www\.[\S]+(\b|$))/gim;
replacedText=replacedText.replace(replacePattern2, '$1
$2 ');
replacePattern3=/(([a-zA-Z0-9\-\_\.])+@[a-zA-Z\_]+?(\.[a-zA-Z]{2,6})+)/gim;
replacedText=replacedText.replace(replacePattern3, '
$1 ');
return replacedText;
}
$(document).off('click', '#cff .cff-html5-video .cff-html5-play').on('click', '#cff .cff-html5-video .cff-html5-play', function(e){
e.preventDefault();
var $self=$(this),
$videoWrapper=$self.closest('.cff-html5-video'),
video=$self.siblings('video')[0];
video.play();
$self.hide();
$self.siblings('.cff-poster').hide();
if(video.hasAttribute("controls")){
video.removeAttribute("controls")
}else{
video.setAttribute("controls","controls")
}
if($videoWrapper.innerWidth() < 150&&!$videoWrapper.hasClass('cff-no-video-expand')){
$videoWrapper.css('width','100%').closest('.cff-item').find('.cff-text-wrapper').css('width','100%');
}});
function cffAddFullsizeImageURLs($self, data){
var data=JSON.parse(data);
if(typeof data.images!=='undefined'&&data.images!==null) $self.find('.cff-lightbox-link').attr('href', data.images[0].source);
}
function cffCreateComments($self, data){
if(data.substring(0, 1)=="<") return false;
var data=JSON.parse(data),
cff_comments='',
cff_likes_this='',
commentShow=parseInt($self.find('.cff-comments-box').attr('data-num')),
like_count=(typeof data.likes!=='undefined') ? data.likes.summary.total_count:0,
$cffCommentsBox=$self.find('.cff-comments-box'),
$cffCommentLikes=$cffCommentsBox.find('.cff-comment-likes'),
cff_hide_comment_avatars=Boolean($self.find('.cff-comments-box').attr('data-cff-hide-avatars')),
cff_expand_comments=Boolean($self.find('.cff-comments-box').attr('data-cff-expand-comments')),
cff_translate_like_this_text=$cffCommentsBox.attr('data-cff-like-text'),
cff_translate_likes_this_text=$cffCommentsBox.attr('data-cff-likes-text'),
cff_translate_reacted_to_this_text=$cffCommentsBox.attr('data-cff-reacted-text'),
cff_translate_and_text=$cffCommentsBox.attr('data-cff-and-text'),
cff_translate_other_text=$cffCommentsBox.attr('data-cff-other-text'),
cff_translate_others_text=$cffCommentsBox.attr('data-cff-others-text'),
cff_translate_reply_text=$cffCommentsBox.attr('data-cff-reply-text'),
cff_translate_replies_text=$cffCommentsBox.attr('data-cff-replies-text'),
cff_total_comments_count=(typeof data.comments!=='undefined') ? data.comments.summary.total_count:0,
cff_meta_link_color=$self.find('.cff-comments-box').attr('data-cff-meta-link-color'),
cff_post_tags=Boolean($self.find('.cff-comments-box').attr('data-cff-post-tags'));
if(typeof $self.attr('data-comments-js')!=='undefined'){
var comment_count=(typeof data.comments!=='undefined') ? data.comments.summary.total_count:0;
$self.find('.cff-comments .cff-count').text(comment_count);
}
var cff_haha_count=(typeof data.haha!=='undefined') ? data.haha.summary.total_count:0;
var cff_love_count=(typeof data.love!=='undefined') ? data.love.summary.total_count:0;
var cff_wow_count=(typeof data.wow!=='undefined') ? data.wow.summary.total_count:0;
var cff_sad_count=(typeof data.sad!=='undefined') ? data.sad.summary.total_count:0;
var cff_angry_count=(typeof data.angry!=='undefined') ? data.angry.summary.total_count:0;
var reactions_arr=[cff_haha_count, cff_love_count, cff_wow_count, cff_sad_count, cff_angry_count];
var reaction_first_num=reactions_arr.sort(sortNumber)[0];
var reaction_second_num=reactions_arr.sort(sortNumber)[1];
function sortNumber(a,b){
return b - a;
}
var reactions_html='',
love_added=false,
haha_added=false,
wow_added=false,
sad_added=false,
angry_added=false,
love_svg='
'+'
',
haha_svg='
'+'
',
wow_svg='
'+'
',
sad_svg='
'+'
',
angry_svg='
',
like_svg='
'+'
',
like_svg_2='
';
var reaction_one_html='';
if(reaction_first_num > 0){
if(data.love.summary.total_count==reaction_first_num){
reaction_one_html +='
'+love_svg+' ';
love_added=true;
}
if(data.haha.summary.total_count==reaction_first_num){
reaction_one_html +='
'+haha_svg+' ';
haha_added=true;
}
if(data.wow.summary.total_count==reaction_first_num){
reaction_one_html +='
'+wow_svg+' ';
wow_added=true;
}
if(data.sad.summary.total_count==reaction_first_num){
reaction_one_html +='
'+sad_svg+' ';
sad_added=true;
}
if(data.angry.summary.total_count==reaction_first_num){
reaction_one_html +='
'+angry_svg+' ';
angry_added=true;
}
reactions_html +=reaction_one_html;
}
if(reaction_one_html.split('cff-reaction-one').length < 3){
if(reaction_second_num > 0){
var reaction_two_html='';
if(data.love.summary.total_count==reaction_second_num&&!love_added){
reaction_two_html='
'+love_svg+' ';
}
if(data.haha.summary.total_count==reaction_second_num&&!haha_added){
reaction_two_html='
'+haha_svg+' ';
}
if(data.wow.summary.total_count==reaction_second_num&&!wow_added){
reaction_two_html='
'+wow_svg+' ';
}
if(data.sad.summary.total_count==reaction_second_num&&!sad_added){
reaction_two_html='
'+sad_svg+' ';
}
if(data.angry.summary.total_count==reaction_second_num&&!angry_added){
reaction_two_html='
'+angry_svg+' ';
}
reactions_html +=reaction_two_html;
}}
if($self.find('.cff-meta .cff-likes').find('.cff-icon').length < 2) $self.find('.cff-meta .cff-likes .cff-icon').after(reactions_html);
if(parseInt(like_count)==0&&(parseInt(cff_love_count) > 0||parseInt(cff_haha_count) > 0||parseInt(cff_wow_count) > 0||parseInt(cff_sad_count) > 0||parseInt(cff_angry_count) > 0)){
$self.find('.cff-meta .cff-likes .cff-like').remove();
$self.find('.cff-meta .cff-likes span').addClass('cff-no-animate');
}
var cff_reactions_count=parseInt(like_count) + parseInt(cff_love_count) + parseInt(cff_haha_count) + parseInt(cff_wow_count) + parseInt(cff_sad_count) + parseInt(cff_angry_count);
if(cff_reactions_count > 0) $self.find('.cff-meta .cff-likes .cff-count').text(cff_reactions_count);
var cff_no_reactions=false;
if(cff_love_count==0&&cff_haha_count==0&&cff_wow_count==0&&cff_sad_count==0&&cff_angry_count==0) cff_no_reactions=true;
var reactions_count_html='
';
if(parseInt(like_count) > 0){
reactions_count_html +=''+like_svg+' ';
if(!cff_no_reactions){
if(parseInt(like_count) > 0) reactions_count_html +=''+like_count+' ';
if(cff_love_count > 0) reactions_count_html +=''+love_svg+' '+cff_love_count+' ';
if(cff_haha_count > 0) reactions_count_html +=''+haha_svg+' '+cff_haha_count+' ';
if(cff_wow_count > 0) reactions_count_html +=''+wow_svg+' '+cff_wow_count+' ';
if(cff_sad_count > 0) reactions_count_html +=''+sad_svg+' '+cff_sad_count+' ';
if(cff_angry_count > 0) reactions_count_html +=''+angry_svg+' '+cff_angry_count+' ';
}}
reactions_count_html +=' ';
if(typeof data.likes!=='undefined'){
if(data.likes.data.length){
cff_likes_this +='
';
var liker_one='',
liker_two='';
if(like_count > 0&&typeof data.likes.data[0]!=='undefined'){
var userHasLink=false;
if(typeof data.likes.data[0].link!=='undefined'){
if(data.likes.data[0].link.indexOf('/app_scoped_user_id/')==-1) userHasLink=true;
}
userHasLink ? liker_one +=''+data.likes.data[0].name;
userHasLink ? liker_one +=' ':liker_one +=' ';
}
if(like_count > 1&&typeof data.likes.data[1]!=='undefined'){
var userHasLink=false;
if(typeof data.likes.data[1].link!=='undefined'){
if(data.likes.data[1].link.indexOf('/app_scoped_user_id/')==-1) userHasLink=true;
}
userHasLink ? liker_two +='
':liker_two='';
liker_two +=data.likes.data[1].name;
userHasLink ? liker_two +=' ':liker_two +='';
}
if(like_count==1){
cff_likes_this +=liker_one+' '+cff_translate_likes_this_text;
}else if(like_count==2){
cff_likes_this +=liker_one+' '+cff_translate_and_text+' '+liker_two+' '+cff_translate_like_this_text;
}else if(like_count==3){
cff_likes_this +=liker_one+', '+liker_two+' '+cff_translate_and_text+' 1 '+cff_translate_other_text+' '+cff_translate_like_this_text;
}else{
cff_likes_this +=liker_one+', '+liker_two+' '+cff_translate_and_text+' ';
if(like_count==25) cff_likes_this +='';
cff_likes_this +=' '+cff_translate_others_text;
if(parseInt(cff_reactions_count)==parseInt(like_count)){
cff_likes_this +=' '+cff_translate_like_this_text;
}else{
cff_likes_this +=' '+cff_translate_reacted_to_this_text;
}}
cff_likes_this +='';
if($cffCommentLikes.find('.cff-reactions-count').length < 1) $cffCommentLikes.append('
' + reactions_count_html + cff_likes_this + ' ');
}else{
if(cff_no_reactions){
$cffCommentLikes.hide();
}else{
if($cffCommentLikes.find('.cff-reactions-count').length < 1) $cffCommentLikes.append('
' + reactions_count_html + ' ');
}}
}
if(typeof data.comments!=='undefined'){
$.each(data.comments.data, function(i, commentItem){
var consentGiven=(typeof window.cff!=='undefined'&&typeof window.cff.feeds!=='undefined') ? window.cff.feeds[0].settings.consentGiven:true;
var comment_message=cffEncodeHTML(commentItem.message),
comment_message=cffLinkify(comment_message),
cff_comment_author_info=true,
cff_hide_comment_avatars=false;
if(typeof commentItem.from!=='undefined'){
cff_comment_from_id=commentItem.from.id;
}else{
cff_hide_comment_avatars=true;
cff_comment_author_info=false;
cff_comment_from_id='';
}
cff_comments +='';
});
}
$self.find('.cff-comments-wrap .cff-comment').remove();
$self.find('.cff-comments-wrap').prepend(cff_comments);
$self.find('.cff-show-more-comments').attr('data-cff-comments-total', cff_total_comments_count);
if($self.find('.cff-comment-likes span').length > 0) $self.find('.cff-comment-on-facebook').css({'border-top-left-radius':"0",'border-top-right-radius':"0"});
if($self.find('.cff-comments-wrap .cff-comment').length > 0) $self.find('.cff-comment-on-facebook').css({'border-bottom-left-radius':"0",'border-bottom-right-radius':"0"});
if($self.find('.cff-comments-wrap .cff-comment').length < 1) $self.find('.cff-comment-on-facebook').css('padding','8px 15px 8px 10px');
setTimeout(function(){
if($self.closest('.cff').hasClass('cff-masonry-js')&&!$self.closest('.cff').hasClass('cff-masonry-css')) cffAddMasonry($self.closest('.cff'));
}, 200);
}
function cff_lazy_load_correction(){
var $=jQuery;
$('.cff-lightbox-link').each(function(){
var $lbLink=$(this);
if($lbLink.closest('.cff-album-item').attr('data-cff-full-size')){
lborigSrc=$lbLink.attr('data-cff-full-size');
}else{
lborigSrc=$lbLink.parent().find('img').attr('data-orig-source');
}
$lbLink.attr('href', lborigSrc);
})
$('img[data-orig-source]').each(function(){
var $self=$(this),
currentSrc=$self.attr('src'),
originalSrc=$self.attr('data-orig-source');
if(originalSrc!=currentSrc){
$self.attr('src', originalSrc);
}
if($self.hasClass('cff-multi-image')){
$self.css('background-image', 'url(' + originalSrc + ')');
}});
$('.cff-link-slider').each(function(){
$(this).find('.cff-link-slider-slides').css('width', '2500px')
});
}
if(typeof window.cff==='undefined'||typeof window.cff.feeds==='undefined'){
if(!$cff.find('.cff_resized_image_data').length){
cff_lazy_load_correction();
}}else if(typeof window.cff.feeds[0]!=='undefined'){
if(!window.cff.feeds[0].settings.resizingEnabled){
cff_lazy_load_correction();
}}
setTimeout(function(){
$cff.find('.cff-link-slider').each(function(){
var $cffLinkSlider=$(this),
$cffLinkSliderSlides=$cffLinkSlider.find('.cff-link-slider-slides'),
$cffLinkSliderItem=$cffLinkSliderSlides.find('.cff-link-slider-item'),
cffLinkSliderCount=$cffLinkSliderItem.length,
cffLinkSliderWidth=$cffLinkSlider.width(),
cffCurSlide=0;
$cffLinkSliderSlides.css({ width: cffLinkSliderWidth * cffLinkSliderCount });
$cffLinkSliderItem.css({ width: cffLinkSliderWidth });
function cffMoveSlide(dir){
dir=='prev' ? cffCurSlide--:cffCurSlide++;
$cffLinkSliderSlides.css('left', -cffCurSlide*cffLinkSliderWidth);
cffCurSlide==cffLinkSliderCount-1 ? $cffLinkSlider.find('a.cff-slider-next').hide():$cffLinkSlider.find('a.cff-slider-next').show();
cffCurSlide > 0 ? $cffLinkSlider.find('a.cff-slider-prev').show():$cffLinkSlider.find('a.cff-slider-prev').hide();
};
$cffLinkSlider.find('a.cff-slider-prev, a.cff-slider-next').on('click', function(e){
e.preventDefault();
$(this).hasClass('cff-slider-prev') ? cffMoveSlide('prev'):cffMoveSlide('next');
});
setTimeout(function(){
var cffLastSlideHeight=$cffLinkSliderSlides.find('.cff-link-slider-item').first().height();
$cffLinkSliderSlides.find('.cff-final-item').css('height', cffLastSlideHeight).find('img').css('margin-top', (cffLastSlideHeight/2)-100);
}, 1500);
$cffLinkSliderSlides.find('.cff-link-slider-item').show();
});
}, 200);
})(jQuery);
var imgLiquid=imgLiquid||{VER: '0.9.944'};
imgLiquid.bgs_Available=false;
imgLiquid.bgs_CheckRunned=false;
$cff.find('.cff-new .cff-album-cover img, .cff-new .cff-crop img').css('visibility', 'hidden');
jQuery('#cff .cff-img-attachments .cff-crop img').css('opacity', 0);
(function ($){
function checkBgsIsavailable(){
if(imgLiquid.bgs_CheckRunned) return;
else imgLiquid.bgs_CheckRunned=true;
var spanBgs=$('
');
$('body').append(spanBgs);
!function (){
var bgs_Check=spanBgs[0];
if(!bgs_Check||!window.getComputedStyle) return;
var compStyle=window.getComputedStyle(bgs_Check, null);
if(!compStyle||!compStyle.backgroundSize) return;
imgLiquid.bgs_Available=(compStyle.backgroundSize==='cover');
}();
spanBgs.remove();
}
$.fn.extend({
imgLiquid: function (options){
this.defaults={
fill: true,
verticalAlign: 'center', // 'top' // 'bottom' // '50%' // '10%'
horizontalAlign: 'center', // 'left' // 'right' // '50%' // '10%'
useBackgroundSize: false,
useDataHtmlAttr: true,
responsive: true,
delay: false,
fadeInTime: false,
removeBoxBackground: true,
hardPixels: true,
responsiveCheckTime: 500,
timecheckvisibility: 500,
onStart: null,
onFinish: null,
onItemStart: null,
onItemFinish: function(index, container, img){
img.addClass('cffFadeIn');
},
onItemError: null
};
checkBgsIsavailable();
var imgLiquidRoot=this;
this.options=options;
this.settings=$.extend({}, this.defaults, this.options);
if(this.settings.onStart) this.settings.onStart();
return this.each(function ($i){
var settings=imgLiquidRoot.settings,
$imgBoxCont=$(this),
$img=$('img:first',$imgBoxCont);
if(!$img.length){onError(); return;}
if(!$img.data('imgLiquid_settings')){
settings=$.extend({}, imgLiquidRoot.settings, getSettingsOverwrite());
}else{
$imgBoxCont.removeClass('imgLiquid_error').removeClass('imgLiquid_ready');
settings=$.extend({}, $img.data('imgLiquid_settings'), imgLiquidRoot.options);
}
$img.data('imgLiquid_settings', settings);
if(settings.onItemStart) settings.onItemStart($i, $imgBoxCont, $img);
if(imgLiquid.bgs_Available&&settings.useBackgroundSize)
processBgSize();
else
processOldMethod();
function processBgSize(){
if($imgBoxCont.css('background-image').indexOf(encodeURI($img.attr('src')))===-1){
$imgBoxCont.css({'background-image': 'url("' + encodeURI($img.attr('src')) + '")'});
}
$imgBoxCont.css({
'background-size': (settings.fill) ? 'cover':'contain',
'background-position': (settings.horizontalAlign + ' ' + settings.verticalAlign).toLowerCase(),
'background-repeat': 'no-repeat'
});
$('a:first', $imgBoxCont).css({
'display': 'block',
'width': '100%',
'height': '100%'
});
$('img', $imgBoxCont).css({'display': 'none'});
if(settings.onItemFinish) settings.onItemFinish($i, $imgBoxCont, $img);
$imgBoxCont.addClass('imgLiquid_bgSize');
$imgBoxCont.addClass('imgLiquid_ready');
checkFinish();
}
function processOldMethod(){
if($img.data('oldSrc')&&$img.data('oldSrc')!==$img.attr('src')){
var $imgCopy=$img.clone().removeAttr('style');
$imgCopy.data('imgLiquid_settings', $img.data('imgLiquid_settings'));
$img.parent().prepend($imgCopy);
$img.remove();
$img=$imgCopy;
$img[0].width=0;
setTimeout(processOldMethod, 10);
return;
}
if($img.data('imgLiquid_oldProcessed')){
makeOldProcess(); return;
}
$img.data('imgLiquid_oldProcessed', false);
$img.data('oldSrc', $img.attr('src'));
$('img:not(:first)', $imgBoxCont).css('display', 'none');
$imgBoxCont.css({'overflow': 'hidden'});
$img.fadeTo(0, 0).removeAttr('width').removeAttr('height').css({
'visibility': 'visible',
'max-width': 'none',
'max-height': 'none',
'width': 'auto',
'height': 'auto',
'display': 'block'
});
$img.on('error', onError);
$img[0].onerror=onError;
function onLoad(){
if($img.data('imgLiquid_error')||$img.data('imgLiquid_loaded')||$img.data('imgLiquid_oldProcessed')) return;
if($imgBoxCont.is(':visible')&&$img[0].complete&&$img[0].width > 0&&$img[0].height > 0){
$img.data('imgLiquid_loaded', true);
setTimeout(makeOldProcess, $i * settings.delay);
}else{
setTimeout(onLoad, settings.timecheckvisibility);
}}
onLoad();
checkResponsive();
}
function checkResponsive(){
if(!settings.responsive&&!$img.data('imgLiquid_oldProcessed')) return;
if(!$img.data('imgLiquid_settings')) return;
settings=$img.data('imgLiquid_settings');
$imgBoxCont.actualSize=$imgBoxCont.get(0).offsetWidth + ($imgBoxCont.get(0).offsetHeight / 10000);
if($imgBoxCont.sizeOld&&$imgBoxCont.actualSize!==$imgBoxCont.sizeOld) makeOldProcess();
$imgBoxCont.sizeOld=$imgBoxCont.actualSize;
setTimeout(checkResponsive, settings.responsiveCheckTime);
}
function onError(){
$img.data('imgLiquid_error', true);
$imgBoxCont.addClass('imgLiquid_error');
if(settings.onItemError) settings.onItemError($i, $imgBoxCont, $img);
checkFinish();
}
function getSettingsOverwrite(){
var SettingsOverwrite={};
if(imgLiquidRoot.settings.useDataHtmlAttr){
var dif=$imgBoxCont.attr('data-imgLiquid-fill'),
ha=$imgBoxCont.attr('data-imgLiquid-horizontalAlign'),
va=$imgBoxCont.attr('data-imgLiquid-verticalAlign');
if(dif==='true'||dif==='false') SettingsOverwrite.fill=Boolean (dif==='true');
if(ha!==undefined&&(ha==='left'||ha==='center'||ha==='right'||ha.indexOf('%')!==-1)) SettingsOverwrite.horizontalAlign=ha;
if(va!==undefined&&(va==='top'||va==='bottom'||va==='center'||va.indexOf('%')!==-1)) SettingsOverwrite.verticalAlign=va;
}
if(imgLiquid.isIE&&imgLiquidRoot.settings.ieFadeInDisabled) SettingsOverwrite.fadeInTime=0;
return SettingsOverwrite;
}
function makeOldProcess(){
var w, h, wn, hn, ha, va, hdif, vdif,
margT=0,
margL=0,
$imgCW=$imgBoxCont.width(),
$imgCH=$imgBoxCont.height();
if($img.data('owidth')===undefined) $img.data('owidth', $img[0].width);
if($img.data('oheight')===undefined) $img.data('oheight', $img[0].height);
if(settings.fill===($imgCW / $imgCH) >=($img.data('owidth') / $img.data('oheight'))){
w='100%';
h='auto';
wn=Math.floor($imgCW);
hn=Math.floor($imgCW * ($img.data('oheight') / $img.data('owidth')));
}else{
w='auto';
h='100%';
wn=Math.floor($imgCH * ($img.data('owidth') / $img.data('oheight')));
hn=Math.floor($imgCH);
}
ha=settings.horizontalAlign.toLowerCase();
hdif=$imgCW - wn;
if(ha==='left') margL=0;
if(ha==='center') margL=hdif * 0.5;
if(ha==='right') margL=hdif;
if(ha.indexOf('%')!==-1){
ha=parseInt (ha.replace('%',''), 10);
if(ha > 0) margL=hdif * ha * 0.01;
}
va=settings.verticalAlign.toLowerCase();
vdif=$imgCH - hn;
if(va==='left') margT=0;
if(va==='center') margT=vdif * 0.5;
if(va==='bottom') margT=vdif;
if(va.indexOf('%')!==-1){
va=parseInt (va.replace('%',''), 10);
if(va > 0) margT=vdif * va * 0.01;
}
if(settings.hardPixels){w=wn; h=hn;}
$img.css({
'width': w,
'height': h,
'margin-left': Math.floor(margL),
'margin-top': Math.floor(margT)
});
if(!$img.data('imgLiquid_oldProcessed')){
$img.fadeTo(settings.fadeInTime, 1);
$img.data('imgLiquid_oldProcessed', true);
if(settings.removeBoxBackground) $imgBoxCont.css('background-image', 'none');
$imgBoxCont.addClass('imgLiquid_nobgSize');
$imgBoxCont.addClass('imgLiquid_ready');
}
if(settings.onItemFinish) settings.onItemFinish($i, $imgBoxCont, $img);
checkFinish();
}
function checkFinish(){
if($i===imgLiquidRoot.length - 1) if(imgLiquidRoot.settings.onFinish) imgLiquidRoot.settings.onFinish();
}});
}});
})(jQuery);
if(typeof window.cff==='undefined'||typeof window.cff.feeds==='undefined'){
window.cff=new Cff();
window.cff.createPage(window.cff.createFeeds, {});
}
jQuery(document).ready(function(){
var allInitiated=true;
jQuery('.cff').each(function(index){
if(typeof window.cff!=='undefined'
&& typeof window.cff.feeds!=='undefined'
&& typeof window.cff.feeds[index]==='undefined'){
allInitiated=false;
}});
if(!allInitiated){
window.cff.createPage(window.cff.createFeeds, {});
}
var $=jQuery;
$('#cookie-notice a').on('click', function(){
setTimeout(function(){
$.each(window.cff.feeds,function(index){
window.cff.feeds[ index ].afterConsentToggled();
});
},1000);
});
$('#cookie-law-info-bar a').on('click', function(){
setTimeout(function(){
$.each(window.cff.feeds,function(index){
window.cff.feeds[ index ].afterConsentToggled();
});
},1000);
});
$('.cli-user-preference-checkbox').on('click', function(){
setTimeout(function(){
$.each(window.cff.feeds,function(index){
window.cff.feeds[ index ].settings.consentGiven=false;
window.cff.feeds[ index ].afterConsentToggled();
});
},1000);
});
$(window).on('CookiebotOnAccept', function (event){
$.each(window.cff.feeds,function(index){
window.cff.feeds[ index ].settings.consentGiven=true;
window.cff.feeds[ index ].afterConsentToggled();
});
});
$(document).on('cmplzAcceptAll', function (event){
$.each(window.cff.feeds,function(index){
window.cff.feeds[ index ].settings.consentGiven=true;
window.cff.feeds[ index ].afterConsentToggled();
});
});
$(document).on('cmplzRevoke', function (event){
$.each(window.cff.feeds,function(index){
window.cff.feeds[ index ].settings.consentGiven=false;
window.cff.feeds[ index ].afterConsentToggled();
});
});
$(document).on('borlabs-cookie-consent-saved', function (event){
$.each(window.cff.feeds,function(index){
window.cff.feeds[ index ].settings.consentGiven=false;
window.cff.feeds[ index ].afterConsentToggled();
});
});
});
setTimeout(function(){
jQuery('#cff .embed-responsive video, #cff .embed-responsive iframe').unwrap();
}, 500);
!function (){
var css=imgLiquid.injectCss,
head=document.getElementsByTagName('head')[0],
style=document.createElement('style');
style.type='text/css';
if(style.styleSheet){
style.styleSheet.cssText=css;
}else{
style.appendChild(document.createTextNode(css));
}
head.appendChild(style);
}();
jQuery(".cff-new .cff-album-cover").imgLiquid({fill:true});
jQuery(".cff-new .cff-crop").imgLiquid({fill:true, useBackgroundSize:true});
jQuery(".cff-header-hero").imgLiquid({fill:true});
}
cff_init();
function cffGetShortcodeToken($cff){
var shortcode_token_param='';
if($cff.attr('data-cff-shortcode')){
if($cff.attr('data-cff-shortcode').indexOf('accesstoken')!==-1){
var shortcode_att=$cff.attr('data-cff-shortcode'),
shortcode_att_arr=JSON.parse(shortcode_att);
shortcode_token_param=encodeURI('&at=' + shortcode_att_arr['accesstoken']);
}}
return shortcode_token_param;
}
window.cffLinkify=(function(){var k="[a-z\\d.-]+://",h="(?:(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.){3}(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])",c="(?:(?:[^\\s!@#$%^&*()_=+[\\]{}\\\\|;:'\",.<>/?]+)\\.)+",n="(?:ac|ad|aero|ae|af|ag|ai|al|am|an|ao|aq|arpa|ar|asia|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|biz|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|cat|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|coop|com|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|info|int|in|io|iq|ir|is|it|je|jm|jobs|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mil|mk|ml|mm|mn|mobi|mo|mp|mq|mr|ms|mt|museum|mu|mv|mw|mx|my|mz|name|na|nc|net|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pro|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tel|tf|tg|th|tj|tk|tl|tm|tn|to|tp|travel|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|xn--0zwm56d|xn--11b5bs3a9aj6g|xn--80akhbyknj4f|xn--9t4b11yi5a|xn--deba0ad|xn--g6w251d|xn--hgbk6aj7f53bba|xn--hlcj6aya9esc7a|xn--jxalpdlp|xn--kgbechtv|xn--zckzah|ye|yt|yu|za|zm|zw)",f="(?:"+c+n+"|"+h+")",o="(?:[;/][^#?<>\\s]*)?",e="(?:\\?[^#<>\\s]*)?(?:#[^<>\\s]*)?",d="\\b"+k+"[^<>\\s]+",a="\\b"+f+o+e+"(?!\\w)",m="mailto:",j="(?:"+m+")?[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@"+f+e+"(?!\\w)",l=new RegExp("(?:"+d+"|"+a+"|"+j+")","ig"),g=new RegExp("^"+k,"i"),b={"'":"`",">":"<",")":"(","]":"[","}":"{","B;":"B+","b:":"b9"},i={callback:function(q,p){return p?'
'+q+" ":q},punct_regexp:/(?:[!?.,:;'"]|(?:&|&)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)$/};return function(u,z){z=z||{};var w,v,A,p,x="",t=[],s,E,C,y,q,D,B,r;for(v in i){if(z[v]===undefined){z[v]=i[v]}}while(w=l.exec(u)){A=w[0];E=l.lastIndex;C=E-A.length;if(/[\/:]/.test(u.charAt(C-1))){continue}do{y=A;r=A.substr(-1);B=b[r];if(B){q=A.match(new RegExp("\\"+B+"(?!$)","g"));D=A.match(new RegExp("\\"+r,"g"));if((q?q.length:0)<(D?D.length:0)){A=A.substr(0,A.length-1);E--}}if(z.punct_regexp){A=A.replace(z.punct_regexp,function(F){E-=F.length;return""})}}while(A.length&&A!==y);p=A;if(!g.test(p)){p=(p.indexOf("@")!==-1?(!p.indexOf(m)?"":m):!p.indexOf("irc.")?"irc://":!p.indexOf("ftp.")?"ftp://":"http://")+p}if(s!=C){t.push([u.slice(s,C)]);s=E}t.push([A,p])}t.push([u.substr(s)]);for(v=0;v
' + replacementString + '';
}}
function cffReplaceTags(tag){
var replacementString=jQuery.trim(tag);
return '' + replacementString + ' ';
}
var hashRegex=/[#]+[A-Za-z0-9-_]+/g,
tagRegex=/[@]+[A-Za-z0-9-_]+/g;
function cffEncodeHTML(raw){
if(typeof raw==='undefined'){
return '';
}
var encoded=raw.replace(/(>)/g,'>'),
encoded=encoded.replace(/(<)/g,'<');
encoded=encoded.replace(/(<br\/>)/g,' ');
encoded=encoded.replace(/(<br>)/g,' ');
return encoded;
}
function cffLoadCommentReplies($this){
var usegrouptoken='',
useowntoken='',
$cffClosestContainer=jQuery('#cff_'+$this.parent().attr('data-id')).closest('#cff');
if($cffClosestContainer.hasClass('cff-group')) usegrouptoken='&usegrouptoken=true';
if($cffClosestContainer.attr('data-own-token')=='true') useowntoken='&useowntoken=true';
var cff_page_id=$this.closest('.cff-item').attr('data-page-id'),
shortcode_token_param=cffGetShortcodeToken($cffClosestContainer),
$commentReplies=$this.parent(),
$commentRepliesBox=$commentReplies.siblings('.cff-comment-replies-box'),
comments_url=cffsiteurl + "/custom-facebook-feed-pro/comments.php?id=" + $commentReplies.attr('data-id') + usegrouptoken + useowntoken + '&pageid=' + cff_page_id + shortcode_token_param;
if($commentReplies.hasClass('cff-hide')){
$commentRepliesBox.hide();
$commentReplies.removeClass('cff-hide');
}else{
$commentRepliesBox.show();
$commentReplies.addClass('cff-hide');
if($commentRepliesBox.hasClass('cff-empty')){
var $commentRepliesA=$commentReplies.find('a');
$commentRepliesA.append('
');
$commentReplies.find('.cff-loader').css('background-color', $commentRepliesA.css('color'));
var submitData={
action: 'cff_comments',
id: $commentReplies.attr('data-id'),
pageid: cff_page_id,
};
if($cffClosestContainer.hasClass('cff-group')){
submitData.usegrouptoken=true;
}
if($cffClosestContainer.attr('data-own-token')=='true'){
submitData.useowntoken=true;
}
if(shortcode_token_param!==''){
var token=shortcode_token_param.split('=');
submitData.at=token[1];
}
var onSuccess=function(data){
$commentReplies.find('.cff-loader').remove();
var data=JSON.parse(data),
allComments='';
if(typeof data.comments!=='undefined'){
jQuery.each(data.comments.data, function(i, commentItem){
var consentGiven=(typeof window.cff!=='undefined'&&typeof window.cff.feeds!=='undefined') ? window.cff.feeds[0].settings.consentGiven:true;
var cff_comment_author_info=true;
if(typeof commentItem.from!=='undefined'){
cff_comment_from_id=commentItem.from.id;
}else{
cff_comment_author_info=false;
cff_comment_from_id='';
}
allComments +='';
});
}
$commentRepliesBox.html(allComments).removeClass('cff-empty');
if($this.closest('#cff').hasClass('cff-masonry-js')&&!$this.closest('#cff').hasClass('cff-masonry-css')&&!$this.closest('#cff').hasClass('cff-opaque-comments')){
cffAddMasonry($this.closest('#cff'));
}};
cffAjax(submitData,onSuccess);
}}
}
function cffLightbox(){
(function(){
var $=jQuery;
var LightboxOptions=(function(){
function LightboxOptions(){
this.fadeDuration=300;
this.fitImagesInViewport=true;
this.resizeDuration=400;
this.positionFromTop=50;
this.showImageNumberLabel=true;
this.alwaysShowNavOnTouchDevices=false;
this.wrapAround=false;
}
LightboxOptions.prototype.albumLabel=function(curImageNum, albumSize){
return curImageNum + " / " + albumSize;
};
return LightboxOptions;
})();
var Lightbox=(function(){
function Lightbox(options){
this.options=options;
this.album=[];
this.currentImageIndex=void 0;
this.init();
}
Lightbox.prototype.init=function(){
this.enable();
this.build();
};
Lightbox.prototype.enable=function(){
var self=this;
$('body').on('click', 'a[data-cff-lightbox], area[data-cff-lightbox]', function(event){
self.start($(event.currentTarget));
return false;
});
};
Lightbox.prototype.build=function(){
var cff_lightbox_svg_class='';
if($('.cff.cff-no-svgs').length) cff_lightbox_svg_class='cff-no-svgs';
var self=this;
$("
").appendTo($('body'));
if(typeof jQuery("#cff-lightbox-wrapper").find(".cff-lightbox-dataContainer").hammer!=='function'){
var Hammer={
Manager: {
prototype: {}}
};
(function (factory){
if(typeof define==='function'&&define.amd){
define(['jquery', 'hammerjs'], factory);
}else if(typeof exports==='object'){
factory(require('jquery'), require('hammerjs'));
}else{
factory(jQuery, Hammer);
}}(function (jQuery, Hammer){
function hammerify(el, options){
}
jQuery.fn.hammer=function (options){
return this.each(function (){
hammerify(this, options);
});
};
Hammer.Manager.prototype.emit=(function (originalEmit){
return function (type, data){
originalEmit.call(this, type, data);
jQuery(this.element).trigger({
type: type,
gesture: data
});
};})(Hammer.Manager.prototype.emit);
}));
}
this.$lightbox=$('#cff-lightbox-wrapper');
this.$overlay=$('#cff-lightbox-overlay');
this.$outerContainer=this.$lightbox.find('.cff-lightbox-outerContainer');
this.$container=this.$lightbox.find('.cff-lightbox-container');
this.containerTopPadding=parseInt(this.$container.css('padding-top'), 10);
this.containerRightPadding=parseInt(this.$container.css('padding-right'), 10);
this.containerBottomPadding=parseInt(this.$container.css('padding-bottom'), 10);
this.containerLeftPadding=parseInt(this.$container.css('padding-left'), 10);
this.$overlay.hide().on('click', function(){
self.end();
if(cff_supports_video()) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();
$('#cff-lightbox-wrapper iframe').attr('src', '');
if($('body').length){
$('body').removeClass('cff_no_scroll');
}
return false;
});
this.$lightbox.hide().on('click', function(event){
if($(event.target).attr('id')==='cff-lightbox-wrapper'){
self.end();
if(cff_supports_video()) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();
$('#cff-lightbox-wrapper iframe').attr('src', '');
if($('body').length){
$('body').removeClass('cff_no_scroll');
}}
return false;
});
this.$outerContainer.on('click', function(event){
if($(event.target).attr('id')==='cff-lightbox-wrapper'){
self.end();
if(cff_supports_video()) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();
$('#cff-lightbox-wrapper iframe').attr('src', '');
}
return false;
});
this.$lightbox.find('.cff-lightbox-prev').on('click', function(){
if(self.currentImageIndex===0){
self.changeImage(self.album.length - 1);
}else{
self.changeImage(self.currentImageIndex - 1);
}
if(cff_supports_video()) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();
$('#cff-lightbox-wrapper iframe').attr('src', '');
return false;
});
this.$lightbox.find('.cff-lightbox-next').on('click', function(){
if(self.currentImageIndex===self.album.length - 1){
self.changeImage(0);
}else{
self.changeImage(self.currentImageIndex + 1);
}
if(cff_supports_video()) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();
$('#cff-lightbox-wrapper iframe').attr('src', '');
return false;
});
this.$lightbox.find('.cff-lightbox-outerContainer').hammer().on("swipeleft", function(){
if(self.currentImageIndex===self.album.length - 1){
self.changeImage(0);
}else{
self.changeImage(self.currentImageIndex + 1);
}
if(cff_supports_video()) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();
$('#cff-lightbox-wrapper iframe').attr('src', '');
return false;
});
this.$lightbox.find('.cff-lightbox-outerContainer').hammer().on("swiperight", function(){
if(self.currentImageIndex===0){
self.changeImage(self.album.length - 1);
}else{
self.changeImage(self.currentImageIndex - 1);
}
if(cff_supports_video()) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();
$('#cff-lightbox-wrapper iframe').attr('src', '');
return false;
});
$('.cff-lightbox-thumbs').on('click', '.cff-lightbox-attachment', function (){
var $thumb=$(this),
$thumbImg=$thumb.find('img'),
captionText=$thumb.attr('data-caption');
if(captionText==''||captionText=='undefined') captionText=$thumb.attr('orig-caption');
self.changeImage(parseInt($thumb.attr('data-cff-lightbox-order')), $thumb.attr('href'), $thumbImg.attr('width'), $thumbImg.attr('height'), $thumb.attr('data-facebook'), captionText);
return false;
});
this.$lightbox.find('.cff-lightbox-loader, .cff-lightbox-close').on('click', function(){
self.end();
if(cff_supports_video()) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();
$('#cff-lightbox-wrapper iframe').attr('src', '');
if($('body').length){
$('body').removeClass('cff_no_scroll');
}
return false;
});
};
Lightbox.prototype.start=function($link){
var self=this;
var $window=$(window);
$window.on('resize', $.proxy(this.sizeOverlay, this));
if($('body').length){
$('body').addClass('cff_no_scroll');
}
$('select, object, embed').css({
visibility: "hidden"
});
this.sizeOverlay();
if(this.album.length==0) this.album=[];
var imageNumber=0;
function addToAlbum($link){
var albumClassName=$link.closest('.cff-posts-wrap').children().attr('class');
linkParentPostID='';
if(typeof albumClassName!=='undefined'){
linkParentPostID=$link.closest('.'+albumClassName.split(' ')[0]).attr('id');
linkParentPostID=linkParentPostID.replace('cff_','')
}
var found=false;
$.each(self.album, function(i, imageitem){
if(( imageitem.link==$link.attr('href'))&&(imageitem.postid==linkParentPostID)){
found=true;
return;
}});
if(!$('.cff-duplicate-video-thumbnails').length) if(found==true) return;
var closestFeedIndex=parseInt($link.closest('.cff').attr('data-cff-index')-1);
var video=$link.attr("data-video"),
iframe=$link.attr('data-iframe'),
link=$link.attr("href"),
count=0;
var consentGiven=(typeof window.cff!=='undefined'&&typeof window.cff.feeds!=='undefined') ? window.cff.feeds[0].settings.consentGiven:true;
if(!consentGiven){
if(iframe!==''){
iframe='link';
}
if(video!==''){
video='link';
}
if($link.closest('.cff-album-item').length
&& typeof $link.closest('.cff-album-item').attr('data-count')!=='undefined'){
count=$link.closest('.cff-album-item').attr('data-count');
}}
self.album.push({
link: link,
title: $link.attr('data-title')||$link.attr('title'),
postid: $link.attr('data-id'),
showthumbs: $link.attr('data-thumbs'),
facebookurl: $link.attr('data-url'),
video: video,
iframe: iframe,
type: $link.attr('data-type'),
cffgroupalbums: $link.attr('data-cffgroupalbums'),
isthumbnail: $link.attr('data-cff-isthumbnail'),
pagename: $link.parent().attr('data-cff-page-name'),
posttime: $link.parent().attr('data-cff-post-time'),
lbcomments: $link.attr('data-lb-comments'),
feedIndex: closestFeedIndex,
count: count
});
}
var dataLightboxValue=$link.attr('data-cff-lightbox');
var $links;
if(dataLightboxValue){
$links=$($link.prop("tagName") + '[data-cff-lightbox="' + dataLightboxValue + '"]');
for (var i=0; i < $links.length; i=++i){
addToAlbum($($links[i]));
if($links[i]===$link[0]){
imageNumber=i;
$.each(self.album, function(i, image){
if((image.postid==$link.attr('data-id'))&&image.isthumbnail!=true) imageNumber=i;
});
}}
}else{
if($link.attr('rel')==='lightbox'){
addToAlbum($link);
}else{
$links=$($link.prop("tagName") + '[rel="' + $link.attr('rel') + '"]');
for (var j=0; j < $links.length; j=++j){
addToAlbum($($links[j]));
if($links[j]===$link[0]){
imageNumber=j;
}}
}}
var top=$window.scrollTop() + this.options.positionFromTop;
var left=$window.scrollLeft();
this.$lightbox.css({
top: top + 'px',
left: left + 'px'
}).fadeIn(this.options.fadeDuration);
this.changeImage(imageNumber);
};
Lightbox.prototype.changeImage=function(imageNumberVal, imageUrl, imgWidth, imgHeight, facebookLink, captionText){
var self=this,
isThumb=false,
bottomPadding=120;
imageNumber=imageNumberVal;
if(typeof imageUrl!=='undefined') isThumb=true;
this.disableKeyboardNav();
var $image=this.$lightbox.find('.cff-lightbox-image');
this.$overlay.fadeIn(this.options.fadeDuration);
$('.cff-lightbox-loader').fadeIn('slow');
this.$lightbox.find('.cff-lightbox-image, .cff-lightbox-nav, .cff-lightbox-prev, .cff-lightbox-next, .cff-lightbox-dataContainer, .cff-lightbox-numbers, .cff-lightbox-caption').hide();
this.$outerContainer.addClass('animating');
var preloader=new Image();
preloader.onload=function(){
var $preloader, imageHeight, imageWidth, maxImageHeight, maxImageWidth, windowHeight, windowWidth;
$image.attr('src', self.album[imageNumber].link);
if(isThumb){
$image.attr('src', imageUrl);
$('.cff-lightbox-facebook').attr('href', facebookLink);
$('.cff-lightbox-caption .cff-lightbox-caption-text').html(captionText);
preloader.width=imgWidth;
preloader.height=imgHeight;
bottomPadding=180;
}
$preloader=$(preloader);
$image.width(preloader.width);
$image.height(preloader.height);
if(self.options.fitImagesInViewport){
windowWidth=$(window).width();
windowHeight=$(window).height();
var cff_lb_comments_width=0,
cffNavArrowsWidth=80;
if($('#cff_' + self.album[0].postid).closest('#cff').attr('data-lb-comments')=='true'&&windowWidth > 640) cff_lb_comments_width=300;
if(window.innerWidth < 640) cffNavArrowsWidth=40;
maxImageWidth=windowWidth - self.containerLeftPadding - self.containerRightPadding - 20 - cff_lb_comments_width - cffNavArrowsWidth;
maxImageHeight=windowHeight - self.containerTopPadding - self.containerBottomPadding - bottomPadding;
if((preloader.width > maxImageWidth)||(preloader.height > maxImageHeight)){
if((preloader.width / maxImageWidth) > (preloader.height / maxImageHeight)){
imageWidth=maxImageWidth;
imageHeight=parseInt(preloader.height / (preloader.width / imageWidth), 10);
$image.width(imageWidth);
$image.height(imageHeight);
}else{
imageHeight=maxImageHeight;
imageWidth=parseInt(preloader.width / (preloader.height / imageHeight), 10);
$image.width(imageWidth);
$image.height(imageHeight);
}}
}
self.sizeContainer($image.width(), $image.height());
};
preloader.src=this.album[imageNumber].link;
this.currentImageIndex=imageNumber;
};
Lightbox.prototype.sizeOverlay=function(){
this.$overlay
.width($(window).width())
.height($(document).height());
};
Lightbox.prototype.sizeContainer=function(imageWidth, imageHeight){
var self=this;
var oldWidth=this.$outerContainer.outerWidth();
var oldHeight=this.$outerContainer.outerHeight();
var newWidth=imageWidth + this.containerLeftPadding + this.containerRightPadding;
var newHeight=imageHeight + this.containerTopPadding + this.containerBottomPadding;
function postResize(){
self.$lightbox.find('.cff-lightbox-dataContainer').width(newWidth);
self.$lightbox.find('.cff-lightbox-prevLink').height(newHeight);
self.$lightbox.find('.cff-lightbox-nextLink').height(newHeight);
self.showImage();
}
if(oldWidth!==newWidth||oldHeight!==newHeight){
this.$outerContainer.animate({
width: newWidth,
height: newHeight
}, this.options.resizeDuration, 'swing', function(){
postResize();
});
}else{
postResize();
}};
Lightbox.prototype.showImage=function(){
this.$lightbox.find('.cff-lightbox-loader').hide();
this.$lightbox.find('.cff-lightbox-image').fadeIn('slow');
this.updateNav();
this.updateDetails();
this.preloadNeighboringImages();
this.enableKeyboardNav();
};
Lightbox.prototype.updateNav=function(){
var alwaysShowNav=false;
try {
document.createEvent("TouchEvent");
alwaysShowNav=(this.options.alwaysShowNavOnTouchDevices)? true: false;
} catch (e){}
this.$lightbox.find('.cff-lightbox-nav').show();
if(this.album.length > 1){
if(this.options.wrapAround){
if(alwaysShowNav){
this.$lightbox.find('.cff-lightbox-prev, .cff-lightbox-next').css('opacity', '1');
}
this.$lightbox.find('.cff-lightbox-prev, .cff-lightbox-next').show();
}else{
if(this.currentImageIndex > 0){
this.$lightbox.find('.cff-lightbox-prev').show();
if(alwaysShowNav){
this.$lightbox.find('.cff-lightbox-prev').css('opacity', '1');
}}
if(this.currentImageIndex < this.album.length - 1){
this.$lightbox.find('.cff-lightbox-next').show();
if(alwaysShowNav){
this.$lightbox.find('.cff-lightbox-next').css('opacity', '1');
}}
}}
};
var thumbsArr={};
Lightbox.prototype.updateDetails=function(){
var self=this;
var origCaption='';
this.$lightbox.find('.cff-lightbox-nav, .cff-lightbox-nav a').show();
if($('.cff-lightbox-video').length==0) $('.cff-lightbox-container').prepend(" ");
if(cff_supports_video()){
$('#cff-lightbox-wrapper').removeClass('cff-has-video');
if(typeof this.album[this.currentImageIndex].video!=='undefined'
&& this.album[this.currentImageIndex].video!=='link'){
if(this.album[this.currentImageIndex].video.length){
$('#cff-lightbox-wrapper').addClass('cff-has-video');
$('.cff-lightbox-video').attr({
'src':this.album[this.currentImageIndex].video,
'poster':this.album[this.currentImageIndex].link,
'autoplay':'true'
});
}}
}
var iframeIsLink=false;
if(this.album[this.currentImageIndex].iframe==='link'){
iframeIsLink=true;
}
if((this.album[this.currentImageIndex].video==='link'||iframeIsLink)
&& ! jQuery(".cff-lightbox-container .cff_gdpr_notice").length){
jQuery(".cff-lightbox-container").prepend(' ')
}else if(this.album[this.currentImageIndex].video!=='link'&&!iframeIsLink){
jQuery('.cff_gdpr_notice').remove();
}else if(jQuery(".cff-lightbox-container .cff_gdpr_notice").length){
jQuery(".cff-lightbox-container .cff_gdpr_notice").attr('href',this.album[this.currentImageIndex].facebookurl);
}
var cff_lb_comments=(this.album[this.currentImageIndex].lbcomments=='true'&&$('#cff_'+this.album[this.currentImageIndex].postid+' .cff-lightbox-link').attr('data-lb-comments')!='false') ? true:false;
if($(window).width() <=640) cff_lb_comments=false;
if(cff_lb_comments){
var lb_post_id=this.album[this.currentImageIndex].postid,
page_id=lb_post_id.split('_')[0],
author_name=this.album[this.currentImageIndex].pagename,
date_in_correct_format=this.album[this.currentImageIndex].posttime,
$lightbox_sidebar=$('.cff-lightbox-container .cff-lightbox-sidebar'),
$lightbox_thumbs_holder=$('.cff-lightbox-thumbs-holder'),
from_id=$('#cff_'+this.album[this.currentImageIndex].postid).attr('data-cff-from');
$('.cff-lightbox-wrapper').addClass('cff-enable-lb-comments');
$('.cff-lightbox-dataContainer').css('width', $('.cff-lightbox-dataContainer').innerWidth() + 300);
$lightbox_sidebar.css('display', 'block');
var cff_post_author="";
var consentGiven=(typeof window.cff!=='undefined'&&typeof window.cff.feeds!=='undefined') ? window.cff.feeds[0].settings.consentGiven:true;
if(consentGiven&&typeof from_id!=='undefined'){
cff_post_author="";
}else{
cff_post_author=""+date_in_correct_format+"
";
}
$('.cff-lightbox-dataContainer .cff-lightbox-close').remove();
$lightbox_sidebar.html("' + $('#cff_'+this.album[this.currentImageIndex].postid+' .cff-comments-box')[0].outerHTML);
this.$lightbox.find('.cff-lightbox-close').on('click', function(){
self.end();
if(cff_supports_video()) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();
$('#cff-lightbox-wrapper iframe').attr('src', '');
if($('body').length){
$('body').removeClass('cff_no_scroll');
}
return false;
});
setTimeout(function(){
if($lightbox_thumbs_holder.find('a').length > 1){
$lightbox_sidebar.find('.cff-page-name a').text($lightbox_thumbs_holder.find('a.cff-selected').attr('data-page-name'));
$lightbox_sidebar.find('.cff-date').text($lightbox_thumbs_holder.find('a.cff-selected').attr('data-post-date'));
}}, 0);
$lightbox_thumbs_holder.css('margin-top', -10);
if($lightbox_sidebar.find('.cff-reactions-count').innerWidth() > 150){
$lightbox_sidebar.find('.cff-likes-this-text').addClass('cff-long');
}
$lightbox_sidebar.find('.cff-comment:visible').each(function(){
var $thisComment=jQuery(this);
var consentGiven=(typeof window.cff!=='undefined'&&typeof window.cff.feeds!=='undefined') ? window.cff.feeds[0].settings.consentGiven:true;
if(consentGiven){
$thisComment.find('.cff-comment-img:not(.cff-comment-reply-img) a, .cff-comment-img:not(.cff-comment-reply-img) span').html(' ');
}});
$lightbox_sidebar.find('.cff-comment-replies a').on('click', function(){
cffLoadCommentReplies($(this));
});
$lightbox_sidebar.find('.cff-show-more-comments a').attr('href', $lightbox_sidebar.find('.cff-comment-on-facebook a').attr('href'));
}else{
$('.cff-lightbox-wrapper .cff-lightbox-sidebar').html('');
$('.cff-lightbox-wrapper').removeClass('cff-enable-lb-comments');
}
$('#cff-lightbox-wrapper').removeClass('cff-has-iframe cff-fb-player cff-has-thumbs');
if(typeof this.album[this.currentImageIndex].iframe!=='undefined'){
if(this.album[this.currentImageIndex].iframe.length&&this.album[this.currentImageIndex].iframe!=='link'){
var videoURL=this.album[this.currentImageIndex].iframe;
$('#cff-lightbox-wrapper').addClass('cff-has-iframe');
if(videoURL.indexOf("https://www.facebook.com/v2.3/plugins/video.php?")!=-1) $('#cff-lightbox-wrapper').addClass('cff-fb-player');
if(videoURL.indexOf(".swf") > -1||videoURL.indexOf("&autoplay=1")!=-1){
var autoplayParam='';
}else{
var autoplayParam='?autoplay=1';
}
var vInt=setTimeout(function(){
$('#cff-lightbox-wrapper iframe').attr({
'src':videoURL + autoplayParam + "&mute=0"
});
}, 500);
}}
var isThumbnail=false;
if(this.album[this.currentImageIndex].isthumbnail) isThumbnail=true;
if(!isThumbnail) $('.cff-lightbox-thumbs-holder').empty().removeClass('cff-animate');
if(this.album[this.currentImageIndex].link==$('.cff-lightbox-image').attr('src')){
$('.cff-lightbox-facebook').attr('href', this.album[this.currentImageIndex].facebookurl);
}
if(this.album[this.currentImageIndex].showthumbs=='true'){
$('.cff-lightbox-thumbs').show();
var thisPostId=this.album[this.currentImageIndex].postid,
albumInfo='',
albumThumbs='',
albumsonly=false;
if(this.album[this.currentImageIndex].type=='albumsonly') albumsonly=true;
if(typeof thumbsArr[thisPostId]!=='undefined'){
$.each(thumbsArr[thisPostId], function(i, thumb){
var origCaption=thumb[5].replace(/"/g, '"');
var albumIndex=0;
$.each(self.album, function(i, albumItem){
if(albumItem.postid==thisPostId){
albumIndex=i;
return false;
}});
var lightboxImageOrder=(parseInt(albumIndex)+parseInt(i));
if(typeof thumb[8]=='undefined') thumb[8]=thumb[0];
albumThumbs +=' ';
if(i > 0){
cffInsertLightboxImage(lightboxImageOrder, thumb[0], thumb[4], thumb[3], thisPostId, albumsonly, true, thumb[6], thumb[7], thumb[8]);
}});
$('.cff-lightbox-thumbs-holder').html('' + albumThumbs + '
').addClass('cff-animate');
$('.cff-lightbox-wrapper').addClass('cff-has-thumbs');
jQuery(".cff-lightbox-thumbs-holder a").imgLiquid({fill:true, useBackgroundSize:true});
$('.cff-loader').hide();
$('.cff-lightbox-thumbs-holder').css('min-height', 0);
}else{
if(typeof cffsiteurl==='undefined'||cffsiteurl=='') cffsiteurl=window.location.host + '/wp-content/plugins';
var $cffClosest=$('#cff_'+thisPostId).closest('.cff'),
cff_page_id=$('#cff_'+thisPostId).attr('data-page-id'),
shortcode_token_param=cffGetShortcodeToken($cffClosest),
useowntoken='';
if($cffClosest.attr('data-own-token')=='true') useowntoken='&useowntoken=true';
var cffAttachmentsUrl=cffsiteurl + "/custom-facebook-feed-pro/thumbs.php?id=" + thisPostId + '&pageid=' + cff_page_id + useowntoken + shortcode_token_param,
thumbsData=[];
if(albumsonly){
cffAttachmentsUrl=cffAttachmentsUrl + '&albumsonly=true';
var consentGiven=(typeof window.cff!=='undefined'&&typeof window.cff.feeds!=='undefined') ? window.cff.feeds[0].settings.consentGiven:true;
if(consentGiven){
$('.cff-lightbox-thumbs-holder').css('min-height', 45).after('
');
}}
var cffgroupalbums=this.album[this.currentImageIndex].cffgroupalbums;
if(cffgroupalbums) cffAttachmentsUrl=cffAttachmentsUrl + '&usegrouptoken=' + cffgroupalbums;
var submitData={
action: 'cff_thumbs',
id: thisPostId,
pageid: cff_page_id,
};
if(shortcode_token_param!==''){
var token=shortcode_token_param.split('=');
submitData.at=token[1];
}
if($cffClosest.attr('data-own-token')=='true'){
submitData.useowntoken=true;
}
if(cffgroupalbums){
submitData.usegrouptoken=cffgroupalbums;
}
if(albumsonly){
submitData.albumsonly=true;
}
var onSuccess=function(data){
data=JSON.parse(data);
if(albumsonly){
$.each(data.data, function(i, photoItem){
var dataCaption='';
if(photoItem.name) dataCaption=photoItem.name;
dataCaption=cffLinkify(dataCaption);
dataCaption=dataCaption.replace(hashRegex , cffReplaceHashtags);
dataCaption=String(dataCaption).replace(/& /g, '& ').replace(//g, '>').replace(/"/g, '"').replace(/\n/g, " ");
origCaption=String(origCaption).replace(/& /g, '& ').replace(//g, '>').replace(/"/g, '"').replace(/\n/g, " ");
var lightboxImageOrder=(parseInt(self.currentImageIndex)+parseInt(i));
var cffThumbHref=photoItem.source,
cffPhotoItemWidth=photoItem.width,
cffPhotoItemHeight=photoItem.height;
if(typeof photoItem.images[0]!=='undefined'){
cffThumbHref=photoItem.images[0].source;
cffPhotoItemWidth=photoItem.images[0].width;
cffPhotoItemHeight=photoItem.images[0].height;
}
if(typeof photoItem.images[ photoItem.images.length-2 ]!=='undefined'){
var cffThumbImg=photoItem.images[ photoItem.images.length-2 ].source;
}else{
var cffThumbImg=cffThumbHref;
}
albumThumbs +=' ';
thumbsData.push([cffThumbHref, cffPhotoItemWidth, cffPhotoItemHeight, 'http://facebook.com/'+photoItem.id, dataCaption, origCaption, undefined, undefined, cffThumbImg]);
if(i > 0){
cffInsertLightboxImage(lightboxImageOrder, cffThumbHref, dataCaption, 'http://facebook.com/'+photoItem.id, thisPostId, albumsonly, true, cffThumbImg);
}});
}else{
if(typeof data.attachments!=='undefined'){
$.each(data.attachments.data[0].subattachments.data, function(i, subattachment){
var dataCaption='';
if(subattachment.description) dataCaption=subattachment.description;
origCaption=String(origCaption).replace(/"/g, '"');
dataCaption=cffLinkify(dataCaption);
dataCaption=dataCaption.replace(hashRegex , cffReplaceHashtags);
dataCaption=String(dataCaption).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"').replace(/\n/g, " ");
var lightboxImageOrder=(parseInt(self.currentImageIndex)+parseInt(i));
albumThumbs +=' ';
thumbsData.push([subattachment.media.image.src, subattachment.media.image.width, subattachment.media.image.height, subattachment.url, dataCaption, origCaption, author_name, date_in_correct_format]);
if(i > 0){
cffInsertLightboxImage(lightboxImageOrder, subattachment.media.image.src, dataCaption, subattachment.url, thisPostId, albumsonly, true, author_name, date_in_correct_format, subattachment.media.image.src);
}});
}}
if(albumThumbs.length > 0){
$('.cff-lightbox-thumbs-holder').html('' + albumThumbs + '
').addClass('cff-animate');
$('.cff-lightbox-wrapper').addClass('cff-has-thumbs');
}
jQuery(".cff-lightbox-thumbs-holder .cff-lightbox-attachment").imgLiquid({fill:true, useBackgroundSize:true});
$('.cff-loader').hide();
$('.cff-lightbox-thumbs-holder').css('min-height', 0);
thumbsArr[ thisPostId ]=thumbsData;
if(albumsonly){
jQuery('.cff-lightbox-container').removeClass('cff-album-loading');
jQuery('.cff-lightbox-prev, .cff-lightbox-next').show();
}};
$('.cff-gdpr-more-link').remove();
if(window.cff.feeds[ this.album[this.currentImageIndex].feedIndex ].settings.consentGiven){
if(albumsonly){
jQuery('.cff-lightbox-container').addClass('cff-album-loading');
jQuery('.cff-lightbox-prev, .cff-lightbox-next').hide();
}
cffAjax(submitData,onSuccess);
}else{
if(parseInt(this.album[this.currentImageIndex].count) > 0){
$('.cff-lightbox-facebook').after('
+' + this.album[this.currentImageIndex].count + ' ');
$('.cff-gdpr-more-link').imgLiquid({fill:true, useBackgroundSize:true});
setTimeout(function (){
$('.cff-gdpr-more-link span').css({
'margin-top': '-' + ($('.cff-gdpr-more-link span').height() / 2) + 'px',
'margin-right': '-' + ($('.cff-gdpr-more-link span').width() / 2) + 'px',
'display': 'block'
});
}, 200);
}}
}}else{
$('.cff-lightbox-thumbs').hide();
}
$(".cff-lightbox-attachment").removeClass('cff-selected');
$(".cff-lightbox-attachment[href='"+$('.cff-lightbox-image').attr('src')+"']").addClass('cff-selected');
function cffInsertLightboxImage(currentImageIndex, link, title, facebookurl, postid, albumsonly, isThumbnail, cffThumbImg){
var found=false;
$.each(self.album, function(i, thumbitem){
if(( thumbitem.link==link)&&(thumbitem.postid==postid)){
found=true;
return;
}});
if(found==true) return;
(albumsonly) ? postType='albumsonly':postType='';
(albumsonly) ? lbcomments='false':lbcomments='true';
self.album.splice(currentImageIndex, 0, {
link: link,
title: title,
postid: postid,
showthumbs: 'true',
facebookurl: facebookurl,
video: '',
iframe: '',
type: postType,
cffgroupalbums: undefined,
isthumbnail: isThumbnail,
lbcomments: lbcomments,
thumbimg: cffThumbImg
});
}
this.$lightbox.find('.cff-lightbox-caption').fadeIn('fast');
if(typeof this.album[this.currentImageIndex].title!=='undefined'&&this.album[this.currentImageIndex].title!==""){
var origCaption=this.album[this.currentImageIndex].title;
origCaption=origCaption.replace(hashRegex , cffReplaceHashtags);
origCaption=String(origCaption).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"');
var $lightboxCaption=this.$lightbox.find('.cff-lightbox-caption'),
$lightboxCaptionText=$lightboxCaption.find('.cff-lightbox-caption-text');
if(this.album[this.currentImageIndex].link==$('.cff-lightbox-image').attr('src')) $lightboxCaptionText.html(origCaption);
if($lightboxCaptionText.text()==' '||$lightboxCaptionText.text()==''){
$lightboxCaption.addClass('cff-no-caption');
}else{
$lightboxCaption.removeClass('cff-no-caption');
}}else{
if(albumsonly||this.album[this.currentImageIndex].title===undefined) this.$lightbox.find('.cff-lightbox-caption-text').html('');
if(this.$lightbox.find('.cff-lightbox-caption .cff-lightbox-caption-text').text().length < 1) this.$lightbox.find('.cff-lightbox-caption').addClass('cff-no-caption').find('.cff-lightbox-caption-text').html('');
}
this.$lightbox.find('.cff-lightbox-facebook, .cff-lightbox-caption-text a, .cff-lightbox-sidebar a:not(.cff-comment-replies-a), .cff_gdpr_notice, .cff-gdpr-more-link').off('click').on('click', function(event){
window.open($(this).attr('href'),
'_blank'
)
}
);
if(this.album.length > 1&&this.options.showImageNumberLabel){
this.$lightbox.find('.cff-lightbox-number').text(this.options.albumLabel(this.currentImageIndex + 1, this.album.length)).fadeIn('fast');
}else{
this.$lightbox.find('.cff-lightbox-number').hide();
}
if(typeof cffLightboxAction==='function'){
setTimeout(function(){
cffLightboxAction();
},100);
}
this.$outerContainer.removeClass('animating');
this.$lightbox.find('.cff-lightbox-dataContainer').fadeIn(this.options.resizeDuration, function(){
return self.sizeOverlay();
});
};
Lightbox.prototype.preloadNeighboringImages=function(){
if(this.album.length > this.currentImageIndex + 1){
var preloadNext=new Image();
preloadNext.src=this.album[this.currentImageIndex + 1].link;
}
if(this.currentImageIndex > 0){
var preloadPrev=new Image();
preloadPrev.src=this.album[this.currentImageIndex - 1].link;
}};
Lightbox.prototype.enableKeyboardNav=function(){
$(document).on('keyup.keyboard', $.proxy(this.keyboardAction, this));
};
Lightbox.prototype.disableKeyboardNav=function(){
$(document).off('.keyboard');
};
Lightbox.prototype.keyboardAction=function(event){
var KEYCODE_ESC=27;
var KEYCODE_LEFTARROW=37;
var KEYCODE_RIGHTARROW=39;
var keycode=event.keyCode;
var key=String.fromCharCode(keycode).toLowerCase();
if(keycode===KEYCODE_ESC||key.match(/x|o|c/)){
if(cff_supports_video()) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();
$('#cff-lightbox-wrapper iframe').attr('src', '');
this.end();
}else if(key==='p'||keycode===KEYCODE_LEFTARROW){
if(jQuery('.cff-lightbox-container').hasClass('cff-album-loading')){
return;
}
if(this.currentImageIndex!==0){
this.changeImage(this.currentImageIndex - 1);
}else if(this.options.wrapAround&&this.album.length > 1){
this.changeImage(this.album.length - 1);
}
if(cff_supports_video()) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();
$('#cff-lightbox-wrapper iframe').attr('src', '');
}else if(key==='n'||keycode===KEYCODE_RIGHTARROW){
if(jQuery('.cff-lightbox-container').hasClass('cff-album-loading')){
return;
}
if(this.currentImageIndex!==this.album.length - 1){
this.changeImage(this.currentImageIndex + 1);
}else if(this.options.wrapAround&&this.album.length > 1){
this.changeImage(0);
}
if(cff_supports_video()) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();
$('#cff-lightbox-wrapper iframe').attr('src', '');
}};
Lightbox.prototype.end=function(){
this.disableKeyboardNav();
$(window).off("resize", this.sizeOverlay);
this.$lightbox.fadeOut(this.options.fadeDuration);
this.$overlay.fadeOut(this.options.fadeDuration);
$('select, object, embed').css({
visibility: "visible"
});
};
return Lightbox;
})();
$(function(){
var options=new LightboxOptions();
var lightbox=new Lightbox(options);
});
}).call(this);
function cff_supports_video(){
return !!document.createElement('video').canPlayType;
}}
if(jQuery('#cff.cff-lb').length) cffLightbox();
};
;window.Modernizr=function(a,b,c){function z(a){j.cssText=a}function A(a,b){return z(m.join(a+";")+(b||""))}function B(a,b){return typeof a===b}function C(a,b){return!!~(""+a).indexOf(b)}function D(a,b){for(var d in a){var e=a[d];if(!C(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function E(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:B(f,"function")?f.bind(d||b):f}return!1}function F(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+o.join(d+" ")+d).split(" ");return B(b,"string")||B(b,"undefined")?D(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),E(e,b,c))}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n="Webkit Moz O ms",o=n.split(" "),p=n.toLowerCase().split(" "),q={},r={},s={},t=[],u=t.slice,v,w=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["",'"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},x={}.hasOwnProperty,y;!B(x,"undefined")&&!B(x.call,"undefined")?y=function(a,b){return x.call(a,b)}:y=function(a,b){return b in a&&B(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=u.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(u.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(u.call(arguments)))};return e}),q.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:w(["@media (",m.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},q.cssanimations=function(){return F("animationName")},q.csstransitions=function(){return F("transition")};for(var G in q)y(q,G)&&(v=G.toLowerCase(),e[v]=q[G](),t.push((e[v]?"":"no-")+v));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)y(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},z(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.testProp=function(a){return D([a])},e.testAllProps=F,e.testStyles=w,e.prefixed=function(a,b,c){return b?F(a,b,c):F(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+t.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;fn;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.invokeAll("enable")},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical);t&&e&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s],l=o.oldScroll=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var n in t){var r=t[n];for(var s in this.waypoints[n]){var a,l,h,p,u,c=this.waypoints[n][s],d=c.options.offset,f=c.triggerPoint,w=0,y=null==f;c.element!==c.element.window&&(w=c.adapter.offset()[r.offsetProp]),"function"==typeof d?d=d.apply(c):"string"==typeof d&&(d=parseFloat(d),c.options.offset.indexOf("%")>-1&&(d=Math.ceil(r.contextDimension*d/100))),a=r.contextScroll-r.contextOffset,c.triggerPoint=w+a-d,l=f=r.oldScroll,p=l&&h,u=!l&&!h,!y&&p?(c.queueTrigger(r.backward),o[c.group.id]=c.group):!y&&u?(c.queueTrigger(r.forward),o[c.group.id]=c.group):y&&r.oldScroll>=c.triggerPoint&&(c.queueTrigger(r.forward),o[c.group.id]=c.group)}}for(var g in o)o[g].flushTriggers();return this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.$element=e(t)}var e=window.jQuery,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.$element[i].apply(this.$element,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;window.jQuery&&(window.jQuery.fn.waypoint=t(window.jQuery)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}();
;(function(e,t,n,r){function d(t,n){this.element=t;this.options=e.extend({},s,n);this._defaults=s;this._name=i;this.init()}var i="stellar",s={scrollProperty:"scroll",positionProperty:"position",horizontalScrolling:true,verticalScrolling:true,horizontalOffset:0,verticalOffset:0,responsive:true,parallaxBackgrounds:true,parallaxElements:true,hideDistantElements:true,hideElement:function(e){e.hide()},showElement:function(e){e.show()}},o={scroll:{getLeft:function(e){return e.scrollLeft()},setLeft:function(e,t){e.scrollLeft(t)},getTop:function(e){return e.scrollTop()},setTop:function(e,t){e.scrollTop(t)}},position:{getLeft:function(e){return parseInt(e.css("left"),10)*-1},getTop:function(e){return parseInt(e.css("top"),10)*-1}},margin:{getLeft:function(e){return parseInt(e.css("margin-left"),10)*-1},getTop:function(e){return parseInt(e.css("margin-top"),10)*-1}},transform:{getLeft:function(e){var t=getComputedStyle(e[0])[f];return t!=="none"?parseInt(t.match(/(-?[0-9]+)/g)[4],10)*-1:0},getTop:function(e){var t=getComputedStyle(e[0])[f];return t!=="none"?parseInt(t.match(/(-?[0-9]+)/g)[5],10)*-1:0}}},u={position:{setLeft:function(e,t){e.css("left",t)},setTop:function(e,t){e.css("top",t)}},transform:{setPosition:function(e,t,n,r,i){e[0].style[f]="translate3d("+(t-n)+"px, "+(r-i)+"px, 0)"}}},a=function(){var t=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,n=e("script")[0].style,r="",i;for(i in n){if(t.test(i)){r=i.match(t)[0];break}}if("WebkitOpacity"in n){r="Webkit"}if("KhtmlOpacity"in n){r="Khtml"}return function(e){return r+(r.length>0?e.charAt(0).toUpperCase()+e.slice(1):e)}}(),f=a("transform"),l=e("
",{style:"background:#fff"}).css("background-position-x")!==r,c=l?function(e,t,n){e.css({"background-position-x":t,"background-position-y":n})}:function(e,t,n){e.css("background-position",t+" "+n)},h=l?function(e){return[e.css("background-position-x"),e.css("background-position-y")]}:function(e){return e.css("background-position").split(" ")},p=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)};d.prototype={init:function(){this.options.name=i+"_"+Math.floor(Math.random()*1e9);this._defineElements();this._defineGetters();this._defineSetters();this._handleWindowLoadAndResize();this._detectViewport();this.refresh({firstLoad:true});if(this.options.scrollProperty==="scroll"){this._handleScrollEvent()}else{this._startAnimationLoop()}},_defineElements:function(){if(this.element===n.body)this.element=t;this.$scrollElement=e(this.element);this.$element=this.element===t?e("body"):this.$scrollElement;this.$viewportElement=this.options.viewportElement!==r?e(this.options.viewportElement):this.$scrollElement[0]===t||this.options.scrollProperty==="scroll"?this.$scrollElement:this.$scrollElement.parent()},_defineGetters:function(){var e=this,t=o[e.options.scrollProperty];this._getScrollLeft=function(){return t.getLeft(e.$scrollElement)};this._getScrollTop=function(){return t.getTop(e.$scrollElement)}},_defineSetters:function(){var t=this,n=o[t.options.scrollProperty],r=u[t.options.positionProperty],i=n.setLeft,s=n.setTop;this._setScrollLeft=typeof i==="function"?function(e){i(t.$scrollElement,e)}:e.noop;this._setScrollTop=typeof s==="function"?function(e){s(t.$scrollElement,e)}:e.noop;this._setPosition=r.setPosition||function(e,n,i,s,o){if(t.options.horizontalScrolling){r.setLeft(e,n,i)}if(t.options.verticalScrolling){r.setTop(e,s,o)}}},_handleWindowLoadAndResize:function(){var n=this,r=e(t);if(n.options.responsive){r.bind("load."+this.name,function(){n.refresh()})}r.bind("resize."+this.name,function(){n._detectViewport();if(n.options.responsive){n.refresh()}})},refresh:function(n){var r=this,i=r._getScrollLeft(),s=r._getScrollTop();if(!n||!n.firstLoad){this._reset()}this._setScrollLeft(0);this._setScrollTop(0);this._setOffsets();this._findParticles();this._findBackgrounds();if(n&&n.firstLoad&&/WebKit/.test(navigator.userAgent)){e(t).load(function(){var e=r._getScrollLeft(),t=r._getScrollTop();r._setScrollLeft(e+1);r._setScrollTop(t+1);r._setScrollLeft(e);r._setScrollTop(t)})}this._setScrollLeft(i);this._setScrollTop(s)},_detectViewport:function(){var e=this.$viewportElement.offset(),t=e!==null&&e!==r;this.viewportWidth=this.$viewportElement.width();this.viewportHeight=this.$viewportElement.height();this.viewportOffsetTop=t?e.top:0;this.viewportOffsetLeft=t?e.left:0},_findParticles:function(){var t=this,n=this._getScrollLeft(),i=this._getScrollTop();if(this.particles!==r){for(var s=this.particles.length-1;s>=0;s--){this.particles[s].$element.data("stellar-elementIsActive",r)}}this.particles=[];if(!this.options.parallaxElements)return;this.$element.find("[data-stellar-ratio]").each(function(n){var i=e(this),s,o,u,a,f,l,c,h,p,d=0,v=0,m=0,g=0;if(!i.data("stellar-elementIsActive")){i.data("stellar-elementIsActive",this)}else if(i.data("stellar-elementIsActive")!==this){return}t.options.showElement(i);if(!i.data("stellar-startingLeft")){i.data("stellar-startingLeft",i.css("left"));i.data("stellar-startingTop",i.css("top"))}else{i.css("left",i.data("stellar-startingLeft"));i.css("top",i.data("stellar-startingTop"))}u=i.position().left;a=i.position().top;f=i.css("margin-left")==="auto"?0:parseInt(i.css("margin-left"),10);l=i.css("margin-top")==="auto"?0:parseInt(i.css("margin-top"),10);h=i.offset().left-f;p=i.offset().top-l;i.parents().each(function(){var t=e(this);if(t.data("stellar-offset-parent")===true){d=m;v=g;c=t;return false}else{m+=t.position().left;g+=t.position().top}});s=i.data("stellar-horizontal-offset")!==r?i.data("stellar-horizontal-offset"):c!==r&&c.data("stellar-horizontal-offset")!==r?c.data("stellar-horizontal-offset"):t.horizontalOffset;o=i.data("stellar-vertical-offset")!==r?i.data("stellar-vertical-offset"):c!==r&&c.data("stellar-vertical-offset")!==r?c.data("stellar-vertical-offset"):t.verticalOffset;t.particles.push({$element:i,$offsetParent:c,isFixed:i.css("position")==="fixed",horizontalOffset:s,verticalOffset:o,startingPositionLeft:u,startingPositionTop:a,startingOffsetLeft:h,startingOffsetTop:p,parentOffsetLeft:d,parentOffsetTop:v,stellarRatio:i.data("stellar-ratio")!==r?i.data("stellar-ratio"):1,width:i.outerWidth(true),height:i.outerHeight(true),isHidden:false})})},_findBackgrounds:function(){var t=this,n=this._getScrollLeft(),i=this._getScrollTop(),s;this.backgrounds=[];if(!this.options.parallaxBackgrounds)return;s=this.$element.find("[data-stellar-background-ratio]");if(this.$element.data("stellar-background-ratio")){s=s.add(this.$element)}s.each(function(){var s=e(this),o=h(s),u,a,f,l,p,d,v,m,g,y=0,b=0,w=0,E=0;if(!s.data("stellar-backgroundIsActive")){s.data("stellar-backgroundIsActive",this)}else if(s.data("stellar-backgroundIsActive")!==this){return}if(!s.data("stellar-backgroundStartingLeft")){s.data("stellar-backgroundStartingLeft",o[0]);s.data("stellar-backgroundStartingTop",o[1])}else{c(s,s.data("stellar-backgroundStartingLeft"),s.data("stellar-backgroundStartingTop"))}p=s.css("margin-left")==="auto"?0:parseInt(s.css("margin-left"),10);d=s.css("margin-top")==="auto"?0:parseInt(s.css("margin-top"),10);v=s.offset().left-p-n;m=s.offset().top-d-i;s.parents().each(function(){var t=e(this);if(t.data("stellar-offset-parent")===true){y=w;b=E;g=t;return false}else{w+=t.position().left;E+=t.position().top}});u=s.data("stellar-horizontal-offset")!==r?s.data("stellar-horizontal-offset"):g!==r&&g.data("stellar-horizontal-offset")!==r?g.data("stellar-horizontal-offset"):t.horizontalOffset;a=s.data("stellar-vertical-offset")!==r?s.data("stellar-vertical-offset"):g!==r&&g.data("stellar-vertical-offset")!==r?g.data("stellar-vertical-offset"):t.verticalOffset;t.backgrounds.push({$element:s,$offsetParent:g,isFixed:s.css("background-attachment")==="fixed",horizontalOffset:u,verticalOffset:a,startingValueLeft:o[0],startingValueTop:o[1],startingBackgroundPositionLeft:isNaN(parseInt(o[0],10))?0:parseInt(o[0],10),startingBackgroundPositionTop:isNaN(parseInt(o[1],10))?0:parseInt(o[1],10),startingPositionLeft:s.position().left,startingPositionTop:s.position().top,startingOffsetLeft:v,startingOffsetTop:m,parentOffsetLeft:y,parentOffsetTop:b,stellarRatio:s.data("stellar-background-ratio")===r?1:s.data("stellar-background-ratio")})})},_reset:function(){var e,t,n,r,i;for(i=this.particles.length-1;i>=0;i--){e=this.particles[i];t=e.$element.data("stellar-startingLeft");n=e.$element.data("stellar-startingTop");this._setPosition(e.$element,t,t,n,n);this.options.showElement(e.$element);e.$element.data("stellar-startingLeft",null).data("stellar-elementIsActive",null).data("stellar-backgroundIsActive",null)}for(i=this.backgrounds.length-1;i>=0;i--){r=this.backgrounds[i];r.$element.data("stellar-backgroundStartingLeft",null).data("stellar-backgroundStartingTop",null);c(r.$element,r.startingValueLeft,r.startingValueTop)}},destroy:function(){this._reset();this.$scrollElement.unbind("resize."+this.name).unbind("scroll."+this.name);this._animationLoop=e.noop;e(t).unbind("load."+this.name).unbind("resize."+this.name)},_setOffsets:function(){var n=this,r=e(t);r.unbind("resize.horizontal-"+this.name).unbind("resize.vertical-"+this.name);if(typeof this.options.horizontalOffset==="function"){this.horizontalOffset=this.options.horizontalOffset();r.bind("resize.horizontal-"+this.name,function(){n.horizontalOffset=n.options.horizontalOffset()})}else{this.horizontalOffset=this.options.horizontalOffset}if(typeof this.options.verticalOffset==="function"){this.verticalOffset=this.options.verticalOffset();r.bind("resize.vertical-"+this.name,function(){n.verticalOffset=n.options.verticalOffset()})}else{this.verticalOffset=this.options.verticalOffset}},_repositionElements:function(){var e=this._getScrollLeft(),t=this._getScrollTop(),n,r,i,s,o,u,a,f=true,l=true,h,p,d,v,m;if(this.currentScrollLeft===e&&this.currentScrollTop===t&&this.currentWidth===this.viewportWidth&&this.currentHeight===this.viewportHeight){return}else{this.currentScrollLeft=e;this.currentScrollTop=t;this.currentWidth=this.viewportWidth;this.currentHeight=this.viewportHeight}for(m=this.particles.length-1;m>=0;m--){i=this.particles[m];s=i.isFixed?1:0;if(this.options.horizontalScrolling){h=(e+i.horizontalOffset+this.viewportOffsetLeft+i.startingPositionLeft-i.startingOffsetLeft+i.parentOffsetLeft)*-(i.stellarRatio+s-1)+i.startingPositionLeft;d=h-i.startingPositionLeft+i.startingOffsetLeft}else{h=i.startingPositionLeft;d=i.startingOffsetLeft}if(this.options.verticalScrolling){p=(t+i.verticalOffset+this.viewportOffsetTop+i.startingPositionTop-i.startingOffsetTop+i.parentOffsetTop)*-(i.stellarRatio+s-1)+i.startingPositionTop;v=p-i.startingPositionTop+i.startingOffsetTop}else{p=i.startingPositionTop;v=i.startingOffsetTop}if(this.options.hideDistantElements){l=!this.options.horizontalScrolling||d+i.width>(i.isFixed?0:e)&&d<(i.isFixed?0:e)+this.viewportWidth+this.viewportOffsetLeft;f=!this.options.verticalScrolling||v+i.height>(i.isFixed?0:t)&&v<(i.isFixed?0:t)+this.viewportHeight+this.viewportOffsetTop}if(l&&f){if(i.isHidden){this.options.showElement(i.$element);i.isHidden=false}this._setPosition(i.$element,h,i.startingPositionLeft,p,i.startingPositionTop)}else{if(!i.isHidden){this.options.hideElement(i.$element);i.isHidden=true}}}for(m=this.backgrounds.length-1;m>=0;m--){o=this.backgrounds[m];s=o.isFixed?0:1;u=this.options.horizontalScrolling?(e+o.horizontalOffset-this.viewportOffsetLeft-o.startingOffsetLeft+o.parentOffsetLeft-o.startingBackgroundPositionLeft)*(s-o.stellarRatio)+"px":o.startingValueLeft;a=this.options.verticalScrolling?(t+o.verticalOffset-this.viewportOffsetTop-o.startingOffsetTop+o.parentOffsetTop-o.startingBackgroundPositionTop)*(s-o.stellarRatio)+"px":o.startingValueTop;c(o.$element,u,a)}},_handleScrollEvent:function(){var e=this,t=false;var n=function(){e._repositionElements();t=false};var r=function(){if(!t){p(n);t=true}};this.$scrollElement.bind("scroll."+this.name,r);r()},_startAnimationLoop:function(){var e=this;this._animationLoop=function(){p(e._animationLoop);e._repositionElements()};this._animationLoop()}};e.fn[i]=function(t){var n=arguments;if(t===r||typeof t==="object"){return this.each(function(){if(!e.data(this,"plugin_"+i)){e.data(this,"plugin_"+i,new d(this,t))}})}else if(typeof t==="string"&&t[0]!=="_"&&t!=="init"){return this.each(function(){var r=e.data(this,"plugin_"+i);if(r instanceof d&&typeof r[t]==="function"){r[t].apply(r,Array.prototype.slice.call(n,1))}if(t==="destroy"){e.data(this,"plugin_"+i,null)}})}};e[i]=function(n){var r=e(t);return r.stellar.apply(r,Array.prototype.slice.call(arguments,0))};e[i].scrollProperty=o;e[i].positionProperty=u;t.Stellar=d})(jQuery,this,document);
;(function(d){d.flexslider=function(j,l){var a=d(j),c=d.extend({},d.flexslider.defaults,l),e=c.namespace,q="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,u=q?"touchend":"click",m="vertical"===c.direction,n=c.reverse,h=0g?a.getTarget("next"):a.getTarget("prev");a.flexAnimate(d,c.pauseOnAction)});c.pausePlay&&f.pausePlay.setup();c.slideshow&&(c.pauseOnHover&&a.hover(function(){!a.manualPlay&&!a.manualPause&&a.pause()},
function(){!a.manualPause&&!a.manualPlay&&a.play()}),0');if(1 ':""+b+" ",a.controlNavScaffold.append(""+g+" "),b++;a.controlsContainer?d(a.controlsContainer).append(a.controlNavScaffold):a.append(a.controlNavScaffold);f.controlNav.set();f.controlNav.active();a.controlNavScaffold.delegate("a, img",u,function(b){b.preventDefault();b=d(this);var g=a.controlNav.index(b);b.hasClass(e+"active")||(a.direction=g>a.currentSlide?"next":"prev",a.flexAnimate(g,c.pauseOnAction))});q&&a.controlNavScaffold.delegate("a",
"click touchstart",function(a){a.preventDefault()})},setupManual:function(){a.controlNav=a.manualControls;f.controlNav.active();a.controlNav.live(u,function(b){b.preventDefault();b=d(this);var g=a.controlNav.index(b);b.hasClass(e+"active")||(g>a.currentSlide?a.direction="next":a.direction="prev",a.flexAnimate(g,c.pauseOnAction))});q&&a.controlNav.live("click touchstart",function(a){a.preventDefault()})},set:function(){a.controlNav=d("."+e+"control-nav li "+("thumbnails"===c.controlNav?"img":"a"),
a.controlsContainer?a.controlsContainer:a)},active:function(){a.controlNav.removeClass(e+"active").eq(a.animatingTo).addClass(e+"active")},update:function(b,c){1"+a.count+" ")):1===a.pagingCount?a.controlNavScaffold.find("li").remove():a.controlNav.eq(c).closest("li").remove();f.controlNav.set();1'+c.prevText+' '+c.nextText+" ");a.controlsContainer?(d(a.controlsContainer).append(b),a.directionNav=d("."+e+"direction-nav li a",a.controlsContainer)):(a.append(b),a.directionNav=d("."+e+"direction-nav li a",a));f.directionNav.update();a.directionNav.bind(u,function(b){b.preventDefault();b=d(this).hasClass(e+"next")?a.getTarget("next"):a.getTarget("prev");a.flexAnimate(b,c.pauseOnAction)});
q&&a.directionNav.bind("click touchstart",function(a){a.preventDefault()})},update:function(){var b=e+"disabled";1===a.pagingCount?a.directionNav.addClass(b):c.animationLoop?a.directionNav.removeClass(b):0===a.animatingTo?a.directionNav.removeClass(b).filter("."+e+"prev").addClass(b):a.animatingTo===a.last?a.directionNav.removeClass(b).filter("."+e+"next").addClass(b):a.directionNav.removeClass(b)}},pausePlay:{setup:function(){var b=d('');a.controlsContainer?
(a.controlsContainer.append(b),a.pausePlay=d("."+e+"pauseplay a",a.controlsContainer)):(a.append(b),a.pausePlay=d("."+e+"pauseplay a",a));f.pausePlay.update(c.slideshow?e+"pause":e+"play");a.pausePlay.bind(u,function(b){b.preventDefault();d(this).hasClass(e+"pause")?(a.manualPause=!0,a.manualPlay=!1,a.pause()):(a.manualPause=!1,a.manualPlay=!0,a.play())});q&&a.pausePlay.bind("click touchstart",function(a){a.preventDefault()})},update:function(b){"play"===b?a.pausePlay.removeClass(e+"pause").addClass(e+
"play").text(c.playText):a.pausePlay.removeClass(e+"play").addClass(e+"pause").text(c.pauseText)}},touch:function(){function b(b){k=m?d-b.touches[0].pageY:d-b.touches[0].pageX;q=m?Math.abs(k)k||a.currentSlide===a.last&&0Number(new Date)-l&&50r/2)?a.flexAnimate(m,c.pauseOnAction):s||a.flexAnimate(a.currentSlide,c.pauseOnAction,!0)}j.removeEventListener("touchend",g,!1);f=k=e=d=null}var d,e,f,r,k,l,q=!1;j.addEventListener("touchstart",function(k){a.animating?k.preventDefault():1===k.touches.length&&(a.pause(),r=m?a.h:a.w,l=Number(new Date),f=h&&n&&a.animatingTo===a.last?0:h&&n?a.limit-(a.itemW+c.itemMargin)*a.move*a.animatingTo:h&&a.currentSlide===a.last?a.limit:h?(a.itemW+c.itemMargin)*a.move*a.currentSlide:n?(a.last-a.currentSlide+a.cloneOffset)*r:(a.currentSlide+a.cloneOffset)*r,d=m?k.touches[0].pageY:k.touches[0].pageX,e=m?k.touches[0].pageX:k.touches[0].pageY,j.addEventListener("touchmove",b,!1),j.addEventListener("touchend",g,!1))},!1)},resize:function(){!a.animating&&a.is(":visible")&&(h||a.doMath(),s?f.smoothHeight():h?(a.slides.width(a.computedW),
a.update(a.pagingCount),a.setProps()):m?(a.viewport.height(a.h),a.setProps(a.h,"setTotal")):(c.smoothHeight&&f.smoothHeight(),a.newSlides.width(a.computedW),a.setProps(a.computedW,"setTotal")))},smoothHeight:function(b){if(!m||s){var c=s?a:a.viewport;b?c.animate({height:a.slides.eq(a.animatingTo).height()},b):c.height(a.slides.eq(a.animatingTo).height())}},sync:function(b){var g=d(c.sync).data("flexslider"),e=a.animatingTo;switch(b){case "animate":g.flexAnimate(e,c.pauseOnAction,!1,!0);break;case "play":!g.playing&&
!g.asNav&&g.play();break;case "pause":g.pause()}}};a.flexAnimate=function(b,g,p,j,l){t&&1===a.pagingCount&&(a.direction=a.currentItema.w?2*c.itemMargin:c.itemMargin,b=(a.itemW+b)*a.move*a.animatingTo,
b=b>a.limit&&1!==a.visible?a.limit:b):b=0===a.currentSlide&&b===a.count-1&&c.animationLoop&&"next"!==a.direction?n?(a.count+a.cloneOffset)*r:0:a.currentSlide===a.last&&0===b&&c.animationLoop&&"prev"!==a.direction?n?0:(a.count+1)*r:n?(a.count-1-b+a.cloneOffset)*r:(b+a.cloneOffset)*r;a.setProps(b,"",c.animationSpeed);if(a.transitions){if(!c.animationLoop||!a.atEnd)a.animating=!1,a.currentSlide=a.animatingTo;a.container.unbind("webkitTransitionEnd transitionend");a.container.bind("webkitTransitionEnd transitionend",
function(){a.wrapup(r)})}else a.container.animate(a.args,c.animationSpeed,c.easing,function(){a.wrapup(r)})}c.smoothHeight&&f.smoothHeight(c.animationSpeed)}};a.wrapup=function(b){!s&&!h&&(0===a.currentSlide&&a.animatingTo===a.last&&c.animationLoop?a.setProps(b,"jumpEnd"):a.currentSlide===a.last&&(0===a.animatingTo&&c.animationLoop)&&a.setProps(b,"jumpStart"));a.animating=!1;a.currentSlide=a.animatingTo;c.after(a)};a.animateSlides=function(){a.animating||a.flexAnimate(a.getTarget("next"))};a.pause=
function(){clearInterval(a.animatedSlides);a.playing=!1;c.pausePlay&&f.pausePlay.update("play");a.syncExists&&f.sync("pause")};a.play=function(){a.animatedSlides=setInterval(a.animateSlides,c.slideshowSpeed);a.playing=!0;c.pausePlay&&f.pausePlay.update("pause");a.syncExists&&f.sync("play")};a.canAdvance=function(b,g){var d=t?a.pagingCount-1:a.last;return g?!0:t&&a.currentItem===a.count-1&&0===b&&"prev"===a.direction?!0:t&&0===a.currentItem&&b===a.pagingCount-1&&"next"!==a.direction?!1:b===a.currentSlide&&
!t?!1:c.animationLoop?!0:a.atEnd&&0===a.currentSlide&&b===d&&"next"!==a.direction?!1:a.atEnd&&a.currentSlide===d&&0===b&&"next"===a.direction?!1:!0};a.getTarget=function(b){a.direction=b;return"next"===b?a.currentSlide===a.last?0:a.currentSlide+1:0===a.currentSlide?a.last:a.currentSlide-1};a.setProps=function(b,g,d){var e,f=b?b:(a.itemW+c.itemMargin)*a.move*a.animatingTo;e=-1*function(){if(h)return"setTouch"===g?b:n&&a.animatingTo===a.last?0:n?a.limit-(a.itemW+c.itemMargin)*a.move*a.animatingTo:a.animatingTo===a.last?a.limit:f;switch(g){case "setTotal":return n?(a.count-1-a.currentSlide+a.cloneOffset)*b:(a.currentSlide+a.cloneOffset)*b;case "setTouch":return b;case "jumpEnd":return n?b:a.count*b;case "jumpStart":return n?a.count*b:b;default:return b}}()+"px";a.transitions&&(e=m?"translate3d(0,"+e+",0)":"translate3d("+e+",0,0)",d=void 0!==d?d/1E3+"s":"0s",a.container.css("-"+a.pfx+"-transition-duration",d));a.args[a.prop]=e;(a.transitions||void 0===d)&&a.container.css(a.args)};a.setup=function(b){if(s)a.slides.css({width:"100%",
"float":"left",marginRight:"-100%",position:"relative"}),"init"===b&&(q?a.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+c.animationSpeed/1E3+"s ease",zIndex:1}).eq(a.currentSlide).css({opacity:1,zIndex:2}):a.slides.eq(a.currentSlide).fadeIn(c.animationSpeed,c.easing)),c.smoothHeight&&f.smoothHeight();else{var g,p;"init"===b&&(a.viewport=d('
').css({overflow:"hidden",position:"relative"}).appendTo(a).append(a.container),a.cloneCount=0,a.cloneOffset=
0,n&&(p=d.makeArray(a.slides).reverse(),a.slides=d(p),a.container.empty().append(a.slides)));c.animationLoop&&!h&&(a.cloneCount=2,a.cloneOffset=1,"init"!==b&&a.container.find(".clone").remove(),a.container.append(a.slides.first().clone().addClass("clone")).prepend(a.slides.last().clone().addClass("clone")));a.newSlides=d(c.selector,a);g=n?a.count-1-a.currentSlide+a.cloneOffset:a.currentSlide+a.cloneOffset;m&&!h?(a.container.height(200*(a.count+a.cloneCount)+"%").css("position","absolute").width("100%"),
setTimeout(function(){a.newSlides.css({display:"block"});a.doMath();a.viewport.height(a.h);a.setProps(g*a.h,"init")},"init"===b?100:0)):(a.container.width(200*(a.count+a.cloneCount)+"%"),a.setProps(g*a.computedW,"init"),setTimeout(function(){a.doMath();a.newSlides.css({width:a.computedW,"float":"left",display:"block"});c.smoothHeight&&f.smoothHeight()},"init"===b?100:0))}h||a.slides.removeClass(e+"active-slide").eq(a.currentSlide).addClass(e+"active-slide")};a.doMath=function(){var b=a.slides.first(),
d=c.itemMargin,e=c.minItems,f=c.maxItems;a.w=a.width();a.h=b.height();a.boxPadding=b.outerWidth()-b.width();h?(a.itemT=c.itemWidth+d,a.minW=e?e*a.itemT:a.w,a.maxW=f?f*a.itemT:a.w,a.itemW=a.minW>a.w?(a.w-d*e)/e:a.maxWa.w?a.w:c.itemWidth,a.visible=Math.floor(a.w/(a.itemW+d)),a.move=0a.w?(a.itemW+2*d)*a.count-a.w-
d:(a.itemW+d)*a.count-a.w-d):(a.itemW=a.w,a.pagingCount=a.count,a.last=a.count-1);a.computedW=a.itemW-a.boxPadding};a.update=function(b,d){a.doMath();h||(ba.controlNav.length)f.controlNav.update("add");else if("remove"===d&&!h||a.pagingCounta.last&&(a.currentSlide-=1,a.animatingTo-=1),
f.controlNav.update("remove",a.last);c.directionNav&&f.directionNav.update()};a.addSlide=function(b,e){var f=d(b);a.count+=1;a.last=a.count-1;m&&n?void 0!==e?a.slides.eq(a.count-e).after(f):a.container.prepend(f):void 0!==e?a.slides.eq(e).before(f):a.container.append(f);a.update(e,"add");a.slides=d(c.selector+":not(.clone)",a);a.setup();c.added(a)};a.removeSlide=function(b){var e=isNaN(b)?a.slides.index(d(b)):b;a.count-=1;a.last=a.count-1;isNaN(b)?d(b,a.slides).remove():m&&n?a.slides.eq(a.last).remove():
a.slides.eq(b).remove();a.doMath();a.update(e,"remove");a.slides=d(c.selector+":not(.clone)",a);a.setup();c.removed(a)};f.init()};d.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationLoop:!0,smoothHeight:!1,startAt:0,slideshow:!0,slideshowSpeed:7E3,animationSpeed:600,initDelay:0,randomize:!1,pauseOnAction:!0,pauseOnHover:!1,useCSS:!0,touch:!0,video:!1,controlNav:!0,directionNav:!0,prevText:"",nextText:"",
keyboard:!0,multipleKeyboard:!1,mousewheel:!1,pausePlay:!1,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:0,maxItems:0,move:0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){}};d.fn.flexslider=function(j){void 0===j&&(j={});if("object"===typeof j)return this.each(function(){var a=d(this),c=a.find(j.selector?j.selector:".slides > li");1===c.length?(c.fadeIn(400),
j.start&&j.start(a)):void 0==a.data("flexslider")&&new d.flexslider(this,j)});var l=d(this).data("flexslider");switch(j){case "play":l.play();break;case "pause":l.pause();break;case "next":l.flexAnimate(l.getTarget("next"),!0);break;case "prev":case "previous":l.flexAnimate(l.getTarget("prev"),!0);break;default:"number"===typeof j&&l.flexAnimate(j,!0)}}})(jQuery);
;(function(a,b,c){"use strict";var d=a.document,e=a.Modernizr,f=function(a){return a.charAt(0).toUpperCase()+a.slice(1)},g="Moz Webkit O Ms".split(" "),h=function(a){var b=d.documentElement.style,c;if(typeof b[a]=="string")return a;a=f(a);for(var e=0,h=g.length;e"+d+"{#modernizr{height:3px}}"+"").appendTo("head"),f=b('
').appendTo("html");a=f.height()===3,f.remove(),e.remove()}return a},csstransitions:function(){return!!j}},l;if(e)for(l in k)e.hasOwnProperty(l)||e.addTest(l,k[l]);else{e=a.Modernizr={_version:"1.6ish: miniModernizr for Isotope"};var m=" ",n;for(l in k)n=k[l](),e[l]=n,m+=" "+(n?"":"no-")+l;b("html").addClass(m)}if(e.csstransforms){var o=e.csstransforms3d?{translate:function(a){return"translate3d("+a[0]+"px, "+a[1]+"px, 0) "},scale:function(a){return"scale3d("+a+", "+a+", 1) "}}:{translate:function(a){return"translate("+a[0]+"px, "+a[1]+"px) "},scale:function(a){return"scale("+a+") "}},p=function(a,c,d){var e=b.data(a,"isoTransform")||{},f={},g,h={},j;f[c]=d,b.extend(e,f);for(g in e)j=e[g],h[g]=o[g](j);var k=h.translate||"",l=h.scale||"",m=k+l;b.data(a,"isoTransform",e),a.style[i]=m};b.cssNumber.scale=!0,b.cssHooks.scale={set:function(a,b){p(a,"scale",b)},get:function(a,c){var d=b.data(a,"isoTransform");return d&&d.scale?d.scale:1}},b.fx.step.scale=function(a){b.cssHooks.scale.set(a.elem,a.now+a.unit)},b.cssNumber.translate=!0,b.cssHooks.translate={set:function(a,b){p(a,"translate",b)},get:function(a,c){var d=b.data(a,"isoTransform");return d&&d.translate?d.translate:[0,0]}}}var q,r;e.csstransitions&&(q={WebkitTransitionProperty:"webkitTransitionEnd",MozTransitionProperty:"transitionend",OTransitionProperty:"oTransitionEnd otransitionend",transitionProperty:"transitionend"}[j],r=h("transitionDuration"));var s=b.event,t=b.event.handle?"handle":"dispatch",u;s.special.smartresize={setup:function(){b(this).bind("resize",s.special.smartresize.handler)},teardown:function(){b(this).unbind("resize",s.special.smartresize.handler)},handler:function(a,b){var c=this,d=arguments;a.type="smartresize",u&&clearTimeout(u),u=setTimeout(function(){s[t].apply(c,d)},b==="execAsap"?0:100)}},b.fn.smartresize=function(a){return a?this.bind("smartresize",a):this.trigger("smartresize",["execAsap"])},b.Isotope=function(a,c,d){this.element=b(c),this._create(a),this._init(d)};var v=["width","height"],w=b(a);b.Isotope.settings={resizable:!0,layoutMode:"masonry",containerClass:"isotope",itemClass:"isotope-item",hiddenClass:"isotope-hidden",hiddenStyle:{opacity:0,scale:.001},visibleStyle:{opacity:1,scale:1},containerStyle:{position:"relative",overflow:"hidden"},animationEngine:"best-available",animationOptions:{queue:!1,duration:800},sortBy:"original-order",sortAscending:!0,resizesContainer:!0,transformsEnabled:!0,itemPositionDataEnabled:!1},b.Isotope.prototype={_create:function(a){this.options=b.extend({},b.Isotope.settings,a),this.styleQueue=[],this.elemCount=0;var c=this.element[0].style;this.originalStyle={};var d=v.slice(0);for(var e in this.options.containerStyle)d.push(e);for(var f=0,g=d.length;fg?1:f0&&(i=function(a,b){b.$el[d](b.style,f).one(q,k)},j=!1)}}b.each(this.styleQueue,i),j&&k(),this.styleQueue=[]},resize:function(){this["_"+this.options.layoutMode+"ResizeChanged"]()&&this.reLayout()},reLayout:function(a){this["_"+this.options.layoutMode+"Reset"](),this.layout(this.$filteredAtoms,a)},addItems:function(a,b){var c=this._getAtoms(a);this.$allAtoms=this.$allAtoms.add(c),b&&b(c)},insert:function(a,b){this.element.append(a);var c=this;this.addItems(a,function(a){var d=c._filter(a);c._addHideAppended(d),c._sort(),c.reLayout(),c._revealAppended(d,b)})},appended:function(a,b){var c=this;this.addItems(a,function(a){c._addHideAppended(a),c.layout(a),c._revealAppended(a,b)})},_addHideAppended:function(a){this.$filteredAtoms=this.$filteredAtoms.add(a),a.addClass("no-transition"),this._isInserting=!0,this.styleQueue.push({$el:a,style:this.options.hiddenStyle})},_revealAppended:function(a,b){var c=this;setTimeout(function(){a.removeClass("no-transition"),c.styleQueue.push({$el:a,style:c.options.visibleStyle}),c._isInserting=!1,c._processStyleQueue(a,b)},10)},reloadItems:function(){this.$allAtoms=this._getAtoms(this.element.children())},remove:function(a,b){this.$allAtoms=this.$allAtoms.not(a),this.$filteredAtoms=this.$filteredAtoms.not(a);var c=this,d=function(){a.remove(),b&&b.call(c.element)};a.filter(":not(."+this.options.hiddenClass+")").length?(this.styleQueue.push({$el:a,style:this.options.hiddenStyle}),this._sort(),this.reLayout(d)):d()},shuffle:function(a){this.updateSortData(this.$allAtoms),this.options.sortBy="random",this._sort(),this.reLayout(a)},destroy:function(){var a=this.usingTransforms,b=this.options;this.$allAtoms.removeClass(b.hiddenClass+" "+b.itemClass).each(function(){var b=this.style;b.position="",b.top="",b.left="",b.opacity="",a&&(b[i]="")});var c=this.element[0].style;for(var d in this.originalStyle)c[d]=this.originalStyle[d];this.element.unbind(".isotope").undelegate("."+b.hiddenClass,"click").removeClass(b.containerClass).removeData("isotope"),w.unbind(".isotope")},_getSegments:function(a){var b=this.options.layoutMode,c=a?"rowHeight":"columnWidth",d=a?"height":"width",e=a?"rows":"cols",g=this.element[d](),h,i=this.options[b]&&this.options[b][c]||this.$filteredAtoms["outer"+f(d)](!0)||g;h=Math.floor(g/i),h=Math.max(h,1),this[b][e]=h,this[b][c]=i},_checkIfSegmentsChanged:function(a){var b=this.options.layoutMode,c=a?"rows":"cols",d=this[b][c];return this._getSegments(a),this[b][c]!==d},_masonryReset:function(){this.masonry={},this._getSegments();var a=this.masonry.cols;this.masonry.colYs=[];while(a--)this.masonry.colYs.push(0)},_masonryLayout:function(a){var c=this,d=c.masonry;a.each(function(){var a=b(this),e=Math.ceil(a.outerWidth(!0)/d.columnWidth);e=Math.min(e,d.cols);if(e===1)c._masonryPlaceBrick(a,d.colYs);else{var f=d.cols+1-e,g=[],h,i;for(i=0;id&&(e.x=0,e.y=e.height),c._pushPosition(a,e.x,e.y),e.height=Math.max(e.y+g,e.height),e.x+=f})},_fitRowsGetContainerSize:function(){return{height:this.fitRows.height}},_fitRowsResizeChanged:function(){return!0},_cellsByRowReset:function(){this.cellsByRow={index:0},this._getSegments(),this._getSegments(!0)},_cellsByRowLayout:function(a){var c=this,d=this.cellsByRow;a.each(function(){var a=b(this),e=d.index%d.cols,f=Math.floor(d.index/d.cols),g=(e+.5)*d.columnWidth-a.outerWidth(!0)/2,h=(f+.5)*d.rowHeight-a.outerHeight(!0)/2;c._pushPosition(a,g,h),d.index++})},_cellsByRowGetContainerSize:function(){return{height:Math.ceil(this.$filteredAtoms.length/this.cellsByRow.cols)*this.cellsByRow.rowHeight+this.offset.top}},_cellsByRowResizeChanged:function(){return this._checkIfSegmentsChanged()},_straightDownReset:function(){this.straightDown={y:0}},_straightDownLayout:function(a){var c=this;a.each(function(a){var d=b(this);c._pushPosition(d,0,c.straightDown.y),c.straightDown.y+=d.outerHeight(!0)})},_straightDownGetContainerSize:function(){return{height:this.straightDown.y}},_straightDownResizeChanged:function(){return!0},_masonryHorizontalReset:function(){this.masonryHorizontal={},this._getSegments(!0);var a=this.masonryHorizontal.rows;this.masonryHorizontal.rowXs=[];while(a--)this.masonryHorizontal.rowXs.push(0)},_masonryHorizontalLayout:function(a){var c=this,d=c.masonryHorizontal;a.each(function(){var a=b(this),e=Math.ceil(a.outerHeight(!0)/d.rowHeight);e=Math.min(e,d.rows);if(e===1)c._masonryHorizontalPlaceBrick(a,d.rowXs);else{var f=d.rows+1-e,g=[],h,i;for(i=0;id&&(e.x=e.width,e.y=0),c._pushPosition(a,e.x,e.y),e.width=Math.max(e.x+f,e.width),e.y+=g})},_fitColumnsGetContainerSize:function(){return{width:this.fitColumns.width}},_fitColumnsResizeChanged:function(){return!0},_cellsByColumnReset:function(){this.cellsByColumn={index:0},this._getSegments(),this._getSegments(!0)},_cellsByColumnLayout:function(a){var c=this,d=this.cellsByColumn;a.each(function(){var a=b(this),e=Math.floor(d.index/d.rows),f=d.index%d.rows,g=(e+.5)*d.columnWidth-a.outerWidth(!0)/2,h=(f+.5)*d.rowHeight-a.outerHeight(!0)/2;c._pushPosition(a,g,h),d.index++})},_cellsByColumnGetContainerSize:function(){return{width:Math.ceil(this.$filteredAtoms.length/this.cellsByColumn.rows)*this.cellsByColumn.columnWidth}},_cellsByColumnResizeChanged:function(){return this._checkIfSegmentsChanged(!0)},_straightAcrossReset:function(){this.straightAcross={x:0}},_straightAcrossLayout:function(a){var c=this;a.each(function(a){var d=b(this);c._pushPosition(d,c.straightAcross.x,0),c.straightAcross.x+=d.outerWidth(!0)})},_straightAcrossGetContainerSize:function(){return{width:this.straightAcross.x}},_straightAcrossResizeChanged:function(){return!0}},b.fn.imagesLoaded=function(a){function h(){a.call(c,d)}function i(a){var c=a.target;c.src!==f&&b.inArray(c,g)===-1&&(g.push(c),--e<=0&&(setTimeout(h),d.unbind(".imagesLoaded",i)))}var c=this,d=c.find("img").add(c.filter("img")),e=d.length,f="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",g=[];return e||h(),d.bind("load.imagesLoaded error.imagesLoaded",i).each(function(){var a=this.src;this.src=f,this.src=a}),c};var x=function(b){a.console&&a.console.error(b)};b.fn.isotope=function(a,c){if(typeof a=="string"){var d=Array.prototype.slice.call(arguments,1);this.each(function(){var c=b.data(this,"isotope");if(!c){x("cannot call methods on isotope prior to initialization; attempted to call method '"+a+"'");return}if(!b.isFunction(c[a])||a.charAt(0)==="_"){x("no such method '"+a+"' for isotope instance");return}c[a].apply(c,d)})}else this.each(function(){var d=b.data(this,"isotope");d?(d.option(a),d._init(c)):b.data(this,"isotope",new b.Isotope(a,this,c))});return this}})(window,jQuery);
function isScrolledIntoView(e){var t="#"+e;var n=$(window).scrollTop();var r=n+$(window).height();if($(t).length>0){var i=$(t).offset().top;var s=i+$(t).height()}return s>=n&&i<=r&&s<=r&&i>=n}function sliding_horizontal_graph(e,t){$("#"+e+" li span").each(function(n){var r=n+1;var i=$("#"+e+" li:nth-child("+r+") span");var s=i.attr("title");i.animate({width:s+"%"},t)})}function graph_init(e,t){$(window).scroll(function(){if(isScrolledIntoView(e)){sliding_horizontal_graph(e,t)}else{}});if(isScrolledIntoView(e)){sliding_horizontal_graph(e,t)}}function htmlDecode(e){var t=$("
").html(e).text();return t}function playpause(e){if(e.hasClass("playing")){$("#slider_container").cameraResume();e.removeClass("playing").addClass("paused")}else{$("#slider_container").cameraPause();e.removeClass("paused").addClass("playing")}}
;(function(e){jQuery.browser={};jQuery.browser.mozilla=/mozilla/.test(navigator.userAgent.toLowerCase())&&!/webkit/.test(navigator.userAgent.toLowerCase());jQuery.browser.webkit=/webkit/.test(navigator.userAgent.toLowerCase());jQuery.browser.opera=/opera/.test(navigator.userAgent.toLowerCase());jQuery.browser.msie=/msie/.test(navigator.userAgent.toLowerCase());if(!Array.prototype.indexOf){Array.prototype.indexOf=function(e){var t=this.length>>>0;var n=Number(arguments[1])||0;n=n<0?Math.ceil(n):Math.floor(n);if(n<0)n+=t;for(;n0){h();m()}else{v()}};var h=function(){i=e("
").appendTo("body").css({display:"none",width:0,height:0,overflow:"hidden"});for(var n=0;t.length>n;n++){e.ajax({url:t[n],type:"HEAD",complete:function(e){if(!r){a++;p(this["url"])}}})}};var p=function(t){var n=e(" ").attr("src",t).bind("load error",function(){d()}).appendTo(i)};var d=function(){n++;var t=n/a*100;e(o).stop().animate({width:t+"%",minWidth:t+"%"},{duration:200});if(l.percentage==true){e(u).text(Math.ceil(t)+"%");e("#des_website_load .percentage").text(Math.ceil(t)+"%")}if(n==a){v()}};var v=function(){e(i).remove();l.onLoadComplete();r=true};var m=function(){s=e("
").appendTo("body");if(l.percentage==true){u=e("
").text("0%").css({height:"40px",width:"300px",position:"absolute",top:"50%",marginTop:"-"+(59+l.barHeight)+"px",textAlign:"center"}).appendTo(s);e("#des_website_load .percentage").css({height:"40px",width:"300px",position:"absolute",top:"50%",marginTop:59+l.barHeight+"px",textAlign:"center"})}if(!t.length){v()}};var g=function(n){var r="";if(e(n).css("background-image")!="none"){var r=e(n).css("background-image")}else if(typeof e(n).attr("src")!="undefined"&&n.nodeName.toLowerCase()=="img"){var r=e(n).attr("src")}if(r.indexOf("gradient")==-1){r=r.replace(/url\(\"/g,"");r=r.replace(/url\(/g,"");r=r.replace(/\"\)/g,"");r=r.replace(/\)/g,"");var i=r.split(", ");for(var s=0;s0&&t.indexOf(i[s])==-1&&!i[s].match(/^(data:)/i)){var o="";if(e.browser.msie&&e.browser.version<9){o="?"+Math.floor(Math.random()*3e3)}t.push(i[s]+o)}}}};e.fn.queryLoader2=function(t){if(t){e.extend(l,t)}this.each(function(){g(this);if(l.deepSearch==true){e(this).find("*:not(script)").each(function(){g(this)})}});c();return this};var y={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS"},searchString:function(e){for(var t=0;t /g,"^>")}function u(e,t){return e.replace(r,function(e){var n=/^[a-z]+:/i.test(e)?e:"http://"+e;var r=e;for(var i=0;i'+o(r)+""})}function a(e){return Date.parse(e.replace(/^([a-z]{3})([a-z]{3} \d\d?)(.*)(\d{4})$/i,"$1,$2$4$3"))}function f(e){var t=arguments.length>1?arguments[1]:new Date;var n=parseInt((t.getTime()-e)/1e3,10);var r="";if(n<1){r="just now"}else if(n<60){r=n+" seconds ago"}else if(n<120){r="about a minute ago"}else if(n<45*60){r="about "+parseInt(n/60,10).toString()+" minutes ago"}else if(n<2*60*60){r="about an hour ago"}else if(n<24*60*60){r="about "+parseInt(n/3600,10).toString()+" hours ago"}else if(n<48*60*60){r="about a day ago"}else{r="about "+parseInt(n/86400,10).toString()+" days ago"}return r}function l(e){if(e.match(/^(@([A-Za-z0-9-_]+)) .*/i)){return n.auto_join_text_reply}else if(e.match(r)){return n.auto_join_text_url}else if(e.match(/^((\w+ed)|just) .*/im)){return n.auto_join_text_ed}else if(e.match(/^(\w*ing) .*/i)){return n.auto_join_text_ing}else{return n.auto_join_text_default}}function c(){var t=n.modpath,r=n.fetch===null?n.count:n.fetch,i={include_entities:1};if(n.list){return{host:n.twitter_api_url,url:"/1.1/lists/statuses.json",parameters:e.extend({},i,{list_id:n.list_id,slug:n.list,owner_screen_name:n.username,page:n.page,count:r,include_rts:n.retweets?1:0})}}else if(n.favorites){return{host:n.twitter_api_url,url:"/1.1/favorites/list.json",parameters:e.extend({},i,{list_id:n.list_id,screen_name:n.username,page:n.page,count:r})}}else if(n.query===null&&n.username.length===1){return{host:n.twitter_api_url,url:"/1.1/statuses/user_timeline.json",parameters:e.extend({},i,{screen_name:n.username,page:n.page,count:r,include_rts:n.retweets?1:0})}}else{var s=n.query||"from:"+n.username.join(" OR from:");return{host:n.twitter_search_url,url:"/search.json",parameters:e.extend({},i,{page:n.page,q:s,rpp:r})}}}function h(e,t){if(t){return"user"in e?e.user.profile_image_url_https:h(e,false).replace(/^http:\/\/[a-z0-9]{1,3}\.twimg\.com\//,"https://s3.amazonaws.com/twitter_production/")}else{return e.profile_image_url||e.user.profile_image_url}}function p(t){var r={};r.item=t;r.source=t.source;r.name=t.from_user_name||t.user.name;r.screen_name=t.from_user||t.user.screen_name;r.avatar_size=n.avatar_size;r.avatar_url=h(t,document.location.protocol==="https:");r.retweet=typeof t.retweeted_status!="undefined";r.tweet_time=a(t.created_at);r.join_text=n.join_text=="auto"?l(t.text):n.join_text;r.tweet_id=t.id_str;r.twitter_base="http://"+n.twitter_url+"/";r.user_url=r.twitter_base+r.screen_name;r.tweet_url=r.user_url+"/status/"+r.tweet_id;r.reply_url=r.twitter_base+"intent/tweet?in_reply_to="+r.tweet_id;r.retweet_url=r.twitter_base+"intent/retweet?tweet_id="+r.tweet_id;r.favorite_url=r.twitter_base+"intent/favorite?tweet_id="+r.tweet_id;r.retweeted_screen_name=r.retweet&&t.retweeted_status.user.screen_name;r.tweet_relative_time=f(r.tweet_time);r.entities=t.entities?(t.entities.urls||[]).concat(t.entities.media||[]):[];r.tweet_raw_text=r.retweet?"RT @"+r.retweeted_screen_name+" "+t.retweeted_status.text:t.text;r.tweet_text=e([u(r.tweet_raw_text,r.entities)]).linkUser().linkHash()[0];r.tweet_text_fancy=e([r.tweet_text]).makeHeart()[0];r.user=i('',r);r.join=n.join_text?i(' ',r):" ";r.avatar=r.avatar_size?i('',r):"";r.time=i('',r);r.text=i('',r);r.reply_action=i('',r);r.retweet_action=i('',r);r.favorite_action=i('',r);return r}var n=e.extend({modpath:"./twitter/",username:null,list_id:null,list:null,favorites:false,query:null,avatar_size:null,count:3,fetch:null,page:1,retweets:true,intro_text:null,outro_text:null,join_text:null,auto_join_text_default:"i said,",auto_join_text_ed:"i",auto_join_text_ing:"i am",auto_join_text_reply:"i replied to",auto_join_text_url:"i was looking at",loading_text:null,refresh_interval:null,twitter_url:"twitter.com",twitter_api_url:"api.twitter.com",twitter_search_url:"search.twitter.com",template:"{avatar}{time}{join}{text}",comparator:function(e,t){return t["tweet_time"]-e["tweet_time"]},filter:function(e){return true}},t);var r=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi;e.extend({tweet:{t:i}});e.fn.extend({linkUser:s(/(^|[\W])@(\w+)/gi,'$1@ $2 '),linkHash:s(/(?:^|)[\#]+([\w\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u00ff\u0600-\u06ff]+)/gi,' '),makeHeart:s(/(<)+[3]/gi,"♥ ")});return this.each(function(t,r){var s=e(' ').appendTo(b).click(function(g){g.preventDefault();d.paused?d.play():d.pause();return false});d.addEventListener("play",function(){e.removeClass("mejs-play").addClass("mejs-pause")},false);
d.addEventListener("playing",function(){e.removeClass("mejs-play").addClass("mejs-pause")},false);d.addEventListener("pause",function(){e.removeClass("mejs-pause").addClass("mejs-play")},false);d.addEventListener("paused",function(){e.removeClass("mejs-pause").addClass("mejs-play")},false)}})})(mejs.$);
(function(f){f.extend(mejs.MepDefaults,{stopText:"Stop"});f.extend(MediaElementPlayer.prototype,{buildstop:function(a,b,c,d){f('
'; if(cff_comment_author_info){ if(typeof commentItem.from.link!=='undefined'){ cff_comments +=''+commentItem.from.name+''; }else{ cff_comments +=''+commentItem.from.name+''; }} if(cff_post_tags&&commentItem.hasOwnProperty('message_tags')){ $.each(commentItem.message_tags, function(i, message_tag){ tag_name=message_tag.name; tag_link=''+message_tag.name+''; comment_message=comment_message.replace(tag_name, tag_link); }); } cff_comments +=comment_message+'
'; if(commentItem.hasOwnProperty('attachment')){ if(commentItem.attachment.hasOwnProperty('media')){ if(consentGiven){ cff_comments +=''; } if(consentGiven){ if(commentItem.attachment.hasOwnProperty('title')){ cff_comments +=commentItem.attachment.title; }else{ cff_comments +='Attachment'; } cff_comments +='" />'; }else{ cff_comments +=''; }} } cff_comments +=''; var cff_middot='', cff_comment_time=$self.find('#cff_'+commentItem.id).attr('data-cff-comment-date'); if(typeof cff_comment_time!=='undefined'){ cff_comments +=''+cff_comment_time+''; cff_middot=' · '; } if(commentItem.like_count > 0) cff_comments +=''+like_svg_2+''+commentItem.like_count+''; cff_comments +=''; var cff_comment_count=parseInt(commentItem.comment_count); if(cff_comment_count > 0){ var cff_replies_text_string=''; (cff_comment_count==1) ? cff_replies_text_string=cff_translate_reply_text:cff_replies_text_string=cff_translate_replies_text; cff_comments +=''+cff_comment_count+' '+cff_replies_text_string+'
'; } cff_comments +='