// jQuery.documentSize, v1.2.3 // Copyright (c) 2015-2016 Michael Heim, Zeilenwechsel.de // Distributed under MIT license // http://github.com/hashchange/jquery.documentsize !function(a){"use strict";function b(a,b){var d,e,f,i,j,k,l=b.window,m=0!==h(),n=b.useLayoutViewport&&"Width"===a,p=m||!g()||n,r=p?l.document.documentElement["client"+a]:o(a,l);return b.useLayoutViewport&&!p&&(e=r,f=c(l,{asRange:!0}),r=Math.round(e*f.calculated),q()||(d=l.document.documentElement.clientHeight,j=(e-1)*f.min,k=(e+1)*f.max,i=d+3>=r&&r>=d-3||d>=j&&k>=d&&d+30>k,i&&(r=d))),r}function c(a,b){var c,d,e=b&&b.asRange,f={calculated:1,min:1,max:1},i=0!==h()||!g();return i||(a||(a=window),c=a.document.documentElement.clientWidth,d=n(a),f.calculated=c/d,e&&(q()?f.min=f.max=f.calculated:(f.min=c/(d+1),f.max=c/(d-1)))),e?f:f.calculated}function d(a){var b,c,d,g=window,h=!0;return a&&a.length&&(a=Array.prototype.slice.call(a),b=r(a[0]),b||(a[0]=f(a[0])),c=!b&&a[0],c||(a[1]=f(a[1])),d=!c&&a[1],b?(g=a[0],d&&a[1].viewport&&(h=e(a[1].viewport))):c?(a[0].viewport&&(h=e(a[0].viewport)),r(a[1])&&(g=a[1])):!a[0]&&a[1]&&(d&&a[1].viewport?h=e(a[1].viewport):r(a[1])&&(g=a[1]))),{window:g,useVisualViewport:h,useLayoutViewport:!h}}function e(a){var b=s(a)&&a.toLowerCase();if(a&&!b)throw new Error("Invalid viewport option: "+a);if(b&&"visual"!==b&&"layout"!==b)throw new Error("Invalid viewport name: "+a);return"visual"===b}function f(a){return s(a)&&""!==a?{viewport:a}:a}function g(){return void 0===y&&(y=n()>10),y}function h(){var a;return void 0===x&&(a=document.createElement("div"),a.style.cssText="width: 100px; height: 100px; overflow: scroll; position: absolute; top: -500px; left: -500px; margin: 0px; padding: 0px; border: none;",document.body.appendChild(a),x=a.offsetWidth-a.clientWidth,document.body.removeChild(a)),x}function i(){var a,b,c,d,e=j(),f=e&&e.contentDocument||document,g=f.body,h=f!==document;b=f.createElement("div"),b.style.cssText="width: 1px; height: 1px; position: relative; top: 0px; left: 32000px;",h||(a=k()),c=g.scrollWidth,g.appendChild(b),d=c!==g.scrollWidth,g.removeChild(b),h||l(a),A=d?"documentElement":"body",e&&document.body.removeChild(e)}function j(){var a=document.createElement("iframe"),b=document.body;return a.style.cssText="position: absolute; top: -600px; left: -600px; width: 500px; height: 500px; margin: 0px; padding: 0px; border: none; display: block;",a.frameborder="0",b.appendChild(a),a.src="about:blank",a.contentDocument?(a.contentDocument.write('