!function(a){function u(a,b,c){var n,d=a[0],g=/er/.test(c)?j:/bl/.test(c)?h:f,m=c==k?{checked:d[f],disabled:d[h],indeterminate:"true"==a.attr(j)||"false"==a.attr(i)}:d[g];if(/^(ch|di|in)/.test(c)&&!m)v(a,g);else if(/^(un|en|de)/.test(c)&&m)w(a,g);else if(c==k)for(n in m)m[n]?v(a,n,!0):w(a,n,!0);else b&&"toggle"!=c||(b||a[q]("ifClicked"),m?d[l]!==e&&w(a,g):v(a,g))}function v(d,k,m){var C,D,n=d[0],q=d.parent(),r=k==f,t=k==j,u=k==h,v=t?i:r?g:"enabled",x=y(d,v+z(n[l])),B=y(d,k+z(n[l]));n[k]!==!0&&(!m&&k==f&&n[l]==e&&n.name&&(C=d.closest("form"),D='input[name="'+n.name+'"]',D=C.length?C.find(D):a(D),D.each(function(){this!==n&&a(this).data(b)&&w(a(this),k)})),t?(n[k]=!0,n[f]&&w(d,f,"force")):(m||(n[k]=!0),r&&n[j]&&w(d,j,!1)),A(d,r,k,m)),n[h]&&y(d,s,!0)&&q.find("."+c).css(s,"default"),q[o](B||y(d,k)||""),q.attr("role")&&!t&&q.attr("aria-"+(u?h:f),"true"),q[p](x||y(d,v)||"")}function w(a,b,d){var e=a[0],k=a.parent(),m=b==f,n=b==j,q=b==h,r=n?i:m?g:"enabled",t=y(a,r+z(e[l])),u=y(a,b+z(e[l]));e[b]!==!1&&((n||!d||"force"==d)&&(e[b]=!1),A(a,m,r,d)),!e[h]&&y(a,s,!0)&&k.find("."+c).css(s,"pointer"),k[p](u||y(a,b)||""),k.attr("role")&&!n&&k.attr("aria-"+(q?h:f),"false"),k[o](t||y(a,r)||"")}function x(c,d){c.data(b)&&(c.parent().html(c.attr("style",c.data(b).s||"")),d&&c[q](d),c.off(".i").unwrap(),a(r+'[for="'+c[0].id+'"]').add(c.closest(r)).off(".i"))}function y(a,c,d){return a.data(b)?a.data(b).o[c+(d?"":"Class")]:void 0}function z(a){return a.charAt(0).toUpperCase()+a.slice(1)}function A(a,b,c,d){d||(b&&a[q]("ifToggled"),a[q]("ifChanged")[q]("if"+z(c)))}var b="espcms_checkbox",c=b+"-helper",d="checkbox",e="radio",f="checked",g="un"+f,h="disabled",i="determinate",j="in"+i,k="update",l="type",m="click",n="touchbegin.i touchend.i",o="addClass",p="removeClass",q="trigger",r="label",s="cursor",t=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);a.fn[b]=function(g,i){var A,B,C,D,E,F,G,H,s='input[type="'+d+'"], input[type="'+e+'"]',y=a(),z=function(b){b.each(function(){var b=a(this);y=b.is(s)?y.add(b):y.add(b.find(s))})};return/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(g)?(g=g.toLowerCase(),z(this),y.each(function(){var b=a(this);"destroy"==g?x(b,"ifDestroyed"):u(b,!0,g),a.isFunction(i)&&i()})):"object"!=typeof g&&g?this:(A=a.extend({checkedClass:f,disabledClass:h,indeterminateClass:j,labelHover:!0},g),B=A.handle,C=A.hoverClass||"hover",D=A.focusClass||"focus",E=A.activeClass||"active",F=!!A.labelHover,G=A.labelHoverClass||"hover",H=0|(""+A.increaseArea).replace("%",""),A.checkboxClass="espcms_checkbox_blue",A.radioClass="iradio_blue",(B==d||B==e)&&(s='input[type="'+B+'"]'),-50>H&&(H=-50),z(this),y.each(function(){var N,i,j,s,y,z,B,I,J,K,L,M,g=a(this);x(g),i=this,j=i.id,s=-H+"%",y=100+2*H+"%",z={position:"absolute",top:s,left:s,display:"block",width:y,height:y,margin:0,padding:0,background:"#fff",border:0,opacity:0},B=t?{position:"absolute",visibility:"hidden"}:H?z:{position:"absolute",opacity:0},I=i[l]==d?A.checkboxClass||"i"+d:A.radioClass||"i"+e,J=a(r+'[for="'+j+'"]').add(g.closest(r)),K=!!A.aria,L=b+"-"+Math.random().toString(36).substr(2,6),M='<div class="'+I+'" '+(K?'role="'+i[l]+'" ':""),K&&J.each(function(){M+='aria-labelledby="',this.id?M+=this.id:(this.id=L,M+=L),M+='"'}),M=g.wrap(M+"/>")[q]("ifCreated").parent().append(A.insert),N=a('<ins class="'+c+'"/>').css(z).appendTo(M),g.data(b,{o:A,s:g.attr("style")}).css(B),!!A.inheritClass&&M[o](i.className||""),!!A.inheritID&&j&&M.attr("id",b+"-"+j),"static"==M.css("position")&&M.css("position","relative"),u(g,!0,k),J.length&&J.on(m+".i mouseover.i mouseout.i "+n,function(b){var c=b[l],d=a(this);if(!i[h]){if(c==m){if(a(b.target).is("a"))return;u(g,!1,!0)}else F&&(/ut|nd/.test(c)?(M[p](C),d[p](G)):(M[o](C),d[o](G)));if(!t)return!1;b.stopPropagation()}}),g.on(m+".i focus.i blur.i keyup.i keydown.i keypress.i",function(a){var b=a[l],c=a.keyCode;return b==m?!1:"keydown"==b&&32==c?(i[l]==e&&i[f]||(i[f]?w(g,f):v(g,f)),!1):("keyup"==b&&i[l]==e?!i[f]&&v(g,f):/us|ur/.test(b)&&M["blur"==b?p:o](D),void 0)}),N.on(m+" mousedown mouseup mouseover mouseout "+n,function(a){var b=a[l],c=/wn|up/.test(b)?E:C;if(!i[h]){if(b==m?u(g,!1,!0):(/wn|er|in/.test(b)?M[o](c):M[p](c+" "+E),J.length&&F&&c==C&&J[/ut|nd/.test(b)?p:o](G)),!t)return!1;a.stopPropagation()}})}))}}(window.jQuery||window.Zepto);