(function(){var D=false;var F={before:[],after:[]};var G={ESC:27,ENTER:13};function H(){if(D){return }var K=document;if(K.addEventListener){K.addEventListener("keypress",C,false)}else{if(K.attachEvent){K.documentElement.attachEvent("onkeypress",C)}}D=true}function I(K,L){var M=K.toLowerCase();if(M=="before"||M=="after"){F[M].push(L);return }M=G[K.toUpperCase()];if(!M){M=K.charCodeAt(0)}if(!F[M]){F[M]=[]}F[M].push(L)}function C(P){if(!P){P=window.event}var N=A(P);if(B(N)){return }var M=J(P);if(M==undefined){return }var O={code:M};for(var K=0;K0){return L.which}if(L.which==0){for(var K in G){if(L.keyCode==G[K]){return L.keyCode}}}}function E(K){return K.altKey||K.ctrlKey||K.shiftKey||K.metaKey}function A(L){var K=L.target;if(!K){K=L.srcElement}if(K.nodeType==3){K=K.parentNode}return K}function B(K){return K.tagName=="INPUT"||K.tagName=="TEXTAREA"}if(!window.kibbles){window.kibbles={}}window.kibbles.keys={listen:H,addKeyPressListener:I}})();(function(){var X=new Array();var L;var S={padding_top:0,padding_bottom:0,scroll_window:true};var T={PRE:"pre",POST:"post"};var F={pre:[],post:[]};function K(){X=new Array()}function A(b){return X[b]}function V(c,b){X[c]=b}function J(c,b){if(c<0||c>X.length-1){throw"Index out of bounds."}X.splice(c,0,b);if(c<=L){L++}}function E(b){X.push(b)}function N(b){if(b<0||b>X.length-1){throw"Index out of bounds."}X.splice(b,1);if(L>=b){L--}}function O(){return X.length}function P(b,c){S[b]=c}function M(b){kibbles.keys.addKeyPressListener(b,I)}function R(b){kibbles.keys.addKeyPressListener(b,C)}function D(c,b){if(c==T.PRE){F.pre.push(b)}else{if(c==T.POST){F.post.push(b)}}}function I(){Z(a())}function C(){Z(Q())}function Z(b){if(b>=0){var e=L;L=b;var c=new Y(b);var d=(e>=0)?new Y(e):undefined;U(c,d,F.pre);if(!c.y){c.y=H(c.element)}if(!c.y&&!(c.y>=0)){throw"Next stop does not y coords. Aborting."}U(c,d,F.post)}}function W(g,h){if(!G("scroll_window")){return }if(g&&g.element){var c=B();var e=c+document.documentElement.clientHeight;var b=G("padding_top");var d=e-b;if(g.y>d){window.scrollTo(0,g.y-b);return }var f=G("padding_bottom");var i=c+f;if(g.y=0){b=L+1}if(b>X.length-1){return }return b}function Q(){var b=X.length-1;if(L>=0){b=L-1}if(b<0){return }return b}function Y(b,c){this.index=b;this.element=X[b];this.y=H(this.element)}function H(c){if(c){var b=0;if(c.offsetParent){while(c.offsetParent){b+=c.offsetTop;c=c.offsetParent}}else{if(c.y){b+=c.y}}return b}return null}if(!window.kibbles.keys){throw"Kibbles.Skipper requires Kibbles.Keys which is not loaded. Can't continue."}window.kibbles.skipper={setOption:P,addFwdKey:M,addRevKey:R,LISTENER_TYPE:T,addStopListener:D,setCurrentStop:Z,get:A,set:V,append:E,insert:J,del:N,length:O,reset:K};D(kibbles.skipper.LISTENER_TYPE.POST,W);kibbles.keys.listen()})();