if(!modularjs.loaded["lib.onload"]){__onload__=false;addOnLoad=function(a){if(__onload__){a()}else{document.observe("dom:loaded",a)}};addOnLoad(function(){__onload__=true})}modularjs.loaded["lib.onload"]=true;if(!modularjs.loaded["lib.snap"]){(function(d,b){var a=a||function(l){var g={element:null,dragger:null,disable:"none",addBodyClasses:true,hyperextensible:true,resistance:0.5,flickThreshold:50,transitionSpeed:0.3,easing:"ease",maxPosition:266,minPosition:-266,tapToClose:true,touchToDrag:true,slideIntent:40,minDragDistance:5},f={simpleStates:{opening:null,towards:null,hyperExtending:null,halfway:null,flick:null,translation:{absolute:0,relative:0,sinceDirectionChange:0,percentage:0}}},i={},e={hasTouch:("ontouchstart" in b.documentElement||d.navigator.msPointerEnabled),eventType:function(n){var m={down:(e.hasTouch?"touchstart":"mousedown"),move:(e.hasTouch?"touchmove":"mousemove"),up:(e.hasTouch?"touchend":"mouseup"),out:(e.hasTouch?"touchcancel":"mouseout")};return m[n]},page:function(m,n){return(e.hasTouch&&n.touches.length&&n.touches[0])?n.touches[0]["page"+m]:n["page"+m]},klass:{has:function(n,m){return(n.className).indexOf(m)!==-1},add:function(n,m){if(!e.klass.has(n,m)&&g.addBodyClasses){n.className+=" "+m}},remove:function(n,m){if(g.addBodyClasses){n.className=(n.className).replace(m,"").replace(/^\s+|\s+$/g,"")}}},dispatchEvent:function(m){if(typeof i[m]==="function"){return i[m].call()}},vendor:function(){var n=b.createElement("div"),o="webkit Moz O ms".split(" "),m;for(m in o){if(typeof n.style[o[m]+"Transition"]!=="undefined"){return o[m]}}},transitionCallback:function(){return(f.vendor==="Moz"||f.vendor==="ms")?"transitionend":f.vendor+"TransitionEnd"},canTransform:function(){return typeof g.element.style[f.vendor+"Transform"]!=="undefined"},deepExtend:function(m,o){var n;for(n in o){if(o[n]&&o[n].constructor&&o[n].constructor===Object){m[n]=m[n]||{};e.deepExtend(m[n],o[n])}else{m[n]=o[n]}}return m},angleOfDrag:function(m,p){var o,n;n=Math.atan2(-(f.startDragY-p),(f.startDragX-m));if(n<0){n+=2*Math.PI}o=Math.floor(n*(180/Math.PI)-180);if(o<0&&o>-180){o=360-Math.abs(o)}return Math.abs(o)},events:{addEvent:function h(n,m,o){if(n.addEventListener){return n.addEventListener(m,o,false)}else{if(n.attachEvent){return n.attachEvent("on"+m,o)}}},removeEvent:function h(n,m,o){if(n.addEventListener){return n.removeEventListener(m,o,false)}else{if(n.attachEvent){return n.detachEvent("on"+m,o)}}},prevent:function(m){if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}}},parentUntil:function(o,m){var n=typeof m==="string";while(o.parentNode){if(n&&o.getAttribute&&o.getAttribute(m)){return o}else{if(!n&&o===m){return o}}o=o.parentNode}return null}},j={translate:{get:{matrix:function(o){if(!e.canTransform()){return parseInt(g.element.style.left,10)}else{var n=d.getComputedStyle(g.element)[f.vendor+"Transform"].match(/\((.*)\)/),m=8;if(n){n=n[1].split(",");if(n.length===16){o+=m}return parseInt(n[o],10)}return 0}}},easeCallback:function(){g.element.style[f.vendor+"Transition"]="";f.translation=j.translate.get.matrix(4);f.easing=false;clearInterval(f.animatingInterval);if(f.easingTo===0){e.klass.remove(b.body,"snapjs-right");e.klass.remove(b.body,"snapjs-left")}e.dispatchEvent("animated");e.events.removeEvent(g.element,e.transitionCallback(),j.translate.easeCallback)},easeTo:function(m){if(!e.canTransform()){f.translation=m;j.translate.x(m)}else{f.easing=true;f.easingTo=m;g.element.style[f.vendor+"Transition"]="all "+g.transitionSpeed+"s "+g.easing;f.animatingInterval=setInterval(function(){e.dispatchEvent("animating")},1);e.events.addEvent(g.element,e.transitionCallback(),j.translate.easeCallback);j.translate.x(m)}if(m===0){g.element.style[f.vendor+"Transform"]=""}},x:function(o){if((g.disable==="left"&&o>0)||(g.disable==="right"&&o<0)){return}if(!g.hyperextensible){if(o===g.maxPosition||o>g.maxPosition){o=g.maxPosition}else{if(o===g.minPosition||o0,r=o,x;if((f.intentChecked&&!f.hasIntent)){return}if(g.addBodyClasses){if((p)>0){e.klass.add(b.body,"snapjs-left");e.klass.remove(b.body,"snapjs-right")}else{if((p)<0){e.klass.add(b.body,"snapjs-right");e.klass.remove(b.body,"snapjs-left")}}}if(f.hasIntent===false||f.hasIntent===null){var n=e.angleOfDrag(w,v),m=(n>=0&&n<=g.slideIntent)||(n<=360&&n>(360-g.slideIntent)),s=(n>=180&&n<=(180+g.slideIntent))||(n<=180&&n>=(180-g.slideIntent));if(!s&&!m){f.hasIntent=false}else{f.hasIntent=true}f.intentChecked=true}if((g.minDragDistance>=Math.abs(w-f.startDragX))||(f.hasIntent===false)){return}e.events.prevent(t);e.dispatchEvent("drag");f.dragWatchers.current=w;if(f.dragWatchers.last>w){if(f.dragWatchers.state!=="left"){f.dragWatchers.state="left";f.dragWatchers.hold=w}f.dragWatchers.last=w}else{if(f.dragWatchers.last(g.maxPosition/2),flick:Math.abs(f.dragWatchers.current-f.dragWatchers.hold)>g.flickThreshold,translation:{absolute:p,relative:o,sinceDirectionChange:(f.dragWatchers.current-f.dragWatchers.hold),percentage:(p/g.maxPosition)*100}}}else{if(g.minPosition>p){x=(p-g.minPosition)*g.resistance;r=o-x}f.simpleStates={opening:"right",towards:f.dragWatchers.state,hyperExtending:g.minPosition>p,halfway:p<(g.minPosition/2),flick:Math.abs(f.dragWatchers.current-f.dragWatchers.hold)>g.flickThreshold,translation:{absolute:p,relative:o,sinceDirectionChange:(f.dragWatchers.current-f.dragWatchers.hold),percentage:(p/g.minPosition)*100}}}j.translate.x(r+u)}},endDrag:function(n){if(f.isDragging){e.dispatchEvent("end");var m=j.translate.get.matrix(4);if(f.dragWatchers.current===0&&m!==0&&g.tapToClose){e.dispatchEvent("close");e.events.prevent(n);j.translate.easeTo(0);f.isDragging=false;f.startDragX=0;return}if(f.simpleStates.opening==="left"){if((f.simpleStates.halfway||f.simpleStates.hyperExtending||f.simpleStates.flick)){if(f.simpleStates.flick&&f.simpleStates.towards==="left"){j.translate.easeTo(0)}else{if((f.simpleStates.flick&&f.simpleStates.towards==="right")||(f.simpleStates.halfway||f.simpleStates.hyperExtending)){j.translate.easeTo(g.maxPosition)}}}else{j.translate.easeTo(0)}}else{if(f.simpleStates.opening==="right"){if((f.simpleStates.halfway||f.simpleStates.hyperExtending||f.simpleStates.flick)){if(f.simpleStates.flick&&f.simpleStates.towards==="right"){j.translate.easeTo(0)}else{if((f.simpleStates.flick&&f.simpleStates.towards==="left")||(f.simpleStates.halfway||f.simpleStates.hyperExtending)){j.translate.easeTo(g.minPosition)}}}else{j.translate.easeTo(0)}}}f.isDragging=false;f.startDragX=e.page("X",n)}}}},k=function(m){if(m.element){e.deepExtend(g,m);f.vendor=e.vendor();j.drag.listen()}};this.open=function(m){e.dispatchEvent("open");e.klass.remove(b.body,"snapjs-expand-left");e.klass.remove(b.body,"snapjs-expand-right");if(m==="left"){f.simpleStates.opening="left";f.simpleStates.towards="right";e.klass.add(b.body,"snapjs-left");e.klass.remove(b.body,"snapjs-right");j.translate.easeTo(g.maxPosition)}else{if(m==="right"){f.simpleStates.opening="right";f.simpleStates.towards="left";e.klass.remove(b.body,"snapjs-left");e.klass.add(b.body,"snapjs-right");j.translate.easeTo(g.minPosition)}}};this.close=function(){e.dispatchEvent("close");j.translate.easeTo(0)};this.expand=function(m){var n=d.innerWidth||b.documentElement.clientWidth;if(m==="left"){e.dispatchEvent("expandLeft");e.klass.add(b.body,"snapjs-expand-left");e.klass.remove(b.body,"snapjs-expand-right")}else{e.dispatchEvent("expandRight");e.klass.add(b.body,"snapjs-expand-right");e.klass.remove(b.body,"snapjs-expand-left");n*=-1}j.translate.easeTo(n)};this.on=function(m,n){i[m]=n;return this};this.off=function(m){if(i[m]){i[m]=false}};this.enable=function(){e.dispatchEvent("enable");j.drag.listen()};this.disable=function(){e.dispatchEvent("disable");j.drag.stopListening()};this.settings=function(m){e.deepExtend(g,m)};this.state=function(){var m,n=j.translate.get.matrix(4);if(n===g.maxPosition){m="left"}else{if(n===g.minPosition){m="right"}else{m="closed"}}return{state:m,info:f.simpleStates}};k(l)};if((typeof module!=="undefined")&&module.exports){module.exports=a}if(typeof ender==="undefined"){this.Snap=a}if((typeof define==="function")&&define.amd){define("snap",[],function(){return a})}}).call(this,window,document)}modularjs.loaded["lib.snap"]=true;var Mobile={init:function(){FastClick.attach(document.body);Mobile.snapper=new Snap({element:$("content"),dragger:null,hyperextensible:true,touchToClose:true,touchToDrag:false,disable:"right",hyperextensible:false});var d=function(){$("entorno-teclas").setStyle({visibility:"hidden"})};var g=function(){$("entorno-teclas").setStyle({visibility:"inherit"})};$("showLeft").on("click",function(h){if(Mobile.snapper.state().state=="closed"){Mobile.snapper.open("left");d()}else{if(Mobile.snapper.state().state=="left"){Mobile.snapper.close();g()}}});var b=function(){$("overflow-menu").toggle();Mobile.snapper.close()};$("overflow").on("click",b);$("overflow-menu").on("click",b);$("quickMenu").on("click",function(){Menu.menuRapido.alternar();Mobile.snapper.close()});var e=function(){$("showLeft").addClassName("visible");$("entorno-teclas").addClassName("hide");d()};var f=function(){$("showLeft").removeClassName("visible");$("entorno-teclas").removeClassName("hide");g()};var a=Function.defer.bind(function(){if(Mobile.snapper.state().info.towards=="right"){e()}else{f()}});Mobile.snapper.on("open",e);Mobile.snapper.on("close",f);Mobile.snapper.on("end",a)},preInitMenu:function(){Mobile.snapper.close()},initMenu:function(){$("quickMenu").show();Menu.menuRapido.alternar()},initForm:function(){Mobile.resizeMenu()},resizeMenu:function(){if(!c.formulario.store){$$(".tecla.guardar")[0].setStyle({display:"none"})}else{$$(".tecla.guardar")[0].setStyle({display:""})}var d=$$("#entorno-teclas .tecla");var a=0;d.forEach(function(f){if(f.getStyle("display")!=="none"){a++}});var b=100/a;var e=function(){$("entorno-teclas").childElements("button").each(function(f){if(f.getStyle("display")==="inline-block"){f.setStyle({border:"1px #D4D4D4 solid"})}})};d.forEach(function(f){f.setStyle({width:b+"%"})});e()},reflowLabels:function(){$$("td::first-child>span.label").each(function(b){var a=b.up("tr").select("input[types=text]");if(a&&a[0]){a[0].placeholder=b.innerText;b.hide()}b.up("tr").insert({before:new Element("tr").insert(new Element("td",{colspan:"10"}).update(b))})});$$("fieldset > legend").each(function(a){a.addClassName("holo-divider")})}};addOnLoad(Mobile.init);