var fixto=function(n,t,i){function a(){this._vendor=null}function p(){var r=!1,n=i.createElement("div"),t=i.createElement("div"),u;return n.appendChild(t),n.style[y]="translate(0)",n.style.marginTop="10px",n.style.visibility="hidden",t.style.position="fixed",t.style.top=0,i.body.appendChild(n),u=t.getBoundingClientRect(),u.top>0&&(r=!0),i.body.removeChild(n),r}function u(t,i,r){this.child=t;this._$child=n(t);this.parent=i;this.options={className:"fixto-fixed",top:0};this._setOptions(r)}function f(n,t,i){u.call(this,n,t,i);this._replacer=new v.MimicNode(n);this._ghostNode=this._replacer.replacer;this._saveStyles();this._saveViewportHeight();this._proxied_onscroll=this._bind(this._onscroll,this);this._proxied_onresize=this._bind(this._onresize,this);this.start()}function s(n,t,i){u.call(this,n,t,i);this.start()}var r=function(){var n={getAll:function(n){return i.defaultView.getComputedStyle(n)},get:function(n,t){return this.getAll(n)[t]},toFloat:function(n){return parseFloat(n,10)||0},getFloat:function(n,t){return this.toFloat(this.get(n,t))},_getAllCurrentStyle:function(n){return n.currentStyle}};return i.documentElement.currentStyle&&(n.getAll=n._getAllCurrentStyle),n}(),v=function(){function t(n){this.element=n;this.replacer=i.createElement("div");this.replacer.className="replacer";this.replacer.style.visibility="hidden";this.hide();n.parentNode.insertBefore(this.replacer,n)}t.prototype={replace:function(){var n=this.replacer.style,t=r.getAll(this.element);n.width=this._width();n.height=this._height();n.marginTop=t.marginTop;n.marginBottom=t.marginBottom;n.marginLeft=t.marginLeft;n.marginRight=t.marginRight;n.cssFloat=t.cssFloat;n.styleFloat=t.styleFloat;n.position=t.position;n.top=t.top;n.right=t.right;n.bottom=t.bottom;n.left=t.left;n.display=t.display},hide:function(){this.replacer.style.display="none"},_width:function(){return this.element.getBoundingClientRect().width+"px"},_widthOffset:function(){return this.element.offsetWidth+"px"},_height:function(){return this.element.getBoundingClientRect().height+"px"},_heightOffset:function(){return this.element.offsetHeight+"px"},destroy:function(){n(this.replacer).remove();for(var t in this)this.hasOwnProperty(t)&&(this[t]=null)}};var u=i.documentElement.getBoundingClientRect();return u.width||(t.prototype._width=t.prototype._widthOffset,t.prototype._height=t.prototype._heightOffset),{MimicNode:t,computedStyle:r}}(),o;a.prototype={_vendors:{webkit:{cssPrefix:"-webkit-",jsPrefix:"Webkit"},moz:{cssPrefix:"-moz-",jsPrefix:"Moz"},ms:{cssPrefix:"-ms-",jsPrefix:"ms"},opera:{cssPrefix:"-o-",jsPrefix:"O"}},_prefixJsProperty:function(n,t){return n.jsPrefix+t[0].toUpperCase()+t.substr(1)},_prefixValue:function(n,t){return n.cssPrefix+t},_valueSupported:function(n,t,i){try{return i.style[n]=t,i.style[n]===t}catch(r){return!1}},propertySupported:function(n){return i.documentElement.style[n]!==undefined},getJsProperty:function(n){var t,i;if(this.propertySupported(n))return n;if(this._vendor)return this._prefixJsProperty(this._vendor,n);for(i in this._vendors)if(t=this._prefixJsProperty(this._vendors[i],n),this.propertySupported(t))return this._vendor=this._vendors[i],t;return null},getCssValue:function(n,t){var u=i.createElement("div"),f=this.getJsProperty(n),r,e;if(this._valueSupported(f,t,u))return t;if(this._vendor&&(r=this._prefixValue(this._vendor,t),this._valueSupported(f,r,u)))return r;for(e in this._vendors)if(r=this._prefixValue(this._vendors[e],t),this._valueSupported(f,r,u))return this._vendor=this._vendors[e],r;return null}};var h=new a,y=h.getJsProperty("transform"),e,c=h.getCssValue("position","sticky"),w=h.getCssValue("position","fixed"),b=navigator.appName==="Microsoft Internet Explorer",l;return b&&(l=parseFloat(navigator.appVersion.split("MSIE")[1])),u.prototype={_mindtop:function(){var i=0,n,u,t,e,f;if(this._$mind)for(t=0,e=this._$mind.length;t<e;t++)n=this._$mind[t],u=n.getBoundingClientRect(),u.height?i+=u.height:(f=r.getAll(n),i+=n.offsetHeight+r.toFloat(f.marginTop)+r.toFloat(f.marginBottom));return i},stop:function(){this._stop();this._running=!1},start:function(){this._running||(this._start(),this._running=!0)},destroy:function(){this.stop();this._destroy();this._$child.removeData("fixto-instance");for(var n in this)this.hasOwnProperty(n)&&(this[n]=null)},_setOptions:function(t){n.extend(this.options,t);this.options.mind&&(this._$mind=n(this.options.mind));this.options.zIndex&&(this.child.style.zIndex=this.options.zIndex)},setOptions:function(n){this._setOptions(n);this.refresh()},_stop:function(){},_start:function(){},_destroy:function(){},refresh:function(){}},f.prototype=new u,n.extend(f.prototype,{_bind:function(n,t){return function(){return n.call(t)}},_toresize:l===8?i.documentElement:t,_onscroll:function(){if(this._scrollTop=i.documentElement.scrollTop||i.body.scrollTop,this._parentBottom=this.parent.offsetHeight+this._fullOffset("offsetTop",this.parent)-r.getFloat(this.parent,"paddingBottom"),this.fixed){if(this._scrollTop>this._parentBottom||this._scrollTop<this._fullOffset("offsetTop",this._ghostNode)-this.options.top-this._mindtop()){this._unfix();return}this._adjust()}else{var n=r.getAll(this.child);this._scrollTop<this._parentBottom&&this._scrollTop>this._fullOffset("offsetTop",this.child)-this.options.top-this._mindtop()&&this._viewportHeight>this.child.offsetHeight+r.toFloat(n.marginTop)+r.toFloat(n.marginBottom)&&(this._fix(),this._adjust())}},_adjust:function(){var i=0,u=this._mindtop(),n=0,f=r.getAll(this.child),t=null;e&&(t=this._getContext(),t&&(i=Math.abs(t.getBoundingClientRect().top)));n=this._parentBottom-this._scrollTop-(this.child.offsetHeight+r.toFloat(f.marginBottom)+u+this.options.top);n>0&&(n=0);this.child.style.top=n+u+i+this.options.top-r.toFloat(f.marginTop)+"px"},_fullOffset:function(n,t,i){for(var u=t[n],r=t.offsetParent;r!==null&&r!==i;)u=u+r[n],r=r.offsetParent;return u},_getContext:function(){for(var n,u=this.child,t=null,f;!t;){if(n=u.parentNode,n===i.documentElement)return null;if(f=r.getAll(n),f[y]!=="none"){t=n;break}u=n}return t},_fix:function(){var t=this.child,u=t.style,n=r.getAll(t),o=t.getBoundingClientRect().left,s=n.width,f;this._saveStyles();i.documentElement.currentStyle&&(s=t.offsetWidth-(r.toFloat(n.paddingLeft)+r.toFloat(n.paddingRight)+r.toFloat(n.borderLeftWidth)+r.toFloat(n.borderRightWidth))+"px");e&&(f=this._getContext(),f&&(o=t.getBoundingClientRect().left-f.getBoundingClientRect().left));this._replacer.replace();u.left=o-r.toFloat(n.marginLeft)+"px";u.width=s;u.position="fixed";u.top=this._mindtop()+this.options.top-r.toFloat(n.marginTop)+"px";this._$child.addClass(this.options.className);this.fixed=!0},_unfix:function(){var n=this.child.style;this._replacer.hide();n.position=this._childOriginalPosition;n.top=this._childOriginalTop;n.width=this._childOriginalWidth;n.left=this._childOriginalLeft;this._$child.removeClass(this.options.className);this.fixed=!1},_saveStyles:function(){var n=this.child.style;this._childOriginalPosition=n.position;this._childOriginalTop=n.top;this._childOriginalWidth=n.width;this._childOriginalLeft=n.left},_onresize:function(){this.refresh()},_saveViewportHeight:function(){this._viewportHeight=t.innerHeight||i.documentElement.clientHeight},_stop:function(){this._unfix();n(t).unbind("scroll",this._proxied_onscroll);n(this._toresize).unbind("resize",this._proxied_onresize)},_start:function(){this._onscroll();n(t).bind("scroll",this._proxied_onscroll);n(this._toresize).bind("resize",this._proxied_onresize)},_destroy:function(){this._replacer.destroy()},refresh:function(){this._saveViewportHeight();this._unfix();this._onscroll()}}),s.prototype=new u,n.extend(s.prototype,{_start:function(){var n=r.getAll(this.child);this._childOriginalPosition=n.position;this._childOriginalTop=n.top;this.child.style.position=c;this.refresh()},_stop:function(){this.child.style.position=this._childOriginalPosition;this.child.style.top=this._childOriginalTop},refresh:function(){this.child.style.top=this._mindtop()+this.options.top+"px"}}),o=function(n,t,i){return c&&!i||c&&i&&i.useNativeSticky!==!1?new s(n,t,i):w?(e===undefined&&(e=p()),new f(n,t,i)):"Neither fixed nor sticky positioning supported"},l<8&&(o=function(){return"not supported"}),n.fn.fixTo=function(t,i){var u=n(t),r=0;return this.each(function(){var f=n(this).data("fixto-instance"),e;f?(e=t,f[e].call(f,i)):n(this).data("fixto-instance",o(this,u[r],i));r++})},{FixToContainer:f,fixTo:o,computedStyle:r,mimicNode:v}}(window.jQuery,window,document);$(document).ready(function(){$(".sticky-ad").fixTo(".full",{top:20})})