function q2w3_sidebar_init(){for(var a=0;a0&&setInterval(function(){for(var a=0;a0)for(var d=0;d0&&jQuery("#"+b.clone_id).remove(),j=!0,h=!1,i=!1);else{var k=jQuery(this).scrollTop();k+b.fixed_margin_bottom>=f?(i||(b.obj.css("position","fixed"),b.obj.css("top",""),b.obj.css("width",g),jQuery("#"+b.clone_id).length<=0&&b.obj.before(b.clone),i=!0,h=!1,j=!1),b.obj.css("bottom",k+d+b.next_widgets_height-f)):k>=c?h||(b.obj.css("position","fixed"),b.obj.css("top",b.fixed_margin_top),b.obj.css("bottom",""),b.obj.css("width",g),jQuery("#"+b.clone_id).length<=0&&b.obj.before(b.clone),h=!0,i=!1,j=!1):j||(b.obj.css("position",""),b.obj.css("top",""),b.obj.css("bottom",""),b.obj.css("width",""),jQuery("#"+b.clone_id).length>0&&jQuery("#"+b.clone_id).remove(),j=!0,h=!1,i=!1)}}).trigger("scroll."+a.sidebar)}if(!a)return!1;if(!a.widgets)return!1;if(a.widgets.length<1)return!1;a.sidebar||(a.sidebar="q2w3-default-sidebar");var c=new Array,d=jQuery(window).height(),e=jQuery(document).height(),f=a.margin_top;jQuery("#wpadminbar").length&&(f=a.margin_top+jQuery("#wpadminbar").height()),jQuery(".q2w3-widget-clone-"+a.sidebar).remove();for(var g=0;g=0;g--)c[g]&&(c[g].next_widgets_height=h,c[g].fixed_margin_bottom+=h,h+=c[g].height,i||(i=widget_obj.parent(),i.addClass("q2w3-fixed-widget-container"),i.css("height",""),i.height(i.height())));jQuery(window).off("scroll."+a.sidebar);for(var g=0;g0?window.jQuery?q2w3_sidebar_options[0].window_load_hook?jQuery(window).load(q2w3_sidebar_init()):jQuery(document).ready(q2w3_sidebar_init()):console.log("jQuery is not loaded!"):console.log("q2w3_sidebar_options not found!");