(function($){var days=24*60*60,hours=60*60,minutes=60;$.fn.countdown=function(prop){var options=$.extend({callback:function(){},timestamp:0},prop);var left,d,h,m,s,positions;init(this,options);positions=this.find('.position');(function tick(){left=Math.floor((options.timestamp-(new Date()))/1000);if(left<0){left=0;}
var posEx=0;d=Math.floor(left/days);if(d>=100){posEx=1;updateTri(0,1,2,d);}else{updateDuo(0+posEx,1+posEx,d);}
left-=d*days;h=Math.floor(left/hours);updateDuo(2+posEx,3+posEx,h);left-=h*hours;m=Math.floor(left/minutes);updateDuo(4+posEx,5+posEx,m);left-=m*minutes;s=left;updateDuo(6+posEx,7+posEx,s);options.callback(d,h,m,s);setTimeout(tick,1000);})();function updateDuo(minor,major,value){switchDigit(positions.eq(minor),Math.floor(value/10)%10);switchDigit(positions.eq(major),value%10);}
function updateTri(first,second,third,value){switchDigit(positions.eq(first),Math.floor(value/100)%100);switchDigit(positions.eq(second),Math.floor(value/10)%10);switchDigit(positions.eq(third),value%10);}
return this;};function init(elem,options){elem.addClass('countdownHolder');$.each(['Days','Hours','Minutes','Seconds'],function(i){var boxName;if(this=="Days"){boxName="d";}
else if(this=="Hours"){boxName="h";}
else if(this=="Minutes"){boxName="m";}
else{boxName="s";}
left=Math.floor((options.timestamp-(new Date()))/1000);if(left<0){left=0;}
d=Math.floor(left/days);var html='<div class="count'+this+'">';if(this=="Days"&&d>=100){html+='<span class="position">'+'<span class="digit static">0</span>'+'</span>';}
html+='<span class="position">'+'<span class="digit static">0</span>'+'</span>'+'<span class="position">'+'<span class="digit static">0</span>'+'</span>'+'<span class="boxName">'+'<span class="'+this+'">'+boxName+'</span>'+'</span>'
$(html).appendTo(elem);});}
function switchDigit(position,number){var digit=position.find('.digit')
if(digit.is(':animated')){return false;}
if(position.data('digit')==number){return false;}
position.data('digit',number);var replacement=$('<span>',{'class':'digit',css:{top:0,opacity:0},html:number});digit.before(replacement).removeClass('static').animate({top:0,opacity:0},'fast',function(){digit.remove();})
replacement.delay(100).animate({top:0,opacity:1},'fast',function(){replacement.addClass('static');});}})(jQuery);;
/*!
 * jQuery Cookie Plugin v1.4.0
 * https://github.com/carhartl/jquery-cookie
 *
 * Copyright 2013 Klaus Hartl
 * Released under the MIT license
 */
(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else{factory(jQuery);}}(function($){var pluses=/\+/g;function encode(s){return config.raw?s:encodeURIComponent(s);}
function decode(s){return config.raw?s:decodeURIComponent(s);}
function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value));}
function parseCookieValue(s){if(s.indexOf('"')===0){s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,'\\');}
try{s=decodeURIComponent(s.replace(pluses,' '));return config.json?JSON.parse(s):s;}catch(e){}}
function read(s,converter){var value=config.raw?s:parseCookieValue(s);return $.isFunction(converter)?converter(value):value;}
var config=$.cookie=function(key,value,options){if(value!==undefined&&!$.isFunction(value)){options=$.extend({},config.defaults,options);if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days);}
return(document.cookie=[encode(key),'=',stringifyCookieValue(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''));}
var result=key?undefined:{};var cookies=document.cookie?document.cookie.split('; '):[];for(var i=0,l=cookies.length;i<l;i++){var parts=cookies[i].split('=');var name=decode(parts.shift());var cookie=parts.join('=');if(key&&key===name){result=read(cookie,value);break;}
if(!key&&(cookie=read(cookie))!==undefined){result[name]=cookie;}}
return result;};config.defaults={};$.removeCookie=function(key,options){if($.cookie(key)===undefined){return false;}
$.cookie(key,'',$.extend({},options,{expires:-1}));return!$.cookie(key);};}));;+function($){function dwpb_fix_hieght(){var dwpb_height=$('#dwpb').outerHeight();var adminbar_height=$('.admin-bar #wpadminbar').outerHeight();function dwpb_custom_style(){if(!$('#dwpb-custom-style').length){$('<style id="dwpb-custom-style">body.dwpb-push-page.dwpb-open, body.dwpb-push-page.admin-bar.dwpb-open #wpadminbar, .dwpb-twenty-fourteen.dwpb-open.dwpb-push-page .site-header{top:'+dwpb_height+'px}</style>').appendTo('body');$('<style id="dwpb-custom-style-twenty-fourteen">.admin-bar.dwpb-twenty-fourteen.dwpb-open.dwpb-push-page .site-header{top:'+(dwpb_height+adminbar_height)+'px}</style>').appendTo('body');}else{return false;}}
setTimeout(function(){dwpb_custom_style();$('.dwpb-open .dwpb-action').click(function(){dwpb_custom_style();});},1010);}
$(document).ready(function(){$('.dwpb-counter').countdown({timestamp:(new Date()).getTime()+(dwpb.timeleft*1000),callback:function(d,h,m,s){if(d===0&&h===0&&m===0&&s===0){$('.dwpb-message').removeClass('hide');$('.dwpb-countdown').addClass('hide');}}});dwpb_fix_hieght();$('.dwpb-action').click(function(){$('body').toggleClass('dwpb-open');});setTimeout(function(){$('body').addClass('dwpb-open');},1000);if(!$('body').hasClass('dwpb-allow-close')){var cookie=$.cookie('dwpb-hide');if(cookie==='dwpb-hide'){setTimeout(function(){$('body').removeClass('dwpb-open');},1000);}
$('.dwpb-action').click(function(){if(cookie===undefined){$.cookie('dwpb-hide','dwpb-hide',{path:'/'});}else{$.removeCookie('dwpb-hide',{path:'/'});}});}
if($('body').hasClass('dwpb-allow-close')){function remove_promobar(){$('#dwpb, .dwpb-close').remove();$('body').removeClass('dwpb-cover-page dwpb-ramain-top dwpb-open dwpb-push-page dwpb-twenty-fourteen');}
$('.dwpb-close').click(function(){remove_promobar();});$('.dwpb-close').click(function(){if(cookie===undefined){$.cookie('dwpb-close','dwpb-close-'+dwpb.reset_cookie,{path:'/'});}});if($.cookie('dwpb-close')==='dwpb-close-'+dwpb.reset_cookie){remove_promobar();}}});$(window).resize(function(){dwpb_fix_hieght();});}(jQuery);