Você está na página 1de 1

(function(){var E=false;var F={before:[],after:[]};var G={ESC:27,ENTER:13};funct

ion H(){if(E){return }var L=document;if(L.addEventListener){L.addEventListener("


keypress",D,false);L.addEventListener("keydown",I,false)}else{if(L.attachEvent){
L.documentElement.attachEvent("onkeypress",D);L.documentElement.attachEvent("onk
eydown",I)}}E=true}function J(L,M){var N=L.toLowerCase();if(N=="before"||N=="aft
er"){F[N].push(M);return }N=G[L.toUpperCase()];if(!N){N=L.charCodeAt(0)}if(!F[N]
){F[N]=[]}F[N].push(M)}function D(Q){if(!Q){Q=window.event}var O=A(Q);if(B(O)){r
eturn }if(C(Q)){return }var N=K(Q);if(N==undefined){return }var P={code:N};for(v
ar L=0;L<F.before.length;L++){F.before[L](P)}var M=F[N];if(M){for(var L=0;L<M.le
ngth;L++){M[L]({code:N})}}for(var L=0;L<F.after.length;L++){F.after[L](P)}}funct
ion I(M){if(!M){M=window.event}var L=K(M);if(L==G.ESC||L==G.ENTER){D(M)}}functio
n K(L){return L.keyCode?L.keyCode:L.which}function C(L){return L.altKey||L.ctrlK
ey||L.metaKey}function A(M){var L=M.target;if(!L){L=M.srcElement}if(L.nodeType==
3){L=L.parentNode}return L}function B(L){return L.tagName=="INPUT"||L.tagName=="
TEXTAREA"}if(!window.kibbles){window.kibbles={}}window.kibbles.keys={listen:H,ad
dKeyPressListener:J}})();(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.spli
ce(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())}funct
ion C(){Z(Q())}function Z(b){if(b>=0){var e=L;L=b;var c=new Y(b);var d=(e>=0)?ne
w Y(e):undefined;U(c,d,F.pre);if(!c.y){c.y=H(c.element)}if(!c.y&&!(c.y>=0)){thro
w"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.documentEle
ment.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<i){window.scrollTo(0,(g
.y-document.documentElement.clientHeight)+f);return }}}function B(){if(window.do
cument.body.scrollTop){return window.document.body.scrollTop}else{if(window.docu
ment.documentElement.scrollTop){return window.document.documentElement.scrollTop
}else{if(window.pageYOffset){return window.pageYOffset}}}return 0}function G(b){
var c=S[b];if(typeof c=="function"){return c()}return c}function U(c,f,d){if(c&&
d){try{for(var b=0;b<d.length;b++){d[b](c,f)}}catch(e){}}}function a(){var b=0;i
f(L>=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,addFw
dKey: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()})();

Você também pode gostar