text: !function(e,t,n){function o(t,n){this.element=t,this.settings=e.extend({},s,n),this._defaults=s,this._name=i,this.init(),this.startCCTV(),1==this.settings.lockout&&this.secureCCTV()}var i="cctv",s={code:0,lockout:!0};o.prototype={init:function(){e(this.element).append('<div id="cctv-holder"><div id="blinker-holder"><span id="blinker"></span></div><div id="cctv-body"></div><div id="cctv-head"></div></div>'),1==this.settings.lockout&&e(this.element).append('<section id="alarm"><section id="unlock-code"><h3>Hmm, looks like you\'re being nosy...</h3><h4>Enter the unlock code:</h4><input class="code-input" id="code1" autocomplete="off" size="1" maxlength="1" /><input class="code-input" id="code2" autocomplete="off" size="1" maxlength="1" /><input class="code-input" id="code3" autocomplete="off" size="1" maxlength="1" /><input class="code-input" id="code4" autocomplete="off" size="1" maxlength="1" /><input class="code-input" id="code5" autocomplete="off" size="1" maxlength="1" /><a href="#" id="alarm-code-submit">Unlock</a></section></section>')},startCCTV:function(){function o(){s>3&&e("#blinker").removeClass("on"),0===s&&e("#blinker").addClass("on"),s++}function i(t){var o=e("#cctv-head"),i=e("#blinker-holder"),s=e(n).height(),c=t/(s/80);-55>c&&(c=-55),o.css({transform:"rotate("+-c+"deg)"}),i.css({transform:"rotate("+-c+"deg)"})}{var s=0;setInterval(o,1e3)}e(this).mousemove(function(){s=0}),e(t).scroll(function(){var e=t.pageYOffset;i(e),s=0}),e(t).mousemove(function(){var e=t.pageYOffset;i(e),s=0})},secureCCTV:function(){function t(t){var n="",o=e("#code1").val(),i=e("#code2").val(),s=e("#code3").val(),c=e("#code4").val(),d=e("#code5").val();return 1==o.length&&(n+=o),1==i.length&&(n+=i),1==s.length&&(n+=s),1==c.length&&(n+=c),1==d.length&&(n+=d),5==n.length?(e("#alarm-code-submit").addClass("good"),5!=t.toString().length?!0:t==n?!0:!1):(e("#alarm-code-submit").removeClass("good"),!1)}function n(){e("#alarm").addClass("on"),e("#code1").focus()}function o(){e(".code-input").blur(),e(".code-input").val(""),e(".code-input").removeClass("bad"),e("#alarm").removeClass("on")}var i=this.element,s=this.settings.code;e(i).on("contextmenu",function(){return n(),!1}),e(".code-input").keydown(function(n){e(this).removeClass("bad");var i=n.charCode||n.keyCode||0;return(8==i||37==i||39==i)&&((0==e(this).val().length||37==i)&&e(this).prev("input").focus(),39==i&&e(this).next("input").focus()),13==n.keyCode&&(1==t(s)?o():(e(".code-input").blur(),e("#code1").focus(),e(".code-input").addClass("bad"),e(".code-input").val(""))),8==i||9==i||46==i||110==i||190==i||i>=35&&40>=i||i>=48&&57>=i||i>=96&&105>=i}),e(".code-input").keypress(function(){var t=String.fromCharCode(event.keyCode);/^[0-9]+$/.test(t)&&e(this).next("input").focus()}),e(".code-input").keyup(function(){setInterval(function(){t(s)},250)}),e("#alarm-code-submit").click(function(){return 1==t(s)?o():(e(".code-input").addClass("bad"),e(".code-input").val(""),e(this).removeClass("good")),!1})}},e.fn[i]=function(t){return this.each(function(){e.data(this,"plugin_"+i)||e.data(this,"plugin_"+i,new o(this,t))})}}(jQuery,window,document);