/*
 * @author    RocketTheme http://www.rockettheme.com
 * @copyright Copyright (C) 2007 - 2012 RocketTheme, LLC
 * @license   http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
 */
(function(c){var a={},b=function(f){var e=a[f];if(!e){e=a[f]={exports:{}};var d=e.exports;c[f].call(d,b,e,d,window);}return e.exports;};window.moofx=b("0");
})({"0":function(c,e,b,f){var a=c("1"),g=c("2");var d=typeof document!=="undefined"?c("3"):c("a");d.version="3.0.10";d.requestFrame=function(h){g.request(h);
return this;};d.cancelFrame=function(h){g.cancel(h);return this;};d.color=a;e.exports=d;},"1":function(k,e,y,s){var m={maroon:"#800000",red:"#ff0000",orange:"#ffA500",yellow:"#ffff00",olive:"#808000",purple:"#800080",fuchsia:"#ff00ff",white:"#ffffff",lime:"#00ff00",green:"#008000",navy:"#000080",blue:"#0000ff",aqua:"#00ffff",teal:"#008080",black:"#000000",silver:"#c0c0c0",gray:"#808080",transparent:"#0000"};
var d=function(B,A,c,z){if(z==null||z===""){z=1;}B=parseFloat(B);A=parseFloat(A);c=parseFloat(c);z=parseFloat(z);if(!(B<=255&&B>=0&&A<=255&&A>=0&&c<=255&&c>=0&&z<=1&&z>=0)){return null;
}return[Math.round(B),Math.round(A),Math.round(c),z];};var x=function(F){if(F.length===3){F+="f";}if(F.length===4){var E=F.charAt(0),D=F.charAt(1),B=F.charAt(2),z=F.charAt(3);
F=E+E+D+D+B+B+z+z;}if(F.length===6){F+="ff";}var A=[];for(var C=0,c=F.length;C<c;C+=2){A.push(parseInt(F.substr(C,2),16)/(C===6?255:1));}return A;};var n=function(A,z,c){if(c<0){c+=1;
}if(c>1){c-=1;}if(c<1/6){return A+(z-A)*6*c;}if(c<1/2){return z;}if(c<2/3){return A+(z-A)*(2/3-c)*6;}return A;};var a=function(C,G,B,F){var c,E,D;if(F==null||F===""){F=1;
}C/=360;G/=100;B/=100;F/=1;if(C>1||C<0||G>1||G<0||B>1||B<0||F>1||F<0){return null;}if(G===0){c=E=D=B;}else{var z=B<0.5?B*(1+G):B+G-B*G;var A=2*B-z;c=n(A,z,C+1/3);
D=n(A,z,C);E=n(A,z,C-1/3);}return[c*255,D*255,E*255,F];};var r=[];for(var v in m){r.push(v);}var o="(?:#([a-f0-9]{3,8}))",f="\\s*([.\\d%]+)\\s*",b="(?:,\\s*([.\\d]+)\\s*)?",u="\\("+[f,f,f]+b+"\\)",g="(?:rgb)a?",q="(?:hsl)a?",p="("+r.join("|")+")";
var h=RegExp(o,"i"),w=RegExp(g+u,"i"),j=RegExp(q+u,"i");var t=function(c,A){if(c==null){return null;}c=(c+"").replace(/\s+/,"");var z=m[c];if(z){return t(z,A);
}else{if(z=c.match(h)){c=x(z[1]);}else{if(z=c.match(w)){c=z.slice(1);}else{if(z=c.match(j)){c=a.apply(null,z.slice(1));}else{return null;}}}}if(!(c&&(c=d.apply(null,c)))){return null;
}if(A){return c;}if(c[3]===1){c.splice(3,1);}return"rgb"+(c.length===4?"a":"")+"("+c+")";};t.x=RegExp([p,o,g+u,q+u].join("|"),"gi");e.exports=t;},"2":function(c,b,f,a){var d=a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame||a.msRequestAnimationFrame||function(m){return setTimeout(m,1000/60);
};var j=[],h=false;var g=function(n){if(n==null){n=+(new Date);}h=false;for(var m=j.length;m--;){var o=j.shift();if(o){o(n);}}};var k=function(m){for(var n=j.length;
n--;){if(j[n]===m){j.splice(n,1);break;}}};var e=function(m){j.push(m);if(!h){h=true;d(g);}return function(){k(m);};};f.request=e;f.cancel=k;},"3":function(k,g,ag,c){var O=k("1"),b=k("2");
var ae=b.cancel,X=b.request;var E=k("4"),o=k("5"),z=k("7");var al=z.camelize,ab=z.clean,P=z.capitalize;var N=o.map,af=o.forEach,F=o.indexOf;var Y=k("9");
var H=k("a");var R={};var m=function(e){return R[e]||(R[e]=z.hyphenate(e));};var ai=function(e){return Math.round(e*1000)/1000;};var w=c.getComputedStyle?function(au){var e=getComputedStyle(au);
return function(av){return e?e.getPropertyValue(m(av)):"";};}:function(au){var e=au.currentStyle;return function(av){return e?e[al(av)]:"";};};var s=document.createElement("div");
var L="border:none;margin:none;padding:none;visibility:hidden;position:absolute;height:0;";var aj=function(au,e){var aw=au.parentNode,av=1;if(aw){s.style.cssText=L+("width:100"+e+";");
aw.appendChild(s);av=s.offsetWidth/100;aw.removeChild(s);}return av;};var I=function(e){var au=e.length;if(au===1){e.push(e[0],e[0],e[0]);}else{if(au===2){e.push(e[0],e[1]);
}else{if(au===3){e.push(e[1]);}}}return e;};var q="([-.\\d]+)(%|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vm)",t=q+"?",am="none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|inherit";
var d=RegExp(q,"g"),aq=RegExp(t),J=RegExp(t,"g"),C=RegExp(am);var V=function(e){return e==null?"":e+"";};var j=function(au,e){if(au==null||au===""){return e?"1":"";
}return isFinite(au=+au)?au<0?"0":au+"":"1";};try{s.style.color="rgba(0,0,0,0.5)";}catch(ao){}var ah=/^rgba/.test(s.style.color);var v=function(au,e){var ax="rgba(0,0,0,1)",aw;
if(!au||!(aw=O(au,true))){return e?ax:"";}if(e){return"rgba("+aw+")";}var av=aw[3];if(av===0){return"transparent";}return !ah||av===1?"rgb("+aw.slice(0,3)+")":"rgba("+aw+")";
};var aa=function(av,e){if(av==null||av===""){return e?"0px":"";}var au=z.match(av,aq);return au?au[1]+(au[2]||"px"):av;};var h=function(av,e){if(av==null||av===""){return e?"none":"";
}var au=av.match(C);return au?av:e?"none":"";};var U=function(aw,au){var ax="0px none rgba(0,0,0,1)";if(aw==null||aw===""){return au?ax:"";}if(aw===0||aw==="none"){return au?ax:aw+"";
}var ay;aw=aw.replace(O.x,function(az){ay=az;return"";});var av=aw.match(C),e=aw.match(J);return ab([aa(e?e[0]:"",au),h(av?av[0]:"",au),v(ay,au)].join(" "));
};var u=function(au,e){if(au==null||au===""){return e?"0px 0px 0px 0px":"";}return ab(I(N(ab(au).split(" "),function(av){return aa(av,e);})).join(" "));
};var a=function(aw,av,e){var ay="rgba(0,0,0,0)",ax=e===3?ay+" 0px 0px 0px":ay+" 0px 0px 0px 0px";if(aw==null||aw===""){return av?ax:"";}if(aw==="none"){return av?ax:aw;
}var au=[],aw=ab(aw).replace(O.x,function(az){au.push(az);return"";});return N(aw.split(","),function(aE,aB){var aD=v(au[aB],av),az=/inset/.test(aE),aC=aE.match(J)||["0px"];
aC=N(aC,function(aF){return aa(aF,av);});while(aC.length<e){aC.push("0px");}var aA=az?["inset",aD]:[aD];return aA.concat(aC).join(" ");}).join(", ");};
var G=function(au,e){if(au==null||au===""){return"";}return au.replace(O.x,function(av){return v(av,e);}).replace(d,function(av){return aa(av,e);});};var p={},r={},y={},S={};
var M=function(e){return p[e]||(p[e]=function(){var au=S[e]||e,av=y[e]||G;return function(){return av(w(this)(au),true);};}());};var Z=function(e){return r[e]||(r[e]=function(){var au=S[e]||e,av=y[e]||G;
return function(aw){this.style[au]=av(aw,false);};}());};var A=["Top","Right","Bottom","Left"],at=["TopLeft","TopRight","BottomRight","BottomLeft"];af(A,function(au){var e="border"+au;
af(["margin"+au,"padding"+au,e+"Width",au.toLowerCase()],function(av){y[av]=aa;});y[e+"Color"]=v;y[e+"Style"]=h;y[e]=U;p[e]=function(){return[M(e+"Width").call(this),M(e+"Style").call(this),M(e+"Color").call(this)].join(" ");
};});af(at,function(e){y["border"+e+"Radius"]=aa;});y.color=y.backgroundColor=v;y.width=y.height=y.fontSize=y.backgroundSize=aa;af(["margin","padding"],function(e){y[e]=u;
p[e]=function(){return N(A,function(au){return M(e+au).call(this);},this).join(" ");};});y.borderWidth=u;y.borderStyle=function(au,e){if(au==null||au===""){return e?I(["none"]).join(" "):"";
}au=ab(au).split(" ");return ab(I(N(au,function(av){h(av,e);})).join(" "));};y.borderColor=function(au,e){if(!au||!(au=z.match(au,O.x))){return e?I(["rgba(0,0,0,1)"]).join(" "):"";
}return ab(I(N(au,function(av){return v(av,e);})).join(" "));};af(["Width","Style","Color"],function(e){p["border"+e]=function(){return N(A,function(au){return M("border"+au+e).call(this);
},this).join(" ");};});y.borderRadius=u;p.borderRadius=function(){return N(at,function(e){return M("border"+e+"Radius").call(this);},this).join(" ");};
y.border=U;p.border=function(){var av;for(var e=0;e<A.length;e++){var au=M("border"+A[e]).call(this);if(av&&au!==av){return null;}av=au;}return av;};y.zIndex=V;
y.opacity=j;var ac=s.style.MsFilter!=null&&"MsFilter"||s.style.filter!=null&&"filter";if(ac&&s.style.opacity==null){var x=/alpha\(opacity=([\d.]+)\)/i;
r.opacity=function(au){au=(au=j(au))==="1"?"":"alpha(opacity="+Math.round(au*100)+")";var e=w(this)(ac);return this.style[ac]=x.test(e)?e.replace(x,au):e+" "+au;
};p.opacity=function(){var e=w(this)(ac).match(x);return(!e?1:e[1]/100)+"";};}var Q=y.boxShadow=function(au,e){return a(au,e,4);};var K=y.textShadow=function(au,e){return a(au,e,3);
};af(["Webkit","Moz","ms","O",null],function(e){af(["transition","transform","transformOrigin","transformStyle","perspective","perspectiveOrigin","backfaceVisibility"],function(au){var av=e?e+P(au):au;
if(e==="ms"){R[av]="-ms-"+m(au);}if(s.style[av]!=null){S[au]=av;}});});var n=S.transition,D=S.transform;if(n==="OTransition"){n=null;}var ad,W;if(!n&&D){(function(){var ax=k("c");
var au="\\s*([-\\d\\w.]+)\\s*";var aw=RegExp("matrix\\("+[au,au,au,au,au,au]+"\\)");var az=function(aB){var aC=ax.apply(null,aB.match(aw).slice(1))||[[0,0],0,0,[0,0]];
return["translate("+N(aC[0],function(aD){return ai(aD)+"px";})+")","rotate("+ai(aC[1]*180/Math.PI)+"deg)","skewX("+ai(aC[2]*180/Math.PI)+"deg)","scale("+N(aC[3],ai)+")"].join(" ");
};var av=function(aB){return aB||"0px";},e=function(aB){return aB||"1";},aA=function(aB){return aB||"0deg";};var ay={translate:function(aC){if(!aC){aC="0px,0px";
}var aB=aC.split(",");if(!aB[1]){aB[1]="0px";}return N(aB,ab)+"";},translateX:av,translateY:av,scale:function(aC){if(!aC){aC="1,1";}var aB=aC.split(",");
if(!aB[1]){aB[1]=aB[0];}return N(aB,ab)+"";},scaleX:e,scaleY:e,rotate:aA,skewX:aA,skewY:aA};W=E({constructor:function(aC){var aD=this.names=[];var aB=this.values=[];
aC.replace(/(\w+)\(([-.\d\s\w,]+)\)/g,function(aF,aE,aG){aD.push(aE);aB.push(aG);});},identity:function(){var aB=[];af(this.names,function(aC){var aD=ay[aC];
if(aD){aB.push(aC+"("+aD()+")");}});return aB.join(" ");},sameType:function(aB){return this.names.toString()===aB.names.toString();},decompose:function(){var aC=this.toString();
s.style.cssText=L+m(D)+":"+aC+";";document.body.appendChild(s);var aB=w(s)(D);if(!aB||aB==="none"){aB="matrix(1, 0, 0, 1, 0, 0)";}document.body.removeChild(s);
return az(aB);}});W.prototype.toString=function(aC){var aB=this.values,aD=[];af(this.names,function(aE,aF){var aG=ay[aE];if(!aG){return;}var aH=aG(aB[aF]);
if(!aC||aH!==aG()){aD.push(aE+"("+aH+")");}});return aD.length?aD.join(" "):"none";};W.union=function(aE,aD){if(aE===aD){return;}var aB,aC;if(aE==="none"){aC=new W(aD);
aD=aC.toString();aE=aC.identity();aB=new W(aE);}else{if(aD==="none"){aB=new W(aE);aE=aB.toString();aD=aB.identity();aC=new W(aD);}else{aB=new W(aE);aE=aB.toString();
aC=new W(aD);aD=aC.toString();}}if(aE===aD){return;}if(!aB.sameType(aC)){aE=aB.decompose();aD=aC.decompose();}if(aE===aD){return;}return[aE,aD];};ad=y.transform=function(aB){if(!aB||aB==="none"){return"none";
}return(new W(aw.test(aB)?az(aB):aB)).toString(true);};p.transform=function(){var aB=this.style;return aB[D]||(aB[D]=ad(w(this)(D)));};})();}var ap=function(av,aw,az){var ay=y[aw]||G,ax=M(aw).call(av),az=ay(az,true);
if(ax===az){return;}if(ay===aa||ay===U||ay===u){var e=az.match(d),au=0;if(e){ax=ax.replace(d,function(aD,aG,aE){var aA=e[au++],aF=aA.match(aq),aC=aF[2];
if(aE!==aC){var aB=aE==="px"?aG:aj(av,aE)*aG;return ai(aB/aj(av,aC))+aC;}return aD;});}if(au>0){Z(aw).call(av,ax);}}else{if(ay===ad){return W.union(ax,az);
}}return ax!==az?[ax,az]:null;};var T=E({inherits:H,constructor:function T(av,aw){var au=M(aw),e=Z(aw);this.get=function(){return au.call(av);};this.set=function(ax){return e.call(av,ax);
};T.parent.constructor.call(this,this.set);this.node=av;this.property=aw;}});var ak;ak=E({inherits:T,constructor:function ak(){return ak.parent.constructor.apply(this,arguments);
},start:function(av){this.stop();if(this.duration===0){this.cancel(av);return this;}var e=ap(this.node,this.property,av);if(!e){this.cancel(av);return this;
}ak.parent.start.apply(this,e);if(!this.cancelStep){return this;}var au=y[this.property]||G;if((au===Q||au===K||au===G)&&this.templateFrom!==this.templateTo){this.cancelStep();
delete this.cancelStep;this.cancel(av);}return this;},parseEquation:function(e){if(typeof e==="string"){return ak.parent.parseEquation.call(this,e);}}});
var ar=function(aw,au,e,ax){var av=F(au,aw);if(av!==-1){au.splice(av,1);e.splice(av,1);ax.splice(av,1);}};var an=E({inherits:T,constructor:function an(au,av){an.parent.constructor.call(this,au,av);
this.hproperty=m(S[av]||av);var e=this;this.bSetTransitionCSS=function(aw){e.setTransitionCSS(aw);};this.bSetStyleCSS=function(aw){e.setStyleCSS(aw);};
this.bComplete=function(){e.complete();};},start:function(au){this.stop();if(this.duration===0){this.cancel(au);return this;}var e=ap(this.node,this.property,au);
if(!e){this.cancel(au);return this;}this.to=e[1];this.cancelSetTransitionCSS=X(this.bSetTransitionCSS);return this;},setTransitionCSS:function(e){delete this.cancelSetTransitionCSS;
this.resetCSS(true);this.cancelSetStyleCSS=X(this.bSetStyleCSS);},setStyleCSS:function(au){delete this.cancelSetStyleCSS;var e=this.duration;this.cancelComplete=setTimeout(this.bComplete,e);
this.endTime=au+e;this.set(this.to);},complete:function(){delete this.cancelComplete;this.resetCSS();this.callback(this.endTime);},stop:function(e){if(this.cancelExit){this.cancelExit();
delete this.cancelExit;}else{if(this.cancelSetTransitionCSS){this.cancelSetTransitionCSS();delete this.cancelSetTransitionCSS;}else{if(this.cancelSetStyleCSS){this.cancelSetStyleCSS();
delete this.cancelSetStyleCSS;if(e){this.resetCSS();}}else{if(this.cancelComplete){clearTimeout(this.cancelComplete);delete this.cancelComplete;if(e){this.resetCSS();
this.set(this.get());}}}}}return this;},resetCSS:function(au){var ay=w(this.node),ax=ay(n+"Property").replace(/\s+/g,"").split(","),aw=ay(n+"Duration").replace(/\s+/g,"").split(","),e=ay(n+"TimingFunction").replace(/\s+/g,"").match(/cubic-bezier\([\d-.,]+\)/g);
ar("all",ax,aw,e);ar(this.hproperty,ax,aw,e);if(au){ax.push(this.hproperty);aw.push(this.duration+"ms");e.push("cubic-bezier("+this.equation+")");}var av=this.node.style;
av[n+"Property"]=ax;av[n+"Duration"]=aw;av[n+"TimingFunction"]=e;},parseEquation:function(e){if(typeof e==="string"){return an.parent.parseEquation.call(this,e,true);
}}});var f=n?an:ak;var B=function(e,au){return typeof e==="function"?H(e):Y(e,au);};Y.implement({animate:function(aw,au,e){var aC=aw,aD=au;if(typeof aw==="string"){aC={};
aC[aw]=au;aD=e;}if(aD==null){aD={};}var ay=typeof aD;aD=ay==="function"?{callback:aD}:ay==="string"||ay==="number"?{duration:aD}:aD;var aB=aD.callback||function(){},ax=0,av=0;
aD.callback=function(aE){if(++ax===av){aB(aE);}};for(var aA in aC){var az=aC[aA],aA=al(aA);this.handle(function(aF){av++;var aE=this._animations||(this._animations={});
var aG=aE[aA]||(aE[aA]=new f(aF,aA));aG.setOptions(aD).start(az);});}return this;},style:function(e,ay){var au=e;if(typeof e==="string"){au={};au[e]=ay;
}for(var aw in au){var av=au[aw],ax=Z(aw=al(aw));this.handle(function(aA){var az=this._animations,aB;if(az&&(aB=az[aw])){aB.stop(true);}ax.call(aA,av);
});}return this;},compute:function(av){av=al(av);var e=this[0];if(av==="transform"&&ad){return w(e)(D);}var au=M(av).call(e);return au!=null?au.replace(d,function(aw,ay,ax){return ax==="px"?aw:aj(e,ax)*ay+"px";
}):"";}});B.parse=function(av,au,e){return(y[al(av)]||G)(au,e);};g.exports=B;},"4":function(g,d,h,c){var n=function(o,p){return Object.hasOwnProperty.call(o,p);
};var m=function(o,r,q){for(var p in o){if(r.call(q,o[p],p,o)===false){break;}}return o;};if(!{valueOf:0}.propertyIsEnumerable("valueOf")){var f="constructor,toString,valueOf,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString".split(","),k=Object.prototype;
m=function(o,t,r){var q=f.length,p,s;for(p in o){if(t.call(r,o[p],p,o)===false){return o;}}while(q--){p=f[q];s=o[p];if(s!==k[p]&&t.call(r,s,p,o)===false){break;
}}return o;};}var j=Object.create||function(o){var p=function(){};p.prototype=o;return new p;};var e=function(o,p){this.prototype[o]=p;};var b=function(o){m(o,function(q,p){if(p!=="constructor"&&p!=="inherits"&&p!=="mutator"){this.mutator(p,q);
}},this);return this;};var a=function(p){var q=p.inherits,s;if(q){s=q.prototype;}var o=n(p,"constructor")?p.constructor:q?function(){return s.constructor.apply(this,arguments);
}:function(){};if(q){var r=o.prototype=j(s);o.parent=s;r.constructor=o;}o.mutator=p.mutator||q&&q.mutator||e;o.implement=b;return o.implement(p);};a.each=m;
a.has=n;a.create=j;d.exports=a;},"5":function(e,d,g,c){var k=e("6");var j=Array.prototype;var m=k({filter:j.filter||function(s,r){var q=[];for(var p=0,o=this.length>>>0;
p<o;p++){if(p in this){var t=this[p];if(s.call(r,t,p,this)){q.push(t);}}}return q;},indexOf:j.indexOf||function(q,r){for(var o=this.length>>>0,p=r<0?Math.max(0,o+r):r||0;
p<o;p++){if(p in this&&this[p]===q){return p;}}return -1;},map:j.map||function(s,r){var t=this.length>>>0,q=Array(t);for(var p=0,o=t;p<o;p++){if(p in this){q[p]=s.call(r,this[p],p,this);
}}return q;},forEach:j.forEach||function(r,q){for(var p=0,o=this.length>>>0;p<o;p++){if(p in this){r.call(q,this[p],p,this);}}},every:j.every||function(r,q){for(var p=0,o=this.length>>>0;
p<o;p++){if(p in this&&!r.call(q,this[p],p,this)){return false;}}return true;},some:j.some||function(r,q){for(var p=0,o=this.length>>>0;p<o;p++){if(p in this&&r.call(q,this[p],p,this)){return true;
}}return false;}});m.isArray=Array.isArray||function(o){return Object.prototype.toString.call(o)==="[object Array]";};var f={};var n="pop,push,reverse,shift,sort,splice,unshift,concat,join,slice,lastIndexOf,reduce,reduceRight".split(",");
for(var h=0,b,a;b=n[h++];){if(a=j[b]){f[b]=a;}}m.implement(f);d.exports=m;},"6":function(b,e,a,f){var d=b("4"),g=Array.prototype.slice;var c=d({mutator:function(h,j){this[h]=function(k){var m=arguments.length>1?g.call(arguments,1):[];
return j.apply(k,m);};this.prototype[h]=j;},constructor:{prototype:{}}});e.exports=function(h){var j=h.inherits||(h.inherits=c);h.constructor=d.create(j);
return d(h);};},"7":function(c,e,a,f){var d=c("6");var b=d({inherits:c("8"),contains:function(g,h){return(h?(h+this+h).indexOf(h+g+h):(this+"").indexOf(g))>-1;
},clean:function(){return b.trim((this+"").replace(/\s+/g," "));},camelize:function(){return(this+"").replace(/-\D/g,function(g){return g.charAt(1).toUpperCase();
});},hyphenate:function(){return(this+"").replace(/[A-Z]/g,function(g){return"-"+g.toLowerCase();});},capitalize:function(){return(this+"").replace(/\b[a-z]/g,function(g){return g.toUpperCase();
});},escape:function(){return(this+"").replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1");},number:function(){return parseFloat(this);}});if(typeof JSON!=="undefined"){b.implement({decode:function(){return JSON.parse(this);
}});}e.exports=b;},"8":function(e,d,g,c){var m=e("6");var j=String.prototype;var k=m({trim:j.trim||function(){return(this+"").replace(/^\s+|\s+$/g,"");
}});var f={};var n="charAt,charCodeAt,concat,indexOf,lastIndexOf,match,quote,replace,search,slice,split,substr,substring,toLowerCase,toUpperCase".split(",");
for(var h=0,b,a;b=n[h++];){if(a=j[b]){f[b]=a;}}k.implement(f);d.exports=k;},"9":function(g,f,h,e){var c=g("4");var n=0;var a=function(q){return q===e?"global":q.uniqueNumber||(q.uniqueNumber="n:"+(n++).toString(36));
};var b={};var p,k;var j=c({constructor:function d(s,r){if(s==null){return null;}if(s instanceof o){return s;}var A=new o;if(s.nodeType||s===e){A[A.length++]=s;
}else{if(typeof s==="string"){if(p){p(s,r,A);}}else{if(s.length){var z={};for(var x=0,u=s.length;x<u;x++){var q=j(s[x],r);if(q&&q.length){for(var w=0,v=q.length;
w<v;w++){var t=q[w],y=a(t);if(!z[y]){A[A.length++]=t;z[y]=true;}}}}if(k&&A.length>1){k(A);}}}}if(!A.length){return null;}if(A.length===1){var y=a(A[0]);
return b[y]||(b[y]=A);}return A;}});var o=c({inherits:j,constructor:function o(){this.length=0;},handle:function m(v){var q=[],u=this.length;if(u===1){var s=v.call(this,this[0],0,q);
if(s!=null&&s!==false&&s!==true){q.push(s);}}else{for(var r=0;r<u;r++){var t=this[r],s=v.call(j(t),t,r,q);if(s===false||s===true){break;}if(s!=null){q.push(s);
}}}return q;}});j.use=function(q){j.implement(c.create(q.prototype));if(q.search){p=q.search;}if(q.sort){k=q.sort;}return this;};f.exports=j;},a:function(h,b,t,p){var c=h("4"),a=h("2").request,m=h("b");
var s=h("5").map;var g="([\\d.]+)(s|ms)?",k="cubic-bezier\\(([-.\\d]+),([-.\\d]+),([-.\\d]+),([-.\\d]+)\\)";var r=RegExp(g),e=RegExp(k),o=RegExp(k,"g");
var j={"default":"cubic-bezier(0.25, 0.1, 0.25, 1.0)",linear:"cubic-bezier(0, 0, 1, 1)","ease-in":"cubic-bezier(0.42, 0, 1.0, 1.0)","ease-out":"cubic-bezier(0, 0, 0.58, 1.0)","ease-in-out":"cubic-bezier(0.42, 0, 0.58, 1.0)"};
j.ease=j["default"];var q=function(w,v,u){return(v-w)*u+w;};var n=function(v){var u=[];var w=(v+"").replace(/[-.\d]+/g,function(x){u.push(+x);return"@";
});return[u,w];};var f=c({constructor:function f(w,v){this.setOptions(v);this.render=w||function(){};var u=this;this.bStep=function(x){return u.step(x);
};this.bExit=function(x){u.exit(x);};},setOptions:function(u){if(u==null){u={};}if(!(this.duration=this.parseDuration(u.duration||"500ms"))){throw new Error("invalid duration");
}if(!(this.equation=this.parseEquation(u.equation||"default"))){throw new Error("invalid equation");}this.callback=u.callback||function(){};return this;
},parseDuration:function(w){if(w=(w+"").match(r)){var v=+w[1],u=w[2]||"ms";if(u==="s"){return v*1000;}if(u==="ms"){return v;}}},parseEquation:function(v,x){var w=typeof v;
if(w==="function"){return v;}else{if(w==="string"){v=j[v]||v;var u=v.replace(/\s+/g,"").match(e);if(u){v=s(u.slice(1),function(y){return +y;});if(x){return v;
}if(v.toString()==="0,0,1,1"){return function(y){return y;};}w="object";}}}if(w==="object"){return m(v[0],v[1],v[2],v[3],1000/60/this.duration/4);}},cancel:function(u){this.to=u;
this.cancelExit=a(this.bExit);},exit:function(u){this.render(this.to);delete this.cancelExit;this.callback(u);},start:function(z,y){this.stop();if(this.duration===0){this.cancel(y);
return this;}this.isArray=false;this.isNumber=false;var x=typeof z,w=typeof y;if(x==="object"&&w==="object"){this.isArray=true;}else{if(x==="number"&&w==="number"){this.isNumber=true;
}}var v=n(z),u=n(y);this.from=v[0];this.to=u[0];this.templateFrom=v[1];this.templateTo=u[1];if(this.from.length!==this.to.length||this.from.toString()===this.to.toString()){this.cancel(y);
return this;}delete this.time;this.length=this.from.length;this.cancelStep=a(this.bStep);return this;},stop:function(){if(this.cancelExit){this.cancelExit();
delete this.cancelExit;}else{if(this.cancelStep){this.cancelStep();delete this.cancelStep;}}return this;},step:function(u){this.time||(this.time=u);var z=(u-this.time)/this.duration;
if(z>1){z=1;}var C=this.equation(z),A=this.from,B=this.to,y=this.templateTo;for(var w=0,v=this.length;w<v;w++){var x=A[w],D=B[w];y=y.replace("@",D!==x?q(x,D,C):D);
}this.render(this.isArray?y.split(","):this.isNumber?+y:y);if(z!==1){this.cancelStep=a(this.bStep);}else{delete this.cancelStep;this.callback(u);}}});var d=function(v){var u=new f(v);
return{start:function(z,y,w){var x=typeof w;u.setOptions(x==="function"?{callback:w}:x==="string"||x==="number"?{duration:w}:w).start(z,y);return this;
},stop:function(){u.stop();return this;}};};d.prototype=f.prototype;b.exports=d;},b:function(b,c,a,d){c.exports=function(h,k,f,j,n){var g=function(p){var o=1-p;
return 3*o*o*p*h+3*o*p*p*f+p*p*p;};var e=function(p){var o=1-p;return 3*o*o*p*k+3*o*p*p*j+p*p*p;};var m=function(p){var o=1-p;return 3*(2*(p-1)*p+o*o)*h+3*(-p*p*p+2*o*p)*f;
};return function(r){var o=r,w,v,s,p,u,q;for(s=o,q=0;q<8;q++){p=g(s)-o;if(Math.abs(p)<n){return e(s);}u=m(s);if(Math.abs(u)<0.000001){break;}s=s-p/u;}w=0,v=1,s=o;
if(s<w){return e(w);}if(s>v){return e(v);}while(w<v){p=g(s);if(Math.abs(p-o)<n){return e(s);}if(o>p){w=s;}else{v=s;}s=(v-w)*0.5+w;}return e(s);};};},c:function(e,d,f,b){var c=function(k){return Math.sqrt(k[0]*k[0]+k[1]*k[1]);
};var g=function(m){var k=c(m);return k?[m[0]/k,m[1]/k]:[0,0];};var a=function(m,k){return m[0]*k[0]+m[1]*k[1];};var j=Math.atan2;var h=function(m,k,o,n){return[o*m[0]+n*k[0],o*m[1]+n*k[1]];
};d.exports=function(v,u,t,s,r,q){if(v*s-u*t===0){return false;}var k=[r,q];var n=[[v,u],[t,s]];var o=[c(n[0])];n[0]=g(n[0]);var w=a(n[0],n[1]);n[1]=h(n[1],n[0],1,-w);
o[1]=c(n[1]);w/=o[1];var p=j(n[0][1],n[0][0]);return[k,p,w,o];};}});
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
window.matchMedia=window.matchMedia||(function(n,m){var p,j=n.documentElement,h=j.firstElementChild||j.firstChild,o=n.createElement("body"),k=n.createElement("div");
k.id="mq-test-1";k.style.cssText="position:absolute;top:-100em";o.style.background="none";o.appendChild(k);return function(a){k.innerHTML='&shy;<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>';
j.insertBefore(o,h);p=k.offsetWidth==42;j.removeChild(o);return{matches:p,media:a};};})(document);
/*! Respond.js v1.1.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs  */
(function(P){P.respond={};
respond.update=function(){};respond.mediaQueriesSupported=P.matchMedia&&P.matchMedia("only all").matches;if(respond.mediaQueriesSupported){return;}var x=P.document,B=x.documentElement,L=[],J=[],D=[],F={},M=30,O=x.getElementsByTagName("head")[0]||B,N=x.getElementsByTagName("base")[0],S=O.getElementsByTagName("link"),Q=[],T=function(){var c=S,g=c.length,f=0,b,e,d,a;
for(;f<g;f++){b=c[f],e=b.href,d=b.media,a=b.rel&&b.rel.toLowerCase()==="stylesheet";if(!!e&&a&&!F[e]){if(b.styleSheet&&b.styleSheet.rawCssText){H(b.styleSheet.rawCssText,e,d);
F[e]=true;}else{if((!/^([a-zA-Z:]*\/\/)/.test(e)&&!N)||e.replace(RegExp.$1,"").split("/")[0]===P.location.host){Q.push({href:e,media:d});}}}}z();},z=function(){if(Q.length){var a=Q.shift();
G(a.href,function(b){H(b,a.href,a.media);F[a.href]=true;z();});}},H=function(j,h,e){var m=j.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),g=m&&m.length||0,h=h.substring(0,h.lastIndexOf("/")),f=function(p){return p.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+h+"$2$3");
},d=!g&&e,a=0,b,o,n,c,k;if(h.length){h+="/";}if(d){g=1;}for(;a<g;a++){b=0;if(d){o=e;J.push(f(j));}else{o=m[a].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1;
J.push(RegExp.$2&&f(RegExp.$2));}c=o.split(",");k=c.length;for(;b<k;b++){n=c[b];L.push({media:n.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:J.length-1,hasquery:n.indexOf("(")>-1,minw:n.match(/\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:n.match(/\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")});
}}K();},I,C,y=function(){var c,b=x.createElement("div"),a=x.body,d=false;b.style.cssText="position:absolute;font-size:1em;width:1em";if(!a){a=d=x.createElement("body");
a.style.background="none";}a.appendChild(b);B.insertBefore(a,B.firstChild);c=b.offsetWidth;if(d){B.removeChild(a);}else{a.removeChild(b);}c=E=parseFloat(c);
return c;},E,K=function(n){var m="clientWidth",c=B[m],o=x.compatMode==="CSS1Compat"&&c||x.body[m]||c,a={},p=S[S.length-1],g=(new Date()).getTime();if(n&&I&&g-I<M){clearTimeout(C);
C=setTimeout(K,M);return;}else{I=g;}for(var r in L){var j=L[r],b=j.minw,k=j.maxw,d=b===null,f=k===null,h="em";if(!!b){b=parseFloat(b)*(b.indexOf(h)>-1?(E||y()):1);
}if(!!k){k=parseFloat(k)*(k.indexOf(h)>-1?(E||y()):1);}if(!j.hasquery||(!d||!f)&&(d||o>=b)&&(f||o<=k)){if(!a[j.media]){a[j.media]=[];}a[j.media].push(J[j.rules]);
}}for(var r in D){if(D[r]&&D[r].parentNode===O){O.removeChild(D[r]);}}for(var r in a){var e=x.createElement("style"),q=a[r].join("\n");e.type="text/css";
e.media=r;O.insertBefore(e,p.nextSibling);if(e.styleSheet){e.styleSheet.cssText=q;}else{e.appendChild(x.createTextNode(q));}D.push(e);}},G=function(a,b){var c=R();
if(!c){return;}c.open("GET",a,true);c.onreadystatechange=function(){if(c.readyState!=4||c.status!=200&&c.status!=304){return;}b(c.responseText);};if(c.readyState==4){return;
}c.send(null);},R=(function(){var a=false;try{a=new XMLHttpRequest();}catch(b){a=new ActiveXObject("Microsoft.XMLHTTP");}return function(){return a;};})();
T();respond.update=T;function A(){K(true);}if(P.addEventListener){P.addEventListener("resize",A,false);}else{if(P.attachEvent){P.attachEvent("onresize",A);
}}})(this);(function(g){if(!g||!(g.toJSON||Object.toJSON||window.JSON)){throw new Error("jQuery, MooTools or Prototype needs to be loaded before jStorage!");
}var h={},e={jStorage:"{}"},j=null,m=0,p=g.toJSON||Object.toJSON||(window.JSON&&(JSON.encode||JSON.stringify)),f=g.evalJSON||(window.JSON&&(JSON.decode||JSON.parse))||function(r){return String(r).evalJSON();
},k=false,o,d={isXML:function(s){var r=(s?s.ownerDocument||s:0).documentElement;return r?r.nodeName!=="HTML":false;},encode:function(s){if(!this.isXML(s)){return false;
}try{return new XMLSerializer().serializeToString(s);}catch(r){try{return s.xml;}catch(t){}}return false;},decode:function(s){var r=("DOMParser" in window&&(new DOMParser()).parseFromString)||(window.ActiveXObject&&function(u){var v=new ActiveXObject("Microsoft.XMLDOM");
v.async="false";v.loadXML(u);return v;}),t;if(!r){return false;}t=r.call("DOMParser" in window&&(new DOMParser())||window,s,"text/xml");return this.isXML(t)?t:false;
}};function n(){var r=false;if("localStorage" in window){try{window.localStorage.setItem("_tmptest","tmpval");r=true;window.localStorage.removeItem("_tmptest");
}catch(s){}}if(r){try{if(window.localStorage){e=window.localStorage;k="localStorage";}}catch(w){}}else{if("globalStorage" in window){try{if(window.globalStorage){e=window.globalStorage[window.location.hostname];
k="globalStorage";}}catch(v){}}else{j=document.createElement("link");if(j.addBehavior){j.style.behavior="url(#default#userData)";document.getElementsByTagName("head")[0].appendChild(j);
j.load("jStorage");var u="{}";try{u=j.getAttribute("jStorage");}catch(t){}e.jStorage=u;k="userDataBehavior";}else{j=null;return;}}}b();q();}function b(){if(e.jStorage){try{h=f(String(e.jStorage));
}catch(r){e.jStorage="{}";}}else{e.jStorage="{}";}m=e.jStorage?String(e.jStorage).length:0;}function c(){try{e.jStorage=p(h);if(j){j.setAttribute("jStorage",e.jStorage);
j.save("jStorage");}m=e.jStorage?String(e.jStorage).length:0;}catch(r){}}function a(r){if(!r||(typeof r!="string"&&typeof r!="number")){throw new TypeError("Key name must be string or numeric");
}if(r=="__jstorage_meta"){throw new TypeError("Reserved key name");}return true;}function q(){var v,r,t,s=Infinity,u=false;clearTimeout(o);if(!h.__jstorage_meta||typeof h.__jstorage_meta.TTL!="object"){return;
}v=+new Date();t=h.__jstorage_meta.TTL;for(r in t){if(t.hasOwnProperty(r)){if(t[r]<=v){delete t[r];delete h[r];u=true;}else{if(t[r]<s){s=t[r];}}}}if(s!=Infinity){o=setTimeout(q,s-v);
}if(u){c();}}g.jStorage={version:"0.1.6.1",set:function(r,s){a(r);if(d.isXML(s)){s={_is_xml:true,xml:d.encode(s)};}else{if(typeof s=="function"){s=null;
}else{if(s&&typeof s=="object"){s=f(p(s));}}}h[r]=s;c();return s;},get:function(r,s){a(r);if(r in h){if(h[r]&&typeof h[r]=="object"&&h[r]._is_xml&&h[r]._is_xml){return d.decode(h[r].xml);
}else{return h[r];}}return typeof(s)=="undefined"?null:s;},deleteKey:function(r){a(r);if(r in h){delete h[r];if(h.__jstorage_meta&&typeof h.__jstorage_meta.TTL=="object"&&r in h.__jstorage_meta.TTL){delete h.__jstorage_meta.TTL[r];
}c();return true;}return false;},setTTL:function(s,r){var t=+new Date();a(s);r=Number(r)||0;if(s in h){if(!h.__jstorage_meta){h.__jstorage_meta={};}if(!h.__jstorage_meta.TTL){h.__jstorage_meta.TTL={};
}if(r>0){h.__jstorage_meta.TTL[s]=t+r;}else{delete h.__jstorage_meta.TTL[s];}c();q();return true;}return false;},flush:function(){h={};c();return true;
},storageObj:function(){function r(){}r.prototype=h;return new r();},index:function(){var r=[],s;for(s in h){if(h.hasOwnProperty(s)&&s!="__jstorage_meta"){r.push(s);
}}return r;},storageSize:function(){return m;},currentBackend:function(){return k;},storageAvailable:function(){return !!k;},reInit:function(){var r,t;
if(j&&j.addBehavior){r=document.createElement("link");j.parentNode.replaceChild(r,j);j=r;j.style.behavior="url(#default#userData)";document.getElementsByTagName("head")[0].appendChild(j);
j.load("jStorage");t="{}";try{t=j.getAttribute("jStorage");}catch(s){}e.jStorage=t;k="userDataBehavior";}b();}};n();})(!window.MooTools?window.jQuery:window.$);
function style_html(q,c){var u,n,m,e,f;c=c||{};n=c.indent_size||4;m=c.indent_char||" ";f=c.brace_style||"collapse";e=c.max_char===0?Infinity:c.max_char||70;
unformatted=c.unformatted||["a"];function b(){this.pos=0;this.token="";this.current_mode="CONTENT";this.tags={parent:"parent1",parentcount:1,parent1:""};
this.tag_type="";this.token_text=this.last_token=this.last_text=this.token_type="";this.Utils={whitespace:"\n\r\t ".split(""),single_token:"br,input,link,meta,!doctype,basefont,base,area,hr,wbr,param,img,isindex,?xml,embed".split(","),extra_liners:"head,body,/html".split(","),in_array:function(w,t){for(var v=0;
v<t.length;v++){if(w===t[v]){return true;}}return false;}};this.get_content=function(){var t="";var w=[];var x=false;while(this.input.charAt(this.pos)!=="<"){if(this.pos>=this.input.length){return w.length?w.join(""):["","TK_EOF"];
}t=this.input.charAt(this.pos);this.pos++;this.line_char_count++;if(this.Utils.in_array(t,this.Utils.whitespace)){if(w.length){x=true;}this.line_char_count--;
continue;}else{if(x){if(this.line_char_count>=this.max_char){w.push("\n");for(var v=0;v<this.indent_level;v++){w.push(this.indent_string);}this.line_char_count=0;
}else{w.push(" ");this.line_char_count++;}x=false;}}w.push(t);}return w.length?w.join(""):"";};this.get_contents_to=function(w){if(this.pos==this.input.length){return["","TK_EOF"];
}var t="";var x="";var y=new RegExp("</"+w+"\\s*>","igm");y.lastIndex=this.pos;var v=y.exec(this.input);var z=v?v.index:this.input.length;if(this.pos<z){x=this.input.substring(this.pos,z);
this.pos=z;}return x;};this.record_tag=function(t){if(this.tags[t+"count"]){this.tags[t+"count"]++;this.tags[t+this.tags[t+"count"]]=this.indent_level;
}else{this.tags[t+"count"]=1;this.tags[t+this.tags[t+"count"]]=this.indent_level;}this.tags[t+this.tags[t+"count"]+"parent"]=this.tags.parent;this.tags.parent=t+this.tags[t+"count"];
};this.retrieve_tag=function(t){if(this.tags[t+"count"]){var v=this.tags.parent;while(v){if(t+this.tags[t+"count"]===v){break;}v=this.tags[v+"parent"];
}if(v){this.indent_level=this.tags[t+this.tags[t+"count"]];this.tags.parent=this.tags[v+"parent"];}delete this.tags[t+this.tags[t+"count"]+"parent"];delete this.tags[t+this.tags[t+"count"]];
if(this.tags[t+"count"]==1){delete this.tags[t+"count"];}else{this.tags[t+"count"]--;}}};this.get_tag=function(){var t="";var w=[];var y=false;do{if(this.pos>=this.input.length){return w.length?w.join(""):["","TK_EOF"];
}t=this.input.charAt(this.pos);this.pos++;this.line_char_count++;if(this.Utils.in_array(t,this.Utils.whitespace)){y=true;this.line_char_count--;continue;
}if(t==="'"||t==='"'){if(!w[1]||w[1]!=="!"){t+=this.get_unformatted(t);y=true;}}if(t==="="){y=false;}if(w.length&&w[w.length-1]!=="="&&t!==">"&&y){if(this.line_char_count>=this.max_char){this.print_newline(false,w);
this.line_char_count=0;}else{w.push(" ");this.line_char_count++;}y=false;}w.push(t);}while(t!==">");var z=w.join("");var x;if(z.indexOf(" ")!=-1){x=z.indexOf(" ");
}else{x=z.indexOf(">");}var v=z.substring(1,x).toLowerCase();if(z.charAt(z.length-2)==="/"||this.Utils.in_array(v,this.Utils.single_token)){this.tag_type="SINGLE";
}else{if(v==="script"){this.record_tag(v);this.tag_type="SCRIPT";}else{if(v==="style"){this.record_tag(v);this.tag_type="STYLE";}else{if(this.Utils.in_array(v,unformatted)){var A=this.get_unformatted("</"+v+">",z);
w.push(A);this.tag_type="SINGLE";}else{if(v.charAt(0)==="!"){if(v.indexOf("[if")!=-1){if(z.indexOf("!IE")!=-1){var A=this.get_unformatted("-->",z);w.push(A);
}this.tag_type="START";}else{if(v.indexOf("[endif")!=-1){this.tag_type="END";this.unindent();}else{if(v.indexOf("[cdata[")!=-1){var A=this.get_unformatted("]]>",z);
w.push(A);this.tag_type="SINGLE";}else{var A=this.get_unformatted("-->",z);w.push(A);this.tag_type="SINGLE";}}}}else{if(v.charAt(0)==="/"){this.retrieve_tag(v.substring(1));
this.tag_type="END";}else{this.record_tag(v);this.tag_type="START";}if(this.Utils.in_array(v,this.Utils.extra_liners)){this.print_newline(true,this.output);
}}}}}}return w.join("");};this.get_unformatted=function(v,w){if(w&&w.indexOf(v)!=-1){return"";}var t="";var x="";var y=true;do{if(this.pos>=this.input.length){return x;
}t=this.input.charAt(this.pos);this.pos++;if(this.Utils.in_array(t,this.Utils.whitespace)){if(!y){this.line_char_count--;continue;}if(t==="\n"||t==="\r"){x+="\n";
this.line_char_count=0;continue;}}x+=t;this.line_char_count++;y=true;}while(x.indexOf(v)==-1);return x;};this.get_token=function(){var t;if(this.last_token==="TK_TAG_SCRIPT"||this.last_token==="TK_TAG_STYLE"){var v=this.last_token.substr(7);
t=this.get_contents_to(v);if(typeof t!=="string"){return t;}return[t,"TK_"+v];}if(this.current_mode==="CONTENT"){t=this.get_content();if(typeof t!=="string"){return t;
}else{return[t,"TK_CONTENT"];}}if(this.current_mode==="TAG"){t=this.get_tag();if(typeof t!=="string"){return t;}else{var w="TK_TAG_"+this.tag_type;return[t,w];
}}};this.get_full_indent=function(t){t=this.indent_level+t||0;if(t<1){return"";}return Array(t+1).join(this.indent_string);};this.printer=function(x,w,t,z,y){this.input=x||"";
this.output=[];this.indent_character=w;this.indent_string="";this.indent_size=t;this.brace_style=y;this.indent_level=0;this.max_char=z;this.line_char_count=0;
for(var v=0;v<this.indent_size;v++){this.indent_string+=this.indent_character;}this.print_newline=function(C,A){this.line_char_count=0;if(!A||!A.length){return;
}if(!C){while(this.Utils.in_array(A[A.length-1],this.Utils.whitespace)){A.pop();}}A.push("\n");for(var B=0;B<this.indent_level;B++){A.push(this.indent_string);
}};this.print_token=function(A){this.output.push(A);};this.indent=function(){this.indent_level++;};this.unindent=function(){if(this.indent_level>0){this.indent_level--;
}};};return this;}u=new b();u.printer(q,m,n,e,f);while(true){var g=u.get_token();u.token_text=g[0];u.token_type=g[1];if(u.token_type==="TK_EOF"){break;
}switch(u.token_type){case"TK_TAG_START":u.print_newline(false,u.output);u.print_token(u.token_text);u.indent();u.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":u.print_newline(false,u.output);
u.print_token(u.token_text);u.current_mode="CONTENT";break;case"TK_TAG_END":if(u.last_token==="TK_CONTENT"&&u.last_text===""){var s=u.token_text.match(/\w+/)[0];
var j=u.output[u.output.length-1].match(/<\s*(\w+)/);if(j===null||j[1]!==s){u.print_newline(true,u.output);}}u.print_token(u.token_text);u.current_mode="CONTENT";
break;case"TK_TAG_SINGLE":u.print_newline(false,u.output);u.print_token(u.token_text);u.current_mode="CONTENT";break;case"TK_CONTENT":if(u.token_text!==""){u.print_token(u.token_text);
}u.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":if(u.token_text!==""){u.output.push("\n");var h=u.token_text;if(u.token_type=="TK_SCRIPT"){var p=typeof js_beautify=="function"&&js_beautify;
}else{if(u.token_type=="TK_STYLE"){var p=typeof css_beautify=="function"&&css_beautify;}}if(c.indent_scripts=="keep"){var k=0;}else{if(c.indent_scripts=="separate"){var k=-u.indent_level;
}else{var k=1;}}var a=u.get_full_indent(k);if(p){h=p(h.replace(/^\s*/,a),c);}else{var d=h.match(/^\s*/)[0];var o=d.match(/[^\n\r]*$/)[0].split(u.indent_string).length-1;
var r=u.get_full_indent(k-o);h=h.replace(/^\s*/,a).replace(/\r\n|\r|\n/g,"\n"+r).replace(/\s*$/,"");}if(h){u.print_token(h);u.print_newline(true,u.output);
}}u.current_mode="TAG";break;}u.last_token=u.token_type;u.last_text=u.token_text;}return u.output.join("");}(function(j,g,h){var c=function(k){return j[k]||j.getElementsByTagName(k)[0];
},a=function(n,k,m){return typeof n=="function"?n.apply(k,m):n;},e=null,b=false,f=function(){if(!b){b=true;var m=".twipsy { display: block; position: absolute; visibility: visible; padding: 5px; font-size: 12px; z-index: 11000;}					.twipsy.above .twipsy-arrow { bottom: 0; left: 50%; margin-left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid #000000;}					.twipsy.above-left .twipsy-arrow { bottom: 0; left: 18px; margin-left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid #000000;}					.twipsy.above-right .twipsy-arrow { bottom: 0; right: 18px; margin-left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid #000000;}					.twipsy.left .twipsy-arrow { top: 50%; right: 0; margin-top: -5px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 5px solid #000000;}					.twipsy.below .twipsy-arrow { top: 0; left: 50%; margin-left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 5px solid #000000;}					.twipsy.below-left .twipsy-arrow { top: 0; left: 18px; margin-left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 5px solid #000000;}					.twipsy.below-right .twipsy-arrow { top: 0; right: 18px; margin-left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 5px solid #000000;}					.twipsy.right .twipsy-arrow { top: 50%; left: 0; margin-top: -5px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-right: 5px solid #000000;}					.twipsy-inner { padding: 3px 8px; background-color: #000000; color: white; text-align: center; max-width: 200px; text-decoration: none; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px;}					.twipsy-arrow { position: absolute; width: 0; height: 0;}",k=new Element("style",{type:"text/css"}).inject(c("head"),"bottom");
k.styleSheet?k.styleSheet.cssText=m:k.innerHTML=m;}};if(typeOf(Browser.Features.transition)!="boolean"){Browser.Features.transition=(function(){var k=(j.body||j.documentElement).style;
if(k.transition!==h||k.MsTransition!==h){e="TransitionEnd";}else{if(k.WebkitTransition!==h){e="webkitTransitionEnd";}else{if(k.MozTransition!==h){e="transitionend";
}else{if(k.OTransition!==h){e="oTransitionEnd";}}}}return e!=null;})();}var d=new Class({initialize:function(m,k){this.options=Object.merge({},d.defaults,k);
this.element=j.id(m);this.enabled=true;if(k.injectStyles){f();}this.fixTitle();},show:function(){var t,k,s,p,n,r,o,u,m,q;if(this.hasContent()&&this.enabled){n=this.setContent().getTip();
if(this.options.animate){moofx(n).animate({opacity:0.8},{duration:"150ms",equation:"ease-in",callback:function(){this.isShown=true;}.bind(this)});}n.setStyles({top:0,left:0,display:"block"}).inject(document.body,"top");
o=this.element.getPosition();u=this.element.getSize();t={left:o.x,top:o.y,width:u.x,height:u.y};m=n.getSize();k=m.x;s=m.y;p=a(this.options.placement,this,[n,this.element]);
q=t.left-k-this.options.offset;if(q<0&&p=="left"){p="right";}switch(p){case"below":r={top:t.top+t.height+this.options.offset,left:t.left+t.width/2-k/2};
break;case"below-left":r={top:t.top+t.height+this.options.offset,left:t.left-this.options.offset};break;case"below-right":r={top:t.top+t.height+this.options.offset,left:t.left+t.width-k+this.options.offset};
break;case"above":r={top:t.top-s-this.options.offset,left:t.left+t.width/2-k/2};break;case"above-left":r={top:t.top-s-this.options.offset,left:t.left-this.options.offset};
break;case"above-right":r={top:t.top-s-this.options.offset,left:t.left+t.width-k+this.options.offset};break;case"left":r={top:t.top+t.height/2-s/2,left:q};
break;case"right":r={top:t.top+t.height/2-s/2,left:t.left+t.width+this.options.offset};break;}n.setStyles(r).addClass(p);}return this;},hide:function(){var m=this.getTip(),k=function(){this.isShown=false;
m.dispose();}.bind(this);if(!this.hasContent()){k();return this;}moofx(m).animate({opacity:0},{duration:"150ms",equation:"ease-in",callback:k});return this;
},setContent:function(){this.getTip().getElement(".twipsy-inner").set(this.options.html?"html":"text",this.getTitle());return this;},hasContent:function(){return this.getTitle().replace(/\s+/g,"")!=="";
},getTitle:function(){var n,k=this.element,m=this.options;this.fixTitle();if(typeof m.title=="string"){n=k.getProperty(m.title=="title"?"data-original-title":m.title);
}else{if(typeof m.title=="function"){n=m.title.call(k);}}n=(""+n).clean();return n||m.fallback;},getTip:function(){if(!this.tip){this.tip=new Element("div.twipsy",{html:this.options.template});
}return this.tip;},validate:function(){if(!this.element.parentNode){this.hide();this.element=null;this.options=null;return false;}return true;},enable:function(){this.enabled=true;
return this;},disable:function(){this.enabled=false;return this;},toggleEnabled:function(){this.enabled=!this.enabled;return this;},toggle:function(){this[this.getTip().hasClass("in")?"hide":"show"]();
return this;},fixTitle:function(){var k=this.element;if(k.getProperty("title")||!k.getProperty("data-original-title")){k.setProperty("data-original-title",k.getProperty("title")||"").removeProperty("title");
}return this;}});d.defaults={placement:"above",animate:true,delayIn:0,delayOut:0,html:false,live:false,offset:0,title:"title",trigger:"hover",injectStyles:true,fallback:"",template:'<div class="twipsy-inner"></div><div class="twipsy-arrow"></div>'};
d.rejectAttrOptions=["title"];d.elementOptions=function(o,m){var p={},k=d.rejectAttrOptions,n=k.length;["placement","animate","delay-in","delay-out","html","offset","title","trigger","template","inject-styles"].each(function(s){var r=null,q;
if(o.dataset){r=o.dataset[s.camelCase()];}else{r=o.getProperty("data-"+s);}if(r){q=r.toLowerCase().clean();if(q==="true"){r=true;}else{if(q==="false"){r=false;
}else{if(/^[0-9]+$/.test(q)){q=parseInt(q,10);}}}p[s.camelCase()]=r;}});while(n--){delete p[k[n]];}return Object.merge({},m,p);};Element.implement({twipsy:function(t){var s,r,o,n,k="twipsy";
if(t===true){return this.retrieve(k);}else{if(typeof t=="string"){s=this.retrieve(k);if(s){s[t]();}return this;}}t=Object.merge({},d.defaults,t);function m(v){var u=v.retrieve(k);
if(!u){u=new d(v,d.elementOptions(v,t));v.store(k,u);}return u;}function p(){var u=m(this);u.hoverState="in";if(t.delayIn==0){u.show();}else{u.fixTitle();
setTimeout(function(){if(u.hoverState=="in"){u.show();}},t.delayIn);}}function q(){var u=m(this);u.hoverState="out";if(t.delayOut==0){u.hide();}else{setTimeout(function(){if(u.hoverState=="out"){u.hide();
}},t.delayOut);}}if(t.trigger!="manual"){o=t.trigger=="hover"?"mouseenter":"focus";n=t.trigger=="hover"?"mouseleave":"blur";m(this);document.id(this).addEvent(o,p).addEvent(n,q);
}return this;}});Elements.implement({twipsy:function(k){this.each(function(m){m.twipsy(k);});return this;}});g.Twipsy=d;})(document,self,undefined);((function(){if(typeof this.RokPadData=="undefined"){this.RokPadData={};
}var a={theme:{Chrome:"chrome",Clouds:"clouds","Clouds Midnight":"clouds_midnight",Cobalt:"cobalt","Crimson Editor":"crimson_editor",Dawn:"dawn",Dreamweaver:"dreamweaver",Eclipse:"eclipse",Fluidvision:"fluidvision",idleFingers:"idle_fingers",krTheme:"kr_theme",Merbivore:"merbivore","Merbivore Soft":"merbivore_soft","Mono Industrial":"mono_industrial",Monokai:"monokai","Pastel on dark":"pastel_on_dark","Solarized Dark":"solarized_dark","Solarized Light":"solarized_light",TextMate:"textmate",Tomorrow:"tomorrow","Tomorrow Night":"tomorrow_night","Tomorrow Night Blue":"tomorrow_night_blue","Tomorrow Night Bright":"tomorrow_night_bright","Tomorrow Night 80s":"tomorrow_night_eighties",Twilight:"twilight","Vibrant Ink":"vibrant_ink"},"font-size":["7px","8px","9px","10px","11px","12px","13px","14px","15px","16px","20px","24px"]};
this.RokPadClass=new Class({Implements:[Options,Events],initialize:function(){this.elements=document.getElements("[data-rokpad-editor]");this.editors={};
this.attach();this._startAutoSave();return this;},attach:function(){this.elements.each(function(d){var e=d.retrieve("rokpad:attached",false),c=d.retrieve("rokpad:options",false);
if(!e){d.store("rokpad:attached",true);var g=d.get("data-rokpad-editor"),b=d.getElement("[data-rokpad-container]");this.editors[g]=this._getACE(d);if(!c){this._populateOptions(g,d);
d.store("rokpad:options",true);}this._restoreSettings(g);this._restoreOptions(g);this._extrasFixes(g,d);b.makeResizable({handle:d.getElement(".rokpad-statusbar"),modifiers:{x:false,y:"height"},limit:{x:false,y:[b.getStyle("min-height").toInt(),false]},onDrag:function(){this.editors[g].getEditor().resize();
}.bind(this),onComplete:function(){this._store("height",b.getStyle("height").toInt());}.bind(this)});var f={undo:d.retrieve("rokpad:events:undo",function(h,j){this.undo.call(this,h,g,d,j);
}.bind(this)),redo:d.retrieve("rokpad:events:redo",function(h,j){this.redo.call(this,h,g,d,j);}.bind(this)),fullscreen:d.retrieve("rokpad:events:fullscreen",function(h,j){this.fullscreen.call(this,h,g,d,j);
}.bind(this)),shortcode:d.retrieve("rokpad:events:shortcode",function(h,j){this.insertShortCode.call(this,h,g,d,j);}.bind(this)),softtabs:d.retrieve("rokpad:events:softtabs",function(h,j){h.preventDefault();
this.setUseSoftTabs.call(this,g,j,d);}.bind(this)),tabsize:d.retrieve("rokpad:events:tabsize",function(h,j){h.preventDefault();this.setTabSize.call(this,g,j,d);
}.bind(this)),mode:d.retrieve("rokpad:events:mode",function(h,j){h.preventDefault();this.setMode.call(this,g,j,d);}.bind(this)),dropdownToggle:d.retrieve("rokpad:events:dropdownToggle",function(h,k){var m=k.get("data-rokpad-toggle"),j=d.getElement("[data-rokpad-dropdown="+m+"]")||d.getElement("[data-rokpad-popover="+m+"]");
d.getElements("[data-rokpad-dropdown], [data-rokpad-popover]").setStyle("display","none");j.setStyle("display","block");}.bind(this)),toggleActionSettings:d.retrieve("rokpad:events:actionSettings",function(h,j){h.preventDefault();
this.toggleActionSettings.call(this,g,j.get("data-rokpad-action-setting"));}.bind(this)),saveButton:d.retrieve("rokpad:events:saveAction",function(h,j){h.preventDefault();
this.save.call(this);}.bind(this)),findButton:d.retrieve("rokpad:events:find",function(j,k){j.preventDefault();var h=d.getElement("[data-rokpad-action-method=find] input");
this._showActionbar.call(this,g);this._setActionbar.call(this,g,(j.shift?"replace":"find"));h.select();h.focus();}.bind(this)),findReplaceButton:d.retrieve("rokpad:events:findreplace",function(j,k){j.preventDefault();
var h=d.getElement("[data-rokpad-action-method=find] input");this._showActionbar.call(this,g);this._setActionbar.call(this,g,"replace");h.select();h.focus();
this._hideDropDowns();}.bind(this)),beautifyHTML:d.retrieve("rokpad:events:beautifyhtml",function(h,j){h.preventDefault();this.editors[g].setValue(style_html(this.editors[g].getValue(),{indent_size:this.editors[g].getEditor().getSession().getTabSize(),indent_char:" ",max_char:0,unformatted:["a","sub","sup","b","i","u"]}));
this._hideDropDowns();}.bind(this)),gotoButton:d.retrieve("rokpad:events:goto",function(j,k){j.preventDefault();var h=d.getElement("[data-rokpad-action-method=goto] input");
this._showActionbar.call(this,g);this._setActionbar.call(this,g,"goto");h.select();h.focus();this._hideDropDowns.call(this);}.bind(this)),showFindOrReplace:d.retrieve("rokpad:events:showfind",function(k,m){var h;
if(k.key=="esc"){this._hideActionbar.call(this,g);return true;}if(k.key=="enter"){var j=this._getRange.call(this,g,this._retrieve("actionSettings"));if(m.getParent("[data-rokpad-action-method]").get("data-rokpad-action-method")=="goto"){h=d.getElement("[data-rokpad-action-method=goto] input");
this.editors[g].getEditor().gotoLine(h.get("value"),0,true);}else{this.editors[g].getEditor().find(j.needle,j,true);}return true;}if(k.key=="l"&&k[Browser.Platform.mac?"meta":"control"]){h=d.getElement("[data-rokpad-action-method=goto] input");
k.preventDefault();this._showActionbar.call(this,g);this._setActionbar.call(this,g,"goto");h.select();h.focus();return true;}if(k.key=="g"&&k[Browser.Platform.mac?"meta":"control"]){k.preventDefault();
this.editors[g].getEditor()[k.shift?"findPrevious":"findNext"](this._getRange(g,this._retrieve("actionSettings")));this.editors[g].getEditor().focus();
return true;}if(k.key!="f"||!k[Browser.Platform.mac?"meta":"control"]){return true;}h=d.getElement("[data-rokpad-action-method=find] input");k.preventDefault();
this._showActionbar.call(this,g);this._setActionbar.call(this,g,(k.shift?"replace":"find"));h.select();h.focus();}.bind(this)),actionInput:d.retrieve("rokpad:events:actioninput",function(h,j){this.performAction.call(this,g,j,d);
}.bind(this)),document:function(h,j){this._hideDropDowns.call(this,h,j);}.bind(this),inputWrapper:function(h,j){j.getElement("input").focus();},changeOptions:function(h,j){this.changeOptions.call(this,g,j,"store");
}.bind(this),enableAutoSave:function(h,j){if(j.get("checked")){this._startAutoSave();}else{this._stopAutoSave();}}.bind(this),dragover:function(h,j){this.dragOver.call(this,h,g,j);
}.bind(this),drop:function(h,j){this.drop.call(this,h,g,j);}.bind(this)};d.addEvents({"click:relay([data-rokpad-undo])":f.undo,"click:relay([data-rokpad-redo])":f.redo,"click:relay([data-rokpad-fullscreen])":f.fullscreen,"click:relay([data-rokpad-shortcode])":f.shortcode,"click:relay([data-rokpad-toggle])":f.dropdownToggle,"click:relay([data-rokpad-softtabs])":f.softtabs,"click:relay([data-rokpad-tabsize])":f.tabsize,"click:relay([data-rokpad-mode])":f.mode,"click:relay([data-rokpad-action-setting])":f.toggleActionSettings,"click:relay([data-rokpad-save])":f.saveButton,"click:relay([data-rokpad-find])":f.findButton,"click:relay([data-rokpad-find-replace])":f.findReplaceButton,"click:relay([data-rokpad-beautify])":f.beautifyHTML,"click:relay([data-rokpad-goto])":f.gotoButton,"keyup:relay([class*=rok-input-row-] input)":f.actionInput,"click:relay([data-rokpad-action])":f.actionInput,"keydown:relay([class*=rok-input-row-] input)":f.showFindOrReplace,"click:relay(.rok-input-wrapper)":f.inputWrapper,"click:relay(input[data-rokpad-options])":f.changeOptions,"change:relay(select[data-rokpad-options])":f.changeOptions,"keyup:relay(input[type=text][data-rokpad-options])":f.changeOptions,"click:relay(input[data-rokpad-options=autosave-enabled])":f.enableAutoSave});
document.id(document.body).addEvents({dragover:f.dragover,drop:f.drop});if(!document.retrieve("rokpad:events:document",false)){document.store("rokpad:events:document",true);
document.addEvent("click",f.document);}}},this);},attachResize:function(d,c){var b=window.retrieve("rokpad:events:resize",function(){var e=this._calculateHeight(c);
c.getElement(".rokpad-editor-container").setStyle("height",window.getSize().y-e);this.editors[d].getEditor().resize.delay(1,this.editors[d].getEditor());
}.bind(this));window.addEvent("resize",b);},detachResize:function(){window.removeEvent("resize",window.retrieve("rokpad:events:resize"));},dragOver:function(b,d,c){},drop:function(e,g,f){var c;
try{c=e.event.dataTransfer.files[0];if(window.FileReader){var b=new FileReader();b.onload=function(){var h=this._getModeFromPath(c.name);this.editors[g].setValue(b.result);
this.setMode(g,this.editors[g].wrapper.getElement("[data-rokpad-mode="+h+"]"),this.editors[g].wrapper,true);}.bind(this);b.readAsText(c);}return e.preventDefault(e);
}catch(d){return e.preventDefault(e);}},_getModeFromPath:function(b){var d="text",c;Object.each(RokPadData.modesList,function(f,e){c=new RegExp("^.*\\.("+f[1]+")$","g");
if(b.match(c)){d=f[2];}});return d;},undo:function(c,e,b,d){if(d.hasClass("rok-button-disabled")){return true;}this.editors[e].getEditor().undo(true);},redo:function(c,e,b,d){if(d.hasClass("rok-button-disabled")){return true;
}this.editors[e].getEditor().redo(true);},setMode:function(g,e,c,b){c=c||this.editors[g].wrapper;e=e||"text";e=typeOf(e)=="element"?e:c.getElement("[data-rokpad-mode="+e+"]");
var d=e.get("data-rokpad-mode"),f=e.getSiblings("[data-rokpad-mode]");if(!d){return true;}f.removeClass("rokpad-checked");e.addClass("rokpad-checked");
c.getElement("[data-rokpad-toggle=mode] span").set("text",e.get("text"));this.editors[g].getEditor().getSession().clearAnnotations();this.editors[g].getEditor().getSession().setMode("ace/mode/"+d);
this._hideDropDowns();if(!b){this._store("mode",d);}return this;},getMode:function(b){return this.editors[b].getEditor().getSession().getMode().$id.replace(/^ace\/mode\//g,"");
},setTabSize:function(f,d,b){b=b||this.editors[f].wrapper;d=typeOf(d)=="element"?d:b.getElement("[data-rokpad-tabsize="+d+"]");var c=d.get("data-rokpad-tabsize"),e=d.getSiblings("[data-rokpad-tabsize]");
if(!c){return true;}e.removeClass("rokpad-checked");d.addClass("rokpad-checked");b.getElement("[data-rokpad-toggle=tabs] span").set("text",c);c=c.toInt()||0;
if(!c){return;}this.editors[f].getEditor().getSession().setTabSize(c);this._hideDropDowns();this._store("tabSize",c);return this;},getTabSize:function(b){return this.editors[b].getEditor().getSession().getTabSize();
},setUseSoftTabs:function(f,e,b){b=b||this.editors[f].wrapper;var c=typeOf(e)=="string"||typeOf(e)=="number"?e:null;e=typeOf(e)=="element"?e:b.getElement("[data-rokpad-softtabs]");
var d=c!==null?c:e.get("data-rokpad-softtabs");d=(!d||d=="0"?1:0);e[!d?"removeClass":"addClass"]("rokpad-checked").set("data-rokpad-softtabs",d);this.editors[f].getEditor().getSession().setUseSoftTabs(!d?1:0);
this._hideDropDowns();this._store("useSoftTabs",!d?1:0);return this;},getUseSoftTabs:function(b){return this.editors[b].getEditor().getSession().getUseSoftTabs();
},toggleActionSettings:function(g,c,e){var d=this.editors[g].wrapper.getElement("[data-rokpad-action-setting="+c+"]"),b=this._getRange(g,this._retrieve("actionSettings"))||{},f=b[c];
if(typeof f=="undefined"){d[c=="wrap"?"removeClass":"addClass"]("rok-button-unchecked");b[c]=(c=="wrap")?true:false;}else{if(typeof e=="undefined"){e=!!d.hasClass("rok-button-unchecked");
}d[e===false?"addClass":"removeClass"]("rok-button-unchecked");b[c]=e;}this._store("actionSettings",b);this.editors[g].getEditor().$search.set(b);},performAction:function(c,j,g){var e=this._getRange(c,this._retrieve("actionSettings")),h=this.editors[c].getEditor(),d=null;
var b=j.getParent("[data-rokpad-action-method]");if(b){b=b.get("data-rokpad-action-method");switch(b){case"goto":break;case"find":e.needle=j.get("value");
this._store("actionSettings",e);break;case"replace":e.replacement=j.get("value");this._store("actionSettings",e);}}var f=j.get("data-rokpad-action");if(f){var k=h.$search.getOptions().needle;
if(k!=e.needle&&(f=="findNext"||f=="findPrevious")){f="find";}switch(f){case"goto":d=this.editors[c].wrapper.getElement("[data-rokpad-action-method="+f+"] input").get("value").toInt();
if(!isNaN(d)){h.gotoLine(d,0,true);}break;case"find":h.find(e.needle,e,true);break;case"findAll":h.findAll(e.needle,e);break;case"findNext":h.findNext(e,true);
break;case"findPrevious":h.findPrevious(e,true);break;case"replace":h.replace(e.replacement,e);break;case"replaceAll":h.replaceAll(e.replacement,e);break;
}h.focus();}},changeOptions:function(b,d,h){var g=d.get("tag")=="select"||d.get("type")=="text"?d.get("value"):d.checked,j=d.get("data-rokpad-options"),k="set"+j.camelCase().capitalize(),c=this.editors[b].getEditor();
switch(j){case"theme":case"font-size":this.editors[b][k](g);break;case"highlight-active-line":case"show-invisibles":case"highlight-selected-word":case"fade-fold-widgets":c[k](g);
break;case"show-gutter":case"show-print-margin":c.renderer[k](g);break;case"fold-style":c.getSession()[k](g);c.setShowFoldWidgets(g!=="manual");break;case"selection-style":c[k](g?"line":"text");
break;case"use-wrap-mode":var f=c.getSession(),e=c.renderer;switch(g){case"off":f[k](false);e.setPrintMarginColumn(80);break;case"40":f[k](true);f.setWrapLimitRange(40,40);
e.setPrintMarginColumn(40);break;case"80":f[k](true);f.setWrapLimitRange(80,80);e.setPrintMarginColumn(80);break;case"free":f[k](true);f.setWrapLimitRange(null,null);
e.setPrintMarginColumn(80);break;}break;}if(h){this._store(j,g);}},fullscreen:function(b,c,e,f){var k;if(e.retrieve("rokpad:states:fullscreen",false)){var n=e.retrieve("rokpad:states:styles"),g=e.retrieve("rokpad:states:containerheight"),j=e.retrieve("rokpad:states:location"),h=e.retrieve("rokpad:states:document"),d=e.retrieve("rokpad:states:documentscroll");
e.setStyles(n).inject(j.element,j.position);e.getElement(".rokpad-editor-container").setStyles(g);if(h.html["overflow-y"]=="scroll"||h.html.overflow=="auto"){document.id(document.html).setStyle("overflow",h.html.overflow);
}document.id(document.body).setStyle("overflow",h.body);window.scrollTo(d.x,d.y);this.editors[c].getEditor().resize.delay(1,this.editors[c].getEditor());
this.detachResize();e.removeClass("rokpad-cantresize");k=e.getElement("[data-rokpad-container]").retrieve("resizer");k.attach();f.getElement("i").className="rokpad-icon-fullscreen";
e.store("rokpad:states:fullscreen",false);}else{e.store("rokpad:states:location",this._getLocation(e));e.store("rokpad:states:styles",e.getStyles("position","left","top","right","bottom","z-index","height"));
e.store("rokpad:states:containerheight",e.getElement(".rokpad-editor-container").getStyles("height","min-height"));e.store("rokpad:states:document",{html:document.id(document.html).getStyles("overflow","overflow-y","overflow-x"),body:document.id(document.body).getStyle("overflow")});
e.store("rokpad:states:documentscroll",window.getScroll());var m=this._calculateHeight(e);e.inject(document.id(document.body)).setStyles({position:"fixed",left:0,top:0,right:0,bottom:0,"z-index":10000,height:"100%"});
e.getElement(".rokpad-editor-container").setStyles({height:window.getSize().y-m,"min-height":"0"});if(document.id(document.html).getStyle("overflow-y")=="scroll"||document.id(document.html).getStyle("overflow")=="auto"){document.id(document.html).setStyle("overflow","hidden");
}document.id(document.body).setStyle("overflow","hidden");this.editors[c].getEditor().resize.delay(5,this.editors[c].getEditor());this.attachResize(c,e);
e.addClass("rokpad-cantresize");k=e.getElement("[data-rokpad-container]").retrieve("resizer");k.detach();f.getElement("i").className="rokpad-icon-windowed";
e.store("rokpad:states:fullscreen",true);}this.editors[c].getEditor().focus();},insertShortCode:function(c,d,h,n){var g=n.get("data-rokpad-shortcode").replace(/'/g,'"'),m=this.editors[d].getEditor(),o=m.getSession(),p,j,e=[],b=[];
if(!g){return;}if(RokPadDevice=="portable"){g=g.substitute({cur:"",data:"",n:"\n",t:"\t"});insertAtCursor(document.id(d),g);document.id(d).focus();return;
}ranges=Array.from(m.getSelection()[m.getSelection().inMultiSelectMode?"getAllRanges":"getRange"]());m.clearSelection();ranges.each(function(q,s){p=o.getTextRange(q);
j=g.substitute({cur:"{cur}",data:p,n:"\n",t:"\t"});b=[];(j.split("\n")).each(function(t,v){var u=t.indexOfAll("{cur}");if(u.length){u.each(function(x,w){b.push({row:q.start.row+v,column:(!v?q.start.column:0)+(x-(5*w))});
});}},this);j=j.substitute({cur:""});o.replace(q,j);var r=m.getSelection();b.each(function(t,u){var v=q.clone();v.setStart(t);v.setEnd(t);v.cursor=t;if(r.inMultiSelectMode||b.length>1){r.addRange(v);
}else{m.moveCursorToPosition(t);}});},this);var f=m.getSelection().getAllRanges(),k=b.length*ranges.length;for(i=b.length,l=f.length;i<l;i+=b.length+1){m.getSelection().substractPoint(f[i].cursor);
}m.focus();},save:function(){if(!this._canSave()){return false;}if(!document.retrieve("rokpad:ajax:save",false)){var d=new Request({url:document.getElement("form[name=adminForm]").get("action"),onRequest:this.saveRequest,onSuccess:this.saveSuccess});
document.store("rokpad:ajax:save",d);}var b=this._getTask(),c=document.getElement("form[name=adminForm]"),e=document.retrieve("rokpad:ajax:save");c.task.value=b;
e.cancel().post(c.toQueryString());},saveRequest:function(){document.getElements("[data-rokpad-save] i").addClass("spinner");},saveSuccess:function(e){var c=new Element("div").set("html",e),b=document.getElement("form[name=adminForm"),h=c.getElements("form[name=adminForm] input, form[name=adminForm] select, form[name=adminForm] textarea"),k,j,d,f;
for(var g=h.length-1;g>=0;g--){j=h[g].get("type");k=document.id(h[g].get("id"))||document.getElement(h[g].get("tag")+"[name="+h[g].get("name")+"]");if(k){k.set("value",h[g].get("value"));
}else{if(h[g].get("name")){b.adopt(h[g].setStyle("display","none"));}}}d=c.getElement("form[name=adminForm]");d=d?d.get("action"):false;if(d){b.set("action",d!="index.php"?d:location.href);
f=document.retrieve("rokpad:ajax:save");f.setOptions({url:b.get("action")});}document.getElements("[data-rokpad-savedate]").set("text",(new Date()).format("%d %b, %T"));
document.getElements("[data-rokpad-save] i").removeClass("spinner");},_getACE:function(d){var e=d.get("data-rokpad-editor"),c=document.id(e+"-rokpad-editor"),b=d.getElement("[data-rokpad-original]");
d.setStyle("height","auto");return new RokPadACE(e,{wrapper:d,container:c,id:e});},_populateOptions:function(d,b){var c;Object.each(a,function(g,e){c=b.getElement("[data-rokpad-options="+e+"]");
var f=typeOf(g);(f=="object"?Object:Array).each(g,function(j,h){c.adopt(new Element("option[value="+j+"]").set("text",(f=="object"?h:j)));});});},_restoreSettings:function(c){this.setMode(c,(this._retrieve("mode")||"html"));
this.setUseSoftTabs(c,this._retrieve("useSoftTabs"));this.setTabSize(c,this._retrieve("tabSize")||4);this[this._retrieve("showActionbar",false)?"_showActionbar":"_hideActionbar"](c);
this._setActionbar(c,this._retrieve("actionbarMode","find"),false);var b=this._getRange(c,this._retrieve("actionSettings"));if(!b){this._store("actionSettings",{});
b={};}["regExp","caseSensitive","wholeWord","backwards","wrap","scope"].each(function(d){var e=(d=="wrap")?true:false;this.toggleActionSettings(c,d,b[d]?b[d]:e);
},this);},_restoreOptions:function(f){var d=RokPadDefaultSettings,e=this.editors[f].wrapper,b,c;Object.each(d,function(h,g){b=e.getElement("[data-rokpad-options="+g+"]");
h=(h=="0"||h=="1"||b.get("type")=="text")?h.toInt():h;if(b){c=this._retrieve(g);b.set((b.get("type")=="checkbox"?"checked":"value"),typeof c!="undefined"?c:h);
this.changeOptions(f,b);}},this);},_extrasFixes:function(h,c){var b=c.getParent(".repeatable-list .repeatable-element.hidden"),g=c.getElement("! > .repeatable-list ~ p.add a"),f=c.getElements("! > .repeatable-list .repeatable-element > .delete");
if(b&&g){if(!g.retrieve("rokpad:zoo:add",false)){g.store("rokpad:zoo:add",true);g.addEvent("click",function(){var m=c.getParent(".repeatable-list").getElements(".repeatable-element:not(.hidden)").getLast(),k=m.getElement("[data-rokpad-editor]"),j=k.get("data-rokpad-editor");
if(!this.editors[j].textarea.get("name")){this.editors[j].textarea.set("name",this.editors[j].textarea.get("id"));}this.editors[j].getEditor().resize();
this.editors[j].getEditor().focus.delay(10,this.editors[j].getEditor());}.bind(this));}}if(b&&f.length){f.addEvent("click",function(){var m=c.getParent(".repeatable-list").getElements(".repeatable-element:not(.hidden)").getLast(),k=m.getElement("[data-rokpad-editor]"),j=k.get("data-rokpad-editor");
this.editors[j].textarea.set("name",null);}.bind(this));}var e=document.getElement(".jevconfig"),d=(e)?e.getElements("#configs.tabs > dt"):[];if(e&&d.length){d.addEvent("click",function(){this.editors[h].getEditor().resize.delay(5,this.editors[h].getEditor());
}.bind(this));}if(window.parent&&typeof saveText!="undefined"&&!document.getElement("form")){this.save=function(){saveText();window.parent.SqueezeBox.close();
};this._stopAutoSave();this._startAutoSave=function(){return this._stopAutoSave();};}},_rearrangeHeight:function(g,e){var f=this.editors[g].wrapper,c=f.getElement("[data-rokpad-container]"),d=f.getElement("[data-rokpad-actionbar]"),b=d.getSize().y-Math.abs(e||0);
c.setStyle("height",Math.max(250,c.getSize().y-2-b));this.editors[g].getEditor().resize();},_showActionbar:function(h,e){var g=this.editors[h].wrapper,b=g.getElement("[data-rokpad-container]"),d=g.getElement("[data-rokpad-actionbar]"),c=g.getElement("[data-rokpad-action-method=find] input"),f=g.getElement("[data-rokpad-action-method=replace] input");
inputGoto=g.getElement("[data-rokpad-action-method=goto] input");if(!d.retrieve("rokpad:actionbar:shown",false)||e){d.setStyle("display","block");b.setStyle("height",this._retrieve("height")||b.getStyle("min-height").toInt());
this._store("showActionbar",true);c.set("value",this._retrieve("actionSettings").needle);f.set("value",this._retrieve("actionSettings").replacement);inputGoto.set("value","");
this._rearrangeHeight(h);d.store("rokpad:actionbar:shown",true);}},_hideActionbar:function(f){var e=this.editors[f].wrapper,c=e.getElement("[data-rokpad-container]"),d=e.getElement("[data-rokpad-actionbar]"),b=0;
if(d.retrieve("rokpad:actionbar:shown",true)){b=d.getSize().y;c.setStyle("height",c.getSize().y+b-2);this.editors[f].getEditor().resize();d.setStyle("display","none");
this._store("showActionbar",false);d.store("rokpad:actionbar:shown",false);}},_setActionbar:function(f,d,c){var e=this.editors[f].wrapper,b=e.getElement("[data-rokpad-actionbar]");
row2=b.getElement(".rok-input-row-2"),height1=height2=0;switch(d){case"goto":height1=b.getSize().y;row2.setStyle("display","none");height2=b.getSize().y;
e.getElement(".rokpad-column-1").setStyle("display","none");e.getElement("[data-rokpad-action-method=goto]").setStyle("display","block");e.getElement("[data-rokpad-action=goto]").setStyle("display","inline-block");
e.getElement("[data-rokpad-action-method=find]").setStyle("display","none");e.getElement(".rokpad-column-3 .rok-input-row-2").setStyle("display","none");
e.getElement("[data-rokpad-action=find]").setStyle("width","auto");e.getElements("[data-rokpad-action=findNext]").getParent(".rok-buttons-group").setStyle("display","none");
e.getElements("[data-rokpad-action=find], [data-rokpad-action=findNext], [data-rokpad-action=findPrevious], [data-rokpad-action=findAll]").setStyle("display","none");
this._store("actionbarMode","goto");break;case"find":height1=b.getSize().y;row2.setStyle("display","none");height2=b.getSize().y;e.getElement(".rokpad-column-1").setStyle("display","table-cell");
e.getElements("[data-rokpad-action-method=goto], [data-rokpad-action=goto]").setStyle("display","none");e.getElement("[data-rokpad-action-method=find]").setStyle("display","block");
e.getElement(".rokpad-column-3 .rok-input-row-2").setStyle("display","none");e.getElement("[data-rokpad-action=find]").setStyle("width","auto");e.getElements("[data-rokpad-action=findNext]").getParent(".rok-buttons-group").setStyle("display","inline-block");
e.getElements("[data-rokpad-action=find], [data-rokpad-action=findNext], [data-rokpad-action=findPrevious], [data-rokpad-action=findAll]").setStyle("display","inline-block");
this._store("actionbarMode","find");break;case"replace":height1=b.getSize().y;row2.setStyle("display","block");height2=b.getSize().y;e.getElement(".rokpad-column-1").setStyle("display","table-cell");
e.getElements("[data-rokpad-action-method=goto], [data-rokpad-action=goto]").setStyle("display","none");e.getElement("[data-rokpad-action-method=find]").setStyle("display","block");
e.getElement(".rokpad-column-3 .rok-input-row-2").setStyle("display","block");e.getElement("[data-rokpad-action=find], [data-rokpad-action=findAll]").setStyle("display","inline-block");
e.getElements("[data-rokpad-action=findNext], [data-rokpad-action=findPrevious]").setStyle("display","none");e.getElement("[data-rokpad-action=find]").setStyle("width",e.getElement("[data-rokpad-action=replace]").getComputedSize().width||47);
this._store("actionbarMode","replace");}if(c!==false){this._rearrangeHeight(f,height1);}if(e.retrieve("rokpad:states:fullscreen")){window.fireEvent("resize",null,1);
}},_store:function(b,c){if(!$.jStorage.get("rokpad")){$.jStorage.set("rokpad",{});}$.jStorage.setTTL("rokpad",0);var d=$.jStorage.get("rokpad");d[b]=c;
return $.jStorage.set("rokpad",d);},_retrieve:function(b){if(!$.jStorage.get("rokpad")){$.jStorage.set("rokpad",{});}$.jStorage.setTTL("rokpad",0);return $.jStorage.get("rokpad")[b];
},_getRange:function(e,c){if(!c){return c;}var d=this.editors[e].getEditor().getSelectionRange(),b=this.editors[e].getEditor().getSelection();if(b.isEmpty()){c.range=null;
}if(c.scope&&!b.isEmpty()){if(d.start.row==d.end.row&&Math.abs(d.start.column-d.end.column)==c.needle.length){return c;}c.range=d;}return c;},_getLocation:function(c){var b={};
if(!c.getSiblings().length){b={element:c.getParent(),position:"inside"};}else{if(c.getPrevious()){b={element:c.getPrevious(),position:"after"};}else{if(c.getNext()){b={element:c.getNext(),position:"before"};
}}}return b;},_calculateHeight:function(c){var b=0;c.getElements("> :not(.rokpad-editor-container)").each(function(d){if(d.getStyle("display")!="none"){b+=d.getSize().y;
}});return b;},_hideDropDowns:function(b,c){c=c||(b&&b.target)||null;if(!c||typeOf(c)=="document"){return document.getElements("[data-rokpad-dropdown], [data-rokpad-popover]").setStyle("display","none");
}else{if(c&&(c.get("data-rokpad-dropdown")||c.getParent("[data-rokpad-dropdown]")||c.get("data-rokpad-popover")||c.getParent("[data-rokpad-popover]")||c.get("data-rokpad-toggle")||c.getParent("[data-rokpad-toggle]"))){return true;
}document.getElements("[data-rokpad-dropdown], [data-rokpad-popover]").setStyle("display","none");}},_canSave:function(){if(!document.retrieve("rokpad:document:submitform",false)){document.store("rokpad:document:submitform",Joomla.submitform);
}var h=true,b=document.retrieve("rokpad:document:submitform"),d=this._getTask();submitform=Joomla.submitform=function(j){return false;};var g=document.getElements("form input.required, form select.required, .message-name !~ input, .message-name !~ select, #k2AdminContainer #title, #k2AdminContainer #catid, #k2AdminContainer #name");
if(document.getElement("[data-zooversion]")&&g.length){var f=new Elements(g.getSiblings(".message-name").flatten()),e=document.getElement('input[name="name"]');
if(e&&e.get("value")===""){h=false;}if(!h){e.focus();f.setStyle("display","block");}}if(typeof $K2!=="undefined"&&g.length){var c=g.get("value");if(c.contains("0")||c.contains("")){h=false;
}}if(document.formvalidator){h=document.formvalidator.isValid(document.getElement("[name=adminForm]"));}Joomla.submitbutton(d);Joomla.submitform=b;submitform=b;
return h;},_getTask:function(){var c=document.getElement("#toolbar-apply a")||document.getElement("form[name=adminForm] .formelm-buttons > button"),b=(c&&c.get("onclick")||"").toString().replace(/.*submitbutton\(['|"](.*)['|"]\).*/g,"$1");
return b||"apply";},_startAutoSave:function(){var b=this._retrieve("autosave-enabled"),c=this._retrieve("autosave-time")||5;c=(isNaN(c)?5:c.toInt())*60*1000;
this._stopAutoSave();if(b){this.autosaveTimer=function(){if(this._retrieve("autosave-enabled")){this.save();this._startAutoSave();}}.delay(c,this);}},_stopAutoSave:function(){clearTimeout(this.autosaveTimer);
}});})());((function(){var a=new Class({Implements:[Options,Events],options:{wrapper:null,container:null,id:null,onChange:function(b){var c=this.editor.getSession().getUndoManager();
["undo","redo"].each(function(d){var f="[data-rokpad-"+d+"]",g="[class*=rok-button-disabled]",e=":not("+g+")";if(c["has"+d.capitalize()]()){this.wrapper.getElements(f+g).removeClass("rok-button-disabled");
}else{this.wrapper.getElements(f+e).addClass("rok-button-disabled");}},this);}},initialize:function(c,b){this.setOptions(b);this.wrapper=b.wrapper?document.id(b.wrapper)||document.getElement(b.wrapper)||null:null;
this.container=b.container?document.id(b.container)||document.getElement(b.container)||null:null;this.textarea=document.id(c)||document.getElement(c)||null;
if(!this.container){throw new Error('Container for injecting ACE "'+b.container+'" not found in the DOM.');}if(!this.wrapper){throw new Error('Wrapper "'+b.wrapper+'" not found in the DOM.');
}if(!this.textarea){throw new Error('Original textarea "'+b.textarea+'" not found in the DOM.');}if(this.textarea.getParent("form")){this.textarea.inject(this.textarea.getParent("form"));
}if(!matchMedia("(max-device-width: 1024px)").matches){this.textarea.setStyle("display","none");}this.editor=ace.edit(this.container);this.insert(this.textarea.get("value"));
var d=this.editor.getSession().getUndoManager();d.reset.delay(1,d);this.attachEvents();this.container.getElement(".ace_layer.ace_text-layer").set("contenteditable","");
return this;},getEditor:function(){return this.editor;},attachEvents:function(){var b=this.options;this.textarea.addEvent("blur",function(){this.setValue(this.textarea.get("value"));
}.bind(this));this.editor.on("blur",function(){this.textarea.set("value",this.getValue());}.bind(this));this.editor.on("change",function(c){this.fireEvent("change",c,1);
}.bind(this));document.id(this.editor.renderer.scroller).addEvents({click:function(){this.editor.blur();this.editor.focus();}.bind(this),scroll:function(){var d=this.editor.renderer,e=d.$gutter,c=d.scroller,f=c.scrollLeft;
document.id(e)[f<5?"removeClass":"addClass"]("horscroll");}.bind(this)});this.editor.commands.addCommand({name:"find",bindKey:{win:"Ctrl-F",mac:"Command-F|Command-Alt-F"},exec:function(d){var c=this.wrapper.getElement("[data-rokpad-action-method=find] input");
RokPad._setActionbar(b.id,"find");RokPad._showActionbar(b.id);c.select();c.focus();}.bind(this)});this.editor.commands.addCommand({name:"findreplace",bindKey:{win:"Ctrl-Shift-F",mac:"Command-Shift-F"},exec:function(d){var c=this.wrapper.getElement("[data-rokpad-action-method=find] input");
RokPad._setActionbar(b.id,"replace");RokPad._showActionbar(b.id);c.select();c.focus();}.bind(this)});this.editor.commands.addCommand({name:"gotoline",bindKey:{win:"Ctrl-L",mac:"Command-L"},exec:function(d){var c=this.wrapper.getElement("[data-rokpad-action-method=goto] input");
RokPad._setActionbar(b.id,"goto");RokPad._showActionbar(b.id);c.select();c.focus();}.bind(this)});this.editor.commands.addCommand({name:"findnext",bindKey:{win:"Ctrl-K",mac:"Command-G"},exec:function(d){var c=RokPad._getRange(b.id,RokPad._retrieve("actionSettings"));
d.findNext(c);}.bind(this)});this.editor.commands.addCommand({name:"findprevious",bindKey:{win:"Ctrl-Shift-K",mac:"Command-Shift-G"},exec:function(d){var c=RokPad._getRange(b.id,RokPad._retrieve("actionSettings"));
d.findPrevious(c);}.bind(this)});this.editor.commands.addCommand({name:"escape",bindKey:{win:"Esc",mac:"Esc"},exec:function(c){RokPad._hideActionbar(b.id);
}});this.editor.commands.addCommand({name:"save",bindKey:{win:"Ctrl-S",mac:"Command-S"},exec:function(c){RokPad.save();}});this.editor.commands.addCommand({name:"findselection",bindKey:{win:"Ctrl-E",mac:"Command-E"},exec:function(f){var c=this.wrapper.getElement("[data-rokpad-action-method=find] input"),g=this.wrapper.getElement("[data-rokpad-action=find]"),e,d=RokPad._retrieve("actionSettings");
f.selection.selectWord();e=RokPad.editors[b.id].getSelection();RokPad._setActionbar(b.id,"find");RokPad._showActionbar(b.id);c.set("value",e);d.needle=e;
RokPad._store("actionSettings",d);c.select();c.focus();g.fireEvent("click");}.bind(this)});},insert:function(b){this.editor.insert(b);return this;},getValue:function(){return this.editor.getSession().getValue();
},setValue:function(b){this.editor.getSession().setValue(b);return this;},getSelection:function(){return this.editor.getSession().getTextRange(this.editor.getSelectionRange());
},setTheme:function(c){var b=this.editor;if(!c){throw new Error('Second argument "theme" of ACE::setTheme must be passed in.');}if(!c.match(/^ace\/theme/)){c="ace/theme/"+c;
}b.setTheme(c);return this;},setFontSize:function(c){var b=this.editor;if(!c){throw new Error('Second argument "fontsize" of ACE::setFontSize must be passed in.');
}if(typeof c=="number"){c+="px";}b.setFontSize(c);return this;},setMode:function(c){var b=this.editor;if(!c){throw new Error('Second argument "mode" of ACE::setMode must be passed in.');
}b.getSession().setMode(c);return this;},setUseSoftTabs:function(c){var b=this.editor;b.getSession().setUseSoftTabs(c);return this;},replaceSelection:function(j){var g=this.editor,h=g.getSession(),f,c,e,d=[],b=[];
c=Array.from(g.getSelection()[g.getSelection().inMultiSelectMode?"getAllRanges":"getRange"]());c.each(function(k,m){f=h.getTextRange(k);e=f?j.replace(/\{text\}/g,f):j;
h.replace(k,e);},this);}});this.RokPadACE=a;})());((function(){if(typeof this.RokPadData=="undefined"){this.RokPadData={};}this.RokPadData.insertion={};
var d=function(e){if(e.matches){RokPadDevice="portable";}else{RokPadDevice="desktop";}RokPadData.insertion={onSave:function(f){if(e.matches){return;}document.id(f).set("value",RokPad.editors[f].getValue());
},onGetContent:function(f){if(e.matches){return document.id(f).get("value");}else{return RokPad.editors[f].getValue();}},onSetContent:function(g,f){if(e.matches){document.id(g).set("value",f);
}else{RokPad.editors[g].setValue(f);}},onGetInsertMethod:function(g,f){if(e.matches){insertAtCursor(document.id(f),g);}else{RokPad.editors[f].replaceSelection(g);
RokPad.editors[f].getEditor().focus();}}};};if(respond.mediaQueriesSupported&&!Browser.ie8){var b=window.matchMedia("only screen and (max-device-width: 1024px)");
if(b.addListener){b.addListener(d);}else{window.addEvent("resize",function(){if(this.getSize().x<=1024){b={matches:true};}else{b={matches:false};}d(b);
});}d(b);}else{if(Browser.ie8){d({matches:true});}else{d({});}}if(typeof insertAtCursor!=="function"){this.insertAtCursor=function(h,g){if(document.selection){h.focus();
sel=document.selection.createRange();sel.text=g;}else{if(h.selectionStart||h.selectionStart=="0"){var f=h.selectionStart;var e=h.selectionEnd;h.value=h.value.substring(0,f)+g+h.value.substring(e,h.value.length);
}else{h.value+=g;}}};}Function.implement({bind:function(j){var e=this,f=arguments.length>1?Array.slice(arguments,1):null,h=function(){};var g=function(){var m=j,n=arguments.length;
if(this instanceof g){h.prototype=e.prototype;m=new h();}var k=(!f&&!n)?e.call(m):e.apply(m,f&&n?f.concat(Array.slice(arguments)):f||arguments);return m==j?k:m;
};return g;}});String.implement({indexOfAll:function(f){var h=new RegExp(f,"g");var e,g=[];while((e=h.exec(this))!==null){g.push(e.index);}return g;}});
Object.merge(Element.NativeEvents,{dragstart:2,drag:2,dragenter:2,dragleave:2,dragover:2,drop:2,dragend:2});String.implement({substitute:function(e,f){return String(this).replace(f||(/\\?\{([^{}]+)\}/g),function(h,g){if(h.charAt(0)=="\\"){return h.slice(1);
}return(e[g]!=null)?e[g]:h;});}});RokPadData.modesList=[];RokPadData.modesByName={c9search:["C9Search","c9search_results"],coffee:["CoffeeScript","coffee|^Cakefile"],coldfusion:["ColdFusion","cfm"],csharp:["C#","cs"],css:["CSS","css"],diff:["Diff","diff|patch"],golang:["Go","go"],groovy:["Groovy","groovy"],haxe:["haXe","hx"],html:["HTML","htm|html|xhtml"],c_cpp:["C/C++","c|cc|cpp|cxx|h|hh|hpp"],clojure:["Clojure","clj"],java:["Java","java"],javascript:["JavaScript","js"],json:["JSON","json"],jsx:["JSX","jsx"],latex:["LaTeX","latex|tex|ltx|bib"],less:["LESS","less"],liquid:["Liquid","liquid"],lua:["Lua","lua"],luapage:["LuaPage","lp"],markdown:["Markdown","md|markdown"],ocaml:["OCaml","ml|mli"],perl:["Perl","pl|pm"],pgsql:["pgSQL","pgsql"],php:["PHP","php|phtml"],powershell:["Powershell","ps1"],python:["Python","py"],ruby:["Ruby","ru|gemspec|rake|rb"],scad:["OpenSCAD","scad"],scala:["Scala","scala"],scss:["SCSS","scss|sass"],sh:["SH","sh|bash|bat"],sql:["SQL","sql"],svg:["SVG","svg"],text:["Text","txt"],textile:["Textile","textile"],xml:["XML","xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl"],xquery:["XQuery","xq"],yaml:["YAML","yaml"]};
for(var a in RokPadData.modesByName){var c=RokPadData.modesByName[a];c.push(a);RokPadData.modesList.push(c);}window.addEvent("domready",function(){document.getElements(".rokpad-tip").twipsy({placement:"left",offset:5});
var e=Browser.Platform.mac?"mac":"win";document.getElements(".rokpad-keyboard-"+e).setStyle("display","block");document.getElements(".rokpad-kbd-"+e).setStyle("display","inline-block");
this.RokPad=new RokPadClass();if(Browser.ie8){document.getElements(".rokpad-editor-wrapper").addClass("rokpad-ie8");}}.bind(this));})());