var poll_id=0,poll_answer_id="",is_being_voted=!1;pollsL10n.show_loading=parseInt(pollsL10n.show_loading);pollsL10n.show_fading=parseInt(pollsL10n.show_fading);
function poll_vote(b){jQuery(document).ready(function(a){is_being_voted?alert(pollsL10n.text_wait):(set_is_being_voted(!0),poll_id=b,poll_answer_id="",poll_multiple_ans_count=poll_multiple_ans=0,a("#poll_multiple_ans_"+poll_id).length&&(poll_multiple_ans=parseInt(a("#poll_multiple_ans_"+poll_id).val())),a("#polls_form_"+poll_id+" input:checkbox, #polls_form_"+poll_id+" input:radio, #polls_form_"+poll_id+" option").each(function(b){if(a(this).is(":checked")||a(this).is(":selected"))0<poll_multiple_ans?
(poll_answer_id=a(this).val()+","+poll_answer_id,poll_multiple_ans_count++):poll_answer_id=parseInt(a(this).val())}),0<poll_multiple_ans?0<poll_multiple_ans_count&&poll_multiple_ans_count<=poll_multiple_ans?(poll_answer_id=poll_answer_id.substring(0,poll_answer_id.length-1),poll_process()):0==poll_multiple_ans_count?(set_is_being_voted(!1),alert(pollsL10n.text_valid)):(set_is_being_voted(!1),alert(pollsL10n.text_multiple+" "+poll_multiple_ans)):0<poll_answer_id?poll_process():(set_is_being_voted(!1),
alert(pollsL10n.text_valid)))})}function poll_process(){jQuery(document).ready(function(b){poll_nonce=b("#poll_"+poll_id+"_nonce").val();pollsL10n.show_fading&&b("#polls-"+poll_id).fadeTo("def",0);pollsL10n.show_loading&&b("#polls-"+poll_id+"-loading").show();b.ajax({type:"POST",xhrFields:{withCredentials:!0},url:pollsL10n.ajax_url,data:"action=polls&view=process&poll_id="+poll_id+"&poll_"+poll_id+"="+poll_answer_id+"&poll_"+poll_id+"_nonce="+poll_nonce,cache:!1,success:poll_process_success})})}
function poll_result(b){jQuery(document).ready(function(a){is_being_voted?alert(pollsL10n.text_wait):(set_is_being_voted(!0),poll_id=b,poll_nonce=a("#poll_"+poll_id+"_nonce").val(),pollsL10n.show_fading&&a("#polls-"+poll_id).fadeTo("def",0),pollsL10n.show_loading&&a("#polls-"+poll_id+"-loading").show(),a.ajax({type:"POST",xhrFields:{withCredentials:!0},url:pollsL10n.ajax_url,data:"action=polls&view=result&poll_id="+poll_id+"&poll_"+poll_id+"_nonce="+poll_nonce,cache:!1,success:poll_process_success}))})}
function poll_booth(b){jQuery(document).ready(function(a){is_being_voted?alert(pollsL10n.text_wait):(set_is_being_voted(!0),poll_id=b,poll_nonce=a("#poll_"+poll_id+"_nonce").val(),pollsL10n.show_fading&&a("#polls-"+poll_id).fadeTo("def",0),pollsL10n.show_loading&&a("#polls-"+poll_id+"-loading").show(),a.ajax({type:"POST",xhrFields:{withCredentials:!0},url:pollsL10n.ajax_url,data:"action=polls&view=booth&poll_id="+poll_id+"&poll_"+poll_id+"_nonce="+poll_nonce,cache:!1,success:poll_process_success}))})}
function poll_process_success(b){jQuery(document).ready(function(a){a("#polls-"+poll_id).replaceWith(b);pollsL10n.show_loading&&a("#polls-"+poll_id+"-loading").hide();pollsL10n.show_fading&&a("#polls-"+poll_id).fadeTo("def",1);set_is_being_voted(!1)})}function set_is_being_voted(b){is_being_voted=b};
_rmls_blocker_active=true;
function checkForBlocker(){
jQuery.ajax({
url: "/wp-content/plugins/user-tracking-clientonly/js/advertisement.js"
}).done(function(){
_rmls_blocker_active=false;
}).fail(function(){
_rmls_blocker_active=true;
});
}
function IsReferredFromMe(){
var ref=document.referrer;
if((ref==null)||(ref.length==0)){
return false;
}
if(ref.indexOf("http://")==0){
ref=ref.substring(7);
}else if(ref.indexOf("https://")==0){
ref=ref.substring(8);
}
ref=ref.toLowerCase();
var myDomain=document.domain;
if((myDomain==null)||(myDomain.length==0)){
return false;
}
if(myDomain.indexOf("http://")==0){
myDomain=myDomain.substring(7);
}else if(myDomain.indexOf("https://")==0){
myDomain=myDomain.substring(8);
}
myDomain=myDomain.toLowerCase();
return ref.indexOf(myDomain)==0;
}
(function(){
var run_popup_js=function(){
jQuery(document).ready(function(){
checkForBlocker();
var on_popup_status_loaded=function(e, response){
if(!response) return;
if(response.keywords){
for (var i=0; i < response.keywords.length; i++){
jQuery("a[href*='" + response.keywords[i].keyword + "']").data("cookie", response.keywords[i].keyword).data("filter", response.period).data("zu", response.keywords[i].link).addClass("generated_popup_link");
}}
if(response.popup!={}&&response.popup.link){
jQuery("body").append('<div class="popup-ref-link" style="display:none" ' + 'data-ref="' + response.popup.ref + '" ' + 'data-popup="' + response.popup.link + '" ' + 'data-filter="' + response.period + '" ' + 'data-key="' + response.popup.keyword + '"></div>');
}
jQuery("a.generated_popup_link").click(function(e){
if(!(Cookies("Popup-" + jQuery(this).data("cookie")))){
var date=new Date();
var seconds=jQuery(this).data("filter");
console.log(seconds);
var minutes=seconds / 60;
date.setTime(date.getTime() + (minutes * 60 * 1000));
Cookies("Popup-" + jQuery(this).data("cookie"), 'true', {
expires: date,
path: '/'
});
e.preventDefault();
var url=jQuery(this).attr('href');
window.open(url, '_blank');
var url=jQuery(this).data("zu");
window.location.href=url;
}});
linkMask_clicked=false;
jQuery("span.generatedRLM").click(function(){
linkMask_clicked=true;
});
if(jQuery(".popup-ref-link").length){
jQuery(document).click(function(event){
var setCookie=function(){
var date=new Date();
var seconds=jQuery(".popup-ref-link").data("filter");
console.log(seconds);
var minutes=seconds / 60;
date.setTime(date.getTime() + (minutes * 60 * 1000));
Cookies("Popup-" + jQuery(".popup-ref-link").data("key"), 'true', {
expires: date,
path: '/'
});
}
var cookieInPlace=true;
if(!(Cookies("Popup-" + jQuery(".popup-ref-link").data("key")))){
cookieInPlace=false;
}
if((!(_rmls_blocker_active))&&linkMask_clicked==false){
if(!(IsReferredFromMe())){
if((event.target.id==="mailchimp-popup")||(event.target.id==="fancybox-close")||(jQuery(event.target).hasClass('generated_popup_link'))||(jQuery(event.target).parents("a").hasClass('generated_popup_link'))){
return;
}
if(event.target.tagName.toLowerCase()==='a'&&event.target.className!="generated_popup_link"&&!cookieInPlace){
event.preventDefault();
}
if(event.target.tagName.toLowerCase()==='a'&&event.target.className!="generated_popup_link"&&!cookieInPlace){
var cur_url=event.target.href;
window.open(cur_url, '_blank');
setCookie();
var url=jQuery(".popup-ref-link").data("popup");
window.location.href=url;
}else if(event.target.tagName.toLowerCase()==='a'&&event.target.className=="generated_popup_link"){
return;
}else if(!cookieInPlace){
var cur_url=window.location.href;
window.open(cur_url, '_blank');
setCookie();
var url=jQuery(".popup-ref-link").data("popup");
window.location.href=url;
}}
}else if((_rmls_blocker_active)&&linkMask_clicked==false){
if(!(IsReferredFromMe())){
if((event.target.id==="mailchimp-popup")||(event.target.id==="fancybox-close")||(jQuery(event.target).hasClass('generated_popup_link'))||(jQuery(event.target).parents("a").hasClass('generated_popup_link'))){
return;
}
if(event.target.tagName.toLowerCase()==='a'&&event.target.className!="generated_popup_link"&&!cookieInPlace){
event.preventDefault();
}
if(event.target.tagName.toLowerCase()==='a'&&event.target.className!="generated_popup_link"&&!cookieInPlace){
var cur_url=event.target.href;
window.open(cur_url, '_blank');
setCookie();
var url=jQuery(".popup-ref-link").data("popup");
window.location.href=url;
}else if(event.target.tagName.toLowerCase()==='a'&&event.target.className=="generated_popup_link"){
}}
}});
}};
window.utp_on_popup_status_loaded=on_popup_status_loaded;
/*jQuery(document).on('utp::popup_status', on_popup_status_loaded);
jQuery(document).on('utp::popup_status', function(stat){
console.log('TESTHANDLER popup.js utp::popup_status');
});
console.log('triggering utp::get_popup_status');
jQuery(document).trigger('utp::get_popup_status');*/
});
};
if(!window.Cookies){
jQuery.getScript("/wp-content/plugins/user-tracking-clientonly/js/jquery.cookie.js")
.done(function(script, textStatus){
run_popup_js();
})
.fail(function(){
});
}else{
run_popup_js();
}})();
(function(){var t=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++){if(e in this&&this[e]===t)return e}return-1},e=[].slice;(function(t,e){if(typeof define==="function"&&define.amd){return define("waypoints",["jquery"],function(n){return e(n,t)})}else{return e(t.jQuery,t)}})(this,function(n,r){var i,o,l,s,f,u,a,c,h,d,p,y,v,w,g,m;i=n(r);c=t.call(r,"ontouchstart")>=0;s={horizontal:{},vertical:{}};f=1;a={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didResize=false;this.didScroll=false;this.id="context"+f++;this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()};this.waypoints={horizontal:{},vertical:{}};t.data(u,this.id);a[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||c)){e.didScroll=true;t=function(){e.doScroll();return e.didScroll=false};return r.setTimeout(t,n[m].settings.scrollThrottle)}});t.bind(p,function(){var t;if(!e.didResize){e.didResize=true;t=function(){n[m]("refresh");return e.didResize=false};return r.setTimeout(t,n[m].settings.resizeThrottle)}})}t.prototype.doScroll=function(){var t,e=this;t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};if(c&&(!t.vertical.oldScroll||!t.vertical.newScroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newScroll>r.oldScroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldScroll<(n=e.offset)&&n<=r.newScroll){return l.push(e)}else if(r.newScroll<(i=e.offset)&&i<=r.oldScroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.isWindow(this.element);e=this.$element.offset();this.doScroll();t={horizontal:{contextOffset:r?0:e.left,contextScroll:r?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:r?0:e.top,contextScroll:r?0:this.oldScroll.y,contextDimension:r?n[m]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.isWindow(r.element)?0:r.$element.offset()[e.offsetProp];if(n.isFunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parseFloat(i);if(r.options.offset.indexOf("%")>-1){i=Math.ceil(e.contextDimension*i/100)}}r.offset=o-e.contextOffset+e.contextScroll-i;if(r.options.onlyOnScroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldScroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldScroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldScroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkEmpty=function(){if(n.isEmptyObject(this.waypoints.horizontal)&&n.isEmptyObject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete a[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;r=n.extend({},n.fn[g].defaults,r);if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportHeight");if(!n.isWindow(e.element)){t=e.$element.height()}return t-n(this).outerHeight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=t.data(w))!=null?o:[];i.push(this.id);t.data(w,i)}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggerOnce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkEmpty()};t.getWaypointsByElement=function(t){var e,r;r=n(t).data(w);if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;if(e==null){e={}}if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.isWindow(i)){i=t.closest(i)}i=n(i);r=a[i.data(u)];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke(this,"disable")},enable:function(){return d._invoke(this,"enable")},destroy:function(){return d._invoke(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e<n.length-1){return t.push(n[e+1])}})},_traverse:function(t,e,i){var o,l;if(t==null){t="vertical"}if(e==null){e=r}l=h.aggregate(e);o=[];this.each(function(){var e;e=n.inArray(this,l[t]);return i(o,e,l[t])});return this.pushStack(o)},_invoke:function(t,e){t.each(function(){var t;t=l.getWaypointsByElement(this);return n.each(t,function(t,n){n[e]();return true})});return this}};n.fn[g]=function(){var t,r;r=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(d[r]){return d[r].apply(this,t)}else if(n.isFunction(r)){return d.init.apply(this,arguments)}else if(n.isPlainObject(r)){return d.init.apply(this,[null,r])}else if(!r){return n.error("jQuery Waypoints needs a callback function or handler option.")}else{return n.error("The "+r+" method does not exist in jQuery Waypoints.")}};n.fn[g].defaults={context:r,continuous:true,enabled:true,horizontal:false,offset:0,triggerOnce:false};h={refresh:function(){return n.each(a,function(t,e){return e.refresh()})},viewportHeight:function(){var t;return(t=r.innerHeight)!=null?t:i.height()},aggregate:function(t){var e,r,i;e=s;if(t){e=(i=a[n(t).data(u)])!=null?i.waypoints:void 0}if(!e){return[]}r={horizontal:[],vertical:[]};n.each(r,function(t,i){n.each(e[t],function(t,e){return i.push(e)});i.sort(function(t,e){return t.offset-e.offset});r[t]=n.map(i,function(t){return t.element});return r[t]=n.unique(r[t])});return r},above:function(t){if(t==null){t=r}return h._filter(t,"vertical",function(t,e){return e.offset<=t.oldScroll.y})},below:function(t){if(t==null){t=r}return h._filter(t,"vertical",function(t,e){return e.offset>t.oldScroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldScroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset>t.oldScroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendFn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=a[n(t).data(u)];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizeThrottle:100,scrollThrottle:30};return i.load(function(){return n[m]("refresh")})})}).call(this);
(function(e){var t=!1,i=!1,n={isUrl:function(e){var t=RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i");return t.test(e)?!0:!1},loadContent:function(e,t){e.html(t)},addPrefix:function(e){var t=e.attr("id"),i=e.attr("class");"string"==typeof t&&""!==t&&e.attr("id",t.replace(/([A-Za-z0-9_.\-]+)/g,"sidr-id-$1")),"string"==typeof i&&""!==i&&"sidr-inner"!==i&&e.attr("class",i.replace(/([A-Za-z0-9_.\-]+)/g,"sidr-class-$1")),e.removeAttr("style")},execute:function(n,s,a){"function"==typeof s?(a=s,s="sidr"):s||(s="sidr");var r,d,l,c=e("#"+s),u=e(c.data("body")),f=e("html"),p=c.outerWidth(!0),g=c.data("speed"),h=c.data("side"),m=c.data("displace"),v=c.data("onOpen"),y=c.data("onClose"),x="sidr"===s?"sidr-open":"sidr-open "+s+"-open";if("open"===n||"toggle"===n&&!c.is(":visible")){if(c.is(":visible")||t)return;if(i!==!1)return o.close(i,function(){o.open(s)}),void 0;t=!0,"left"===h?(r={left:p+"px"},d={left:"0px"}):(r={right:p+"px"},d={right:"0px"}),u.is("body")&&(l=f.scrollTop(),f.css("overflow-x","hidden").scrollTop(l)),m?u.addClass("sidr-animating").css({width:u.width(),position:"absolute"}).animate(r,g,function(){e(this).addClass(x)}):setTimeout(function(){e(this).addClass(x)},g),c.css("display","block").animate(d,g,function(){t=!1,i=s,"function"==typeof a&&a(s),u.removeClass("sidr-animating")}),v()}else{if(!c.is(":visible")||t)return;t=!0,"left"===h?(r={left:0},d={left:"-"+p+"px"}):(r={right:0},d={right:"-"+p+"px"}),u.is("body")&&(l=f.scrollTop(),f.removeAttr("style").scrollTop(l)),u.addClass("sidr-animating").animate(r,g).removeClass(x),c.animate(d,g,function(){c.removeAttr("style").hide(),u.removeAttr("style"),e("html").removeAttr("style"),t=!1,i=!1,"function"==typeof a&&a(s),u.removeClass("sidr-animating")}),y()}}},o={open:function(e,t){n.execute("open",e,t)},close:function(e,t){n.execute("close",e,t)},toggle:function(e,t){n.execute("toggle",e,t)},toogle:function(e,t){n.execute("toggle",e,t)}};e.sidr=function(t){return o[t]?o[t].apply(this,Array.prototype.slice.call(arguments,1)):"function"!=typeof t&&"string"!=typeof t&&t?(e.error("Method "+t+" does not exist on jQuery.sidr"),void 0):o.toggle.apply(this,arguments)},e.fn.sidr=function(t){var i=e.extend({name:"sidr",speed:200,side:"left",source:null,renaming:!0,body:"body",displace:!0,onOpen:function(){},onClose:function(){}},t),s=i.name,a=e("#"+s);if(0===a.length&&(a=e("<div />").attr("id",s).appendTo(e("body"))),a.addClass("sidr").addClass(i.side).data({speed:i.speed,side:i.side,body:i.body,displace:i.displace,onOpen:i.onOpen,onClose:i.onClose}),"function"==typeof i.source){var r=i.source(s);n.loadContent(a,r)}else if("string"==typeof i.source&&n.isUrl(i.source))e.get(i.source,function(e){n.loadContent(a,e)});else if("string"==typeof i.source){var d="",l=i.source.split(",");if(e.each(l,function(t,i){d+='<div class="sidr-inner">'+e(i).html()+"</div>"}),i.renaming){var c=e("<div />").html(d);c.find("*").each(function(t,i){var o=e(i);n.addPrefix(o)}),d=c.html()}n.loadContent(a,d)}else null!==i.source&&e.error("Invalid Sidr Source");return this.each(function(){var t=e(this),i=t.data("sidr");i||(t.data("sidr",s),"ontouchstart"in document.documentElement?(t.bind("touchstart",function(e){e.originalEvent.touches[0],this.touched=e.timeStamp}),t.bind("touchend",function(e){var t=Math.abs(e.timeStamp-this.touched);200>t&&(e.preventDefault(),o.toggle(s))})):t.click(function(e){e.preventDefault(),o.toggle(s)}))})}})(jQuery);
(function($){
var body=$('body'),
_window=$(window);
(function(){
var nav=$('#site-navigation'), button, menu;
if(! nav)
return;
button=nav.find('.menu-toggle');
if(! button)
return;
menu=nav.find('.nav-container');
if(! menu||! menu.children().length){
button.hide();
return;
}
$('.menu-toggle').on('click.imax', function(){
});
})();
_window.on('hashchange.imax', function(){
var element=document.getElementById(location.hash.substring(1));
if(element){
if(! /^(?:a|select|input|button|textarea)$/i.test(element.tagName))
element.tabIndex=-1;
element.focus();
}});
})(jQuery);
jQuery(document).ready(function($){
jQuery('div.nav-container > ul > li > a').append('<span class="colorbar"></span>');
jQuery('div.nav-container ul > li').hover(function(){
jQuery(this).children('ul.children,ul.sub-menu').stop(true, true).slideDown("fast");
}, function(){
jQuery(this).children('ul.children,ul.sub-menu').slideUp("fast");
});
jQuery('.search-form').append('<span class="searchico genericon genericon-search"></span>');
$("div.entry-nothumb").parent(".meta-img").addClass("no-image-meta");
jQuery('body').append('<a href="#" class="go-top animated"><span class="genericon genericon-collapse"></span></a>');
jQuery(window).scroll(function(){
if(jQuery(this).scrollTop() > 200){
jQuery('.go-top').fadeIn(200).addClass('bounce');
}else{
jQuery('.go-top').fadeOut("slow");
}});
jQuery('.go-top').click(function(event){
event.preventDefault();
jQuery('html, body').animate({scrollTop: 0}, 1000);
});
$('.menu-toggle').sidr({
name: 'sidr-left',
side: 'left',
source: '.nav-container',
onOpen: function(){
$('.menu-toggle').animate({
marginLeft: "260px"
}, 200);
},
onClose: function(){
$('.menu-toggle').animate({
marginLeft: "0px"
}, 200);
}});
$(window).resize(function (){
if($(window).width() > 1070){
$.sidr('close', 'sidr-left');
}
equalheight('#ft-post article');
});
equalheight=function(container){
var currentTallest=0,
currentRowStart=0,
rowDivs=new Array(),
$el,
topPosition=0;
$(container).each(function(){
$el=$(this);
$($el).height('auto')
topPostion=$el.position().top;
if(currentRowStart!=topPostion){
for (currentDiv=0 ; currentDiv < rowDivs.length ; currentDiv++){
rowDivs[currentDiv].height(currentTallest);
}
rowDivs.length=0;
currentRowStart=topPostion;
currentTallest=$el.height();
rowDivs.push($el);
}else{
rowDivs.push($el);
currentTallest=(currentTallest < $el.height()) ? ($el.height()):(currentTallest);
}
for (currentDiv=0 ; currentDiv < rowDivs.length ; currentDiv++){
rowDivs[currentDiv].height(currentTallest);
}});
}
equalheight('.main article');
/*
$(window).scroll(function(){
var newvalue=parseInt($(this).scrollTop()*0.25)-64;
$('.ibanner').css('background-position', '0px '+newvalue+'px');
});
*/
$(window).load(function(){
$('#footer-widgets').each(function (){
$(this).masonry({});
});
$('#blog-cols').each(function (){
$(this).masonry({});
});
});
$('#da-slider').each(function(){
_this=$(this);
var slider_speed=_this.data('slider-speed');
_this.owlCarousel({
navigation:true,
autoPlay:slider_speed,
paginationSpeed:600,
singleItem: true,
rewindSpeed: 600,
stopOnHover: true,
navigationText: ['<span class="genericon genericon-leftarrow"></span>','<span class="genericon genericon-rightarrow"></span>'],
addClassActive: true,
theme:"owl-theme1",
goToFirstSpeed:1000,
slideSpeed:600,
autoHeight: true
});
});
});
(function($){
var nav_container=$(".headerwrap");
var nav=$(".site-header");
var top_spacing=30;
var waypoint_offset=60;
if($(".admin-bar").length>0){
if($(window).width()<766){
var top_spacing=0;
}else{
var top_spacing=30;
}}else{
var top_spacing=0;
}
nav_container.waypoint({
handler: function(direction){
if(direction=='down'){
nav_container.css({ 'height':nav.outerHeight() });
nav.stop().addClass("fixeddiv").css("top",-nav.outerHeight()).animate({"top":top_spacing});
}else{
nav_container.css({ 'height':'auto' });
nav.stop().removeClass("fixeddiv").css("top",nav.outerHeight()).animate({"top":""});
}},
offset: function(){
return -nav.outerHeight()-waypoint_offset;
}});
if($('.utilitybar').length==0){
console.log("no utility bar");
$('.headerwrap').addClass('noutility');
}
/* featured post on scroll animation
$('div#featured .post').css("opacity","0.0");
$('div#featured').waypoint(function(){
$("div#featured .post").each(function(index){
var _this=$(this);
setTimeout(function (){
$('div#featured .post').show();
_this.addClass('animated fadeInUp');
_this.css("opacity","1.0");
}, (index+1) * 200);
});
},
{
offset: '100%',
triggerOnce: true
});
*/
/*
$('#primary .entry-thumbnail').waypoint(function(){
$(this).addClass('animated fadeInLeft');
},
{
offset: '100%',
triggerOnce: true
});
$('div#primary div.post-mainpart').waypoint(function(){
$(this).addClass('animated fadeInUp');
},
{
offset: '100%',
triggerOnce: true
});
*/
})(jQuery);