function dropDownMobileMenu(){$(".dropdown .section .sub-drop-opener").click(function(){$(this).closest(".section").toggleClass("open");$(this).closest(".section").find("ul").slideToggle()});$(".has-dropdown .drop-opener").click(function(){$(this).closest(".has-dropdown").toggleClass("open");$(this).next(".dropdown").slideToggle()});$(".opener").click(function(){$(this).closest(".main-nav").find("#nav").slideToggle()});$(".opener").click(function(){$(this).closest(".main-nav").find("#nav").slideToggle()});$(".has-dropdown").hover(function(){$(".ren-categories-holder").hide();$(".categories-holder").show()});self.renTurnedOn=!1;$("#ren-main").click(function(){$(".ren-categories-holder").show();renTurnedOn=!renTurnedOn;$(".categories-holder").hide()})}function transparentYoutubeVideo(){$(".box-banner iframe").each(function(){var n=$(this).attr("src")||$(this).attr("ng-src"),t="wmode=transparent";n.indexOf("?")!=-1?$(this).attr("src",n+"&"+t):$(this).attr("src",n+"?"+t);n.indexOf("youtube.com/v/")!=-1&&$(this).attr("src",function(n,t){return t.replace("youtube.com/v/","youtube.com/embed/")})})}function calcDropHeight(){var n=$(".slider-block .mask").innerHeight();$("#nav .dropdown").css({"min-height":n-30})}function initCycleCarousel(){jQuery("div.slider-block").scrollAbsoluteGallery({mask:"div.mask",slider:"div.slideset",slides:"div.slide",generatePagination:".pagination",stretchSlideToMask:!0,pauseOnHover:!0,maskAutoSize:!0,autoRotation:!0,switchTime:3e3,animSpeed:500})}function initMultiColumns(){page_w>580?jQuery("#nav .dropdown .holder").columnize({lastNeverTallest:!0,columns:4}):page_w<=580&&page_w>480?jQuery("#nav .dropdown .holder").columnize({lastNeverTallest:!0,columns:2}):page_w<=480&&jQuery("#nav .dropdown .holder").columnize({lastNeverTallest:!1,columns:1})}var wysihtml5,Base,page_w,supports;(function(n){n.extend(n.fn,{validate:function(t){var i,r;if(!this.length){t&&t.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return}return(i=n.data(this[0],"validator"),i)?i:(this.attr("novalidate","novalidate"),i=new n.validator(t,this[0]),n.data(this[0],"validator",i),i.settings.onsubmit&&(r=this.find("input, button"),r.filter(".cancel").click(function(){i.cancelSubmit=!0}),i.settings.submitHandler&&r.filter(":submit").click(function(){i.submitButton=this}),this.submit(function(t){function r(){if(i.settings.submitHandler){if(i.submitButton)var t=n("<input type='hidden'/>").attr("name",i.submitButton.name).val(i.submitButton.value).appendTo(i.currentForm);return i.settings.submitHandler.call(i,i.currentForm),i.submitButton&&t.remove(),!1}return!0}return(i.settings.debug&&t.preventDefault(),i.cancelSubmit)?(i.cancelSubmit=!1,r()):i.form()?i.pendingRequest?(i.formSubmitted=!0,!1):r():(i.focusInvalid(),!1)})),i)},valid:function(){if(n(this[0]).is("form"))return this.validate().form();var t=!0,i=n(this[0].form).validate();return this.each(function(){t&=i.element(this)}),t},removeAttrs:function(t){var i={},r=this;return n.each(t.split(/\s/),function(n,t){i[t]=r.attr(t);r.removeAttr(t)}),i},rules:function(t,i){var r=this[0],o,u,h;if(t){var e=n.data(r.form,"validator").settings,s=e.rules,f=n.validator.staticRules(r);switch(t){case"add":n.extend(f,n.validator.normalizeRule(i));s[r.name]=f;i.messages&&(e.messages[r.name]=n.extend(e.messages[r.name],i.messages));break;case"remove":return i?(o={},n.each(i.split(/\s/),function(n,t){o[t]=f[t];delete f[t]}),o):(delete s[r.name],f)}}return u=n.validator.normalizeRules(n.extend({},n.validator.metadataRules(r),n.validator.classRules(r),n.validator.attributeRules(r),n.validator.staticRules(r)),r),u.required&&(h=u.required,delete u.required,u=n.extend({required:h},u)),u}});n.extend(n.expr[":"],{blank:function(t){return!n.trim(""+t.value)},filled:function(t){return!!n.trim(""+t.value)},unchecked:function(n){return!n.checked}});n.validator=function(t,i){this.settings=n.extend(!0,{},n.validator.defaults,t);this.currentForm=i;this.init()};n.validator.format=function(t,i){return arguments.length==1?function(){var i=n.makeArray(arguments);return i.unshift(t),n.validator.format.apply(this,i)}:(arguments.length>2&&i.constructor!=Array&&(i=n.makeArray(arguments).slice(1)),i.constructor!=Array&&(i=[i]),n.each(i,function(n,i){t=t.replace(new RegExp("\\{"+n+"\\}","g"),i)}),t)};n.extend(n.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:n([]),errorLabelContainer:n([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(n){this.lastActive=n;this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,n,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(n)).hide())},onfocusout:function(n){!this.checkable(n)&&(n.name in this.submitted||!this.optional(n))&&this.element(n)},onkeyup:function(n){(n.name in this.submitted||n==this.lastElement)&&this.element(n)},onclick:function(n){n.name in this.submitted?this.element(n):n.parentNode.name in this.submitted&&this.element(n.parentNode)},highlight:function(t,i,r){t.type==="radio"?this.findByName(t.name).addClass(i).removeClass(r):n(t).addClass(i).removeClass(r)},unhighlight:function(t,i,r){t.type==="radio"?this.findByName(t.name).removeClass(i).addClass(r):n(t).removeClass(i).addClass(r)}},setDefaults:function(t){n.extend(n.validator.defaults,t)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:n.validator.format("Please enter no more than {0} characters."),minlength:n.validator.format("Please enter at least {0} characters."),rangelength:n.validator.format("Please enter a value between {0} and {1} characters long."),range:n.validator.format("Please enter a value between {0} and {1}."),max:n.validator.format("Please enter a value less than or equal to {0}."),min:n.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function r(t){var i=n.data(this[0].form,"validator"),r="on"+t.type.replace(/^validate/,"");i.settings[r]&&i.settings[r].call(i,this[0],t)}var i,t;this.labelContainer=n(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||n(this.currentForm);this.containers=n(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();i=this.groups={};n.each(this.settings.groups,function(t,r){n.each(r.split(/\s/),function(n,r){i[r]=t})});t=this.settings.rules;n.each(t,function(i,r){t[i]=n.validator.normalizeRule(r)});n(this.currentForm).validateDelegate("[type='text'], [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",r).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",r);this.settings.invalidHandler&&n(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),n.extend(this.submitted,this.errorMap),this.invalid=n.extend({},this.errorMap),this.valid()||n(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var n=0,t=this.currentElements=this.elements();t[n];n++)this.check(t[n]);return this.valid()},element:function(t){t=this.validationTargetFor(this.clean(t));this.lastElement=t;this.prepareElement(t);this.currentElements=n(t);var i=this.check(t);return i?delete this.invalid[t.name]:this.invalid[t.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),i},showErrors:function(t){if(t){n.extend(this.errorMap,t);this.errorList=[];for(var i in t)this.errorList.push({message:t[i],element:this.findByName(i)[0]});this.successList=n.grep(this.successList,function(n){return!(n.name in t)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){n.fn.resetForm&&n(this.currentForm).resetForm();this.submitted={};this.lastElement=null;this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(n){var t=0,i;for(i in n)t++;return t},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()==0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{n(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(t){}},findLastActive:function(){var t=this.lastActive;return t&&n.grep(this.errorList,function(n){return n.element.name==t.name}).length==1&&t},elements:function(){var t=this,i={};return n(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return(!this.name&&t.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in i||!t.objectLength(n(this).rules()))?!1:(i[this.name]=!0,!0)})},clean:function(t){return n(t)[0]},errors:function(){return n(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=n([]);this.toHide=n([]);this.currentElements=n([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},prepareElement:function(n){this.reset();this.toHide=this.errorsFor(n)},check:function(t){var i,r,u,f,e;t=this.validationTargetFor(this.clean(t));i=n(t).rules();r=!1;for(u in i){f={method:u,parameters:i[u]};try{if(e=n.validator.methods[u].call(this,t.value.replace(/\r/g,""),t,f.parameters),e=="dependency-mismatch"){r=!0;continue}if(r=!1,e=="pending"){this.toHide=this.toHide.not(this.errorsFor(t));return}if(!e)return this.formatAndAdd(t,f),!1}catch(o){this.settings.debug&&window.console&&console.log("exception occured when checking element "+t.id+", check the '"+f.method+"' method",o);throw o;}}if(!r)return this.objectLength(i)&&this.successList.push(t),!0},customMetaMessage:function(t,i){if(n.metadata){var r=this.settings.meta?n(t).metadata()[this.settings.meta]:n(t).metadata();return r&&r.messages&&r.messages[i]}},customMessage:function(n,t){var i=this.settings.messages[n];return i&&(i.constructor==String?i:i[t])},findDefined:function(){for(var n=0;n<arguments.length;n++)if(arguments[n]!==undefined)return arguments[n];return undefined},defaultMessage:function(t,i){return this.findDefined(this.customMessage(t.name,i),this.customMetaMessage(t,i),!this.settings.ignoreTitle&&t.title||undefined,n.validator.messages[i],"<strong>Warning: No message defined for "+t.name+"<\/strong>")},formatAndAdd:function(n,t){var i=this.defaultMessage(n,t.method),r=/\$?\{(\d+)\}/g;typeof i=="function"?i=i.call(this,t.parameters,n):r.test(i)&&(i=jQuery.format(i.replace(r,"{$1}"),t.parameters));this.errorList.push({message:i,element:n});this.errorMap[n.name]=i;this.submitted[n.name]=i},addWrapper:function(n){return this.settings.wrapper&&(n=n.add(n.parent(this.settings.wrapper))),n},defaultShowErrors:function(){for(var t,i,n=0;this.errorList[n];n++)t=this.errorList[n],this.settings.highlight&&this.settings.highlight.call(this,t.element,this.settings.errorClass,this.settings.validClass),this.showLabel(t.element,t.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(n=0;this.successList[n];n++)this.showLabel(this.successList[n]);if(this.settings.unhighlight)for(n=0,i=this.validElements();i[n];n++)this.settings.unhighlight.call(this,i[n],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return n(this.errorList).map(function(){return this.element})},showLabel:function(t,i){var r=this.errorsFor(t);r.length?(r.removeClass(this.settings.validClass).addClass(this.settings.errorClass),r.attr("generated")&&r.html(i)):(r=n("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(t),generated:!0}).addClass(this.settings.errorClass).html(i||""),this.settings.wrapper&&(r=r.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(r).length||(this.settings.errorPlacement?this.settings.errorPlacement(r,n(t)):r.insertAfter(t)));!i&&this.settings.success&&(r.text(""),typeof this.settings.success=="string"?r.addClass(this.settings.success):this.settings.success(r));this.toShow=this.toShow.add(r)},errorsFor:function(t){var i=this.idOrName(t);return this.errors().filter(function(){return n(this).attr("for")==i})},idOrName:function(n){return this.groups[n.name]||(this.checkable(n)?n.name:n.id||n.name)},validationTargetFor:function(n){return this.checkable(n)&&(n=this.findByName(n.name).not(this.settings.ignore)[0]),n},checkable:function(n){return/radio|checkbox/i.test(n.type)},findByName:function(t){var i=this.currentForm;return n(document.getElementsByName(t)).map(function(n,r){return r.form==i&&r.name==t&&r||null})},getLength:function(t,i){switch(i.nodeName.toLowerCase()){case"select":return n("option:selected",i).length;case"input":if(this.checkable(i))return this.findByName(i.name).filter(":checked").length}return t.length},depend:function(n,t){return this.dependTypes[typeof n]?this.dependTypes[typeof n](n,t):!0},dependTypes:{boolean:function(n){return n},string:function(t,i){return!!n(t,i.form).length},"function":function(n,t){return n(t)}},optional:function(t){return!n.validator.methods.required.call(this,n.trim(t.value),t)&&"dependency-mismatch"},startRequest:function(n){this.pending[n.name]||(this.pendingRequest++,this.pending[n.name]=!0)},stopRequest:function(t,i){this.pendingRequest--;this.pendingRequest<0&&(this.pendingRequest=0);delete this.pending[t.name];i&&this.pendingRequest==0&&this.formSubmitted&&this.form()?(n(this.currentForm).submit(),this.formSubmitted=!1):!i&&this.pendingRequest==0&&this.formSubmitted&&(n(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(t){return n.data(t,"previousValue")||n.data(t,"previousValue",{old:null,valid:!0,message:this.defaultMessage(t,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},dateDE:{dateDE:!0},number:{number:!0},numberDE:{numberDE:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(t,i){t.constructor==String?this.classRuleSettings[t]=i:n.extend(this.classRuleSettings,t)},classRules:function(t){var i={},r=n(t).attr("class");return r&&n.each(r.split(" "),function(){this in n.validator.classRuleSettings&&n.extend(i,n.validator.classRuleSettings[this])}),i},attributeRules:function(t){var r={},u=n(t),i,f;for(i in n.validator.methods)f=i==="required"&&typeof n.fn.prop=="function"?u.prop(i):u.attr(i),f?r[i]=f:u[0].getAttribute("type")===i&&(r[i]=!0);return r.maxlength&&/-1|2147483647|524288/.test(r.maxlength)&&delete r.maxlength,r},metadataRules:function(t){if(!n.metadata)return{};var i=n.data(t.form,"validator").settings.meta;return i?n(t).metadata()[i]:n(t).metadata()},staticRules:function(t){var i={},r=n.data(t.form,"validator");return r.settings.rules&&(i=n.validator.normalizeRule(r.settings.rules[t.name])||{}),i},normalizeRules:function(t,i){return n.each(t,function(r,u){if(u===!1){delete t[r];return}if(u.param||u.depends){var f=!0;switch(typeof u.depends){case"string":f=!!n(u.depends,i.form).length;break;case"function":f=u.depends.call(i,i)}f?t[r]=u.param!==undefined?u.param:!0:delete t[r]}}),n.each(t,function(r,u){t[r]=n.isFunction(u)?u(i):u}),n.each(["minlength","maxlength","min","max"],function(){t[this]&&(t[this]=Number(t[this]))}),n.each(["rangelength","range"],function(){t[this]&&(t[this]=[Number(t[this][0]),Number(t[this][1])])}),n.validator.autoCreateRanges&&(t.min&&t.max&&(t.range=[t.min,t.max],delete t.min,delete t.max),t.minlength&&t.maxlength&&(t.rangelength=[t.minlength,t.maxlength],delete t.minlength,delete t.maxlength)),t.messages&&delete t.messages,t},normalizeRule:function(t){if(typeof t=="string"){var i={};n.each(t.split(/\s/),function(){i[this]=!0});t=i}return t},addMethod:function(t,i,r){n.validator.methods[t]=i;n.validator.messages[t]=r!=undefined?r:n.validator.messages[t];i.length<3&&n.validator.addClassRules(t,n.validator.normalizeRule(t))},methods:{required:function(t,i,r){if(!this.depend(r,i))return"dependency-mismatch";switch(i.nodeName.toLowerCase()){case"select":var u=n(i).val();return u&&u.length>0;case"input":if(this.checkable(i))return this.getLength(t,i)>0;default:return n.trim(t).length>0}},remote:function(t,i,r){var f,u,e;return this.optional(i)?"dependency-mismatch":(f=this.previousValue(i),this.settings.messages[i.name]||(this.settings.messages[i.name]={}),f.originalMessage=this.settings.messages[i.name].remote,this.settings.messages[i.name].remote=f.message,r=typeof r=="string"&&{url:r}||r,this.pending[i.name])?"pending":f.old===t?f.valid:(f.old=t,u=this,this.startRequest(i),e={},e[i.name]=t,n.ajax(n.extend(!0,{url:r,mode:"abort",port:"validate"+i.name,dataType:"json",data:e,success:function(r){var e,h,s,o;u.settings.messages[i.name].remote=f.originalMessage;e=r===!0;e?(h=u.formSubmitted,u.prepareElement(i),u.formSubmitted=h,u.successList.push(i),u.showErrors()):(s={},o=r||u.defaultMessage(i,"remote"),s[i.name]=f.message=n.isFunction(o)?o(t):o,u.showErrors(s));f.valid=e;u.stopRequest(i,e)}},r)),"pending")},minlength:function(t,i,r){return this.optional(i)||this.getLength(n.trim(t),i)>=r},maxlength:function(t,i,r){return this.optional(i)||this.getLength(n.trim(t),i)<=r},rangelength:function(t,i,r){var u=this.getLength(n.trim(t),i);return this.optional(i)||u>=r[0]&&u<=r[1]},min:function(n,t,i){return this.optional(t)||n>=i},max:function(n,t,i){return this.optional(t)||n<=i},range:function(n,t,i){return this.optional(t)||n>=i[0]&&n<=i[1]},email:function(n,t){return this.optional(t)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(n)},url:function(n,t){return this.optional(t)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(n)},date:function(n,t){return this.optional(t)||!/Invalid|NaN/.test(new Date(n))},dateISO:function(n,t){return this.optional(t)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(n)},number:function(n,t){return this.optional(t)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(n)},digits:function(n,t){return this.optional(t)||/^\d+$/.test(n)},creditcard:function(n,t){var r,e,i;if(this.optional(t))return"dependency-mismatch";if(/[^0-9 -]+/.test(n))return!1;var f=0,i=0,u=!1;for(n=n.replace(/\D/g,""),r=n.length-1;r>=0;r--)e=n.charAt(r),i=parseInt(e,10),u&&(i*=2)>9&&(i-=9),f+=i,u=!u;return f%10==0},accept:function(n,t,i){return i=typeof i=="string"?i.replace(/,/g,"|"):"png|jpe?g|gif",this.optional(t)||n.match(new RegExp(".("+i+")$","i"))},equalTo:function(t,i,r){var u=n(r).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){n(i).valid()});return t==u.val()}}});n.format=n.validator.format})(jQuery),function(n){var t={},i;n.ajaxPrefilter?n.ajaxPrefilter(function(n,i,r){var u=n.port;n.mode=="abort"&&(t[u]&&t[u].abort(),t[u]=r)}):(i=n.ajax,n.ajax=function(r){var f=("mode"in r?r:n.ajaxSettings).mode,u=("port"in r?r:n.ajaxSettings).port;return f=="abort"?(t[u]&&t[u].abort(),t[u]=i.apply(this,arguments)):i.apply(this,arguments)})}(jQuery),function(n){jQuery.event.special.focusin||jQuery.event.special.focusout||!document.addEventListener||n.each({focus:"focusin",blur:"focusout"},function(t,i){function r(t){return t=n.event.fix(t),t.type=i,n.event.handle.call(this,t)}n.event.special[i]={setup:function(){this.addEventListener(t,r,!0)},teardown:function(){this.removeEventListener(t,r,!0)},handler:function(t){return arguments[0]=n.event.fix(t),arguments[0].type=i,n.event.handle.apply(this,arguments)}}});n.extend(n.fn,{validateDelegate:function(t,i,r){return this.bind(i,function(i){var u=n(i.target);if(u.is(t))return r.apply(u,arguments)})}})}(jQuery);!function(n){"use strict";n(function(){n.support.transition=function(){var n=function(){var i=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(i.style[n]!==undefined)return t[n]}();return n&&{end:n}}()})}(window.jQuery);!function(n){"use strict";var i='[data-dismiss="alert"]',t=function(t){n(t).on("click",i,this.close)},r;t.prototype.close=function(t){function f(){i.trigger("closed").remove()}var u=n(this),r=u.attr("data-target"),i;(r||(r=u.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=n(r),t&&t.preventDefault(),i.length||(i=u.hasClass("alert")?u:u.parent()),i.trigger(t=n.Event("close")),t.isDefaultPrevented())||(i.removeClass("in"),n.support.transition&&i.hasClass("fade")?i.on(n.support.transition.end,f):f())};r=n.fn.alert;n.fn.alert=function(i){return this.each(function(){var r=n(this),u=r.data("alert");u||r.data("alert",u=new t(this));typeof i=="string"&&u[i].call(r)})};n.fn.alert.Constructor=t;n.fn.alert.noConflict=function(){return n.fn.alert=r,this};n(document).on("click.alert.data-api",i,t.prototype.close)}(window.jQuery);!function(n){"use strict";var t=function(t,i){this.$element=n(t);this.options=n.extend({},n.fn.button.defaults,i)},i;t.prototype.setState=function(n){var i="disabled",t=this.$element,r=t.data(),u=t.is("input")?"val":"html";n=n+"Text";r.resetText||t.data("resetText",t[u]());t[u](r[n]||this.options[n]);setTimeout(function(){n=="loadingText"?t.addClass(i).attr(i,i):t.removeClass(i).removeAttr(i)},0)};t.prototype.toggle=function(){var n=this.$element.closest('[data-toggle="buttons-radio"]');n&&n.find(".active").removeClass("active");this.$element.toggleClass("active")};i=n.fn.button;n.fn.button=function(i){return this.each(function(){var u=n(this),r=u.data("button"),f=typeof i=="object"&&i;r||u.data("button",r=new t(this,f));i=="toggle"?r.toggle():i&&r.setState(i)})};n.fn.button.defaults={loadingText:"loading..."};n.fn.button.Constructor=t;n.fn.button.noConflict=function(){return n.fn.button=i,this};n(document).on("click.button.data-api","[data-toggle^=button]",function(t){var i=n(t.target);i.hasClass("btn")||(i=i.closest(".btn"));i.button("toggle")})}(window.jQuery);!function(n){"use strict";var t=function(t,i){this.$element=n(t);this.options=i;this.options.pause=="hover"&&this.$element.on("mouseenter",n.proxy(this.pause,this)).on("mouseleave",n.proxy(this.cycle,this))},i;t.prototype={cycle:function(t){return t||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval(n.proxy(this.next,this),this.options.interval)),this},to:function(t){var r=this.$element.find(".item.active"),i=r.parent().children(),u=i.index(r),f=this;if(!(t>i.length-1)&&!(t<0))return this.sliding?this.$element.one("slid",function(){f.to(t)}):u==t?this.pause().cycle():this.slide(t>u?"next":"prev",n(i[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&n.support.transition.end&&(this.$element.trigger(n.support.transition.end),this.cycle()),clearInterval(this.interval),this.interval=null,this},next:function(){if(!this.sliding)return this.slide("next")},prev:function(){if(!this.sliding)return this.slide("prev")},slide:function(t,i){var f=this.$element.find(".item.active"),r=i||f[t](),o=this.interval,e=t=="next"?"left":"right",h=t=="next"?"first":"last",s=this,u;if(this.sliding=!0,o&&this.pause(),r=r.length?r:this.$element.find(".item")[h](),u=n.Event("slide",{relatedTarget:r[0]}),!r.hasClass("active")){if(n.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(u),u.isDefaultPrevented())return;r.addClass(t);r[0].offsetWidth;f.addClass(e);r.addClass(e);this.$element.one(n.support.transition.end,function(){r.removeClass([t,e].join(" ")).addClass("active");f.removeClass(["active",e].join(" "));s.sliding=!1;setTimeout(function(){s.$element.trigger("slid")},0)})}else{if(this.$element.trigger(u),u.isDefaultPrevented())return;f.removeClass("active");r.addClass("active");this.sliding=!1;this.$element.trigger("slid")}return o&&this.cycle(),this}}};i=n.fn.carousel;n.fn.carousel=function(i){return this.each(function(){var f=n(this),r=f.data("carousel"),u=n.extend({},n.fn.carousel.defaults,typeof i=="object"&&i),e=typeof i=="string"?i:u.slide;r||f.data("carousel",r=new t(this,u));typeof i=="number"?r.to(i):e?r[e]():u.interval&&r.cycle()})};n.fn.carousel.defaults={interval:5e3,pause:"hover"};n.fn.carousel.Constructor=t;n.fn.carousel.noConflict=function(){return n.fn.carousel=i,this};n(document).on("click.carousel.data-api","[data-slide]",function(t){var i=n(this),r,u=n(i.attr("data-target")||(r=i.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),f=n.extend({},u.data(),i.data());u.carousel(f);t.preventDefault()})}(window.jQuery);!function(n){"use strict";var t=function(t,i){this.$element=n(t);this.options=n.extend({},n.fn.collapse.defaults,i);this.options.parent&&(this.$parent=n(this.options.parent));this.options.toggle&&this.toggle()},i;t.prototype={constructor:t,dimension:function(){var n=this.$element.hasClass("width");return n?"width":"height"},show:function(){var i,u,t,r;if(!this.transitioning){if(i=this.dimension(),u=n.camelCase(["scroll",i].join("-")),t=this.$parent&&this.$parent.find("> .accordion-group > .in"),t&&t.length){if(r=t.data("collapse"),r&&r.transitioning)return;t.collapse("hide");r||t.data("collapse",null)}this.$element[i](0);this.transition("addClass",n.Event("show"),"shown");n.support.transition&&this.$element[i](this.$element[0][u])}},hide:function(){var t;this.transitioning||(t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",n.Event("hide"),"hidden"),this.$element[t](0))},reset:function(n){var t=this.dimension();return this.$element.removeClass("collapse")[t](n||"auto")[0].offsetWidth,this.$element[n!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,i,r){var u=this,f=function(){i.type=="show"&&u.reset();u.transitioning=0;u.$element.trigger(r)};(this.$element.trigger(i),i.isDefaultPrevented())||(this.transitioning=1,this.$element[t]("in"),n.support.transition&&this.$element.hasClass("collapse")?this.$element.one(n.support.transition.end,f):f())},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};i=n.fn.collapse;n.fn.collapse=function(i){return this.each(function(){var u=n(this),r=u.data("collapse"),f=typeof i=="object"&&i;r||u.data("collapse",r=new t(this,f));typeof i=="string"&&r[i]()})};n.fn.collapse.defaults={toggle:!0};n.fn.collapse.Constructor=t;n.fn.collapse.noConflict=function(){return n.fn.collapse=i,this};n(document).on("click.collapse.data-api","[data-toggle=collapse]",function(t){var i=n(this),u,r=i.attr("data-target")||t.preventDefault()||(u=i.attr("href"))&&u.replace(/.*(?=#[^\s]+$)/,""),f=n(r).data("collapse")?"toggle":i.data();i[n(r).hasClass("in")?"addClass":"removeClass"]("collapsed");n(r).collapse(f)})}(window.jQuery);!function(n){"use strict";function u(){n(i).each(function(){r(n(this)).removeClass("open")})}function r(t){var i=t.attr("data-target"),r;return i||(i=t.attr("href"),i=i&&/#/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,"")),r=n(i),r.length||(r=t.parent()),r}var i="[data-toggle=dropdown]",t=function(t){var i=n(t).on("click.dropdown.data-api",this.toggle);n("html").on("click.dropdown.data-api",function(){i.parent().removeClass("open")})},f;t.prototype={constructor:t,toggle:function(){var t=n(this),i,f;if(!t.is(".disabled, :disabled"))return i=r(t),f=i.hasClass("open"),u(),f||i.toggleClass("open"),t.focus(),!1},keydown:function(t){var f,u,e,o,i;if(/(38|40|27)/.test(t.keyCode)&&(f=n(this),t.preventDefault(),t.stopPropagation(),!f.is(".disabled, :disabled"))){if(e=r(f),o=e.hasClass("open"),!o||o&&t.keyCode==27)return f.click();(u=n("[role=menu] li:not(.divider):visible a",e),u.length)&&(i=u.index(u.filter(":focus")),t.keyCode==38&&i>0&&i--,t.keyCode==40&&i<u.length-1&&i++,~i||(i=0),u.eq(i).focus())}}};f=n.fn.dropdown;n.fn.dropdown=function(i){return this.each(function(){var r=n(this),u=r.data("dropdown");u||r.data("dropdown",u=new t(this));typeof i=="string"&&u[i].call(r)})};n.fn.dropdown.Constructor=t;n.fn.dropdown.noConflict=function(){return n.fn.dropdown=f,this};n(document).on("click.dropdown.data-api touchstart.dropdown.data-api",u).on("click.dropdown touchstart.dropdown.data-api",".dropdown form",function(n){n.stopPropagation()}).on("touchstart.dropdown.data-api",".dropdown-menu",function(n){n.stopPropagation()}).on("click.dropdown.data-api touchstart.dropdown.data-api",i,t.prototype.toggle).on("keydown.dropdown.data-api touchstart.dropdown.data-api",i+", [role=menu]",t.prototype.keydown)}(window.jQuery);!function(n){"use strict";var t=function(t,i){this.options=i;this.$element=n(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",n.proxy(this.hide,this));this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)},i;t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,i=n.Event("show");(this.$element.trigger(i),this.isShown||i.isDefaultPrevented())||(this.isShown=!0,this.escape(),this.backdrop(function(){var i=n.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body);t.$element.show();i&&t.$element[0].offsetWidth;t.$element.addClass("in").attr("aria-hidden",!1);t.enforceFocus();i?t.$element.one(n.support.transition.end,function(){t.$element.focus().trigger("shown")}):t.$element.focus().trigger("shown")}))},hide:function(t){t&&t.preventDefault();var i=this;(t=n.Event("hide"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented())&&(this.isShown=!1,this.escape(),n(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),n.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal())},enforceFocus:function(){var t=this;n(document).on("focusin.modal",function(n){t.$element[0]===n.target||t.$element.has(n.target).length||t.$element.focus()})},escape:function(){var n=this;if(this.isShown&&this.options.keyboard)this.$element.on("keyup.dismiss.modal",function(t){t.which==27&&n.hide()});else this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var t=this,i=setTimeout(function(){t.$element.off(n.support.transition.end);t.hideModal()},500);this.$element.one(n.support.transition.end,function(){clearTimeout(i);t.hideModal()})},hideModal:function(){this.$element.hide().trigger("hidden");this.backdrop()},removeBackdrop:function(){this.$backdrop.remove();this.$backdrop=null},backdrop:function(t){var u=this,r=this.$element.hasClass("fade")?"fade":"",i;this.isShown&&this.options.backdrop?(i=n.support.transition&&r,this.$backdrop=n('<div class="modal-backdrop '+r+'" />').appendTo(document.body),this.$backdrop.click(this.options.backdrop=="static"?n.proxy(this.$element[0].focus,this.$element[0]):n.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),i?this.$backdrop.one(n.support.transition.end,t):t()):!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),n.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(n.support.transition.end,n.proxy(this.removeBackdrop,this)):this.removeBackdrop()):t&&t()}};i=n.fn.modal;n.fn.modal=function(i){return this.each(function(){var u=n(this),r=u.data("modal"),f=n.extend({},n.fn.modal.defaults,u.data(),typeof i=="object"&&i);r||u.data("modal",r=new t(this,f));typeof i=="string"?r[i]():f.show&&r.show()})};n.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0};n.fn.modal.Constructor=t;n.fn.modal.noConflict=function(){return n.fn.modal=i,this};n(document).on("click.modal.data-api",'[data-toggle="modal"]',function(t){var i=n(this),r=i.attr("href"),u=n(i.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),f=u.data("modal")?"toggle":n.extend({remote:!/#/.test(r)&&r},u.data(),i.data());t.preventDefault();u.modal(f).one("hide",function(){i.focus()})})}(window.jQuery);!function(n){"use strict";var t=function(n,t){this.init("tooltip",n,t)},i;t.prototype={constructor:t,init:function(t,i,r){var u,f;if(this.type=t,this.$element=n(i),this.options=this.getOptions(r),this.enabled=!0,this.options.trigger=="click")this.$element.on("click."+this.type,this.options.selector,n.proxy(this.toggle,this));else if(this.options.trigger!="manual"){u=this.options.trigger=="hover"?"mouseenter":"focus";f=this.options.trigger=="hover"?"mouseleave":"blur";this.$element.on(u+"."+this.type,this.options.selector,n.proxy(this.enter,this));this.$element.on(f+"."+this.type,this.options.selector,n.proxy(this.leave,this))}this.options.selector?this._options=n.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=n.extend({},n.fn[this.type].defaults,t,this.$element.data()),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var i=n(t.currentTarget)[this.type](this._options).data(this.type);if(!i.options.delay||!i.options.delay.show)return i.show();clearTimeout(this.timeout);i.hoverState="in";this.timeout=setTimeout(function(){i.hoverState=="in"&&i.show()},i.options.delay.show)},leave:function(t){var i=n(t.currentTarget)[this.type](this._options).data(this.type);if(this.timeout&&clearTimeout(this.timeout),!i.options.delay||!i.options.delay.hide)return i.hide();i.hoverState="out";this.timeout=setTimeout(function(){i.hoverState=="out"&&i.hide()},i.options.delay.hide)},show:function(){var t,e,n,u,f,i,r;if(this.hasContent()&&this.enabled){t=this.tip();this.setContent();this.options.animation&&t.addClass("fade");i=typeof this.options.placement=="function"?this.options.placement.call(this,t[0],this.$element[0]):this.options.placement;e=/in/.test(i);t.detach().css({top:0,left:0,display:"block"}).insertAfter(this.$element);n=this.getPosition(e);u=t[0].offsetWidth;f=t[0].offsetHeight;switch(e?i.split(" ")[1]:i){case"bottom":r={top:n.top+n.height,left:n.left+n.width/2-u/2};break;case"top":r={top:n.top-f,left:n.left+n.width/2-u/2};break;case"left":r={top:n.top+n.height/2-f/2,left:n.left-u};break;case"right":r={top:n.top+n.height/2-f/2,left:n.left+n.width}}t.offset(r).addClass(i).addClass("in")}},setContent:function(){var n=this.tip(),t=this.getTitle();n.find(".tooltip-inner")[this.options.html?"html":"text"](t);n.removeClass("fade in top bottom left right")},hide:function(){function i(){var i=setTimeout(function(){t.off(n.support.transition.end).detach()},500);t.one(n.support.transition.end,function(){clearTimeout(i);t.detach()})}var r=this,t=this.tip();return t.removeClass("in"),n.support.transition&&this.$tip.hasClass("fade")?i():t.detach(),this},fixTitle:function(){var n=this.$element;(n.attr("title")||typeof n.attr("data-original-title")!="string")&&n.attr("data-original-title",n.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(t){return n.extend({},t?{top:0,left:0}:this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var t=this.$element,n=this.options;return t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title)},tip:function(){return this.$tip=this.$tip||n(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(t){var i=n(t.currentTarget)[this.type](this._options).data(this.type);i[i.tip().hasClass("in")?"hide":"show"]()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};i=n.fn.tooltip;n.fn.tooltip=function(i){return this.each(function(){var u=n(this),r=u.data("tooltip"),f=typeof i=="object"&&i;r||u.data("tooltip",r=new t(this,f));typeof i=="string"&&r[i]()})};n.fn.tooltip.Constructor=t;n.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner"><\/div><\/div>',trigger:"hover",title:"",delay:0,html:!1};n.fn.tooltip.noConflict=function(){return n.fn.tooltip=i,this}}(window.jQuery);!function(n){"use strict";var t=function(n,t){this.init("popover",n,t)},i;t.prototype=n.extend({},n.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var n=this.tip(),t=this.getTitle(),i=this.getContent();n.find(".popover-title")[this.options.html?"html":"text"](t);n.find(".popover-content")[this.options.html?"html":"text"](i);n.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var t=this.$element,n=this.options;return t.attr("data-content")||(typeof n.content=="function"?n.content.call(t[0]):n.content)},tip:function(){return this.$tip||(this.$tip=n(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}});i=n.fn.popover;n.fn.popover=function(i){return this.each(function(){var u=n(this),r=u.data("popover"),f=typeof i=="object"&&i;r||u.data("popover",r=new t(this,f));typeof i=="string"&&r[i]()})};n.fn.popover.Constructor=t;n.fn.popover.defaults=n.extend({},n.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"><\/div><div class="popover-inner"><h3 class="popover-title"><\/h3><div class="popover-content"><\/div><\/div><\/div>'});n.fn.popover.noConflict=function(){return n.fn.popover=i,this}}(window.jQuery);!function(n){"use strict";function t(t,i){var u=n.proxy(this.process,this),f=n(t).is("body")?n(window):n(t),r;this.options=n.extend({},n.fn.scrollspy.defaults,i);this.$scrollElement=f.on("scroll.scroll-spy.data-api",u);this.selector=(this.options.target||(r=n(t).attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a";this.$body=n("body");this.refresh();this.process()}t.prototype={constructor:t,refresh:function(){var t=this,i;this.offsets=n([]);this.targets=n([]);i=this.$body.find(this.selector).map(function(){var u=n(this),i=u.data("target")||u.attr("href"),r=/^#\w/.test(i)&&n(i);return r&&r.length&&[[r.position().top+t.$scrollElement.scrollTop(),i]]||null}).sort(function(n,t){return n[0]-t[0]}).each(function(){t.offsets.push(this[0]);t.targets.push(this[1])})},process:function(){var i=this.$scrollElement.scrollTop()+this.options.offset,f=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,e=f-this.$scrollElement.height(),t=this.offsets,r=this.targets,u=this.activeTarget,n;if(i>=e)return u!=(n=r.last()[0])&&this.activate(n);for(n=t.length;n--;)u!=r[n]&&i>=t[n]&&(!t[n+1]||i<=t[n+1])&&this.activate(r[n])},activate:function(t){var i,r;this.activeTarget=t;n(this.selector).parent(".active").removeClass("active");r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]';i=n(r).parent("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active"));i.trigger("activate")}};var i=n.fn.scrollspy;n.fn.scrollspy=function(i){return this.each(function(){var u=n(this),r=u.data("scrollspy"),f=typeof i=="object"&&i;r||u.data("scrollspy",r=new t(this,f));typeof i=="string"&&r[i]()})};n.fn.scrollspy.Constructor=t;n.fn.scrollspy.defaults={offset:10};n.fn.scrollspy.noConflict=function(){return n.fn.scrollspy=i,this};n(window).on("load",function(){n('[data-spy="scroll"]').each(function(){var t=n(this);t.scrollspy(t.data())})})}(window.jQuery);!function(n){"use strict";var t=function(t){this.element=n(t)},i;t.prototype={constructor:t,show:function(){var t=this.element,e=t.closest("ul:not(.dropdown-menu)"),i=t.attr("data-target"),r,u,f;(i||(i=t.attr("href"),i=i&&i.replace(/.*(?=#[^\s]*$)/,"")),t.parent("li").hasClass("active"))||(r=e.find(".active:last a")[0],f=n.Event("show",{relatedTarget:r}),t.trigger(f),f.isDefaultPrevented())||(u=n(i),this.activate(t.parent("li"),e),this.activate(u,u.parent(),function(){t.trigger({type:"shown",relatedTarget:r})}))},activate:function(t,i,r){function e(){u.removeClass("active").find("> .dropdown-menu > .active").removeClass("active");t.addClass("active");f?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade");t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active");r&&r()}var u=i.find("> .active"),f=r&&n.support.transition&&u.hasClass("fade");f?u.one(n.support.transition.end,e):e();u.removeClass("in")}};i=n.fn.tab;n.fn.tab=function(i){return this.each(function(){var u=n(this),r=u.data("tab");r||u.data("tab",r=new t(this));typeof i=="string"&&r[i]()})};n.fn.tab.Constructor=t;n.fn.tab.noConflict=function(){return n.fn.tab=i,this};n(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault();n(this).tab("show")})}(window.jQuery);!function(n){"use strict";var t=function(t,i){this.$element=n(t);this.options=n.extend({},n.fn.typeahead.defaults,i);this.matcher=this.options.matcher||this.matcher;this.sorter=this.options.sorter||this.sorter;this.highlighter=this.options.highlighter||this.highlighter;this.updater=this.options.updater||this.updater;this.source=this.options.source;this.$menu=n(this.options.menu);this.shown=!1;this.listen()},i;t.prototype={constructor:t,select:function(){var n=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(n)).change(),this.hide()},updater:function(n){return n},show:function(){var t=n.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return this.$menu.insertAfter(this.$element).css({top:t.top+t.height,left:t.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(){var t;return(this.query=this.$element.val(),!this.query||this.query.length<this.options.minLength)?this.shown?this.hide():this:(t=n.isFunction(this.source)?this.source(this.query,n.proxy(this.process,this)):this.source,t?this.process(t):this)},process:function(t){var i=this;return(t=n.grep(t,function(n){return i.matcher(n)}),t=this.sorter(t),!t.length)?this.shown?this.hide():this:this.render(t.slice(0,this.options.items)).show()},matcher:function(n){return~n.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(n){for(var i=[],r=[],u=[],t;t=n.shift();)t.toLowerCase().indexOf(this.query.toLowerCase())?~t.indexOf(this.query)?r.push(t):u.push(t):i.push(t);return i.concat(r,u)},highlighter:function(n){var t=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return n.replace(new RegExp("("+t+")","ig"),function(n,t){return"<strong>"+t+"<\/strong>"})},render:function(t){var i=this;return t=n(t).map(function(t,r){return t=n(i.options.item).attr("data-value",r),t.find("a").html(i.highlighter(r)),t[0]}),t.first().addClass("active"),this.$menu.html(t),this},next:function(){var i=this.$menu.find(".active").removeClass("active"),t=i.next();t.length||(t=n(this.$menu.find("li")[0]));t.addClass("active")},prev:function(){var t=this.$menu.find(".active").removeClass("active"),n=t.prev();n.length||(n=this.$menu.find("li").last());n.addClass("active")},listen:function(){this.$element.on("blur",n.proxy(this.blur,this)).on("keypress",n.proxy(this.keypress,this)).on("keyup",n.proxy(this.keyup,this));if(this.eventSupported("keydown"))this.$element.on("keydown",n.proxy(this.keydown,this));this.$menu.on("click",n.proxy(this.click,this)).on("mouseenter","li",n.proxy(this.mouseenter,this))},eventSupported:function(n){var t=n in this.$element;return t||(this.$element.setAttribute(n,"return;"),t=typeof this.$element[n]=="function"),t},move:function(n){if(this.shown){switch(n.keyCode){case 9:case 13:case 27:n.preventDefault();break;case 38:n.preventDefault();this.prev();break;case 40:n.preventDefault();this.next()}n.stopPropagation()}},keydown:function(t){this.suppressKeyPressRepeat=~n.inArray(t.keyCode,[40,38,9,13,27]);this.move(t)},keypress:function(n){this.suppressKeyPressRepeat||this.move(n)},keyup:function(n){switch(n.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}n.stopPropagation();n.preventDefault()},blur:function(){var n=this;setTimeout(function(){n.hide()},150)},click:function(n){n.stopPropagation();n.preventDefault();this.select()},mouseenter:function(t){this.$menu.find(".active").removeClass("active");n(t.currentTarget).addClass("active")}};i=n.fn.typeahead;n.fn.typeahead=function(i){return this.each(function(){var u=n(this),r=u.data("typeahead"),f=typeof i=="object"&&i;r||u.data("typeahead",r=new t(this,f));typeof i=="string"&&r[i]()})};n.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"><\/ul>',item:'<li><a href="#"><\/a><\/li>',minLength:1};n.fn.typeahead.Constructor=t;n.fn.typeahead.noConflict=function(){return n.fn.typeahead=i,this};n(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(t){var i=n(this);i.data("typeahead")||(t.preventDefault(),i.typeahead(i.data()))})}(window.jQuery);!function(n){"use strict";var t=function(t,i){this.options=n.extend({},n.fn.affix.defaults,i);this.$window=n(window).on("scroll.affix.data-api",n.proxy(this.checkPosition,this)).on("click.affix.data-api",n.proxy(function(){setTimeout(n.proxy(this.checkPosition,this),1)},this));this.$element=n(t);this.checkPosition()},i;t.prototype.checkPosition=function(){if(this.$element.is(":visible")){var o=n(document).height(),f=this.$window.scrollTop(),e=this.$element.offset(),t=this.options.offset,r=t.bottom,u=t.top,i;(typeof t!="object"&&(r=u=t),typeof u=="function"&&(u=t.top()),typeof r=="function"&&(r=t.bottom()),i=this.unpin!=null&&f+this.unpin<=e.top?!1:r!=null&&e.top+this.$element.height()>=o-r?"bottom":u!=null&&f<=u?"top":!1,this.affixed!==i)&&(this.affixed=i,this.unpin=i=="bottom"?e.top-f:null,this.$element.removeClass("affix affix-top affix-bottom").addClass("affix"+(i?"-"+i:"")))}};i=n.fn.affix;n.fn.affix=function(i){return this.each(function(){var u=n(this),r=u.data("affix"),f=typeof i=="object"&&i;r||u.data("affix",r=new t(this,f));typeof i=="string"&&r[i]()})};n.fn.affix.Constructor=t;n.fn.affix.defaults={offset:0};n.fn.affix.noConflict=function(){return n.fn.affix=i,this};n(window).on("load",function(){n('[data-spy="affix"]').each(function(){var i=n(this),t=i.data();t.offset=t.offset||{};t.offsetBottom&&(t.offset.bottom=t.offsetBottom);t.offsetTop&&(t.offset.top=t.offsetTop);i.affix(t)})})}(window.jQuery),function(n){"use strict";var t=function(n,i,r){var u=document.createElement("img"),f,e;return(u.onerror=i,u.onload=function(){!e||r&&r.noRevoke||t.revokeObjectURL(e);i(t.scale(u,r))},f=window.Blob&&n instanceof Blob||window.File&&n instanceof File?e=t.createObjectURL(n):n,f)?(u.src=f,u):t.readFile(n,function(n){u.src=n})},i=window.createObjectURL&&window||window.URL&&URL.revokeObjectURL&&URL||window.webkitURL&&webkitURL;t.scale=function(n,t){t=t||{};var f=document.createElement("canvas"),i=n.width,r=n.height,u=Math.max((t.minWidth||i)/i,(t.minHeight||r)/r);return(u>1&&(i=parseInt(i*u,10),r=parseInt(r*u,10)),u=Math.min((t.maxWidth||i)/i,(t.maxHeight||r)/r),u<1&&(i=parseInt(i*u,10),r=parseInt(r*u,10)),n.getContext||t.canvas&&f.getContext)?(f.width=i,f.height=r,f.getContext("2d").drawImage(n,0,0,i,r),f):(n.width=i,n.height=r,n)};t.createObjectURL=function(n){return i?i.createObjectURL(n):!1};t.revokeObjectURL=function(n){return i?i.revokeObjectURL(n):!1};t.readFile=function(n,t){if(window.FileReader&&FileReader.prototype.readAsDataURL){var i=new FileReader;return i.onload=function(n){t(n.target.result)},i.readAsDataURL(n),i}return!1};typeof define!="undefined"&&define.amd?define(function(){return t}):n.loadImage=t}(this),function(n){"use strict";typeof define=="function"&&define.amd?define(["jquery","load-image","bootstrap"],n):n(window.jQuery,window.loadImage)}(function(n,t){"use strict";n.extend(n.fn.modal.defaults,{delegate:document,selector:null,filter:"*",index:0,href:null,preloadRange:2,offsetWidth:100,offsetHeight:200,canvas:!1,slideshow:0,imageClickDivision:.5});var i=n.fn.modal.Constructor.prototype.show,r=n.fn.modal.Constructor.prototype.hide;n.extend(n.fn.modal.Constructor.prototype,{initLinks:function(){var i=this,t=this.options,r=t.selector||"a[data-target="+t.target+"]";this.$links=n(t.delegate).find(r).filter(t.filter).each(function(n){i.getUrl(this)===t.href&&(t.index=n)});this.$links[t.index]||(t.index=0)},getUrl:function(t){return t.href||n(t).data("href")},startSlideShow:function(){var n=this;this.options.slideshow&&(this._slideShow=window.setTimeout(function(){n.next()},this.options.slideshow))},stopSlideShow:function(){window.clearTimeout(this._slideShow)},toggleSlideShow:function(){var n=this.$element.find(".modal-slideshow");this.options.slideshow?(this.options.slideshow=0,this.stopSlideShow()):(this.options.slideshow=n.data("slideshow")||5e3,this.startSlideShow());n.find("i").toggleClass("icon-play icon-pause")},preloadImages:function(){for(var t=this.options,u=t.index+t.preloadRange+1,r,i=t.index-t.preloadRange;i<u;i+=1)r=this.$links[i],r&&i!==t.index&&n("<img>").prop("src",this.getUrl(r))},loadImage:function(){var i=this,n=this.$element,r=this.options.index,u=this.getUrl(this.$links[r]),f;this.abortLoad();this.stopSlideShow();n.trigger("beforeLoad");this._loadingTimeout=window.setTimeout(function(){n.addClass("modal-loading")},100);f=n.find(".modal-image").children().removeClass("in");window.setTimeout(function(){f.remove()},3e3);n.find(".modal-title").text(this.$links[r].title);n.find(".modal-download").prop("href",u);this._loadingImage=t(u,function(t){i.img=t;window.clearTimeout(i._loadingTimeout);n.removeClass("modal-loading");n.trigger("load");i.showImage(t);i.startSlideShow()},this._loadImageOptions);this.preloadImages()},showImage:function(t){var i=this.$element,u=n.support.transition&&i.hasClass("fade"),e=u?i.animate:i.css,f=i.find(".modal-image"),r,o;if(f.css({width:t.width,height:t.height}),i.find(".modal-title").css({width:Math.max(t.width,380)}),n(window).width()>480&&(u&&(r=i.clone().hide().appendTo(document.body)),e.call(i.stop(),{"margin-top":-((r||i).outerHeight()/2),"margin-left":-((r||i).outerWidth()/2)}),r&&r.remove()),f.append(t),o=t.offsetWidth,i.trigger("display"),u)if(i.is(":visible"))n(t).on(n.support.transition.end,function(r){r.target===t&&(n(t).off(n.support.transition.end),i.trigger("displayed"))}).addClass("in");else{n(t).addClass("in");i.one("shown",function(){i.trigger("displayed")})}else n(t).addClass("in"),i.trigger("displayed")},abortLoad:function(){this._loadingImage&&(this._loadingImage.onload=this._loadingImage.onerror=null);window.clearTimeout(this._loadingTimeout)},prev:function(){var n=this.options;n.index-=1;n.index<0&&(n.index=this.$links.length-1);this.loadImage()},next:function(){var n=this.options;n.index+=1;n.index>this.$links.length-1&&(n.index=0);this.loadImage()},keyHandler:function(n){switch(n.which){case 37:case 38:n.preventDefault();this.prev();break;case 39:case 40:n.preventDefault();this.next()}},wheelHandler:function(n){n.preventDefault();n=n.originalEvent;this._wheelCounter=this._wheelCounter||0;this._wheelCounter+=n.wheelDelta||n.detail||0;n.wheelDelta&&this._wheelCounter>=120||!n.wheelDelta&&this._wheelCounter<0?(this.prev(),this._wheelCounter=0):(n.wheelDelta&&this._wheelCounter<=-120||!n.wheelDelta&&this._wheelCounter>0)&&(this.next(),this._wheelCounter=0)},initGalleryEvents:function(){var t=this,i=this.$element;i.find(".modal-prev").on("click.modal-gallery",function(n){t.prev(n)});i.find(".modal-next").on("click.modal-gallery",function(n){t.next(n)});i.find(".modal-slideshow").on("click.modal-gallery",function(n){t.toggleSlideShow(n)});n(document).on("keydown.modal-gallery",function(n){t.keyHandler(n)}).on("mousewheel.modal-gallery, DOMMouseScroll.modal-gallery",function(n){t.wheelHandler(n)})},destroyGalleryEvents:function(){var t=this.$element;this.abortLoad();this.stopSlideShow();t.find(".modal-image, .modal-prev, .modal-next, .modal-slideshow").off("click.modal-gallery");n(document).off("keydown.modal-gallery").off("mousewheel.modal-gallery, DOMMouseScroll.modal-gallery")},show:function(){if(!this.isShown&&this.$element.hasClass("modal-gallery")){var t=this.$element,r=this.options,u=n(window).width(),f=n(window).height();t.hasClass("modal-fullscreen")?(this._loadImageOptions={maxWidth:u,maxHeight:f,canvas:r.canvas},t.hasClass("modal-fullscreen-stretch")&&(this._loadImageOptions.minWidth=u,this._loadImageOptions.minHeight=f)):this._loadImageOptions={maxWidth:u-r.offsetWidth,maxHeight:f-r.offsetHeight,canvas:r.canvas};u>480&&t.css({"margin-top":-(t.outerHeight()/2),"margin-left":-(t.outerWidth()/2)});this.initGalleryEvents();this.initLinks();this.$links.length&&(t.find(".modal-slideshow, .modal-prev, .modal-next").toggle(this.$links.length!==1),t.toggleClass("modal-single",this.$links.length===1),this.loadImage())}i.apply(this,arguments)},hide:function(){this.isShown&&this.$element.hasClass("modal-gallery")&&(this.options.delegate=document,this.options.href=null,this.destroyGalleryEvents());r.apply(this,arguments)}});n(function(){n(document.body).on("click.modal-gallery.data-api",'[data-toggle="modal-gallery"]',function(t){var e=n(this),i=e.data(),u=n(i.target),f=u.data("modal"),r;f||(i=n.extend(u.data(),i));i.selector||(i.selector="a[rel=gallery]");r=n(t.target).closest(i.selector);r.length&&u.length&&(t.preventDefault(),i.href=r.prop("href")||r.data("href"),i.delegate=r[0]!==this?this:document,f&&n.extend(f.options,i),u.modal(i))})})});!function(n){var t=function(t,i){var r,u;this.element=n(t);this.picker=n('<div class="slider"><div class="slider-track"><div class="slider-selection"><\/div><div class="slider-handle"><\/div><div class="slider-handle"><\/div><\/div><div class="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner"><\/div><\/div><\/div>').insertBefore(this.element).append(this.element);this.id=this.element.data("slider-id")||i.id;this.id&&(this.picker[0].id=this.id);typeof Modernizr!="undefined"&&Modernizr.touch&&(this.touchCapable=!0);r=this.element.data("slider-tooltip")||i.tooltip;this.tooltip=this.picker.find(".tooltip");this.tooltipInner=this.tooltip.find("div.tooltip-inner");this.orientation=this.element.data("slider-orientation")||i.orientation;switch(this.orientation){case"vertical":this.picker.addClass("slider-vertical");this.stylePos="top";this.mousePos="pageY";this.sizePos="offsetHeight";this.tooltip.addClass("right")[0].style.left="100%";break;default:this.picker.addClass("slider-horizontal").css("width",this.element.outerWidth());this.orientation="horizontal";this.stylePos="left";this.mousePos="pageX";this.sizePos="offsetWidth";this.tooltip.addClass("top")[0].style.top=-this.tooltip.outerHeight()-14+"px"}this.min=this.element.data("slider-min")||i.min;this.max=this.element.data("slider-max")||i.max;this.step=this.element.data("slider-step")||i.step;this.value=this.element.data("slider-value")||i.value;this.value[1]&&(this.range=!0);this.selection=this.element.data("slider-selection")||i.selection;this.selectionEl=this.picker.find(".slider-selection");this.selection==="none"&&this.selectionEl.addClass("hide");this.selectionElStyle=this.selectionEl[0].style;this.handle1=this.picker.find(".slider-handle:first");this.handle1Stype=this.handle1[0].style;this.handle2=this.picker.find(".slider-handle:last");this.handle2Stype=this.handle2[0].style;u=this.element.data("slider-handle")||i.handle;switch(u){case"round":this.handle1.addClass("round");this.handle2.addClass("round");break;case"triangle":this.handle1.addClass("triangle");this.handle2.addClass("triangle")}if(this.range?(this.value[0]=Math.max(this.min,Math.min(this.max,this.value[0])),this.value[1]=Math.max(this.min,Math.min(this.max,this.value[1]))):(this.value=[Math.max(this.min,Math.min(this.max,this.value))],this.handle2.addClass("hide"),this.value[1]=this.selection=="after"?this.max:this.min),this.diff=this.max-this.min,this.percentage=[(this.value[0]-this.min)*100/this.diff,(this.value[1]-this.min)*100/this.diff,this.step*100/this.diff],this.offset=this.picker.offset(),this.size=this.picker[0][this.sizePos],this.formater=i.formater,this.layout(),this.touchCapable)this.picker.on({touchstart:n.proxy(this.mousedown,this)});else this.picker.on({mousedown:n.proxy(this.mousedown,this)});if(r==="show")this.picker.on({mouseenter:n.proxy(this.showTooltip,this),mouseleave:n.proxy(this.hideTooltip,this)});else this.tooltip.addClass("hide")};t.prototype={constructor:t,over:!1,inDrag:!1,showTooltip:function(){this.tooltip.addClass("in");this.over=!0},hideTooltip:function(){this.inDrag===!1&&this.tooltip.removeClass("in");this.over=!1},layout:function(){this.handle1Stype[this.stylePos]=this.percentage[0]+"%";this.handle2Stype[this.stylePos]=this.percentage[1]+"%";this.orientation=="vertical"?(this.selectionElStyle.top=Math.min(this.percentage[0],this.percentage[1])+"%",this.selectionElStyle.height=Math.abs(this.percentage[0]-this.percentage[1])+"%"):(this.selectionElStyle.left=Math.min(this.percentage[0],this.percentage[1])+"%",this.selectionElStyle.width=Math.abs(this.percentage[0]-this.percentage[1])+"%");this.range?(this.tooltipInner.text(this.formater(this.value[0])+" - "+this.formater(this.value[1])),this.tooltip[0].style[this.stylePos]=this.size*(this.percentage[0]+(this.percentage[1]-this.percentage[0])/2)/100-(this.orientation==="vertical"?this.tooltip.outerHeight()/2:this.tooltip.outerWidth()/2)+"px"):(this.tooltipInner.text(this.formater(this.value[0])),this.tooltip[0].style[this.stylePos]=this.size*this.percentage[0]/100-(this.orientation==="vertical"?this.tooltip.outerHeight()/2:this.tooltip.outerWidth()/2)+"px")},mousedown:function(t){var i,u,f,r;if(this.touchCapable&&t.type==="touchstart"&&(t=t.originalEvent),this.offset=this.picker.offset(),this.size=this.picker[0][this.sizePos],i=this.getPercentage(t),this.range?(u=Math.abs(this.percentage[0]-i),f=Math.abs(this.percentage[1]-i),this.dragged=u<f?0:1):this.dragged=0,this.percentage[this.dragged]=i,this.layout(),this.touchCapable)n(document).on({touchmove:n.proxy(this.mousemove,this),touchend:n.proxy(this.mouseup,this)});else n(document).on({mousemove:n.proxy(this.mousemove,this),mouseup:n.proxy(this.mouseup,this)});return this.inDrag=!0,r=this.calculateValue(),this.element.trigger({type:"slideStart",value:r}).trigger({type:"slide",value:r}),!1},mousemove:function(n){var t,i;return this.touchCapable&&n.type==="touchmove"&&(n=n.originalEvent),t=this.getPercentage(n),this.range&&(this.dragged===0&&this.percentage[1]<t?(this.percentage[0]=this.percentage[1],this.dragged=1):this.dragged===1&&this.percentage[0]>t&&(this.percentage[1]=this.percentage[0],this.dragged=0)),this.percentage[this.dragged]=t,this.layout(),i=this.calculateValue(),this.element.trigger({type:"slide",value:i}).data("value",i).prop("value",i),!1},mouseup:function(){this.touchCapable?n(document).off({touchmove:this.mousemove,touchend:this.mouseup}):n(document).off({mousemove:this.mousemove,mouseup:this.mouseup});this.inDrag=!1;this.over==!1&&this.hideTooltip();this.element;var t=this.calculateValue();return this.element.trigger({type:"slideStop",value:t}).data("value",t).prop("value",t),!1},calculateValue:function(){var n;return this.range?(n=[this.min+Math.round(this.diff*this.percentage[0]/100/this.step)*this.step,this.min+Math.round(this.diff*this.percentage[1]/100/this.step)*this.step],this.value=n):(n=this.min+Math.round(this.diff*this.percentage[0]/100/this.step)*this.step,this.value=[n,this.value[1]]),n},getPercentage:function(n){this.touchCapable&&(n=n.touches[0]);var t=(n[this.mousePos]-this.offset[this.stylePos])*100/this.size;return t=Math.round(t/this.percentage[2])*this.percentage[2],Math.max(0,Math.min(100,t))},getValue:function(){return this.range?this.value:this.value[0]},setValue:function(n){this.value=n;this.range?(this.value[0]=Math.max(this.min,Math.min(this.max,this.value[0])),this.value[1]=Math.max(this.min,Math.min(this.max,this.value[1]))):(this.value=[Math.max(this.min,Math.min(this.max,this.value))],this.handle2.addClass("hide"),this.value[1]=this.selection=="after"?this.max:this.min);this.diff=this.max-this.min;this.percentage=[(this.value[0]-this.min)*100/this.diff,(this.value[1]-this.min)*100/this.diff,this.step*100/this.diff];this.layout()}};n.fn.slider=function(i,r){return this.each(function(){var f=n(this),u=f.data("slider"),e=typeof i=="object"&&i;u||f.data("slider",u=new t(this,n.extend({},n.fn.slider.defaults,e)));typeof i=="string"&&u[i](r)})};n.fn.slider.defaults={min:0,max:10,step:1,orientation:"horizontal",value:5,selection:"before",tooltip:"show",handle:"round",formater:function(n){return n}};n.fn.slider.Constructor=t}(window.jQuery);wysihtml5={version:"0.3.0",commands:{},dom:{},quirks:{},toolbar:{},lang:{},selection:{},views:{},INVISIBLE_SPACE:"﻿",EMPTY_FUNCTION:function(){},ELEMENT_NODE:1,TEXT_NODE:3,BACKSPACE_KEY:8,ENTER_KEY:13,ESCAPE_KEY:27,SPACE_KEY:32,DELETE_KEY:46};window.rangy=function(){function t(n,t){var i=typeof n[t];return i==k||!!(i==p&&n[t])||i=="unknown"}function f(n,t){return!!(typeof n[t]==p&&n[t])}function w(n,t){return typeof n[t]!=r}function s(n){return function(t,i){for(var r=i.length;r--;)if(!n(t,i[r]))return!1;return!0}}function b(n){return n&&h(n,tt)&&c(n,nt)}function i(t){window.alert("Rangy not supported in your browser. Reason: "+t);n.initialized=!0;n.supported=!1}function rt(t){var i="Rangy warning: "+t;n.config.alertOnWarn?window.alert(i):typeof window.console!=r&&typeof window.console.log!=r&&window.console.log(i)}function v(){var r,u,e,o,v,s,y;if(!n.initialized)for(u=!1,e=!1,t(document,"createRange")&&(r=document.createRange(),h(r,g)&&c(r,d)&&(u=!0),r.detach()),o=f(document,"body")?document.body:document.getElementsByTagName("body")[0],o&&t(o,"createTextRange")&&(r=o.createTextRange(),b(r)&&(e=!0)),u||e||i("Neither Range nor TextRange are implemented"),n.initialized=!0,n.features={implementsDomRange:u,implementsTextRange:e},v=a.concat(l),s=0,y=v.length;s<y;++s)try{v[s](n)}catch(p){f(window,"console")&&t(window.console,"log")&&window.console.log("Init listener threw an exception. Continuing.",p)}}function ut(n){n=n||window;v();for(var t=0,i=e.length;t<i;++t)e[t](n)}function u(n){this.name=n;this.initialized=!1;this.supported=!1}var p="object",k="function",r="undefined",d=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer","START_TO_START","START_TO_END","END_TO_START","END_TO_END"],g=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],nt=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],tt=["collapse","compareEndPoints","duplicate","getBookmark","moveToBookmark","moveToElementText","parentElement","pasteHTML","select","setEndPoint","getBoundingClientRect"],h=s(t),it=s(f),c=s(w),n={version:"1.2.2",initialized:!1,supported:!0,util:{isHostMethod:t,isHostObject:f,isHostProperty:w,areHostMethods:h,areHostObjects:it,areHostProperties:c,isTextRange:b},features:{},modules:{},config:{alertOnWarn:!1,preferTextRange:!1}},l,a,e,y,o;if(n.fail=i,n.warn=rt,{}.hasOwnProperty?n.util.extend=function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])}:i("hasOwnProperty not supported"),l=[],a=[],n.init=v,n.addInitListener=function(t){n.initialized?t(n):l.push(t)},e=[],n.addCreateMissingNativeApiListener=function(n){e.push(n)},n.createMissingNativeApi=ut,u.prototype.fail=function(n){this.initialized=!0;this.supported=!1;throw new Error("Module '"+this.name+"' failed to load: "+n);},u.prototype.warn=function(t){n.warn("Module "+this.name+": "+t)},u.prototype.createError=function(n){return new Error("Error in Rangy "+this.name+" module: "+n)},n.createModule=function(t,i){var r=new u(t);n.modules[t]=r;a.push(function(n){i(n,r);r.initialized=!0;r.supported=!0})},n.requireModules=function(t){for(var f=0,e=t.length,i,r;f<e;++f){if(r=t[f],i=n.modules[r],!i||!(i instanceof u))throw new Error("Module '"+r+"' not found");if(!i.supported)throw new Error("Module '"+r+"' not supported");}},y=!1,o=function(){y||(y=!0,n.initialized||v())},typeof window==r){i("No window found");return}if(typeof document==r){i("No document found");return}return t(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",o,!1),t(window,"addEventListener")?window.addEventListener("load",o,!1):t(window,"attachEvent")?window.attachEvent("onload",o):i("Window does not have required addEventListener or attachEvent method"),n}();rangy.createModule("DomUtil",function(n,t){function b(n){var t;return typeof n.namespaceURI==i||(t=n.namespaceURI)===null||t=="http://www.w3.org/1999/xhtml"}function k(n){var t=n.parentNode;return t.nodeType==1?t:null}function h(n){for(var t=0;n=n.previousSibling;)t++;return t}function d(n){var t;return c(n)?n.length:(t=n.childNodes)?t.length:0}function a(n,t){for(var r=[],i=n;i;i=i.parentNode)r.push(i);for(i=t;i;i=i.parentNode)if(s(r,i))return i;return null}function g(n,t,i){for(var r=i?t:t.parentNode;r;){if(r===n)return!0;r=r.parentNode}return!1}function f(n,t,i){for(var u,r=i?n:n.parentNode;r;){if(u=r.parentNode,u===t)return r;r=u}return null}function c(n){var t=n.nodeType;return t==3||t==4||t==8}function v(n,t){var i=t.nextSibling,r=t.parentNode;return i?r.insertBefore(n,i):r.appendChild(n),n}function nt(n,t){var i=n.cloneNode(!1);return i.deleteData(0,t),n.deleteData(t,n.length-t),v(i,n),i}function e(n){if(n.nodeType==9)return n;if(typeof n.ownerDocument!=i)return n.ownerDocument;if(typeof n.document!=i)return n.document;if(n.parentNode)return e(n.parentNode);throw new Error("getDocument: no document found for node");}function tt(n){var t=e(n);if(typeof t.defaultView!=i)return t.defaultView;if(typeof t.parentWindow!=i)return t.parentWindow;throw new Error("Cannot get a window object for node");}function it(n){if(typeof n.contentDocument!=i)return n.contentDocument;if(typeof n.contentWindow!=i)return n.contentWindow.document;throw new Error("getIframeWindow: No Document object found for iframe element");}function rt(n){if(typeof n.contentWindow!=i)return n.contentWindow;if(typeof n.contentDocument!=i)return n.contentDocument.defaultView;throw new Error("getIframeWindow: No Window object found for iframe element");}function ut(n){return r.isHostObject(n,"body")?n.body:n.getElementsByTagName("body")[0]}function ft(n){for(var t;t=n.parentNode;)n=t;return n}function et(n,t,i,r){var o,u,s,c,e;if(n==i)return t===r?0:t<r?-1:1;if(o=f(i,n,!0))return t<=h(o)?-1:1;if(o=f(n,i,!0))return h(o)<r?-1:1;if(u=a(n,i),s=n===u?u:f(n,u,!0),c=i===u?u:f(i,u,!0),s===c)throw new Error("comparePoints got to case 4 and childA and childB are the same!");else{for(e=u.firstChild;e;){if(e===s)return-1;if(e===c)return 1;e=e.nextSibling}throw new Error("Should not be here!");}}function ot(n){for(var t=e(n).createDocumentFragment(),i;i=n.firstChild;)t.appendChild(i);return t}function y(n){if(!n)return"[No node]";if(c(n))return'"'+n.data+'"';if(n.nodeType==1){var t=n.id?' id="'+n.id+'"':"";return"<"+n.nodeName+t+">["+n.childNodes.length+"]"}return n.nodeName}function p(n){this.root=n;this._next=n}function st(n){return new p(n)}function w(n,t){this.node=n;this.offset=t}function l(n){this.code=this[n];this.codeName=n;this.message="DOMException: "+this.codeName}var i="undefined",r=n.util,u,o,s;r.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||t.fail("document missing a Node creation method");r.isHostMethod(document,"getElementsByTagName")||t.fail("document missing getElementsByTagName method");u=document.createElement("div");r.areHostMethods(u,["insertBefore","appendChild","cloneNode"]||!r.areHostObjects(u,["previousSibling","nextSibling","childNodes","parentNode"]))||t.fail("Incomplete Element implementation");r.isHostProperty(u,"innerHTML")||t.fail("Element is missing innerHTML property");o=document.createTextNode("test");r.areHostMethods(o,["splitText","deleteData","insertData","appendData","cloneNode"]||!r.areHostObjects(u,["previousSibling","nextSibling","childNodes","parentNode"])||!r.areHostProperties(o,["data"]))||t.fail("Incomplete Text Node implementation");s=function(n,t){for(var i=n.length;i--;)if(n[i]===t)return!0;return!1};p.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var n=this._current=this._next,t,i;if(this._current)if(t=n.firstChild,t)this._next=t;else{for(i=null;n!==this.root&&!(i=n.nextSibling);)n=n.parentNode;this._next=i}return this._current},detach:function(){this._current=this._next=this.root=null}};w.prototype={equals:function(n){return this.node===n.node&this.offset==n.offset},inspect:function(){return"[DomPosition("+y(this.node)+":"+this.offset+")]"}};l.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11};l.prototype.toString=function(){return this.message};n.dom={arrayContains:s,isHtmlNamespace:b,parentElement:k,getNodeIndex:h,getNodeLength:d,getCommonAncestor:a,isAncestorOf:g,getClosestAncestorIn:f,isCharacterDataNode:c,insertAfter:v,splitDataNode:nt,getDocument:e,getWindow:tt,getIframeWindow:rt,getIframeDocument:it,getBody:ut,getRootContainer:ft,comparePoints:et,inspectNode:y,fragmentFromNodeChildren:ot,createIterator:st,DomPosition:w};n.DOMException=l});rangy.createModule("DomRange",function(n){function c(n,i){return n.nodeType!=3&&(t.isAncestorOf(n,i.startContainer,!0)||t.isAncestorOf(n,i.endContainer,!0))}function r(n){return t.getDocument(n.startContainer)}function ot(n,t,i){var u=n._listeners[t],r,f;if(u)for(r=0,f=u.length;r<f;++r)u[r].call(n,{target:n,args:i})}function st(n){return new et(n.parentNode,t.getNodeIndex(n))}function b(n){return new et(n.parentNode,t.getNodeIndex(n)+1)}function ht(n,i,r){var u=n.nodeType==11?n.firstChild:n;return t.isCharacterDataNode(i)?r==i.length?t.insertAfter(n,i):i.parentNode.insertBefore(n,r==0?i:t.splitDataNode(i,r)):r>=i.childNodes.length?i.appendChild(n):i.insertBefore(n,i.childNodes[r]),u}function ct(n){for(var i,t,e,u=r(n.range).createDocumentFragment();t=n.next();){if(i=n.isPartiallySelectedSubtree(),t=t.cloneNode(!i),i&&(e=n.getSubtreeIterator(),t.appendChild(ct(e)),e.detach(!0)),t.nodeType==10)throw new f("HIERARCHY_REQUEST_ERR");u.appendChild(t)}return u}function y(n,i,r){var e,o,u,f;for(r=r||{stop:!1};u=n.next();)if(n.isPartiallySelectedSubtree()){if(i(u)===!1){r.stop=!0;return}if(f=n.getSubtreeIterator(),y(f,i,r),f.detach(!0),r.stop)return}else for(e=t.createIterator(u);o=e.next();)if(i(o)===!1){r.stop=!0;return}}function lt(n){for(var t;n.next();)n.isPartiallySelectedSubtree()?(t=n.getSubtreeIterator(),lt(t),t.detach(!0)):n.remove()}function at(n){for(var t,u=r(n.range).createDocumentFragment(),i;t=n.next();){if(n.isPartiallySelectedSubtree()?(t=t.cloneNode(!1),i=n.getSubtreeIterator(),t.appendChild(at(i)),i.detach(!0)):n.remove(),t.nodeType==10)throw new f("HIERARCHY_REQUEST_ERR");u.appendChild(t)}return u}function vt(n,t,i){var u=!!(t&&t.length),f,e=!!i,r;return u&&(f=new RegExp("^("+t.join("|")+")$")),r=[],y(new o(n,!1),function(n){(!u||f.test(n.nodeType))&&(!e||i(n))&&r.push(n)}),r}function yt(n){var i=typeof n.getName=="undefined"?"Range":n.getName();return"["+i+"("+t.inspectNode(n.startContainer)+":"+n.startOffset+", "+t.inspectNode(n.endContainer)+":"+n.endOffset+")]"}function o(n,i){if(this.range=n,this.clonePartiallySelectedTextNodes=i,!n.collapsed){this.sc=n.startContainer;this.so=n.startOffset;this.ec=n.endContainer;this.eo=n.endOffset;var r=n.commonAncestorContainer;this.sc===this.ec&&t.isCharacterDataNode(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc===r&&!t.isCharacterDataNode(this.sc)?this.sc.childNodes[this.so]:t.getClosestAncestorIn(this.sc,r,!0),this._last=this.ec===r&&!t.isCharacterDataNode(this.ec)?this.ec.childNodes[this.eo-1]:t.getClosestAncestorIn(this.ec,r,!0))}}function s(n){this.code=this[n];this.codeName=n;this.message="RangeException: "+this.codeName}function pt(n,t,i){this.nodes=vt(n,t,i);this._next=this.nodes[0];this._position=0}function k(n){return function(i,r){for(var f,u=r?i:i.parentNode;u;){if(f=u.nodeType,t.arrayContains(n,f))return u;u=u.parentNode}return null}}function a(n,t){if(vi(n,t))throw new s("INVALID_NODE_TYPE_ERR");}function e(n){if(!n.startContainer)throw new f("INVALID_STATE_ERR");}function v(n,i){if(!t.arrayContains(i,n.nodeType))throw new s("INVALID_NODE_TYPE_ERR");}function g(n,i){if(i<0||i>(t.isCharacterDataNode(n)?n.length:n.childNodes.length))throw new f("INDEX_SIZE_ERR");}function nt(n,t){if(d(n,!0)!==d(t,!0))throw new f("WRONG_DOCUMENT_ERR");}function h(n){if(ai(n,!0))throw new f("NO_MODIFICATION_ALLOWED_ERR");}function p(n,t){if(!n)throw new f(t);}function kt(n){return!t.arrayContains(bt,n.nodeType)&&!d(n,!0)}function dt(n,i){return i<=(t.isCharacterDataNode(n)?n.length:n.childNodes.length)}function i(n){if(e(n),kt(n.startContainer)||kt(n.endContainer)||!dt(n.startContainer,n.startOffset)||!dt(n.endContainer,n.endOffset))throw new Error("Range error: Range is no longer valid after DOM mutation ("+n.inspect()+")");}function ft(){}function ui(n){n.START_TO_START=rt;n.START_TO_END=gt;n.END_TO_END=pi;n.END_TO_START=ni;n.NODE_BEFORE=ti;n.NODE_AFTER=ii;n.NODE_BEFORE_AND_AFTER=ri;n.NODE_INSIDE=ut}function fi(n){ui(n);ui(n.prototype)}function ei(n,r){return function(){var a;i(this);var u=this.startContainer,e=this.startOffset,c=this.commonAncestorContainer,f=new o(this,!0),l,s;return u!==c&&(l=t.getClosestAncestorIn(u,c,!0),s=b(l),u=s.node,e=s.offset),y(f,h),f.reset(),a=n(f),f.detach(),r(this,u,e,u,e),a}}function oi(r,u,f){function s(n,t){return function(i){e(this);v(i,wt);v(l(i),bt);var r=(n?st:b)(i);(t?y:p)(this,r.node,r.offset)}}function y(n,i,r){var f=n.endContainer,e=n.endOffset;(i!==n.startContainer||r!==n.startOffset)&&((l(i)!=l(f)||t.comparePoints(i,r,f,e)==1)&&(f=i,e=r),u(n,i,r,f,e))}function p(n,i,r){var f=n.startContainer,e=n.startOffset;(i!==n.endContainer||r!==n.endOffset)&&((l(i)!=l(f)||t.comparePoints(i,r,f,e)==-1)&&(f=i,e=r),u(n,f,e,i,r))}function w(n,t,i){(t!==n.startContainer||i!==n.startOffset||t!==n.endContainer||i!==n.endOffset)&&u(n,t,i,t,i)}r.prototype=new ft;n.util.extend(r.prototype,{setStart:function(n,t){e(this);a(n,!0);g(n,t);y(this,n,t)},setEnd:function(n,t){e(this);a(n,!0);g(n,t);p(this,n,t)},setStartBefore:s(!0,!0),setStartAfter:s(!1,!0),setEndBefore:s(!0,!1),setEndAfter:s(!1,!1),collapse:function(n){i(this);n?u(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):u(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(n){e(this);a(n,!0);u(this,n,0,n,t.getNodeLength(n))},selectNode:function(n){e(this);a(n,!1);v(n,wt);var t=st(n),i=b(n);u(this,t.node,t.offset,i.node,i.offset)},extractContents:ei(at,u),deleteContents:ei(lt,u),canSurroundContents:function(){i(this);h(this.startContainer);h(this.endContainer);var n=new o(this,!0),t=n._first&&c(n._first,this)||n._last&&c(n._last,this);return n.detach(),!t},detach:function(){f(this)},splitBoundaries:function(){i(this);var n=this.startContainer,e=this.startOffset,r=this.endContainer,f=this.endOffset,o=n===r;t.isCharacterDataNode(r)&&f>0&&f<r.length&&t.splitDataNode(r,f);t.isCharacterDataNode(n)&&e>0&&e<n.length&&(n=t.splitDataNode(n,e),o?(f-=e,r=n):r==n.parentNode&&f>=t.getNodeIndex(n)&&f++,e=0);u(this,n,e,r,f)},normalizeBoundaries:function(){var o,s;i(this);var f=this.startContainer,e=this.startOffset,n=this.endContainer,r=this.endOffset,h=function(t){var i=t.nextSibling;i&&i.nodeType==t.nodeType&&(n=t,r=t.length,t.appendData(i.data),i.parentNode.removeChild(i))},c=function(i){var u=i.previousSibling,s,o;u&&u.nodeType==i.nodeType&&(f=i,s=i.length,e=u.length,i.insertData(0,u.data),u.parentNode.removeChild(u),f==n?(r+=e,n=f):n==i.parentNode&&(o=t.getNodeIndex(i),r==o?(n=i,r=s):r>o&&r--))},l=!0;t.isCharacterDataNode(n)?n.length==r&&h(n):(r>0&&(o=n.childNodes[r-1],o&&t.isCharacterDataNode(o)&&h(o)),l=!this.collapsed);l?t.isCharacterDataNode(f)?e==0&&c(f):e<f.childNodes.length&&(s=f.childNodes[e],s&&t.isCharacterDataNode(s)&&c(s)):(f=n,e=r);u(this,f,e,n,r)},collapseToPoint:function(n,t){e(this);a(n,!0);g(n,t);w(this,n,t)}});fi(r)}function si(n){n.collapsed=n.startContainer===n.endContainer&&n.startOffset===n.endOffset;n.commonAncestorContainer=n.collapsed?n.startContainer:t.getCommonAncestor(n.startContainer,n.endContainer)}function hi(n,t,i,r,u){var f=n.startContainer!==t||n.startOffset!==i,e=n.endContainer!==r||n.endOffset!==u;n.startContainer=t;n.startOffset=i;n.endContainer=r;n.endOffset=u;si(n);ot(n,"boundarychange",{startMoved:f,endMoved:e})}function wi(n){e(n);n.startContainer=n.startOffset=n.endContainer=n.endOffset=null;n.collapsed=n.commonAncestorContainer=null;ot(n,"detach",null);n._listeners=null}function u(n){this.startContainer=n;this.startOffset=0;this.endContainer=n;this.endOffset=0;this._listeners={boundarychange:[],detach:[]};si(this)}var tt,w;n.requireModules(["DomUtil"]);var t=n.dom,et=t.DomPosition,f=n.DOMException;o.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null;this._next=this._first},hasNext:function(){return!!this._next},next:function(){var n=this._current=this._next;return n&&(this._next=n!==this._last?n.nextSibling:null,t.isCharacterDataNode(n)&&this.clonePartiallySelectedTextNodes&&(n===this.ec&&(n=n.cloneNode(!0)).deleteData(this.eo,n.length-this.eo),this._current===this.sc&&(n=n.cloneNode(!0)).deleteData(0,this.so))),n},remove:function(){var n=this._current,i,r;t.isCharacterDataNode(n)&&(n===this.sc||n===this.ec)?(i=n===this.sc?this.so:0,r=n===this.ec?this.eo:n.length,i!=r&&n.deleteData(i,r-i)):n.parentNode&&n.parentNode.removeChild(n)},isPartiallySelectedSubtree:function(){var n=this._current;return c(n,this.range)},getSubtreeIterator:function(){var n;if(this.isSingleCharacterDataNode)n=this.range.cloneRange(),n.collapse();else{n=new u(r(this.range));var i=this._current,f=i,e=0,s=i,h=t.getNodeLength(i);t.isAncestorOf(i,this.sc,!0)&&(f=this.sc,e=this.so);t.isAncestorOf(i,this.ec,!0)&&(s=this.ec,h=this.eo);hi(n,f,e,s,h)}return new o(n,this.clonePartiallySelectedTextNodes)},detach:function(n){n&&this.range.detach();this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};s.prototype={BAD_BOUNDARYPOINTS_ERR:1,INVALID_NODE_TYPE_ERR:2};s.prototype.toString=function(){return this.message};pt.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){return this._current=this._next,this._next=this.nodes[++this._position],this._current},detach:function(){this._current=this._next=this.nodes=null}};var wt=[1,3,4,5,7,8,10],bt=[2,9,11],ci=[1,3,4,5,7,8,10,11],li=[1,3,4,5,7,8];var l=t.getRootContainer,d=k([9,11]),ai=k([5,6,10,12]),vi=k([6,10,12]);tt=document.createElement("style");w=!1;try{tt.innerHTML="<b>x<\/b>";w=tt.firstChild.nodeType==3}catch(bi){}n.features.htmlParsingConforms=w;var yi=w?function(n){var r=this.startContainer,u=t.getDocument(r),i;if(!r)throw new f("INVALID_STATE_ERR");return i=null,r.nodeType==1?i=r:t.isCharacterDataNode(r)&&(i=t.parentElement(r)),i=i===null||i.nodeName=="HTML"&&t.isHtmlNamespace(t.getDocument(i).documentElement)&&t.isHtmlNamespace(i)?u.createElement("body"):i.cloneNode(!1),i.innerHTML=n,t.fragmentFromNodeChildren(i)}:function(n){e(this);var u=r(this),i=u.createElement("body");return i.innerHTML=n,t.fragmentFromNodeChildren(i)},it=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],rt=0,gt=1,pi=2,ni=3,ti=0,ii=1,ri=2,ut=3;ft.prototype={attachListener:function(n,t){this._listeners[n].push(t)},compareBoundaryPoints:function(n,r){i(this);nt(this.startContainer,r.startContainer);var u,f,e,o,s=n==ni||n==rt?"start":"end",h=n==gt||n==rt?"start":"end";return u=this[s+"Container"],f=this[s+"Offset"],e=r[h+"Container"],o=r[h+"Offset"],t.comparePoints(u,f,e,o)},insertNode:function(n){if(i(this),v(n,ci),h(this.startContainer),t.isAncestorOf(n,this.startContainer,!0))throw new f("HIERARCHY_REQUEST_ERR");var r=ht(n,this.startContainer,this.startOffset);this.setStartBefore(r)},cloneContents:function(){var n,u,f;return i(this),this.collapsed?r(this).createDocumentFragment():this.startContainer===this.endContainer&&t.isCharacterDataNode(this.startContainer)?(n=this.startContainer.cloneNode(!0),n.data=n.data.slice(this.startOffset,this.endOffset),u=r(this).createDocumentFragment(),u.appendChild(n),u):(f=new o(this,!0),n=ct(f),f.detach(),n)},canSurroundContents:function(){i(this);h(this.startContainer);h(this.endContainer);var n=new o(this,!0),t=n._first&&c(n._first,this)||n._last&&c(n._last,this);return n.detach(),!t},surroundContents:function(n){if(v(n,li),!this.canSurroundContents())throw new s("BAD_BOUNDARYPOINTS_ERR");var t=this.extractContents();if(n.hasChildNodes())while(n.lastChild)n.removeChild(n.lastChild);ht(n,this.startContainer,this.startOffset);n.appendChild(t);this.selectNode(n)},cloneRange:function(){i(this);for(var t=new u(r(this)),f=it.length,n;f--;)n=it[f],t[n]=this[n];return t},toString:function(){var n,r,u;return i(this),n=this.startContainer,n===this.endContainer&&t.isCharacterDataNode(n)?n.nodeType==3||n.nodeType==4?n.data.slice(this.startOffset,this.endOffset):"":(r=[],u=new o(this,!0),y(u,function(n){(n.nodeType==3||n.nodeType==4)&&r.push(n.data)}),u.detach(),r.join(""))},compareNode:function(n){var r,u,o,e;if(i(this),r=n.parentNode,u=t.getNodeIndex(n),!r)throw new f("NOT_FOUND_ERR");return o=this.comparePoint(r,u),e=this.comparePoint(r,u+1),o<0?e>0?ri:ti:e>0?ii:ut},comparePoint:function(n,r){return(i(this),p(n,"HIERARCHY_REQUEST_ERR"),nt(n,this.startContainer),t.comparePoints(n,r,this.startContainer,this.startOffset)<0)?-1:t.comparePoints(n,r,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:yi,toHtml:function(){i(this);var n=r(this).createElement("div");return n.appendChild(this.cloneContents()),n.innerHTML},intersectsNode:function(n,u){var f,e,o,s;return(i(this),p(n,"NOT_FOUND_ERR"),t.getDocument(n)!==r(this))?!1:(f=n.parentNode,e=t.getNodeIndex(n),p(f,"NOT_FOUND_ERR"),o=t.comparePoints(f,e,this.endContainer,this.endOffset),s=t.comparePoints(f,e+1,this.startContainer,this.startOffset),u?o<=0&&s>=0:o<0&&s>0)},isPointInRange:function(n,r){return i(this),p(n,"HIERARCHY_REQUEST_ERR"),nt(n,this.startContainer),t.comparePoints(n,r,this.startContainer,this.startOffset)>=0&&t.comparePoints(n,r,this.endContainer,this.endOffset)<=0},intersectsRange:function(n,u){if(i(this),r(n)!=r(this))throw new f("WRONG_DOCUMENT_ERR");var e=t.comparePoints(this.startContainer,this.startOffset,n.endContainer,n.endOffset),o=t.comparePoints(this.endContainer,this.endOffset,n.startContainer,n.startOffset);return u?e<=0&&o>=0:e<0&&o>0},intersection:function(n){if(this.intersectsRange(n)){var r=t.comparePoints(this.startContainer,this.startOffset,n.startContainer,n.startOffset),u=t.comparePoints(this.endContainer,this.endOffset,n.endContainer,n.endOffset),i=this.cloneRange();return r==-1&&i.setStart(n.startContainer,n.startOffset),u==1&&i.setEnd(n.endContainer,n.endOffset),i}return null},union:function(n){if(this.intersectsRange(n,!0)){var i=this.cloneRange();return t.comparePoints(n.startContainer,n.startOffset,this.startContainer,this.startOffset)==-1&&i.setStart(n.startContainer,n.startOffset),t.comparePoints(n.endContainer,n.endOffset,this.endContainer,this.endOffset)==1&&i.setEnd(n.endContainer,n.endOffset),i}throw new s("Ranges do not intersect");},containsNode:function(n,t){return t?this.intersectsNode(n,!1):this.compareNode(n)==ut},containsNodeContents:function(n){return this.comparePoint(n,0)>=0&&this.comparePoint(n,t.getNodeLength(n))<=0},containsRange:function(n){return this.intersection(n).equals(n)},containsNodeText:function(n){var t=this.cloneRange(),i,r,u;return t.selectNode(n),i=t.getNodes([3]),i.length>0?(t.setStart(i[0],0),r=i.pop(),t.setEnd(r,r.length),u=this.containsRange(t),t.detach(),u):this.containsNodeContents(n)},createNodeIterator:function(n,t){return i(this),new pt(this,n,t)},getNodes:function(n,t){return i(this),vt(this,n,t)},getDocument:function(){return r(this)},collapseBefore:function(n){e(this);this.setEndBefore(n);this.collapse(!1)},collapseAfter:function(n){e(this);this.setStartAfter(n);this.collapse(!0)},getName:function(){return"DomRange"},equals:function(n){return u.rangesEqual(this,n)},inspect:function(){return yt(this)}};oi(u,hi,wi);n.rangePrototype=ft.prototype;u.rangeProperties=it;u.RangeIterator=o;u.copyComparisonConstants=fi;u.createPrototypeRange=oi;u.inspect=yt;u.getRangeDocument=r;u.rangesEqual=function(n,t){return n.startContainer===t.startContainer&&n.startOffset===t.startOffset&&n.endContainer===t.endContainer&&n.endOffset===t.endOffset};n.DomRange=u;n.RangeException=s});rangy.createModule("WrappedRange",function(n){function s(n){var e=n.parentElement(),i=n.duplicate(),r,f,u;return i.collapse(!0),r=i.parentElement(),i=n.duplicate(),i.collapse(!1),f=i.parentElement(),u=r==f?r:t.getCommonAncestor(r,f),u==e?u:t.getCommonAncestor(e,u)}function h(n){return n.compareEndPoints("StartToEnd",n)==0}function f(n,i,u,f){var s=n.duplicate(),o,e,y,w,c,a,p,l,v,h,b;if(s.collapse(u),o=s.parentElement(),t.isAncestorOf(i,o,!0)||(o=i),!o.canHaveHTML)return new r(o.parentNode,t.getNodeIndex(o));e=t.getDocument(o).createElement("span");w=u?"StartToStart":"StartToEnd";do o.insertBefore(e,e.previousSibling),s.moveToElementText(e);while((y=s.compareEndPoints(w,n))>0&&e.previousSibling);if(l=e.nextSibling,y==-1&&l&&t.isCharacterDataNode(l)){if(s.setEndPoint(u?"EndToStart":"EndToEnd",n),/[\r\n]/.test(l.data))for(h=s.duplicate(),b=h.text.replace(/\r\n/g,"\r").length,v=h.moveStart("character",b);(y=h.compareEndPoints("StartToEnd",h))==-1;)v++,h.moveStart("character",1);else v=s.text.length;p=new r(l,v)}else c=(f||!u)&&e.previousSibling,a=(f||u)&&e.nextSibling,p=a&&t.isCharacterDataNode(a)?new r(a,0):c&&t.isCharacterDataNode(c)?new r(c,c.length):new r(o,t.getNodeIndex(e));return e.parentNode.removeChild(e),p}function e(n,i){var u,f,o=n.offset,h=t.getDocument(n.node),r,s,e=h.body.createTextRange(),c=t.isCharacterDataNode(n.node);return c?(u=n.node,f=u.parentNode):(s=n.node.childNodes,u=o<s.length?s[o]:null,f=n.node),r=h.createElement("span"),r.innerHTML="&#feff;",u?f.insertBefore(r,u):f.appendChild(r),e.moveToElementText(r),e.collapse(!i),f.removeChild(r),c&&e[i?"moveStart":"moveEnd"]("character",o),e}var o;n.requireModules(["DomUtil","DomRange"]);var i,t=n.dom,r=t.DomPosition,u=n.DomRange;!n.features.implementsDomRange||n.features.implementsTextRange&&n.config.preferTextRange?n.features.implementsTextRange&&(i=function(n){this.textRange=n;this.refresh()},i.prototype=new u(document),i.prototype.refresh=function(){var n,t,i=s(this.textRange);h(this.textRange)?t=n=f(this.textRange,i,!0,!0):(n=f(this.textRange,i,!0,!1),t=f(this.textRange,i,!1,!1));this.setStart(n.node,n.offset);this.setEnd(t.node,t.offset)},u.copyComparisonConstants(i),o=function(){return this}(),typeof o.Range=="undefined"&&(o.Range=i),n.createNativeRange=function(n){return n=n||document,n.body.createTextRange()}):(function(){function o(n){for(var i=c.length,t;i--;)t=c[i],n[t]=n.nativeRange[t]}function a(n,t,i,r,u){var f=n.startContainer!==t||n.startOffset!=i,e=n.endContainer!==r||n.endOffset!=u;(f||e)&&(n.setEnd(r,u),n.setStart(t,i))}function v(n){n.nativeRange.detach();n.detached=!0;for(var t=c.length,i;t--;)i=c[t],n[i]=null}var r,c=u.rangeProperties,l,h,e,f,s;i=function(n){if(!n)throw new Error("Range must be specified");this.nativeRange=n;o(this)};u.createPrototypeRange(i,a,v);r=i.prototype;r.selectNode=function(n){this.nativeRange.selectNode(n);o(this)};r.deleteContents=function(){this.nativeRange.deleteContents();o(this)};r.extractContents=function(){var n=this.nativeRange.extractContents();return o(this),n};r.cloneContents=function(){return this.nativeRange.cloneContents()};r.surroundContents=function(n){this.nativeRange.surroundContents(n);o(this)};r.collapse=function(n){this.nativeRange.collapse(n);o(this)};r.cloneRange=function(){return new i(this.nativeRange.cloneRange())};r.refresh=function(){o(this)};r.toString=function(){return this.nativeRange.toString()};e=document.createTextNode("test");t.getBody(document).appendChild(e);f=document.createRange();f.setStart(e,0);f.setEnd(e,0);try{f.setStart(e,1);l=!0;r.setStart=function(n,t){this.nativeRange.setStart(n,t);o(this)};r.setEnd=function(n,t){this.nativeRange.setEnd(n,t);o(this)};h=function(n){return function(t){this.nativeRange[n](t);o(this)}}}catch(y){l=!1;r.setStart=function(n,t){try{this.nativeRange.setStart(n,t)}catch(i){this.nativeRange.setEnd(n,t);this.nativeRange.setStart(n,t)}o(this)};r.setEnd=function(n,t){try{this.nativeRange.setEnd(n,t)}catch(i){this.nativeRange.setStart(n,t);this.nativeRange.setEnd(n,t)}o(this)};h=function(n,t){return function(i){try{this.nativeRange[n](i)}catch(r){this.nativeRange[t](i);this.nativeRange[n](i)}o(this)}}}r.setStartBefore=h("setStartBefore","setEndBefore");r.setStartAfter=h("setStartAfter","setEndAfter");r.setEndBefore=h("setEndBefore","setStartBefore");r.setEndAfter=h("setEndAfter","setStartAfter");f.selectNodeContents(e);r.selectNodeContents=f.startContainer==e&&f.endContainer==e&&f.startOffset==0&&f.endOffset==e.length?function(n){this.nativeRange.selectNodeContents(n);o(this)}:function(n){this.setStart(n,0);this.setEnd(n,u.getEndOffset(n))};f.selectNodeContents(e);f.setEnd(e,3);s=document.createRange();s.selectNodeContents(e);s.setEnd(e,4);s.setStart(e,2);r.compareBoundaryPoints=f.compareBoundaryPoints(f.START_TO_END,s)==-1&f.compareBoundaryPoints(f.END_TO_START,s)==1?function(n,t){return t=t.nativeRange||t,n==t.START_TO_END?n=t.END_TO_START:n==t.END_TO_START&&(n=t.START_TO_END),this.nativeRange.compareBoundaryPoints(n,t)}:function(n,t){return this.nativeRange.compareBoundaryPoints(n,t.nativeRange||t)};n.util.isHostMethod(f,"createContextualFragment")&&(r.createContextualFragment=function(n){return this.nativeRange.createContextualFragment(n)});t.getBody(document).removeChild(e);f.detach();s.detach()}(),n.createNativeRange=function(n){return n=n||document,n.createRange()});n.features.implementsTextRange&&(i.rangeToTextRange=function(n){if(n.collapsed)return e(new r(n.startContainer,n.startOffset),!0);var u=e(new r(n.startContainer,n.startOffset),!0),f=e(new r(n.endContainer,n.endOffset),!1),i=t.getDocument(n.startContainer).body.createTextRange();return i.setEndPoint("StartToStart",u),i.setEndPoint("EndToEnd",f),i});i.prototype.getName=function(){return"WrappedRange"};n.WrappedRange=i;n.createRange=function(t){return t=t||document,new i(n.createNativeRange(t))};n.createRangyRange=function(n){return n=n||document,new u(n)};n.createIframeRange=function(i){return n.createRange(t.getIframeDocument(i))};n.createIframeRangyRange=function(i){return n.createRangyRange(t.getIframeDocument(i))};n.addCreateMissingNativeApiListener(function(t){var i=t.document;typeof i.createRange=="undefined"&&(i.createRange=function(){return n.createRange(this)});i=t=null})});rangy.createModule("WrappedSelection",function(n,t){function ri(n){return(n||window).getSelection()}function yt(n){return(n||window).document.selection}function p(n,t,i){var r=i?"end":"start",u=i?"start":"end";n.anchorNode=t[r+"Container"];n.anchorOffset=t[r+"Offset"];n.focusNode=t[u+"Container"];n.focusOffset=t[u+"Offset"]}function ui(n){var t=n.nativeSelection;n.anchorNode=t.anchorNode;n.anchorOffset=t.anchorOffset;n.focusNode=t.focusNode;n.focusOffset=t.focusOffset}function s(n){n.anchorNode=n.focusNode=null;n.anchorOffset=n.focusOffset=0;n.rangeCount=0;n.isCollapsed=!0;n._ranges.length=0}function st(t){var i;return t instanceof h?(i=t._selectionNativeRange,i||(i=n.createNativeRange(r.getDocument(t.startContainer)),i.setEnd(t.endContainer,t.endOffset),i.setStart(t.startContainer,t.startOffset),t._selectionNativeRange=i,t.attachListener("detach",function(){this._selectionNativeRange=null}))):t instanceof k?i=t.nativeRange:n.features.implementsDomRange&&t instanceof r.getWindow(t.startContainer).Range&&(i=t),i}function fi(n){if(!n.length||n[0].nodeType!=1)return!1;for(var t=1,i=n.length;t<i;++t)if(!r.isAncestorOf(n[0],n[t]))return!1;return!0}function ht(n){var t=n.getNodes();if(!fi(t))throw new Error("getSingleElementFromRange: range "+n.inspect()+" did not consist of a single element");return t[0]}function kt(n){return!!n&&typeof n.text!="undefined"}function dt(n,t){var i=new k(t);n._ranges=[i];p(n,i,!1);n.rangeCount=1;n.isCollapsed=i.collapsed}function w(t){var i,f,e,u;if(t._ranges.length=0,t.docSelection.type=="None")s(t);else if(i=t.docSelection.createRange(),kt(i))dt(t,i);else{for(t.rangeCount=i.length,e=r.getDocument(i.item(0)),u=0;u<t.rangeCount;++u)f=n.createRange(e),f.selectNode(i.item(u)),t._ranges.push(f);t.isCollapsed=t.rangeCount==1&&t._ranges[0].collapsed;p(t,t._ranges[t.rangeCount-1],!1)}}function gt(n,t){for(var u=n.docSelection.createRange(),o=ht(t),s=r.getDocument(u.item(0)),f=r.getBody(s).createControlRange(),i=0,e=u.length;i<e;++i)f.add(u.item(i));try{f.add(o)}catch(h){throw new Error("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)");}f.select();w(n)}function rt(n,t,i){this.nativeSelection=n;this.docSelection=t;this._ranges=[];this.win=i;this.refresh()}function ni(n,t){for(var e=r.getDocument(t[0].startContainer),u=r.getBody(e).createControlRange(),f,i=0;i<rangeCount;++i){f=ht(t[i]);try{u.add(f)}catch(o){throw new Error("setRanges(): Element within the one of the specified Ranges could not be added to control selection (does it have layout?)");}}u.select();w(n)}function ti(n,t){if(n.anchorNode&&r.getDocument(n.anchorNode)!==r.getDocument(t))throw new d("WRONG_DOCUMENT_ERR");}function ii(n){var i=[],u=new vt(n.anchorNode,n.anchorOffset),f=new vt(n.focusNode,n.focusOffset),e=typeof n.getName=="function"?n.getName():"Selection",t,r;if(typeof n.rangeCount!="undefined")for(t=0,r=n.rangeCount;t<r;++t)i[t]=h.inspect(n.getRangeAt(t));return"["+e+"(Ranges: "+i.join(", ")+")(anchor: "+u.inspect()+", focus: "+f.inspect()+"]"}var nt,et,tt,ot,e,bt,it,i,ct,ut,lt,b;n.requireModules(["DomUtil","DomRange","WrappedRange"]);n.config.checkSelectionRanges=!0;var at="boolean",ft="_rangySelection",r=n.dom,f=n.util,h=n.DomRange,k=n.WrappedRange,d=n.DOMException,vt=r.DomPosition,l,g,o="Control";var pt=n.util.isHostMethod(window,"getSelection"),a=n.util.isHostObject(document,"selection"),v=a&&(!pt||n.config.preferTextRange);v?(l=yt,n.isSelectionValid=function(n){var t=(n||window).document,i=t.selection;return i.type!="None"||r.getDocument(i.createRange().parentElement())==t}):pt?(l=ri,n.isSelectionValid=function(){return!0}):t.fail("Neither document.selection or window.getSelection() detected.");n.getNativeSelection=l;var u=l(),wt=n.createNativeRange(document),y=r.getBody(document),c=f.areHostObjects(u,["anchorNode","focusNode"]&&f.areHostProperties(u,["anchorOffset","focusOffset"]));if(n.features.selectionHasAnchorAndFocus=c,nt=f.isHostMethod(u,"extend"),n.features.selectionHasExtend=nt,et=typeof u.rangeCount=="number",n.features.selectionHasRangeCount=et,tt=!1,ot=!0,f.areHostMethods(u,["addRange","getRangeAt","removeAllRanges"])&&typeof u.rangeCount=="number"&&n.features.implementsDomRange&&function(){var u=document.createElement("iframe"),t,f;y.appendChild(u);t=r.getIframeDocument(u);t.open();t.write("<html><head><\/head><body>12<\/body><\/html>");t.close();var i=r.getIframeWindow(u).getSelection(),o=t.documentElement,s=o.lastChild,e=s.firstChild,n=t.createRange();n.setStart(e,1);n.collapse(!0);i.addRange(n);ot=i.rangeCount==1;i.removeAllRanges();f=n.cloneRange();n.setStart(e,0);f.setEnd(e,2);i.addRange(n);i.addRange(f);tt=i.rangeCount==2;n.detach();f.detach();y.removeChild(u)}(),n.features.selectionSupportsMultipleRanges=tt,n.features.collapsedNonEditableSelectionsSupported=ot,e=!1,y&&f.isHostMethod(y,"createControlRange")&&(bt=y.createControlRange(),f.areHostProperties(bt,["item","add"])&&(e=!0)),n.features.implementsControlRange=e,g=c?function(n){return n.anchorNode===n.focusNode&&n.anchorOffset===n.focusOffset}:function(n){return n.rangeCount?n.getRangeAt(n.rangeCount-1).collapsed:!1},f.isHostMethod(u,"getRangeAt")?it=function(n,t){try{return n.getRangeAt(t)}catch(i){return null}}:c&&(it=function(t){var u=r.getDocument(t.anchorNode),i=n.createRange(u);return i.setStart(t.anchorNode,t.anchorOffset),i.setEnd(t.focusNode,t.focusOffset),i.collapsed!==this.isCollapsed&&(i.setStart(t.focusNode,t.focusOffset),i.setEnd(t.anchorNode,t.anchorOffset)),i}),n.getSelection=function(n){n=n||window;var t=n[ft],i=l(n),r=a?yt(n):null;return t?(t.nativeSelection=i,t.docSelection=r,t.refresh(n)):(t=new rt(i,r,n),n[ft]=t),t},n.getIframeSelection=function(t){return n.getSelection(r.getIframeWindow(t))},i=rt.prototype,!v&&c&&f.areHostMethods(u,["removeAllRanges","addRange"]))i.removeAllRanges=function(){this.nativeSelection.removeAllRanges();s(this)},ct=function(t,i){var u=h.getRangeDocument(i),r=n.createRange(u);r.collapseToPoint(i.endContainer,i.endOffset);t.nativeSelection.addRange(st(r));t.nativeSelection.extend(i.startContainer,i.startOffset);t.refresh()},i.addRange=et?function(t,i){var u,r;e&&a&&this.docSelection.type==o?gt(this,t):i&&nt?ct(this,t):(tt?u=this.rangeCount:(this.removeAllRanges(),u=0),this.nativeSelection.addRange(st(t)),this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==u+1?(n.config.checkSelectionRanges&&(r=it(this.nativeSelection,this.rangeCount-1),r&&!h.rangesEqual(r,t)&&(t=new k(r))),this._ranges[this.rangeCount-1]=t,p(this,t,b(this.nativeSelection)),this.isCollapsed=g(this)):this.refresh())}:function(n,t){t&&nt?ct(this,n):(this.nativeSelection.addRange(st(n)),this.refresh())},i.setRanges=function(n){if(e&&n.length>1)ni(this,n);else{this.removeAllRanges();for(var t=0,i=n.length;t<i;++t)this.addRange(n[t])}};else if(f.isHostMethod(u,"empty")&&f.isHostMethod(wt,"select")&&e&&v)i.removeAllRanges=function(){var n,t,i;try{this.docSelection.empty();this.docSelection.type!="None"&&(this.anchorNode?n=r.getDocument(this.anchorNode):this.docSelection.type==o&&(t=this.docSelection.createRange(),t.length&&(n=r.getDocument(t.item(0)).body.createTextRange())),n&&(i=n.body.createTextRange(),i.select(),this.docSelection.empty()))}catch(u){}s(this)},i.addRange=function(n){this.docSelection.type==o?gt(this,n):(k.rangeToTextRange(n).select(),this._ranges[0]=n,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,p(this,n,!1))},i.setRanges=function(n){this.removeAllRanges();var t=n.length;t>1?ni(this,n):t&&this.addRange(n[0])};else return t.fail("No means of selecting a Range or TextRange was found"),!1;if(i.getRangeAt=function(n){if(n<0||n>=this.rangeCount)throw new d("INDEX_SIZE_ERR");else return this._ranges[n]},v)ut=function(t){var i;n.isSelectionValid(t.win)?i=t.docSelection.createRange():(i=r.getBody(t.win.document).createTextRange(),i.collapse(!0));t.docSelection.type==o?w(t):kt(i)?dt(t,i):s(t)};else if(f.isHostMethod(u,"getRangeAt")&&typeof u.rangeCount=="number")ut=function(t){if(e&&a&&t.docSelection.type==o)w(t);else if(t._ranges.length=t.rangeCount=t.nativeSelection.rangeCount,t.rangeCount){for(var i=0,r=t.rangeCount;i<r;++i)t._ranges[i]=new n.WrappedRange(t.nativeSelection.getRangeAt(i));p(t,t._ranges[t.rangeCount-1],b(t.nativeSelection));t.isCollapsed=g(t)}else s(t)};else if(c&&typeof u.isCollapsed==at&&typeof wt.collapsed==at&&n.features.implementsDomRange)ut=function(n){var t,i=n.nativeSelection;i.anchorNode?(t=it(i,0),n._ranges=[t],n.rangeCount=1,ui(n),n.isCollapsed=g(n)):s(n)};else return t.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;i.refresh=function(n){var i=n?this._ranges.slice(0):null,t;if(ut(this),n){if(t=i.length,t!=this._ranges.length)return!1;while(t--)if(!h.rangesEqual(i[t],this._ranges[t]))return!1;return!0}};lt=function(n,t){var r=n.getAllRanges(),u=!1,i,f;for(n.removeAllRanges(),i=0,f=r.length;i<f;++i)u||t!==r[i]?n.addRange(r[i]):u=!0;n.rangeCount||s(n)};i.removeRange=e?function(n){var t,s;if(this.docSelection.type==o){var i=this.docSelection.createRange(),h=ht(n),c=r.getDocument(i.item(0)),u=r.getBody(c).createControlRange(),f,e=!1;for(t=0,s=i.length;t<s;++t)f=i.item(t),f!==h||e?u.add(i.item(t)):e=!0;u.select();w(this)}else lt(this,n)}:function(n){lt(this,n)};!v&&c&&n.features.implementsDomRange?(b=function(n){var t=!1;return n.anchorNode&&(t=r.comparePoints(n.anchorNode,n.anchorOffset,n.focusNode,n.focusOffset)==1),t},i.isBackwards=function(){return b(this)}):b=i.isBackwards=function(){return!1};i.toString=function(){for(var t=[],n=0,i=this.rangeCount;n<i;++n)t[n]=""+this._ranges[n];return t.join("")};i.collapse=function(t,i){ti(this,t);var u=n.createRange(r.getDocument(t));u.collapseToPoint(t,i);this.removeAllRanges();this.addRange(u);this.isCollapsed=!0};i.collapseToStart=function(){if(this.rangeCount){var n=this._ranges[0];this.collapse(n.startContainer,n.startOffset)}else throw new d("INVALID_STATE_ERR");};i.collapseToEnd=function(){if(this.rangeCount){var n=this._ranges[this.rangeCount-1];this.collapse(n.endContainer,n.endOffset)}else throw new d("INVALID_STATE_ERR");};i.selectAllChildren=function(t){ti(this,t);var i=n.createRange(r.getDocument(t));i.selectNodeContents(t);this.removeAllRanges();this.addRange(i)};i.deleteFromDocument=function(){var n,t,i,r,u;if(e&&a&&this.docSelection.type==o){for(n=this.docSelection.createRange();n.length;)t=n.item(0),n.remove(t),t.parentNode.removeChild(t);this.refresh()}else if(this.rangeCount){for(i=this.getAllRanges(),this.removeAllRanges(),r=0,u=i.length;r<u;++r)i[r].deleteContents();this.addRange(i[u-1])}};i.getAllRanges=function(){return this._ranges.slice(0)};i.setSingleRange=function(n){this.setRanges([n])};i.containsNode=function(n,t){for(var i=0,r=this._ranges.length;i<r;++i)if(this._ranges[i].containsNode(n,t))return!0;return!1};i.toHtml=function(){var i="",t,n,r;if(this.rangeCount){for(t=h.getRangeDocument(this._ranges[0]).createElement("div"),n=0,r=this._ranges.length;n<r;++n)t.appendChild(this._ranges[n].cloneContents());i=t.innerHTML}return i};i.getName=function(){return"WrappedSelection"};i.inspect=function(){return ii(this)};i.detach=function(){this.win[ft]=null;this.win=this.anchorNode=this.focusNode=null};rt.inspect=ii;n.Selection=rt;n.selectionPrototype=i;n.addCreateMissingNativeApiListener(function(t){typeof t.getSelection=="undefined"&&(t.getSelection=function(){return n.getSelection(this)});t=null})});Base=function(){};Base.extend=function(n,t){var u=Base.prototype.extend,r,f,i;return Base._prototyping=!0,r=new this,u.call(r,n),r.base=function(){},delete Base._prototyping,f=r.constructor,i=r.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==i)this._constructing=!0,f.apply(this,arguments),delete this._constructing;else if(arguments[0]!=null)return(arguments[0].extend||u).call(arguments[0],r)},i.ancestor=this,i.extend=this.extend,i.forEach=this.forEach,i.implement=this.implement,i.prototype=r,i.toString=this.toString,i.valueOf=function(n){return n=="object"?i:f.valueOf()},u.call(i,t),typeof i.init=="function"&&i.init(),i};Base.prototype={extend:function(n,t){var r,f,u,i;if(arguments.length>1)r=this[n],r&&typeof t=="function"&&(!r.valueOf||r.valueOf()!=t.valueOf())&&/\bbase\b/.test(t)&&(f=t.valueOf(),t=function(){var t=this.base||Base.prototype.base,n;return this.base=r,n=f.apply(this,arguments),this.base=t,n},t.valueOf=function(n){return n=="object"?t:f},t.toString=Base.toString),this[n]=t;else if(n){u=Base.prototype.extend;Base._prototyping||typeof this=="function"||(u=this.extend||u);for(var e={toSource:null},o=["constructor","toString","valueOf"],s=Base._prototyping?0:1;i=o[s++];)n[i]!=e[i]&&u.call(this,i,n[i]);for(i in n)e[i]||u.call(this,i,n[i])}return this}};Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(n,t,i){for(var r in n)this.prototype[r]===undefined&&t.call(i,n[r],r,n)},implement:function(){for(var n=0;n<arguments.length;n++)typeof arguments[n]=="function"?arguments[n](this.prototype):this.prototype.extend(arguments[n]);return this},toString:function(){return String(this.valueOf())}});wysihtml5.browser=function(){function o(n){return(/ipad|iphone|ipod/.test(n)&&n.match(/ os (\d+).+? like mac os x/)||[,0])[1]}var t=navigator.userAgent,r=document.createElement("div"),n=t.indexOf("MSIE")!==-1&&t.indexOf("Opera")===-1,i=t.indexOf("Gecko")!==-1&&t.indexOf("KHTML")===-1,u=t.indexOf("AppleWebKit/")!==-1,e=t.indexOf("Chrome/")!==-1,f=t.indexOf("Opera/")!==-1;return{USER_AGENT:t,supported:function(){var n=this.USER_AGENT.toLowerCase(),t="contentEditable"in r,i=document.execCommand&&document.queryCommandSupported&&document.queryCommandState,u=document.querySelector&&document.querySelectorAll,f=this.isIos()&&o(n)<5||n.indexOf("opera mobi")!==-1||n.indexOf("hpwos/")!==-1;return t&&i&&u&&!f},isTouchDevice:function(){return this.supportsEvent("touchmove")},isIos:function(){var n=this.USER_AGENT.toLowerCase();return n.indexOf("webkit")!==-1&&n.indexOf("mobile")!==-1},supportsSandboxedIframes:function(){return n},throwsMixedContentWarningWhenIframeSrcIsEmpty:function(){return!("querySelector"in document)},displaysCaretInEmptyContentEditableCorrectly:function(){return!i},hasCurrentStyleProperty:function(){return"currentStyle"in r},insertsLineBreaksOnReturn:function(){return i},supportsPlaceholderAttributeOn:function(n){return"placeholder"in n},supportsEvent:function(n){return"on"+n in r||function(){return r.setAttribute("on"+n,"return;"),typeof r["on"+n]=="function"}()},supportsEventsInIframeCorrectly:function(){return!f},firesOnDropOnlyWhenOnDragOverIsCancelled:function(){return u||i},supportsDataTransfer:function(){try{return u&&(window.Clipboard||window.DataTransfer).prototype.getData}catch(n){return!1}},supportsHTML5Tags:function(n){var t=n.createElement("div"),i="<article>foo<\/article>";return t.innerHTML=i,t.innerHTML.toLowerCase()===i},supportsCommand:function(){var t={formatBlock:n,insertUnorderedList:n||f||u,insertOrderedList:n||f||u},r={insertHTML:i};return function(n,i){var u=t[i];if(!u){try{return n.queryCommandSupported(i)}catch(f){}try{return n.queryCommandEnabled(i)}catch(e){return!!r[i]}}return!1}}(),doesAutoLinkingInContentEditable:function(){return n},canDisableAutoLinking:function(){return this.supportsCommand(document,"AutoUrlDetect")},clearsContentEditableCorrectly:function(){return i||f||u},supportsGetAttributeCorrectly:function(){var n=document.createElement("td");return n.getAttribute("rowspan")!="1"},canSelectImagesInContentEditable:function(){return i||n||f},clearsListsInContentEditableCorrectly:function(){return i||n||u},autoScrollsToCaret:function(){return!u},autoClosesUnclosedTags:function(){var i=r.cloneNode(!1),n,t;return i.innerHTML="<p><div><\/div>",t=i.innerHTML.toLowerCase(),n=t==="<p><\/p><div><\/div>"||t==="<p><div><\/div><\/p>",this.autoClosesUnclosedTags=function(){return n},n},supportsNativeGetElementsByClassName:function(){return String(document.getElementsByClassName).indexOf("[native code]")!==-1},supportsSelectionModify:function(){return"getSelection"in window&&"modify"in window.getSelection()},supportsClassList:function(){return"classList"in r},needsSpaceAfterLineBreak:function(){return f},supportsSpeechApiOn:function(n){var i=t.match(/Chrome\/(\d+)/)||[,0];return i[1]>=11&&("onwebkitspeechchange"in n||"speech"in n)},crashesWhenDefineProperty:function(t){return n&&(t==="XMLHttpRequest"||t==="XDomainRequest")},doesAsyncFocus:function(){return n},hasProblemsSettingCaretAfterImg:function(){return n},hasUndoInContextMenu:function(){return i||e||f}}}();wysihtml5.lang.array=function(n){return{contains:function(t){if(n.indexOf)return n.indexOf(t)!==-1;for(var i=0,r=n.length;i<r;i++)if(n[i]===t)return!0;return!1},without:function(t){t=wysihtml5.lang.array(t);for(var r=[],i=0,u=n.length;i<u;i++)t.contains(n[i])||r.push(n[i]);return r},get:function(){for(var t=0,r=n.length,i=[];t<r;t++)i.push(n[t]);return i}}};wysihtml5.lang.Dispatcher=Base.extend({observe:function(n,t){return this.events=this.events||{},this.events[n]=this.events[n]||[],this.events[n].push(t),this},on:function(){return this.observe.apply(this,wysihtml5.lang.array(arguments).get())},fire:function(n,t){this.events=this.events||{};for(var r=this.events[n]||[],i=0;i<r.length;i++)r[i].call(this,t);return this},stopObserving:function(n,t){this.events=this.events||{};var i=0,r,u;if(n){for(r=this.events[n]||[],u=[];i<r.length;i++)r[i]!==t&&t&&u.push(r[i]);this.events[n]=u}else this.events={};return this}});wysihtml5.lang.object=function(n){return{merge:function(t){for(var i in t)n[i]=t[i];return this},get:function(){return n},clone:function(){var i={},t;for(t in n)i[t]=n[t];return i},isArray:function(){return Object.prototype.toString.call(n)==="[object Array]"}}},function(){var n=/^\s+/,t=/\s+$/;wysihtml5.lang.string=function(i){return i=String(i),{trim:function(){return i.replace(n,"").replace(t,"")},interpolate:function(n){for(var t in n)i=this.replace("#{"+t+"}").by(n[t]);return i},replace:function(n){return{by:function(t){return i.split(n).join(t)}}}}}}(),function(n){function o(n){return l(n)?n:(n===n.ownerDocument.documentElement&&(n=n.ownerDocument.body),f(n))}function s(n){return n.replace(t,function(n,t){var i=(t.match(r)||[])[1]||"",s=e[i],f,o;return t=t.replace(r,""),t.split(s).length>t.split(i).length&&(t=t+i,i=""),f=t,o=t,t.length>u&&(o=o.substr(0,u)+"..."),f.substr(0,4)==="www."&&(f="http://"+f),'<a href="'+f+'">'+o+"<\/a>"+i})}function h(n){var t=n._wysihtml5_tempElement;return t||(t=n._wysihtml5_tempElement=n.createElement("div")),t}function c(n){var i=n.parentNode,t=h(i.ownerDocument);for(t.innerHTML="<span><\/span>"+s(n.data),t.removeChild(t.firstChild);t.firstChild;)i.insertBefore(t.firstChild,n);i.removeChild(n)}function l(n){for(var t;n.parentNode;){if(n=n.parentNode,t=n.nodeName,i.contains(t))return!0;if(t==="body")return!1}return!1}function f(r){if(!i.contains(r.nodeName)){if(r.nodeType===n.TEXT_NODE&&r.data.match(t)){c(r);return}for(var e=n.lang.array(r.childNodes).get(),o=e.length,u=0;u<o;u++)f(e[u]);return r}}var i=n.lang.array(["CODE","PRE","A","SCRIPT","HEAD","TITLE","STYLE"]),t=/((https?:\/\/|www\.)[^\s<]{3,})/gi,r=/([^\w\/\-](,?))$/i,u=100,e={")":"(","]":"[","}":"{"};n.dom.autoLink=o;n.dom.autoLink.URL_REG_EXP=t}(wysihtml5),function(n){var i=n.browser.supportsClassList(),t=n.dom;t.addClass=function(n,r){if(i)return n.classList.add(r);t.hasClass(n,r)||(n.className+=" "+r)};t.removeClass=function(n,t){if(i)return n.classList.remove(t);n.className=n.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ")};t.hasClass=function(n,t){if(i)return n.classList.contains(t);var r=n.className;return r.length>0&&(r==t||new RegExp("(^|\\s)"+t+"(\\s|$)").test(r))}}(wysihtml5);wysihtml5.dom.contains=function(){var n=document.documentElement;return n.contains?function(n,t){return t.nodeType!==wysihtml5.ELEMENT_NODE&&(t=t.parentNode),n!==t&&n.contains(t)}:n.compareDocumentPosition?function(n,t){return!!(n.compareDocumentPosition(t)&16)}:void 0}();wysihtml5.dom.convertToList=function(){function n(n,t){var i=n.createElement("li");return t.appendChild(i),i}function t(n,t){return n.createElement(t)}function i(i,r){if(i.nodeName==="UL"||i.nodeName==="OL"||i.nodeName==="MENU")return i;for(var c=i.ownerDocument,h=t(c,r),a=i.querySelectorAll("br"),w=a.length,l,v,o,e,s,y,p,u,f=0;f<w;f++)for(e=a[f];(s=e.parentNode)&&s!==i&&s.lastChild===e;){if(wysihtml5.dom.getStyle("display").from(s)==="block"){s.removeChild(e);break}wysihtml5.dom.insert(e).after(e.parentNode)}for(l=wysihtml5.lang.array(i.childNodes).get(),v=l.length,f=0;f<v;f++){if(u=u||n(c,h),o=l[f],y=wysihtml5.dom.getStyle("display").from(o)==="block",p=o.nodeName==="BR",y){u=u.firstChild?n(c,h):u;u.appendChild(o);u=null;continue}if(p){u=u.firstChild?null:u;continue}u.appendChild(o)}return i.parentNode.replaceChild(h,i),h}return i}();wysihtml5.dom.copyAttributes=function(n){return{from:function(t){return{to:function(i){for(var r,u=0,f=n.length;u<f;u++)r=n[u],typeof t[r]!="undefined"&&t[r]!==""&&(i[r]=t[r]);return{andTo:arguments.callee}}}}}},function(n){var t=["-webkit-box-sizing","-moz-box-sizing","-ms-box-sizing","box-sizing"],i=function(t){return r(t)?parseInt(n.getStyle("width").from(t),10)<t.offsetWidth:!1},r=function(i){for(var r=0,u=t.length;r<u;r++)if(n.getStyle(t[r]).from(i)==="border-box")return t[r]};n.copyStyles=function(r){return{from:function(u){i(u)&&(r=wysihtml5.lang.array(r).without(t));for(var o="",s=r.length,f=0,e;f<s;f++)e=r[f],o+=e+":"+n.getStyle(e).from(u)+";";return{to:function(t){n.setStyles(o).on(t);return{andTo:arguments.callee}}}}}}}(wysihtml5.dom),function(n){n.dom.delegate=function(t,i,r,u){return n.dom.observe(t,r,function(r){for(var f=r.target,e=n.lang.array(t.querySelectorAll(i));f&&f!==t;){if(e.contains(f)){u.call(f,r);break}f=f.parentNode}})}}(wysihtml5);wysihtml5.dom.getAsDom=function(){var t=function(n,t){var i=t.createElement("div");i.style.display="none";t.body.appendChild(i);try{i.innerHTML=n}catch(r){}return t.body.removeChild(i),i},i=function(t){if(!t._wysihtml5_supportsHTML5Tags){for(var i=0,r=n.length;i<r;i++)t.createElement(n[i]);t._wysihtml5_supportsHTML5Tags=!0}},n=["abbr","article","aside","audio","bdi","canvas","command","datalist","details","figcaption","figure","footer","header","hgroup","keygen","mark","meter","nav","output","progress","rp","rt","ruby","svg","section","source","summary","time","track","video","wbr"];return function(n,r){r=r||document;var u;return typeof n=="object"&&n.nodeType?(u=r.createElement("div"),u.appendChild(n)):wysihtml5.browser.supportsHTML5Tags(r)?(u=r.createElement("div"),u.innerHTML=n):(i(r),u=t(n,r)),u}}();wysihtml5.dom.getParentElement=function(){function n(n,t){return!t||!t.length?!0:typeof t=="string"?n===t:wysihtml5.lang.array(t).contains(n)}function t(n){return n.nodeType===wysihtml5.ELEMENT_NODE}function i(n,t,i){var r=(n.className||"").match(i)||[];return t?r[r.length-1]===t:!!r.length}function r(t,i,r){while(r--&&t&&t.nodeName!=="BODY"){if(n(t.nodeName,i))return t;t=t.parentNode}return null}function u(r,u,f,e,o){while(o--&&r&&r.nodeName!=="BODY"){if(t(r)&&n(r.nodeName,u)&&i(r,f,e))return r;r=r.parentNode}return null}return function(n,t,i){return i=i||50,t.className||t.classRegExp?u(n,t.nodeName,t.className,t.classRegExp,i):r(n,t.nodeName,i)}}();wysihtml5.dom.getStyle=function(){function i(n){return n.replace(t,function(n){return n.charAt(1).toUpperCase()})}var n={float:"styleFloat"in document.createElement("div").style?"styleFloat":"cssFloat"},t=/\-[a-z]/g;return function(t){return{from:function(r){var f,e,l,a;if(r.nodeType===wysihtml5.ELEMENT_NODE){var o=r.ownerDocument,s=n[t]||i(t),u=r.style,h=r.currentStyle,c=u[s];if(c)return c;if(h)try{return h[s]}catch(v){}return f=o.defaultView||o.parentWindow,e=(t==="height"||t==="width")&&r.nodeName==="TEXTAREA",f.getComputedStyle?(e&&(l=u.overflow,u.overflow="hidden"),a=f.getComputedStyle(r,null).getPropertyValue(t),e&&(u.overflow=l||""),a):void 0}}}}}();wysihtml5.dom.hasElementWithTagName=function(){function i(n){return n._wysihtml5_identifier||(n._wysihtml5_identifier=t++)}var n={},t=1;return function(t,r){var f=i(t)+":"+r,u=n[f];return u||(u=n[f]=t.getElementsByTagName(r)),u.length>0}}(),function(n){function r(n){return n._wysihtml5_identifier||(n._wysihtml5_identifier=i++)}var t={},i=1;n.dom.hasElementWithClassName=function(i,u){if(!n.browser.supportsNativeGetElementsByClassName())return!!i.querySelector("."+u);var e=r(i)+":"+u,f=t[e];return f||(f=t[e]=i.getElementsByClassName(u)),f.length>0}}(wysihtml5);wysihtml5.dom.insert=function(n){return{after:function(t){t.parentNode.insertBefore(n,t.nextSibling)},before:function(t){t.parentNode.insertBefore(n,t)},into:function(t){t.appendChild(n)}}};wysihtml5.dom.insertCSS=function(n){return n=n.join("\n"),{into:function(t){var r=t.head||t.getElementsByTagName("head")[0],i=t.createElement("style");i.type="text/css";i.styleSheet?i.styleSheet.cssText=n:i.appendChild(t.createTextNode(n));r&&r.appendChild(i)}}};wysihtml5.dom.observe=function(n,t,i){t=typeof t=="string"?[t]:t;for(var r,u,f=0,e=t.length;f<e;f++)u=t[f],n.addEventListener?n.addEventListener(u,i,!1):(r=function(t){"target"in t||(t.target=t.srcElement);t.preventDefault=t.preventDefault||function(){this.returnValue=!1};t.stopPropagation=t.stopPropagation||function(){this.cancelBubble=!0};i.call(n,t)},n.attachEvent("on"+u,r));return{stop:function(){for(var u,f=0,e=t.length;f<e;f++)u=t[f],n.removeEventListener?n.removeEventListener(u,i,!1):n.detachEvent("on"+u,r)}}};wysihtml5.dom.parse=function(){function o(t,r,u,f){wysihtml5.lang.object(n).merge(e).merge(r).get();u=u||t.ownerDocument||document;for(var c=u.createDocumentFragment(),l=typeof t=="string",s,h,o=l?wysihtml5.dom.getAsDom(t,u):t;o.firstChild;)h=o.firstChild,o.removeChild(h),s=i(h,f),s&&c.appendChild(s);return o.innerHTML="",o.appendChild(c),l?wysihtml5.quirks.getCorrectInnerHTML(o):o}function i(n,r){var h=n.nodeType,o=n.childNodes,c=o.length,f,s=u[h],e=0;if(f=s&&s(n),!f)return null;for(e=0;e<c;e++)newChild=i(o[e],r),newChild&&f.appendChild(newChild);return r&&f.childNodes.length<=1&&f.nodeName.toLowerCase()===t&&!f.attributes.length?f.firstChild:f}function s(i){var r,f,o=n.tags,u=i.nodeName.toLowerCase(),e=i.scopeName;if(i._wysihtml5||(i._wysihtml5=1,i.className==="wysihtml5-temp"))return null;if(e&&e!="HTML"&&(u=e+":"+u),"outerHTML"in i&&(wysihtml5.browser.autoClosesUnclosedTags()||i.nodeName!=="P"||i.outerHTML.slice(-4).toLowerCase()==="<\/p>"||(u="div")),u in o){if(r=o[u],!r||r.remove)return null;r=typeof r=="string"?{rename_tag:r}:r}else if(i.firstChild)r={rename_tag:t};else return null;return f=i.ownerDocument.createElement(r.rename_tag||u),h(i,f,r),i=null,f}function h(t,i,u){var e={},tt=u.set_class,a=u.add_class,it=u.set_attributes,p=u.check_attributes,rt=n.classes,w=0,s=[],b=[],l=[],k=[],ut,d,h,g,o,nt,c;if(it&&(e=wysihtml5.lang.object(it).clone()),p)for(o in p)(c=v[p[o]],c)&&(nt=c(r(t,o)),typeof nt=="string"&&(e[o]=nt));if(tt&&s.push(tt),a)for(o in a)(c=y[a[o]],c)&&(g=c(r(t,o)),typeof g=="string"&&s.push(g));for(rt["_wysihtml5-temp-placeholder"]=1,k=t.getAttribute("class"),k&&(s=s.concat(k.split(f))),ut=s.length;w<ut;w++)h=s[w],rt[h]&&b.push(h);for(d=b.length;d--;)h=b[d],wysihtml5.lang.array(l).contains(h)||l.unshift(h);l.length&&(e["class"]=l.join(" "));for(o in e)try{i.setAttribute(o,e[o])}catch(ft){}e.src&&(typeof e.width!="undefined"&&i.setAttribute("width",e.width),typeof e.height!="undefined"&&i.setAttribute("height",e.height))}function r(n,t){var i,r,u;return t=t.toLowerCase(),i=n.nodeName,i=="IMG"&&t=="src"&&l(n)===!0?n.src:c&&"outerHTML"in n?(r=n.outerHTML.toLowerCase(),u=r.indexOf(" "+t+"=")!=-1,u?n.getAttribute(t):null):n.getAttribute(t)}function l(n){try{return n.complete&&!n.mozMatchesSelector(":-moz-broken")}catch(t){if(n.complete&&n.readyState==="complete")return!0}}function a(n){return n.ownerDocument.createTextNode(n.data)}var u={"1":s,"3":a},t="span",f=/\s+/,e={tags:{},classes:{}},n={},c=!wysihtml5.browser.supportsGetAttributeCorrectly(),v={url:function(){var n=/^https?:\/\//i;return function(t){return!t||!t.match(n)?null:t.replace(n,function(n){return n.toLowerCase()})}}(),alt:function(){var n=/[^ a-z0-9_\-]/gi;return function(t){return t?t.replace(n,""):""}}(),allow:function(){return function(n){return n}}(),numbers:function(){var n=/\D/g;return function(t){return t=(t||"").replace(n,""),t||null}}()},y={align_img:function(){var n={left:"wysiwyg-float-left",right:"wysiwyg-float-right"};return function(t){return n[String(t).toLowerCase()]}}(),align_text:function(){var n={left:"wysiwyg-text-align-left",right:"wysiwyg-text-align-right",center:"wysiwyg-text-align-center",justify:"wysiwyg-text-align-justify"};return function(t){return n[String(t).toLowerCase()]}}(),clear_br:function(){var n={left:"wysiwyg-clear-left",right:"wysiwyg-clear-right",both:"wysiwyg-clear-both",all:"wysiwyg-clear-both"};return function(t){return n[String(t).toLowerCase()]}}(),size_font:function(){var n={"1":"wysiwyg-font-size-xx-small","2":"wysiwyg-font-size-small","3":"wysiwyg-font-size-medium","4":"wysiwyg-font-size-large","5":"wysiwyg-font-size-x-large","6":"wysiwyg-font-size-xx-large","7":"wysiwyg-font-size-xx-large","-":"wysiwyg-font-size-smaller","+":"wysiwyg-font-size-larger"};return function(t){return n[String(t).charAt(0)]}}()};return o}();wysihtml5.dom.removeEmptyTextNodes=function(n){for(var t,r=wysihtml5.lang.array(n.childNodes).get(),u=r.length,i=0;i<u;i++)t=r[i],t.nodeType===wysihtml5.TEXT_NODE&&t.data===""&&t.parentNode.removeChild(t)};wysihtml5.dom.renameElement=function(n,t){for(var i=n.ownerDocument.createElement(t),r;r=n.firstChild;)i.appendChild(r);return wysihtml5.dom.copyAttributes(["align","className"]).from(n).to(i),n.parentNode.replaceChild(i,n),i};wysihtml5.dom.replaceWithChildNodes=function(n){if(n.parentNode){if(!n.firstChild){n.parentNode.removeChild(n);return}for(var t=n.ownerDocument.createDocumentFragment();n.firstChild;)t.appendChild(n.firstChild);n.parentNode.replaceChild(t,n);n=t=null}},function(n){function t(t){return n.getStyle("display").from(t)==="block"}function r(n){return n.nodeName==="BR"}function i(n){var t=n.ownerDocument.createElement("br");n.appendChild(t)}function u(n){if(n.nodeName==="MENU"||n.nodeName==="UL"||n.nodeName==="OL"){var l=n.ownerDocument,e=l.createDocumentFragment(),o=n.previousElementSibling||n.previousSibling,u,s,h,c,f;for(o&&!t(o)&&i(e);f=n.firstChild;){for(s=f.lastChild;u=f.firstChild;)h=u===s,c=h&&!t(u)&&!r(u),e.appendChild(u),c&&i(e);f.parentNode.removeChild(f)}n.parentNode.replaceChild(e,n)}}n.resolveList=u}(wysihtml5.dom),function(n){var t=document,i=["parent","top","opener","frameElement","frames","localStorage","globalStorage","sessionStorage","indexedDB"],r=["open","close","openDialog","showModalDialog","alert","confirm","prompt","openDatabase","postMessage","XMLHttpRequest","XDomainRequest"],u=["referrer","write","open","close"];n.dom.Sandbox=Base.extend({constructor:function(t,i){this.callback=t||n.EMPTY_FUNCTION;this.config=n.lang.object({}).merge(i).get();this.iframe=this._createIframe()},insertInto:function(n){typeof n=="string"&&(n=t.getElementById(n));n.appendChild(this.iframe)},getIframe:function(){return this.iframe},getWindow:function(){this._readyError()},getDocument:function(){this._readyError()},destroy:function(){var n=this.getIframe();n.parentNode.removeChild(n)},_readyError:function(){throw new Error("wysihtml5.Sandbox: Sandbox iframe isn't loaded yet");},_createIframe:function(){var r=this,i=t.createElement("iframe");i.className="wysihtml5-sandbox";n.dom.setAttributes({security:"restricted",allowtransparency:"true",frameborder:0,width:0,height:0,marginwidth:0,marginheight:0}).on(i);return n.browser.throwsMixedContentWarningWhenIframeSrcIsEmpty()&&(i.src="javascript:'<html><\/html>'"),i.onload=function(){i.onreadystatechange=i.onload=null;r._onLoadIframe(i)},i.onreadystatechange=function(){/loaded|complete/.test(i.readyState)&&(i.onreadystatechange=i.onload=null,r._onLoadIframe(i))},i},_onLoadIframe:function(f){var e,o;if(n.dom.contains(t.documentElement,f)){var c=this,h=f.contentWindow,s=f.contentWindow.document,l=t.characterSet||t.charset||"utf-8",a=this._getHtml({charset:l,stylesheets:this.config.stylesheets});if(s.open("text/html","replace"),s.write(a),s.close(),this.getWindow=function(){return f.contentWindow},this.getDocument=function(){return f.contentWindow.document},h.onerror=function(n,t,i){throw new Error("wysihtml5.Sandbox: "+n,t,i);},!n.browser.supportsSandboxedIframes()){for(e=0,o=i.length;e<o;e++)this._unset(h,i[e]);for(e=0,o=r.length;e<o;e++)this._unset(h,r[e],n.EMPTY_FUNCTION);for(e=0,o=u.length;e<o;e++)this._unset(s,u[e]);this._unset(s,"cookie","",!0)}this.loaded=!0;setTimeout(function(){c.callback(c)},0)}},_getHtml:function(t){var i=t.stylesheets,u="",r=0,f;if(i=typeof i=="string"?[i]:i,i)for(f=i.length;r<f;r++)u+='<link rel="stylesheet" href="'+i[r]+'">';return t.stylesheets=u,n.lang.string('<!DOCTYPE html><html><head><meta charset="#{charset}">#{stylesheets}<\/head><body><\/body><\/html>').interpolate(t)},_unset:function(t,i,r,u){try{t[i]=r}catch(e){}try{t.__defineGetter__(i,function(){return r})}catch(e){}if(u)try{t.__defineSetter__(i,function(){})}catch(e){}if(!n.browser.crashesWhenDefineProperty(i))try{var f={get:function(){return r}};u&&(f.set=function(){});Object.defineProperty(t,i,f)}catch(e){}}})}(wysihtml5),function(){var n={className:"class"};wysihtml5.dom.setAttributes=function(t){return{on:function(i){for(var r in t)i.setAttribute(n[r]||r,t[r])}}}}();wysihtml5.dom.setStyles=function(n){return{on:function(t){var r=t.style,i;if(typeof n=="string"){r.cssText+=";"+n;return}for(i in n)i==="float"?(r.cssFloat=n[i],r.styleFloat=n[i]):r[i]=n[i]}}},function(n){n.simulatePlaceholder=function(t,i,r){var e="placeholder",u=function(){i.hasPlaceholderSet()&&i.clear();n.removeClass(i.element,e)},f=function(){i.isEmpty()&&(i.setValue(r),n.addClass(i.element,e))};t.observe("set_placeholder",f).observe("unset_placeholder",u).observe("focus:composer",u).observe("paste:composer",u).observe("blur:composer",f);f()}}(wysihtml5.dom),function(n){var t=document.documentElement;"textContent"in t?(n.setTextContent=function(n,t){n.textContent=t},n.getTextContent=function(n){return n.textContent}):"innerText"in t?(n.setTextContent=function(n,t){n.innerText=t},n.getTextContent=function(n){return n.innerText}):(n.setTextContent=function(n,t){n.nodeValue=t},n.getTextContent=function(n){return n.nodeValue})}(wysihtml5.dom);wysihtml5.quirks.cleanPastedHTML=function(){function t(t,i,r){i=i||n;r=r||t.ownerDocument||document;var u,s=typeof t=="string",h,f,c,e,o=0;u=s?wysihtml5.dom.getAsDom(t,r):t;for(e in i)for(f=u.querySelectorAll(e),h=i[e],c=f.length;o<c;o++)h(f[o]);return f=t=i=null,s?u.innerHTML:u}var n={"a u":wysihtml5.dom.replaceWithChildNodes};return t}(),function(n){var t=n.dom;n.quirks.ensureProperClearing=function(){var n=function(){var n=this;setTimeout(function(){var t=n.innerHTML.toLowerCase();(t=="<p>&nbsp;<\/p>"||t=="<p>&nbsp;<\/p><p>&nbsp;<\/p>")&&(n.innerHTML="")},0)};return function(i){t.observe(i.element,["cut","keydown"],n)}}();n.quirks.ensureProperClearingOfLists=function(){var i=["OL","UL","MENU"],r=function(r,u){var f,e,o,s;u.firstChild&&n.lang.array(i).contains(u.firstChild.nodeName)&&(f=t.getParentElement(r,{nodeName:i}),f)&&(e=f==u.firstChild,e)&&(o=f.childNodes.length<=1,o)&&(s=f.firstChild?f.firstChild.innerHTML==="":!0,s)&&f.parentNode.removeChild(f)};return function(i){t.observe(i.element,"keydown",function(t){if(t.keyCode===n.BACKSPACE_KEY){var u=i.selection.getSelectedNode();r(u,i.element)}})}}()}(wysihtml5),function(n){var t="%7E";n.quirks.getCorrectInnerHTML=function(i){var r=i.innerHTML,f,e,o,s,u;if(r.indexOf(t)===-1)return r;for(f=i.querySelectorAll("[href*='~'], [src*='~']"),u=0,s=f.length;u<s;u++)e=f[u].href||f[u].src,o=n.lang.string(e).replace("~").by(t),r=n.lang.string(r).replace(o).by(e);return r}}(wysihtml5),function(n){var t=n.dom,i=["LI","P","H1","H2","H3","H4","H5","H6"],r=["UL","OL","MENU"];n.quirks.insertLineBreakOnReturn=function(u){function f(i){var r=t.getParentElement(i,{nodeName:["P","DIV"]},2),f;r&&(f=document.createTextNode(n.INVISIBLE_SPACE),t.insert(f).before(r),t.replaceWithChildNodes(r),u.selection.selectNode(f))}function e(e){var o=e.keyCode;if(!e.shiftKey&&(o===n.ENTER_KEY||o===n.BACKSPACE_KEY)){var c=e.target,h=u.selection.getSelectedNode(),s=t.getParentElement(h,{nodeName:i},4);if(s){s.nodeName==="LI"&&(o===n.ENTER_KEY||o===n.BACKSPACE_KEY)?setTimeout(function(){var n=u.selection.getSelectedNode(),i;n&&((i=t.getParentElement(n,{nodeName:r},2),i)||f(n))},0):s.nodeName.match(/H[1-6]/)&&o===n.ENTER_KEY&&setTimeout(function(){f(u.selection.getSelectedNode())},0);return}o!==n.ENTER_KEY||n.browser.insertsLineBreaksOnReturn()||(u.commands.exec("insertLineBreak"),e.preventDefault())}}t.observe(u.element.ownerDocument,"keydown",e)}}(wysihtml5),function(n){var t="wysihtml5-quirks-redraw";n.quirks.redraw=function(i){n.dom.addClass(i,t);n.dom.removeClass(i,t);try{var r=i.ownerDocument;r.execCommand("italic",!1,null);r.execCommand("italic",!1,null)}catch(u){}}}(wysihtml5),function(n){function i(n){var t=0;if(n.parentNode)do t+=n.offsetTop||0,n=n.offsetParent;while(n);return t}var t=n.dom;n.Selection=Base.extend({constructor:function(n){window.rangy.init();this.editor=n;this.composer=n.composer;this.doc=this.composer.doc},getBookmark:function(){var n=this.getRange();return n&&n.cloneRange()},setBookmark:function(n){n&&this.setSelection(n)},setBefore:function(n){var t=rangy.createRange(this.doc);return t.setStartBefore(n),t.setEndBefore(n),this.setSelection(t)},setAfter:function(n){var t=rangy.createRange(this.doc);return t.setStartAfter(n),t.setEndAfter(n),this.setSelection(t)},selectNode:function(i){var r=rangy.createRange(this.doc),f=i.nodeType===n.ELEMENT_NODE,u="canHaveHTML"in i?i.canHaveHTML:i.nodeName!=="IMG",o=f?i.innerHTML:i.data,e=o===""||o===n.INVISIBLE_SPACE,s=t.getStyle("display").from(i),h=s==="block"||s==="list-item";if(e&&f&&u)try{i.innerHTML=n.INVISIBLE_SPACE}catch(c){}u?r.selectNodeContents(i):r.selectNode(i);u&&e&&f?r.collapse(h):u&&e&&(r.setStartAfter(i),r.setEndAfter(i));this.setSelection(r)},getSelectedNode:function(n){var i,t;return n&&this.doc.selection&&this.doc.selection.type==="Control"&&(t=this.doc.selection.createRange(),t&&t.length)?t.item(0):(i=this.getSelection(this.doc),i.focusNode===i.anchorNode?i.focusNode:(t=this.getRange(this.doc),t?t.commonAncestorContainer:this.doc.body))},executeAndRestore:function(t,i){var r=this.doc.body,s=i&&r.scrollTop,h=i&&r.scrollLeft,e="_wysihtml5-temp-placeholder",c='<span class="'+e+'">'+n.INVISIBLE_SPACE+"<\/span>",u=this.getRange(this.doc),f,o;if(!u){t(r,r);return}o=u.createContextualFragment(c);u.insertNode(o);try{t(u.startContainer,u.endContainer)}catch(l){setTimeout(function(){throw l;},0)}caretPlaceholder=this.doc.querySelector("."+e);caretPlaceholder?(f=rangy.createRange(this.doc),f.selectNode(caretPlaceholder),f.deleteContents(),this.setSelection(f)):r.focus();i&&(r.scrollTop=s,r.scrollLeft=h);try{caretPlaceholder.parentNode.removeChild(caretPlaceholder)}catch(a){}},executeAndRestoreSimple:function(n){var t=this.getRange(),o=this.doc.body,r,e,u,f,i;if(!t){n(o,o);return}f=t.getNodes([3]);e=f[0]||t.startContainer;u=f[f.length-1]||t.endContainer;i={collapsed:t.collapsed,startContainer:e,startOffset:e===t.startContainer?t.startOffset:0,endContainer:u,endOffset:u===t.endContainer?t.endOffset:u.length};try{n(t.startContainer,t.endContainer)}catch(s){setTimeout(function(){throw s;},0)}r=rangy.createRange(this.doc);try{r.setStart(i.startContainer,i.startOffset)}catch(h){}try{r.setEnd(i.endContainer,i.endOffset)}catch(c){}try{this.setSelection(r)}catch(l){}},insertHTML:function(n){var r=rangy.createRange(this.doc),t=r.createContextualFragment(n),i=t.lastChild;this.insertNode(t);i&&this.setAfter(i)},insertNode:function(n){var t=this.getRange();t&&t.insertNode(n)},surround:function(n){var t=this.getRange();if(t)try{t.surroundContents(n);this.selectNode(n)}catch(i){n.appendChild(t.extractContents());t.insertNode(n)}},scrollIntoView:function(){var t=this.doc,f=t.documentElement.scrollHeight>t.documentElement.offsetHeight,r=t._wysihtml5ScrollIntoViewElement=t._wysihtml5ScrollIntoViewElement||function(){var i=t.createElement("span");return i.innerHTML=n.INVISIBLE_SPACE,i}(),u;f&&(this.insertNode(r),u=i(r),r.parentNode.removeChild(r),u>t.body.scrollTop&&(t.body.scrollTop=u))},selectLine:function(){n.browser.supportsSelectionModify()?this._selectLine_W3C():this.doc.selection&&this._selectLine_MSIE()},_selectLine_W3C:function(){var t=this.doc.defaultView,n=t.getSelection();n.modify("extend","left","lineboundary");n.modify("extend","right","lineboundary")},_selectLine_MSIE:function(){var n=this.doc.selection.createRange(),t=n.boundingTop,s=n.boundingHeight,e=this.doc.body.scrollWidth,o,f,i,r,u;if(n.moveToPoint){for(t===0&&(i=this.doc.createElement("span"),this.insertNode(i),t=i.offsetTop,i.parentNode.removeChild(i)),t+=1,r=-10;r<e;r+=2)try{n.moveToPoint(r,t);break}catch(h){}for(o=t,f=this.doc.selection.createRange(),u=e;u>=0;u--)try{f.moveToPoint(u,o);break}catch(c){}n.setEndPoint("EndToEnd",f);n.select()}},getText:function(){var n=this.getSelection();return n?n.toString():""},getNodes:function(n,t){var i=this.getRange();return i?i.getNodes([n],t):[]},getRange:function(){var n=this.getSelection();return n&&n.rangeCount&&n.getRangeAt(0)},getSelection:function(){return rangy.getSelection(this.doc.defaultView||this.doc.parentWindow)},setSelection:function(n){var t=this.doc.defaultView||this.doc.parentWindow,i=rangy.getSelection(t);return i.setSingleRange(n)}})}(wysihtml5),function(n,t){function h(n,t,i){if(!n.className)return!1;var r=n.className.match(i)||[];return r[r.length-1]===t}function c(n,t,i){n.className?(f(n,i),n.className+=" "+t):n.className=t}function f(n,t){n.className&&(n.className=n.className.replace(t,""))}function l(n,t){return n.className.replace(u," ")==t.className.replace(u," ")}function a(n){for(var t=n.parentNode;n.firstChild;)t.insertBefore(n.firstChild,n);t.removeChild(n)}function v(n,t){if(n.attributes.length!=t.attributes.length)return!1;for(var r=0,e=n.attributes.length,i,u,f;r<e;++r)if(i=n.attributes[r],f=i.name,f!="class"&&((u=t.attributes.getNamedItem(f),i.specified!=u.specified)||i.specified&&i.nodeValue!==u.nodeValue))return!1;return!0}function e(n,i){return t.dom.isCharacterDataNode(n)?i==0?!!n.previousSibling:i==n.length?!!n.nextSibling:!0:i>0&&i<n.childNodes.length}function i(n,r,u){var f,e;if(t.dom.isCharacterDataNode(r)&&(u==0?(u=t.dom.getNodeIndex(r),r=r.parentNode):u==r.length?(u=t.dom.getNodeIndex(r)+1,r=r.parentNode):f=t.dom.splitDataNode(r,u)),!f){for(f=r.cloneNode(!1),f.id&&f.removeAttribute("id");e=r.childNodes[u];)f.appendChild(e);t.dom.insertAfter(f,r)}return r==n?f:i(n,f.parentNode,t.dom.getNodeIndex(f))}function r(t){this.isElementMerge=t.nodeType==n.ELEMENT_NODE;this.firstTextNode=this.isElementMerge?t.lastChild:t;this.textNodes=[this.firstTextNode]}function o(n,t,i,r){this.tagNames=n||[s];this.cssClass=t||"";this.similarClassRegExp=i;this.normalize=r;this.applyToAnyTagName=!1}var s="span",u=/\s+/g;r.prototype={doMerge:function(){for(var r=[],i,t,u,n=0,f=this.textNodes.length;n<f;++n)i=this.textNodes[n],t=i.parentNode,r[n]=i.data,n&&(t.removeChild(i),t.hasChildNodes()||t.parentNode.removeChild(t));return this.firstTextNode.data=u=r.join(""),u},getLength:function(){for(var n=this.textNodes.length,t=0;n--;)t+=this.textNodes[n].length;return t},toString:function(){for(var t=[],n=0,i=this.textNodes.length;n<i;++n)t[n]="'"+this.textNodes[n].data+"'";return"[Merge("+t.join(",")+")]"}};o.prototype={getAncestorWithClass:function(i){for(var r;i;){if(r=this.cssClass?h(i,this.cssClass,this.similarClassRegExp):!0,i.nodeType==n.ELEMENT_NODE&&t.dom.arrayContains(this.tagNames,i.tagName.toLowerCase())&&r)return i;i=i.parentNode}return!1},postApply:function(n,t){for(var a=n[0],f=n[n.length-1],e=[],i,h=a,v=f,y=0,p=f.length,o,c,l,u=0,s=n.length;u<s;++u)o=n[u],c=this.getAdjacentMergeableTextNode(o.parentNode,!1),c?(i||(i=new r(c),e.push(i)),i.textNodes.push(o),o===a&&(h=i.firstTextNode,y=h.length),o===f&&(v=i.firstTextNode,p=i.getLength())):i=null;if(l=this.getAdjacentMergeableTextNode(f.parentNode,!0),l&&(i||(i=new r(f),e.push(i)),i.textNodes.push(l)),e.length){for(u=0,s=e.length;u<s;++u)e[u].doMerge();t.setStart(h,y);t.setEnd(v,p)}},getAdjacentMergeableTextNode:function(t,i){var u=t.nodeType==n.TEXT_NODE,e=u?t.parentNode:t,r,f=i?"nextSibling":"previousSibling";if(u){if(r=t[f],r&&r.nodeType==n.TEXT_NODE)return r}else if(r=e[f],r&&this.areElementsMergeable(t,r))return r[i?"firstChild":"lastChild"];return null},areElementsMergeable:function(n,i){return t.dom.arrayContains(this.tagNames,(n.tagName||"").toLowerCase())&&t.dom.arrayContains(this.tagNames,(i.tagName||"").toLowerCase())&&l(n,i)&&v(n,i)},createContainer:function(n){var t=n.createElement(this.tagNames[0]);return this.cssClass&&(t.className=this.cssClass),t},applyToTextNode:function(n){var i=n.parentNode,r;i.childNodes.length==1&&t.dom.arrayContains(this.tagNames,i.tagName.toLowerCase())?this.cssClass&&c(i,this.cssClass,this.similarClassRegExp):(r=this.createContainer(t.dom.getDocument(n)),n.parentNode.insertBefore(r,n),r.appendChild(n))},isRemovable:function(i){return t.dom.arrayContains(this.tagNames,i.tagName.toLowerCase())&&n.lang.string(i.className).trim()==this.cssClass},undoToTextNode:function(n,t,r){if(!t.containsNode(r)){var u=t.cloneRange();u.selectNode(r);u.isPointInRange(t.endContainer,t.endOffset)&&e(t.endContainer,t.endOffset)&&(i(r,t.endContainer,t.endOffset),t.setEndAfter(r));u.isPointInRange(t.startContainer,t.startOffset)&&e(t.startContainer,t.startOffset)&&(r=i(r,t.startContainer,t.startOffset))}this.similarClassRegExp&&f(r,this.similarClassRegExp);this.isRemovable(r)&&a(r)},applyToRange:function(t){var i=t.getNodes([n.TEXT_NODE]),f,r,u,e;if(!i.length)try{f=this.createContainer(t.endContainer.ownerDocument);t.surroundContents(f);this.selectNode(t,f);return}catch(o){}if(t.splitBoundaries(),i=t.getNodes([n.TEXT_NODE]),i.length){for(u=0,e=i.length;u<e;++u)r=i[u],this.getAncestorWithClass(r)||this.applyToTextNode(r);t.setStart(i[0],0);r=i[i.length-1];t.setEnd(r,r.length);this.normalize&&this.postApply(i,t)}},undoToRange:function(t){var i=t.getNodes([n.TEXT_NODE]),r,e,s,u,f,o;for(i.length?(t.splitBoundaries(),i=t.getNodes([n.TEXT_NODE])):(s=t.endContainer.ownerDocument,u=s.createTextNode(n.INVISIBLE_SPACE),t.insertNode(u),t.selectNode(u),i=[u]),f=0,o=i.length;f<o;++f)r=i[f],e=this.getAncestorWithClass(r),e&&this.undoToTextNode(r,t,e);o==1?this.selectNode(t,i[0]):(t.setStart(i[0],0),r=i[i.length-1],t.setEnd(r,r.length),this.normalize&&this.postApply(i,t))},selectNode:function(t,i){var r=i.nodeType===n.ELEMENT_NODE,e="canHaveHTML"in i?i.canHaveHTML:!0,f=r?i.innerHTML:i.data,u=f===""||f===n.INVISIBLE_SPACE;if(u&&r&&e)try{i.innerHTML=n.INVISIBLE_SPACE}catch(o){}t.selectNodeContents(i);u&&r?t.collapse(!1):u&&(t.setStartAfter(i),t.setEndAfter(i))},getTextSelectedByRange:function(n,t){var i=t.cloneRange(),r,u;return i.selectNodeContents(n),r=i.intersection(t),u=r?r.toString():"",i.detach(),u},isAppliedToRange:function(t){var f=[],i,u=t.getNodes([n.TEXT_NODE]),r,e,o;if(!u.length)return i=this.getAncestorWithClass(t.startContainer),i?[i]:!1;for(r=0,e=u.length;r<e;++r)if(o=this.getTextSelectedByRange(u[r],t),i=this.getAncestorWithClass(u[r]),o==""||i)f.push(i);else return!1;return f},toggleRange:function(n){this.isAppliedToRange(n)?this.undoToRange(n):this.applyToRange(n)}};n.selection.HTMLApplier=o}(wysihtml5,rangy);wysihtml5.Commands=Base.extend({constructor:function(n){this.editor=n;this.composer=n.composer;this.doc=this.composer.doc},support:function(n){return wysihtml5.browser.supportsCommand(this.doc,n)},exec:function(n,t){var i=wysihtml5.commands[n],u=wysihtml5.lang.array(arguments).get(),f=i&&i.exec,r=null;if(this.editor.fire("beforecommand:composer"),f)u.unshift(this.composer),r=f.apply(i,u);else try{r=this.doc.execCommand(n,!1,t)}catch(e){}return this.editor.fire("aftercommand:composer"),r},state:function(n){var t=wysihtml5.commands[n],i=wysihtml5.lang.array(arguments).get(),r=t&&t.state;if(r)return i.unshift(this.composer),r.apply(t,i);try{return this.doc.queryCommandState(n)}catch(u){return!1}},value:function(n){var t=wysihtml5.commands[n],i=t&&t.value;if(i)return i.call(t,this.composer,n);try{return this.doc.queryCommandValue(n)}catch(r){return null}}}),function(n){var t;n.commands.bold={exec:function(t,i){return n.commands.formatInline.exec(t,i,"b")},state:function(t,i){return n.commands.formatInline.state(t,i,"b")},value:function(){return t}}}(wysihtml5),function(n){function u(n,i){for(var o=i.length,u=0,r,f,e;u<o;u++)r=i[u],f=t.getParentElement(r,{nodeName:"code"}),e=t.getTextContent(r),e.match(t.autoLink.URL_REG_EXP)&&!f?f=t.renameElement(r,"code"):t.replaceWithChildNodes(r)}function f(u,f){var y=u.doc,p="_wysihtml5-temp-"+ +new Date,o=0,s,h,e,w,b,c,l,a,v;for(n.commands.formatInline.exec(u,i,r,p,/non-matching-class/g),h=y.querySelectorAll(r+"."+p),s=h.length;o<s;o++){e=h[o];e.removeAttribute("class");for(v in f)e.setAttribute(v,f[v])}c=e;s===1&&(l=t.getTextContent(e),w=!!e.querySelector("*"),b=l===""||l===n.INVISIBLE_SPACE,!w&&b&&(t.setTextContent(e,f.text||e.href),a=y.createTextNode(" "),u.selection.setAfter(e),u.selection.insertNode(a),c=a));u.selection.setAfter(c)}var i,r="A",t=n.dom;n.commands.createLink={exec:function(n,t,i){var r=this.state(n,t);r?n.selection.executeAndRestore(function(){u(n,r)}):(i=typeof i=="object"?i:{href:i},f(n,i))},state:function(t,i){return n.commands.formatInline.state(t,i,"A")},value:function(){return i}}}(wysihtml5),function(n){var i,t=/wysiwyg-font-size-[a-z\-]+/g;n.commands.fontSize={exec:function(i,r,u){return n.commands.formatInline.exec(i,r,"span","wysiwyg-font-size-"+u,t)},state:function(i,r,u){return n.commands.formatInline.state(i,r,"span","wysiwyg-font-size-"+u,t)},value:function(){return i}}}(wysihtml5),function(n){var i,t=/wysiwyg-color-[a-z]+/g;n.commands.foreColor={exec:function(i,r,u){return n.commands.formatInline.exec(i,r,"span","wysiwyg-color-"+u,t)},state:function(i,r,u){return n.commands.formatInline.state(i,r,"span","wysiwyg-color-"+u,t)},value:function(){return i}}}(wysihtml5),function(n){function l(n,t,i){n.className?(f(n,i),n.className+=" "+t):n.className=t}function f(n,t){n.className=n.className.replace(t,"")}function e(t){return t.nodeType===n.TEXT_NODE&&!n.lang.string(t.data).trim()}function o(n){for(var t=n.previousSibling;t&&e(t);)t=t.previousSibling;return t}function s(n){for(var t=n.nextSibling;t&&e(t);)t=t.nextSibling;return t}function a(n){var i=n.ownerDocument,t=s(n),r=o(n);t&&!h(t)&&n.parentNode.insertBefore(i.createElement("br"),t);r&&!h(r)&&n.parentNode.insertBefore(i.createElement("br"),n)}function v(n){var t=s(n),i=o(n);t&&r(t)&&t.parentNode.removeChild(t);i&&r(i)&&i.parentNode.removeChild(i)}function y(n){var t=n.lastChild;t&&r(t)&&t.parentNode.removeChild(t)}function r(n){return n.nodeName==="BR"}function h(n){return r(n)?!0:t.getStyle("display").from(n)==="block"?!0:!1}function p(i,r,u,f){if(f)var e=t.observe(i,"DOMNodeInserted",function(i){var r=i.target,u;r.nodeType===n.ELEMENT_NODE&&(u=t.getStyle("display").from(r),u.substr(0,6)!=="inline"&&(r.className+=" "+f))});i.execCommand(r,!1,u);e&&e.stop()}function w(n,t){n.selection.selectLine();n.selection.surround(t);v(t);y(t);n.selection.selectNode(t)}function b(t){return!!n.lang.string(t.className).trim()}var c,t=n.dom,i="DIV",u=["H1","H2","H3","H4","H5","H6","P","BLOCKQUOTE",i];n.commands.formatBlock={exec:function(r,e,o,s,h){var v=r.doc,c=this.state(r,e,o,s,h),y;if(o=typeof o=="string"?o.toUpperCase():o,c){r.selection.executeAndRestoreSimple(function(){h&&f(c,h);var n=b(c);n||c.nodeName!==(o||i)?n&&t.renameElement(c,i):(a(c),t.replaceWithChildNodes(c))});return}if((o===null||n.lang.array(u).contains(o))&&(y=r.selection.getSelectedNode(),c=t.getParentElement(y,{nodeName:u}),c)){r.selection.executeAndRestoreSimple(function(){o&&(c=t.renameElement(c,o));s&&l(c,s,h)});return}if(r.commands.support(e)){p(v,e,o||i,s);return}c=v.createElement(o||i);s&&(c.className=s);w(r,c)},state:function(n,i,r,u,f){r=typeof r=="string"?r.toUpperCase():r;var e=n.selection.getSelectedNode();return t.getParentElement(e,{nodeName:r,className:u,classRegExp:f})},value:function(){return c}}}(wysihtml5),function(n){function f(n){var t=i[n];return t?[n.toLowerCase(),t.toLowerCase()]:[n.toLowerCase()]}function r(i,r,u){var e=i+":"+r;return t[e]||(t[e]=new n.selection.HTMLApplier(f(i),r,u,!0)),t[e]}var u,i={strong:"b",em:"i",b:"strong",i:"em"},t={};n.commands.formatInline={exec:function(n,t,i,u,f){var e=n.selection.getRange();if(!e)return!1;r(i,u,f).toggleRange(e);n.selection.setSelection(e)},state:function(t,u,f,e,o){var s=t.doc,c=i[f]||f,h;return!n.dom.hasElementWithTagName(s,f)&&!n.dom.hasElementWithTagName(s,c)?!1:e&&!n.dom.hasElementWithClassName(s,e)?!1:(h=t.selection.getRange(),!h)?!1:r(f,e,o).isAppliedToRange(h)},value:function(){return u}}}(wysihtml5),function(n){var t;n.commands.insertHTML={exec:function(n,t,i){n.commands.support(t)?n.doc.execCommand(t,!1,i):n.selection.insertHTML(i)},state:function(){return!1},value:function(){return t}}}(wysihtml5),function(n){var t="IMG";n.commands.insertImage={exec:function(i,r,u){u=typeof u=="object"?u:{src:u};var h=i.doc,f=this.state(i),o,s,e;if(f){i.selection.setBefore(f);e=f.parentNode;e.removeChild(f);n.dom.removeEmptyTextNodes(e);e.nodeName!=="A"||e.firstChild||(i.selection.setAfter(e),e.parentNode.removeChild(e));n.quirks.redraw(i.element);return}f=h.createElement(t);for(s in u)f[s]=u[s];i.selection.insertNode(f);n.browser.hasProblemsSettingCaretAfterImg()?(o=h.createTextNode(n.INVISIBLE_SPACE),i.selection.insertNode(o),i.selection.setAfter(o)):i.selection.setAfter(f)},state:function(i){var e=i.doc,r,u,f;return n.dom.hasElementWithTagName(e,t)?(r=i.selection.getSelectedNode(),!r)?!1:r.nodeName===t?r:r.nodeType!==n.ELEMENT_NODE?!1:(u=i.selection.getText(),u=n.lang.string(u).trim(),u)?!1:(f=i.selection.getNodes(n.ELEMENT_NODE,function(n){return n.nodeName==="IMG"}),f.length!==1)?!1:f[0]:!1},value:function(n){var t=this.state(n);return t&&t.src}}}(wysihtml5),function(n){var t,i="<br>"+(n.browser.needsSpaceAfterLineBreak()?" ":"");n.commands.insertLineBreak={exec:function(t,r){t.commands.support(r)?(t.doc.execCommand(r,!1,null),n.browser.autoScrollsToCaret()||t.selection.scrollIntoView()):t.commands.exec("insertHTML",i)},state:function(){return!1},value:function(){return t}}}(wysihtml5),function(n){var t;n.commands.insertOrderedList={exec:function(t,i){var f=t.doc,e=t.selection.getSelectedNode(),r=n.dom.getParentElement(e,{nodeName:"OL"}),o=n.dom.getParentElement(e,{nodeName:"UL"}),s="_wysihtml5-temp-"+(new Date).getTime(),h,u;if(t.commands.support(i)){f.execCommand(i,!1,null);return}r?t.selection.executeAndRestoreSimple(function(){n.dom.resolveList(r)}):o?t.selection.executeAndRestoreSimple(function(){n.dom.renameElement(o,"ol")}):(t.commands.exec("formatBlock","div",s),u=f.querySelector("."+s),h=u.innerHTML===""||u.innerHTML===n.INVISIBLE_SPACE,t.selection.executeAndRestoreSimple(function(){r=n.dom.convertToList(u,"ol")}),h&&t.selection.selectNode(r.querySelector("li")))},state:function(t){var i=t.selection.getSelectedNode();return n.dom.getParentElement(i,{nodeName:"OL"})},value:function(){return t}}}(wysihtml5),function(n){var t;n.commands.insertUnorderedList={exec:function(t,i){var f=t.doc,e=t.selection.getSelectedNode(),r=n.dom.getParentElement(e,{nodeName:"UL"}),o=n.dom.getParentElement(e,{nodeName:"OL"}),s="_wysihtml5-temp-"+(new Date).getTime(),h,u;if(t.commands.support(i)){f.execCommand(i,!1,null);return}r?t.selection.executeAndRestoreSimple(function(){n.dom.resolveList(r)}):o?t.selection.executeAndRestoreSimple(function(){n.dom.renameElement(o,"ul")}):(t.commands.exec("formatBlock","div",s),u=f.querySelector("."+s),h=u.innerHTML===""||u.innerHTML===n.INVISIBLE_SPACE,t.selection.executeAndRestoreSimple(function(){r=n.dom.convertToList(u,"ul")}),h&&t.selection.selectNode(r.querySelector("li")))},state:function(t){var i=t.selection.getSelectedNode();return n.dom.getParentElement(i,{nodeName:"UL"})},value:function(){return t}}}(wysihtml5),function(n){var t;n.commands.italic={exec:function(t,i){return n.commands.formatInline.exec(t,i,"i")},state:function(t,i){return n.commands.formatInline.state(t,i,"i")},value:function(){return t}}}(wysihtml5),function(n){var r,t="wysiwyg-text-align-center",i=/wysiwyg-text-align-[a-z]+/g;n.commands.justifyCenter={exec:function(r){return n.commands.formatBlock.exec(r,"formatBlock",null,t,i)},state:function(r){return n.commands.formatBlock.state(r,"formatBlock",null,t,i)},value:function(){return r}}}(wysihtml5),function(n){var r,t="wysiwyg-text-align-left",i=/wysiwyg-text-align-[a-z]+/g;n.commands.justifyLeft={exec:function(r){return n.commands.formatBlock.exec(r,"formatBlock",null,t,i)},state:function(r){return n.commands.formatBlock.state(r,"formatBlock",null,t,i)},value:function(){return r}}}(wysihtml5),function(n){var r,t="wysiwyg-text-align-right",i=/wysiwyg-text-align-[a-z]+/g;n.commands.justifyRight={exec:function(r){return n.commands.formatBlock.exec(r,"formatBlock",null,t,i)},state:function(r){return n.commands.formatBlock.state(r,"formatBlock",null,t,i)},value:function(){return r}}}(wysihtml5),function(n){var t;n.commands.underline={exec:function(t,i){return n.commands.formatInline.exec(t,i,"u")},state:function(t,i){return n.commands.formatInline.state(t,i,"u")},value:function(){return t}}}(wysihtml5),function(n){function h(n){for(var t;t=n.querySelector("._wysihtml5-temp");)t.parentNode.removeChild(t)}var i=90,r=89,u=8,f=46,e=40,o='<span id="_wysihtml5-undo" class="_wysihtml5-temp">'+n.INVISIBLE_SPACE+"<\/span>",s='<span id="_wysihtml5-redo" class="_wysihtml5-temp">'+n.INVISIBLE_SPACE+"<\/span>",t=n.dom;n.UndoManager=n.lang.Dispatcher.extend({constructor:function(n){this.editor=n;this.composer=n.composer;this.element=this.composer.element;this.history=[this.composer.getValue()];this.position=1;this.composer.commands.support("insertHTML")&&this._observe()},_observe:function(){var e=this,c=this.composer.sandbox.getDocument(),a,v,y,l;t.observe(this.element,"keydown",function(n){if(!n.altKey&&(n.ctrlKey||n.metaKey)){var t=n.keyCode,u=t===i&&!n.shiftKey,f=t===i&&n.shiftKey||t===r;u?(e.undo(),n.preventDefault()):f&&(e.redo(),n.preventDefault())}});t.observe(this.element,"keydown",function(n){var t=n.keyCode;t!==a&&(a=t,(t===u||t===f)&&e.transact())});n.browser.hasUndoInContextMenu()&&(l=function(){h(c);clearInterval(v)},t.observe(this.element,"contextmenu",function(){l();e.composer.selection.executeAndRestoreSimple(function(){e.element.lastChild&&e.composer.selection.setAfter(e.element.lastChild);c.execCommand("insertHTML",!1,o);c.execCommand("insertHTML",!1,s);c.execCommand("undo",!1,null)});v=setInterval(function(){c.getElementById("_wysihtml5-redo")?(l(),e.redo()):c.getElementById("_wysihtml5-undo")||(l(),e.undo())},400);y||(y=!0,t.observe(document,"mousedown",l),t.observe(c,["mousedown","paste","cut","copy"],l))}));this.editor.observe("newword:composer",function(){e.transact()}).observe("beforecommand:composer",function(){e.transact()})},transact:function(){var i=this.history[this.position-1],n=this.composer.getValue(),t;n!=i&&(t=this.history.length=this.position,t>e&&(this.history.shift(),this.position--),this.position++,this.history.push(n))},undo:function(){(this.transact(),this.position<=1)||(this.set(this.history[--this.position-1]),this.editor.fire("undo:composer"))},redo:function(){this.position>=this.history.length||(this.set(this.history[++this.position-1]),this.editor.fire("redo:composer"))},set:function(n){this.composer.setValue(n);this.editor.focus(!0)}})}(wysihtml5);wysihtml5.views.View=Base.extend({constructor:function(n,t,i){this.parent=n;this.element=t;this.config=i;this._observeViewChange()},_observeViewChange:function(){var n=this;this.parent.observe("beforeload",function(){n.parent.observe("change_view",function(t){t===n.name?(n.parent.currentView=n,n.show(),setTimeout(function(){n.focus()},0)):n.hide()})})},focus:function(){if(this.element.ownerDocument.querySelector(":focus")!==this.element)try{this.element.focus()}catch(n){}},hide:function(){this.element.style.display="none"},show:function(){this.element.style.display=""},disable:function(){this.element.setAttribute("disabled","disabled")},enable:function(){this.element.removeAttribute("disabled")}}),function(n){var t=n.dom,i=n.browser;n.views.Composer=n.views.View.extend({name:"composer",CARET_HACK:"<br>",constructor:function(n,t,i){this.base(n,t,i);this.textarea=this.parent.textarea;this._initSandbox()},clear:function(){this.element.innerHTML=i.displaysCaretInEmptyContentEditableCorrectly()?"":this.CARET_HACK},getValue:function(t){var i=this.isEmpty()?"":n.quirks.getCorrectInnerHTML(this.element);return t&&(i=this.parent.parse(i)),n.lang.string(i).replace(n.INVISIBLE_SPACE).by("")},setValue:function(n,t){t&&(n=this.parent.parse(n));this.element.innerHTML=n},show:function(){this.iframe.style.display=this._displayStyle||"";this.disable();this.enable()},hide:function(){this._displayStyle=t.getStyle("display").from(this.iframe);this._displayStyle==="none"&&(this._displayStyle=null);this.iframe.style.display="none"},disable:function(){this.element.removeAttribute("contentEditable");this.base()},enable:function(){this.element.setAttribute("contentEditable","true");this.base()},focus:function(t){n.browser.doesAsyncFocus()&&this.hasPlaceholderSet()&&this.clear();this.base();var i=this.element.lastChild;t&&i&&(i.nodeName==="BR"?this.selection.setBefore(this.element.lastChild):this.selection.setAfter(this.element.lastChild))},getTextContent:function(){return t.getTextContent(this.element)},hasPlaceholderSet:function(){return this.getTextContent()==this.textarea.element.getAttribute("placeholder")},isEmpty:function(){var n=this.element.innerHTML;return n===""||n===this.CARET_HACK||this.hasPlaceholderSet()||this.getTextContent()===""&&!this.element.querySelector("blockquote, ul, ol, img, embed, object, table, iframe, svg, video, audio, button, input, select, textarea")},_initSandbox:function(){var r=this,n,i;this.sandbox=new t.Sandbox(function(){r._create()},{stylesheets:this.config.stylesheets});this.iframe=this.sandbox.getIframe();n=document.createElement("input");n.type="hidden";n.name="_wysihtml5_mode";n.value=1;i=this.textarea.element;t.insert(this.iframe).after(i);t.insert(n).after(i)},_create:function(){var f=this,r,u;this.doc=this.sandbox.getDocument();this.element=this.doc.body;this.textarea=this.parent.textarea;this.element.innerHTML=this.textarea.getValue(!0);this.enable();this.selection=new n.Selection(this.parent);this.commands=new n.Commands(this.parent);t.copyAttributes(["className","spellcheck","title","lang","dir","accessKey"]).from(this.textarea.element).to(this.element);t.addClass(this.element,this.config.composerClassName);this.config.style&&this.style();this.observe();r=this.config.name;r&&(t.addClass(this.element,r),t.addClass(this.iframe,r));u=typeof this.config.placeholder=="string"?this.config.placeholder:this.textarea.element.getAttribute("placeholder");u&&t.simulatePlaceholder(this.parent,this,u);this.commands.exec("styleWithCSS",!1);this._initAutoLinking();this._initObjectResizing();this._initUndoManager();(this.textarea.element.hasAttribute("autofocus")||document.querySelector(":focus")==this.textarea.element)&&setTimeout(function(){f.focus()},100);n.quirks.insertLineBreakOnReturn(this);i.clearsContentEditableCorrectly()||n.quirks.ensureProperClearing(this);i.clearsListsInContentEditableCorrectly()||n.quirks.ensureProperClearingOfLists(this);this.initSync&&this.config.sync&&this.initSync();this.textarea.hide();this.parent.fire("beforeload").fire("load")},_initAutoLinking:function(){var r=this,u=i.canDisableAutoLinking(),f=i.doesAutoLinkingInContentEditable();if(u&&this.commands.exec("autoUrlDetect",!1),this.config.autoLink){(!f||f&&u)&&this.parent.observe("newword:composer",function(){r.selection.executeAndRestore(function(n,i){t.autoLink(i.parentNode)})});var o=this.sandbox.getDocument().getElementsByTagName("a"),s=t.autoLink.URL_REG_EXP,e=function(i){var r=n.lang.string(t.getTextContent(i)).trim();return r.substr(0,4)==="www."&&(r="http://"+r),r};t.observe(this.element,"keydown",function(n){if(o.length){var f=r.selection.getSelectedNode(n.target.ownerDocument),i=t.getParentElement(f,{nodeName:"A"},4),u;i&&(u=e(i),setTimeout(function(){var n=e(i);n!==u&&n.match(s)&&i.setAttribute("href",n)},0))}})}},_initObjectResizing:function(){var u=["width","height"],f=u.length,r=this.element;this.commands.exec("enableObjectResizing",this.config.allowObjectResizing);this.config.allowObjectResizing?i.supportsEvent("resizeend")&&t.observe(r,"resizeend",function(t){for(var s=t.target||t.srcElement,e=s.style,o=0,i;o<f;o++)i=u[o],e[i]&&(s.setAttribute(i,parseInt(e[i],10)),e[i]="");n.quirks.redraw(r)}):i.supportsEvent("resizestart")&&t.observe(r,"resizestart",function(n){n.preventDefault()})},_initUndoManager:function(){new n.UndoManager(this.parent)}})}(wysihtml5),function(n){var t=n.dom,i=document,u=window,e=i.createElement("div"),r=["background-color","color","cursor","font-family","font-size","font-style","font-variant","font-weight","line-height","letter-spacing","text-align","text-decoration","text-indent","text-rendering","word-break","word-wrap","word-spacing"],f=["background-color","border-collapse","border-bottom-color","border-bottom-style","border-bottom-width","border-left-color","border-left-style","border-left-width","border-right-color","border-right-style","border-right-width","border-top-color","border-top-style","border-top-width","clear","display","float","margin-bottom","margin-left","margin-right","margin-top","outline-color","outline-offset","outline-width","outline-style","padding-left","padding-right","padding-top","padding-bottom","position","top","left","right","bottom","z-index","vertical-align","text-align","-webkit-box-sizing","-moz-box-sizing","-ms-box-sizing","box-sizing","-webkit-box-shadow","-moz-box-shadow","-ms-box-shadow","box-shadow","-webkit-border-top-right-radius","-moz-border-radius-topright","border-top-right-radius","-webkit-border-bottom-right-radius","-moz-border-radius-bottomright","border-bottom-right-radius","-webkit-border-bottom-left-radius","-moz-border-radius-bottomleft","border-bottom-left-radius","-webkit-border-top-left-radius","-moz-border-radius-topleft","border-top-left-radius","width","height"],o=["width","height","top","left","right","bottom"],s=["html             { height: 100%; }","body             { min-height: 100%; padding: 0; margin: 0; margin-top: -1px; padding-top: 1px; }","._wysihtml5-temp { display: none; }",n.browser.isGecko?"body.placeholder { color: graytext !important; }":"body.placeholder { color: #a9a9a9 !important; }","body[disabled]   { background-color: #eee !important; color: #999 !important; cursor: default !important; }","img:-moz-broken  { -moz-force-broken-image-icon: 1; height: 24px; width: 24px; }"],h=function(n){if(n.setActive)try{n.setActive()}catch(s){}else{var r=n.style,f=i.documentElement.scrollTop||i.body.scrollTop,e=i.documentElement.scrollLeft||i.body.scrollLeft,o={position:r.position,top:r.top,left:r.left,WebkitUserSelect:r.WebkitUserSelect};t.setStyles({position:"absolute",top:"-99999px",left:"-99999px",WebkitUserSelect:"none"}).on(n);n.focus();t.setStyles(o).on(n);u.scrollTo&&u.scrollTo(e,f)}};n.views.Composer.prototype.style=function(){var l=this,a=i.querySelector(":focus"),c=this.textarea.element,v=c.hasAttribute("placeholder"),w=v&&c.getAttribute("placeholder"),y,p;return this.focusStylesHost=this.focusStylesHost||e.cloneNode(!1),this.blurStylesHost=this.blurStylesHost||e.cloneNode(!1),v&&c.removeAttribute("placeholder"),c===a&&c.blur(),t.copyStyles(f).from(c).to(this.iframe).andTo(this.blurStylesHost),t.copyStyles(r).from(c).to(this.element).andTo(this.blurStylesHost),t.insertCSS(s).into(this.element.ownerDocument),h(c),t.copyStyles(f).from(c).to(this.focusStylesHost),t.copyStyles(r).from(c).to(this.focusStylesHost),y=n.lang.array(f).without(["display"]),a?a.focus():c.blur(),v&&c.setAttribute("placeholder",w),n.browser.hasCurrentStyleProperty()||(p=t.observe(u,"resize",function(){if(!t.contains(document.documentElement,l.iframe)){p.stop();return}var n=t.getStyle("display").from(c),i=t.getStyle("display").from(l.iframe);c.style.display="";l.iframe.style.display="none";t.copyStyles(o).from(c).to(l.iframe).andTo(l.focusStylesHost).andTo(l.blurStylesHost);l.iframe.style.display=i;c.style.display=n})),this.parent.observe("focus:composer",function(){t.copyStyles(y).from(l.focusStylesHost).to(l.iframe);t.copyStyles(r).from(l.focusStylesHost).to(l.element)}),this.parent.observe("blur:composer",function(){t.copyStyles(y).from(l.blurStylesHost).to(l.iframe);t.copyStyles(r).from(l.blurStylesHost).to(l.element)}),this}}(wysihtml5),function(n){var t=n.dom,i=n.browser,r={"66":"bold","73":"italic","85":"underline"};n.views.Composer.prototype.observe=function(){var u=this,o=this.getValue(),s=this.sandbox.getIframe(),f=this.element,h=i.supportsEventsInIframeCorrectly()?f:this.sandbox.getWindow(),l=i.supportsEvent("drop")?["drop","paste"]:["dragdrop","paste"],e,c;t.observe(s,"DOMNodeRemoved",function(){clearInterval(e);u.parent.fire("destroy:composer")});e=setInterval(function(){t.contains(document.documentElement,s)||(clearInterval(e),u.parent.fire("destroy:composer"))},250);t.observe(h,"focus",function(){u.parent.fire("focus").fire("focus:composer");setTimeout(function(){o=u.getValue()},0)});t.observe(h,"blur",function(){o!==u.getValue()&&u.parent.fire("change").fire("change:composer");u.parent.fire("blur").fire("blur:composer")});n.browser.isIos()&&t.observe(f,"blur",function(){var n=f.ownerDocument.createElement("input"),t=document.documentElement.scrollTop||document.body.scrollTop,i=document.documentElement.scrollLeft||document.body.scrollLeft;try{u.selection.insertNode(n)}catch(r){f.appendChild(n)}n.focus();n.parentNode.removeChild(n);window.scrollTo(i,t)});t.observe(f,"dragenter",function(){u.parent.fire("unset_placeholder")});i.firesOnDropOnlyWhenOnDragOverIsCancelled()&&t.observe(f,["dragover","dragenter"],function(n){n.preventDefault()});t.observe(f,l,function(n){var t=n.dataTransfer,r;console.log("PASTED",n);t&&i.supportsDataTransfer()&&(r=t.getData("text/html")||t.getData("text/plain"));r?(f.focus(),u.commands.exec("insertHTML",r),u.parent.fire("paste").fire("paste:composer"),n.stopPropagation(),n.preventDefault()):setTimeout(function(){u.parent.fire("paste").fire("paste:composer")},0)});t.observe(f,"keyup",function(t){var i=t.keyCode;(i===n.SPACE_KEY||i===n.ENTER_KEY)&&u.parent.fire("newword:composer")});this.parent.observe("paste:composer",function(){setTimeout(function(){u.parent.fire("newword:composer")},0)});i.canSelectImagesInContentEditable()||t.observe(f,"mousedown",function(n){var t=n.target;t.nodeName==="IMG"&&(u.selection.selectNode(t),n.preventDefault())});t.observe(f,"keydown",function(n){var i=n.keyCode,t=r[i];(n.ctrlKey||n.metaKey)&&!n.altKey&&t&&(u.commands.exec(t),n.preventDefault())});t.observe(f,"keydown",function(t){var r=u.selection.getSelectedNode(!0),e=t.keyCode,i;r&&r.nodeName==="IMG"&&(e===n.BACKSPACE_KEY||e===n.DELETE_KEY)&&(i=r.parentNode,i.removeChild(r),i.nodeName!=="A"||i.firstChild||i.parentNode.removeChild(i),setTimeout(function(){n.quirks.redraw(f)},0),t.preventDefault())});c={IMG:"Image: ",A:"Link: "};t.observe(f,"mouseover",function(n){var t=n.target,i=t.nodeName,r,u;(i==="A"||i==="IMG")&&(u=t.hasAttribute("title"),u||(r=c[i]+(t.getAttribute("href")||t.getAttribute("src")),t.setAttribute("title",r)))})}}(wysihtml5),function(n){var t=400;n.views.Synchronizer=Base.extend({constructor:function(n,t,i){this.editor=n;this.textarea=t;this.composer=i;this._observe()},fromComposerToTextarea:function(t){this.textarea.setValue(n.lang.string(this.composer.getValue()).trim(),t)},fromTextareaToComposer:function(n){var t=this.textarea.getValue();t?this.composer.setValue(t,n):(this.composer.clear(),this.editor.fire("set_placeholder"))},sync:function(n){this.editor.currentView.name==="textarea"?this.fromTextareaToComposer(n):this.fromComposerToTextarea(n)},_observe:function(){var r,i=this,u=this.textarea.element.form,f=function(){r=setInterval(function(){i.fromComposerToTextarea()},t)},e=function(){clearInterval(r);r=null};f();u&&(n.dom.observe(u,"submit",function(){i.sync(!0)}),n.dom.observe(u,"reset",function(){setTimeout(function(){i.fromTextareaToComposer()},0)}));this.editor.observe("change_view",function(n){n!=="composer"||r?n==="textarea"&&(i.fromComposerToTextarea(!0),e()):(i.fromTextareaToComposer(!0),f())});this.editor.observe("destroy:composer",e)}})}(wysihtml5);wysihtml5.views.Textarea=wysihtml5.views.View.extend({name:"textarea",constructor:function(n,t,i){this.base(n,t,i);this._observe()},clear:function(){this.element.value=""},getValue:function(n){var t=this.isEmpty()?"":this.element.value;return n&&(t=this.parent.parse(t)),t},setValue:function(n,t){t&&(n=this.parent.parse(n));this.element.value=n},hasPlaceholderSet:function(){var t=wysihtml5.browser.supportsPlaceholderAttributeOn(this.element),i=this.element.getAttribute("placeholder")||null,n=this.element.value,r=!n;return t&&r||n===i},isEmpty:function(){return!wysihtml5.lang.string(this.element.value).trim()||this.hasPlaceholderSet()},_observe:function(){var t=this.element,n=this.parent,i={focusin:"focus",focusout:"blur"},r=wysihtml5.browser.supportsEvent("focusin")?["focusin","focusout","change"]:["focus","blur","change"];n.observe("beforeload",function(){wysihtml5.dom.observe(t,r,function(t){var r=i[t.type]||t.type;n.fire(r).fire(r+":textarea")});wysihtml5.dom.observe(t,["paste","drop"],function(){setTimeout(function(){n.fire("paste").fire("paste:textarea")},0)})})}}),function(n){var t=n.dom,i="wysihtml5-command-dialog-opened",r="input, select, textarea",u="[data-wysihtml5-dialog-field]",f="data-wysihtml5-dialog-field";n.toolbar.Dialog=n.lang.Dispatcher.extend({constructor:function(n,t){this.link=n;this.container=t},_observe:function(){var u,f;if(!this._observed){u=this;f=function(n){var t=u._serialize();t==u.elementToChange?u.fire("edit",t):u.fire("save",t);u.hide();n.preventDefault();n.stopPropagation()};t.observe(u.link,"click",function(){t.hasClass(u.link,i)&&setTimeout(function(){u.hide()},0)});t.observe(this.container,"keydown",function(t){var i=t.keyCode;i===n.ENTER_KEY&&f(t);i===n.ESCAPE_KEY&&u.hide()});t.delegate(this.container,"[data-wysihtml5-dialog-action=save]","click",f);t.delegate(this.container,"[data-wysihtml5-dialog-action=cancel]","click",function(n){u.fire("cancel");u.hide();n.preventDefault();n.stopPropagation()});for(var o=this.container.querySelectorAll(r),e=0,s=o.length,h=function(){clearInterval(u.interval)};e<s;e++)t.observe(o[e],"change",h);this._observed=!0}},_serialize:function(){for(var i=this.elementToChange||{},t=this.container.querySelectorAll(u),r=t.length,n=0;n<r;n++)i[t[n].getAttribute(f)]=t[n].value;return i},_interpolate:function(n){for(var t,r,e,s=document.querySelector(":focus"),o=this.container.querySelectorAll(u),h=o.length,i=0;i<h;i++)(t=o[i],t!==s)&&(n&&t.type==="hidden"||(r=t.getAttribute(f),e=this.elementToChange?this.elementToChange[r]||"":t.defaultValue,t.value=e))},show:function(n){var f=this,u=this.container.querySelector(r);if(this.elementToChange=n,this._observe(),this._interpolate(),n&&(this.interval=setInterval(function(){f._interpolate(!0)},500)),t.addClass(this.link,i),this.container.style.display="",this.fire("show"),u&&!n)try{u.focus()}catch(e){}},hide:function(){clearInterval(this.interval);this.elementToChange=null;t.removeClass(this.link,i);this.container.style.display="none";this.fire("hide")}})}(wysihtml5),function(n){var t=n.dom,r={position:"relative"},i={left:0,margin:0,opacity:0,overflow:"hidden",padding:0,position:"absolute",top:0,zIndex:1},u={cursor:"inherit",fontSize:"50px",height:"50px",marginTop:"-25px",outline:0,padding:0,position:"absolute",right:"-4px",top:"50%"},f={"x-webkit-speech":"",speech:""};n.toolbar.Speech=function(e,o){var s=document.createElement("input"),h,c;if(!n.browser.supportsSpeechApiOn(s)){o.style.display="none";return}h=document.createElement("div");n.lang.object(i).merge({width:o.offsetWidth+"px",height:o.offsetHeight+"px"});t.insert(s).into(h);t.insert(h).into(o);t.setStyles(u).on(s);t.setAttributes(f).on(s);t.setStyles(i).on(h);t.setStyles(r).on(o);c="onwebkitspeechchange"in s?"webkitspeechchange":"speechchange";t.observe(s,c,function(){e.execCommand("insertText",s.value);s.value=""});t.observe(s,"click",function(n){t.hasClass(o,"wysihtml5-command-disabled")&&n.preventDefault();n.stopPropagation()})}}(wysihtml5),function(n){var r="wysihtml5-command-disabled",u="wysihtml5-commands-disabled",i="wysihtml5-command-active",f="wysihtml5-action-active",t=n.dom;n.toolbar.Toolbar=Base.extend({constructor:function(t,i){this.editor=t;this.container=typeof i=="string"?document.getElementById(i):i;this.composer=t.composer;this._getLinks("command");this._getLinks("action");this._observe();this.show();for(var u=this.container.querySelectorAll("[data-wysihtml5-command=insertSpeech]"),f=u.length,r=0;r<f;r++)new n.toolbar.Speech(this,u[r])},_getLinks:function(t){for(var e=this[t+"Links"]=n.lang.array(this.container.querySelectorAll("[data-wysihtml5-"+t+"]")).get(),h=e.length,u=0,c=this[t+"Mapping"]={},i,o,r,f,s;u<h;u++)i=e[u],r=i.getAttribute("data-wysihtml5-"+t),f=i.getAttribute("data-wysihtml5-"+t+"-value"),o=this.container.querySelector("[data-wysihtml5-"+t+"-group='"+r+"']"),s=this._getDialog(i,r),c[r+":"+f]={link:i,group:o,name:r,value:f,dialog:s,state:!1}},_getDialog:function(t,i){var r=this,u=this.container.querySelector("[data-wysihtml5-dialog='"+i+"']"),f,e;return u&&(f=new n.toolbar.Dialog(t,u),f.observe("show",function(){e=r.composer.selection.getBookmark();r.editor.fire("show:dialog",{command:i,dialogContainer:u,commandLink:t})}),f.observe("save",function(n){e&&r.composer.selection.setBookmark(e);r._execCommand(i,n);r.editor.fire("save:dialog",{command:i,dialogContainer:u,commandLink:t})}),f.observe("cancel",function(){r.editor.focus(!1);r.editor.fire("cancel:dialog",{command:i,dialogContainer:u,commandLink:t})})),f},execCommand:function(n,t){if(!this.commandsDisabled){var i=this.commandMapping[n+":"+t];i&&i.dialog&&!i.state?i.dialog.show():this._execCommand(n,t)}},_execCommand:function(n,t){this.editor.focus(!1);this.composer.commands.exec(n,t);this._updateLinkStates()},execAction:function(n){var t=this.editor;switch(n){case"change_view":t.currentView===t.textarea?t.fire("change_view","composer"):t.fire("change_view","textarea")}},_observe:function(){for(var n=this,r=this.editor,i=this.container,e=this.commandLinks.concat(this.actionLinks),o=e.length,f=0;f<o;f++)t.setAttributes({href:"javascript:;",unselectable:"on"}).on(e[f]);t.delegate(i,"[data-wysihtml5-command]","mousedown",function(n){n.preventDefault()});t.delegate(i,"[data-wysihtml5-command]","click",function(t){var i=this,r=i.getAttribute("data-wysihtml5-command"),u=i.getAttribute("data-wysihtml5-command-value");n.execCommand(r,u);t.preventDefault()});t.delegate(i,"[data-wysihtml5-action]","click",function(t){var i=this.getAttribute("data-wysihtml5-action");n.execAction(i);t.preventDefault()});r.observe("focus:composer",function(){n.bookmark=null;clearInterval(n.interval);n.interval=setInterval(function(){n._updateLinkStates()},500)});r.observe("blur:composer",function(){clearInterval(n.interval)});r.observe("destroy:composer",function(){clearInterval(n.interval)});r.observe("change_view",function(r){setTimeout(function(){n.commandsDisabled=r!=="composer";n._updateLinkStates();n.commandsDisabled?t.addClass(i,u):t.removeClass(i,u)},0)})},_updateLinkStates:function(){var l=this.composer.element,h=this.commandMapping,c=this.actionMapping,s,e,o,u;for(s in h)(u=h[s],this.commandsDisabled?(e=!1,t.removeClass(u.link,i),u.group&&t.removeClass(u.group,i),u.dialog&&u.dialog.hide()):(e=this.composer.commands.state(u.name,u.value),n.lang.object(e).isArray()&&(e=e.length===1?e[0]:!0),t.removeClass(u.link,r),u.group&&t.removeClass(u.group,r)),u.state!==e)&&(u.state=e,e?(t.addClass(u.link,i),u.group&&t.addClass(u.group,i),u.dialog&&(typeof e=="object"?u.dialog.show(e):u.dialog.hide())):(t.removeClass(u.link,i),u.group&&t.removeClass(u.group,i),u.dialog&&u.dialog.hide()));for(s in c)o=c[s],o.name==="change_view"&&(o.state=this.editor.currentView===this.editor.textarea,o.state?t.addClass(o.link,f):t.removeClass(o.link,f))},show:function(){this.container.style.display=""},hide:function(){this.container.style.display="none"}})}(wysihtml5),function(n){var t,i={name:t,style:!0,toolbar:t,autoLink:!0,parserRules:{tags:{br:{},span:{},div:{},p:{}},classes:{}},parser:n.dom.parse,composerClassName:"wysihtml5-editor",bodyClassName:"wysihtml5-supported",stylesheets:[],placeholderText:t,allowObjectResizing:!0,supportTouchDevices:!0};n.Editor=n.lang.Dispatcher.extend({constructor:function(t,r){if(this.textareaElement=typeof t=="string"?document.getElementById(t):t,this.config=n.lang.object({}).merge(i).merge(r).get(),this.textarea=new n.views.Textarea(this,this.textareaElement,this.config),this.currentView=this.textarea,this._isCompatible=n.browser.supported(),!this._isCompatible||!this.config.supportTouchDevices&&n.browser.isTouchDevice()){var u=this;setTimeout(function(){u.fire("beforeload").fire("load")},0);return}n.dom.addClass(document.body,this.config.bodyClassName);this.composer=new n.views.Composer(this,this.textareaElement,this.config);this.currentView=this.composer;typeof this.config.parser=="function"&&this._initParser();this.observe("beforeload",function(){this.synchronizer=new n.views.Synchronizer(this,this.textarea,this.composer);this.config.toolbar&&(this.toolbar=new n.toolbar.Toolbar(this,this.config.toolbar))})},isCompatible:function(){return this._isCompatible},clear:function(){return this.currentView.clear(),this},getValue:function(n){return this.currentView.getValue(n)},setValue:function(n,t){return n?(this.currentView.setValue(n,t),this):this.clear()},focus:function(n){return this.currentView.focus(n),this},disable:function(){return this.currentView.disable(),this},enable:function(){return this.currentView.enable(),this},isEmpty:function(){return this.currentView.isEmpty()},hasPlaceholderSet:function(){return this.currentView.hasPlaceholderSet()},parse:function(t){var i=this.config.parser(t,this.config.parserRules,this.composer.sandbox.getDocument(),!0);return typeof t=="object"&&n.quirks.redraw(t),i},_initParser:function(){this.observe("paste:composer",function(){var t=this;t.composer.selection.executeAndRestore(function(){n.quirks.cleanPastedHTML(t.composer.element);t.parse(t.composer.element)},!0)});this.observe("paste:textarea",function(){var t=this.textarea.getValue(),n;n=this.parse(t);this.textarea.setValue(n)})}})}(wysihtml5);!function(n,t){"use strict";var f={"font-styles":function(n){return"<li class='dropdown'><a class='btn dropdown-toggle' data-toggle='dropdown' href='#'><i class='icon-font'><\/i>&nbsp;<span class='current-font'>"+n.font_styles.normal+"<\/span>&nbsp;<b class='caret'><\/b><\/a><ul class='dropdown-menu'><li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='div'>"+n.font_styles.normal+"<\/a><\/li><li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h1'>"+n.font_styles.h1+"<\/a><\/li><li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h2'>"+n.font_styles.h2+"<\/a><\/li><li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h3'>"+n.font_styles.h3+"<\/a><\/li><\/ul><\/li>"},emphasis:function(){return"<li><div class='btn-group'><a class='btn' data-wysihtml5-command='bold' title='CTRL+B'><i class='icon-bold'><\/i><\/a><a class='btn' data-wysihtml5-command='italic' title='CTRL+I'><i class='icon-italic'><\/i><\/a><a class='btn' data-wysihtml5-command='underline' title='CTRL+U'><i class='icon-underline'><\/i><\/a><\/div><\/li>"},lists:function(n){return"<li><div class='btn-group'><a class='btn' data-wysihtml5-command='insertUnorderedList' title='"+n.lists.unordered+"'><i class='icon-list'><\/i><\/a><a class='btn' data-wysihtml5-command='insertOrderedList' title='"+n.lists.ordered+"'><i class='icon-th-list'><\/i><\/a><a class='btn' data-wysihtml5-command='Outdent' title='"+n.lists.outdent+"'><i class='icon-indent-right'><\/i><\/a><a class='btn' data-wysihtml5-command='Indent' title='"+n.lists.indent+"'><i class='icon-indent-left'><\/i><\/a><\/div><\/li>"},link:function(n){return"<li><div class='bootstrap-wysihtml5-insert-link-modal modal fade'><div class='modal-header'><a class='close' data-dismiss='modal'>&times;<\/a><h3>"+n.link.insert+"<\/h3><\/div><div class='modal-body'><input value='http://' class='bootstrap-wysihtml5-insert-link-url input-xlarge'><\/div><div class='modal-footer'><a href='#' class='btn' data-dismiss='modal'>"+n.link.cancel+"<\/a><a href='#' class='btn btn-primary' data-dismiss='modal'>"+n.link.insert+"<\/a><\/div><\/div><a class='btn' data-wysihtml5-command='createLink' title='"+n.link.insert+"'><i class='icon-share'><\/i><\/a><\/li>"},image:function(n){return"<li><div class='bootstrap-wysihtml5-insert-image-modal modal fade'><div class='modal-header'><a class='close' data-dismiss='modal'>&times;<\/a><h3>"+n.image.insert+"<\/h3><\/div><div class='modal-body'><input value='http://' class='bootstrap-wysihtml5-insert-image-url input-xlarge'><\/div><div class='modal-footer'><a href='#' class='btn' data-dismiss='modal'>"+n.image.cancel+"<\/a><a href='#' class='btn btn-primary' data-dismiss='modal'>"+n.image.insert+"<\/a><\/div><\/div><a class='btn' data-wysihtml5-command='insertImage' title='"+n.image.insert+"'><i class='icon-picture'><\/i><\/a><\/li>"},video:function(n){return"<li><div class='bootstrap-wysihtml5-insert-video-modal modal fade'><div class='modal-header'><a class='close' data-dismiss='modal'>&times;<\/a><h3>"+n.video.insert+"<\/h3><\/div><div class='modal-body'><div class='control-group'><input type='text' data-wysihtml5-dialog-field='src' value='http://' class='bootstrap-wysihtml5-insert-video-url input-xlarge'><\/div><div class='control-group error form-inline'><label class='video-error'>"+n.video.invalid+"<\/label><\/div><\/div><div class='modal-footer'><a href='#' class='btn' data-dismiss='modal' data-wysihtml5-dialog-action='cancel'>"+n.video.cancel+"<\/a><a href='#' class='btn btn-primary' data-dismiss='modal' data-wysihtml5-dialog-action='save'>"+n.video.insert+"<\/a><\/div><\/div><a class='btn' data-wysihtml5-command='insertVideo' title='"+n.video.insert+"'><i class='icon-film'><\/i><\/a><\/li>"},html:function(n){return"<li><div class='btn-group'><a class='btn' data-wysihtml5-action='change_view' title='"+n.html.edit+"'><i class='icon-pencil'><\/i><\/a><\/div><\/li>"},color:function(n){return"<li class='dropdown'><a class='btn dropdown-toggle' data-toggle='dropdown' href='#'><span class='current-color'>"+n.colours.black+"<\/span>&nbsp;<b class='caret'><\/b><\/a><ul class='dropdown-menu'><li><div class='wysihtml5-colors' data-wysihtml5-command-value='black'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='black'>"+n.colours.black+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='silver'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='silver'>"+n.colours.silver+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='gray'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='gray'>"+n.colours.gray+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='maroon'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='maroon'>"+n.colours.maroon+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='red'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='red'>"+n.colours.red+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='purple'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='purple'>"+n.colours.purple+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='green'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='green'>"+n.colours.green+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='olive'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='olive'>"+n.colours.olive+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='navy'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='navy'>"+n.colours.navy+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='blue'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='blue'>"+n.colours.blue+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='orange'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='orange'>"+n.colours.orange+"<\/a><\/li><\/ul><\/li>"}},o=function(n,t){return f[n](t)},u=function(t,i){var u,e;this.el=t;u=i||r;for(e in u.customTemplates)f[e]=u.customTemplates[e];this.toolbar=this.createToolbar(t,u);this.editor=this.createEditor(i);window.editor=this.editor;n("iframe.wysihtml5-sandbox").each(function(t,i){n(i.contentWindow).off("focus.wysihtml5").on({"focus.wysihtml5":function(){n("li.dropdown").removeClass("open")}})})},i,r,e;u.prototype={constructor:u,createEditor:function(n){var i,r;if(n=n||{},n.toolbar=this.toolbar[0],i=new t.Editor(this.el[0],n),n&&n.events)for(r in n.events)i.on(r,n.events[r]);return i},createToolbar:function(t,i){var h=this,f=n("<ul/>",{"class":"wysihtml5-toolbar",style:"display:none"}),c=i.locale||r.locale||"en",u,s;for(u in r)s=!1,i[u]!==undefined?i[u]===!0&&(s=!0):s=r[u],s===!0&&(f.append(o(u,e[c])),u==="html"&&this.initHtml(f),u==="link"&&this.initInsertLink(f),u==="image"&&this.initInsertImage(f),u==="video"&&this.initInsertVideo(f));if(i.toolbar)for(u in i.toolbar)f.append(i.toolbar[u]);return f.find("a[data-wysihtml5-command='formatBlock']").click(function(t){var i=t.target||t.srcElement,r=n(i);h.toolbar.find(".current-font").text(r.html())}),f.find("a[data-wysihtml5-command='foreColor']").click(function(t){var i=t.target||t.srcElement,r=n(i);h.toolbar.find(".current-color").text(r.html())}),this.el.before(f),f},initHtml:function(n){var t="a[data-wysihtml5-action='change_view']";n.find(t).click(function(){n.find("a.btn").not(t).toggleClass("disabled")})},initInsertImage:function(t){var u=this,i=t.find(".bootstrap-wysihtml5-insert-image-modal"),r=i.find(".bootstrap-wysihtml5-insert-image-url"),e=i.find("a.btn-primary"),o=r.val(),f=function(){var n=r.val();r.val(o);u.editor.currentView.element.focus();u.editor.composer.commands.exec("insertImage",n)};r.keypress(function(n){n.which==13&&(f(),i.modal("hide"))});e.click(f);i.on("shown",function(){r.focus()});i.on("hide",function(){u.editor.currentView.element.focus()});t.find("a[data-wysihtml5-command=insertImage]").click(function(){var t=n(this).hasClass("wysihtml5-command-active");if(t)return!0;i.modal("show");i.on("click.dismiss.modal",'[data-dismiss="modal"]',function(n){n.stopPropagation()});return!1})},initInsertVideo:function(n){var r=this,t=n.find(".bootstrap-wysihtml5-insert-video-modal"),i=t.find(".bootstrap-wysihtml5-insert-video-url"),e=t.find("a.btn-primary"),u=t.find(".video-error").parent(),f=function(){var n,t,f;if(u.hide(),n=i.val(),t=n,n.substr(0,32)=="https://www.youtube.com/watch?v=")f=n.substr(32),t="https://www.youtube.com/embed/"+f.split("&")[0],i.val(n),r.editor.currentView.element.focus(),r.editor.composer.commands.exec("insertVideo",{src:t,width:"398",height:"224"});else return u.show(),!1};i.keypress(function(n){n.which==13&&(f(),t.modal("hide"))});e.click(f);t.on("shown",function(){i.focus()});t.on("hide",function(){r.editor.currentView.element.focus()});n.find("a[data-wysihtml5-command=insertVideo]").click(function(){t.modal("show");t.on("click.dismiss.modal",'[data-dismiss="modal"]',function(n){n.stopPropagation()});return!1})},initInsertLink:function(t){var u=this,i=t.find(".bootstrap-wysihtml5-insert-link-modal"),r=i.find(".bootstrap-wysihtml5-insert-link-url"),e=i.find("a.btn-primary"),o=r.val(),f=function(){var n=r.val();r.val(o);u.editor.currentView.element.focus();u.editor.composer.commands.exec("createLink",{href:n,target:"_blank",rel:"nofollow"})};r.keypress(function(n){n.which==13&&(f(),i.modal("hide"))});e.click(f);i.on("shown",function(){r.focus()});i.on("hide",function(){u.editor.currentView.element.focus()});t.find("a[data-wysihtml5-command=createLink]").click(function(){var t=n(this).hasClass("wysihtml5-command-active");if(t)return!0;i.appendTo("body").modal("show");i.on("click.dismiss.modal",'[data-dismiss="modal"]',function(n){n.stopPropagation()});return!1})}};i={resetDefaults:function(){n.fn.wysihtml5.defaultOptions=n.extend(!0,{},n.fn.wysihtml5.defaultOptionsCache)},bypassDefaults:function(t){return this.each(function(){var i=n(this);i.data("wysihtml5",new u(i,t))})},shallowExtend:function(t){var r=n.extend({},n.fn.wysihtml5.defaultOptions,t||{}),u=this;return i.bypassDefaults.apply(u,[r])},deepExtend:function(t){var r=n.extend(!0,{},n.fn.wysihtml5.defaultOptions,t||{}),u=this;return i.bypassDefaults.apply(u,[r])},init:function(n){var t=this;return i.shallowExtend.apply(t,[n])}};n.fn.wysihtml5=function(t){if(i[t])return i[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t!="object"&&t)n.error("Method "+t+" does not exist on jQuery.wysihtml5");else return i.init.apply(this,arguments)};n.fn.wysihtml5.Constructor=u;r=n.fn.wysihtml5.defaultOptions={"font-styles":!0,color:!1,emphasis:!0,lists:!0,html:!1,link:!0,image:!0,video:!0,events:{},parserRules:{classes:{"wysiwyg-color-silver":1,"wysiwyg-color-gray":1,"wysiwyg-color-white":1,"wysiwyg-color-maroon":1,"wysiwyg-color-red":1,"wysiwyg-color-purple":1,"wysiwyg-color-fuchsia":1,"wysiwyg-color-green":1,"wysiwyg-color-lime":1,"wysiwyg-color-olive":1,"wysiwyg-color-yellow":1,"wysiwyg-color-navy":1,"wysiwyg-color-blue":1,"wysiwyg-color-teal":1,"wysiwyg-color-aqua":1,"wysiwyg-color-orange":1},tags:{b:{},i:{},br:{check_attributes:{style:"allow","class":"allow"}},ol:{},ul:{check_attributes:{style:"allow","class":"allow"}},li:{check_attributes:{style:"allow","class":"allow"}},h1:{check_attributes:{style:"allow","class":"allow"}},h2:{check_attributes:{style:"allow","class":"allow"}},h3:{check_attributes:{style:"allow","class":"allow"}},blockquote:{},u:1,img:{check_attributes:{width:"numbers",alt:"alt",height:"numbers",src:"allow",style:"allow","class":"allow"}},a:{set_attributes:{target:"_blank",rel:"nofollow"},check_attributes:{href:"url",style:"allow","class":"allow"}},iframe:{check_attributes:{src:"url",width:"numbers",height:"numbers"},set_attributes:{frameborder:"0"}},span:{check_attributes:{style:"allow","class":"allow"}},div:{check_attributes:{style:"allow","class":"allow"}},Table:{check_attributes:{style:"allow","class":"allow"}},thead:{check_attributes:{style:"allow","class":"allow"}},tbody:{check_attributes:{style:"allow","class":"allow"}},tfoot:{check_attributes:{style:"allow","class":"allow"}},th:{check_attributes:{style:"allow","class":"allow"}},tr:{check_attributes:{style:"allow","class":"allow"}},td:{check_attributes:{style:"allow","class":"allow"}},p:{check_attributes:{style:"allow","class":"allow"}},strong:{},em:{}}},locale:"en"};typeof n.fn.wysihtml5.defaultOptionsCache=="undefined"&&(n.fn.wysihtml5.defaultOptionsCache=n.extend(!0,{},n.fn.wysihtml5.defaultOptions));e=n.fn.wysihtml5.locale={en:{font_styles:{normal:"Normal text",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3"},emphasis:{bold:"Bold",italic:"Italic",underline:"Underline"},lists:{unordered:"Unordered list",ordered:"Ordered list",outdent:"Outdent",indent:"Indent"},link:{insert:"Insert link",cancel:"Cancel"},image:{insert:"Insert image",cancel:"Cancel"},video:{insert:"Insert YouTube Video",cancel:"Cancel",invalid:"invalid video URL"},html:{edit:"Edit HTML"},colours:{black:"Black",silver:"Silver",gray:"Grey",maroon:"Maroon",red:"Red",purple:"Purple",green:"Green",olive:"Olive",navy:"Navy",blue:"Blue",orange:"Orange"}}}}(window.jQuery,window.wysihtml5),function(n){var t="IFRAME";n.commands.insertVideo={exec:function(i,r,u){u=typeof u=="object"?u:{src:u};var s=i.doc,f=this.state(i),o,e;if(f){i.selection.setBefore(f);e=f.parentNode;e.removeChild(f);n.dom.removeEmptyTextNodes(e);e.nodeName!=="A"||e.firstChild||(i.selection.setAfter(e),e.parentNode.removeChild(e));n.quirks.redraw(i.element);return}f=s.createElement(t);for(o in u)f[o]=u[o];console.log(f);i.selection.insertNode(f);n.browser.hasProblemsSettingCaretAfterImg()?(textNode=s.createTextNode(n.INVISIBLE_SPACE),i.selection.insertNode(textNode),i.selection.setAfter(textNode)):i.selection.setAfter(f)},state:function(i){var u=i.doc,r,f,e;return n.dom.hasElementWithTagName(u,t)?(r=i.selection.getSelectedNode(u),!r)?!1:r.nodeName===t?r:r.nodeType!==n.ELEMENT_NODE?!1:(f=i.selection.getText(u),f=n.lang.string(f).trim(),f)?!1:(e=i.selection.getNodes(u,n.ELEMENT_NODE,function(n){return n.nodeName==="IFRAME"}),e.length!==1)?!1:e[0]:!1},value:function(n){var t=this.state(n);return t&&t.src}}}(wysihtml5),function(n){n.commands.insertEmbedVideo={exec:function(t,i,r){var u=r.src,f={src:n.commands.getAttributeValue.exec(u,"src"),width:n.commands.getAttributeValue.exec(u,"width"),height:n.commands.getAttributeValue.exec(u,"height")},e=Object.create?Object.create(f):new Object(f);n.commands.insertVideo.exec(t,i,e)},state:function(t){n.commands.insertVideo.state(t)},value:function(t){n.commands.insertVideo.value(t)}}}(wysihtml5),function(n){n.commands.getAttributeValue={exec:function(n,t){return n.substring(parseInt(n.indexOf(t))+t.length+2,n.length).split('" ')[0]}}}(wysihtml5),function(n,t,i){function u(n){return n}function f(n){return decodeURIComponent(n.replace(r," "))}var r=/\+/g;n.cookie=function(r,e,o){var v,h,c,l,s,a;if(e!==i&&!/Object/.test(Object.prototype.toString.call(e)))return o=n.extend({},n.cookie.defaults,o),e===null&&(o.expires=-1),typeof o.expires=="number"&&(v=o.expires,h=o.expires=new Date,h.setDate(h.getDate()+v)),e=String(e),t.cookie=[encodeURIComponent(r),"=",o.raw?e:encodeURIComponent(e),o.expires?"; expires="+o.expires.toUTCString():"",o.path?"; path="+o.path:"",o.domain?"; domain="+o.domain:"",o.secure?"; secure":""].join("");for(o=e||n.cookie.defaults||{},c=o.raw?u:f,l=t.cookie.split("; "),s=0;a=l[s]&&l[s].split("=");s++)if(c(a.shift())===r)return c(a.join("="));return null};n.cookie.defaults={};n.removeCookie=function(t,i){return n.cookie(t,i)!==null?(n.cookie(t,null,i),!0):!1}}(jQuery,document);$(function(){"use strict";var n=$('<div id="cookie-notification">                                 <div class="page-wrap container-fluid">                                     <div class="row-fluid">                                             <p>                                                 <i class="icon-info-sign text-info"><\/i>                                                 Vi anvender cookies til teknisk funktionalitet, webstatistik og for at forbedre brugervenligheden. Når du benytter vores website, giver du samtykke til anvendelsen af cookies. Læs mere om cookies og hvordan de fjernes                                                  <a id="cookie-notification-description-link" href="http://www.fdih.dk/cookies/slet-dine-cookies/" target="_blank">                                                     her.                                                 <\/a>                                             <\/p>                                             <a id="cookie-notification-close-link" class="btn-custom pull-right" href="#">                                                 Ok                                             <\/a>                                     <\/div>                                 <\/div>                             <\/div>');if($.cookie("cbx_cookies_accepted")!=="1"){$.cookie("cbx_cookies_accepted")!=="0"?setTimeout(function(){$(n).appendTo("body").css({left:0,"margin-bottom":-n.outerHeight()+"px"}).animate({"margin-bottom":"0"},500)},500):$(n).appendTo("body").css("left",0);$.cookie("cbx_cookies_accepted","0",{expires:365,path:"/"});$("body").on("click","#cookie-notification-close-link",function(t){$.cookie("cbx_cookies_accepted","1",{expires:365,path:"/"});n.animate({"margin-bottom":-n.outerHeight()+"px"},200,function(){n.remove()});t.preventDefault()})}}),function(n){"use strict";typeof define=="function"&&define.amd?define(["jquery"],n):n(jQuery)}(function(n){"use strict";function i(t,r){var f=function(){},u=this,e={autoSelectFirst:!1,appendTo:"body",serviceUrl:null,lookup:null,onSelect:null,width:"auto",minChars:1,maxHeight:300,deferRequestBy:0,params:{},formatResult:i.formatResult,delimiter:null,zIndex:9999,type:"GET",noCache:!1,onSearchStart:f,onSearchComplete:f,onSearchError:f,containerClass:"autocomplete-suggestions",tabDisabled:!1,dataType:"text",currentRequest:null,triggerSelectOnValidInput:!0,preventBadQueries:!0,lookupFilter:function(n,t,i){return n.value.toLowerCase().indexOf(i)!==-1},paramName:"query",transformResult:function(t){return typeof t=="string"?n.parseJSON(t):t}};u.element=t;u.el=n(t);u.suggestions=[];u.badQueries=[];u.selectedIndex=-1;u.currentValue=u.element.value;u.intervalId=0;u.cachedResponse={};u.onChangeInterval=null;u.onChange=null;u.isLocal=!1;u.suggestionsContainer=null;u.options=n.extend({},e,r);u.classes={selected:"autocomplete-selected",suggestion:"autocomplete-suggestion"};u.hint=null;u.hintValue="";u.selection=null;u.initialize();u.setOptions(r)}var r=function(){return{escapeRegExChars:function(n){return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},createNode:function(n){var t=document.createElement("div");return t.className=n,t.style.position="absolute",t.style.display="none",t}}}(),t={ESC:27,TAB:9,RETURN:13,LEFT:37,UP:38,RIGHT:39,DOWN:40};i.utils=r;n.Autocomplete=i;i.formatResult=function(n,t){var i="("+r.escapeRegExChars(t)+")";return n.value.replace(new RegExp(i,"gi"),"<strong>$1<\/strong>")};i.prototype={killerFn:null,initialize:function(){var t=this,f="."+t.classes.suggestion,e=t.classes.selected,u=t.options,r;t.element.setAttribute("autocomplete","off");t.killerFn=function(i){n(i.target).closest("."+t.options.containerClass).length===0&&(t.killSuggestions(),t.disableKillerFn())};t.suggestionsContainer=i.utils.createNode(u.containerClass);r=n(t.suggestionsContainer);r.appendTo(u.appendTo);u.width!=="auto"&&r.width(u.width);r.on("mouseover.autocomplete",f,function(){t.activate(n(this).data("index"))});r.on("mouseout.autocomplete",function(){t.selectedIndex=-1;r.children("."+e).removeClass(e)});r.on("click.autocomplete",f,function(){t.select(n(this).data("index"))});t.fixPosition();t.fixPositionCapture=function(){t.visible&&t.fixPosition()};n(window).on("resize.autocomplete",t.fixPositionCapture);t.el.on("keydown.autocomplete",function(n){t.onKeyPress(n)});t.el.on("keyup.autocomplete",function(n){t.onKeyUp(n)});t.el.on("blur.autocomplete",function(){t.onBlur()});t.el.on("focus.autocomplete",function(){t.onFocus()});t.el.on("change.autocomplete",function(n){t.onKeyUp(n)})},onFocus:function(){var n=this;n.fixPosition();n.options.minChars<=n.el.val().length&&n.onValueChange()},onBlur:function(){this.enableKillerFn()},setOptions:function(t){var r=this,i=r.options;n.extend(i,t);r.isLocal=n.isArray(i.lookup);r.isLocal&&(i.lookup=r.verifySuggestionsFormat(i.lookup));n(r.suggestionsContainer).css({"max-height":i.maxHeight+"px",width:i.width+"px","z-index":i.zIndex})},clearCache:function(){this.cachedResponse={};this.badQueries=[]},clear:function(){this.clearCache();this.currentValue="";this.suggestions=[]},disable:function(){var n=this;n.disabled=!0;n.currentRequest&&n.currentRequest.abort()},enable:function(){this.disabled=!1},fixPosition:function(){var t=this,i,r;t.options.appendTo==="body"&&(i=t.el.offset(),r={top:i.top+t.el.outerHeight()+"px",left:i.left+"px"},t.options.width==="auto"&&(r.width=t.el.outerWidth()-2+"px"),n(t.suggestionsContainer).css(r))},enableKillerFn:function(){var t=this;n(document).on("click.autocomplete",t.killerFn)},disableKillerFn:function(){var t=this;n(document).off("click.autocomplete",t.killerFn)},killSuggestions:function(){var n=this;n.stopKillSuggestions();n.intervalId=window.setInterval(function(){n.hide();n.stopKillSuggestions()},50)},stopKillSuggestions:function(){window.clearInterval(this.intervalId)},isCursorAtEnd:function(){var i=this,n=i.el.val().length,r=i.element.selectionStart,t;return typeof r=="number"?r===n:document.selection?(t=document.selection.createRange(),t.moveStart("character",-n),n===t.text.length):!0},onKeyPress:function(n){var i=this;if(!i.disabled&&!i.visible&&n.which===t.DOWN&&i.currentValue){i.suggest();return}if(!i.disabled&&i.visible){switch(n.which){case t.ESC:i.el.val(i.currentValue);i.hide();break;case t.RIGHT:if(i.hint&&i.options.onHint&&i.isCursorAtEnd()){i.selectHint();break}return;case t.TAB:if(i.hint&&i.options.onHint){i.selectHint();return}case t.RETURN:if(i.selectedIndex===-1){i.hide();return}if(i.select(i.selectedIndex),n.which===t.TAB&&i.options.tabDisabled===!1)return;break;case t.UP:i.moveUp();break;case t.DOWN:i.moveDown();break;default:return}n.stopImmediatePropagation();n.preventDefault()}},onKeyUp:function(n){var i=this;if(!i.disabled){switch(n.which){case t.UP:case t.DOWN:return}clearInterval(i.onChangeInterval);i.currentValue!==i.el.val()&&(i.findBestHint(),i.options.deferRequestBy>0?i.onChangeInterval=setInterval(function(){i.onValueChange()},i.options.deferRequestBy):i.onValueChange())}},onValueChange:function(){var t=this,i=t.options,f=t.el.val(),r=t.getQuery(f),u;if(t.selection&&(t.selection=null,(i.onInvalidateSelection||n.noop).call(t.element)),clearInterval(t.onChangeInterval),t.currentValue=f,t.selectedIndex=-1,i.triggerSelectOnValidInput&&(u=t.findSuggestionIndex(r),u!==-1)){t.select(u);return}r.length<i.minChars?t.hide():t.getSuggestions(r)},findSuggestionIndex:function(t){var r=this,i=-1,u=t.toLowerCase();return n.each(r.suggestions,function(n,t){if(t.value.toLowerCase()===u)return i=n,!1}),i},getQuery:function(t){var r=this.options.delimiter,i;return r?(i=t.split(r),n.trim(i[i.length-1])):t},getSuggestionsLocal:function(t){var f=this,r=f.options,e=t.toLowerCase(),o=r.lookupFilter,u=parseInt(r.lookupLimit,10),i;return i={suggestions:n.grep(r.lookup,function(n){return o(n,t,e)})},u&&i.suggestions.length>u&&(i.suggestions=i.suggestions.slice(0,u)),i},getSuggestions:function(t){var u,i=this,r=i.options,f=r.serviceUrl,e,o;if(r.params[r.paramName]=t,e=r.ignoreParams?null:r.params,i.isLocal?u=i.getSuggestionsLocal(t):(n.isFunction(f)&&(f=f.call(i.element,t)),o=f+"?"+n.param(e||{}),u=i.cachedResponse[o]),u&&n.isArray(u.suggestions))i.suggestions=u.suggestions,i.suggest();else if(!i.isBadQuery(t)){if(r.onSearchStart.call(i.element,r.params)===!1)return;i.currentRequest&&i.currentRequest.abort();i.currentRequest=n.ajax({url:f,data:e,type:r.type,dataType:r.dataType}).done(function(n){var u;i.currentRequest=null;u=r.transformResult(n);i.processResponse(u,t,o);r.onSearchComplete.call(i.element,t,u.suggestions)}).fail(function(n,u,f){r.onSearchError.call(i.element,t,n,u,f)})}},isBadQuery:function(n){if(!this.options.preventBadQueries)return!1;for(var t=this.badQueries,i=t.length;i--;)if(n.indexOf(t[i])===0)return!0;return!1},hide:function(){var t=this;t.visible=!1;t.selectedIndex=-1;n(t.suggestionsContainer).hide();t.signalHint(null)},suggest:function(){if(this.suggestions.length===0){this.hide();return}var t=this,i=t.options,h=i.formatResult,e=t.getQuery(t.currentValue),c=t.classes.suggestion,l=t.classes.selected,r=n(t.suggestionsContainer),o=i.beforeRender,s="",u,f;if(i.triggerSelectOnValidInput&&(u=t.findSuggestionIndex(e),u!==-1)){t.select(u);return}n.each(t.suggestions,function(n,t){s+='<div class="'+c+'" data-index="'+n+'">'+h(t,e)+"<\/div>"});i.width==="auto"&&(f=t.el.outerWidth()-2,r.width(f>0?f:300));r.html(s);i.autoSelectFirst&&(t.selectedIndex=0,r.children().first().addClass(l));n.isFunction(o)&&o.call(t.element,r);r.show();t.visible=!0;t.findBestHint()},findBestHint:function(){var t=this,i=t.el.val().toLowerCase(),r=null;i&&(n.each(t.suggestions,function(n,t){var u=t.value.toLowerCase().indexOf(i)===0;return u&&(r=t),!u}),t.signalHint(r))},signalHint:function(t){var r="",i=this;t&&(r=i.currentValue+t.value.substr(i.currentValue.length));i.hintValue!==r&&(i.hintValue=r,i.hint=t,(this.options.onHint||n.noop)(r))},verifySuggestionsFormat:function(t){return t.length&&typeof t[0]=="string"?n.map(t,function(n){return{value:n,data:null}}):t},processResponse:function(n,t,i){var r=this,u=r.options;(n.suggestions=r.verifySuggestionsFormat(n.suggestions),u.noCache||(r.cachedResponse[i]=n,u.preventBadQueries&&n.suggestions.length===0&&r.badQueries.push(t)),t===r.getQuery(r.currentValue))&&(r.suggestions=n.suggestions,r.suggest())},activate:function(t){var i=this,r,u=i.classes.selected,f=n(i.suggestionsContainer),e=f.children();return(f.children("."+u).removeClass(u),i.selectedIndex=t,i.selectedIndex!==-1&&e.length>i.selectedIndex)?(r=e.get(i.selectedIndex),n(r).addClass(u),r):null},selectHint:function(){var t=this,i=n.inArray(t.hint,t.suggestions);t.select(i)},select:function(n){var t=this;t.hide();t.onSelect(n)},moveUp:function(){var t=this;if(t.selectedIndex!==-1){if(t.selectedIndex===0){n(t.suggestionsContainer).children().first().removeClass(t.classes.selected);t.selectedIndex=-1;t.el.val(t.currentValue);t.findBestHint();return}t.adjustScroll(t.selectedIndex-1)}},moveDown:function(){var n=this;n.selectedIndex!==n.suggestions.length-1&&n.adjustScroll(n.selectedIndex+1)},adjustScroll:function(t){var i=this,f=i.activate(t),r,u,e,o=25;f&&(r=f.offsetTop,u=n(i.suggestionsContainer).scrollTop(),e=u+i.options.maxHeight-o,r<u?n(i.suggestionsContainer).scrollTop(r):r>e&&n(i.suggestionsContainer).scrollTop(r-i.options.maxHeight+o),i.el.val(i.getValue(i.suggestions[t].value)),i.signalHint(null))},onSelect:function(t){var i=this,u=i.options.onSelect,r=i.suggestions[t];i.currentValue=i.getValue(r.value);i.el.val(i.currentValue);i.signalHint(null);i.suggestions=[];i.selection=r;n.isFunction(u)&&u.call(i.element,r)},getValue:function(n){var r=this,u=r.options.delimiter,t,i;return u?(t=r.currentValue,i=t.split(u),i.length===1)?n:t.substr(0,t.length-i[i.length-1].length)+n:n},dispose:function(){var t=this;t.el.off(".autocomplete").removeData("autocomplete");t.disableKillerFn();n(window).off("resize.autocomplete",t.fixPositionCapture);n(t.suggestionsContainer).remove()}};n.fn.autocomplete=function(t,r){var u="autocomplete";return arguments.length===0?this.first().data(u):this.each(function(){var e=n(this),f=e.data(u);typeof t=="string"?f&&typeof f[t]=="function"&&f[t](r):(f&&f.dispose&&f.dispose(),f=new i(this,t),e.data(u,f))})}}),function(n){function e(t,i){var s=t.data("jqae"),u,e,c;s||(s={});u=s.wrapperElement;u||(u=t.wrapInner("<div/>").find(">div"),u.css({margin:0,padding:0,border:0}));e=u.data("jqae");e||(e={});c=e.originalContent;c?u=e.originalContent.clone(!0).data("jqae",{originalContent:c}).replaceAll(u):u.data("jqae",{originalContent:u.clone(!0)});t.data("jqae",{wrapperElement:u,containerWidth:t.width(),containerHeight:t.height()});var l=t.height(),a=(parseInt(t.css("padding-top"),10)||0)+(parseInt(t.css("border-top-width"),10)||0)-(u.offset().top-t.offset().top),o=!1,v=u;i.selector&&(v=n(u.find(i.selector).get().reverse()));v.each(function(){var t=n(this),s=t.text(),e=!1;if(u.innerHeight()-t.innerHeight()>l+a)t.remove();else if(f(t),t.contents().length){for(o&&(r(t).get(0).nodeValue+=i.ellipsis,o=!1);u.innerHeight()>l+a;)if(e=h(t),e)if(f(t),t.contents().length)r(t).get(0).nodeValue+=i.ellipsis;else{o=!0;t.remove();break}else{o=!0;t.remove();break}i.setTitle=="onEllipsis"&&e||i.setTitle=="always"?t.attr("title",s):i.setTitle!="never"&&t.removeAttr("title")}})}function h(t){var u=r(t),i,f;return u.length?(i=u.get(0).nodeValue,f=i.lastIndexOf(" "),f>-1?(i=n.trim(i.substring(0,f)),u.get(0).nodeValue=i):u.get(0).nodeValue="",!0):!1}function r(n){var i,t;return n.contents().length?(t=n.contents(),i=t.eq(t.length-1),i.filter(o).length?i:r(i)):(n.append(""),t=n.contents(),t.eq(t.length-1))}function f(t){var u,i,r;if(t.contents().length){if(u=t.contents(),i=u.eq(u.length-1),i.filter(o).length)return r=i.get(0).nodeValue,r=n.trim(r),r==""?(i.remove(),!0):!1;while(f(i));return i.contents().length?!1:(i.remove(),!0)}return!1}function o(){return this.nodeType===3}function c(n,r){t[n]=r;i||(i=window.setInterval(function(){a()},200))}function l(n){t[n]&&(delete t[n],t.length||i&&(window.clearInterval(i),i=undefined))}function a(){if(!u){u=!0;for(var i in t)n(i).each(function(){var r,u;r=n(this);u=r.data("jqae");(u.containerWidth!=r.width()||u.containerHeight!=r.height())&&e(r,t[i])});u=!1}}var t={},i,u=!1,s={ellipsis:"...",setTitle:"never",live:!1};n.fn.ellipsis=function(t,i){var u,r;return u=n(this),typeof t!="string"&&(i=t,t=undefined),r=n.extend({},s,i),r.selector=t,u.each(function(){var t=n(this);e(t,r)}),r.live?c(u.selector,r):l(u.selector),this}}(jQuery);page_w=$("html").width();jQuery(function(){jcf.customForms.replaceAll();dropDownMobileMenu();jQuery("input, textarea").placeholder();transparentYoutubeVideo()});$(window).resize(function(){jcf.customForms.refreshAll();calcDropHeight()});supports=function(){var n=document.createElement("div"),t="Khtml Ms O Moz Webkit".split(" "),i=t.length;return function(r){if(r in n.style)return!0;for(r=r.replace(/^[a-z]/,function(n){return n.toUpperCase()});i--;)if(t[i]+r in n.style)return!0;return!1}}();supports("columns")&&(document.documentElement.className+=" columnsSupported"),function(n,t,i){function y(n){var t={},r=/^jQuery\d+$/;return i.each(n.attributes,function(n,i){i.specified&&!r.test(i.name)&&(t[i.name]=i.value)}),t}function e(n,t){var u=this,r=i(u);if(u.value==r.attr("placeholder")&&r.hasClass("placeholder"))if(r.data("placeholder-password")){if(r=r.hide().next().show().attr("id",r.removeAttr("id").data("placeholder-id")),n===!0)return r[0].value=t;r.focus()}else u.value="",r.removeClass("placeholder"),u==v()&&u.select()}function s(){var t,r=this,n=i(r),u=this.id;if(r.value==""){if(r.type=="password"){if(!n.data("placeholder-textinput")){try{t=n.clone().attr({type:"text"})}catch(f){t=i("<input>").attr(i.extend(y(this),{type:"text"}))}t.removeAttr("name").data({"placeholder-password":n,"placeholder-id":u}).bind("focus.placeholder",e);n.data({"placeholder-textinput":t,"placeholder-id":u}).before(t)}n=n.removeAttr("id").hide().prev().attr("id",u).show()}n.addClass("placeholder");n[0].value=n.attr("placeholder")}else n.removeClass("placeholder")}function v(){try{return t.activeElement}catch(n){}}var h=Object.prototype.toString.call(n.operamini)=="[object OperaMini]",f="placeholder"in t.createElement("input")&&!h,o="placeholder"in t.createElement("textarea")&&!h,c=i.fn,l=i.valHooks,a=i.propHooks,u,r;f&&o?(r=c.placeholder=function(){return this},r.input=r.textarea=!0):(r=c.placeholder=function(){var n=this;return n.filter((f?"textarea":":input")+"[placeholder]").not(".placeholder").bind({"focus.placeholder":e,"blur.placeholder":s}).data("placeholder-enabled",!0).trigger("blur.placeholder"),n},r.input=f,r.textarea=o,u={get:function(n){var t=i(n),r=t.data("placeholder-password");return r?r[0].value:t.data("placeholder-enabled")&&t.hasClass("placeholder")?"":n.value},set:function(n,t){var r=i(n),u=r.data("placeholder-password");return u?u[0].value=t:r.data("placeholder-enabled")?(t==""?(n.value=t,n!=v()&&s.call(n)):r.hasClass("placeholder")?e.call(n,!0,t)||(n.value=t):n.value=t,r):n.value=t}},f||(l.input=u,a.value=u),o||(l.textarea=u,a.value=u),i(function(){i(t).delegate("form","submit.placeholder",function(){var n=i(".placeholder",this).each(e);setTimeout(function(){n.each(s)},10)})}),i(n).bind("beforeunload.placeholder",function(){i(".placeholder").each(function(){this.value=""})}))}(this,document,jQuery);jcf={modules:{},plugins:{},baseOptions:{unselectableClass:"jcf-unselectable",labelActiveClass:"jcf-label-active",labelDisabledClass:"jcf-label-disabled",classPrefix:"jcf-class-",hiddenClass:"jcf-hidden",focusClass:"jcf-focus",wrapperTag:"div"},customForms:{setOptions:function(n){for(var t in n)n.hasOwnProperty(t)&&typeof n[t]=="object"&&jcf.lib.extend(jcf.modules[t].prototype.defaultOptions,n[t])},replaceAll:function(n){var r,i,t;for(r in jcf.modules)for(i=jcf.lib.queryBySelector(jcf.modules[r].prototype.selector,n),t=0;t<i.length;t++)i[t].jcf?i[t].jcf.refreshState():!jcf.lib.hasClass(i[t],"default")&&jcf.modules[r].prototype.checkElement(i[t])&&new jcf.modules[r]({replaces:i[t]})},refreshAll:function(n){var r,i,t;for(r in jcf.modules)for(i=jcf.lib.queryBySelector(jcf.modules[r].prototype.selector,n),t=0;t<i.length;t++)i[t].jcf&&i[t].jcf.refreshState()},refreshElement:function(n){n&&n.jcf&&n.jcf.refreshState()},destroyAll:function(){var i,t,n;for(i in jcf.modules)for(t=jcf.lib.queryBySelector(jcf.modules[i].prototype.selector),n=0;n<t.length;n++)t[n].jcf&&t[n].jcf.destroy()}},isTouchDevice:"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,isWinPhoneDevice:navigator.msPointerEnabled&&/MSIE 10.*Touch/.test(navigator.userAgent),setBaseModule:function(n){jcf.customControl=function(n){this.options=jcf.lib.extend({},jcf.baseOptions,this.defaultOptions,n);this.init()};for(var t in n)jcf.customControl.prototype[t]=n[t]},addModule:function(n){var t,i;if(n.name){jcf.modules[n.name]=function(){jcf.modules[n.name].superclass.constructor.apply(this,arguments)};jcf.lib.inherit(jcf.modules[n.name],jcf.customControl);for(t in n)jcf.modules[n.name].prototype[t]=n[t];jcf.modules[n.name].prototype.onCreateModule();for(i in jcf.modules)if(jcf.modules[i]!=jcf.modules[n.name])jcf.modules[i].prototype.onModuleAdded(jcf.modules[n.name])}},addPlugin:function(n){if(n&&n.name){jcf.plugins[n.name]=function(){this.init.apply(this,arguments)};for(var t in n)jcf.plugins[n.name].prototype[t]=n[t]}},init:function(){return navigator.pointerEnabled||navigator.msPointerEnabled?(this.eventPress=navigator.pointerEnabled?"pointerdown":"MSPointerDown",this.eventMove=navigator.pointerEnabled?"pointermove":"MSPointerMove",this.eventRelease=navigator.pointerEnabled?"pointerup":"MSPointerUp"):(this.eventPress="mousedown",this.eventMove="mousemove",this.eventRelease="mouseup"),this.isTouchDevice&&(this.eventPress+=" touchstart",this.eventMove+=" touchmove",this.eventRelease+=" touchend"),setTimeout(function(){jcf.lib.domReady(function(){jcf.initStyles()})},1),this},initStyles:function(){var i=document.getElementsByTagName("head")[0],n=document.createElement("style"),t=document.createTextNode("."+jcf.baseOptions.unselectableClass+"{-moz-user-select:none;-webkit-tap-highlight-color:rgba(255,255,255,0);-webkit-user-select:none;user-select:none;}");n.type="text/css";n.styleSheet?n.styleSheet.cssText=t.nodeValue:n.appendChild(t);i.appendChild(n)}}.init();jcf.setBaseModule({init:function(){this.options.replaces&&(this.realElement=this.options.replaces,this.realElement.jcf=this,this.replaceObject())},defaultOptions:{},checkElement:function(){return!0},replaceObject:function(){this.createWrapper();this.attachEvents();this.fixStyles();this.setupWrapper()},createWrapper:function(){this.fakeElement=jcf.lib.createElement(this.options.wrapperTag);this.labelFor=jcf.lib.getLabelFor(this.realElement);jcf.lib.disableTextSelection(this.fakeElement);jcf.lib.addClass(this.fakeElement,jcf.lib.getAllClasses(this.realElement.className,this.options.classPrefix));jcf.lib.addClass(this.realElement,jcf.baseOptions.hiddenClass)},attachEvents:function(){jcf.lib.event.add(this.realElement,"focus",this.onFocusHandler,this);jcf.lib.event.add(this.realElement,"blur",this.onBlurHandler,this);jcf.lib.event.add(this.fakeElement,"click",this.onFakeClick,this);jcf.lib.event.add(this.fakeElement,jcf.eventPress,this.onFakePressed,this);jcf.lib.event.add(this.fakeElement,jcf.eventRelease,this.onFakeReleased,this);this.labelFor&&(this.labelFor.jcf=this,jcf.lib.event.add(this.labelFor,"click",this.onFakeClick,this),jcf.lib.event.add(this.labelFor,jcf.eventPress,this.onFakePressed,this),jcf.lib.event.add(this.labelFor,jcf.eventRelease,this.onFakeReleased,this))},fixStyles:function(){if(jcf.isTouchDevice){var n="rgba(255,255,255,0)";this.realElement.style.webkitTapHighlightColor=n;this.fakeElement.style.webkitTapHighlightColor=n;this.labelFor&&(this.labelFor.style.webkitTapHighlightColor=n)}},setupWrapper:function(){},refreshState:function(){},destroy:function(){this.fakeElement&&this.fakeElement.parentNode&&(this.fakeElement.parentNode.insertBefore(this.realElement,this.fakeElement),this.fakeElement.parentNode.removeChild(this.fakeElement));jcf.lib.removeClass(this.realElement,jcf.baseOptions.hiddenClass);this.realElement.jcf=null},onFocus:function(){jcf.lib.addClass(this.fakeElement,this.options.focusClass)},onBlur:function(){jcf.lib.removeClass(this.fakeElement,this.options.focusClass)},onFocusHandler:function(){this.focused||(this.focused=!0,jcf.isTouchDevice&&(jcf.focusedInstance&&jcf.focusedInstance.realElement!=this.realElement&&(jcf.focusedInstance.onBlur(),jcf.focusedInstance.realElement.blur()),jcf.focusedInstance=this),this.onFocus.apply(this,arguments))},onBlurHandler:function(){this.pressedFlag||(this.focused=!1,this.onBlur.apply(this,arguments))},onFakeClick:function(){jcf.isTouchDevice?this.onFocus():this.realElement.disabled||this.realElement.focus()},onFakePressed:function(){this.pressedFlag=!0},onFakeReleased:function(){this.pressedFlag=!1},onCreateModule:function(){},onModuleAdded:function(){},onControlReady:function(){}});jcf.lib={bind:function(n,t){return function(){return n.apply(t,arguments)}},browser:function(){var n=navigator.userAgent.toLowerCase(),t={},i=/(webkit)[ \/]([\w.]+)/.exec(n)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(n)||/(msie) ([\w.]+)/.exec(n)||n.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(n)||[];return t[i[1]]=!0,t.version=i[2]||"0",t.safariMac=n.indexOf("mac")!=-1&&n.indexOf("safari")!=-1,t}(),getOffset:function(n){var t,i;if(n.getBoundingClientRect&&!jcf.isWinPhoneDevice){var r=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,u=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop,f=document.documentElement.clientLeft||document.body.clientLeft||0,e=document.documentElement.clientTop||document.body.clientTop||0;return{top:Math.round(n.getBoundingClientRect().top+u-e),left:Math.round(n.getBoundingClientRect().left+r-f)}}for(t=0,i=0;n.offsetParent;)t+=n.offsetLeft,i+=n.offsetTop,n=n.offsetParent;return{top:i,left:t}},getScrollTop:function(){return window.pageYOffset||document.documentElement.scrollTop},getScrollLeft:function(){return window.pageXOffset||document.documentElement.scrollLeft},getWindowWidth:function(){return document.compatMode=="CSS1Compat"?document.documentElement.clientWidth:document.body.clientWidth},getWindowHeight:function(){return document.compatMode=="CSS1Compat"?document.documentElement.clientHeight:document.body.clientHeight},getStyle:function(n,t){return document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(n,null)[t]:n.currentStyle?n.currentStyle[t]:n.style[t]},getParent:function(n,t){while(n.parentNode&&n.parentNode!=document.body){if(n.parentNode.tagName.toLowerCase()==t.toLowerCase())return n.parentNode;n=n.parentNode}return!1},isParent:function(n,t){while(t.parentNode){if(t.parentNode===n)return!0;t=t.parentNode}return!1},getLabelFor:function(n){var t=jcf.lib.getParent(n,"label");return t?t:n.id?jcf.lib.queryBySelector('label[for="'+n.id+'"]')[0]:void 0},disableTextSelection:function(n){typeof n.onselectstart!="undefined"?n.onselectstart=function(){return!1}:window.opera?n.setAttribute("unselectable","on"):jcf.lib.addClass(n,jcf.baseOptions.unselectableClass)},enableTextSelection:function(n){typeof n.onselectstart!="undefined"?n.onselectstart=null:window.opera?n.removeAttribute("unselectable"):jcf.lib.removeClass(n,jcf.baseOptions.unselectableClass)},queryBySelector:function(n,t){var i,u,r,f;if(typeof t=="string"){for(i=[],u=this.getElementsBySelector(t),r=0;r<u.length;r++)f=Array.prototype.slice.call(this.getElementsBySelector(n,u[r])),i=i.concat(f);return i}return this.getElementsBySelector(n,t)},prevSibling:function(n){while(n=n.previousSibling)if(n.nodeType==1)break;return n},nextSibling:function(n){while(n=n.nextSibling)if(n.nodeType==1)break;return n},fireEvent:function(n,t){var i;return n.dispatchEvent?(i=document.createEvent("HTMLEvents"),i.initEvent(t,!0,!0),!n.dispatchEvent(i)):document.createEventObject?(i=document.createEventObject(),n.fireEvent("on"+t,i)):void 0},inherit:function(n,t){var i=function(){};i.prototype=t.prototype;n.prototype=new i;n.prototype.constructor=n;n.superclass=t.prototype},extend:function(n){for(var i,t=1;t<arguments.length;t++)for(i in arguments[t])arguments[t].hasOwnProperty(i)&&(n[i]=arguments[t][i]);return n},hasClass:function(n,t){return n.className?n.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)")):!1},addClass:function(n,t){this.hasClass(n,t)||(n.className+=(!n.className.length||n.className.charAt(n.className.length-1)===" "?"":" ")+t)},removeClass:function(n,t){this.hasClass(n,t)&&(n.className=n.className.replace(new RegExp("(\\s|^)"+t+"(\\s|$)")," ").replace(/\s+$/,""))},toggleClass:function(n,t,i){i?this.addClass(n,t):this.removeClass(n,t)},createElement:function(n,t){var r=document.createElement(n),i;for(i in t)if(t.hasOwnProperty(i))switch(i){case"class":r.className=t[i];break;case"html":r.innerHTML=t[i];break;case"style":this.setStyles(r,t[i]);break;default:r.setAttribute(i,t[i])}return r},setStyles:function(n,t){for(var i in t)if(t.hasOwnProperty(i))switch(i){case"float":n.style.cssFloat=t[i];break;case"opacity":n.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+t[i]*100+")";n.style.opacity=t[i];break;default:n.style[i]=(typeof t[i]=="undefined"?0:t[i])+(typeof t[i]=="number"?"px":"")}return n},getInnerWidth:function(n){return n.offsetWidth-(parseInt(this.getStyle(n,"paddingLeft"))||0)-(parseInt(this.getStyle(n,"paddingRight"))||0)},getInnerHeight:function(n){return n.offsetHeight-(parseInt(this.getStyle(n,"paddingTop"))||0)-(parseInt(this.getStyle(n,"paddingBottom"))||0)},getAllClasses:function(n,t,i){return i||(i=""),t||(t=""),n?n.replace(new RegExp("(\\s|^)"+i+"(\\s|$)")," ").replace(/[\s]*([\S]+)+[\s]*/gi,t+"$1 "):""},getElementsBySelector:function(n,t){var k,p,w,i,d,b,c,a,e,u,l,r,s,f;if(typeof document.querySelectorAll=="function")return(t||document).querySelectorAll(n);for(k=n.split(","),p=[],w=0;w<k.length;w++){for(i=[t||document],d=k[w].replace(/^\s+/,"").replace(/\s+$/,"").split(" "),b=0;b<d.length;b++){if(token=d[b].replace(/^\s+/,"").replace(/\s+$/,""),token.indexOf("#")>-1){var y=token.split("#"),o=y[0],nt=y[1],g=document.getElementById(nt);if(o&&g.nodeName.toLowerCase()!=o)return[];i=[g];continue}if(token.indexOf(".")>-1){var y=token.split("."),o=y[0]||"*",tt=y[1],u=[],l=0;for(r=0;r<i.length;r++)for(s=o=="*"?i[r].getElementsByTagName("*"):i[r].getElementsByTagName(o),f=0;f<s.length;f++)u[l++]=s[f];for(i=[],a=0,e=0;e<u.length;e++)u[e].className&&u[e].className.match(new RegExp("(\\s|^)"+tt+"(\\s|$)"))&&(i[a++]=u[e]);continue}if(token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^"]*)"?\]$/)){var o=RegExp.$1||"*",h=RegExp.$2,it=RegExp.$3,v=RegExp.$4;for(h.toLowerCase()=="for"&&this.browser.msie&&this.browser.version<8&&(h="htmlFor"),u=[],l=0,r=0;r<i.length;r++)for(s=o=="*"?i[r].getElementsByTagName("*"):i[r].getElementsByTagName(o),f=0;s[f];f++)u[l++]=s[f];i=[];a=0;switch(it){case"=":c=function(n){return n.getAttribute(h)==v};break;case"~":c=function(n){return n.getAttribute(h).match(new RegExp("(\\s|^)"+v+"(\\s|$)"))};break;case"|":c=function(n){return n.getAttribute(h).match(new RegExp("^"+v+"-?"))};break;case"^":c=function(n){return n.getAttribute(h).indexOf(v)==0};break;case"$":c=function(n){return n.getAttribute(h).lastIndexOf(v)==n.getAttribute(h).length-v.length};break;case"*":c=function(n){return n.getAttribute(h).indexOf(v)>-1};break;default:c=function(n){return n.getAttribute(h)}}for(i=[],a=0,e=0;e<u.length;e++)c(u[e])&&(i[a++]=u[e]);continue}for(o=token,u=[],l=0,r=0;r<i.length;r++)for(s=i[r].getElementsByTagName(o),f=0;f<s.length;f++)u[l++]=s[f];i=u}p=[].concat(p,i)}return p},scrollSize:function(){function e(){n&&u();t=document.createElement("div");n=document.createElement("div");n.style.cssText="position:absolute;overflow:hidden;width:100px;height:100px";n.appendChild(t);document.body.appendChild(n)}function u(){document.body.removeChild(n);n=null}function f(f){return e(),t.style.cssText="height:"+(f?"100%":"200px"),r=f?t.offsetHeight:t.offsetWidth,n.style.overflow="scroll",t.innerHTML=1,i=f?t.offsetHeight:t.offsetWidth,f&&n.clientHeight&&(i=n.clientHeight),u(),r-i}var t,n,r,i;return{getWidth:function(){return f(!1)},getHeight:function(){return f(!0)}}}(),domReady:function(n){function t(){i||(i=!0,n())}var i=!1;if(document.addEventListener)document.addEventListener("DOMContentLoaded",t,!1);else if(document.attachEvent){if(document.documentElement.doScroll&&window==window.top){function r(){if(!i&&document.body)try{document.documentElement.doScroll("left");t()}catch(n){setTimeout(r,0)}}r()}document.attachEvent("onreadystatechange",function(){document.readyState==="complete"&&t()})}window.addEventListener?window.addEventListener("load",t,!1):window.attachEvent&&window.attachEvent("onload",t)},event:function(){function i(n){if(n=n||window.event,n.isFixed)return n;if(n.isFixed=!0,n.preventDefault=n.preventDefault||function(){this.returnValue=!1},n.stopPropagation=n.stopPropagation||function(){this.cancelBubble=!0},n.target||(n.target=n.srcElement),!n.relatedTarget&&n.fromElement&&(n.relatedTarget=n.fromElement==n.target?n.toElement:n.fromElement),n.pageX==null&&n.clientX!=null){var t=document.documentElement,i=document.body;n.pageX=n.clientX+(t&&t.scrollLeft||i&&i.scrollLeft||0)-(t.clientLeft||0);n.pageY=n.clientY+(t&&t.scrollTop||i&&i.scrollTop||0)-(t.clientTop||0)}return!n.which&&n.button&&(n.which=n.button&1?1:n.button&2?3:n.button&4?2:0),(n.type==="DOMMouseScroll"||n.type==="mousewheel")&&(n.mWheelDelta=0,n.wheelDelta?n.mWheelDelta=n.wheelDelta/120:n.detail&&(n.mWheelDelta=-n.detail/3)),n}function r(n,t){var r,u,f,e;n=i(n);r=this.events[n.type];for(u in r)f=r[u],e=f.call(t||this,n),e===!1&&(n.preventDefault(),n.stopPropagation())}var t=0,n={add:function(i,u,f,e){var s,o,h;if(u.indexOf(" ")>-1){for(s=u.split(" "),o=0;o<s.length;o++)n.add(i,s[o],f,e);return}i.setInterval&&i!=window&&!i.frameElement&&(i=window);f.guid||(f.guid=++t);i.events||(i.events={},i.handle=function(n){return r.call(i,n)});i.events[u]||(i.events[u]={},i.addEventListener?i.addEventListener(u,i.handle,!1):i.attachEvent&&i.attachEvent("on"+u,i.handle),u==="mousewheel"&&n.add(i,"DOMMouseScroll",f,e));h=jcf.lib.bind(f,e);h.guid=f.guid;i.events[u][f.guid]=e?h:f},remove:function(t,i,r){var e,u,f,o;if(i.indexOf(" ")>-1){for(e=i.split(" "),u=0;u<e.length;u++)n.remove(t,e[u],r);return}if(f=t.events&&t.events[i],f){delete f[r.guid];for(o in f)return;t.removeEventListener?t.removeEventListener(i,t.handle,!1):t.detachEvent&&t.detachEvent("on"+i,t.handle);delete t.events[i];for(o in t.events)return;try{delete t.handle;delete t.events}catch(s){t.removeAttribute&&(t.removeAttribute("handle"),t.removeAttribute("events"))}i==="mousewheel"&&n.remove(t,"DOMMouseScroll",r)}}};return n}()};jcf.addModule({name:"customscroll",selector:"div.scrollable-area",defaultOptions:{alwaysPreventWheel:!1,enableMouseWheel:!0,captureFocus:!1,handleNested:!0,alwaysKeepScrollbars:!1,autoDetectWidth:!1,scrollbarOptions:{},focusClass:"scrollable-focus",wrapperTag:"div",autoDetectWidthClass:"autodetect-width",noHorizontalBarClass:"noscroll-horizontal",noVerticalBarClass:"noscroll-vertical",innerWrapperClass:"scrollable-inner-wrapper",outerWrapperClass:"scrollable-area-wrapper",horizontalClass:"hscrollable",verticalClass:"vscrollable",bothClass:"anyscrollable"},replaceObject:function(){this.initStructure();this.refreshState();this.addEvents()},initStructure:function(){this.realElement.jcf=this;this.scrollType=jcf.lib.hasClass(this.realElement,this.options.bothClass)||jcf.lib.hasClass(this.realElement,this.options.horizontalClass)&&jcf.lib.hasClass(this.realElement,this.options.verticalClass)?"both":jcf.lib.hasClass(this.realElement,this.options.horizontalClass)?"horizontal":"vertical";jcf.lib.hasClass(this.realElement,this.options.autoDetectWidthClass)&&(this.options.autoDetectWidth=!0);this.realElement.style.position="relative";this.realElement.style.overflow="hidden";this.buildWrapper();this.buildScrollbars()},buildWrapper:function(){if(this.outerWrapper=document.createElement(this.options.wrapperTag),this.outerWrapper.className=this.options.outerWrapperClass,this.realElement.parentNode.insertBefore(this.outerWrapper,this.realElement),this.outerWrapper.appendChild(this.realElement),this.options.autoDetectWidth&&(this.scrollType==="both"||this.scrollType==="horizontal")&&this.realElement.children.length===1){var n=0;this.realElement.style.width="99999px";n=this.realElement.children[0].offsetWidth;this.realElement.style.width="";n&&(this.realElement.children[0].style.width=n+"px")}},buildScrollbars:function(){(this.scrollType==="horizontal"||this.scrollType==="both")&&(this.hScrollBar=new jcf.plugins.scrollbar(jcf.lib.extend(this.options.scrollbarOptions,{vertical:!1,spawnClass:this,holder:this.outerWrapper,range:this.realElement.scrollWidth-this.realElement.offsetWidth,size:this.realElement.offsetWidth,onScroll:jcf.lib.bind(function(n){this.realElement.scrollLeft=n},this)})));(this.scrollType==="vertical"||this.scrollType==="both")&&(this.vScrollBar=new jcf.plugins.scrollbar(jcf.lib.extend(this.options.scrollbarOptions,{vertical:!0,spawnClass:this,holder:this.outerWrapper,range:this.realElement.scrollHeight-this.realElement.offsetHeight,size:this.realElement.offsetHeight,onScroll:jcf.lib.bind(function(n){this.realElement.scrollTop=n},this)})));this.outerWrapper.style.width=this.realElement.offsetWidth+"px";this.outerWrapper.style.height=this.realElement.offsetHeight+"px";this.resizeScrollContent()},resizeScrollContent:function(){var n=this.realElement.offsetWidth-jcf.lib.getInnerWidth(this.realElement),t=this.realElement.offsetHeight-jcf.lib.getInnerHeight(this.realElement);this.realElement.style.width=Math.max(0,this.outerWrapper.offsetWidth-n-(this.vScrollBar?this.vScrollBar.getScrollBarSize():0))+"px";this.realElement.style.height=Math.max(0,this.outerWrapper.offsetHeight-t-(this.hScrollBar?this.hScrollBar.getScrollBarSize():0))+"px"},addEvents:function(){if(!jcf.isTouchDevice&&this.options.enableMouseWheel&&jcf.lib.event.add(this.outerWrapper,"mousewheel",this.onMouseWheel,this),(jcf.isTouchDevice||navigator.msPointerEnabled||navigator.pointerEnabled)&&(this.outerWrapper.style.msTouchAction="none",jcf.lib.event.add(this.realElement,jcf.eventPress,this.onScrollablePress,this)),this.options.handleNested)for(var n=this.realElement,t=this.name;n.parentNode;)n.parentNode.jcf&&n.parentNode.jcf.name==t&&n.parentNode.jcf.refreshState(),n=n.parentNode},isTouchPointerEvent:function(n){return n.type.indexOf("touch")>-1||navigator.pointerEnabled&&n.pointerType==="touch"||navigator.msPointerEnabled&&n.pointerType===n.MSPOINTER_TYPE_TOUCH},onMouseWheel:function(n){return this.scrollType==="vertical"||this.scrollType==="both"?this.vScrollBar.doScrollWheelStep(n.mWheelDelta)===!1?!1:!this.options.alwaysPreventWheel:this.hScrollBar.doScrollWheelStep(n.mWheelDelta)===!1?!1:!this.options.alwaysPreventWheel},onScrollablePress:function(n){this.isTouchPointerEvent(n)&&(this.preventFlag=!0,this.origWindowScrollTop=jcf.lib.getScrollTop(),this.origWindowScrollLeft=jcf.lib.getScrollLeft(),this.scrollableOffset=jcf.lib.getOffset(this.realElement),this.hScrollBar&&(this.scrollableTouchX=(n.changedTouches?n.changedTouches[0]:n).pageX,this.origValueX=this.hScrollBar.getScrollValue()),this.vScrollBar&&(this.scrollableTouchY=(n.changedTouches?n.changedTouches[0]:n).pageY,this.origValueY=this.vScrollBar.getScrollValue()),jcf.lib.event.add(this.realElement,jcf.eventMove,this.onScrollableMove,this),jcf.lib.event.add(this.realElement,jcf.eventRelease,this.onScrollableRelease,this))},onScrollableMove:function(n){var r,t,u,i;this.vScrollBar&&(r=(n.changedTouches?n.changedTouches[0]:n).pageY-this.scrollableTouchY,t=this.origValueY-r,this.vScrollBar.scrollTo(t),(t<0||t>this.vScrollBar.options.range)&&(this.preventFlag=!1));this.hScrollBar&&(u=(n.changedTouches?n.changedTouches[0]:n).pageX-this.scrollableTouchX,i=this.origValueX-u,this.hScrollBar.scrollTo(i),(i<0||i>this.hScrollBar.options.range)&&(this.preventFlag=!1));this.preventFlag&&n.preventDefault()},onScrollableRelease:function(){jcf.lib.event.remove(this.realElement,jcf.eventMove,this.onScrollableMove);jcf.lib.event.remove(this.realElement,jcf.eventRelease,this.onScrollableRelease)},refreshState:function(){this.options.alwaysKeepScrollbars?(this.hScrollBar&&(this.hScrollBar.scrollBar.style.display="block"),this.vScrollBar&&(this.vScrollBar.scrollBar.style.display="block")):(this.hScrollBar&&(this.getScrollRange(!1)?(this.hScrollBar.scrollBar.style.display="block",this.resizeScrollContent(),this.hScrollBar.setRange(this.getScrollRange(!1))):(this.hScrollBar.scrollBar.style.display="none",this.realElement.style.width=this.outerWrapper.style.width),jcf.lib.toggleClass(this.outerWrapper,this.options.noHorizontalBarClass,this.hScrollBar.options.range===0)),this.vScrollBar&&(this.getScrollRange(!0)>0?(this.vScrollBar.scrollBar.style.display="block",this.resizeScrollContent(),this.vScrollBar.setRange(this.getScrollRange(!0))):(this.vScrollBar.scrollBar.style.display="none",this.realElement.style.width=this.outerWrapper.style.width),jcf.lib.toggleClass(this.outerWrapper,this.options.noVerticalBarClass,this.vScrollBar.options.range===0)));this.vScrollBar&&(this.vScrollBar.setRange(this.realElement.scrollHeight-this.realElement.offsetHeight),this.vScrollBar.setSize(this.realElement.offsetHeight),this.vScrollBar.scrollTo(this.realElement.scrollTop));this.hScrollBar&&(this.hScrollBar.setRange(this.realElement.scrollWidth-this.realElement.offsetWidth),this.hScrollBar.setSize(this.realElement.offsetWidth),this.hScrollBar.scrollTo(this.realElement.scrollLeft))},getScrollRange:function(n){return n?this.realElement.scrollHeight-this.realElement.offsetHeight:this.realElement.scrollWidth-this.realElement.offsetWidth},getCurrentRange:function(n){return this.getScrollRange(n.isVertical)},onCreateModule:function(){jcf.modules.select&&this.extendSelect();jcf.modules.selectmultiple&&this.extendSelectMultiple();jcf.modules.textarea&&this.extendTextarea()},onModuleAdded:function(n){n.prototype.name=="select"&&this.extendSelect();n.prototype.name=="selectmultiple"&&this.extendSelectMultiple();n.prototype.name=="textarea"&&this.extendTextarea()},extendSelect:function(){jcf.modules.select.prototype.onControlReady=function(n){n.selectList.scrollHeight>n.selectList.offsetHeight&&(n.jcfScrollable=new jcf.modules.customscroll({alwaysPreventWheel:!0,replaces:n.selectList}))};var n=jcf.modules.select.prototype.scrollToItem;jcf.modules.select.prototype.scrollToItem=function(){n.apply(this);this.jcfScrollable&&this.jcfScrollable.refreshState()}},extendTextarea:function(){jcf.modules.textarea.prototype.onControlReady=function(n){n.jcfScrollable=new jcf.modules.customscroll({alwaysKeepScrollbars:!0,alwaysPreventWheel:!0,replaces:n.realElement})};var n=jcf.modules.textarea.prototype.refreshState;jcf.modules.textarea.prototype.refreshState=function(){n.apply(this);this.jcfScrollable&&this.jcfScrollable.refreshState()}},extendSelectMultiple:function(){var n,t;jcf.modules.selectmultiple.prototype.onControlReady=function(n){n.jcfScrollable=new jcf.modules.customscroll({alwaysPreventWheel:!0,replaces:n.optionsHolder})};n=jcf.modules.selectmultiple.prototype.scrollToItem;jcf.modules.selectmultiple.prototype.scrollToItem=function(){n.apply(this);this.jcfScrollable&&this.jcfScrollable.refreshState()};t=jcf.modules.selectmultiple.prototype.rebuildOptions;jcf.modules.selectmultiple.prototype.rebuildOptions=function(){t.apply(this);this.jcfScrollable&&this.jcfScrollable.refreshState()}}});jcf.addPlugin({name:"scrollbar",defaultOptions:{size:0,range:0,moveStep:6,moveDistance:50,moveInterval:10,trackHoldDelay:900,holder:null,vertical:!0,scrollTag:"div",onScroll:function(){},onScrollEnd:function(){},onScrollStart:function(){},disabledClass:"btn-disabled",VscrollBarClass:"vscrollbar",VscrollStructure:'<div class="vscroll-up"><\/div><div class="vscroll-line"><div class="vscroll-slider"><div class="scroll-bar-top"><\/div><div class="scroll-bar-bottom"><\/div><\/div><\/div><\/div><div class="vscroll-down"><\/div>',VscrollTrack:"div.vscroll-line",VscrollBtnDecClass:"div.vscroll-up",VscrollBtnIncClass:"div.vscroll-down",VscrollSliderClass:"div.vscroll-slider",HscrollBarClass:"hscrollbar",HscrollStructure:'<div class="hscroll-left"><\/div><div class="hscroll-line"><div class="hscroll-slider"><div class="scroll-bar-left"><\/div><div class="scroll-bar-right"><\/div><\/div><\/div><\/div><div class="hscroll-right"><\/div>',HscrollTrack:"div.hscroll-line",HscrollBtnDecClass:"div.hscroll-left",HscrollBtnIncClass:"div.hscroll-right",HscrollSliderClass:"div.hscroll-slider"},init:function(n){this.setOptions(n);this.createScrollBar();this.attachEvents();this.setSize()},setOptions:function(n){this.options=jcf.lib.extend({},this.defaultOptions,n);this.isVertical=this.options.vertical;this.prefix=this.isVertical?"V":"H";this.eventPageOffsetProperty=this.isVertical?"pageY":"pageX";this.positionProperty=this.isVertical?"top":"left";this.sizeProperty=this.isVertical?"height":"width";this.dimenionsProperty=this.isVertical?"offsetHeight":"offsetWidth";this.invertedDimenionsProperty=this.isVertical?"offsetWidth":"offsetHeight";for(var t in this.options)t.indexOf(this.prefix)==0&&(this.options[t.substr(1)]=this.options[t])},createScrollBar:function(){this.scrollBar=document.createElement(this.options.scrollTag);this.scrollBar.className=this.options.scrollBarClass;this.scrollBar.innerHTML=this.options.scrollStructure;this.track=jcf.lib.queryBySelector(this.options.scrollTrack,this.scrollBar)[0];this.btnDec=jcf.lib.queryBySelector(this.options.scrollBtnDecClass,this.scrollBar)[0];this.btnInc=jcf.lib.queryBySelector(this.options.scrollBtnIncClass,this.scrollBar)[0];this.slider=jcf.lib.queryBySelector(this.options.scrollSliderClass,this.scrollBar)[0];this.slider.style.position="absolute";this.track.style.position="relative"},attachEvents:function(){this.options.holder&&this.options.holder.appendChild(this.scrollBar);jcf.lib.event.add(this.slider,jcf.eventPress,this.onSliderPressed,this);jcf.lib.event.add(this.btnDec,jcf.eventPress,this.onBtnDecPressed,this);jcf.lib.event.add(this.btnInc,jcf.eventPress,this.onBtnIncPressed,this);jcf.lib.event.add(this.track,jcf.eventPress,this.onTrackPressed,this)},setSize:function(n){typeof n=="number"&&(this.options.size=n);this.scrollOffset=this.scrollValue=this.sliderOffset=0;this.scrollBar.style[this.sizeProperty]=this.options.size+"px";this.resizeControls();this.refreshSlider()},setRange:function(n){this.options.range=Math.max(n,0);this.resizeControls()},doScrollWheelStep:function(n){return this.startScroll(),n<0&&!this.isEndPosition()||n>0&&!this.isStartPosition()?(this.scrollTo(this.getScrollValue()-this.options.moveDistance*n),this.moveScroll(),this.endScroll(),!1):void 0},resizeControls:function(){this.barSize=this.scrollBar[this.dimenionsProperty];this.btnDecSize=this.btnDec[this.dimenionsProperty];this.btnIncSize=this.btnInc[this.dimenionsProperty];this.trackSize=Math.max(0,this.barSize-this.btnDecSize-this.btnIncSize);this.track.style[this.sizeProperty]=this.trackSize+"px";this.trackSize=this.track[this.dimenionsProperty];this.sliderSize=this.getSliderSize();this.slider.style[this.sizeProperty]=this.sliderSize+"px";this.sliderSize=this.slider[this.dimenionsProperty]},refreshSlider:function(n){n&&this.resizeControls();this.sliderOffset=isNaN(this.sliderOffset)?0:this.sliderOffset;this.slider.style[this.positionProperty]=this.sliderOffset+"px"},startScroll:function(){this.options.spawnClass&&typeof this.options.spawnClass.getCurrentRange=="function"&&this.setRange(this.options.spawnClass.getCurrentRange(this));this.resizeControls();this.scrollBarOffset=jcf.lib.getOffset(this.track)[this.positionProperty];this.options.onScrollStart()},moveScroll:function(){this.options.onScroll(this.scrollValue);jcf.lib.removeClass(this.btnDec,this.options.disabledClass);jcf.lib.removeClass(this.btnInc,this.options.disabledClass);this.scrollValue===0&&jcf.lib.addClass(this.btnDec,this.options.disabledClass);this.scrollValue===this.options.range&&jcf.lib.addClass(this.btnInc,this.options.disabledClass)},endScroll:function(){this.options.onScrollEnd()},startButtonMoveScroll:function(n){this.startScroll();clearInterval(this.buttonScrollTimer);this.buttonScrollTimer=setInterval(jcf.lib.bind(function(){this.scrollValue+=this.options.moveStep*n;this.scrollValue>this.options.range?(this.scrollValue=this.options.range,this.endButtonMoveScroll()):this.scrollValue<0&&(this.scrollValue=0,this.endButtonMoveScroll());this.scrollTo(this.scrollValue)},this),this.options.moveInterval)},endButtonMoveScroll:function(){clearInterval(this.buttonScrollTimer);this.endScroll()},isStartPosition:function(){return this.scrollValue===0},isEndPosition:function(){return this.scrollValue===this.options.range},getSliderSize:function(){return Math.round(this.getSliderSizePercent()*this.trackSize/100)},getSliderSizePercent:function(){return this.options.range===0?0:this.barSize*100/(this.barSize+this.options.range)},getSliderOffsetByScrollValue:function(){return this.scrollValue*100/this.options.range*(this.trackSize-this.sliderSize)/100},getSliderOffsetPercent:function(){return this.sliderOffset*100/(this.trackSize-this.sliderSize)},getScrollValueBySliderOffset:function(){return this.getSliderOffsetPercent()*this.options.range/100},getScrollBarSize:function(){return this.scrollBar[this.invertedDimenionsProperty]},getScrollValue:function(){return this.scrollValue||0},scrollOnePage:function(n){this.scrollTo(this.scrollValue+n*this.barSize)},scrollTo:function(n){this.scrollValue=n<0?0:n>this.options.range?this.options.range:n;this.sliderOffset=this.getSliderOffsetByScrollValue();this.refreshSlider();this.moveScroll()},onSliderPressed:function(n){return jcf.lib.event.add(document.body,jcf.eventRelease,this.onSliderRelease,this),jcf.lib.event.add(document.body,jcf.eventMove,this.onSliderMove,this),jcf.lib.disableTextSelection(this.slider),this.sliderInnerOffset=(n.changedTouches?n.changedTouches[0]:n)[this.eventPageOffsetProperty]-jcf.lib.getOffset(this.slider)[this.positionProperty],this.startScroll(),!1},onSliderRelease:function(){jcf.lib.event.remove(document.body,jcf.eventRelease,this.onSliderRelease);jcf.lib.event.remove(document.body,jcf.eventMove,this.onSliderMove)},onSliderMove:function(n){n.preventDefault();this.sliderOffset=(n.changedTouches?n.changedTouches[0]:n)[this.eventPageOffsetProperty]-this.scrollBarOffset-this.sliderInnerOffset;this.sliderOffset<0?this.sliderOffset=0:this.sliderOffset+this.sliderSize>this.trackSize&&(this.sliderOffset=this.trackSize-this.sliderSize);this.previousOffset!=this.sliderOffset&&(this.previousOffset=this.sliderOffset,this.scrollTo(this.getScrollValueBySliderOffset()))},onBtnIncPressed:function(){return jcf.lib.event.add(document.body,jcf.eventRelease,this.onBtnIncRelease,this),jcf.lib.disableTextSelection(this.btnInc),this.startButtonMoveScroll(1),!1},onBtnIncRelease:function(){jcf.lib.event.remove(document.body,jcf.eventRelease,this.onBtnIncRelease);this.endButtonMoveScroll()},onBtnDecPressed:function(){return jcf.lib.event.add(document.body,jcf.eventRelease,this.onBtnDecRelease,this),jcf.lib.disableTextSelection(this.btnDec),this.startButtonMoveScroll(-1),!1},onBtnDecRelease:function(){jcf.lib.event.remove(document.body,jcf.eventRelease,this.onBtnDecRelease);this.endButtonMoveScroll()},onTrackPressed:function(n){var t=n[this.eventPageOffsetProperty]-jcf.lib.getOffset(this.track)[this.positionProperty],i=t<this.sliderOffset?-1:t>this.sliderOffset+this.sliderSize?1:0;i&&this.scrollOnePage(i)}});!function(n,t){"use strict";function g(){i.READY||(h.determineEventTypes(),r.each(i.gestures,function(n){u.register(n)}),h.onTouch(i.DOCUMENT,o,u.detect),h.onTouch(i.DOCUMENT,f,u.detect),i.READY=!0)}var i=function nt(n,t){return new nt.Instance(n,t||{})};i.VERSION="1.1.3";i.defaults={behavior:{userSelect:"none",touchAction:"pan-y",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};i.DOCUMENT=document;i.HAS_POINTEREVENTS=navigator.pointerEnabled||navigator.msPointerEnabled;i.HAS_TOUCHEVENTS="ontouchstart"in n;i.IS_MOBILE=/mobile|tablet|ip(ad|hone|od)|android|silk/i.test(navigator.userAgent);i.NO_MOUSEEVENTS=i.HAS_TOUCHEVENTS&&i.IS_MOBILE||i.HAS_POINTEREVENTS;i.CALCULATE_INTERVAL=25;var l={},w=i.DIRECTION_DOWN="down",k=i.DIRECTION_LEFT="left",b=i.DIRECTION_UP="up",d=i.DIRECTION_RIGHT="right",a=i.POINTER_MOUSE="mouse",y=i.POINTER_TOUCH="touch",p=i.POINTER_PEN="pen",e=i.EVENT_START="start",o=i.EVENT_MOVE="move",f=i.EVENT_END="end",s=i.EVENT_RELEASE="release",v=i.EVENT_TOUCH="touch";i.READY=!1;i.plugins=i.plugins||{};i.gestures=i.gestures||{};var r=i.utils={extend:function(n,i,r){for(var u in i)!i.hasOwnProperty(u)||n[u]!==t&&r||(n[u]=i[u]);return n},on:function(n,t,i){n.addEventListener(t,i,!1)},off:function(n,t,i){n.removeEventListener(t,i,!1)},each:function(n,i,r){var u,f;if("forEach"in n)n.forEach(i,r);else if(n.length!==t){for(u=0,f=n.length;f>u;u++)if(i.call(r,n[u],u,n)===!1)return}else for(u in n)if(n.hasOwnProperty(u)&&i.call(r,n[u],u,n)===!1)return},inStr:function(n,t){return n.indexOf(t)>-1},inArray:function(n,t){var r,i,u;if(n.indexOf)return r=n.indexOf(t),-1===r?!1:r;for(i=0,u=n.length;u>i;i++)if(n[i]===t)return i;return!1},toArray:function(n){return Array.prototype.slice.call(n,0)},hasParent:function(n,t){for(;n;){if(n==t)return!0;n=n.parentNode}return!1},getCenter:function(n){var u=[],f=[],e=[],o=[],t=Math.min,i=Math.max;return 1===n.length?{pageX:n[0].pageX,pageY:n[0].pageY,clientX:n[0].clientX,clientY:n[0].clientY}:(r.each(n,function(n){u.push(n.pageX);f.push(n.pageY);e.push(n.clientX);o.push(n.clientY)}),{pageX:(t.apply(Math,u)+i.apply(Math,u))/2,pageY:(t.apply(Math,f)+i.apply(Math,f))/2,clientX:(t.apply(Math,e)+i.apply(Math,e))/2,clientY:(t.apply(Math,o)+i.apply(Math,o))/2})},getVelocity:function(n,t,i){return{x:Math.abs(t/n)||0,y:Math.abs(i/n)||0}},getAngle:function(n,t){var i=t.clientX-n.clientX,r=t.clientY-n.clientY;return 180*Math.atan2(r,i)/Math.PI},getDirection:function(n,t){var i=Math.abs(n.clientX-t.clientX),r=Math.abs(n.clientY-t.clientY);return i>=r?n.clientX-t.clientX>0?k:d:n.clientY-t.clientY>0?b:w},getDistance:function(n,t){var i=t.clientX-n.clientX,r=t.clientY-n.clientY;return Math.sqrt(i*i+r*r)},getScale:function(n,t){return n.length>=2&&t.length>=2?this.getDistance(t[0],t[1])/this.getDistance(n[0],n[1]):1},getRotation:function(n,t){return n.length>=2&&t.length>=2?this.getAngle(t[1],t[0])-this.getAngle(n[1],n[0]):0},isVertical:function(n){return n==b||n==w},setPrefixedCss:function(n,t,i,u){var o=["","Webkit","Moz","O","ms"],e,f;for(t=r.toCamelCase(t),e=0;e<o.length;e++)if(f=t,o[e]&&(f=o[e]+f.slice(0,1).toUpperCase()+f.slice(1)),f in n.style){n.style[f]=(null==u||u)&&i||"";break}},toggleBehavior:function(n,t,i){if(t&&n&&n.style){r.each(t,function(t,u){r.setPrefixedCss(n,u,t,i)});var u=i&&function(){return!1};"none"==t.userSelect&&(n.onselectstart=u);"none"==t.userDrag&&(n.ondragstart=u)}},toCamelCase:function(n){return n.replace(/[_-]([a-z])/g,function(n){return n[1].toUpperCase()})}},h=i.event={preventMouseEvents:!1,started:!1,shouldDetect:!1,on:function(n,t,i,u){var f=t.split(" ");r.each(f,function(t){r.on(n,t,i);u&&u(t)})},off:function(n,t,i,u){var f=t.split(" ");r.each(f,function(t){r.off(n,t,i);u&&u(t)})},onTouch:function(n,t,u){var o=this,s=function(s){var a,v=s.type.toLowerCase(),h=i.HAS_POINTEREVENTS,l=r.inStr(v,"mouse");l&&o.preventMouseEvents||(l&&t==e&&0===s.button?(o.preventMouseEvents=!1,o.shouldDetect=!0):h&&t==e?o.shouldDetect=1===s.buttons||c.matchType(y,s):l||t!=e||(o.preventMouseEvents=!0,o.shouldDetect=!0),h&&t!=f&&c.updatePointer(t,s),o.shouldDetect&&(a=o.doDetect.call(o,s,t,n,u)),a==f&&(o.preventMouseEvents=!1,o.shouldDetect=!1,c.reset()),h&&t==f&&c.updatePointer(t,s))};return this.on(n,l[t],s),s},doDetect:function(n,t,i,r){var l=this.getTouchList(n,t),p=l.length,c=t,a=l.trigger,y=p,h;return t==e?a=v:t==f&&(a=s,y=l.length-(n.changedTouches?n.changedTouches.length:1)),y>0&&this.started&&(c=o),this.started=!0,h=this.collectEventData(i,c,l,n),t!=f&&r.call(u,h),a&&(h.changedLength=y,h.eventType=a,r.call(u,h),h.eventType=c,delete h.changedLength),c==f&&(r.call(u,h),this.started=!1),c},determineEventTypes:function(){var t;return t=i.HAS_POINTEREVENTS?n.PointerEvent?["pointerdown","pointermove","pointerup pointercancel lostpointercapture"]:["MSPointerDown","MSPointerMove","MSPointerUp MSPointerCancel MSLostPointerCapture"]:i.NO_MOUSEEVENTS?["touchstart","touchmove","touchend touchcancel"]:["touchstart mousedown","touchmove mousemove","touchend touchcancel mouseup"],l[e]=t[0],l[o]=t[1],l[f]=t[2],l},getTouchList:function(n,t){if(i.HAS_POINTEREVENTS&&!(navigator.msPointerEnabled&&!navigator.pointerEnabled))return c.getTouchList();if(n.touches){if(t==o)return n.touches;var u=[],e=[].concat(r.toArray(n.touches),r.toArray(n.changedTouches)),f=[];return r.each(e,function(n){r.inArray(u,n.identifier)===!1&&f.push(n);u.push(n.identifier)}),f}return n.identifier=1,[n]},collectEventData:function(n,t,i,f){var e=y;return r.inStr(f.type,"mouse")||c.matchType(a,f)?e=a:c.matchType(p,f)&&(e=p),{center:r.getCenter(i),timeStamp:Date.now(),target:f.target,touches:i,eventType:t,pointerType:e,srcEvent:f,preventDefault:function(){var n=this.srcEvent;n.preventManipulation&&n.preventManipulation();n.preventDefault&&n.preventDefault()},stopPropagation:function(){this.srcEvent.stopPropagation()},stopDetect:function(){return u.stopDetect()}}}},c=i.PointerEvent={pointers:{},getTouchList:function(){var n=[];return r.each(this.pointers,function(t){n.push(t)}),n},updatePointer:function(n,t){n==f||n!=f&&1!==t.buttons?delete this.pointers[t.pointerId]:(t.identifier=t.pointerId,this.pointers[t.pointerId]=t)},matchType:function(n,t){if(!t.pointerType)return!1;var r=t.pointerType,i={};return i[a]=r===(t.MSPOINTER_TYPE_MOUSE||a),i[y]=r===(t.MSPOINTER_TYPE_TOUCH||y),i[p]=r===(t.MSPOINTER_TYPE_PEN||p),i[n]},reset:function(){this.pointers={}}},u=i.detection={gestures:[],current:null,previous:null,stopped:!1,startDetect:function(n,t){this.current||(this.stopped=!1,this.current={inst:n,startEvent:r.extend({},t),lastEvent:!1,lastCalcEvent:!1,futureCalcEvent:!1,lastCalcData:{},name:""},this.detect(t))},detect:function(n){if(this.current&&!this.stopped){n=this.extendEventData(n);var t=this.current.inst,i=t.options;return r.each(this.gestures,function(r){!this.stopped&&t.enabled&&i[r.name]&&r.handler.call(r,n,t)},this),this.current&&(this.current.lastEvent=n),n.eventType==f&&this.stopDetect(),n}},stopDetect:function(){this.previous=r.extend({},this.current);this.current=null;this.stopped=!0},getCalculatedData:function(n,t,u,f,e){var o=this.current,l=!1,c=o.lastCalcEvent,h=o.lastCalcData;c&&n.timeStamp-c.timeStamp>i.CALCULATE_INTERVAL&&(t=c.center,u=n.timeStamp-c.timeStamp,f=n.center.clientX-c.center.clientX,e=n.center.clientY-c.center.clientY,l=!0);(n.eventType==v||n.eventType==s)&&(o.futureCalcEvent=n);(!o.lastCalcEvent||l)&&(h.velocity=r.getVelocity(u,f,e),h.angle=r.getAngle(t,n.center),h.direction=r.getDirection(t,n.center),o.lastCalcEvent=o.futureCalcEvent||n,o.futureCalcEvent=n);n.velocityX=h.velocity.x;n.velocityY=h.velocity.y;n.interimAngle=h.angle;n.interimDirection=h.direction},extendEventData:function(n){var i=this.current,t=i.startEvent,o=i.lastEvent||t;(n.eventType==v||n.eventType==s)&&(t.touches=[],r.each(n.touches,function(n){t.touches.push({clientX:n.clientX,clientY:n.clientY})}));var u=n.timeStamp-t.timeStamp,f=n.center.clientX-t.center.clientX,e=n.center.clientY-t.center.clientY;return this.getCalculatedData(n,o.center,u,f,e),r.extend(n,{startEvent:t,deltaTime:u,deltaX:f,deltaY:e,distance:r.getDistance(t.center,n.center),angle:r.getAngle(t.center,n.center),direction:r.getDirection(t.center,n.center),scale:r.getScale(t.touches,n.touches),rotation:r.getRotation(t.touches,n.touches)}),n},register:function(n){var u=n.defaults||{};return u[n.name]===t&&(u[n.name]=!0),r.extend(i.defaults,u,!0),n.index=n.index||1e3,this.gestures.push(n),this.gestures.sort(function(n,t){return n.index<t.index?-1:n.index>t.index?1:0}),this.gestures}};i.Instance=function(n,t){var f=this;g();this.element=n;this.enabled=!0;r.each(t,function(n,i){delete t[i];t[r.toCamelCase(i)]=n});this.options=r.extend(r.extend({},i.defaults),t||{});this.options.behavior&&r.toggleBehavior(this.element,this.options.behavior,!0);this.eventStartHandler=h.onTouch(n,e,function(n){f.enabled&&n.eventType==e?u.startDetect(f,n):n.eventType==v&&u.detect(n)});this.eventHandlers=[]};i.Instance.prototype={on:function(n,t){var i=this;return h.on(i.element,n,t,function(n){i.eventHandlers.push({gesture:n,handler:t})}),i},off:function(n,t){var i=this;return h.off(i.element,n,t,function(n){var u=r.inArray({gesture:n,handler:t});u!==!1&&i.eventHandlers.splice(u,1)}),i},trigger:function(n,t){var u,f;return t||(t={}),u=i.DOCUMENT.createEvent("Event"),u.initEvent(n,!0,!0),u.gesture=t,f=this.element,r.hasParent(t.target,f)&&(f=t.target),f.dispatchEvent(u),this},enable:function(n){return this.enabled=n,this},dispose:function(){var t,n;for(r.toggleBehavior(this.element,this.options.behavior,!1),t=-1;n=this.eventHandlers[++t];)r.off(this.element,n.gesture,n.handler);return this.eventHandlers=[],h.off(this.element,l[e],this.eventStartHandler),null}},function(n){function h(i,h){var c=u.current,l,a,v,y;if(!(h.options.dragMaxTouches>0&&i.touches.length>h.options.dragMaxTouches))switch(i.eventType){case e:t=!1;break;case o:if(i.distance<h.options.dragMinDistance&&c.name!=n)return;l=c.startEvent.center;c.name!=n&&(c.name=n,h.options.dragDistanceCorrection&&i.distance>0)&&(a=Math.abs(h.options.dragMinDistance/i.distance),l.pageX+=i.deltaX*a,l.pageY+=i.deltaY*a,l.clientX+=i.deltaX*a,l.clientY+=i.deltaY*a,i=u.extendEventData(i));(c.lastEvent.dragLockToAxis||h.options.dragLockToAxis&&h.options.dragLockMinDistance<=i.distance)&&(i.dragLockToAxis=!0);v=c.lastEvent.direction;i.dragLockToAxis&&v!==i.direction&&(i.direction=r.isVertical(v)?i.deltaY<0?b:w:i.deltaX<0?k:d);t||(h.trigger(n+"start",i),t=!0);h.trigger(n,i);h.trigger(n+i.direction,i);y=r.isVertical(i.direction);(h.options.dragBlockVertical&&y||h.options.dragBlockHorizontal&&!y)&&i.preventDefault();break;case s:t&&i.changedLength<=h.options.dragMaxTouches&&(h.trigger(n+"end",i),t=!1);break;case f:t=!1}}var t=!1;i.gestures.Drag={name:n,index:50,handler:h,defaults:{dragMinDistance:10,dragDistanceCorrection:!0,dragMaxTouches:1,dragBlockHorizontal:!1,dragBlockVertical:!1,dragLockToAxis:!1,dragLockMinDistance:25}}}("drag");i.gestures.Gesture={name:"gesture",index:1337,handler:function(n,t){t.trigger(this.name,n)}},function(n){function r(i,r){var h=r.options,f=u.current;switch(i.eventType){case e:clearTimeout(t);f.name=n;t=setTimeout(function(){f&&f.name==n&&r.trigger(n,i)},h.holdTimeout);break;case o:i.distance>h.holdThreshold&&clearTimeout(t);break;case s:clearTimeout(t)}}var t;i.gestures.Hold={name:n,index:10,defaults:{holdTimeout:500,holdThreshold:2},handler:r}}("hold");i.gestures.Release={name:"release",index:1/0,handler:function(n,t){n.eventType==s&&t.trigger(this.name,n)}};i.gestures.Swipe={name:"swipe",index:40,defaults:{swipeMinTouches:1,swipeMaxTouches:1,swipeVelocityX:.6,swipeVelocityY:.6},handler:function(n,t){if(n.eventType==s){var r=n.touches.length,i=t.options;if(r<i.swipeMinTouches||r>i.swipeMaxTouches)return;(n.velocityX>i.swipeVelocityX||n.velocityY>i.swipeVelocityY)&&(t.trigger(this.name,n),t.trigger(this.name+n.direction,n))}}},function(n){function s(i,s){var l,a,h=s.options,v=u.current,c=u.previous;switch(i.eventType){case e:t=!1;break;case o:t=t||i.distance>h.tapMaxDistance;break;case f:!r.inStr(i.srcEvent.type,"cancel")&&i.deltaTime<h.tapMaxTime&&!t&&(l=c&&c.lastEvent&&i.timeStamp-c.lastEvent.timeStamp,a=!1,c&&c.name==n&&l&&l<h.doubleTapInterval&&i.distance<h.doubleTapDistance&&(s.trigger("doubletap",i),a=!0),(!a||h.tapAlways)&&(v.name=n,s.trigger(v.name,i)))}}var t=!1;i.gestures.Tap={name:n,index:100,handler:s,defaults:{tapMaxTime:250,tapMaxDistance:10,tapAlways:!0,doubleTapDistance:20,doubleTapInterval:300}}}("tap");i.gestures.Touch={name:"touch",index:-1/0,defaults:{preventDefault:!1,preventMouse:!1},handler:function(n,t){return t.options.preventMouse&&n.pointerType==a?void n.stopDetect():(t.options.preventDefault&&n.preventDefault(),void(n.eventType==v&&t.trigger("touch",n)))}},function(n){function r(i,r){switch(i.eventType){case e:t=!1;break;case o:if(i.touches.length<2)return;var f=Math.abs(1-i.scale),h=Math.abs(i.rotation);if(f<r.options.transformMinScale&&h<r.options.transformMinRotation)return;u.current.name=n;t||(r.trigger(n+"start",i),t=!0);r.trigger(n,i);h>r.options.transformMinRotation&&r.trigger("rotate",i);f>r.options.transformMinScale&&(r.trigger("pinch",i),r.trigger("pinch"+(i.scale<1?"in":"out"),i));break;case s:t&&i.changedLength<2&&(r.trigger(n+"end",i),t=!1)}}var t=!1;i.gestures.Transform={name:n,index:45,defaults:{transformMinScale:.01,transformMinRotation:1},handler:r}}("transform");"function"==typeof define&&define.amd?define(function(){return i}):"undefined"!=typeof module&&module.exports?module.exports=i:n.Hammer=i}(window),function(n){n.fn.columnize=function(t){var i={width:400,columns:!1,buildOnce:!1,overflow:!1,doneFunc:function(){},target:!1,ignoreImageLoading:!0,columnFloat:"left",lastNeverTallest:!1,accuracy:!1,manualBreaks:!1,cssClassPrefix:""},t=n.extend(i,t);return typeof t.width=="string"&&(t.width=parseInt(t.width),isNaN(t.width)&&(t.width=i.width)),this.each(function(){function u(n,t){var i=t?".":"";return l.length?i+l+"-"+n:i+n}function o(i,r,f,e){for(var a,y,p,s,o,l,w,h,v;(c||f.height()<e)&&r[0].childNodes.length;){if(a=r[0].childNodes[0],n(a).find(u("columnbreak",!0)).length)return;if(n(a).hasClass(u("columnbreak")))return;i.append(a)}if(i[0].childNodes.length!=0){if(y=i[0].childNodes,p=y[y.length-1],i[0].removeChild(p),s=n(p),s[0].nodeType==3){for(o=s[0].nodeValue,l=t.width/18,t.accuracy&&(l=t.accuracy),h=null;f.height()<e&&o.length;)v=o.indexOf(" ",l),w=v!=-1?o.substring(0,o.indexOf(" ",l)):o,h=document.createTextNode(w),i.append(h),o=o.length>l&&v!=-1?o.substring(v):"";if(f.height()>=e&&h!=null&&(i[0].removeChild(h),o=h.nodeValue+o),!o.length)return!1;s[0].nodeValue=o}return r.contents().length?r.prepend(s):r.append(s),s[0].nodeType==3}}function s(n,t,i,r){var f,e;if(!n.contents(":last").find(u("columnbreak",!0)).length&&!n.contents(":last").hasClass(u("columnbreak"))&&t.contents().length){if(f=t.contents(":first"),f.get(0).nodeType!=1)return;e=f.clone(!0);f.hasClass(u("columnbreak"))?(n.append(e),f.remove()):c?(n.append(e),f.remove()):e.get(0).nodeType==1&&!e.hasClass(u("dontend"))&&(n.append(e),e.is("img")&&i.height()<r+20?f.remove():!f.hasClass(u("dontsplit"))&&i.height()<r+20?f.remove():e.is("img")||f.hasClass(u("dontsplit"))?e.remove():(e.empty(),o(e,f,i,r)?f.addClass(u("split")):(f.addClass(u("split")),f.children().length&&s(e,f,i,r)),e.get(0).childNodes.length==0&&e.remove()))}}function w(){var l,a,c,i,h,v;if(!r.data("columnized")||r.children().length!=1){if(r.data("columnized",!0),r.data("columnizing",!0),r.empty(),r.append(n("<div class='"+u("first")+" "+u("last")+" "+u("column")+" ' style='width:100%; float: "+t.columnFloat+";'><\/div>")),$col=r.children().eq(r.children().length-1),$destroyable=f.clone(!0),t.overflow){for(targetHeight=t.overflow.height,o($col,$destroyable,$col,targetHeight),$destroyable.contents().find(":first-child").hasClass(u("dontend"))||s($col,$destroyable,$col,targetHeight);$col.contents(":last").length&&e($col.contents(":last").get(0));)l=$col.contents(":last"),l.remove(),$destroyable.prepend(l);for(a="",c=document.createElement("DIV");$destroyable[0].childNodes.length>0;){if(i=$destroyable[0].childNodes[0],i.attributes)for(h=0;h<i.attributes.length;h++)i.attributes[h].nodeName.indexOf("jQuery")==0&&i.removeAttribute(i.attributes[h].nodeName);c.innerHTML="";c.appendChild($destroyable[0].childNodes[0]);a+=c.innerHTML}v=n(t.overflow.id)[0];v.innerHTML=a}else $col.append($destroyable);r.data("columnizing",!1);t.overflow&&t.overflow.doneFunc&&t.overflow.doneFunc()}}function e(t){return t.nodeType==3?/^\s+$/.test(t.nodeValue)?t.previousSibling?e(t.previousSibling):!1:!1:t.nodeType!=1?!1:n(t).hasClass(u("dontend"))?!0:t.childNodes.length==0?!1:e(t.childNodes[t.childNodes.length-1])}function h(){var g,l,d,i,ft,at,vt,et,rt,nt,h,yt,ut;if(a=0,p!=r.width()){p=r.width();var v=Math.round(r.width()/t.width),tt=t.width,lt=t.height;if(t.columns&&(v=t.columns),c&&(v=f.find(u("columnbreak",!0)).length+1,tt=!1),v<=1)return w();if(!r.data("columnizing")){r.data("columnized",!0);r.data("columnizing",!0);r.empty();r.append(n("<div style='width:"+Math.floor(100/v)+"%; float: "+t.columnFloat+";'><\/div>"));i=r.children(":last");i.append(f.clone());y=i.height();r.empty();var b=y/v,k=3,it=!1;for(t.overflow?(k=1,b=t.overflow.height):lt&&tt&&(k=1,b=lt,it=!0),g=0;g<k&&k<20;g++){r.empty();try{l=f.clone(!0)}catch(bt){l=f.clone()}for(l.css("visibility","hidden"),h=0;h<v;h++)d=h==0?u("first"):"",d+=" "+u("column"),d=h==v-1?u("last")+" "+d:d,r.append(n("<div class='"+d+"' style='width:"+Math.floor(100/v)+"%; float: "+t.columnFloat+";'><\/div>"));for(h=0;h<v-(t.overflow?0:1)||it&&l.contents().length;){for(r.children().length<=h&&r.append(n("<div class='"+d+"' style='width:"+Math.floor(100/v)+"%; float: "+t.columnFloat+";'><\/div>")),i=r.children().eq(h),o(i,l,i,b),s(i,l,i,b);i.contents(":last").length&&e(i.contents(":last").get(0));)ft=i.contents(":last"),ft.remove(),l.prepend(ft);h++;i.contents().length==0&&l.contents().length?i.append(l.contents(":first")):h==v-(t.overflow?0:1)&&!t.overflow&&l.find(u("columnbreak",!0)).length&&v++}if(t.overflow&&!it)if(at=!1,vt=document.all&&navigator.appVersion.indexOf("MSIE 7.")!=-1,at||vt){for(et="",rt=document.createElement("DIV");l[0].childNodes.length>0;){for(nt=l[0].childNodes[0],h=0;h<nt.attributes.length;h++)nt.attributes[h].nodeName.indexOf("jQuery")==0&&nt.removeAttribute(nt.attributes[h].nodeName);rt.innerHTML="";rt.appendChild(l[0].childNodes[0]);et+=rt.innerHTML}yt=n(t.overflow.id)[0];yt.innerHTML=et}else n(t.overflow.id).empty().append(l.contents().clone(!0));else if(it)r.children().each(function(n){i=r.children().eq(n);i.width(tt+"px");n==0?i.addClass(u("first")):n==r.children().length-1?i.addClass(u("last")):(i.removeClass(u("first")),i.removeClass(u("last")))}),r.width(r.children().length*tt+"px");else{for(i=r.children().eq(r.children().length-1);l.contents().length;)i.append(l.contents(":first"));var wt=i.height(),kt=wt-b,ot=0,st=1e7,ht=0,ct=!1,pt=0;r.children().each(function(n){return function(t){var r=n.children().eq(t),f=r.children(":last").find(u("columnbreak",!0)).length,i;f||(i=r.height(),ct=!1,ot+=i,i>ht&&(ht=i,ct=!0),i<st&&(st=i),pt++)}}(r));ut=ot/pt;ot==0?g=k:t.lastNeverTallest&&ct?(a+=30,b+=30,g==k-1&&k++):ht-st>30?b=ut+30:Math.abs(ut-b)>20?b=ut:g=k}r.append(n("<br style='clear:both;'>"))}r.find(u("column",!0)).find(":first"+u("removeiffirst",!0)).remove();r.find(u("column",!0)).find(":last"+u("removeiflast",!0)).remove();r.data("columnizing",!1);t.overflow&&t.overflow.doneFunc();t.doneFunc()}}}var r=t.target?n(t.target):n(this),y=n(this).height(),f=n("<div><\/div>"),p=0,c=t.manualBreaks,l=i.cssClassPrefix,a,v;if(typeof t.cssClassPrefix=="string"&&(l=t.cssClassPrefix),a=0,f.append(n(this).contents().clone(!0)),!t.ignoreImageLoading&&!t.target&&!r.data("imageLoaded")&&(r.data("imageLoaded",!0),n(this).find("img").length>0)){v=function(n,i){return function(){n.data("firstImageLoaded")||(n.data("firstImageLoaded","true"),n.empty().append(i.children().clone(!0)),n.columnize(t))}}(n(this),f);n(this).find("img").one("load",v);n(this).find("img").one("abort",v);return}r.empty();h();t.buildOnce||n(window).resize(function(){!t.buildOnce&&n.browser.msie?(r.data("timeout")&&clearTimeout(r.data("timeout")),r.data("timeout",setTimeout(h,200))):t.buildOnce||h()})})}}(jQuery),function(n,t,i){function l(n){var t={},r=/^jQuery\d+$/;return i.each(n.attributes,function(n,i){i.specified&&!r.test(i.name)&&(t[i.name]=i.value)}),t}function f(n,r){var f=this,u=i(f);if(f.value==u.attr("placeholder")&&u.hasClass("placeholder"))if(u.data("placeholder-password")){if(u=u.hide().next().show().attr("id",u.removeAttr("id").data("placeholder-id")),n===!0)return u[0].value=r;u.focus()}else f.value="",u.removeClass("placeholder"),f==t.activeElement&&f.select()}function s(){var t,r=this,n=i(r),e=n,u=this.id;if(r.value==""){if(r.type=="password"){if(!n.data("placeholder-textinput")){try{t=n.clone().attr({type:"text"})}catch(o){t=i("<input>").attr(i.extend(l(this),{type:"text"}))}t.removeAttr("name").data({"placeholder-password":!0,"placeholder-id":u}).bind("focus.placeholder",f);n.data({"placeholder-textinput":t,"placeholder-id":u}).before(t)}n=n.removeAttr("id").hide().prev().attr("id",u).show()}n.addClass("placeholder");n[0].value=n.attr("placeholder")}else n.removeClass("placeholder")}var u="placeholder"in t.createElement("input"),e="placeholder"in t.createElement("textarea"),h=i.fn,c=i.valHooks,o,r;u&&e?(r=h.placeholder=function(){return this},r.input=r.textarea=!0):(r=h.placeholder=function(){var n=this;return n.filter((u?"textarea":":input")+"[placeholder]").not(".placeholder").bind({"focus.placeholder":f,"blur.placeholder":s}).data("placeholder-enabled",!0).trigger("blur.placeholder"),n},r.input=u,r.textarea=e,o={get:function(n){var t=i(n);return t.data("placeholder-enabled")&&t.hasClass("placeholder")?"":n.value},set:function(n,r){var u=i(n);return u.data("placeholder-enabled")?(r==""?(n.value=r,n!=t.activeElement&&s.call(n)):u.hasClass("placeholder")?f.call(n,!0,r)||(n.value=r):n.value=r,u):n.value=r}},u||(c.input=o),e||(c.textarea=o),i(function(){i(t).delegate("form","submit.placeholder",function(){var n=i(".placeholder",this).each(f);setTimeout(function(){n.each(s)},10)})}),i(n).bind("beforeunload.placeholder",function(){i(".placeholder").each(function(){this.value=""})}))}(this,document,jQuery);window.Modernizr=function(n,t,i){function y(n){k.cssText=n}function e(n,t){return typeof n===t}var r={},u=t.documentElement,f="modernizr",p=t.createElement(f),k=p.style,d,g={}.toString,c=" -webkit- -moz- -o- -ms- ".split(" "),o={},w=[],l=w.slice,s,b=function(n,i,r,e){var l,a,c,v,o=t.createElement("div"),h=t.body,s=h||t.createElement("body");if(parseInt(r,10))while(r--)c=t.createElement("div"),c.id=e?e[r]:f+(r+1),o.appendChild(c);return l=["&#173;",'<style id="s',f,'">',n,"<\/style>"].join(""),o.id=f,(h?o:s).innerHTML+=l,s.appendChild(o),h||(s.style.background="",s.style.overflow="hidden",v=u.style.overflow,u.style.overflow="hidden",u.appendChild(s)),a=i(o,n),h?o.parentNode.removeChild(o):(s.parentNode.removeChild(s),u.style.overflow=v),!!a},a={}.hasOwnProperty,v,h;v=!e(a,"undefined")&&!e(a.call,"undefined")?function(n,t){return a.call(n,t)}:function(n,t){return t in n&&e(n.constructor.prototype[t],"undefined")};Function.prototype.bind||(Function.prototype.bind=function(n){var t=this,i,r;if(typeof t!="function")throw new TypeError;return i=l.call(arguments,1),r=function(){var f,e,u;return this instanceof r?(f=function(){},f.prototype=t.prototype,e=new f,u=t.apply(e,i.concat(l.call(arguments))),Object(u)===u?u:e):t.apply(n,i.concat(l.call(arguments)))},r});o.touch=function(){var i;return"ontouchstart"in n||n.DocumentTouch&&t instanceof DocumentTouch?i=!0:b(["@media (",c.join("touch-enabled),("),f,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(n){i=n.offsetTop===9}),i};for(h in o)v(o,h)&&(s=h.toLowerCase(),r[s]=o[h](),w.push((r[s]?"":"no-")+s));return r.addTest=function(n,t){if(typeof n=="object")for(var f in n)v(n,f)&&r.addTest(f,n[f]);else{if(n=n.toLowerCase(),r[n]!==i)return r;t=typeof t=="function"?t():t;typeof enableClasses!="undefined"&&enableClasses&&(u.className+=" "+(t?"":"no-")+n);r[n]=t}return r},y(""),p=d=null,r._version="2.6.2",r._prefixes=c,r.testStyles=b,r}(this,this.document),function(){if(document.documentElement.clientWidth<=767){var n=$("body:not(.cart):not(.checkoutpage)").find("#page-wrap"),t=$("nav.nav-collapse").prependTo("body").addClass("mobile-menu mobile-menu-left hidden-phone"),i=$("nav.filter-navigation").prependTo("body").addClass("mobile-menu mobile-menu-right hidden-phone"),r=$("#modal-filters").prependTo("body");$("#navbar-collapse-button").on("click",function(){n.toggleClass("open-left");t.removeClass("hidden-phone").toggleClass("open")});$("#show-mobile-filters, #btn-cancel-filters").on("click",function(){n.toggleClass("open-right");i.removeClass("hidden-phone").toggleClass("open")});window.location.search.indexOf("logoncompleted")!=-1&&(n.toggleClass("open-left"),t.removeClass("hidden-phone").toggleClass("open"));n.on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){$(".mobile-menu").each(function(){var n=$(this);n.is(".open")||n.addClass("hidden-phone")})});(function(){var t,n;$(".mobile-menu").on("touchstart",function(i){var r=$(this);t=i.originalEvent.touches[0].pageY;n=r.scrollTop();n<=0&&r.scrollTop(1);n+r[0].offsetHeight>=r[0].scrollHeight&&r.scrollTop(r[0].scrollHeight-r[0].offsetHeight-1)})})()}}(),function(n,t,i){function f(n,i){var u=t.createElement(n||"div"),r;for(r in i)u[r]=i[r];return u}function u(n){for(var t=1,i=arguments.length;t<i;t++)n.appendChild(arguments[t]);return n}function p(n,t,i,r){var u=["opacity",t,~~(n*100),i,r].join("-"),f=.01+i/r*100,o=Math.max(1-(1-n)/t*(100-f),n),s=e.substring(0,e.indexOf("Animation")).toLowerCase(),h=s&&"-"+s+"-"||"";return a[u]||(v.insertRule("@"+h+"keyframes "+u+"{0%{opacity:"+o+"}"+f+"%{opacity:"+n+"}"+(f+.01)+"%{opacity:1}"+(f+t)%100+"%{opacity:"+n+"}100%{opacity:"+o+"}}",0),a[u]=1),u}function s(n,t){var f=n.style,u,r;if(f[t]!==i)return t;for(t=t.charAt(0).toUpperCase()+t.slice(1),r=0;r<l.length;r++)if(u=l[r]+t,f[u]!==i)return u}function r(n,t){for(var i in t)n.style[s(n,i)||i]=t[i];return n}function h(n){for(var u,r,t=1;t<arguments.length;t++){u=arguments[t];for(r in u)n[r]===i&&(n[r]=u[r])}return n}function c(n){for(var t={x:n.offsetLeft,y:n.offsetTop};n=n.offsetParent;)t.x+=n.offsetLeft,t.y+=n.offsetTop;return t}var l=["webkit","Moz","ms","O"],a={},e,v=function(){var n=f("style");return u(t.getElementsByTagName("head")[0],n),n.sheet||n.styleSheet}(),w={lines:12,length:7,width:5,radius:10,rotate:0,color:"#000",speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"auto",left:"auto"},o=function y(n){if(!this.spin)return new y(n);this.opts=h(n||{},y.defaults,w)};o.defaults={};h(o.prototype,{spin:function(n){this.stop();var i=this,t=i.opts,u=i.el=r(f(0,{className:t.className}),{position:"relative",zIndex:t.zIndex}),l=t.radius+t.length+t.width,o,s;if(n&&(n.insertBefore(u,n.firstChild||null),s=c(n),o=c(u),r(u,{left:(t.left=="auto"?s.x-o.x+(n.offsetWidth>>1):t.left+l)+"px",top:(t.top=="auto"?s.y-o.y+(n.offsetHeight>>1):t.top+l)+"px"})),u.setAttribute("aria-role","progressbar"),i.lines(u,i.opts),!e){var a=0,v=t.fps,h=v/t.speed,y=(1-t.opacity)/(h*t.trail/100),p=h/t.lines;!function w(){var n,r;for(a++,n=t.lines;n;n--)r=Math.max(1-(a+n*p)%h*y,t.opacity),i.opacity(u,t.lines-n,r,t);i.timeout=i.el&&setTimeout(w,~~(1e3/v))}()}return i},stop:function(){var n=this.el;return n&&(clearTimeout(this.timeout),n.parentNode&&n.parentNode.removeChild(n),this.el=i),this},lines:function(n,t){function s(n,u){return r(f(),{position:"absolute",width:t.length+t.width+"px",height:t.width+"px",background:n,boxShadow:u,transformOrigin:"left",transform:"rotate("+~~(360/t.lines*i+t.rotate)+"deg) translate("+t.radius+"px,0)",borderRadius:(t.width>>1)+"px"})}for(var i=0,o;i<t.lines;i++)o=r(f(),{position:"absolute",top:1+~(t.width/2)+"px",transform:t.hwaccel?"translate3d(0,0,0)":"",opacity:t.opacity,animation:e&&p(t.opacity,t.trail,i,t.lines)+" "+1/t.speed+"s linear infinite"}),t.shadow&&u(o,r(s("#000","0 0 4px #000"),{top:"2px"})),u(n,u(o,s(t.color,"0 0 1px rgba(0,0,0,.1)")));return n},opacity:function(n,t,i){t<n.childNodes.length&&(n.childNodes[t].style.opacity=i)}});!function(){function n(n,t){return f("<"+n+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',t)}var t=r(f("group"),{behavior:"url(#default#VML)"});!s(t,"transform")&&t.adj?(v.addRule(".spin-vml","behavior:url(#default#VML)"),o.prototype.lines=function(t,i){function s(){return r(n("group",{coordsize:o+" "+o,coordorigin:-e+" "+-e}),{width:o,height:o})}function h(t,f,o){u(l,u(r(s(),{rotation:360/i.lines*t+"deg",left:~~f}),u(r(n("roundrect",{arcsize:1}),{width:e,height:i.width,left:i.radius,top:-i.width>>1,filter:o}),n("fill",{color:i.color,opacity:i.opacity}),n("stroke",{opacity:0}))))}var e=i.length+i.width,o=2*e,c=-(i.width+i.length)*2+"px",l=r(s(),{position:"absolute",top:c,left:c}),f;if(i.shadow)for(f=1;f<=i.lines;f++)h(f,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(f=1;f<=i.lines;f++)h(f);return u(t,l)},o.prototype.opacity=function(n,t,i,r){var u=n.firstChild;r=r.shadow&&r.lines||0;u&&t+r<u.childNodes.length&&(u=u.childNodes[t+r],u=u&&u.firstChild,u=u&&u.firstChild,u&&(u.opacity=i))}):e=s(t,"animation")}();n.Spinner=o}(window,document),function(n,t,i){n.fn.tinyNav=function(r){var u=n.extend({active:"selected",header:!1},r);return this.each(function(){var f;i++;var e=n(this),h="tinynav",o=h+i,s=".l_"+o,r=n("<select/>").addClass(h+" "+o);e.is("ul,ol")&&(u.header&&r.append(n("<option/>").text("Navigation")),f="",e.addClass("l_"+o).find("a").each(function(){f+=n(this).closest("ul").is(e)?'<option value="'+n(this).attr("href")+'">'+n(this).text()+"<\/option>":'<option value="'+n(this).attr("href")+'">&mdash;&nbsp;'+n(this).text()+"<\/option>"}),r.append(f),u.header||r.find(":eq("+n(s+" li").index(n(s+" li."+u.active))+")").attr("selected",!0),r.change(function(){t.location.href=n(this).val()}),n(s).after(r))})}}(jQuery,this,0)