/* skelJS v0.3.3 | (c) n33 | n33.co @n33co | MIT + GPLv2 */skel.registerPlugin("panels",function(){var a={config:{baseZIndex:1E4,speed:250,panels:{},overlays:{}},cache:{panels:{},overlays:{},body:null,window:null,pageWrapper:null,defaultWrapper:null,fixedWrapper:null,activePanel:null},deviceType:null,eventType:"click",isTouch:!1,presets:{standard:{panels:{navPanel:{breakpoints:"mobile",position:"left",style:"push",size:"80%",html:'
'}},overlays:{titleBar:{breakpoints:"mobile",position:"top-left",width:"100%",height:44,html:''}}}},defaults:{config:{panel:{breakpoints:"",position:null,style:null,size:"80%",html:"",resetScroll:!0,resetForms:!0,swipeToClose:!0},overlay:{breakpoints:"",position:null,width:0,height:0,html:""}}},recalcW:function(a){var b=parseInt(a);"string"==typeof a&&"%"==a.charAt(a.length-1)&&(b=Math.floor(jQuery(window).width()*(b/100)));return b},recalcH:function(a){var b=parseInt(a);"string"==typeof a&&"%"==a.charAt(a.length-1)&&(b=Math.floor(jQuery(window).height()*(b/100)));return b},getHalf:function(a){var b=parseInt(a);return"string"==typeof a&&"%"==a.charAt(a.length-1)?Math.floor(b/2)+"%":Math.floor(b/2)+"px"},parseSuspend:function(a){a=a.get(0);a.suspend_skel&&a.suspend_skel()},parseResume:function(a){a=a.get(0);a.resume_skel&&a.resume_skel()},parseInit:function(d){var b,c;b=d.get(0);var f=d.attr("data-action"),g=d.attr("data-args"),e,h;f&&g&&(g=g.split(","));switch(f){case "togglePanel":case "panelToggle":d.css("-webkit-tap-highlight-color","rgba(0,0,0,0)").css("cursor","pointer");b=function(b){b.preventDefault();b.stopPropagation();if(a.cache.activePanel)return a.cache.activePanel.close_skel(),!1;jQuery(this);b=a.cache.panels[g[0]];b.is(":visible")?b.close_skel():b.open_skel()};"android"==a.deviceType?d.bind("click",b):d.bind(a.eventType,b);break;case "navList":e=jQuery("#"+g[0]);b=e.find("a");c=[];b.each(function(){var a=jQuery(this),b;b=Math.max(0,a.parents("li").length-1);c.push(''+a.text()+"")});0"+c.join("")+"");d.find(".link").css("cursor","pointer").css("display","block");break;case "copyText":e=jQuery("#"+g[0]);d.html(e.text());break;case "copyHTML":e=jQuery("#"+g[0]);d.html(e.html());break;case "moveElementContents":e=jQuery("#"+g[0]);b.resume_skel=function(){e.children().each(function(){d.append(jQuery(this))})};b.suspend_skel=function(){d.children().each(function(){e.append(jQuery(this))})};b.resume_skel();break;case "moveElement":e=jQuery("#"+g[0]);b.resume_skel=function(){jQuery('
').insertBefore(e);d.append(e)};b.suspend_skel=function(){jQuery("#skel-panels-tmp-"+e.attr("id")).replaceWith(e)};b.resume_skel();break;case "moveCell":e=jQuery("#"+g[0]),h=jQuery("#"+g[1]),b.resume_skel=function(){jQuery('
').insertBefore(e);d.append(e);e.css("width","auto");h&&h.expandCell_skel()},b.suspend_skel=function(){jQuery("#skel-panels-tmp-"+e.attr("id")).replaceWith(e);e.css("width","");h&&h.css("width","")},b.resume_skel()}},lockView:function(d){a.cache.window.scrollPos_skel=a.cache.window.scrollTop();a.cache.body.css("overflow-"+d,"hidden");a.cache.pageWrapper.bind("touchstart.lock",function(b){b.preventDefault();b.stopPropagation();a.cache.activePanel&&a.cache.activePanel.close_skel()});a.cache.pageWrapper.bind("click.lock",function(b){b.preventDefault();b.stopPropagation();a.cache.activePanel&&a.cache.activePanel.close_skel()});a.cache.pageWrapper.bind("scroll.lock",function(b){b.preventDefault();b.stopPropagation();a.cache.activePanel&&a.cache.activePanel.close_skel()});a.cache.window.bind("orientationchange.lock",function(b){a.cache.activePanel&&a.cache.activePanel.close_skel()});a.isTouch||(a.cache.window.bind("resize.lock",function(b){a.cache.activePanel&&a.cache.activePanel.close_skel()}),a.cache.window.bind("scroll.lock",function(b){a.cache.activePanel&&a.cache.activePanel.close_skel()}))},unlockView:function(d){a.cache.body.css("overflow-"+d,"visible");a.cache.pageWrapper.unbind("touchstart.lock");a.cache.pageWrapper.unbind("click.lock");a.cache.pageWrapper.unbind("scroll.lock");a.cache.window.unbind("orientationchange.lock");a.isTouch||(a.cache.window.unbind("resize.lock"),a.cache.window.unbind("scroll.lock"))},resumeElement:function(d){a.cache[d.type+"s"][d.id].find("*").each(function(){a.parseResume(jQuery(this))})},suspendElement:function(d){d=a.cache[d.type+"s"][d.id];d.css("transform","translate(0,0)");d.find("*").each(function(){a.parseSuspend(jQuery(this))})},initElement:function(d){var b=d.config,c=jQuery(d.object);a.cache[d.type+"s"][d.id]=c;c.applyTransition_skel().accelerate_skel();c.find("*").each(function(){a.parseInit(jQuery(this))});switch(d.type){case "panel":c.addClass("skel-panels-panel").css("z-index",a.config.baseZIndex).css("position","fixed").hide();c.find("a").css("-webkit-tap-highlight-color","rgba(0,0,0,0)").click(function(b){b.preventDefault();b.stopPropagation();var c=jQuery(this).attr("href");a.cache.activePanel.close_skel();window.setTimeout(function(){window.location.href=c},a.config.speed+10)});"ios"==a.deviceType&&c.find("input,select,textarea").focus(function(b){var c=jQuery(this);b.preventDefault();b.stopPropagation();window.setTimeout(function(){var b=a.cache.window.scrollPos_skel,d=a.cache.window.scrollTop()-b;a.cache.window.scrollTop(b);a.cache.activePanel.scrollTop(a.cache.activePanel.scrollTop()+d);c.hide();window.setTimeout(function(){c.show()},0)},100)});switch(b.position){case "top":case "bottom":var f="bottom"==b.position?"-":"";c.addClass("skel-panels-panel-"+b.position).css("height",a.recalcH(b.size)).scrollTop(0);a.isTouch?c.css("overflow-y","scroll").css("-webkit-overflow-scrolling","touch").bind("touchstart",function(a){c._posY=a.originalEvent.touches[0].pageY;c._posX=a.originalEvent.touches[0].pageX}).bind("touchmove",function(a){a=c._posY-a.originalEvent.touches[0].pageY;var b=c.outerHeight(),d=c.get(0).scrollHeight-c.scrollTop();if(0==c.scrollTop()&&0>a||d>b-2&&da&&-20d))return c.close_skel(),!1;if(0==c.scrollTop()&&0>a||k>f-2&&k');a.cache.pageWrapper=jQuery("#skel-panels-pageWrapper");a.cache.pageWrapper.css("position","relative").css("left","0").css("right","0").css("top","0").css("bottom","0").applyTransition_skel().accelerate_skel();a.cache.defaultWrapper=jQuery('
').appendTo(a.cache.body);a.cache.defaultWrapper.css("height","100%");a.cache.fixedWrapper=jQuery('
').appendTo(a.cache.body);a.cache.fixedWrapper.css("position","relative");jQuery(".skel-panels-fixed").appendTo(a.cache.fixedWrapper);a._.registerLocation("skel_panels_defaultWrapper",a.cache.defaultWrapper[0]);a._.registerLocation("skel_panels_fixedWrapper",a.cache.fixedWrapper[0]);a._.registerLocation("skel_panels_pageWrapper",a.cache.pageWrapper[0])})},initDeviceType:function(){var d,b={ios:"(iPad|iPhone|iPod)",android:"Android"};for(d in b)if(navigator.userAgent.match(RegExp(b[d],"g"))){a.deviceType=d;break}a.deviceType||(a.deviceType="other");a.isTouch=!!("ontouchstart"in window);a.eventType=a.isTouch?"touchend":"click"},init:function(){a.initDeviceType();a.initHelpers();a.initObjects();a.initElements("overlay");a.initElements("panel");a._.updateState()}};return a}());