var InstagramLoader=function(){var t={},n={userId:"userId",tag:"tag",placeholderClass:".element-social",domain:document.location.hostname.substr(document.location.hostname.lastIndexOf(".")+1)};return t.init=function(t){var i,r;$.extend(n,t),i=$(n.placeholderClass).length,i>0&&(r="/Umbraco/api/apiinstagram/get?userId="+n.userId+"&tag="+n.tag+"&count="+i+"&domain="+n.domain,$.ajax({url:r,beforeSend:function(){for(var r,t=0;t<i;t++)r=$(n.placeholderClass)[t],$(r).spin({lines:9,length:5,width:4,radius:6,color:"#FFF"})},success:function(t){for(var u,r=0;r<i;r++)u=$(n.placeholderClass)[r],t[r]&&$(u).find("img").prop("src",t[r])},complete:function(){for(var r,t=0;t<i;t++)r=$(n.placeholderClass)[t],$(r).find("img").show(),$(r).spin(!1)}}))},t}(InstagramLoader||{});(function(n){var t;n.fn.shareUrl=function(){function r(n){window.open(n,"share",t)}var i={url:"",image:"",title:"",message:""};return t=i.isMobile?"toolbar=0,status=0":"toolbar=0,status=0,width=600,height=400",this.each(function(){var t=n(this);t.click(function(){var t=n(this).data("action"),u;i.url=n(this).data("url"),i.image=n(this).data("image"),i.title=n(this).data("title"),i.message=n(this).data("message");var f=n(this).data("ga-type"),e=n(this).data("ga-location")||"",o=n(this).data("ga-option")||"";trackEvent(f,e,o),u={twitter:"https://twitter.com/intent/tweet?url="+encodeURIComponent(i.url)+"&text="+encodeURIComponent(i.message)},t=="facebook"?FB.ui({method:"feed",name:i.title,caption:"U By Kotex",description:i.message,link:i.url,picture:i.image},function(){}):r(u[t])})}),this}})(jQuery),function(n){n.fn.verify=function(){this.each(function(){var t=n(this);t.find("a").each(function(){var r=n(this).data("id"),i=n.cookie("votes-"+r);i!==undefined&&(t.addClass("disabled"),n(this).data("helpful").toString()===i&&n(this).addClass("voted"))})})},n.fn.vote=function(t,i){this.each(function(){var u=n(this),r=u.data("id"),f=n.cookie("votes-"+r);u.click(function(e){var s,o;return e.stopPropagation(),u.parent(".vote").addClass("disabled"),f=n.cookie("votes-"+r),s=u.data("helpful"),f===undefined&&(o={NodeId:r,IsHelpful:s},n.ajax({type:"POST",url:t,data:o}).done(function(t){n.cookie("votes-"+r,o.IsHelpful),n("span.helpful-percent[data-id*="+r+"]").text(t),o.IsHelpful===!1&&n("#vote-down").modal({backdrop:"static"}),i()})),!1})})}}(jQuery),$(document).ready(function(){$(".element-video").on("click",function(){$(this).find(".content").is(":visible")&&$(this).find(".content").click()});$(".element-video .content").click(function(){var n=$(this).data("videoid"),t='<iframe src="//www.youtube.com/embed/'+n+'?autoplay=1&amp;autohide=1&amp;showinfo=0&amp;rel=0&amp;wmode=transparent" frameborder=0 allowfullscreen><\/iframe>';$(this).hide(),$(this).next().show().html(t)})}),function(){var t=184,i=184,n;$(document).ready(function(){setTimeout(function(){n()},200)}),$(window).resize(function(){n()}),n=function(){var n;$("html").hasClass("browser-ie8")?$("body").width()>=367?(n=$("#isotope-container"),n.isotope({itemSelector:".element",transformsEnabled:!1,layoutMode:"perfectMasonry",perfectMasonry:{layout:"vertical",liquid:!1,columnWidth:t,rowHeight:i}})):(n=$("#isotope-container"),n.hasClass("isotope")&&n.isotope("destroy")):Modernizr.mq("(min-width: 367px)")?(n=$("#isotope-container"),n.isotope({itemSelector:".element",transformsEnabled:!1,layoutMode:"perfectMasonry",perfectMasonry:{layout:"vertical",liquid:!1,columnWidth:t,rowHeight:i}})):(n=$("#isotope-container"),n.hasClass("isotope")&&n.isotope("destroy"))},$(".element-range").each(function(){var n=$(this).height(),t;if(n>0){if(n>174)var i=n-174,r=Math.ceil(i/184),t=174+r*184;else t=174;$(this).height(t)}})}(),function(){$(document).ready(function(){var t=$("#isotope-container"),n=0;t.delegate(".element.element-article","click",function(t){var e,u;if(!$(this).hasClass("large")){$(".article").remove(),n=$(this).offset().top-20;var f=$(this).data("id"),r=$(this),i=$(".landing-element");return History.enabled&&(t.preventDefault(),e=$(this).attr("href"),u=$(this).data("title"),History.pushState({data:u},u,e)),$.ajax({url:"/umbraco/Surface/ArticleView/GET/"+f,beforeSend:function(){r.hasClass("has-image")?r.spin({lines:9,length:5,width:4,radius:6,color:"#FFF"}):r.spin({lines:9,length:5,width:4,radius:6,color:"#000"})},success:function(n){i.find(".content").removeClass("active"),i.find(".call-to-action").removeClass("active"),i.find(".content").hide(),i.find(".call-to-action").hide(),i.addClass("large"),i.append("<div class='article'>"+n+"<\/div>"),$("html, body").animate({scrollTop:$(".article").offset().top-20},300),$(".widget-share").shareUrl();var t="/Umbraco/api/ApiVote/Post";$(".vote").verify(),$(".vote a").vote(t,function(){$(".vote").verify(),feedbackmodalformreset(f)}),typeof articleCallback=="function"&&articleCallback()},complete:function(){r.spin(!1),i.find("a").click(function(n){n.stopPropagation()});i.find(".close-btn").on("click",function(t){var u,r,i;t.stopPropagation(),u=$(this).parents(".article"),r=$(this).data("parent-url"),History.enabled&&(i="U by Kotex",History.pushState({data:i},i,r)),$(".article").remove(),$("html, body").animate({scrollTop:n},300);var f=$(this).data("ga-type"),e=$(this).data("ga-location")||"",o=$(this).data("ga-option")||"";return trackEvent(f,e,o),!1})}}),!1}return!1}),window.addEventListener?window.addEventListener("popstate",function(){var i=$(".article").parent().attr("href")==document.location.pathname,t=$(".article").parent().data("url")==document.location.pathname,r=i||t;!r&&$("#isotope-container a[href='"+document.location.pathname+"']").length>0?$("#isotope-container a[href='"+document.location.pathname+"']").click():t||$(".article .close-btn").click()}):window.attachEvent&&window.attachEvent("onpopstate",function(){var i=$(".article").parent().attr("href")==document.location.pathname,t=$(".article").parent().data("url")==document.location.pathname,r=i||t;!r&&$("#isotope-container a[href='"+document.location.pathname+"']").length>0?$("#isotope-container a[href='"+document.location.pathname+"']").click():t||$(".article .close-btn").click()})})}(),function(n,t,i){function e(i,r,u){var f=t.createElement(i);return r&&(f.id=h+r),u&&(f.style.cssText=u),n(f)}function ai(){return i.innerHeight?i.innerHeight:n(i).height()}function kt(n){var i=c.length,t=(a+n)%i;return t<0?i+t:t}function y(n,t){return Math.round((/%/.test(n)?(t==="x"?d.width():ai())/100:1)*parseInt(n,10))}function pi(n,t){return n.photo||n.photoRegex.test(t)}function wi(n,t){return n.retinaUrl&&i.devicePixelRatio>1?t.replace(n.photoRegex,n.retinaSuffix):t}function bi(n){"contains"in u[0]&&!u[0].contains(n.target)&&(n.stopPropagation(),u.focus())}function ki(){var t,i=n.data(v,b);i==null?(r=n.extend({},gt),console&&console.log&&console.log("Error: cboxElement missing settings object")):r=n.extend({},i);for(t in r)n.isFunction(r[t])&&t.slice(0,2)!=="on"&&(r[t]=r[t].call(v));r.rel=r.rel||v.rel||n(v).data("rel")||"nofollow",r.href=r.href||n(v).attr("href"),r.title=r.title||v.title,typeof r.href=="string"&&(r.href=n.trim(r.href))}function ft(i,r){n(t).trigger(i),w.trigger(i),n.isFunction(r)&&r.call(v)}function dt(i){if(!at){if(v=i,ki(),c=n(v),a=0,r.rel!=="nofollow"&&(c=n("."+et).filter(function(){var t=n.data(this,b),i;return t&&(i=n(this).data("rel")||t.rel||this.rel),i===r.rel}),a=c.index(v),a===-1&&(c=c.add(v),a=c.length-1)),k.css({opacity:parseFloat(r.opacity),cursor:r.overlayClose?"pointer":"auto",visibility:"visible"}).show(),hi&&u.add(k).removeClass(hi),r.className&&u.add(k).addClass(r.className),hi=r.className,r.closeButton?bt.html(r.close).appendTo(p):bt.appendTo("<div/>"),!tt){if(tt=lt=!0,u.css({visibility:"hidden",display:"block"}),l=e(o,"LoadedContent","width:0; height:0; overflow:hidden"),p.css({width:"",height:""}).append(l),g=ii.height()+fi.height()+p.outerHeight(!0)-p.height(),nt=ri.width()+ui.width()+p.outerWidth(!0)-p.width(),it=l.outerHeight(!0),rt=l.outerWidth(!0),r.w=y(r.initialWidth,"x"),r.h=y(r.initialHeight,"y"),l.css({width:"",height:r.h}),s.position(),ft(gi,r.onOpen),si.add(ei).hide(),u.focus(),r.trapFocus&&t.addEventListener){t.addEventListener("focus",bi,!0);w.one(ti,function(){t.removeEventListener("focus",bi,!0)})}if(r.returnFocus)w.one(ti,function(){n(v).focus()})}ir()}}function di(){!u&&t.body&&(li=!1,d=n(i),u=e(o).attr({id:b,"class":n.support.opacity===!1?h+"IE":"",role:"dialog",tabindex:"-1"}).hide(),k=e(o,"Overlay").hide(),wt=n([e(o,"LoadingOverlay")[0],e(o,"LoadingGraphic")[0]]),ut=e(o,"Wrapper"),p=e(o,"Content").append(ei=e(o,"Title"),oi=e(o,"Current"),ct=n('<button type="button"/>').attr({id:h+"Previous"}),ht=n('<button type="button"/>').attr({id:h+"Next"}),ot=e("button","Slideshow"),wt),bt=n('<button type="button"/>').attr({id:h+"Close"}),ut.append(e(o).append(e(o,"TopLeft"),ii=e(o,"TopCenter"),e(o,"TopRight")),e(o,!1,"clear:left").append(ri=e(o,"MiddleLeft"),p,ui=e(o,"MiddleRight")),e(o,!1,"clear:left").append(e(o,"BottomLeft"),fi=e(o,"BottomCenter"),e(o,"BottomRight"))).find("div div").css({float:"left"}),st=e(o,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),si=ht.add(ct).add(oi).add(ot),n(t.body).append(k,u.append(ut,st)))}function tr(){function i(n){n.which>1||n.shiftKey||n.altKey||n.metaKey||n.ctrlKey||(n.preventDefault(),dt(this))}if(u){if(!li)if(li=!0,ht.click(function(){s.next()}),ct.click(function(){s.prev()}),bt.click(function(){s.close()}),k.click(function(){r.overlayClose&&s.close()}),n(t).bind("keydown."+h,function(n){var t=n.keyCode;tt&&r.escKey&&t===27&&(n.preventDefault(),s.close()),tt&&r.arrowKey&&c[1]&&!n.altKey&&(t===37?(n.preventDefault(),ct.click()):t===39&&(n.preventDefault(),ht.click()))}),n.isFunction(n.fn.on))n(t).on("click."+h,"."+et,i);else n("."+et).live("click."+h,i);return!0}return!1}function ir(){var u,b,p=s.prep,k,d=++ci;if(lt=!0,f=!1,v=c[a],ki(),ft(pt),ft(vt,r.onLoad),r.h=r.height?y(r.height,"y")-it-g:r.innerHeight&&y(r.innerHeight,"y"),r.w=r.width?y(r.width,"x")-rt-nt:r.innerWidth&&y(r.innerWidth,"x"),r.mw=r.w,r.mh=r.h,r.maxWidth&&(r.mw=y(r.maxWidth,"x")-rt-nt,r.mw=r.w&&r.w<r.mw?r.w:r.mw),r.maxHeight&&(r.mh=y(r.maxHeight,"y")-it-g,r.mh=r.h&&r.h<r.mh?r.h:r.mh),u=r.href,vi=setTimeout(function(){wt.show()},100),r.inline){k=e(o).hide().insertBefore(n(u)[0]);w.one(pt,function(){k.replaceWith(l.children())});p(n(u))}else if(r.iframe)p(" ");else if(r.html)p(r.html);else if(pi(r,u)){u=wi(r,u),f=t.createElement("img");n(f).addClass(h+"Photo").bind("error",function(){r.title=!1,p(e(o,"Error").html(r.imgError))}).one("load",function(){var t;d===ci&&(f.alt=n(v).attr("alt")||n(v).attr("data-alt")||"",r.retinaImage&&i.devicePixelRatio>1&&(f.height=f.height/i.devicePixelRatio,f.width=f.width/i.devicePixelRatio),r.scalePhotos&&(b=function(){f.height-=f.height*t,f.width-=f.width*t},r.mw&&f.width>r.mw&&(t=(f.width-r.mw)/f.width,b()),r.mh&&f.height>r.mh&&(t=(f.height-r.mh)/f.height,b())),r.h&&(f.style.marginTop=Math.max(r.mh-f.height,0)/2+"px"),c[1]&&(r.loop||c[a+1])&&(f.style.cursor="pointer",f.onclick=function(){s.next()}),f.style.width=f.width+"px",f.style.height=f.height+"px",setTimeout(function(){p(f)},1))});setTimeout(function(){f.src=u},1)}else u&&st.load(u,r.data,function(t,i){d===ci&&p(i==="error"?e(o,"Error").html(r.xhrError):n(this).contents())})}var gt={transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,className:!1,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",open:!1,returnFocus:!0,trapFocus:!0,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp)((#|\?).*)?$/i,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:undefined,closeButton:!0},b="colorbox",h="cbox",et=h+"Element",gi=h+"_open",vt=h+"_load",yt=h+"_complete",ni=h+"_cleanup",ti=h+"_closed",pt=h+"_purge",k,u,ut,p,ii,ri,ui,fi,c,d,l,st,wt,ei,oi,ot,ht,ct,bt,si,w=n("<a/>"),r,g,nt,it,rt,v,a,f,tt,lt,at,vi,s,o="div",hi,ci=0,yi={},li,nr=function(){function t(){clearTimeout(l)}function e(){(r.loop||c[a+1])&&(t(),l=setTimeout(s.next,r.slideshowSpeed))}function v(){ot.html(r.slideshowStop).unbind(i).one(i,y);w.bind(yt,e).bind(vt,t),u.removeClass(n+"off").addClass(n+"on")}function y(){t(),w.unbind(yt,e).unbind(vt,t);ot.html(r.slideshowStart).unbind(i).one(i,function(){s.next(),v()});u.removeClass(n+"on").addClass(n+"off")}function o(){f=!1,ot.hide(),t(),w.unbind(yt,e).unbind(vt,t),u.removeClass(n+"off "+n+"on")}var f,n=h+"Slideshow_",i="click."+h,l;return function(){if(f)r.slideshow||(w.unbind(ni,o),o());else if(r.slideshow&&c[1]){f=!0;w.one(ni,o);r.slideshowAuto?v():y(),ot.show()}}}();n.colorbox||(n(di),s=n.fn[b]=n[b]=function(t,i){var r=this;if(t=t||{},di(),tr()){if(n.isFunction(r))r=n("<a/>"),t.open=!0;else if(!r[0])return r;i&&(t.onComplete=i),r.each(function(){n.data(this,b,n.extend({},n.data(this,b)||gt,t))}).addClass(et),(n.isFunction(t.open)&&t.open.call(r)||t.open)&&dt(r[0])}return r},s.position=function(t,i){function w(){ii[0].style.width=fi[0].style.width=p[0].style.width=parseInt(u[0].style.width,10)-nt+"px",p[0].style.height=ri[0].style.height=ui[0].style.height=parseInt(u[0].style.height,10)-g+"px"}var f,e=0,o=0,c=u.offset(),l,a,v;d.unbind("resize."+h),u.css({top:-9e4,left:-9e4}),l=d.scrollTop(),a=d.scrollLeft(),r.fixed?(c.top-=l,c.left-=a,u.css({position:"fixed"})):(e=l,o=a,u.css({position:"absolute"})),o+=r.right!==!1?Math.max(d.width()-r.w-rt-nt-y(r.right,"x"),0):r.left!==!1?y(r.left,"x"):Math.round(Math.max(d.width()-r.w-rt-nt,0)/2),e+=r.bottom!==!1?Math.max(ai()-r.h-it-g-y(r.bottom,"y"),0):r.top!==!1?y(r.top,"y"):Math.round(Math.max(ai()-r.h-it-g,0)/2),u.css({top:c.top,left:c.left,visibility:"visible"}),ut[0].style.width=ut[0].style.height="9999px",f={width:r.w+rt+nt,height:r.h+it+g,top:e,left:o},t&&(v=0,n.each(f,function(n){if(f[n]!==yi[n]){v=t;return}}),t=v),yi=f,t||u.css(f),u.dequeue().animate(f,{duration:t||0,complete:function(){w(),lt=!1,ut[0].style.width=r.w+rt+nt+"px",ut[0].style.height=r.h+it+g+"px",r.reposition&&setTimeout(function(){d.bind("resize."+h,s.position)},1),i&&i()},step:w})},s.resize=function(n){var t;tt&&(n=n||{},n.width&&(r.w=y(n.width,"x")-rt-nt),n.innerWidth&&(r.w=y(n.innerWidth,"x")),l.css({width:r.w}),n.height&&(r.h=y(n.height,"y")-it-g),n.innerHeight&&(r.h=y(n.innerHeight,"y")),n.innerHeight||n.height||(t=l.scrollTop(),l.css({height:"auto"}),r.h=l.height()),l.css({height:r.h}),t&&l.scrollTop(t),s.position(r.transition==="none"?0:r.speed))},s.prep=function(i){function k(){return r.w=r.w||l.width(),r.w=r.mw&&r.mw<r.w?r.mw:r.w}function d(){return r.h=r.h||l.height(),r.h=r.mh&&r.mh<r.h?r.mh:r.h}if(tt){var v,y=r.transition==="none"?0:r.speed;l.empty().remove(),l=e(o,"LoadedContent").append(i),l.hide().appendTo(st.show()).css({width:k(),overflow:r.scrolling?"auto":"hidden"}).css({height:d()}).prependTo(p),st.hide(),n(f).css({float:"none"}),v=function(){function p(){n.support.opacity===!1&&u[0].style.removeAttribute("filter")}var f=c.length,i,s="frameBorder",v="allowTransparency",o;if(tt){if(o=function(){clearTimeout(vi),wt.hide(),ft(yt,r.onComplete)},ei.html(r.title).add(l).show(),f>1?(typeof r.current=="string"&&oi.html(r.current.replace("{current}",a+1).replace("{total}",f)).show(),ht[r.loop||a<f-1?"show":"hide"]().html(r.next),ct[r.loop||a?"show":"hide"]().html(r.previous),nr(),r.preloading&&n.each([kt(-1),kt(1)],function(){var i,f,u=c[this],r=n.data(u,b);r&&r.href?(i=r.href,n.isFunction(i)&&(i=i.call(u))):i=n(u).attr("href"),i&&pi(r,i)&&(i=wi(r,i),f=t.createElement("img"),f.src=i)})):si.hide(),r.iframe){i=e("iframe")[0],s in i&&(i[s]=0),v in i&&(i[v]="true"),r.scrolling||(i.scrolling="no"),n(i).attr({src:r.href,name:+new Date,"class":h+"Iframe",allowFullScreen:!0,webkitAllowFullScreen:!0,mozallowfullscreen:!0}).one("load",o).appendTo(l);w.one(pt,function(){i.src="//about:blank"});r.fastIframe&&n(i).trigger("load")}else o();r.transition==="fade"?u.fadeTo(y,1,p):p()}},r.transition==="fade"?u.fadeTo(y,0,function(){s.position(0,v)}):s.position(y,v)}},s.next=function(){!lt&&c[1]&&(r.loop||c[a+1])&&(a=kt(1),dt(c[a]))},s.prev=function(){!lt&&c[1]&&(r.loop||a)&&(a=kt(-1),dt(c[a]))},s.close=function(){tt&&!at&&(at=!0,tt=!1,ft(ni,r.onCleanup),d.unbind("."+h),k.fadeTo(r.fadeOut||0,0),u.stop().fadeTo(r.fadeOut||0,0,function(){u.add(k).css({opacity:1,cursor:"auto"}).hide(),ft(pt),l.empty().remove(),setTimeout(function(){at=!1,ft(ti,r.onClosed)},1)}))},s.remove=function(){u&&(u.stop(),n.colorbox.close(),u.stop().remove(),k.remove(),at=!1,u=null,n("."+et).removeData(b).removeClass(et),n(t).unbind("click."+h))},s.element=function(){return n(v)},s.settings=gt)}(jQuery,document,window)