").append(b.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},b.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){b.fn[t]=function(e){return this.on(t,e)}}),b.each(["get","post"],function(e,n){b[n]=function(e,r,i,o){return b.isFunction(r)&&(o=o||i,i=r,r=t),b.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Nn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Mn(Mn(e,b.ajaxSettings),t):Mn(b.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,u,l,c,p=b.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?b(f):b.event,h=b.Deferred(),g=b.Callbacks("once memory"),m=p.statusCode||{},y={},v={},x=0,T="canceled",N={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)m[t]=[m[t],e[t]];else N.always(e[N.status]);return this},abort:function(e){var t=e||T;return l&&l.abort(t),k(0,t),this}};if(h.promise(N).complete=g.add,N.success=N.done,N.error=N.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=b.trim(p.dataType||"*").toLowerCase().match(w)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?80:443))==(mn[3]||("http:"===mn[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=b.param(p.data,p.traditional)),qn(An,p,n,N),2===x)return N;u=p.global,u&&0===b.active++&&b.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Cn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(b.lastModified[o]&&N.setRequestHeader("If-Modified-Since",b.lastModified[o]),b.etag[o]&&N.setRequestHeader("If-None-Match",b.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&N.setRequestHeader("Content-Type",p.contentType),N.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)N.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,N,p)===!1||2===x))return N.abort();T="abort";for(i in{success:1,error:1,complete:1})N[i](p[i]);if(l=qn(jn,p,n,N)){N.readyState=1,u&&d.trigger("ajaxSend",[N,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){N.abort("timeout")},p.timeout));try{x=1,l.send(y,k)}catch(C){if(!(2>x))throw C;k(-1,C)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,C=n;2!==x&&(x=2,s&&clearTimeout(s),l=t,a=i||"",N.readyState=e>0?4:0,r&&(w=_n(p,N,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=N.getResponseHeader("Last-Modified"),T&&(b.lastModified[o]=T),T=N.getResponseHeader("etag"),T&&(b.etag[o]=T)),204===e?(c=!0,C="nocontent"):304===e?(c=!0,C="notmodified"):(c=Fn(p,w),C=c.state,y=c.data,v=c.error,c=!v)):(v=C,(e||!C)&&(C="error",0>e&&(e=0))),N.status=e,N.statusText=(n||C)+"",c?h.resolveWith(f,[y,C,N]):h.rejectWith(f,[N,C,v]),N.statusCode(m),m=t,u&&d.trigger(c?"ajaxSuccess":"ajaxError",[N,p,c?y:v]),g.fireWith(f,[N,C]),u&&(d.trigger("ajaxComplete",[N,p]),--b.active||b.event.trigger("ajaxStop")))}return N},getScript:function(e,n){return b.get(e,t,n,"script")},getJSON:function(e,t,n){return b.get(e,t,n,"json")}});function _n(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(s in c)s in r&&(n[c[s]]=r[s]);while("*"===l[0])l.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in u)if(u[s]&&u[s].test(o)){l.unshift(s);break}if(l[0]in r)a=l[0];else{for(s in r){if(!l[0]||e.converters[s+" "+l[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function Fn(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u[1])for(i in e.converters)a[i.toLowerCase()]=e.converters[i];for(;r=u[++s];)if("*"!==r){if("*"!==l&&l!==r){if(i=a[l+" "+r]||a["* "+r],!i)for(n in a)if(o=n.split(" "),o[1]===r&&(i=a[l+" "+o[0]]||a["* "+o[0]])){i===!0?i=a[n]:a[n]!==!0&&(r=o[0],u.splice(s--,0,r));break}if(i!==!0)if(i&&e["throws"])t=i(t);else try{t=i(t)}catch(c){return{state:"parsererror",error:i?c:"No conversion from "+l+" to "+r}}}l=r}return{state:"success",data:t}}b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),b.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||b("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var On=[],Bn=/(=)\?(?=&|$)|\?\?/;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=On.pop()||b.expando+"_"+vn++;return this[e]=!0,e}}),b.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=b.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||b.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,On.push(o)),s&&b.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}b.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=b.ajaxSettings.xhr(),b.support.cors=!!Rn&&"withCredentials"in Rn,Rn=b.support.ajax=!!Rn,Rn&&b.ajaxTransport(function(n){if(!n.crossDomain||b.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=b.noop,$n&&delete Pn[a]),i)4!==u.readyState&&u.abort();else{p={},s=u.status,l=u.getAllResponseHeaders(),"string"==typeof u.responseText&&(p.text=u.responseText);try{c=u.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,l)},n.async?4===u.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},b(e).unload($n)),Pn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+x+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=Yn.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(b.cssNumber[e]?"":"px"),"px"!==r&&s){s=b.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,b.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=b.now()}function Zn(e,t){b.each(t,function(t,n){var r=(Qn[t]||[]).concat(Qn["*"]),i=0,o=r.length;for(;o>i;i++)if(r[i].call(e,t,n))return})}function er(e,t,n){var r,i,o=0,a=Gn.length,s=b.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;for(;u>a;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:b.extend({},t),opts:b.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=b.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(tr(c,l.opts.specialEasing);a>o;o++)if(r=Gn[o].call(l,e,c,l.opts))return r;return Zn(l,c),b.isFunction(l.opts.start)&&l.opts.start.call(e,l),b.fx.timer(b.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function tr(e,t){var n,r,i,o,a;for(i in e)if(r=b.camelCase(i),o=t[r],n=e[i],b.isArray(n)&&(o=n[1],n=e[i]=n[0]),i!==r&&(e[r]=n,delete e[i]),a=b.cssHooks[r],a&&"expand"in a){n=a.expand(n),delete e[r];for(i in n)i in e||(e[i]=n[i],t[i]=o)}else t[r]=o}b.Animation=b.extend(er,{tweener:function(e,t){b.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,u,l,c,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&nn(e);n.queue||(c=b._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,p=c.empty.fire,c.empty.fire=function(){c.unqueued||p()}),c.unqueued++,f.always(function(){f.always(function(){c.unqueued--,b.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===b.css(e,"display")&&"none"===b.css(e,"float")&&(b.support.inlineBlockNeedsLayout&&"inline"!==un(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",b.support.shrinkWrapBlocks||f.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(i in t)if(a=t[i],Vn.exec(a)){if(delete t[i],u=u||"toggle"===a,a===(m?"hide":"show"))continue;g.push(i)}if(o=g.length){s=b._data(e,"fxshow")||b._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?b(e).show():f.done(function(){b(e).hide()}),f.done(function(){var t;b._removeData(e,"fxshow");for(t in h)b.style(e,t,h[t])});for(i=0;o>i;i++)r=g[i],l=f.createTween(r,m?s[r]:0),h[r]=s[r]||b.style(e,r),r in s||(s[r]=l.start,m&&(l.end=l.start,l.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}b.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(b.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?b.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=b.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){b.fx.step[e.prop]?b.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[b.cssProps[e.prop]]||b.cssHooks[e.prop])?b.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},b.each(["toggle","show","hide"],function(e,t){var n=b.fn[t];b.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),b.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=b.isEmptyObject(e),o=b.speed(t,n,r),a=function(){var t=er(this,b.extend({},e),o);a.finish=function(){t.stop(!0)},(i||b._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=b.timers,a=b._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&b.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=b._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=b.timers,a=r?r.length:0;for(n.finish=!0,b.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}b.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){b.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),b.speed=function(e,t,n){var r=e&&"object"==typeof e?b.extend({},e):{complete:n||!n&&t||b.isFunction(e)&&e,duration:e,easing:n&&t||t&&!b.isFunction(t)&&t};return r.duration=b.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in b.fx.speeds?b.fx.speeds[r.duration]:b.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){b.isFunction(r.old)&&r.old.call(this),r.queue&&b.dequeue(this,r.queue)},r},b.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},b.timers=[],b.fx=rr.prototype.init,b.fx.tick=function(){var e,n=b.timers,r=0;for(Xn=b.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||b.fx.stop(),Xn=t},b.fx.timer=function(e){e()&&b.timers.push(e)&&b.fx.start()},b.fx.interval=13,b.fx.start=function(){Un||(Un=setInterval(b.fx.tick,b.fx.interval))},b.fx.stop=function(){clearInterval(Un),Un=null},b.fx.speeds={slow:600,fast:200,_default:400},b.fx.step={},b.expr&&b.expr.filters&&(b.expr.filters.animated=function(e){return b.grep(b.timers,function(t){return e===t.elem}).length}),b.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){b.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,b.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},b.offset={setOffset:function(e,t,n){var r=b.css(e,"position");"static"===r&&(e.style.position="relative");var i=b(e),o=i.offset(),a=b.css(e,"top"),s=b.css(e,"left"),u=("absolute"===r||"fixed"===r)&&b.inArray("auto",[a,s])>-1,l={},c={},p,f;u?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),b.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(l.top=t.top-o.top+p),null!=t.left&&(l.left=t.left-o.left+f),"using"in t?t.using.call(e,l):i.css(l)}},b.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===b.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),b.nodeName(e[0],"html")||(n=e.offset()),n.top+=b.css(e[0],"borderTopWidth",!0),n.left+=b.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-b.css(r,"marginTop",!0),left:t.left-n.left-b.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||o.documentElement;while(e&&!b.nodeName(e,"html")&&"static"===b.css(e,"position"))e=e.offsetParent;return e||o.documentElement})}}),b.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);b.fn[e]=function(i){return b.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?b(a).scrollLeft():o,r?o:b(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return b.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}b.each({Height:"height",Width:"width"},function(e,n){b.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){b.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return b.access(this,function(n,r,i){var o;return b.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?b.css(n,r,s):b.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=b,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return b})})(window);
jQInf = jQuery.noConflict(true);
let infinite = "/apps/infinite";
let cleverlink = Shopify.shop;
function getData() {
let response;
jQInf.ajax({
type: "POST",
url: infinite,
data: {
shop: cleverlink || "shopallthinge.myshopify.com"
},
success: function(data) {
response = data;
},
async: false
});
return response;
}
settings = getData();
let data = JSON.parse(settings.data[0].data);
let status = settings.data[0].status;
let customgif = settings.data[0].customGif;
if (data.showbutton === "No" || data.showbutton === "1") {
loaderMode = 1;
} else {
loaderMode = 2;
}
loadMoreBtnText = data.buttonText;
oncegoI = false;
specialTheme = 0;
gsLastUrl = '';
XMLHttpRequest.prototype.gsOpen = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.gsSend = XMLHttpRequest.prototype.send;
jQInf(window).ready(function() {
if(!oncegoI) {
specialTheme = 0;
jQInf("body").append('');
if(jQInf(".container-pushy-main").length > 0 && jQInf("#category-sticky-parent").length > 0 && jQInf(".pagination-buttons").length > 0) {
jQInf("#category-sticky-parent").after(jQInf(jQInf(".pagination-buttons").get(0)));
}
// TESTAMENT
if((jQInf("#product-loop .product-index").length > 0) && (jQInf("#product-loop .first").length > 0)) {
jQInf("body").append('');
specialTheme = 6;
}
// VENUE
if(jQInf(".o-layout__item").length > 0) {
jQInf("body").append("");
}
// ENVY
if(jQInf("#Collection .indiv-product-wrapper").length > 0) {
specialTheme = 9;
}
// ICON
if(jQInf("#bside #product-loop .product").length > 0) {
specialTheme = 8;
jQInf("body").append('');
}
// TURBO
if((jQInf(".columns .collection-matrix .one-third").length > 0) || (jQInf(".columns .collection-matrix .four").length > 0) || (jQInf(".columns .collection-matrix .eight").length > 0)) {
specialTheme = 2;
setInterval(function() {
jQInf(".js-forms .viewed").removeClass("viewed");
}, 1000);
}
// PARALLAX
if((jQInf("#shopify-section-collection-template .one-third").length > 0) || (jQInf("#shopify-section-collection-template .four .product_image .image__container").length > 0) || (jQInf("#shopify-section-collection-template .eight .product_image .image__container").length > 0)) {
jQInf("html").css("opacity", '1');
jQInf("body").append("");
specialTheme = 2;
}
// VANTAGE
if((jQInf(".product-loop .medium_grid .product-index-inner .box-ratio").length > 0) || (jQInf(".product-loop .large_grid .product-index-inner .box-ratio").length > 0)) {
specialTheme = 13;
jQInf("body").append('');
}
// SPLIT
if(jQInf(".site-box-container .box__collection").length > 0) {
$("body").append("");
specialTheme = 12;
}
if((jQInf(".quickshop .quickshop-spinner").length > 0) && (jQInf(".quick-shop-modal-trigger").length > 0)) {
specialTheme = 15;
}
// ATLANTIC
if(jQInf(".product-list .product .product-card-figure").length > 0) {
specialTheme = 11;
}
// KINGDOM
if((jQInf(".isotope-products .three .grid-item-image").length > 0)) {
jQInf("body").append('');
specialTheme = 17;
}
// SHOWCASE
if((jQInf(".wide-container .jiggly-split").length > 0)) {
specialTheme = 16;
}
// CASCADE
if((jQInf(".collection-cascade .resp-img-wrapper .resp-img-placeholder").length > 0)) {
specialTheme = 18;
}
if((jQInf('.collection-listing .product-crop-tall .product-list-item figure[data-rimg-template*="shopif"]').length > 0)) {
specialTheme = 33;
//jQInf("body").append('');
}
// COLORS
if((jQInf(".col-0 .inner .table .cell").length > 0)) {
specialTheme = 21;
jQInf("body").append('');
}
setInterval(function() {
try {
jQInf(".lazyloading").each(function() {
jQInf(this).removeClass("lazyloading");
jQInf(this).addClass("lazyloaded");
});
}
catch(err) {
}
}, 3000);
//console.debug("special theme " + specialTheme);
try {
jQInf("#bc-sf-filter-top-pagination").remove();
} catch(error){
}
if(jQInf(".pagination").length == 2) {
jQInf(jQInf(".pagination").get(0)).remove();
}
gsLastUrl = window.location.href;
if(!(window.location.href.indexOf("/products/") > 0)) {
setInterval(function() {
try {
if(gsLastUrl.length > 5 && window.location.href != gsLastUrl) {
gsLastUrl = window.location.href;
window.location.reload();
}
}
catch(err) {}
try {
jQInf(jQInf('body').get(0)).find("img[src*='loader.gif']").each(function() {
if(jQInf(this).hasClass("product_image--current")) {
jQInf(this).attr("src", jQInf(this).attr('data-src'));
}
});
}
catch(err) {}
}, 1000);
}
jQInf("body").append("");
oncegoI = true;
if(jQInf("#wrapper1 #collection_sorted .product_listing_controls .products_count").length > 0) {
specialTheme = 1;
}
if(specialTheme == 1) {
setTimeout(function()
{
gsscroller = new GSLoader();
}, 1000);
}
else {
gsscroller = new GSLoader();
}
}
});
paginateSel = null;
paginateSelector = '';
collectionParent = '';
collectionPageNr = 1;
gsscroller = null;
containerPos = 1;
productsParentTmp = null;
function getUrlParamsGS( prop ) {
var params = {};
var search = decodeURIComponent( window.location.href.slice( window.location.href.indexOf( '?' ) + 1 ) );
var definitions = search.split( '&' );
definitions.forEach( function( val, key ) {
var parts = val.split( '=', 2 );
params[ parts[ 0 ] ] = parts[ 1 ];
} );
return ( prop && prop in params ) ? params[ prop ] : null;
}
var fixThemeSpecial = function() {
if(specialTheme == 6) {
var gsProductsPerRow = 0;
var gsCntProductsInRow = 0;
if(jQInf("#product-loop").find(".desktop-6").length > 0) {
gsProductsPerRow = 2;
}
if(jQInf("#product-loop").find(".desktop-4").length > 0) {
gsProductsPerRow = 3;
}
if(jQInf("#product-loop").find(".desktop-3").length > 0) {
gsProductsPerRow = 4;
}
if(jQInf("#product-loop").find(".desktop-2").length > 0) {
gsProductsPerRow = 6;
}
if(jQInf("#product-loop").find(".desktop-fifth").length > 0) {
gsProductsPerRow = 5;
}
if(gsProductsPerRow == 0) {
gsProductsPerRow = 4;
}
var gsCounterOdds = 1;
jQInf("#product-loop .product-index").each(function(index) {
var loazyloaders = jQInf(this).find(".lazyloading");
if(loazyloaders.length > 0) {
var mainlazyloader = $(loazyloaders.get(0));
mainlazyloader.removeClass("lazyloading");
mainlazyloader.addClass("lazyloaded");
}
jQInf(this).removeClass("first");
jQInf(this).removeClass("last");
if(gsCounterOdds == 1) {
jQInf(this).addClass("first");
}
if(gsCounterOdds == gsProductsPerRow) {
jQInf(this).addClass("last");
}
if(gsCounterOdds == gsProductsPerRow) {
gsCounterOdds = 0;
}
gsCounterOdds++;
});
}
if(specialTheme == 16) {
colCnt = 1;
jQInf(".product-block").each(function(index){
var cardImage = jQInf(jQInf(this).find(".lazyloading").get(0));
cardImage.removeClass("lazyloading");
cardImage.addClass("lazyloaded");
var productBlockGS = jQInf(".col-" + colCnt).find(".product-block").get(0);
jQInf(productBlockGS).appendTo("#page-content");
colCnt++;
if(colCnt == 4) {
colCnt = 1;
}
});
jQInf(".product-list .product-block").each(function(index){
jQInf(this).appendTo("#page-content");
});
colCnt = 1;
jQInf(".product-block").each(function(index){
jQInf(".col-" + colCnt).append(jQInf(this));
colCnt++;
if(colCnt == 4) {
colCnt = 1;
}
});
}
if(specialTheme == 17) {
try {
jQInf(".grid-item").each(function(index) {
jQInf(this).addClass("loaded");
});
if ( jQuery('.isotope-products').length > 0 ) {
jQuery('.isotope-products').each(function(){
window.KINGDOM.Grid.mount(jQuery(this))
});
}
} catch(err) {}
}
if(specialTheme == 18) {
try {
jQInf("body").append($('script[src*="assets/theme.min.js"]').get(0).outerHTML.replace('defer="defer"', ''));
}
catch(err) {
}
}
if(specialTheme == 9) {
var gsNumberOfColumns = 0
if(jQInf("#Collection").find(".six_columns").length > 0) {
gsNumberOfColumns = 6;
}
if(jQInf("#Collection").find(".five_columns").length > 0) {
gsNumberOfColumns = 5;
}
if(jQInf("#Collection").find(".four_columns").length > 0) {
gsNumberOfColumns = 4;
}
if(jQInf("#Collection").find(".three_columns").length > 0) {
gsNumberOfColumns = 3;
}
if(jQInf("#Collection").find(".two_columns").length > 0) {
gsNumberOfColumns = 2;
}
if(gsNumberOfColumns == 0) {
gsNumberOfColumns = 4;
}
jQInf(".product_clear").remove();
var gsCounterOdds = 1;
var gsCounterThree = 1;
jQInf("#Collection .indiv-product-wrapper").each(function(index) {
jQInf(this).removeClass("alpha");
jQInf(this).removeClass("omega");
jQInf(this).removeClass("even");
jQInf(this).removeClass("odd");
jQInf(this).removeClass("tablet-clear");
jQInf(this).removeClass("mobile-clear");
if(gsCounterOdds == 1) {
jQInf(this).addClass("even");
jQInf(this).addClass("tablet-clear");
jQInf(this).addClass("mobile-clear");
}
else {
jQInf(this).addClass("odd");
}
if(gsCounterThree == 1) {
jQInf(this).addClass("alpha");
}
if(gsCounterThree == gsNumberOfColumns) {
jQInf(this).addClass("omega");
jQInf(this).after('
');
}
if(gsCounterOdds == 2) {
gsCounterOdds = 0;
}
if(gsCounterThree == gsNumberOfColumns) {
gsCounterThree = 0;
}
gsCounterOdds++;
gsCounterThree++;
});
}
if(specialTheme == 12) {
jQInf("#section-collection .site-box").each(function(index) {
jQInf(this).addClass("active");
});
}
if(specialTheme == 13) {
var gsCounterOdds = 1;
var gsNumberOfColumns = 0
if(jQInf(jQInf(".product-loop").get(0)).find(".desktop-6").length > 0) {
gsNumberOfColumns = 2;
}
if(jQInf(jQInf(".product-loop").get(0)).find(".desktop-4").length > 0) {
gsNumberOfColumns = 3;
}
if(jQInf(jQInf(".product-loop").get(0)).find(".desktop-3").length > 0) {
gsNumberOfColumns = 4;
}
if(gsNumberOfColumns == 0) {
gsNumberOfColumns = 3;
}
jQInf(".product-loop .product-index").each(function(index) {
jQInf(this).removeClass("first");
jQInf(this).removeClass("last");
if(gsCounterOdds == 1) {
jQInf(this).addClass("first");
}
if(gsCounterOdds == gsNumberOfColumns) {
jQInf(this).addClass("last");
}
if(gsCounterOdds == gsNumberOfColumns) {
gsCounterOdds = 0;
}
gsCounterOdds++;
});
}
if(specialTheme == 8) {
var gsNumberOfColumns = 0
if(jQInf("#product-loop").find(".desktop-6").length > 0) {
gsNumberOfColumns = 2;
}
if(jQInf("#product-loop").find(".desktop-4").length > 0) {
gsNumberOfColumns = 3;
}
if(jQInf("#product-loop").find(".desktop-3").length > 0) {
gsNumberOfColumns = 4;
}
if(gsNumberOfColumns == 0) {
gsNumberOfColumns = 4;
}
var gsCounterOdds = 1;
jQInf("#product-loop .product").each(function(index) {
jQInf(this).removeClass("first");
jQInf(this).removeClass("last");
if(gsCounterOdds == 1) {
jQInf(this).addClass("first");
}
if(gsCounterOdds == gsNumberOfColumns) {
jQInf(this).addClass("last");
}
if(gsCounterOdds == gsNumberOfColumns) {
gsCounterOdds = 0;
}
gsCounterOdds++;
});
}
if(specialTheme == 2 || specialTheme == 10) {
jQInf(".product_clear").remove();
var gsCounterOdds = 1;
var gsCounterThree = 1;
var gsNumberOfColumns = 3;
var GSproductQuery = '#shopify-section-collection-template .products .one-third';
if(jQInf(".collection-matrix .columns").length > 0) {
GSproductQuery = '.collection-matrix .columns';
}
if(jQInf("#shopify-section-collection-template .products .eight").length > 0) {
gsNumberOfColumns = 2;
GSproductQuery = '#shopify-section-collection-template .products .eight';
}
if(jQInf("#shopify-section-collection-template .products .one-third").length > 0) {
gsNumberOfColumns = 3;
GSproductQuery = '#shopify-section-collection-template .products .one-third';
}
if(jQInf("#shopify-section-collection-template .products .four").length > 0) {
gsNumberOfColumns = 4;
GSproductQuery = '#shopify-section-collection-template .products .four';
}
jQInf(GSproductQuery).not(".modal_image").each(function(index) {
jQInf(this).removeClass("alpha");
jQInf(this).removeClass("omega");
jQInf(this).removeClass("even");
jQInf(this).removeClass("odd");
if(gsCounterOdds == 1) {
jQInf(this).addClass("even");
}
else {
jQInf(this).addClass("odd");
}
if(gsCounterThree == 1) {
jQInf(this).addClass("alpha");
}
if(gsCounterThree == gsNumberOfColumns) {
jQInf(this).addClass("omega");
jQInf(this).after('
');
}
if(gsCounterOdds == 2) {
gsCounterOdds = 0;
}
if(gsCounterThree == gsNumberOfColumns) {
gsCounterThree = 0;
}
gsCounterOdds++;
gsCounterThree++;
});
}
jQInf(".lazyloading").each(function() {
jQInf(this).removeClass("lazyloading");
jQInf(this).addClass("lazyloaded");
});
try {
collection.init();
}
catch(err) {
}
}
var GSLoader = function() {
if((window.location.href.indexOf("/products/") > 0)) {
try {
sessionStorage.setItem('gsproductviewed', '1');
}
catch(err) {
}
}
// if((!(window.location.href.indexOf("/collections/") > 0)) || (window.location.href.indexOf("/products/") > 0)) {
// return;
// }
if((window.location.href.indexOf("/blogs/") > 0)) {
return;
}
if((window.location.href.indexOf("/products/") > 0)) {
return;
}
try {
//if(sessionStorage.getItem('gscollectionurl') != window.location.href) {
if((sessionStorage.getItem('gscollectionurl') != window.location.href) || (jQInf(".medium-up--one-half, .medium-up--one-third").length > 1 && (jQInf('.card').length > 0)) ){
sessionStorage.setItem('gscollectionurl', window.location.href);
sessionStorage.setItem('gscollectioncontent', '');
sessionStorage.setItem('gspaginatecontent', '');
sessionStorage.setItem('gscollectionpagenr', '');
}
if(sessionStorage.getItem('gsproductviewed') == null || sessionStorage.getItem('gsproductviewed') == '0') {
sessionStorage.setItem('gscollectionurl', window.location.href);
sessionStorage.setItem('gscollectioncontent', '');
sessionStorage.setItem('gspaginatecontent', '');
sessionStorage.setItem('gscollectionpagenr', '');
}
sessionStorage.setItem('gsproductviewed', '0');
}
catch(err) {
}
paginateSelector = '.pagination';
collectionParent = '.products';
collectionParent = this.findCollectionParent();
if(jQInf('.pagination').length == 0) {
paginateSelector = '';
var paginationNodes = jQInf(collectionParent).find('*[class*="agination"]');
if(paginationNodes.length > 0) {
paginateSelector = '.' + jQInf.trim(paginationNodes.first().attr("class")).replace(/\s\s+/g, ' ').replace(/ /gi, '.');
}
else {
if(jQInf('#pagination').length > 0) {
paginateSelector = '#pagination';
}
else {
paginationNodes = jQInf('*[id*="agination"]');
if(paginationNodes.length > 0) {
paginateSelector = '#' + paginationNodes.first().attr("id");
}
else {
paginationNodes = jQInf('*[class*="aginate"]');
if(paginationNodes.length > 0) {
paginateSelector = '.' + jQInf.trim(paginationNodes.first().attr("class")).replace(/\s\s+/g, ' ').replace(/ /gi, '.');
}
else {
paginationNodes = jQInf('*[id*="aginate"]');
if(paginationNodes.length > 0) {
paginateSelector = '#' + paginationNodes.first().attr("id");
}
}
}
}
}
if(paginateSelector == '') {
var paginationNodes = jQInf(collectionParent).parent().nextAll().find('*[class*="agination"]');
if(paginationNodes.length > 0) {
paginateSelector = '.' + jQInf.trim(paginationNodes.first().attr("class")).replace(/\s\s+/g, ' ').replace(/ /gi, '.');
}
else {
if(jQInf('#pagination').length > 0) {
paginateSelector = '#pagination';
}
else {
paginationNodes = jQInf('*[id*="agination"]');
if(paginationNodes.length > 0) {
paginateSelector = '#' + paginationNodes.first().attr("id");
}
else {
paginationNodes = jQInf('*[class*="aginate"]');
if(paginationNodes.length > 0) {
paginateSelector = '.' + jQInf.trim(paginationNodes.first().attr("class")).replace(/\s\s+/g, ' ').replace(/ /gi, '.');
}
else {
paginationNodes = jQInf('*[id*="aginate"]');
if(paginationNodes.length > 0) {
paginateSelector = '#' + paginationNodes.first().attr("id");
}
}
}
}
}
}
if(paginateSelector == '#modal-pagination-wrapper') {
paginateSelector = '';
}
if(paginateSelector == '') {
var paginationNodes = jQInf('*[class*="agination"]');
if(paginationNodes.length > 0) {
paginateSelector = '.' + jQInf.trim(paginationNodes.first().attr("class")).replace(/\s\s+/g, ' ').replace(/ /gi, '.');
}
else {
if(jQInf('#pagination').length > 0) {
paginateSelector = '#pagination';
}
else {
paginationNodes = jQInf('*[id*="agination"]');
if(paginationNodes.length > 0) {
paginateSelector = '#' + paginationNodes.first().attr("id");
}
else {
paginationNodes = jQInf('*[class*="aginate"]');
if(paginationNodes.length > 0) {
paginateSelector = '.' + jQInf.trim(paginationNodes.first().attr("class")).replace(/\s\s+/g, ' ').replace(/ /gi, '.');
}
else {
paginationNodes = jQInf('*[id*="aginate"]');
if(paginationNodes.length > 0) {
paginateSelector = '#' + paginationNodes.first().attr("id");
}
}
}
}
}
}
}
if(jQInf(".container-pushy-main").length > 0 && jQInf("#category-sticky-parent").length > 0 && jQInf(".pagination-buttons").length > 0) {
paginateSelector = '.pagination-buttons';
}
if(paginateSelector == '') {
if(jQInf('#paging').length > 0) {
paginateSelector = '#paging';
}
}
if((jQInf(".wide-container .jiggly-split").length > 0)) {
paginateSelector = ".pager-button, .pagination";
}
if(paginateSelector == '') {
if(jQInf('.page_c').length > 0) {
paginateSelector = '.page_c';
collectionParent = collectionParent.replace('.animation-done', '');
jQInf("body").append("");
}
}
if (jQInf(".shopify-pagination").length > 0 && jQInf(".pagination-gl_default").length > 0) {
paginateSelector = '.shopify-pagination';
jQInf("body").append("");
}
if (jQInf(".pull-right.pagination-btns").length > 0 && jQInf(".product-listing").length > 0 && jQInf(".filters-row__pagination").length > 0) {
jQInf('
').insertAfter( ".product-listing" );
jQInf("#forcegscenter").append(jQInf(jQInf(".filters-row__pagination").get(0)));
}
if(specialTheme == 1) {
jQInf("body").append("");
}
paginateSelector = paginateSelector.replace('..', '.').replace('..', '.').replace('..', '.').replace('..', '.').replace('..', '.');
if(jQInf(paginateSelector).length > 0) {
jQInf("body").append("");
}
if(jQInf("#gscollectionbottom").length > 0) {
jQInf("#gscollectionbottom").remove();
}
if(jQInf("#bc-sf-filter-products").length == 0) {
if(loaderMode == 1) {
jQInf(jQInf(paginateSelector).get(0)).after('
');
}
else {
jQInf(jQInf(paginateSelector).get(0)).after('
');
}
}
else {
if(loaderMode == 1) {
jQInf(jQInf("#bc-sf-filter-products").get(0)).after('
');
}
else {
jQInf(jQInf("#bc-sf-filter-products").get(0)).after('
');
}
}
jQInf(jQInf(paginateSelector)).hide();
jQInf("body").append("");
setInterval(function() {
try {
if(jQInf(paginateSelector).css('float').length > 0) {
jQInf("#gscollectionbottom").css('float', jQInf(paginateSelector).css('float'));
}
}
catch(err) {
}
}, 500);
jQInf( "*:contains('Page 1')" ).each(function() {
if(jQInf(this).children().length == 0) {
jQInf(this).hide();
}
});
if(jQInf(collectionParent).length > 1) {
var tmpCnt = 1;
jQInf(collectionParent).each(function() {
if(productsParentTmp.get(0).innerHTML.localeCompare(jQInf(this).get(0).innerHTML) == 0) {
containerPos = tmpCnt;
}
tmpCnt++;
});
}
if(jQInf(collectionParent).find(paginateSelector).length > 0) {
jQInf(collectionParent).after(jQInf("#gscollectionbottom"));
}
this.listenToScroll = this.listenToScroll.bind(this);
this.analyseView = this.analyseView.bind(this);
if(productsParentTmp === null) {
jQInf("#gscollectionbottom img").remove();
jQInf("#gscollectionbottom button").remove();
return;
}
this.containerElement = productsParentTmp.get(0);
if(jQInf(".grid-link__container").length > 0) {
this.containerElement = jQInf(".grid-link__container").get(0);
}
if(jQInf(".custom-category .toolbar-amount").length > 0 && jQInf(".custom-products").length > 0) {
this.containerElement = jQInf(".custom-products .row").get(0);
}
if(!this.containerElement) {
return;
}
this.paginateSection = document.querySelector(paginateSelector);
paginateSel = this.paginateSection;
if(sessionStorage.getItem('gscollectioncontent') != null && sessionStorage.getItem('gscollectioncontent') != "") {
this.containerElement.insertAdjacentHTML('beforeend', sessionStorage.getItem('gscollectioncontent'));
fixThemeSpecial();
this.paginateSection = document.querySelector(paginateSelector);
this.paginateSection.innerHTML = sessionStorage.getItem('gspaginatecontent');
collectionPageNr = parseInt(sessionStorage.getItem('gscollectionpagenr'));
setTimeout(function()
{
try {
var resizeEvent = window.document.createEvent('UIEvents');
resizeEvent .initUIEvent('resize', true, false, window, 0);
window.dispatchEvent(resizeEvent);
$(window).trigger('forceproductblockheights');
} catch(err) {
}
//jQInf(window).trigger('resize');
}, 1000);
if(jQInf(".medium-up--one-half, .medium-up--one-third").length > 0) {
try {
jQInf(".card").css("opacity", '1');
} catch(err) {}
}
if(collectionPageNr == -1) {
jQInf("#gscollectionbottom button").remove();
jQInf("#gscollectionbottom img").remove();
}
}
this.listenToScroll();
};
GSLoader.prototype.findCollectionParent = function() {
var limititerations = 20;
var colllectionParentTmp = jQInf("a[href*='page=2']");
if(jQInf("#bc-sf-filter-bottom-pagination").length > 0) {
colllectionParentTmp = jQInf("#bc-sf-filter-bottom-pagination");
}
var collectionParentFound = false;
while(limititerations > 0) {
colllectionParentTmp = colllectionParentTmp.parent();
limititerations--;
//console.debug(jQInf(colllectionParentTmp));
if(jQInf(colllectionParentTmp).find('a[href*="/products/"]').length > 0) {
collectionParentFound = true;
limititerations = 0;
}
}
if(!collectionParentFound) {
return false;
}
var productInCollection = jQInf(colllectionParentTmp).find('a[href*="/products/"]');
if(productInCollection.length < 2) {
return false;
}
try {
if(jQInf('#collection-display #product-loop').length > 0) {
productsParentTmp = jQInf('#product-loop');
return '#product-loop';
}
} catch(err) { }
var productInCollectionFirst = productInCollection[0];
var productInCollectionLast = productInCollection[productInCollection.length - 1];
productsParentTmp = productInCollectionFirst;
limititerations = 20;
while(limititerations > 0) {
productsParentTmp = jQInf(productsParentTmp).parent();
if(jQInf(".custom-category .toolbar-amount").length > 0 && jQInf(".custom-products").length > 0) {
jQInf("body").append("");
productsParentTmp = jQInf(jQInf('.custom-products').get(0));
return '.custom-products .row';
}
limititerations--;
//console.debug(jQInf(colllectionParentTmp));
if(jQInf(productsParentTmp).find(productInCollectionLast).length > 0) {
if(productsParentTmp.attr("id")) {
var idName = '#' + productsParentTmp.attr("id");
return idName ;
}
if(productsParentTmp.attr("class")) {
//var className = '.' + productsParentTmp.attr("class").split(" ").join(".");
//className = className.replace('..', '.').replace('..', '.').replace('..', '.').replace('..', '.').replace('..', '.');
var className = '.' + jQInf.trim(productsParentTmp.attr("class")).replace(/\s\s+/g, ' ').replace(/ /gi, '.')
return className;
}
limititerations = 0;
}
}
return false;
}
GSLoader.prototype.listenToScroll = function() {
if (this.paginateSection) {
if(loaderMode == 1) {
document.addEventListener('scroll', this.analyseView);
window.addEventListener('resize', this.analyseView);
window.addEventListener('orientationchange', this.analyseView);
}
else {
jQInf("#gsloadmore").click(this.clickMoreBtn);
}
}
};
async function postData(url = '', data = {}) {
// Default options are marked with *
const response = await fetch(url, {
method: 'GET', // *GET, POST, PUT, DELETE, etc.
mode: 'cors', // no-cors, *cors, same-origin
cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
credentials: 'same-origin', // include, *same-origin, omit
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
// 'Content-Type': 'application/x-www-form-urlencoded',
},
redirect: 'follow', // manual, *follow, error
referrerPolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url
});
return response.text(); // parses JSON response into native JavaScript objects
};
GSLoader.prototype.fetchNextPage = function() {
httpRequest = new XMLHttpRequest();
try {
httpRequest.responseType = 'document';
} catch(error){
}
httpRequest.onreadystatechange = function loadingfinished() { try {
if(jQInf(".debugbygss").length == 0) {
jQInf("body").first().append('
');
}
jQInf(".gsdebuglisten10").remove();
jQInf("#debugbygss").append("
Response status: " + httpRequest.status + " ready state: " + httpRequest.readyState + "
");
} catch(err) {}
if (httpRequest.status == 200 && httpRequest.readyState == 4) {
if(httpRequest.responseXML == null) {
postData(this.nextStepLink, { })
.then(data => {
var data = jQInf(data);
var appendedSection = data.find(collectionParent).get(0);
var appendaedPage = data.find(paginateSelector).get(0);
var nextPageNr = collectionPageNr + 1;
jQInf("#gsloaderimg").hide();
jQInf("#gsloadmore").show();
if (data.find("a[href*='page=" + nextPageNr + "']").length == 0) {
jQInf("#gscollectionbottom button").remove();
jQInf("#gscollectionbottom img").remove();
}
if (jQInf(".medium-up--one-half").length > 1 && (jQInf(data).find('.card').length > 0)) {
var columnCnt = 0;
jQInf(data).find('.card').each(function () {
jQInf(jQInf(jQInf(".medium-up--one-half").get(columnCnt))).get(0).insertAdjacentHTML('beforeend', jQInf(jQInf(this)).get(0).outerHTML);
//jQInf(jQInf(".medium-up--one-half").get(columnCnt)).html(jQInf(this).innerHTML);
columnCnt++;
if (columnCnt > (jQInf(".medium-up--one-half").length - 1)) {
columnCnt = 0;
}
});
// var appendedSection2 = httpRequest.responseXML.querySelectorAll('.medium-up--one-half')[0];
// jQInf(jQInf(".medium-up--one-half").get(1)).insertAdjacentHTML('beforeend', appendedSection2.innerHTML);
} else {
jQInf(data).find('img').each(function () {
try {
jQInf(this).removeAttr("srcset");
} catch (err) {
}
});
jQInf(".more-views-slider").each(function(){
var images = jQInf(this).find(".image-list");
jQInf(images[0]).css('display', 'none');
jQInf(images[0]).removeClass('lightSlider lsGrab lSSlide');
jQInf(this).append(images[0]);
jQInf(this).find(".lSSlideOuter").each(function(){
jQInf(this).remove();
});
jQInf(images[0]).css('display', 'block');
});
this.containerElement.insertAdjacentHTML('beforeend', appendedSection.innerHTML);
//jQInf("body").append(jQInf('script[src*="application.min"]').get(0).outerHTML);
var thumbLoader = jQInf(this.containerElement).find(".thumb-loader");
if(thumbLoader.length > 0)
{
jQInf(thumbLoader).each(function () {
jQInf(this).css("opacity", '1');
});
}
}
var productImages = jQInf(this.containerElement).find(".product-item .product-image img");
jQInf(productImages).each(function(){
if(!jQInf(this).hasClass('loaded')){
jQInf(this).addClass('loaded');
}
});
if (collectionParent.indexOf("medium-up--one-half") > 0) {
jQInf(".card").css("opacity", '1');
}
if (jQInf(collectionParent).find(paginateSelector).length > 0) {
jQInf(this.containerElement).after(jQInf("#gscollectionbottom"));
}
this.paginateSection.innerHTML = appendaedPage.innerHTML;
if (jQInf(".cata-product .product-list-item").length > 0) {
jQInf(".cata-product .product-grid-item").each(function () {
jQInf(this).removeClass("product-grid-item");
jQInf(this).addClass("product-list-item");
});
}
if (loaderMode == 1) {
this.listenToScroll();
}
HsCartDrawer.quickBuyByttonByCollections(HsCartDrawer.json,HsCartDrawer.query);
HsCartDrawer.addToCart(HsCartDrawer.json,HsCartDrawer.query);
});
return;
}
if(specialTheme == 17) {
collectionParent = collectionParent.replace(".isotope-products.border-no.loaded", ".isotope-products");
}
if(specialTheme == 21) {
collectionParent = '.collection-products div';
}
var appendedSection = httpRequest.responseXML.querySelectorAll(collectionParent)[0];
if(httpRequest.responseXML.querySelectorAll(collectionParent).length > 1) {
appendedSection = httpRequest.responseXML.querySelectorAll(collectionParent)[containerPos - 1];
}
try {
jQInf(appendedSection).find(".slide-up-animation").removeClass("slide-up-animation");
} catch(err) {}
if(specialTheme == 12) {
jQInf(appendedSection).find(".box--add-hr").remove();
}
// FIX FOR PARALAX THEME
var paralaxImgs = jQInf(appendedSection).find(".product_image .product_container img");
if(paralaxImgs.length > 0) {
paralaxImgs.each(function() {
jQInf(this).css("opacity", "1");
});
}
var appHeaderEls = jQInf(appendedSection).find("header");
if(appHeaderEls.length > 0) {
appHeaderEls.each(function() {
jQInf(this).hide();
});
}
var containerForProducts = jQInf(this.containerElement);
jQInf(appendedSection).find("script").each(function() {
try {
if(containerForProducts.attr("class") == jQInf(this).parent().attr("class")) {
jQInf(this).remove();
}
} catch(err) {}
});
if(jQInf(appendedSection).find("img:not(\"[src*='/products/']\")").length > 0 && jQInf(appendedSection).find("img[src*='/products/']").length == 0) {
jQInf(appendedSection).find("img:not(\"[src*='/products/']\")").each(function() {
var imgReference = jQInf(this).get(0);
var suggestedImageUrl = '';
var productImgContHtml = jQInf(this).parent().get(0).innerHTML;
var splitImgUrls = productImgContHtml.split('cdn.shopify.com');
var splitCnt = 0;
var stringToExaminForImageUrl = '';
jQInf.each(splitImgUrls, function(index) {
if(splitCnt > 0) {
if(this.indexOf('/products/') > 0) {
if(stringToExaminForImageUrl == '') {
stringToExaminForImageUrl = this;
}
}
}
splitCnt++;
});
if(splitImgUrls.length > 1) {
var remainingpath = stringToExaminForImageUrl.replace("'", " ").replace('"', " ").replace(',', " ").replace(';', " ");
splitImgUrls = remainingpath.split(" ");
suggestedImageUrl = splitImgUrls[0];
suggestedImageUrl = '//cdn.shopify.com' + suggestedImageUrl;
jQInf(imgReference).attr('src', suggestedImageUrl);
}
});
}
var appendaedPage = httpRequest.responseXML.querySelectorAll(paginateSelector)[0];
var nextPageNr = collectionPageNr + 1;
//this.containerElement.insertAdjacentHTML('beforeend', sessionStorage.getItem('gscollectioncontent'));
//sessionStorage.setItem('gscollectioncontent', sessionStorage.getItem('gscollectioncontent') + '' + appendedSection.innerHTML);
jQInf("#gsloaderimg").hide();
jQInf("#gsloadmore").show();
window.gscollectionpagenr = collectionPageNr;
if(!httpRequest.responseXML.querySelector("a[href*='page=" + nextPageNr + "']")) {
try {
//sessionStorage.setItem('gscollectionpagenr', -1);
window.gscollectionpagenr = -1;
}
catch(err) {
}
jQInf("#gscollectionbottom button").remove();
jQInf("#gscollectionbottom img").remove();
}
else {
try {
window.gscollectionpagenr = collectionPageNr;
//sessionStorage.setItem('gscollectionpagenr', collectionPageNr);
}
catch(err) {
}
}
if(jQInf(".medium-up--one-half, .medium-up--one-third").length > 1 && (jQInf(httpRequest.responseXML).find('.card').length > 0)) {
var columnCnt = 0;
jQInf(httpRequest.responseXML).find('.card').each(function() {
jQInf(jQInf(jQInf(".medium-up--one-half, .medium-up--one-third").get(columnCnt))).get(0).insertAdjacentHTML('beforeend', jQInf(jQInf(this)).get(0).outerHTML);
//jQInf(jQInf(".medium-up--one-half, .medium-up--one-third").get(columnCnt)).html(jQInf(this).innerHTML);
columnCnt++;
if(columnCnt > (jQInf(".medium-up--one-half, .medium-up--one-third").length - 1)) {
columnCnt = 0;
}
});
// var appendedSection2 = httpRequest.responseXML.querySelectorAll('.medium-up--one-half')[0];
// jQInf(jQInf(".medium-up--one-half").get(1)).insertAdjacentHTML('beforeend', appendedSection2.innerHTML);
}
else {
if(jQInf(appendedSection).find(".hidden-handheld").length > 0) {
jQInf(appendedSection).find(".hidden-handheld").remove();
}
jQInf(appendedSection).find("img[src*='loader.gif']").each(function() {
if(jQInf(this).hasClass("product_image--current")) {
jQInf(this).attr("src", jQInf(this).attr('data-src'));
}
});
jQInf(httpRequest.responseXML).find('img').each(function() {
try {
jQInf(this).removeAttr("srcset");
} catch(err) {}
});
//console.debug(sessionStorage.getItem('gscollectioncontent'));
if(jQInf('.collection-grid-uninit .collection-header').length > 0) {
if(jQInf(appendedSection).find("header").length > 0) {
jQInf(appendedSection).find("header").remove();
}
var containerForChildren = jQInf("
");
jQInf(appendedSection).find(".collection-grid-item").each(function() {
containerForChildren.append(jQInf(this));
});
appendedSection = containerForChildren.get(0);
}
if(specialTheme == 33) {
jQInf(appendedSection).find("figure").each(function() {
var backgroundFromTemplate = jQInf(this).attr('data-rimg-template').replace("{size}", '544x800');
jQInf(this).attr("style", 'background-image: url("' + backgroundFromTemplate + '");');
});
}
if(jQInf("#bc-sf-filter-products").length > 0) {
jQInf("#bc-sf-filter-products").append(appendedSection.innerHTML);
}
else {
this.containerElement.insertAdjacentHTML('beforeend', appendedSection.innerHTML);
try {
jQInf(this.containerElement).children("style").each(function() {
jQInf(this).hide();
});
} catch( error ){}
try {
var api = new Yotpo.API(yotpo);
api.refreshWidgets();
} catch(err) { }
try {
DoublyGlobalCurrency.convertAll($('[name=doubly-currencies]').val());
setTimeout(function() {
try {
DoublyGlobalCurrency.convertAll($('[name=doubly-currencies]').val());
} catch(err) { }
}, 1000);
}
catch(err) { }
try {
if($(".fw-variants").length > 0) {
$(".product_item").hover(function () {
$(this).find(".fw-variant-list").stop().slideDown("slow");
}, function(){
$(this).find(".fw-variant-list").stop().slideUp("slow");
})
}
}
catch(err) { }
try {
if ((typeof SCAShopify) !== 'undefined') {
SCAShopify.jQuery(document).unbind('click.fb-start');
SCAShopify.loaded = false;
SCAQVinit = undefined;
jQInf.getScript(jQInf('script[src*="sca-qv-"]').attr('src'));
}
}
catch(err) { }
try {
if (typeof ReloadSmartWishlist !== "undefined" && $.isFunction(ReloadSmartWishlist)) ReloadSmartWishlist();
}
catch(err) { }
if(specialTheme == 15) {
jQInf("body").append(jQInf('script[src*="assets/theme.js"]').get(0).outerHTML);
}
if(specialTheme == 11) {
jQInf("body").append(jQInf('script[src*="assets/atlantic"]').get(0).outerHTML);
}
try {
jQInf("body").append(jQInf('script[src*="assets/empire.js"]').get(0).outerHTML);
}
catch(err) { }
if(specialTheme == 17) {
window.scrollBy( 0, -2);
}
//this.containerElement.insertAdjacentHTML('beforeend', appendedSection.innerHTML);
fixThemeSpecial();
}
try {
jQInf(productsParentTmp.get(0)).find("script").hide();
} catch(err) {}
jQInf(jQInf(this.containerElement).find(".thumb-loader").length > 0)
{
jQInf(this.containerElement).find(".thumb-loader").each(function() {
jQInf(this).css("opacity", '1');
});
}
}
if(collectionParent.indexOf("medium-up--one-half") > 0 || collectionParent.indexOf("medium-up--one-third") > 0) {
jQInf(".card").css("opacity", '1');
}
if(jQInf(collectionParent).find(paginateSelector).length > 0) {
jQInf(this.containerElement).after(jQInf("#gscollectionbottom"));
}
//this.paginateSection.innerHTML = appendaedPage.innerHTML;
jQInf(this.paginateSection).innerHTML = '';
//jQInf(this.paginateSection).append(jQInf(appendaedPage.innerHTML));
jQInf(this.paginateSection).append(jQInf(appendaedPage));
if(jQInf(".custom-category .toolbar-amount").length > 0 && jQInf(".custom-products").length > 0) {
jQInf('.modes').find(".active").trigger("click");
}
if(jQInf(".cata-product .product-list-item").length > 0) {
jQInf(".cata-product .product-grid-item").each(function() {
jQInf(this).removeClass("product-grid-item");
jQInf(this).addClass("product-list-item");
});
}
if(loaderMode == 1) {
this.listenToScroll();
}
setTimeout(function()
{
try {
SPR.initRatingHandler();
SPR.initDomEls();
SPR.loadBadges();
} catch( error ){}
}, 1000);
setTimeout(function()
{
try {
var resizeEvent = window.document.createEvent('UIEvents');
resizeEvent .initUIEvent('resize', true, false, window, 0);
window.dispatchEvent(resizeEvent);
$(window).trigger('forceproductblockheights');
} catch(err) {
}
//jQInf(window).trigger('resize');
}, 1000);
sessionStorage.setItem('gscollectionpagenr', window.gscollectionpagenr);
try {
if(sessionStorage.getItem('gscollectioncontent') != null && sessionStorage.getItem('gscollectioncontent') != "") {
sessionStorage.setItem('gscollectioncontent', sessionStorage.getItem('gscollectioncontent') + '' + appendedSection.innerHTML);
}
else {
sessionStorage.setItem('gscollectionurl', window.location.href);
sessionStorage.setItem('gscollectioncontent', appendedSection.innerHTML);
}
} catch(err) {
try {
sessionStorage.setItem('gscollectioncontent', '');
} catch(err) {}
}
try {
sessionStorage.setItem('gspaginatecontent', appendaedPage.innerHTML);
}
catch(err) {
}
}
}.bind(this);
try {
httpRequest.gsOpen('GET', this.nextStepLink);
httpRequest.responseType = 'document';
httpRequest.gsSend();
}
catch(err) {
httpRequest.open('GET', this.nextStepLink);
httpRequest.responseType = 'document';
httpRequest.send();
}
};
GSLoader.prototype.analyseView = function() {
if (document.getElementById("gscollectionbottom").getBoundingClientRect().top <= window.innerHeight && document.getElementById("gscollectionbottom").getBoundingClientRect().bottom >= 0) {
window.collectionPageNr = collectionPageNr + 1;
this.nextSetUrl = this.paginateSection.querySelector("a[href*='page=" + collectionPageNr + "']");
var pageUrl = window.location.href;
if(pageUrl.indexOf('?')) {
var exploded = pageUrl.split("?");
pageUrl = exploded[0];
}
if(pageUrl.indexOf('#')) {
var exploded = pageUrl.split("#");
pageUrl = exploded[0];
}
document.removeEventListener('scroll', this.analyseView);
window.removeEventListener('resize', this.analyseView);
window.removeEventListener('orientationchange', this.analyseView);
if (this.nextSetUrl || (jQInf("#bc-sf-filter-products").length > 0)) {
var paramGSStr = '';
if(getUrlParamsGS("sort_by") != null) {
paramGSStr = paramGSStr + "&sort_by=" + getUrlParamsGS("sort_by");
}
if(getUrlParamsGS("view") != null) {
paramGSStr = paramGSStr + "&view=" + getUrlParamsGS("view");
}
if(getUrlParamsGS("q") != null) {
paramGSStr = paramGSStr + "&q=" + getUrlParamsGS("q");
}
if(getUrlParamsGS("constraint") != null) {
paramGSStr = paramGSStr + "&constraint=" + getUrlParamsGS("constraint");
}
if(window.location.href.indexOf("?") != -1) {
gsscroller.nextStepLink = window.location.href + '&page=' + collectionPageNr;
}
else {
gsscroller.nextStepLink = window.location.href + '?page=' + collectionPageNr;
}
this.fetchNextPage();
}
else {
jQInf("#gscollectionbottom img").remove();
}
}
};
GSLoader.prototype.clickMoreBtn = function() {
window.collectionPageNr = collectionPageNr + 1;
gsscroller.nextSetUrl = paginateSel.querySelector("a[href*='page=" + collectionPageNr + "']");
var pageUrl = window.location.href;
if(pageUrl.indexOf('?')) {
var exploded = pageUrl.split("?");
pageUrl = exploded[0];
}
if(pageUrl.indexOf('#')) {
var exploded = pageUrl.split("#");
pageUrl = exploded[0];
}
jQInf("#gsloaderimg").show();
jQInf("#gsloadmore").hide();
if (gsscroller.nextSetUrl) {
var paramGSStr = '';
if(getUrlParamsGS("sort_by") != null) {
paramGSStr = paramGSStr + "&sort_by=" + getUrlParamsGS("sort_by");
}
if(getUrlParamsGS("view") != null) {
paramGSStr = paramGSStr + "&view=" + getUrlParamsGS("view");
}
if(getUrlParamsGS("q") != null) {
paramGSStr = paramGSStr + "&q=" + getUrlParamsGS("q");
}
if(getUrlParamsGS("constraint") != null) {
paramGSStr = paramGSStr + "&constraint=" + getUrlParamsGS("constraint");
}
if(window.location.href.indexOf("?") != -1) {
gsscroller.nextStepLink = window.location.href + '&page=' + collectionPageNr;
}
else {
gsscroller.nextStepLink = window.location.href + '?page=' + collectionPageNr;
}
gsscroller.fetchNextPage();
}
else {
jQInf("#gscollectionbottom button").remove();
jQInf("#gscollectionbottom img").remove();
}
};
if((window.location.href.indexOf("/collections/") > 0)) {
if((window.location.href.indexOf("&page=") > 0) || (window.location.href.indexOf("?page=") > 0)) {
var newUrlRedirect = window.location.href.replace("page=", "redirect=");
window.location.href = newUrlRedirect;
}
}