/*! push-menu 2013-09-27 */ !function(a,b){"use strict";function c(a,b){if(!a)return!1;for(var c=a.target||a.srcElement||a||!1;c&&c.id!==b;)c=c.parentNode||!1;return c!==!1}function d(a,c,e,f){return f=f||0,a.id.indexOf(c)>=0?f:(b(a).hasClass(e)&&++f,a.parentNode&&d(a.parentNode,c,e,f))}function e(){var b=!1;return function(a){(/(android|ipad|playbook|silk|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))&&(b=!0)}(navigator.userAgent||navigator.vendor||a.opera),b}function f(c,d,e){var f=this;this.el=c,this.trigger=d,this.options=b.extend(this.defaults,e),Modernizr.csstransforms3d&&(this._init(),b(a).bind("resize",function(){b(a).width()>767&&f._resetMenu(!0)}))}Modernizr.csstransforms3d&&(f.prototype={defaults:{type:"overlap",levelSpacing:40,backClass:"mp-back"},_init:function(){this.open=!1,this.level=0,this.wrapper=document.getElementById("mp-pusher"),this.levels=Array.prototype.slice.call(this.el.querySelectorAll("div.mp-level"));var a=this;this.levels.forEach(function(b){b.setAttribute("data-level",d(b,a.el.id,"mp-level"))}),this.menuItems=Array.prototype.slice.call(this.el.querySelectorAll("li")),this.levelBack=Array.prototype.slice.call(this.el.querySelectorAll("."+this.options.backClass)),this.eventtype=e()?"touchstart":"click",b(this.el).addClass("mp-"+this.options.type),this._initEvents()},_initEvents:function(){var a=this,d=function(b){a._resetMenu(),b.removeEventListener(a.eventtype,d)};this.trigger.addEventListener(this.eventtype,function(b){b.stopPropagation(),b.preventDefault(),a.open?a._resetMenu():(a._openMenu(),document.addEventListener(a.eventtype,function(b){a.open&&!c(b.target,a.el.id)&&d(this)}))}),this.menuItems.forEach(function(c){var d=c.querySelector("div.mp-level");d&&c.querySelector("a").addEventListener(a.eventtype,function(e){e.preventDefault();var f=b(c).closest(".mp-level").data("level");a.level<=f&&(e.stopPropagation(),b(c).closest(".mp-level").addClass("mp-level-overlay"),a._openMenu(d))})}),this.levels.forEach(function(b){b.addEventListener(a.eventtype,function(c){c.stopPropagation();var d=b.getAttribute("data-level");a.level>d&&(a.level=d,a._closeMenu())})}),this.levelBack.forEach(function(c){c.addEventListener(a.eventtype,function(d){d.preventDefault();var e=b(c).closest(".mp-level").data("level");a.level<=e&&(d.stopPropagation(),a.level=b(c).closest(".mp-level").data("level")-1,0===a.level?a._resetMenu():a._closeMenu())})})},_openMenu:function(a){++this.level;var c=(this.level-1)*this.options.levelSpacing,d="overlap"===this.options.type?this.el.offsetWidth+c:this.el.offsetWidth;if(b(this.wrapper).css("transform","translate3d("+d+"px,0,0)"),a&&(b(a).css("transform",""),this.levels&&this.levels.length))for(var e=0,f=this.levels.length;f>e;++e){var g=this.levels[e];g===a||b(g).hasClass("mp-level-open")||(g.style.WebkitTransform=g.style.transform="translate3d(-100%,0,0) translate3d("+-1*c+"px,0,0)")}1===this.level&&(b(this.wrapper).addClass("mp-pushed"),this.open=!0),b(a||this.levels[0]).addClass("mp-level-open")},_resetMenu:function(c){b(this.wrapper).css("transform","none"),this.level=0,b(this.wrapper).removeClass("mp-pushed"),this._toggleLevels(),this.open=!1,c||b(a).resize()},_closeMenu:function(){var a="overlap"===this.options.type?this.el.offsetWidth+(this.level-1)*this.options.levelSpacing:this.el.offsetWidth;b(this.wrapper).css("transform","translate3d("+a+"px,0,0)"),this._toggleLevels()},_toggleLevels:function(){var a=this;_.each(this.levels,function(c){c=b(c),c.data("level")>=a.level+1?c.removeClass("mp-level-open mp-level-overlay"):Number(c.data("level"))===a.level&&c.removeClass("mp-level-overlay")})}},a.MlPushMenu=f)}(window,jQuery),function(a){"use strict";if(Modernizr.csstransforms3d){var b={Models:{},Collections:{},Views:{}};b.Models.Root=Backbone.Model.extend({defaults:{title:"",description:"",type:"root",children:[]},initialize:function(){this.children=new b.Collections.Item}}),b.Models.Item=Backbone.Model.extend({defaults:{url:"",title:"",attr_title:"",description:"",classes:[],type:"root",children:[]}}),b.Collections.Item=Backbone.Collection.extend({model:b.Models.Item}),b.Collections.Root=Backbone.Collection.extend({model:b.Models.Root}),b.Views.Root=Backbone.View.extend({el:a("#container"),template:a("#wpvpm-menu-root").html(),initialize:function(){_.bindAll(this,"render"),this.listenTo(this.model,"change",this.render),this.render()},render:function(){var c=new b.Views.Item({model:new b.Models.Item(this.model.toJSON())}).render(),d=a("
").addClass("scroller").attr("id","mp-scroller"),e=a("").addClass("mp-pusher").attr("id","mp-pusher");a(this.el).wrap(e).before(_.template(this.template)({content:c})),a(this.el).wrap(d)}}),b.Views.Item=Backbone.View.extend({template:a("#wpvpm-menu-item").html(),initialize:function(){_.bindAll(this,"render")},render:function(){var a="";return _(this.model.get("children")).each(function(c){var d=new b.Views.Item({model:new b.Models.Item(c)});a+=d.render()}),_.template(this.template)(_.extend(this.model.toJSON(),{content:a}))}}),a(function(){if("WpvPushMenu"in window&&WpvPushMenu.items){new b.Views.Root({model:new b.Models.Root(WpvPushMenu.items)});var a=document.getElementById("mp-menu-trigger");a&&new MlPushMenu(document.getElementById("mp-menu"),document.getElementById("mp-menu-trigger"),{type:"cover"})}})}}(jQuery);