diff --git a/assets/css/src/components/_formEditorLegacy.scss b/assets/css/src/components/_formEditorLegacy.scss deleted file mode 100644 index f7b42fee09..0000000000 --- a/assets/css/src/components/_formEditorLegacy.scss +++ /dev/null @@ -1,647 +0,0 @@ -@import '../../../../node_modules/codemirror/lib/codemirror'; -@import '../../../../node_modules/codemirror/theme/neo'; - -$icons: '../../img/form_editor_icons.png'; -$handle_icon: '../../img/handle.png'; - -#mailpoet_form_name { - font-size: 23px; -} - -#mailpoet_form_history { - display: none; -} - -#mailpoet_form_editor { - background-color: #fff; - border: 1px solid #ccc; - box-shadow: 0 0 5px rgba(0, 0, 0, .2), inset 0 0 20px rgba(0, 0, 0, .1); - padding: 20px; - position: relative; - width: 300px; -} - -#mailpoet_form_editor:before, -#mailpoet_form_editor:after { - background: transparent; - bottom: 12px; - box-shadow: 0 6px 12px rgba(0, 0, 0, .3); - content: ' '; - height: 10px; - left: 12px; - position: absolute; - transform: skew(-5deg) rotate(-5deg); - width: 40%; - z-index: -1; -} - -#mailpoet_form_editor:after { - left: auto; - right: 12px; - transform: skew(5deg) rotate(5deg); -} - -/* Warnings in blocks */ -.mailpoet_warning { - color: #900; - font-weight: bold; -} - -.block_placeholder { - border: 0 none; - font-weight: bold; - height: 0; - line-height: 30px; - margin: 0 auto; - overflow: hidden; - text-align: center; - text-indent: -9999px; - width: 298px; - z-index: 9500; -} - -.block_placeholder.active { - /* border:1px dashed #dfdfdf; */ - /* background-color:#f5f5f5; */ - background-color: #4cb7e1; - display: block; - height: 30px; - overflow: auto; - text-indent: 0; -} - -.block_placeholder.hover { - background-color: #0074a2; - border-color: #0074a2; - color: #fff; -} - -/* Widget: checkbox, radio */ -.mailpoet_radio, -.mailpoet_checkbox { - margin: -2px 5px 0 0; -} - -/* MailPoet Form wrapper */ -#mailpoet_form_wrapper { - margin: 20px 0 0; - position: relative; -} - -/* MailPoet Form container */ -#mailpoet_form_container { - margin: 0; - width: 340px; -} - -#mailpoet_form_editor.loading, -#mailpoet_form_toolbar.loading { - background: url('loading.gif') no-repeat center center #fcfcfc; -} - -#mailpoet_form_toolbar.loading { - border: 1px solid #dfdfdf; -} - -#mailpoet_form_toolbar.loading #mailpoet_toolbar_fields { - visibility: hidden; - z-index: 1; -} - -/* Tabs : content/images/styles/themes */ -#wysija-add-field { - float: none; -} - -#mailpoet_form_toolbar { - position: absolute; - width: 400px; - z-index: 999; -} - -#mailpoet_form_toolbar .mailpoet_form_toolbar_tabs { - border-bottom: 1px solid #dfdfdf; - line-height: 0; -} - -#mailpoet_form_toolbar .add_custom_field { - padding: 15px 0 5px; - text-align: center; -} - -#mailpoet_form_toolbar .mailpoet_form_toolbar_tabs li, -#mailpoet_form_toolbar .mailpoet_form_toolbar_tabs a { - display: inline-block; - *display: inline; - *float: left; - height: 30px; - line-height: 30px; - margin: 0; - outline: 0 none; - padding: 0; -} - -#mailpoet_form_toolbar .mailpoet_form_toolbar_tabs li { - margin: 0 0 1px; -} - -#mailpoet_form_toolbar .mailpoet_form_toolbar_tabs a { - background: linear-gradient(center top, #f9f9f9, #f5f5f5); - background-color: #f5f5f5; - border: 1px solid #dfdfdf; - border-radius: 3px 3px 0 0; - box-shadow: 0 1px 0 #fff inset; - color: #a6a6a6; - font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; - outline: 0 none; - padding: 0 7px; - text-decoration: none; -} - -#mailpoet_form_toolbar .mailpoet_form_toolbar_tabs a:hover { - background-color: #eee; -} - -#mailpoet_form_toolbar .mailpoet_form_toolbar_tabs a.selected { - background: #fcfcfc; - border-bottom: 0 none; - color: #000; - filter: none; - padding-bottom: 1px; -} - -#mailpoet_form_toolbar .mailpoet_form_toolbar_tabs .last a, -.wysija_params { - display: none !important; -} - -#mailpoet_form_toolbar .mailpoet_form_toolbar_tabs, -#mailpoet_form_toolbar #mailpoet_toolbar_fields { - margin: 0; - position: relative; - z-index: 9998; -} - -/* edit form name */ -#mailpoet_form_name_input { - vertical-align: bottom; -} - -/* wysija widgets */ -.mailpoet_form_widget { - height: 25px; - line-height: 25px; - width: 298px; - z-index: 9999 !important; -} - -.mailpoet_toolbar_section { - background: none repeat scroll 0 0 #fff; - border: 1px solid #e5e5e5; - box-shadow: 0 1px 1px rgba(0, 0, 0, .04); - cursor: pointer; - margin-bottom: 0; - max-height: 2000px; - min-width: 255px; - overflow: hidden; - position: relative; - transition: max-height .5s ease-in-out; -} - -.mailpoet_toolbar_section > div { - height: 100%; - min-width: 255px; - overflow: auto; - padding: 10px 20px 20px; -} - -.mailpoet_toolbar_section h3 { - margin: 10px; - position: relative; -} - -.mailpoet_toolbar_section.closed { - max-height: 38px; -} - -.mailpoet_toolbar_section .mailpoet_toggle { - height: 38px; - position: absolute; - right: 0; - top: 0; - width: 27px; -} - -.mailpoet_toolbar_section .mailpoet_toggle:focus { - box-shadow: none !important; - outline: 0 none !important; -} - -.mailpoet_toolbar_section .mailpoet_toggle:before { - content: '\f142'; - display: inline-block; - font: 400 20px / 1 dashicons; - padding: 8px 10px; - position: relative; - right: 12px; - speak: none; - text-decoration: none !important; - top: 0; -} - -.mailpoet_toolbar_section.closed .mailpoet_toggle:before { - content: '\f140'; -} - -#mailpoet_form_styles { - margin: 10px; - max-width: 318px; - min-height: 300px; - resize: vertical; - width: 318px; -} - -#mailpoet_form_toolbar a.mailpoet_form_field, -.mailpoet_form_widget { - background: linear-gradient(center 0, #f9f9f9, #ececec); - background-color: #f5f5f5; - border: 1px solid #dfdfdf; - border-radius: 3px; - box-shadow: 0 1px 0 #fff inset; - color: #222; - cursor: move; - display: block; - font-size: 12px; - font-weight: bold; - height: 25px; - line-height: 25px; - padding: 0 7px; - text-shadow: 0 1px 0 #fff; -} - -#mailpoet_form_toolbar a.mailpoet_form_field.disabled { - color: #ccc; - cursor: pointer; - pointer-events: none; -} - -.mailpoet_form_field_edit { - bottom: 13px; - position: absolute; - right: 27px; -} - -.mailpoet_form_field_delete { - bottom: 13px; - position: absolute; - right: 7px; -} - -/* toolbar: fields */ -#mailpoet_toolbar_fields li { - padding: 0 0 10px; - position: relative; -} - -#mailpoet_toolbar_fields li.notice { - background: none !important; - border: 0 none !important; - font-size: 11px; - font-style: italic; - margin: 0 !important; -} - -/* blocks */ -.mailpoet_form_block { - background-color: #fff; - border: 0 none; - display: inline-table; - display: block; - height: 1%; - margin: 0; - padding: 10px 18px; - position: relative; - z-index: 98; -} - -.mailpoet_form_block.highlighted { - border: 1px solid #5897fb; - padding: 9px 17px; -} - -.mailpoet_form_block img { - max-width: 100%; -} - -/* Widget styles */ -.mailpoet_form_block p { - margin: 5px 0; - word-wrap: break-word; -} - -.mailpoet_form_block.dragging { - pointer-events: none; - z-index: 99000; -} - -.mailpoet_form_block:after { - clear: both; - content: '.'; - display: block; - height: 0; - visibility: hidden; -} - -.mailpoet_form_block.hover { - border: 1px dashed #bbb; - margin: 0; - padding: 9px 17px; -} - -.mailpoet_form_block.static { - background-color: #999; -} - -/* controls */ -.mailpoet_form_block .wysija_controls { - background: linear-gradient(center 0, #eee, #bbb); - background-color: #dfdfdf; - border: 1px solid #ccc; - border-radius: 2px; - height: 20px; - left: -1px; - margin: 0; - padding: 0; - position: absolute; - right: 0; - top: -22px; - width: 298px; -} - -.mailpoet_form_block .wysija_controls li { - float: left; - height: 20px; - width: 20px; -} - -.mailpoet_form_block .wysija_controls a { - color: #000; - cursor: pointer; - float: left; - font-size: 120%; - font-weight: bold; - height: 20px; - line-height: 20px; - text-align: center; - width: 20px; -} - -.mailpoet_form_block .wysija_controls a.remove { - margin: 0 0 0 1px; -} - -.mailpoet_form_block .handle_container, -.mailpoet_form_block .handle_container a { - float: none; - width: 40px !important; -} - -.mailpoet_form_block .handle_container { - left: 140px; - position: absolute; - top: 0; -} - -/* controls & icons */ -.wysija_controls a span, -.wysija_gallery .wysija_tools a span, -.wysija_image .wysija_tools a span, -.wysija_text .wysija_tools a span, -#mailpoet_toolbar_fields a span { - display: block; - height: 20px; - width: 20px; -} - -/* toolbar: full width button */ -/* color picker in control bars */ -.wysija_controls span input { - color: transparent; - margin: 2px 0 0; - padding: 0; -} - -/* left alignment button */ -.alignment-left span { - background: url($icons) no-repeat 0 0; -} - -.alignment-left.active span, -.alignment-left:hover span { - background: url($icons) no-repeat 0 -20px; -} - -/* center alignment button */ -.alignment-center span { - background: url($icons) no-repeat -20px 0; -} - -.alignment-center.active span, -.alignment-center:hover span { - background: url($icons) no-repeat -20px -20px; -} - -/* right alignment button */ -.alignment-right span { - background: url($icons) no-repeat -40px 0; -} - -.alignment-right.active span, -.alignment-right:hover span { - background: url($icons) no-repeat -40px -20px; -} - -/* linking */ -.add-link span { - background: url($icons) no-repeat -60px 0; -} - -.add-link.active span, -.add-link:hover span { - background: url($icons) no-repeat -60px -20px; -} - -.remove-link span { - background: url($icons) no-repeat -80px 0; -} - -.remove-link.active span, -.remove-link:hover span { - background: url($icons) no-repeat -80px -20px; -} - -/* block controls */ -.remove span, -.delete span { - background: url($icons) no-repeat -100px 0; -} - -.remove.active span, -.remove:hover span, -.delete.active span, -.delete:hover span { - background: url($icons) no-repeat -100px -20px; -} - -.handle span { - background: url($handle_icon) no-repeat; - cursor: move; - width: 40px !important; -} - -.duplicate span { - background: url($icons) no-repeat -140px 0; -} - -.duplicate.active span, -.duplicate:hover span { - background: url($icons) no-repeat -140px -20px; -} - -.settings span { - background: url($icons) no-repeat -160px 0; -} - -.settings.active span, -.settings:hover span { - background: url($icons) no-repeat -160px -20px; -} - -.icon-plus span { - background: url($icons) no-repeat -200px 0; -} - -.icon-plus.active span, -.icon-plus:hover span { - background: url($icons) no-repeat -200px -20px; -} - -.icon-minus span { - background: url($icons) no-repeat -220px 0; -} - -.icon-minus.active span, -.icon-minus:hover span { - background: url($icons) no-repeat -220px -20px; -} - -/* wysija options */ -.wysija_options { - display: none; -} - -/* wysija block settings */ -.wysija_settings { - position: absolute; - z-index: 1000; -} - -.wysija_settings a { - background: linear-gradient(center 0, #f9f9f9, #ececec); - background-color: #f5f5f5; - border: 1px solid #dfdfdf; - border-radius: 3px; - box-shadow: 0 1px 0 #fff inset; - color: #222; - cursor: pointer; - display: block; - font-size: 12px; - font-weight: normal; - padding: 5px 5px 3px 27px; - text-decoration: none; - text-shadow: 0 1px 0 #fff; -} - -.wysija_settings a span { - height: 20px; - left: 5px; - position: absolute; - top: 3px; - width: 20px; -} - -/* labels */ -.mailpoet_form_block label { - display: block; - margin: 0 5px 0 0; -} - -/* form settings: success message */ -#mailpoet_on_success textarea, -#mailpoet_on_success select { - width: 100%; -} - -#mailpoet_on_success textarea { - height: 50px; - min-height: 50px; - resize: vertical; -} - -/* make sure textareas within the form editor are not resizeable */ -.mailpoet_form_block textarea { - resize: none; -} - -/* remove click events from inputs within form editor */ -.mailpoet_form_block input, -.mailpoet_form_block textarea { - pointer-events: none; -} - -/* form export */ -#mailpoet_form_export textarea { - display: none; - font-size: 85%; - height: 150px; - min-height: 150px; - resize: vertical; - width: 340px; -} - -/** Styling for WP 3.8 and higher */ -.mailpoet_form_field_edit, -.mailpoet_form_field_delete { - text-decoration: none; -} - -.mailpoet_form_field_edit:hover .dashicons-admin-generic:before, -.mailpoet_form_field_delete:hover .dashicons-dismiss:before, -.settings:hover .dashicons-admin-generic:before { - color: #2ea2cc; -} - -.mailpoet_form_field_edit span, -.mailpoet_form_field_delete span { - background: none !important; - color: #999; -} - -.mailpoet_form_field_delete span:before { - font-size: 21px; -} - -/* Code Mirror */ -.CodeMirror { - border: 1px solid #eee; -} - -/* Settings */ -#mailpoet_form_segments.parsley-error + span .select2-selection { - border: 1px solid #b94a48; -} - -.mailpoet_form_field_settings_text { - min-height: 100px; - width: 100%; -} diff --git a/assets/css/src/components/formEditor/components/_sidebar.scss b/assets/css/src/components/formEditor/components/_sidebar.scss index 75e3960c85..7d9f317b38 100644 --- a/assets/css/src/components/formEditor/components/_sidebar.scss +++ b/assets/css/src/components/formEditor/components/_sidebar.scss @@ -85,9 +85,3 @@ $gutenberg-control-border-color-focus: #007cba; margin: 8px 0; } } - -// Styles for old editor link -.mailpoet_old_form_editor_link, -#mailpoet_form_edit_old_editor_fallback_link { - padding: 16px; -} diff --git a/assets/css/src/mailpoet-plugin.scss b/assets/css/src/mailpoet-plugin.scss index 26bfdc5a20..469cde0adb 100644 --- a/assets/css/src/mailpoet-plugin.scss +++ b/assets/css/src/mailpoet-plugin.scss @@ -9,7 +9,6 @@ @import 'components/common'; @import 'components/modal'; @import 'components/notice'; -@import 'components/formEditorLegacy'; @import 'components/listing'; @import 'components/listing/newsletters'; @import 'components/box'; diff --git a/assets/js/lib/prototype.min.js b/assets/js/lib/prototype.min.js deleted file mode 100644 index 35e4dfc841..0000000000 --- a/assets/js/lib/prototype.min.js +++ /dev/null @@ -1,12 +0,0 @@ -var Prototype={Version:"1.7.3",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div"),b=document.createElement("form"),a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"]*>([\\S\\s]*?)<\/script\\s*>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Class=(function(){var d=(function(){for(var e in {toString:1}){if(e==="toString"){return false}}return true})();function a(){}function b(){var h=null,g=$A(arguments);if(Object.isFunction(g[0])){h=g.shift()}function e(){this.initialize.apply(this,arguments)}Object.extend(e,Class.Methods);e.superclass=h;e.subclasses=[];if(h){a.prototype=h.prototype;e.prototype=new a;h.subclasses.push(e)}for(var f=0,j=g.length;f0){match=source.match(pattern);if(match&&match[0].length>0){result+=source.slice(0,match.index);result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length)}else{result+=source,source=""}}return result}function sub(pattern,replacement,count){replacement=prepareReplacement(replacement);count=Object.isUndefined(count)?1:count;return this.gsub(pattern,function(match){if(--count<0){return match[0]}return replacement(match)})}function scan(pattern,iterator){this.gsub(pattern,iterator);return String(this)}function truncate(length,truncation){length=length||30;truncation=Object.isUndefined(truncation)?"...":truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this)}function strip(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function stripTags(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?(\/)?>|<\/\w+>/gi,"")}function stripScripts(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")}function extractScripts(){var matchAll=new RegExp(Prototype.ScriptFragment,"img"),matchOne=new RegExp(Prototype.ScriptFragment,"im");return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||["",""])[1]})}function evalScripts(){return this.extractScripts().map(function(script){return eval(script)})}function escapeHTML(){return this.replace(/&/g,"&").replace(//g,">")}function unescapeHTML(){return this.stripTags().replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function toQueryParams(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match){return{}}return match[1].split(separator||"&").inject({},function(hash,pair){if((pair=pair.split("="))[0]){var key=decodeURIComponent(pair.shift()),value=pair.length>1?pair.join("="):pair[0];if(value!=undefined){value=value.gsub("+"," ");value=decodeURIComponent(value)}if(key in hash){if(!Object.isArray(hash[key])){hash[key]=[hash[key]]}hash[key].push(value)}else{hash[key]=value}}return hash})}function toArray(){return this.split("")}function succ(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)}function times(count){return count<1?"":new Array(count+1).join(this)}function camelize(){return this.replace(/-+(.)?/g,function(match,chr){return chr?chr.toUpperCase():""})}function capitalize(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()}function underscore(){return this.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()}function dasherize(){return this.replace(/_/g,"-")}function inspect(useDoubleQuotes){var escapedString=this.replace(/[\x00-\x1f\\]/g,function(character){if(character in String.specialChar){return String.specialChar[character]}return"\\u00"+character.charCodeAt().toPaddedString(2,16)});if(useDoubleQuotes){return'"'+escapedString.replace(/"/g,'\\"')+'"'}return"'"+escapedString.replace(/'/g,"\\'")+"'"}function unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,"$1")}function isJSON(){var str=this;if(str.blank()){return false}str=str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@");str=str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");str=str.replace(/(?:^|:|,)(?:\s*\[)+/g,"");return(/^[\],:{}\s]*$/).test(str)}function evalJSON(sanitize){var json=this.unfilterJSON(),cx=/[\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff\u0000]/g;if(cx.test(json)){json=json.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())}function parseJSON(){var json=this.unfilterJSON();return JSON.parse(json)}function include(pattern){return this.indexOf(pattern)>-1}function startsWith(pattern,position){position=Object.isNumber(position)?position:0;return this.lastIndexOf(pattern,position)===position}function endsWith(pattern,position){pattern=String(pattern);position=Object.isNumber(position)?position:this.length;if(position<0){position=0}if(position>this.length){position=this.length}var d=position-pattern.length;return d>=0&&this.indexOf(pattern,d)===d}function empty(){return this==""}function blank(){return/^\s*$/.test(this)}function interpolate(object,pattern){return new Template(this,pattern).evaluate(object)}return{gsub:gsub,sub:sub,scan:scan,truncate:truncate,strip:String.prototype.trim||strip,stripTags:stripTags,stripScripts:stripScripts,extractScripts:extractScripts,evalScripts:evalScripts,escapeHTML:escapeHTML,unescapeHTML:unescapeHTML,toQueryParams:toQueryParams,parseQuery:toQueryParams,toArray:toArray,succ:succ,times:times,camelize:camelize,capitalize:capitalize,underscore:underscore,dasherize:dasherize,inspect:inspect,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:NATIVE_JSON_PARSE_SUPPORT?parseJSON:evalJSON,include:include,startsWith:String.prototype.startsWith||startsWith,endsWith:String.prototype.endsWith||endsWith,empty:empty,blank:blank,interpolate:interpolate}})());var Template=Class.create({initialize:function(a,b){this.template=a.toString();this.pattern=b||Template.Pattern},evaluate:function(a){if(a&&Object.isFunction(a.toTemplateReplacements)){a=a.toTemplateReplacements()}return this.template.gsub(this.pattern,function(d){if(a==null){return(d[1]+"")}var f=d[1]||"";if(f=="\\"){return d[2]}var b=a,g=d[3],e=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;d=e.exec(g);if(d==null){return f}while(d!=null){var c=d[1].startsWith("[")?d[2].replace(/\\\\]/g,"]"):d[1];b=b[c];if(null==b||""==d[3]){break}g=g.substring("["==d[3]?d[1].length:d[0].length);d=e.exec(g)}return f+String.interpret(b)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function c(x,w){try{this._each(x,w)}catch(y){if(y!=$break){throw y}}return this}function r(z,y,x){var w=-z,A=[],B=this.toArray();if(z<1){return B}while((w+=z)=w){w=A}},this);return w}function n(y,x){y=y||Prototype.K;var w;this.each(function(A,z){A=y.call(x,A,z,this);if(w==null||Ay?1:0}).pluck("value")}function o(){return this.map()}function s(){var x=Prototype.K,w=$A(arguments);if(Object.isFunction(w.last())){x=w.pop()}var y=[this].concat(w).map($A);return this.map(function(A,z){return x(y.pluck(z))})}function k(){return this.toArray().length}function u(){return"#"}return{each:c,eachSlice:r,all:b,every:b,any:i,some:i,collect:j,map:j,detect:t,findAll:h,select:h,filter:h,grep:g,include:a,member:a,inGroupsOf:q,inject:l,invoke:v,max:p,min:n,partition:e,pluck:f,reject:d,sortBy:m,toArray:o,entries:o,zip:s,size:k,inspect:u,find:t}})();function $A(c){if(!c){return[]}if("toArray" in Object(c)){return c.toArray()}var b=c.length||0,a=new Array(b);while(b--){a[b]=c[b]}return a}function $w(a){if(!Object.isString(a)){return[]}a=a.strip();return a?a.split(/\s+/):[]}Array.from=$A;(function(){var v=Array.prototype,o=v.slice,q=v.forEach;function b(B,A){for(var z=0,C=this.length>>>0;z>>0;if(B===0){return -1}A=Number(A);if(isNaN(A)){A=0}else{if(A!==0&&isFinite(A)){A=(A>0?1:-1)*Math.floor(Math.abs(A))}}if(A>B){return -1}var z=A>=0?A:Math.max(B-Math.abs(A),0);for(;z>>0;if(B===0){return -1}if(!Object.isUndefined(A)){A=Number(A);if(isNaN(A)){A=0}else{if(A!==0&&isFinite(A)){A=(A>0?1:-1)*Math.floor(Math.abs(A))}}}else{A=B}var z=A>=0?Math.min(A,B-1):B-Math.abs(A);for(;z>=0;z--){if(z in D&&D[z]===C){return z}}return -1}function c(G){var E=[],F=o.call(arguments,0),H,A=0;F.unshift(this);for(var D=0,z=F.length;D>>0;A>>0;A>>0;A>>0;A"}function h(){return new Hash(this)}return{initialize:e,_each:f,set:j,get:c,unset:m,toObject:o,toTemplateReplacements:o,keys:n,values:l,index:g,merge:i,update:d,toQueryString:a,inspect:k,toJSON:o,clone:h}})());Hash.from=$H;Object.extend(Number.prototype,(function(){function d(){return this.toPaddedString(2,16)}function b(){return this+1}function h(j,i){$R(0,this,true).each(j,i);return this}function g(k,j){var i=this.toString(j||10);return"0".times(k-i.length)+i}function a(){return Math.abs(this)}function c(){return Math.round(this)}function e(){return Math.ceil(this)}function f(){return Math.floor(this)}return{toColorPart:d,succ:b,times:h,toPaddedString:g,abs:a,round:c,ceil:e,floor:f}})());function $R(c,a,b){return new ObjectRange(c,a,b)}var ObjectRange=Class.create(Enumerable,(function(){function b(f,d,e){this.start=f;this.end=d;this.exclusive=e}function c(f,e){var g=this.start,d;for(d=0;this.include(g);d++){f.call(e,g,d);g=g.succ()}}function a(d){if(d1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var e={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){e["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){e.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var c=this.options.requestHeaders;if(Object.isFunction(c.push)){for(var b=0,d=c.length;b=200&&a<300)||a==304},getStatus:function(){try{if(this.transport.status===1223){return 204}return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(a){var c=Ajax.Request.Events[a],b=new Ajax.Response(this);if(c=="Complete"){try{this._complete=true;(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(b,b.headerJSON)}catch(d){this.dispatchException(d)}var f=b.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&f&&f.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+c]||Prototype.emptyFunction)(b,b.headerJSON);Ajax.Responders.dispatch("on"+c,this,b,b.headerJSON)}catch(d){this.dispatchException(d)}if(c=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},isSameOrigin:function(){var a=this.url.match(/^\s*https?:\/\/[^\/]*/);return !a||(a[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))},getHeader:function(a){try{return this.transport.getResponseHeader(a)||null}catch(b){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);Ajax.Responders.dispatch("onException",this,a)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(c){this.request=c;var d=this.transport=c.transport,a=this.readyState=d.readyState;if((a>2&&!Prototype.Browser.IE)||a==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(d.responseText);this.headerJSON=this._getHeaderJSON()}if(a==4){var b=d.responseXML;this.responseXML=Object.isUndefined(b)?null:b;this.responseJSON=this._getResponseJSON()}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(a){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(a){return null}},getResponseHeader:function(a){return this.transport.getResponseHeader(a)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var a=this.getHeader("X-JSON");if(!a){return null}try{a=decodeURIComponent(escape(a))}catch(b){}try{return a.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}},_getResponseJSON:function(){var a=this.request.options;if(!a.evalJSON||(a.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null}try{return this.responseText.evalJSON(a.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,a,c,b){this.container={success:(a.success||a),failure:(a.failure||(a.success?null:a))};b=Object.clone(b);var d=b.onComplete;b.onComplete=(function(e,f){this.updateContent(e.responseText);if(Object.isFunction(d)){d(e,f)}}).bind(this);$super(c,b)},updateContent:function(d){var c=this.container[this.success()?"success":"failure"],a=this.options;if(!a.evalScripts){d=d.stripScripts()}if(c=PJS$(c)){if(a.insertion){if(Object.isString(a.insertion)){var b={};b[a.insertion]=d;c.insert(b)}else{a.insertion(c,d)}}else{c.update(d)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,a,c,b){$super(b);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=a;this.url=c;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(a){if(this.options.decay){this.decay=(a.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=a.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});(function(a8){var aE;var a1=Array.prototype.slice;var av=document.createElement("div");function aZ(bp){if(arguments.length>1){for(var F=0,br=[],bq=arguments.length;F');return i.tagName.toLowerCase()==="input"&&i.name==="x"}catch(F){return false}})();var aI=a8.Element;function aF(F,i){i=i||{};F=F.toLowerCase();if(d&&i.name){F="<"+F+' name="'+i.name+'">';delete i.name;return aF.writeAttribute(document.createElement(F),i)}if(!r[F]){r[F]=aF.extend(document.createElement(F))}var bp=aQ(F,i)?r[F].cloneNode(false):document.createElement(F);return aF.writeAttribute(bp,i)}a8.Element=aF;Object.extend(a8.Element,aI||{});if(aI){a8.Element.prototype=aI.prototype}aF.Methods={ByTag:{},Simulated:{}};var a3={};var H={id:"id",className:"class"};function ba(F){F=aZ(F);var i="<"+F.tagName.toLowerCase();var bp,br;for(var bq in H){bp=H[bq];br=(F[bq]||"").toString();if(br){i+=" "+bp+"="+br.inspect(true)}}return i+">"}a3.inspect=ba;function v(i){return aZ(i).getStyle("display")!=="none"}function ax(F,i){F=aZ(F);if(typeof i!=="boolean"){i=!aF.visible(F)}aF[i?"show":"hide"](F);return F}function aH(i){i=aZ(i);i.style.display="none";return i}function j(i){i=aZ(i);i.style.display="";return i}Object.extend(a3,{visible:v,toggle:ax,hide:aH,show:j});function ad(i){i=aZ(i);i.parentNode.removeChild(i);return i}var aT=(function(){var i=document.createElement("select"),F=true;i.innerHTML='';if(i.options&&i.options[0]){F=i.options[0].nodeName.toUpperCase()!=="OPTION"}i=null;return F})();var I=(function(){try{var i=document.createElement("table");if(i&&i.tBodies){i.innerHTML="test";var bp=typeof i.tBodies[0]=="undefined";i=null;return bp}}catch(F){return true}})();var a2=(function(){try{var i=document.createElement("div");i.innerHTML="";var bp=(i.childNodes.length===0);i=null;return bp}catch(F){return true}})();var x=aT||I||a2;var aq=(function(){var i=document.createElement("script"),bp=false;try{i.appendChild(document.createTextNode(""));bp=!i.firstChild||i.firstChild&&i.firstChild.nodeType!==3}catch(F){bp=true}i=null;return bp})();function O(br,bt){br=aZ(br);var bu=br.getElementsByTagName("*"),bq=bu.length;while(bq--){Z(bu[bq])}if(bt&&bt.toElement){bt=bt.toElement()}if(Object.isElement(bt)){return br.update().insert(bt)}bt=Object.toHTML(bt);var bp=br.tagName.toUpperCase();if(bp==="SCRIPT"&&aq){br.text=bt;return br}if(x){if(bp in L.tags){while(br.firstChild){br.removeChild(br.firstChild)}var F=t(bp,bt.stripScripts());for(var bq=0,bs;bs=F[bq];bq++){br.appendChild(bs)}}else{if(a2&&Object.isString(bt)&&bt.indexOf("-1){while(br.firstChild){br.removeChild(br.firstChild)}var F=t(bp,bt.stripScripts(),true);for(var bq=0,bs;bs=F[bq];bq++){br.appendChild(bs)}}else{br.innerHTML=bt.stripScripts()}}}else{br.innerHTML=bt.stripScripts()}bt.evalScripts.bind(bt).defer();return br}function ah(F,bp){F=aZ(F);if(bp&&bp.toElement){bp=bp.toElement()}else{if(!Object.isElement(bp)){bp=Object.toHTML(bp);var i=F.ownerDocument.createRange();i.selectNode(F);bp.evalScripts.bind(bp).defer();bp=i.createContextualFragment(bp.stripScripts())}}F.parentNode.replaceChild(bp,F);return F}var L={before:function(i,F){i.parentNode.insertBefore(F,i)},top:function(i,F){i.insertBefore(F,i.firstChild)},bottom:function(i,F){i.appendChild(F)},after:function(i,F){i.parentNode.insertBefore(F,i.nextSibling)},tags:{TABLE:["","
",1],TBODY:["","
",2],TR:["","
",3],TD:["
","
",4],SELECT:["",1]}};var aJ=L.tags;Object.extend(aJ,{THEAD:aJ.TBODY,TFOOT:aJ.TBODY,TH:aJ.TD});function ao(bp,bs){bp=aZ(bp);if(bs&&bs.toElement){bs=bs.toElement()}if(Object.isElement(bs)){bp.parentNode.replaceChild(bs,bp);return bp}bs=Object.toHTML(bs);var br=bp.parentNode,F=br.tagName.toUpperCase();if(F in L.tags){var bt=aF.next(bp);var i=t(F,bs.stripScripts());br.removeChild(bp);var bq;if(bt){bq=function(bu){br.insertBefore(bu,bt)}}else{bq=function(bu){br.appendChild(bu)}}i.each(bq)}else{bp.outerHTML=bs.stripScripts()}bs.evalScripts.bind(bs).defer();return bp}if("outerHTML" in document.documentElement){ah=ao}function a7(i){if(Object.isUndefined(i)||i===null){return false}if(Object.isString(i)||Object.isNumber(i)){return true}if(Object.isElement(i)){return true}if(i.toElement||i.toHTML){return true}return false}function bn(br,bt,F){F=F.toLowerCase();var bv=L[F];if(bt&&bt.toElement){bt=bt.toElement()}if(Object.isElement(bt)){bv(br,bt);return br}bt=Object.toHTML(bt);var bq=((F==="before"||F==="after")?br.parentNode:br).tagName.toUpperCase();var bu=t(bq,bt.stripScripts());if(F==="top"||F==="after"){bu.reverse()}for(var bp=0,bs;bs=bu[bp];bp++){bv(br,bs)}bt.evalScripts.bind(bt).defer()}function Q(F,bp){F=aZ(F);if(a7(bp)){bp={bottom:bp}}for(var i in bp){bn(F,bp[i],i)}return F}function u(F,bp,i){F=aZ(F);if(Object.isElement(bp)){aZ(bp).writeAttribute(i||{})}else{if(Object.isString(bp)){bp=new aF(bp,i)}else{bp=new aF("div",bp)}}if(F.parentNode){F.parentNode.replaceChild(bp,F)}bp.appendChild(F);return bp}function w(F){F=aZ(F);var bp=F.firstChild;while(bp){var i=bp.nextSibling;if(bp.nodeType===Node.TEXT_NODE&&!/\S/.test(bp.nodeValue)){F.removeChild(bp)}bp=i}return F}function a4(i){return aZ(i).innerHTML.blank()}function t(bs,br,bt){var bq=L.tags[bs],bu=av;var F=!!bq;if(!F&&bt){F=true;bq=["","",0]}if(F){bu.innerHTML=" "+bq[0]+br+bq[1];bu.removeChild(bu.firstChild);for(var bp=bq[2];bp--;){bu=bu.firstChild}}else{bu.innerHTML=br}return $A(bu.childNodes)}function E(bq,F){if(!(bq=aZ(bq))){return}var bs=bq.cloneNode(F);if(!aY){bs._prototypeUID=aE;if(F){var br=aF.select(bs,"*"),bp=br.length;while(bp--){br[bp]._prototypeUID=aE}}}return aF.extend(bs)}function Z(F){var i=M(F);if(i){aF.stopObserving(F);if(!aY){F._prototypeUID=aE}delete aF.Storage[i]}}function bl(bp){var F=bp.length;while(F--){Z(bp[F])}}function at(br){var bq=br.length,bp,F;while(bq--){bp=br[bq];F=M(bp);delete aF.Storage[F];delete Event.cache[F]}}if(aY){bl=at}function m(bp){if(!(bp=aZ(bp))){return}Z(bp);var bq=bp.getElementsByTagName("*"),F=bq.length;while(F--){Z(bq[F])}return null}Object.extend(a3,{remove:ad,update:O,replace:ah,insert:Q,wrap:u,cleanWhitespace:w,empty:a4,clone:E,purge:m});function am(i,bp,bq){i=aZ(i);bq=bq||-1;var F=[];while(i=i[bp]){if(i.nodeType===Node.ELEMENT_NODE){F.push(aF.extend(i))}if(F.length===bq){break}}return F}function aL(i){return am(i,"parentNode")}function bm(i){return aF.select(i,"*")}function X(i){i=aZ(i).firstChild;while(i&&i.nodeType!==Node.ELEMENT_NODE){i=i.nextSibling}return aZ(i)}function bi(F){var i=[],bp=aZ(F).firstChild;while(bp){if(bp.nodeType===Node.ELEMENT_NODE){i.push(aF.extend(bp))}bp=bp.nextSibling}return i}function p(i){return am(i,"previousSibling")}function bh(i){return am(i,"nextSibling")}function aV(i){i=aZ(i);var bp=p(i),F=bh(i);return bp.reverse().concat(F)}function aR(F,i){F=aZ(F);if(Object.isString(i)){return Prototype.Selector.match(F,i)}return i.match(F)}function aW(F,bp,bq,i){F=aZ(F),bq=bq||0,i=i||0;if(Object.isNumber(bq)){i=bq,bq=null}while(F=F[bp]){if(F.nodeType!==1){continue}if(bq&&!Prototype.Selector.match(F,bq)){continue}if(--i>=0){continue}return aF.extend(F)}}function aa(F,bp,i){F=aZ(F);if(arguments.length===1){return aZ(F.parentNode)}return aW(F,"parentNode",bp,i)}function y(F,bq,i){if(arguments.length===1){return X(F)}F=aZ(F),bq=bq||0,i=i||0;if(Object.isNumber(bq)){i=bq,bq="*"}var bp=Prototype.Selector.select(bq,F)[i];return aF.extend(bp)}function h(F,bp,i){return aW(F,"previousSibling",bp,i)}function aB(F,bp,i){return aW(F,"nextSibling",bp,i)}function bb(i){i=aZ(i);var F=a1.call(arguments,1).join(", ");return Prototype.Selector.select(F,i)}function aD(bq){bq=aZ(bq);var bs=a1.call(arguments,1).join(", ");var bt=aF.siblings(bq),bp=[];for(var F=0,br;br=bt[F];F++){if(Prototype.Selector.match(br,bs)){bp.push(br)}}return bp}function D(F,i){F=aZ(F),i=aZ(i);if(!F||!i){return false}while(F=F.parentNode){if(F===i){return true}}return false}function B(F,i){F=aZ(F),i=aZ(i);if(!F||!i){return false}if(!i.contains){return D(F,i)}return i.contains(F)&&i!==F}function J(F,i){F=aZ(F),i=aZ(i);if(!F||!i){return false}return(F.compareDocumentPosition(i)&8)===8}var aM;if(av.compareDocumentPosition){aM=J}else{if(av.contains){aM=B}else{aM=D}}Object.extend(a3,{recursivelyCollect:am,ancestors:aL,descendants:bm,firstDescendant:X,immediateDescendants:bi,previousSiblings:p,nextSiblings:bh,siblings:aV,match:aR,up:aa,down:y,previous:h,next:aB,select:bb,adjacent:aD,descendantOf:aM,getElementsBySelector:bb,childElements:bi});var T=1;function aU(i){i=aZ(i);var F=aF.readAttribute(i,"id");if(F){return F}do{F="anonymous_element_"+T++}while(aZ(F));aF.writeAttribute(i,"id",F);return F}function a9(F,i){return aZ(F).getAttribute(i)}function K(F,i){F=aZ(F);var bp=aG.read;if(bp.values[i]){return bp.values[i](F,i)}if(bp.names[i]){i=bp.names[i]}if(i.include(":")){if(!F.attributes||!F.attributes[i]){return null}return F.attributes[i].value}return F.getAttribute(i)}function e(F,i){if(i==="title"){return F.title}return F.getAttribute(i)}var U=(function(){av.setAttribute("onclick",[]);var i=av.getAttribute("onclick");var F=Object.isArray(i);av.removeAttribute("onclick");return F})();if(U){a9=K}else{if(Prototype.Browser.Opera){a9=e}}function a0(bq,bp,bs){bq=aZ(bq);var F={},br=aG.write;if(typeof bp==="object"){F=bp}else{F[bp]=Object.isUndefined(bs)?true:bs}for(var i in F){bp=br.names[i]||i;bs=F[i];if(br.values[i]){bs=br.values[i](bq,bs);if(Object.isUndefined(bs)){continue}}if(bs===false||bs===null){bq.removeAttribute(bp)}else{if(bs===true){bq.setAttribute(bp,bp)}else{bq.setAttribute(bp,bs)}}}return bq}var a=(function(){if(!d){return false}var F=document.createElement('');F.checked=true;var i=F.getAttributeNode("checked");return !i||!i.specified})();function Y(i,bp){bp=aG.has[bp]||bp;var F=aZ(i).getAttributeNode(bp);return !!(F&&F.specified)}function bg(i,F){if(F==="checked"){return i.checked}return Y(i,F)}a8.Element.Methods.Simulated.hasAttribute=a?bg:Y;function k(i){return new aF.ClassNames(i)}var V={};function f(F){if(V[F]){return V[F]}var i=new RegExp("(^|\\s+)"+F+"(\\s+|$)");V[F]=i;return i}function al(i,F){if(!(i=aZ(i))){return}var bp=i.className;if(bp.length===0){return false}if(bp===F){return true}return f(F).test(bp)}function o(i,F){if(!(i=aZ(i))){return}if(!al(i,F)){i.className+=(i.className?" ":"")+F}return i}function au(i,F){if(!(i=aZ(i))){return}i.className=i.className.replace(f(F)," ").strip();return i}function ae(F,bp,i){if(!(F=aZ(F))){return}if(Object.isUndefined(i)){i=!al(F,bp)}var bq=aF[i?"addClassName":"removeClassName"];return bq(F,bp)}var aG={};var aP="className",ar="for";av.setAttribute(aP,"x");if(av.className!=="x"){av.setAttribute("class","x");if(av.className==="x"){aP="class"}}var aK=document.createElement("label");aK.setAttribute(ar,"x");if(aK.htmlFor!=="x"){aK.setAttribute("htmlFor","x");if(aK.htmlFor==="x"){ar="htmlFor"}}aK=null;function ac(i,F){return i.getAttribute(F)}function g(i,F){return i.getAttribute(F,2)}function A(i,bp){var F=i.getAttributeNode(bp);return F?F.value:""}function bj(i,F){return aZ(i).hasAttribute(F)?F:null}av.onclick=Prototype.emptyFunction;var P=av.getAttribute("onclick");var aw;if(String(P).indexOf("{")>-1){aw=function(i,F){var bp=i.getAttribute(F);if(!bp){return null}bp=bp.toString();bp=bp.split("{")[1];bp=bp.split("}")[0];return bp.strip()}}else{if(P===""){aw=function(i,F){var bp=i.getAttribute(F);if(!bp){return null}return bp.strip()}}}aG.read={names:{"class":aP,className:aP,"for":ar,htmlFor:ar},values:{style:function(i){return i.style.cssText.toLowerCase()},title:function(i){return i.title}}};aG.write={names:{className:"class",htmlFor:"for",cellpadding:"cellPadding",cellspacing:"cellSpacing"},values:{checked:function(i,F){F=!!F;i.checked=F;return F?"checked":null},style:function(i,F){i.style.cssText=F?F:""}}};aG.has={names:{}};Object.extend(aG.write.names,aG.read.names);var a6=$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder");for(var af=0,ag;ag=a6[af];af++){aG.write.names[ag.toLowerCase()]=ag;aG.has.names[ag.toLowerCase()]=ag}Object.extend(aG.read.values,{href:g,src:g,type:ac,action:A,disabled:bj,checked:bj,readonly:bj,multiple:bj,onload:aw,onunload:aw,onclick:aw,ondblclick:aw,onmousedown:aw,onmouseup:aw,onmouseover:aw,onmousemove:aw,onmouseout:aw,onfocus:aw,onblur:aw,onkeypress:aw,onkeydown:aw,onkeyup:aw,onsubmit:aw,onreset:aw,onselect:aw,onchange:aw});Object.extend(a3,{identify:aU,readAttribute:a9,writeAttribute:a0,classNames:k,hasClassName:al,addClassName:o,removeClassName:au,toggleClassName:ae});function W(i){if(i==="float"||i==="styleFloat"){return"cssFloat"}return i.camelize()}function bo(i){if(i==="float"||i==="cssFloat"){return"styleFloat"}return i.camelize()}function C(bp,bq){bp=aZ(bp);var bt=bp.style,F;if(Object.isString(bq)){bt.cssText+=";"+bq;if(bq.include("opacity")){var i=bq.match(/opacity:\s*(\d?\.?\d*)/)[1];aF.setOpacity(bp,i)}return bp}for(var bs in bq){if(bs==="opacity"){aF.setOpacity(bp,bq[bs])}else{var br=bq[bs];if(bs==="float"||bs==="cssFloat"){bs=Object.isUndefined(bt.styleFloat)?"cssFloat":"styleFloat"}bt[bs]=br}}return bp}function aO(F,bp){F=aZ(F);bp=W(bp);var bq=F.style[bp];if(!bq||bq==="auto"){var i=document.defaultView.getComputedStyle(F,null);bq=i?i[bp]:null}if(bp==="opacity"){return bq?parseFloat(bq):1}return bq==="auto"?null:bq}function s(i,F){switch(F){case"height":case"width":if(!aF.visible(i)){return null}var bp=parseInt(aO(i,F),10);if(bp!==i["offset"+F.capitalize()]){return bp+"px"}return aF.measure(i,F);default:return aO(i,F)}}function aj(i,F){i=aZ(i);F=bo(F);var bp=i.style[F];if(!bp&&i.currentStyle){bp=i.currentStyle[F]}if(F==="opacity"){if(!N){return be(i)}else{return bp?parseFloat(bp):1}}if(bp==="auto"){if((F==="width"||F==="height")&&aF.visible(i)){return aF.measure(i,F)+"px"}return null}return bp}function aA(i){return(i||"").replace(/alpha\([^\)]*\)/gi,"")}function ab(i){if(!i.currentStyle||!i.currentStyle.hasLayout){i.style.zoom=1}return i}var N=(function(){av.style.cssText="opacity:.55";return/^0.55/.test(av.style.opacity)})();function z(i,F){i=aZ(i);if(F==1||F===""){F=""}else{if(F<0.00001){F=0}}i.style.opacity=F;return i}function bf(i,bq){if(N){return z(i,bq)}i=ab(aZ(i));var bp=aF.getStyle(i,"filter"),F=i.style;if(bq==1||bq===""){bp=aA(bp);if(bp){F.filter=bp}else{F.removeAttribute("filter")}return i}if(bq<0.00001){bq=0}F.filter=aA(bp)+" alpha(opacity="+(bq*100)+")";return i}function bd(i){return aF.getStyle(i,"opacity")}function be(F){if(N){return bd(F)}var bp=aF.getStyle(F,"filter");if(bp.length===0){return 1}var i=(bp||"").match(/alpha\(opacity=(.*)\)/i);if(i&&i[1]){return parseFloat(i[1])/100}return 1}Object.extend(a3,{setStyle:C,getStyle:aO,setOpacity:z,getOpacity:bd});if("styleFloat" in av.style){a3.getStyle=aj;a3.setOpacity=bf;a3.getOpacity=be}var l=0;a8.Element.Storage={UID:1};function M(i){if(i===window){return 0}if(typeof i._prototypeUID==="undefined"){i._prototypeUID=aF.Storage.UID++}return i._prototypeUID}function c(i){if(i===window){return 0}if(i==document){return 1}return i.uniqueID}var aY=("uniqueID" in av);if(aY){M=c}function b(F){if(!(F=aZ(F))){return}var i=M(F);if(!aF.Storage[i]){aF.Storage[i]=$H()}return aF.Storage[i]}function a5(F,i,bp){if(!(F=aZ(F))){return}var bq=b(F);if(arguments.length===2){bq.update(i)}else{bq.set(i,bp)}return F}function aN(bp,F,i){if(!(bp=aZ(bp))){return}var br=b(bp),bq=br.get(F);if(Object.isUndefined(bq)){br.set(F,i);bq=i}return bq}Object.extend(a3,{getStorage:b,store:a5,retrieve:aN});var an={},aX=aF.Methods.ByTag,aC=Prototype.BrowserFeatures;if(!aC.ElementExtensions&&("__proto__" in av)){a8.HTMLElement={};a8.HTMLElement.prototype=av.__proto__;aC.ElementExtensions=true}function bc(i){if(typeof window.Element==="undefined"){return false}if(!d){return false}var bp=window.Element.prototype;if(bp){var br="_"+(Math.random()+"").slice(2),F=document.createElement(i);bp[br]="x";var bq=(F[br]!=="x");delete bp[br];F=null;return bq}return false}var ap=bc("object");function ak(F,i){for(var bq in i){var bp=i[bq];if(Object.isFunction(bp)&&!(bq in F)){F[bq]=bp.methodize()}}}var bk={};function ay(F){var i=M(F);return(i in bk)}function az(bp){if(!bp||ay(bp)){return bp}if(bp.nodeType!==Node.ELEMENT_NODE||bp==window){return bp}var i=Object.clone(an),F=bp.tagName.toUpperCase();if(aX[F]){Object.extend(i,aX[F])}ak(bp,i);bk[M(bp)]=true;return bp}function aS(F){if(!F||ay(F)){return F}var i=F.tagName;if(i&&(/^(?:object|applet|embed)$/i.test(i))){ak(F,aF.Methods);ak(F,aF.Methods.Simulated);ak(F,aF.Methods.ByTag[i.toUpperCase()])}return F}if(aC.SpecificElementExtensions){az=ap?aS:Prototype.K}function S(F,i){F=F.toUpperCase();if(!aX[F]){aX[F]={}}Object.extend(aX[F],i)}function q(F,bp,i){if(Object.isUndefined(i)){i=false}for(var br in bp){var bq=bp[br];if(!Object.isFunction(bq)){continue}if(!i||!(br in F)){F[br]=bq.methodize()}}}function ai(bq){var i;var bp={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"};if(bp[bq]){i="HTML"+bp[bq]+"Element"}if(window[i]){return window[i]}i="HTML"+bq+"Element";if(window[i]){return window[i]}i="HTML"+bq.capitalize()+"Element";if(window[i]){return window[i]}var F=document.createElement(bq),br=F.__proto__||F.constructor.prototype;F=null;return br}function R(br){if(arguments.length===0){G()}if(arguments.length===2){var bt=br;br=arguments[1]}if(!bt){Object.extend(aF.Methods,br||{})}else{if(Object.isArray(bt)){for(var bs=0,bq;bq=bt[bs];bs++){S(bq,br)}}else{S(bt,br)}}var bp=window.HTMLElement?HTMLElement.prototype:aF.prototype;if(aC.ElementExtensions){q(bp,aF.Methods);q(bp,aF.Methods.Simulated,true)}if(aC.SpecificElementExtensions){for(var bq in aF.Methods.ByTag){var F=ai(bq);if(Object.isUndefined(F)){continue}q(F.prototype,aX[bq])}}Object.extend(aF,aF.Methods);Object.extend(aF,aF.Methods.Simulated);delete aF.ByTag;delete aF.Simulated;aF.extend.refresh();r={}}Object.extend(a8.Element,{extend:az,addMethods:R});if(az===Prototype.K){a8.Element.extend.refresh=Prototype.emptyFunction}else{a8.Element.extend.refresh=function(){if(Prototype.BrowserFeatures.ElementExtensions){return}Object.extend(an,aF.Methods);Object.extend(an,aF.Methods.Simulated);bk={}}}function G(){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(aF.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods),BUTTON:Object.clone(Form.Element.Methods)})}aF.addMethods(a3);function n(){av=null;r=null}if(window.attachEvent){window.attachEvent("onunload",n)}})(this);(function(){function k(G){var F=G.match(/^(\d+)%?$/i);if(!F){return null}return(Number(F[1])/100)}function y(G,H){G=PJS$(G);var I=G.style[H];if(!I||I==="auto"){var F=document.defaultView.getComputedStyle(G,null);I=F?F[H]:null}if(H==="opacity"){return I?parseFloat(I):1}return I==="auto"?null:I}function B(F,G){var H=F.style[G];if(!H&&F.currentStyle){H=F.currentStyle[G]}return H}function r(H,G){var J=H.offsetWidth;var L=u(H,"borderLeftWidth",G)||0;var F=u(H,"borderRightWidth",G)||0;var I=u(H,"paddingLeft",G)||0;var K=u(H,"paddingRight",G)||0;return J-L-F-I-K}if(!Object.isUndefined(document.documentElement.currentStyle)&&!Prototype.Browser.Opera){y=B}function u(P,Q,G){var J=null;if(Object.isElement(P)){J=P;P=y(J,Q)}if(P===null||Object.isUndefined(P)){return null}if((/^(?:-)?\d+(\.\d+)?(px)?$/i).test(P)){return window.parseFloat(P)}var K=P.include("%"),H=(G===document.viewport);if(/\d/.test(P)&&J&&J.runtimeStyle&&!(K&&H)){var F=J.style.left,O=J.runtimeStyle.left;J.runtimeStyle.left=J.currentStyle.left;J.style.left=P||0;P=J.style.pixelLeft;J.style.left=F;J.runtimeStyle.left=O;return P}if(J&&K){G=G||J.parentNode;var I=k(P),L=null;var N=Q.include("left")||Q.include("right")||Q.include("width");var M=Q.include("top")||Q.include("bottom")||Q.include("height");if(G===document.viewport){if(N){L=document.viewport.getWidth()}else{if(M){L=document.viewport.getHeight()}}}else{if(N){L=PJS$(G).measure("width")}else{if(M){L=PJS$(G).measure("height")}}}return(L===null)?0:L*I}return 0}function j(F){if(Object.isString(F)&&F.endsWith("px")){return F}return F+"px"}function m(F){while(F&&F.parentNode){var G=F.getStyle("display");if(G==="none"){return false}F=PJS$(F.parentNode)}return true}var g=Prototype.K;if("currentStyle" in document.documentElement){g=function(F){if(!F.currentStyle.hasLayout){F.style.zoom=1}return F}}function i(F){if(F.include("border")){F=F+"-width"}return F.camelize()}Element.Layout=Class.create(Hash,{initialize:function($super,G,F){$super();this.element=PJS$(G);Element.Layout.PROPERTIES.each(function(H){this._set(H,null)},this);if(F){this._preComputing=true;this._begin();Element.Layout.PROPERTIES.each(this._compute,this);this._end();this._preComputing=false}},_set:function(G,F){return Hash.prototype.set.call(this,G,F)},set:function(G,F){throw"Properties of Element.Layout are read-only."},get:function($super,G){var F=$super(G);return F===null?this._compute(G):F},_begin:function(){if(this._isPrepared()){return}var J=this.element;if(m(J)){this._setPrepared(true);return}var L={position:J.style.position||"",width:J.style.width||"",visibility:J.style.visibility||"",display:J.style.display||""};J.store("prototype_original_styles",L);var M=y(J,"position"),F=J.offsetWidth;if(F===0||F===null){J.style.display="block";F=J.offsetWidth}var G=(M==="fixed")?document.viewport:J.parentNode;var N={visibility:"hidden",display:"block"};if(M!=="fixed"){N.position="absolute"}J.setStyle(N);var H=J.offsetWidth,I;if(F&&(H===F)){I=r(J,G)}else{if(M==="absolute"||M==="fixed"){I=r(J,G)}else{var O=J.parentNode,K=PJS$(O).getLayout();I=K.get("width")-this.get("margin-left")-this.get("border-left")-this.get("padding-left")-this.get("padding-right")-this.get("border-right")-this.get("margin-right")}}J.setStyle({width:I+"px"});this._setPrepared(true)},_end:function(){var G=this.element;var F=G.retrieve("prototype_original_styles");G.store("prototype_original_styles",null);G.setStyle(F);this._setPrepared(false)},_compute:function(G){var F=Element.Layout.COMPUTATIONS;if(!(G in F)){throw"Property not found."}return this._set(G,F[G].call(this,this.element))},_isPrepared:function(){return this.element.retrieve("prototype_element_layout_prepared",false)},_setPrepared:function(F){return this.element.store("prototype_element_layout_prepared",F)},toObject:function(){var F=$A(arguments);var G=(F.length===0)?Element.Layout.PROPERTIES:F.join(" ").split(" ");var H={};G.each(function(I){if(!Element.Layout.PROPERTIES.include(I)){return}var J=this.get(I);if(J!=null){H[I]=J}},this);return H},toHash:function(){var F=this.toObject.apply(this,arguments);return new Hash(F)},toCSS:function(){var F=$A(arguments);var H=(F.length===0)?Element.Layout.PROPERTIES:F.join(" ").split(" ");var G={};H.each(function(I){if(!Element.Layout.PROPERTIES.include(I)){return}if(Element.Layout.COMPOSITE_PROPERTIES.include(I)){return}var J=this.get(I);if(J!=null){G[i(I)]=J+"px"}},this);return G},inspect:function(){return"#"}});Object.extend(Element.Layout,{PROPERTIES:$w("height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height"),COMPOSITE_PROPERTIES:$w("padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height"),COMPUTATIONS:{height:function(H){if(!this._preComputing){this._begin()}var F=this.get("border-box-height");if(F<=0){if(!this._preComputing){this._end()}return 0}var I=this.get("border-top"),G=this.get("border-bottom");var K=this.get("padding-top"),J=this.get("padding-bottom");if(!this._preComputing){this._end()}return F-I-G-K-J},width:function(H){if(!this._preComputing){this._begin()}var G=this.get("border-box-width");if(G<=0){if(!this._preComputing){this._end()}return 0}var K=this.get("border-left"),F=this.get("border-right");var I=this.get("padding-left"),J=this.get("padding-right");if(!this._preComputing){this._end()}return G-K-F-I-J},"padding-box-height":function(G){var F=this.get("height"),I=this.get("padding-top"),H=this.get("padding-bottom");return F+I+H},"padding-box-width":function(F){var G=this.get("width"),H=this.get("padding-left"),I=this.get("padding-right");return G+H+I},"border-box-height":function(G){if(!this._preComputing){this._begin()}var F=G.offsetHeight;if(!this._preComputing){this._end()}return F},"border-box-width":function(F){if(!this._preComputing){this._begin()}var G=F.offsetWidth;if(!this._preComputing){this._end()}return G},"margin-box-height":function(G){var F=this.get("border-box-height"),H=this.get("margin-top"),I=this.get("margin-bottom");if(F<=0){return 0}return F+H+I},"margin-box-width":function(H){var G=this.get("border-box-width"),I=this.get("margin-left"),F=this.get("margin-right");if(G<=0){return 0}return G+I+F},top:function(F){var G=F.positionedOffset();return G.top},bottom:function(F){var I=F.positionedOffset(),G=F.getOffsetParent(),H=G.measure("height");var J=this.get("border-box-height");return H-J-I.top},left:function(F){var G=F.positionedOffset();return G.left},right:function(H){var J=H.positionedOffset(),I=H.getOffsetParent(),F=I.measure("width");var G=this.get("border-box-width");return F-G-J.left},"padding-top":function(F){return u(F,"paddingTop")},"padding-bottom":function(F){return u(F,"paddingBottom")},"padding-left":function(F){return u(F,"paddingLeft")},"padding-right":function(F){return u(F,"paddingRight")},"border-top":function(F){return u(F,"borderTopWidth")},"border-bottom":function(F){return u(F,"borderBottomWidth")},"border-left":function(F){return u(F,"borderLeftWidth")},"border-right":function(F){return u(F,"borderRightWidth")},"margin-top":function(F){return u(F,"marginTop")},"margin-bottom":function(F){return u(F,"marginBottom")},"margin-left":function(F){return u(F,"marginLeft")},"margin-right":function(F){return u(F,"marginRight")}}});if("getBoundingClientRect" in document.documentElement){Object.extend(Element.Layout.COMPUTATIONS,{right:function(G){var H=g(G.getOffsetParent());var I=G.getBoundingClientRect(),F=H.getBoundingClientRect();return(F.right-I.right).round()},bottom:function(G){var H=g(G.getOffsetParent());var I=G.getBoundingClientRect(),F=H.getBoundingClientRect();return(F.bottom-I.bottom).round()}})}Element.Offset=Class.create({initialize:function(G,F){this.left=G.round();this.top=F.round();this[0]=this.left;this[1]=this.top},relativeTo:function(F){return new Element.Offset(this.left-F.left,this.top-F.top)},inspect:function(){return"#".interpolate(this)},toString:function(){return"[#{left}, #{top}]".interpolate(this)},toArray:function(){return[this.left,this.top]}});function z(G,F){return new Element.Layout(G,F)}function d(F,G){return PJS$(F).getLayout().get(G)}function q(F){return Element.getDimensions(F).height}function c(F){return Element.getDimensions(F).width}function s(G){G=PJS$(G);var K=Element.getStyle(G,"display");if(K&&K!=="none"){return{width:G.offsetWidth,height:G.offsetHeight}}var H=G.style;var F={visibility:H.visibility,position:H.position,display:H.display};var J={visibility:"hidden",display:"block"};if(F.position!=="fixed"){J.position="absolute"}Element.setStyle(G,J);var I={width:G.offsetWidth,height:G.offsetHeight};Element.setStyle(G,F);return I}function p(F){F=PJS$(F);function H(I){return n(I)?PJS$(document.body):PJS$(I)}if(h(F)||f(F)||o(F)||n(F)){return PJS$(document.body)}var G=(Element.getStyle(F,"display")==="inline");if(!G&&F.offsetParent){return H(F.offsetParent)}while((F=F.parentNode)&&F!==document.body){if(Element.getStyle(F,"position")!=="static"){return H(F)}}return PJS$(document.body)}function C(G){G=PJS$(G);var F=0,H=0;if(G.parentNode){do{F+=G.offsetTop||0;H+=G.offsetLeft||0;G=G.offsetParent}while(G)}return new Element.Offset(H,F)}function w(G){G=PJS$(G);var H=G.getLayout();var F=0,J=0;do{F+=G.offsetTop||0;J+=G.offsetLeft||0;G=G.offsetParent;if(G){if(o(G)){break}var I=Element.getStyle(G,"position");if(I!=="static"){break}}}while(G);J-=H.get("margin-left");F-=H.get("margin-top");return new Element.Offset(J,F)}function b(G){var F=0,H=0;do{if(G===document.body){var I=document.documentElement||document.body.parentNode||document.body;F+=!Object.isUndefined(window.pageYOffset)?window.pageYOffset:I.scrollTop||0;H+=!Object.isUndefined(window.pageXOffset)?window.pageXOffset:I.scrollLeft||0;break}else{F+=G.scrollTop||0;H+=G.scrollLeft||0;G=G.parentNode}}while(G);return new Element.Offset(H,F)}function A(J){var F=0,I=0,H=document.body;J=PJS$(J);var G=J;do{F+=G.offsetTop||0;I+=G.offsetLeft||0;if(G.offsetParent==H&&Element.getStyle(G,"position")=="absolute"){break}}while(G=G.offsetParent);G=J;do{if(G!=H){F-=G.scrollTop||0;I-=G.scrollLeft||0}}while(G=G.parentNode);return new Element.Offset(I,F)}function x(F){F=PJS$(F);if(Element.getStyle(F,"position")==="absolute"){return F}var J=p(F);var I=F.viewportOffset(),G=J.viewportOffset();var K=I.relativeTo(G);var H=F.getLayout();F.store("prototype_absolutize_original_styles",{position:F.getStyle("position"),left:F.getStyle("left"),top:F.getStyle("top"),width:F.getStyle("width"),height:F.getStyle("height")});F.setStyle({position:"absolute",top:K.top+"px",left:K.left+"px",width:H.get("width")+"px",height:H.get("height")+"px"});return F}function l(G){G=PJS$(G);if(Element.getStyle(G,"position")==="relative"){return G}var F=G.retrieve("prototype_absolutize_original_styles");if(F){G.setStyle(F)}return G}function a(F){F=PJS$(F);var G=Element.cumulativeOffset(F);window.scrollTo(G.left,G.top);return F}function v(G){G=PJS$(G);var F=Element.getStyle(G,"position"),H={};if(F==="static"||!F){H.position="relative";if(Prototype.Browser.Opera){H.top=0;H.left=0}Element.setStyle(G,H);Element.store(G,"prototype_made_positioned",true)}return G}function t(F){F=PJS$(F);var H=Element.getStorage(F),G=H.get("prototype_made_positioned");if(G){H.unset("prototype_made_positioned");Element.setStyle(F,{position:"",top:"",bottom:"",left:"",right:""})}return F}function e(G){G=PJS$(G);var I=Element.getStorage(G),F=I.get("prototype_made_clipping");if(Object.isUndefined(F)){var H=Element.getStyle(G,"overflow");I.set("prototype_made_clipping",H);if(H!=="hidden"){G.style.overflow="hidden"}}return G}function D(F){F=PJS$(F);var H=Element.getStorage(F),G=H.get("prototype_made_clipping");if(!Object.isUndefined(G)){H.unset("prototype_made_clipping");F.style.overflow=G||""}return F}function E(I,F,Q){Q=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},Q||{});var H=document.documentElement;F=PJS$(F);I=PJS$(I);var G,O,K,P={};if(Q.setLeft||Q.setTop){G=Element.viewportOffset(F);O=[0,0];if(Element.getStyle(I,"position")==="absolute"){var N=Element.getOffsetParent(I);if(N!==document.body){O=Element.viewportOffset(N)}}}function L(){var R=0,S=0;if(Object.isNumber(window.pageXOffset)){R=window.pageXOffset;S=window.pageYOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){R=document.body.scrollLeft;S=document.body.scrollTop}else{if(H&&(H.scrollLeft||H.scrollTop)){R=H.scrollLeft;S=H.scrollTop}}}return{x:R,y:S}}var J=L();if(Q.setWidth||Q.setHeight){K=Element.getLayout(F)}if(Q.setLeft){P.left=(G[0]+J.x-O[0]+Q.offsetLeft)+"px"}if(Q.setTop){P.top=(G[1]+J.y-O[1]+Q.offsetTop)+"px"}var M=I.getLayout();if(Q.setWidth){P.width=K.get("width")+"px"}if(Q.setHeight){P.height=K.get("height")+"px"}return Element.setStyle(I,P)}if(Prototype.Browser.IE){p=p.wrap(function(H,G){G=PJS$(G);if(h(G)||f(G)||o(G)||n(G)){return PJS$(document.body)}var F=G.getStyle("position");if(F!=="static"){return H(G)}G.setStyle({position:"relative"});var I=H(G);G.setStyle({position:F});return I});w=w.wrap(function(I,G){G=PJS$(G);if(!G.parentNode){return new Element.Offset(0,0)}var F=G.getStyle("position");if(F!=="static"){return I(G)}var H=G.getOffsetParent();if(H&&H.getStyle("position")==="fixed"){g(H)}G.setStyle({position:"relative"});var J=I(G);G.setStyle({position:F});return J})}else{if(Prototype.Browser.Webkit){C=function(G){G=PJS$(G);var F=0,H=0;do{F+=G.offsetTop||0;H+=G.offsetLeft||0;if(G.offsetParent==document.body){if(Element.getStyle(G,"position")=="absolute"){break}}G=G.offsetParent}while(G);return new Element.Offset(H,F)}}}Element.addMethods({getLayout:z,measure:d,getWidth:c,getHeight:q,getDimensions:s,getOffsetParent:p,cumulativeOffset:C,positionedOffset:w,cumulativeScrollOffset:b,viewportOffset:A,absolutize:x,relativize:l,scrollTo:a,makePositioned:v,undoPositioned:t,makeClipping:e,undoClipping:D,clonePosition:E});function o(F){return F.nodeName.toUpperCase()==="BODY"}function n(F){return F.nodeName.toUpperCase()==="HTML"}function h(F){return F.nodeType===Node.DOCUMENT_NODE}function f(F){return F!==document.body&&!Element.descendantOf(F,document.body)}if("getBoundingClientRect" in document.documentElement){Element.addMethods({viewportOffset:function(F){F=PJS$(F);if(f(F)){return new Element.Offset(0,0)}var G=F.getBoundingClientRect(),H=document.documentElement;return new Element.Offset(G.left-H.clientLeft,G.top-H.clientTop)}})}})();(function(){var c=Prototype.Browser.Opera&&(window.parseFloat(window.opera.version())<9.5);var f=null;function b(){if(f){return f}f=c?document.body:document.documentElement;return f}function d(){return{width:this.getWidth(),height:this.getHeight()}}function a(){return b().clientWidth}function g(){return b().clientHeight}function e(){var h=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft;var i=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop;return new Element.Offset(h,i)}document.viewport={getDimensions:d,getWidth:a,getHeight:g,getScrollOffsets:e}})();window.$$=function(){var a=$A(arguments).join(", ");return Prototype.Selector.select(a,document)};Prototype.Selector=(function(){function a(){throw new Error('Method "Prototype.Selector.select" must be defined.')}function c(){throw new Error('Method "Prototype.Selector.match" must be defined.')}function d(l,m,h){h=h||0;var g=Prototype.Selector.match,k=l.length,f=0,j;for(j=0;j+~]|"+v+")"+v+"*"),z=new RegExp("="+v+"*([^\\]'\"]*?)"+v+"*\\]","g"),X=new RegExp(q),Z=new RegExp("^"+Q+"$"),ah={ID:new RegExp("^#("+a+")"),CLASS:new RegExp("^\\.("+a+")"),TAG:new RegExp("^("+a.replace("w","w*")+")"),ATTR:new RegExp("^"+al),PSEUDO:new RegExp("^"+q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+v+"*(even|odd|(([+-]|)(\\d*)n|)"+v+"*(?:([+-]|)"+v+"*(\\d+)|))"+v+"*\\)|)","i"),bool:new RegExp("^(?:"+c+")$","i"),needsContext:new RegExp("^"+v+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+v+"*((?:-\\d)?\\d*)"+v+"*\\)|)(?=[^-]|$)","i")},h=/^(?:input|select|textarea|button)$/i,r=/^h\d$/i,U=/^[^{]+\{\s*\[native \w/,W=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ag=/[+~]/,S=/'|\\/g,y=new RegExp("\\\\([\\da-f]{1,6}"+v+"?|("+v+")|.)","ig"),ak=function(e,aE,i){var aD="0x"+aE-65536;return aD!==aD||i?aE:aD<0?String.fromCharCode(aD+65536):String.fromCharCode(aD>>10|55296,aD&1023|56320)};try{b.apply((ar=s.call(O.childNodes)),O.childNodes);ar[O.childNodes.length].nodeType}catch(I){b={apply:ar.length?function(i,e){R.apply(i,s.call(e))}:function(aF,aE){var e=aF.length,aD=0;while((aF[e++]=aE[aD++])){}aF.length=e-1}}}function B(aK,aD,aO,aQ){var aP,aH,aI,aM,aN,aG,aF,e,aE,aL;if((aD?aD.ownerDocument||aD:O)!==H){ae(aD)}aD=aD||H;aO=aO||[];if(!aK||typeof aK!=="string"){return aO}if((aM=aD.nodeType)!==1&&aM!==9){return[]}if(an&&!aQ){if((aP=W.exec(aK))){if((aI=aP[1])){if(aM===9){aH=aD.getElementById(aI);if(aH&&aH.parentNode){if(aH.id===aI){aO.push(aH);return aO}}else{return aO}}else{if(aD.ownerDocument&&(aH=aD.ownerDocument.getElementById(aI))&&K(aD,aH)&&aH.id===aI){aO.push(aH);return aO}}}else{if(aP[2]){b.apply(aO,aD.getElementsByTagName(aK));return aO}else{if((aI=aP[3])&&ay.getElementsByClassName&&aD.getElementsByClassName){b.apply(aO,aD.getElementsByClassName(aI));return aO}}}}if(ay.qsa&&(!ai||!ai.test(aK))){e=aF=ap;aE=aD;aL=aM===9&&aK;if(aM===1&&aD.nodeName.toLowerCase()!=="object"){aG=n(aK);if((aF=aD.getAttribute("id"))){e=aF.replace(S,"\\$&")}else{aD.setAttribute("id",e)}e="[id='"+e+"'] ";aN=aG.length;while(aN--){aG[aN]=e+o(aG[aN])}aE=ag.test(aK)&&Y(aD.parentNode)||aD;aL=aG.join(",")}if(aL){try{b.apply(aO,aE.querySelectorAll(aL));return aO}catch(aJ){}finally{if(!aF){aD.removeAttribute("id")}}}}}return ax(aK.replace(x,"$1"),aD,aO,aQ)}function F(){var i=[];function e(aD,aE){if(i.push(aD+" ")>t.cacheLength){delete e[i.shift()]}return(e[aD+" "]=aE)}return e}function p(e){e[ap]=true;return e}function l(i){var aE=H.createElement("div");try{return !!i(aE)}catch(aD){return false}finally{if(aE.parentNode){aE.parentNode.removeChild(aE)}aE=null}}function aA(aD,aF){var e=aD.split("|"),aE=aD.length;while(aE--){t.attrHandle[e[aE]]=aF}}function f(i,e){var aE=e&&i,aD=aE&&i.nodeType===1&&e.nodeType===1&&(~e.sourceIndex||V)-(~i.sourceIndex||V);if(aD){return aD}if(aE){while((aE=aE.nextSibling)){if(aE===e){return -1}}}return i?1:-1}function C(e){return function(aD){var i=aD.nodeName.toLowerCase();return i==="input"&&aD.type===e}}function g(e){return function(aD){var i=aD.nodeName.toLowerCase();return(i==="input"||i==="button")&&aD.type===e}}function am(e){return p(function(i){i=+i;return p(function(aD,aH){var aF,aE=e([],aD.length,i),aG=aE.length;while(aG--){if(aD[(aF=aE[aG])]){aD[aF]=!(aH[aF]=aD[aF])}}})})}function Y(e){return e&&typeof e.getElementsByTagName!==au&&e}ay=B.support={};P=B.isXML=function(e){var i=e&&(e.ownerDocument||e).documentElement;return i?i.nodeName!=="HTML":false};ae=B.setDocument=function(aD){var e,aE=aD?aD.ownerDocument||aD:O,i=aE.defaultView;if(aE===H||aE.nodeType!==9||!aE.documentElement){return H}H=aE;u=aE.documentElement;an=!P(aE);if(i&&i!==i.top){if(i.addEventListener){i.addEventListener("unload",function(){ae()},false)}else{if(i.attachEvent){i.attachEvent("onunload",function(){ae()})}}}ay.attributes=l(function(aF){aF.className="i";return !aF.getAttribute("className")});ay.getElementsByTagName=l(function(aF){aF.appendChild(aE.createComment(""));return !aF.getElementsByTagName("*").length});ay.getElementsByClassName=U.test(aE.getElementsByClassName)&&l(function(aF){aF.innerHTML="
";aF.firstChild.className="i";return aF.getElementsByClassName("i").length===2});ay.getById=l(function(aF){u.appendChild(aF).id=ap;return !aE.getElementsByName||!aE.getElementsByName(ap).length});if(ay.getById){t.find.ID=function(aH,aG){if(typeof aG.getElementById!==au&&an){var aF=aG.getElementById(aH);return aF&&aF.parentNode?[aF]:[]}};t.filter.ID=function(aG){var aF=aG.replace(y,ak);return function(aH){return aH.getAttribute("id")===aF}}}else{delete t.find.ID;t.filter.ID=function(aG){var aF=aG.replace(y,ak);return function(aI){var aH=typeof aI.getAttributeNode!==au&&aI.getAttributeNode("id");return aH&&aH.value===aF}}}t.find.TAG=ay.getElementsByTagName?function(aF,aG){if(typeof aG.getElementsByTagName!==au){return aG.getElementsByTagName(aF)}}:function(aF,aJ){var aK,aI=[],aH=0,aG=aJ.getElementsByTagName(aF);if(aF==="*"){while((aK=aG[aH++])){if(aK.nodeType===1){aI.push(aK)}}return aI}return aG};t.find.CLASS=ay.getElementsByClassName&&function(aG,aF){if(typeof aF.getElementsByClassName!==au&&an){return aF.getElementsByClassName(aG)}};aw=[];ai=[];if((ay.qsa=U.test(aE.querySelectorAll))){l(function(aF){aF.innerHTML="";if(aF.querySelectorAll("[t^='']").length){ai.push("[*^$]="+v+"*(?:''|\"\")")}if(!aF.querySelectorAll("[selected]").length){ai.push("\\["+v+"*(?:value|"+c+")")}if(!aF.querySelectorAll(":checked").length){ai.push(":checked")}});l(function(aG){var aF=aE.createElement("input");aF.setAttribute("type","hidden");aG.appendChild(aF).setAttribute("name","D");if(aG.querySelectorAll("[name=d]").length){ai.push("name"+v+"*[*^$|!~]?=")}if(!aG.querySelectorAll(":enabled").length){ai.push(":enabled",":disabled")}aG.querySelectorAll("*,:x");ai.push(",.*:")})}if((ay.matchesSelector=U.test((k=u.webkitMatchesSelector||u.mozMatchesSelector||u.oMatchesSelector||u.msMatchesSelector)))){l(function(aF){ay.disconnectedMatch=k.call(aF,"div");k.call(aF,"[s!='']:x");aw.push("!=",q)})}ai=ai.length&&new RegExp(ai.join("|"));aw=aw.length&&new RegExp(aw.join("|"));e=U.test(u.compareDocumentPosition);K=e||U.test(u.contains)?function(aG,aF){var aI=aG.nodeType===9?aG.documentElement:aG,aH=aF&&aF.parentNode;return aG===aH||!!(aH&&aH.nodeType===1&&(aI.contains?aI.contains(aH):aG.compareDocumentPosition&&aG.compareDocumentPosition(aH)&16))}:function(aG,aF){if(aF){while((aF=aF.parentNode)){if(aF===aG){return true}}}return false};J=e?function(aG,aF){if(aG===aF){ac=true;return 0}var aH=!aG.compareDocumentPosition-!aF.compareDocumentPosition;if(aH){return aH}aH=(aG.ownerDocument||aG)===(aF.ownerDocument||aF)?aG.compareDocumentPosition(aF):1;if(aH&1||(!ay.sortDetached&&aF.compareDocumentPosition(aG)===aH)){if(aG===aE||aG.ownerDocument===O&&K(O,aG)){return -1}if(aF===aE||aF.ownerDocument===O&&K(O,aF)){return 1}return N?(j.call(N,aG)-j.call(N,aF)):0}return aH&4?-1:1}:function(aG,aF){if(aG===aF){ac=true;return 0}var aM,aJ=0,aL=aG.parentNode,aI=aF.parentNode,aH=[aG],aK=[aF];if(!aL||!aI){return aG===aE?-1:aF===aE?1:aL?-1:aI?1:N?(j.call(N,aG)-j.call(N,aF)):0}else{if(aL===aI){return f(aG,aF)}}aM=aG;while((aM=aM.parentNode)){aH.unshift(aM)}aM=aF;while((aM=aM.parentNode)){aK.unshift(aM)}while(aH[aJ]===aK[aJ]){aJ++}return aJ?f(aH[aJ],aK[aJ]):aH[aJ]===O?-1:aK[aJ]===O?1:0};return aE};B.matches=function(i,e){return B(i,null,null,e)};B.matchesSelector=function(aD,aF){if((aD.ownerDocument||aD)!==H){ae(aD)}aF=aF.replace(z,"='$1']");if(ay.matchesSelector&&an&&(!aw||!aw.test(aF))&&(!ai||!ai.test(aF))){try{var i=k.call(aD,aF);if(i||ay.disconnectedMatch||aD.document&&aD.document.nodeType!==11){return i}}catch(aE){}}return B(aF,H,null,[aD]).length>0};B.contains=function(e,i){if((e.ownerDocument||e)!==H){ae(e)}return K(e,i)};B.attr=function(aD,e){if((aD.ownerDocument||aD)!==H){ae(aD)}var i=t.attrHandle[e.toLowerCase()],aE=i&&T.call(t.attrHandle,e.toLowerCase())?i(aD,e,!an):undefined;return aE!==undefined?aE:ay.attributes||!an?aD.getAttribute(e):(aE=aD.getAttributeNode(e))&&aE.specified?aE.value:null};B.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)};B.uniqueSort=function(aE){var aF,aG=[],e=0,aD=0;ac=!ay.detectDuplicates;N=!ay.sortStable&&aE.slice(0);aE.sort(J);if(ac){while((aF=aE[aD++])){if(aF===aE[aD]){e=aG.push(aD)}}while(e--){aE.splice(aG[e],1)}}N=null;return aE};M=B.getText=function(aG){var aF,aD="",aE=0,e=aG.nodeType;if(!e){while((aF=aG[aE++])){aD+=M(aF)}}else{if(e===1||e===9||e===11){if(typeof aG.textContent==="string"){return aG.textContent}else{for(aG=aG.firstChild;aG;aG=aG.nextSibling){aD+=M(aG)}}}else{if(e===3||e===4){return aG.nodeValue}}}return aD};t=B.selectors={cacheLength:50,createPseudo:p,match:ah,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){e[1]=e[1].replace(y,ak);e[3]=(e[4]||e[5]||"").replace(y,ak);if(e[2]==="~="){e[3]=" "+e[3]+" "}return e.slice(0,4)},CHILD:function(e){e[1]=e[1].toLowerCase();if(e[1].slice(0,3)==="nth"){if(!e[3]){B.error(e[0])}e[4]=+(e[4]?e[5]+(e[6]||1):2*(e[3]==="even"||e[3]==="odd"));e[5]=+((e[7]+e[8])||e[3]==="odd")}else{if(e[3]){B.error(e[0])}}return e},PSEUDO:function(i){var e,aD=!i[5]&&i[2];if(ah.CHILD.test(i[0])){return null}if(i[3]&&i[4]!==undefined){i[2]=i[4]}else{if(aD&&X.test(aD)&&(e=n(aD,true))&&(e=aD.indexOf(")",aD.length-e)-aD.length)){i[0]=i[0].slice(0,e);i[2]=aD.slice(0,e)}}return i.slice(0,3)}},filter:{TAG:function(i){var e=i.replace(y,ak).toLowerCase();return i==="*"?function(){return true}:function(aD){return aD.nodeName&&aD.nodeName.toLowerCase()===e}},CLASS:function(e){var i=d[e+" "];return i||(i=new RegExp("(^|"+v+")"+e+"("+v+"|$)"))&&d(e,function(aD){return i.test(typeof aD.className==="string"&&aD.className||typeof aD.getAttribute!==au&&aD.getAttribute("class")||"")})},ATTR:function(aD,i,e){return function(aF){var aE=B.attr(aF,aD);if(aE==null){return i==="!="}if(!i){return true}aE+="";return i==="="?aE===e:i==="!="?aE!==e:i==="^="?e&&aE.indexOf(e)===0:i==="*="?e&&aE.indexOf(e)>-1:i==="$="?e&&aE.slice(-e.length)===e:i==="~="?(" "+aE+" ").indexOf(e)>-1:i==="|="?aE===e||aE.slice(0,e.length+1)===e+"-":false}},CHILD:function(i,aF,aE,aG,aD){var aI=i.slice(0,3)!=="nth",e=i.slice(-4)!=="last",aH=aF==="of-type";return aG===1&&aD===0?function(aJ){return !!aJ.parentNode}:function(aP,aN,aS){var aJ,aV,aQ,aU,aR,aM,aO=aI!==e?"nextSibling":"previousSibling",aT=aP.parentNode,aL=aH&&aP.nodeName.toLowerCase(),aK=!aS&&!aH;if(aT){if(aI){while(aO){aQ=aP;while((aQ=aQ[aO])){if(aH?aQ.nodeName.toLowerCase()===aL:aQ.nodeType===1){return false}}aM=aO=i==="only"&&!aM&&"nextSibling"}return true}aM=[e?aT.firstChild:aT.lastChild];if(e&&aK){aV=aT[ap]||(aT[ap]={});aJ=aV[i]||[];aR=aJ[0]===az&&aJ[1];aU=aJ[0]===az&&aJ[2];aQ=aR&&aT.childNodes[aR];while((aQ=++aR&&aQ&&aQ[aO]||(aU=aR=0)||aM.pop())){if(aQ.nodeType===1&&++aU&&aQ===aP){aV[i]=[az,aR,aU];break}}}else{if(aK&&(aJ=(aP[ap]||(aP[ap]={}))[i])&&aJ[0]===az){aU=aJ[1]}else{while((aQ=++aR&&aQ&&aQ[aO]||(aU=aR=0)||aM.pop())){if((aH?aQ.nodeName.toLowerCase()===aL:aQ.nodeType===1)&&++aU){if(aK){(aQ[ap]||(aQ[ap]={}))[i]=[az,aU]}if(aQ===aP){break}}}}}aU-=aD;return aU===aG||(aU%aG===0&&aU/aG>=0)}}},PSEUDO:function(aE,aD){var e,i=t.pseudos[aE]||t.setFilters[aE.toLowerCase()]||B.error("unsupported pseudo: "+aE);if(i[ap]){return i(aD)}if(i.length>1){e=[aE,aE,"",aD];return t.setFilters.hasOwnProperty(aE.toLowerCase())?p(function(aH,aJ){var aG,aF=i(aH,aD),aI=aF.length;while(aI--){aG=j.call(aH,aF[aI]);aH[aG]=!(aJ[aG]=aF[aI])}}):function(aF){return i(aF,0,e)}}return i}},pseudos:{not:p(function(e){var i=[],aD=[],aE=ab(e.replace(x,"$1"));return aE[ap]?p(function(aG,aL,aJ,aH){var aK,aF=aE(aG,null,aH,[]),aI=aG.length;while(aI--){if((aK=aF[aI])){aG[aI]=!(aL[aI]=aK)}}}):function(aH,aG,aF){i[0]=aH;aE(i,null,aF,aD);return !aD.pop()}}),has:p(function(e){return function(i){return B(e,i).length>0}}),contains:p(function(e){return function(i){return(i.textContent||i.innerText||M(i)).indexOf(e)>-1}}),lang:p(function(e){if(!Z.test(e||"")){B.error("unsupported lang: "+e)}e=e.replace(y,ak).toLowerCase();return function(aD){var i;do{if((i=an?aD.lang:aD.getAttribute("xml:lang")||aD.getAttribute("lang"))){i=i.toLowerCase();return i===e||i.indexOf(e+"-")===0}}while((aD=aD.parentNode)&&aD.nodeType===1);return false}}),target:function(e){var i=av.location&&av.location.hash;return i&&i.slice(1)===e.id},root:function(e){return e===u},focus:function(e){return e===H.activeElement&&(!H.hasFocus||H.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===false},disabled:function(e){return e.disabled===true},checked:function(e){var i=e.nodeName.toLowerCase();return(i==="input"&&!!e.checked)||(i==="option"&&!!e.selected)},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling){if(e.nodeType<6){return false}}return true},parent:function(e){return !t.pseudos.empty(e)},header:function(e){return r.test(e.nodeName)},input:function(e){return h.test(e.nodeName)},button:function(i){var e=i.nodeName.toLowerCase();return e==="input"&&i.type==="button"||e==="button"},text:function(i){var e;return i.nodeName.toLowerCase()==="input"&&i.type==="text"&&((e=i.getAttribute("type"))==null||e.toLowerCase()==="text")},first:am(function(){return[0]}),last:am(function(e,i){return[i-1]}),eq:am(function(e,aD,i){return[i<0?i+aD:i]}),even:am(function(e,aE){var aD=0;for(;aD=0;){e.push(aD)}return e}),gt:am(function(e,aF,aE){var aD=aE<0?aE+aF:aE;for(;++aD1?function(aG,aF,aD){var aE=e.length;while(aE--){if(!e[aE](aG,aF,aD)){return false}}return true}:e[0]}function E(aD,aG,aF){var aE=0,e=aG.length;for(;aE-1){aR[aT]=!(aO[aT]=aL)}}}}else{aN=af(aN===aO?aN.splice(aI,aN.length):aN);if(aG){aG(null,aO,aN,aQ)}else{b.apply(aO,aN)}}})}function aq(aI){var aD,aG,aE,aH=aI.length,aL=t.relative[aI[0].type],aM=aL||t.relative[" "],aF=aL?1:0,aJ=w(function(i){return i===aD},aM,true),aK=w(function(i){return j.call(aD,i)>-1},aM,true),e=[function(aO,aN,i){return(!aL&&(i||aN!==aC))||((aD=aN).nodeType?aJ(aO,aN,i):aK(aO,aN,i))}];for(;aF1&&aB(e),aF>1&&o(aI.slice(0,aF-1).concat({value:aI[aF-2].type===" "?"*":""})).replace(x,"$1"),aG,aF0,aF=aE.length>0,i=function(aP,aJ,aO,aN,aS){var aK,aL,aQ,aU=0,aM="0",aG=aP&&[],aV=[],aT=aC,aI=aP||aF&&t.find.TAG("*",aS),aH=(az+=aT==null?1:Math.random()||0.1),aR=aI.length;if(aS){aC=aJ!==H&&aJ}for(;aM!==aR&&(aK=aI[aM])!=null;aM++){if(aF&&aK){aL=0;while((aQ=aE[aL++])){if(aQ(aK,aJ,aO)){aN.push(aK);break}}if(aS){az=aH}}if(e){if((aK=!aQ&&aK)){aU--}if(aP){aG.push(aK)}}}aU+=aM;if(e&&aM!==aU){aL=0;while((aQ=aD[aL++])){aQ(aG,aV,aJ,aO)}if(aP){if(aU>0){while(aM--){if(!(aG[aM]||aV[aM])){aV[aM]=at.call(aN)}}}aV=af(aV)}b.apply(aN,aV);if(aS&&!aP&&aV.length>0&&(aU+aD.length)>1){B.uniqueSort(aN)}}if(aS){az=aH;aC=aT}return aG};return e?p(i):i}ab=B.compile=function(e,aE){var aF,aD=[],aH=[],aG=L[e+" "];if(!aG){if(!aE){aE=n(e)}aF=aE.length;while(aF--){aG=aq(aE[aF]);if(aG[ap]){aD.push(aG)}else{aH.push(aG)}}aG=L(e,ad(aH,aD));aG.selector=e}return aG};ax=B.select=function(aE,e,aF,aI){var aG,aL,aD,aM,aJ,aK=typeof aE==="function"&&aE,aH=!aI&&n((aE=aK.selector||aE));aF=aF||[];if(aH.length===1){aL=aH[0]=aH[0].slice(0);if(aL.length>2&&(aD=aL[0]).type==="ID"&&ay.getById&&e.nodeType===9&&an&&t.relative[aL[1].type]){e=(t.find.ID(aD.matches[0].replace(y,ak),e)||[])[0];if(!e){return aF}else{if(aK){e=e.parentNode}}aE=aE.slice(aL.shift().value.length)}aG=ah.needsContext.test(aE)?0:aL.length;while(aG--){aD=aL[aG];if(t.relative[(aM=aD.type)]){break}if((aJ=t.find[aM])){if((aI=aJ(aD.matches[0].replace(y,ak),ag.test(aL[0].type)&&Y(e.parentNode)||e))){aL.splice(aG,1);aE=aI.length&&o(aL);if(!aE){b.apply(aF,aI);return aF}break}}}}(aK||ab(aE,aH))(aI,e,!an,aF,ag.test(aE)&&Y(e.parentNode)||e);return aF};ay.sortStable=ap.split("").sort(J).join("")===ap;ay.detectDuplicates=!!ac;ae();ay.sortDetached=l(function(e){return e.compareDocumentPosition(H.createElement("div"))&1});if(!l(function(e){e.innerHTML="";return e.firstChild.getAttribute("href")==="#"})){aA("type|href|height|width",function(i,e,aD){if(!aD){return i.getAttribute(e,e.toLowerCase()==="type"?1:2)}})}if(!ay.attributes||!l(function(e){e.innerHTML="";e.firstChild.setAttribute("value","");return e.firstChild.getAttribute("value")===""})){aA("value",function(i,e,aD){if(!aD&&i.nodeName.toLowerCase()==="input"){return i.defaultValue}})}if(!l(function(e){return e.getAttribute("disabled")==null})){aA(c,function(i,e,aE){var aD;if(!aE){return i[e]===true?e.toLowerCase():(aD=i.getAttributeNode(e))&&aD.specified?aD.value:null}})}if(typeof define==="function"&&define.amd){define(function(){return B})}else{if(typeof module!=="undefined"&&module.exports){module.exports=B}else{av.Sizzle=B}}})(window);(function(){if(typeof Sizzle!=="undefined"){return}if(typeof define!=="undefined"&&define.amd){window.Sizzle=Prototype._actual_sizzle;window.define=Prototype._original_define;delete Prototype._actual_sizzle;delete Prototype._original_define}else{if(typeof module!=="undefined"&&module.exports){window.Sizzle=module.exports;module.exports={}}}})();(function(c){var d=Prototype.Selector.extendElements;function a(e,f){return d(c(e,f||document))}function b(f,e){return c.matches(e,[f]).length==1}Prototype.Selector.engine=c;Prototype.Selector.select=a;Prototype.Selector.match=b})(Sizzle);window.Sizzle=Prototype._original_property;delete Prototype._original_property;var Form={reset:function(a){a=PJS$(a);a.reset();return a},serializeElements:function(h,d){if(typeof d!="object"){d={hash:!!d}}else{if(Object.isUndefined(d.hash)){d.hash=true}}var e,g,a=false,f=d.submit,b,c;if(d.hash){c={};b=function(i,j,k){if(j in i){if(!Object.isArray(i[j])){i[j]=[i[j]]}i[j]=i[j].concat(k)}else{i[j]=k}return i}}else{c="";b=function(i,k,j){if(!Object.isArray(j)){j=[j]}if(!j.length){return i}var l=encodeURIComponent(k).gsub(/%20/,"+");return i+(i?"&":"")+j.map(function(m){m=m.gsub(/(\r)?\n/,"\r\n");m=encodeURIComponent(m);m=m.gsub(/%20/,"+");return l+"="+m}).join("&")}}return h.inject(c,function(i,j){if(!j.disabled&&j.name){e=j.name;g=PJS$(j).getValue();if(g!=null&&j.type!="file"&&(j.type!="submit"||(!a&&f!==false&&(!f||e==f)&&(a=true)))){i=b(i,e,g)}}return i})}};Form.Methods={serialize:function(b,a){return Form.serializeElements(Form.getElements(b),a)},getElements:function(e){var f=PJS$(e).getElementsByTagName("*");var d,c=[],b=Form.Element.Serializers;for(var a=0;d=f[a];a++){if(b[d.tagName.toLowerCase()]){c.push(Element.extend(d))}}return c},getInputs:function(g,c,d){g=PJS$(g);var a=g.getElementsByTagName("input");if(!c&&!d){return $A(a).map(Element.extend)}for(var e=0,h=[],f=a.length;e=0}).sortBy(function(d){return d.tabIndex}).first();return a?a:c.find(function(d){return/^(?:input|select|textarea)$/i.test(d.tagName)})},focusFirstElement:function(b){b=PJS$(b);var a=b.findFirstElement();if(a){a.activate()}return b},request:function(b,a){b=PJS$(b),a=Object.clone(a||{});var d=a.parameters,c=b.readAttribute("action")||"";if(c.blank()){c=window.location.href}a.parameters=b.serialize(true);if(d){if(Object.isString(d)){d=d.toQueryParams()}Object.extend(a.parameters,d)}if(b.hasAttribute("method")&&!a.method){a.method=b.method}return new Ajax.Request(c,a)}};Form.Element={focus:function(a){PJS$(a).focus();return a},select:function(a){PJS$(a).select();return a}};Form.Element.Methods={serialize:function(a){a=PJS$(a);if(!a.disabled&&a.name){var b=a.getValue();if(b!=undefined){var c={};c[a.name]=b;return Object.toQueryString(c)}}return""},getValue:function(a){a=PJS$(a);var b=a.tagName.toLowerCase();return Form.Element.Serializers[b](a)},setValue:function(a,b){a=PJS$(a);var c=a.tagName.toLowerCase();Form.Element.Serializers[c](a,b);return a},clear:function(a){PJS$(a).value="";return a},present:function(a){return PJS$(a).value!=""},activate:function(a){a=PJS$(a);try{a.focus();if(a.select&&(a.tagName.toLowerCase()!="input"||!(/^(?:button|reset|submit)$/i.test(a.type)))){a.select()}}catch(b){}return a},disable:function(a){a=PJS$(a);a.disabled=true;return a},enable:function(a){a=PJS$(a);a.disabled=false;return a}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers=(function(){function b(h,i){switch(h.type.toLowerCase()){case"checkbox":case"radio":return f(h,i);default:return e(h,i)}}function f(h,i){if(Object.isUndefined(i)){return h.checked?h.value:null}else{h.checked=!!i}}function e(h,i){if(Object.isUndefined(i)){return h.value}else{h.value=i}}function a(k,n){if(Object.isUndefined(n)){return(k.type==="select-one"?c:d)(k)}var j,l,o=!Object.isArray(n);for(var h=0,m=k.length;h=0?g(i.options[h]):null}function d(l){var h,m=l.length;if(!m){return null}for(var k=0,h=[];k=this.offset[1]&&c=this.offset[0]&&a=this.offset[1]&&this.ycomp=this.offset[0]&&this.xcomp0})._each(b,a)},set:function(a){this.element.className=a},add:function(a){if(this.include(a)){return}this.set($A(this).concat(a).join(" "))},remove:function(a){if(!this.include(a)){return}this.set($A(this).without(a).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);(function(){window.Selector=Class.create({initialize:function(a){this.expression=a.strip()},findElements:function(a){return Prototype.Selector.select(this.expression,a)},match:function(a){return Prototype.Selector.match(a,this.expression)},toString:function(){return this.expression},inspect:function(){return"#"}});Object.extend(Selector,{matchElements:function(f,g){var a=Prototype.Selector.match,d=[];for(var c=0,e=f.length;cn;n++)e+=(this.charAt(n)+this.charAt(n)).toLowerCase();7==this.length&&(e=this.toLowerCase())}return 7==e.length?e:arguments[0]||this},Element.collectTextNodes=function(e){return $A(PJS$(e).childNodes).collect(function(e){return 3==e.nodeType?e.nodeValue:e.hasChildNodes()?Element.collectTextNodes(e):""}).flatten().join("")},Element.collectTextNodesIgnoreClass=function(e,t){return $A(PJS$(e).childNodes).collect(function(e){return 3==e.nodeType?e.nodeValue:e.hasChildNodes()&&!Element.hasClassName(e,t)?Element.collectTextNodesIgnoreClass(e,t):""}).flatten().join("")},Element.setContentZoom=function(e,t){return e=PJS$(e),e.setStyle({fontSize:t/100+"em"}),Prototype.Browser.WebKit&&window.scrollBy(0,0),e},Element.getInlineOpacity=function(e){return PJS$(e).style.opacity||""},Element.forceRerendering=function(e){try{e=PJS$(e);var t=document.createTextNode(" ");e.appendChild(t),e.removeChild(t)}catch(n){}};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(e){return-Math.cos(e*Math.PI)/2+.5},reverse:function(e){return 1-e},flicker:function(e){var e=-Math.cos(e*Math.PI)/4+.75+Math.random()/4;return e>1?1:e},wobble:function(e){return-Math.cos(e*Math.PI*9*e)/2+.5},pulse:function(e,t){return-Math.cos(e*((t||5)-.5)*2*Math.PI)/2+.5},spring:function(e){return 1-Math.cos(4.5*e*Math.PI)*Math.exp(6*-e)},none:function(e){return 0},full:function(e){return 1}},DefaultOptions:{duration:1,fps:100,sync:!1,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(e){var t="position:relative";Prototype.Browser.IE&&(t+=";zoom:1"),e=PJS$(e),$A(e.childNodes).each(function(n){3==n.nodeType&&(n.nodeValue.toArray().each(function(i){e.insertBefore(new Element("span",{style:t}).update(" "==i?String.fromCharCode(160):i),n)}),Element.remove(n))})},multiple:function(e,t){var n;n=("object"==typeof e||Object.isFunction(e))&&e.length?e:PJS$(e).childNodes;var i=Object.extend({speed:.1,delay:0},arguments[2]||{}),o=i.delay;$A(n).each(function(e,n){new t(e,Object.extend(i,{delay:n*i.speed+o}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(e,t,n){return e=PJS$(e),t=(t||"appear").toLowerCase(),Effect[Effect.PAIRS[t][e.visible()?1:0]](e,Object.extend({queue:{position:"end",scope:e.id||"global",limit:1}},n||{}))}};if(Effect.DefaultOptions.transition=Effect.Transitions.sinoidal,Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[],this.interval=null},_each:function(e){this.effects._each(e)},add:function(e){var t=(new Date).getTime(),n=Object.isString(e.options.queue)?e.options.queue:e.options.queue.position;switch(n){case"front":this.effects.findAll(function(e){return"idle"==e.state}).each(function(t){t.startOn+=e.finishOn,t.finishOn+=e.finishOn});break;case"with-last":t=this.effects.pluck("startOn").max()||t;break;case"end":t=this.effects.pluck("finishOn").max()||t}e.startOn+=t,e.finishOn+=t,(!e.options.queue.limit||this.effects.lengtht;t++)this.effects[t]&&this.effects[t].loop(e)}}),Effect.Queues={instances:$H(),get:function(e){return Object.isString(e)?this.instances.get(e)||this.instances.set(e,new Effect.ScopedQueue):e}},Effect.Queue=Effect.Queues.get("global"),Effect.Base=Class.create({position:null,start:function(e){e&&e.transition===!1&&(e.transition=Effect.Transitions.linear),this.options=Object.extend(Object.extend({},Effect.DefaultOptions),e||{}),this.currentFrame=0,this.state="idle",this.startOn=1e3*this.options.delay,this.finishOn=this.startOn+1e3*this.options.duration,this.fromToDelta=this.options.to-this.options.from,this.totalTime=this.finishOn-this.startOn,this.totalFrames=this.options.fps*this.options.duration,this.render=function(){function e(e,t){e.options[t+"Internal"]&&e.options[t+"Internal"](e),e.options[t]&&e.options[t](e)}return function(t){"idle"===this.state&&(this.state="running",e(this,"beforeSetup"),this.setup&&this.setup(),e(this,"afterSetup")),"running"===this.state&&(t=this.options.transition(t)*this.fromToDelta+this.options.from,this.position=t,e(this,"beforeUpdate"),this.update&&this.update(t),e(this,"afterUpdate"))}}(),this.event("beforeStart"),this.options.sync||Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this)},loop:function(e){if(e>=this.startOn){if(e>=this.finishOn)return this.render(1),this.cancel(),this.event("beforeFinish"),this.finish&&this.finish(),void this.event("afterFinish");var t=(e-this.startOn)/this.totalTime,n=(t*this.totalFrames).round();n>this.currentFrame&&(this.render(t),this.currentFrame=n)}},cancel:function(){this.options.sync||Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this),this.state="finished"},event:function(e){this.options[e+"Internal"]&&this.options[e+"Internal"](this),this.options[e]&&this.options[e](this)},inspect:function(){var e=$H();for(property in this)Object.isFunction(this[property])||e.set(property,this[property]);return"#"}}),Effect.Parallel=Class.create(Effect.Base,{initialize:function(e){this.effects=e||[],this.start(arguments[1])},update:function(e){this.effects.invoke("render",e)},finish:function(e){this.effects.each(function(t){t.render(1),t.cancel(),t.event("beforeFinish"),t.finish&&t.finish(e),t.event("afterFinish")})}}),Effect.Tween=Class.create(Effect.Base,{initialize:function(e,t,n){e=Object.isString(e)?PJS$(e):e;var i=$A(arguments),o=i.last(),s=5==i.length?i[3]:null;this.method=Object.isFunction(o)?o.bind(e):Object.isFunction(e[o])?e[o].bind(e):function(t){e[o]=t},this.start(Object.extend({from:t,to:n},s||{}))},update:function(e){this.method(e)}}),Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))},update:Prototype.emptyFunction}),Effect.Opacity=Class.create(Effect.Base,{initialize:function(e){if(this.element=PJS$(e),!this.element)throw Effect._elementDoesNotExistError;Prototype.Browser.IE&&!this.element.currentStyle.hasLayout&&this.element.setStyle({zoom:1});var t=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(t)},update:function(e){this.element.setOpacity(e)}}),Effect.Move=Class.create(Effect.Base,{initialize:function(e){if(this.element=PJS$(e),!this.element)throw Effect._elementDoesNotExistError;var t=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(t)},setup:function(){this.element.makePositioned(),this.originalLeft=parseFloat(this.element.getStyle("left")||"0"),this.originalTop=parseFloat(this.element.getStyle("top")||"0"),"absolute"==this.options.mode&&(this.options.x=this.options.x-this.originalLeft,this.options.y=this.options.y-this.originalTop)},update:function(e){this.element.setStyle({left:(this.options.x*e+this.originalLeft).round()+"px",top:(this.options.y*e+this.originalTop).round()+"px"})}}),Effect.MoveBy=function(e,t,n){return new Effect.Move(e,Object.extend({x:n,y:t},arguments[3]||{}))},Effect.Scale=Class.create(Effect.Base,{initialize:function(e,t){if(this.element=PJS$(e),!this.element)throw Effect._elementDoesNotExistError;var n=Object.extend({scaleX:!0,scaleY:!0,scaleContent:!0,scaleFromCenter:!1,scaleMode:"box",scaleFrom:100,scaleTo:t},arguments[2]||{});this.start(n)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||!1,this.elementPositioning=this.element.getStyle("position"),this.originalStyle={},["top","left","width","height","fontSize"].each(function(e){this.originalStyle[e]=this.element.style[e]}.bind(this)),this.originalTop=this.element.offsetTop,this.originalLeft=this.element.offsetLeft;var e=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(t){e.indexOf(t)>0&&(this.fontSize=parseFloat(e),this.fontSizeType=t)}.bind(this)),this.factor=(this.options.scaleTo-this.options.scaleFrom)/100,this.dims=null,"box"==this.options.scaleMode&&(this.dims=[this.element.offsetHeight,this.element.offsetWidth]),/^content/.test(this.options.scaleMode)&&(this.dims=[this.element.scrollHeight,this.element.scrollWidth]),this.dims||(this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth])},update:function(e){var t=this.options.scaleFrom/100+this.factor*e;this.options.scaleContent&&this.fontSize&&this.element.setStyle({fontSize:this.fontSize*t+this.fontSizeType}),this.setDimensions(this.dims[0]*t,this.dims[1]*t)},finish:function(e){this.restoreAfterFinish&&this.element.setStyle(this.originalStyle)},setDimensions:function(e,t){var n={};if(this.options.scaleX&&(n.width=t.round()+"px"),this.options.scaleY&&(n.height=e.round()+"px"),this.options.scaleFromCenter){var i=(e-this.dims[0])/2,o=(t-this.dims[1])/2;"absolute"==this.elementPositioning?(this.options.scaleY&&(n.top=this.originalTop-i+"px"),this.options.scaleX&&(n.left=this.originalLeft-o+"px")):(this.options.scaleY&&(n.top=-i+"px"),this.options.scaleX&&(n.left=-o+"px"))}this.element.setStyle(n)}}),Effect.Highlight=Class.create(Effect.Base,{initialize:function(e){if(this.element=PJS$(e),!this.element)throw Effect._elementDoesNotExistError;var t=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(t)},setup:function(){return"none"==this.element.getStyle("display")?void this.cancel():(this.oldStyle={},this.options.keepBackgroundImage||(this.oldStyle.backgroundImage=this.element.getStyle("background-image"),this.element.setStyle({backgroundImage:"none"})),this.options.endcolor||(this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")),this.options.restorecolor||(this.options.restorecolor=this.element.getStyle("background-color")),this._base=$R(0,2).map(function(e){return parseInt(this.options.startcolor.slice(2*e+1,2*e+3),16)}.bind(this)),void(this._delta=$R(0,2).map(function(e){return parseInt(this.options.endcolor.slice(2*e+1,2*e+3),16)-this._base[e]}.bind(this))))},update:function(e){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(t,n,i){return t+(this._base[i]+this._delta[i]*e).round().toColorPart()}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}}),Effect.ScrollTo=function(e){var t=arguments[1]||{},n=document.viewport.getScrollOffsets(),i=PJS$(e).cumulativeOffset();return t.offset&&(i[1]+=t.offset),new Effect.Tween(null,n.top,i[1],t,function(e){scrollTo(n.left,e.round())})},Effect.Fade=function(e){e=PJS$(e);var t=e.getInlineOpacity(),n=Object.extend({from:e.getOpacity()||1,to:0,afterFinishInternal:function(e){0==e.options.to&&e.element.hide().setStyle({opacity:t})}},arguments[1]||{});return new Effect.Opacity(e,n)},Effect.Appear=function(e){e=PJS$(e);var t=Object.extend({from:"none"==e.getStyle("display")?0:e.getOpacity()||0,to:1,afterFinishInternal:function(e){e.element.forceRerendering()},beforeSetup:function(e){e.element.setOpacity(e.options.from).show()}},arguments[1]||{});return new Effect.Opacity(e,t)},Effect.Puff=function(e){e=PJS$(e);var t={opacity:e.getInlineOpacity(),position:e.getStyle("position"),top:e.style.top,left:e.style.left,width:e.style.width,height:e.style.height};return new Effect.Parallel([new Effect.Scale(e,200,{sync:!0,scaleFromCenter:!0,scaleContent:!0,restoreAfterFinish:!0}),new Effect.Opacity(e,{sync:!0,to:0})],Object.extend({duration:1,beforeSetupInternal:function(e){Position.absolutize(e.effects[0].element)},afterFinishInternal:function(e){e.effects[0].element.hide().setStyle(t)}},arguments[1]||{}))},Effect.BlindUp=function(e){return e=PJS$(e),e.makeClipping(),new Effect.Scale(e,0,Object.extend({scaleContent:!1,scaleX:!1,restoreAfterFinish:!0,afterFinishInternal:function(e){e.element.hide().undoClipping()}},arguments[1]||{}))},Effect.BlindDown=function(e){e=PJS$(e);var t=e.getDimensions();return new Effect.Scale(e,100,Object.extend({scaleContent:!1,scaleX:!1,scaleFrom:0,scaleMode:{originalHeight:t.height,originalWidth:t.width},restoreAfterFinish:!0,afterSetup:function(e){e.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(e){e.element.undoClipping()}},arguments[1]||{}))},Effect.SwitchOff=function(e){e=PJS$(e);var t=e.getInlineOpacity();return new Effect.Appear(e,Object.extend({duration:.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(e){new Effect.Scale(e.element,1,{duration:.3,scaleFromCenter:!0,scaleX:!1,scaleContent:!1,restoreAfterFinish:!0,beforeSetup:function(e){e.element.makePositioned().makeClipping()},afterFinishInternal:function(e){e.element.hide().undoClipping().undoPositioned().setStyle({opacity:t})}})}},arguments[1]||{}))},Effect.DropOut=function(e){e=PJS$(e);var t={top:e.getStyle("top"),left:e.getStyle("left"),opacity:e.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(e,{x:0,y:100,sync:!0}),new Effect.Opacity(e,{sync:!0,to:0})],Object.extend({duration:.5,beforeSetup:function(e){e.effects[0].element.makePositioned()},afterFinishInternal:function(e){e.effects[0].element.hide().undoPositioned().setStyle(t)}},arguments[1]||{}))},Effect.Shake=function(e){e=PJS$(e);var t=Object.extend({distance:20,duration:.5},arguments[1]||{}),n=parseFloat(t.distance),i=parseFloat(t.duration)/10,o={top:e.getStyle("top"),left:e.getStyle("left")};return new Effect.Move(e,{x:n,y:0,duration:i,afterFinishInternal:function(e){new Effect.Move(e.element,{x:2*-n,y:0,duration:2*i,afterFinishInternal:function(e){new Effect.Move(e.element,{x:2*n,y:0,duration:2*i,afterFinishInternal:function(e){new Effect.Move(e.element,{x:2*-n,y:0,duration:2*i,afterFinishInternal:function(e){new Effect.Move(e.element,{x:2*n,y:0,duration:2*i,afterFinishInternal:function(e){new Effect.Move(e.element,{x:-n,y:0,duration:i,afterFinishInternal:function(e){e.element.undoPositioned().setStyle(o)}})}})}})}})}})}})},Effect.SlideDown=function(e){e=PJS$(e).cleanWhitespace();var t=e.down().getStyle("bottom"),n=e.getDimensions();return new Effect.Scale(e,100,Object.extend({scaleContent:!1,scaleX:!1,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:n.height,originalWidth:n.width},restoreAfterFinish:!0,afterSetup:function(e){e.element.makePositioned(),e.element.down().makePositioned(),window.opera&&e.element.setStyle({top:""}),e.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(e){e.element.down().setStyle({bottom:e.dims[0]-e.element.clientHeight+"px"})},afterFinishInternal:function(e){e.element.undoClipping().undoPositioned(),e.element.down().undoPositioned().setStyle({bottom:t})}},arguments[1]||{}))},Effect.SlideUp=function(e){e=PJS$(e).cleanWhitespace();var t=e.down().getStyle("bottom"),n=e.getDimensions();return new Effect.Scale(e,window.opera?0:1,Object.extend({scaleContent:!1,scaleX:!1,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:n.height,originalWidth:n.width},restoreAfterFinish:!0,afterSetup:function(e){e.element.makePositioned(),e.element.down().makePositioned(),window.opera&&e.element.setStyle({top:""}),e.element.makeClipping().show()},afterUpdateInternal:function(e){e.element.down().setStyle({bottom:e.dims[0]-e.element.clientHeight+"px"})},afterFinishInternal:function(e){e.element.hide().undoClipping().undoPositioned(),e.element.down().undoPositioned().setStyle({bottom:t})}},arguments[1]||{}))},Effect.Squish=function(e){return new Effect.Scale(e,window.opera?1:0,{restoreAfterFinish:!0,beforeSetup:function(e){e.element.makeClipping()},afterFinishInternal:function(e){e.element.hide().undoClipping()}})},Effect.Grow=function(e){e=PJS$(e);var t=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{}),n={top:e.style.top,left:e.style.left,height:e.style.height,width:e.style.width,opacity:e.getInlineOpacity()},i=e.getDimensions(),o,s,r,l;switch(t.direction){case"top-left":o=s=r=l=0;break;case"top-right":o=i.width,s=l=0,r=-i.width;break;case"bottom-left":o=r=0,s=i.height,l=-i.height;break;case"bottom-right":o=i.width,s=i.height,r=-i.width,l=-i.height;break;case"center":o=i.width/2,s=i.height/2,r=-i.width/2,l=-i.height/2}return new Effect.Move(e,{x:o,y:s,duration:.01,beforeSetup:function(e){e.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(e){new Effect.Parallel([new Effect.Opacity(e.element,{sync:!0,to:1,from:0,transition:t.opacityTransition}),new Effect.Move(e.element,{x:r,y:l,sync:!0,transition:t.moveTransition}),new Effect.Scale(e.element,100,{scaleMode:{originalHeight:i.height,originalWidth:i.width},sync:!0,scaleFrom:window.opera?1:0,transition:t.scaleTransition,restoreAfterFinish:!0})],Object.extend({beforeSetup:function(e){e.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(e){e.effects[0].element.undoClipping().undoPositioned().setStyle(n)}},t))}})},Effect.Shrink=function(e){e=PJS$(e);var t=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{}),n={top:e.style.top,left:e.style.left,height:e.style.height,width:e.style.width,opacity:e.getInlineOpacity()},i=e.getDimensions(),o,s;switch(t.direction){case"top-left":o=s=0;break;case"top-right":o=i.width,s=0;break;case"bottom-left":o=0,s=i.height;break;case"bottom-right":o=i.width,s=i.height;break;case"center":o=i.width/2,s=i.height/2}return new Effect.Parallel([new Effect.Opacity(e,{sync:!0,to:0,from:1,transition:t.opacityTransition}),new Effect.Scale(e,window.opera?1:0,{sync:!0,transition:t.scaleTransition,restoreAfterFinish:!0}),new Effect.Move(e,{x:o,y:s,sync:!0,transition:t.moveTransition})],Object.extend({beforeStartInternal:function(e){e.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(e){e.effects[0].element.hide().undoClipping().undoPositioned().setStyle(n)}},t))},Effect.Pulsate=function(e){e=PJS$(e);var t=arguments[1]||{},n=e.getInlineOpacity(),i=t.transition||Effect.Transitions.linear,o=function(e){return 1-i(-Math.cos(e*(t.pulses||5)*2*Math.PI)/2+.5)};return new Effect.Opacity(e,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(e){e.element.setStyle({opacity:n})}},t),{transition:o}))},Effect.Fold=function(e){e=PJS$(e);var t={top:e.style.top,left:e.style.left,width:e.style.width,height:e.style.height};return e.makeClipping(),new Effect.Scale(e,5,Object.extend({scaleContent:!1,scaleX:!1,afterFinishInternal:function(n){new Effect.Scale(e,1,{scaleContent:!1,scaleY:!1,afterFinishInternal:function(e){e.element.hide().undoClipping().setStyle(t)}})}},arguments[1]||{}))},Effect.Morph=Class.create(Effect.Base,{initialize:function(e){if(this.element=PJS$(e),!this.element)throw Effect._elementDoesNotExistError;var t=Object.extend({style:{}},arguments[1]||{});if(Object.isString(t.style))if(t.style.include(":"))this.style=t.style.parseStyle();else{this.element.addClassName(t.style),this.style=$H(this.element.getStyles()),this.element.removeClassName(t.style);var n=this.element.getStyles();this.style=this.style.reject(function(e){return e.value==n[e.key]}),t.afterFinishInternal=function(e){e.element.addClassName(e.options.style),e.transforms.each(function(t){e.element.style[t.style]=""})}}else this.style=$H(t.style);this.start(t)},setup:function(){function e(e){return(!e||["rgba(0, 0, 0, 0)","transparent"].include(e))&&(e="#ffffff"),e=e.parseColor(),$R(0,2).map(function(t){return parseInt(e.slice(2*t+1,2*t+3),16)})}this.transforms=this.style.map(function(t){var n=t[0],i=t[1],o=null;if("#zzzzzz"!=i.parseColor("#zzzzzz"))i=i.parseColor(),o="color";else if("opacity"==n)i=parseFloat(i),Prototype.Browser.IE&&!this.element.currentStyle.hasLayout&&this.element.setStyle({zoom:1});else if(Element.CSS_LENGTH.test(i)){var s=i.match(/^([\+\-]?[0-9\.]+)(.*)$/);i=parseFloat(s[1]),o=3==s.length?s[2]:null}var r=this.element.getStyle(n);return{style:n.camelize(),originalValue:"color"==o?e(r):parseFloat(r||0),targetValue:"color"==o?e(i):i,unit:o}}.bind(this)).reject(function(e){return e.originalValue==e.targetValue||"color"!=e.unit&&(isNaN(e.originalValue)||isNaN(e.targetValue))})},update:function(e){for(var t={},n,i=this.transforms.length;i--;)t[(n=this.transforms[i]).style]="color"==n.unit?"#"+Math.round(n.originalValue[0]+(n.targetValue[0]-n.originalValue[0])*e).toColorPart()+Math.round(n.originalValue[1]+(n.targetValue[1]-n.originalValue[1])*e).toColorPart()+Math.round(n.originalValue[2]+(n.targetValue[2]-n.originalValue[2])*e).toColorPart():(n.originalValue+(n.targetValue-n.originalValue)*e).toFixed(3)+(null===n.unit?"":n.unit);this.element.setStyle(t,!0)}}),Effect.Transform=Class.create({initialize:function(e){this.tracks=[],this.options=arguments[1]||{},this.addTracks(e)},addTracks:function(e){return e.each(function(e){e=$H(e);var t=e.values().first();this.tracks.push($H({ids:e.keys().first(),effect:Effect.Morph,options:{style:t}}))}.bind(this)),this},play:function(){return new Effect.Parallel(this.tracks.map(function(e){var t=e.get("ids"),n=e.get("effect"),i=e.get("options"),o=[PJS$(t)||$PJS$(t)].flatten();return o.map(function(e){return new n(e,Object.extend({sync:!0},i))})}).flatten(),this.options)}}),Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex"),Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/,String.__parseStyleElement=document.createElement("div"),String.prototype.parseStyle=function(){var e,t=$H();return Prototype.Browser.WebKit?e=new Element("div",{style:this}).style:(String.__parseStyleElement.innerHTML='
',e=String.__parseStyleElement.childNodes[0].style),Element.CSS_PROPERTIES.each(function(n){e[n]&&t.set(n,e[n])}),Prototype.Browser.IE&&this.include("opacity")&&t.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]),t},Element.getStyles=document.defaultView&&document.defaultView.getComputedStyle?function(e){var t=document.defaultView.getComputedStyle(PJS$(e),null);return Element.CSS_PROPERTIES.inject({},function(e,n){return e[n]=t[n],e})}:function(e){e=PJS$(e);var t=e.currentStyle,n;return n=Element.CSS_PROPERTIES.inject({},function(e,n){return e[n]=t[n],e}),n.opacity||(n.opacity=e.getOpacity()),n},Effect.Methods={morph:function(e,t){return e=PJS$(e),new Effect.Morph(e,Object.extend({style:t},arguments[2]||{})),e},visualEffect:function(e,t,n){e=PJS$(e);var i=t.dasherize().camelize(),o=i.charAt(0).toUpperCase()+i.substring(1);return new Effect[o](e,n),e},highlight:function(e,t){return e=PJS$(e),new Effect.Highlight(e,t),e}},$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(e){Effect.Methods[e]=function(t,n){return t=PJS$(t),Effect[e.charAt(0).toUpperCase()+e.substring(1)](t,n),t}}),$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(e){Effect.Methods[e]=Element[e]}),Element.addMethods(Effect.Methods),Object.isUndefined(Effect))throw"dragdrop.js requires including script.aculo.us' effects.js library";var Droppables={drops:[],remove:function(e){this.drops=this.drops.reject(function(t){return t.element==PJS$(e)})},add:function(e){e=PJS$(e);var t=Object.extend({greedy:!0,hoverclass:null,tree:!1},arguments[1]||{});if(t.containment){t._containers=[];var n=t.containment;Object.isArray(n)?n.each(function(e){t._containers.push(PJS$(e))}):t._containers.push(PJS$(n))}t.accept&&(t.accept=[t.accept].flatten()),Element.makePositioned(e),t.element=e,this.drops.push(t)},findDeepestChild:function(e){for(deepest=e[0],i=1;i0&&(n=Droppables.findDeepestChild(i)),this.last_active&&this.last_active!=n&&this.deactivate(this.last_active),n&&(Position.within(n.element,e[0],e[1]),n.onHover&&n.onHover(t,n.element,Position.overlap(n.overlap,n.element)),n!=this.last_active&&Droppables.activate(n))}},fire:function(e,t){return this.last_active?(Position.prepare(),this.isAffected([Event.pointerX(e),Event.pointerY(e)],t,this.last_active)&&this.last_active.onDrop?(this.last_active.onDrop(t,this.last_active.element,e),!0):void 0):void 0},reset:function(){this.last_active&&this.deactivate(this.last_active)}},Draggables={drags:[],observers:[],register:function(e){0==this.drags.length&&(this.eventMouseUp=this.endDrag.bindAsEventListener(this),this.eventMouseMove=this.updateDrag.bindAsEventListener(this),this.eventKeypress=this.keyPress.bindAsEventListener(this),Event.observe(document,"mouseup",this.eventMouseUp),Event.observe(document,"mousemove",this.eventMouseMove),Event.observe(document,"keypress",this.eventKeypress)),this.drags.push(e)},unregister:function(e){this.drags=this.drags.reject(function(t){return t==e}),0==this.drags.length&&(Event.stopObserving(document,"mouseup",this.eventMouseUp),Event.stopObserving(document,"mousemove",this.eventMouseMove),Event.stopObserving(document,"keypress",this.eventKeypress))},activate:function(e){e.options.delay?this._timeout=setTimeout(function(){Draggables._timeout=null,window.focus(),Draggables.activeDraggable=e}.bind(this),e.options.delay):(window.focus(),this.activeDraggable=e)},deactivate:function(){this.activeDraggable=null},updateDrag:function(e){if(this.activeDraggable){var t=[Event.pointerX(e),Event.pointerY(e)];this._lastPointer&&this._lastPointer.inspect()==t.inspect()||(this._lastPointer=t,this.activeDraggable.updateDrag(e,t))}},endDrag:function(e){this._timeout&&(clearTimeout(this._timeout),this._timeout=null),this.activeDraggable&&(this._lastPointer=null,this.activeDraggable.endDrag(e),this.activeDraggable=null)},keyPress:function(e){this.activeDraggable&&this.activeDraggable.keyPress(e)},addObserver:function(e){this.observers.push(e),this._cacheObserverCallbacks()},removeObserver:function(e){this.observers=this.observers.reject(function(t){return t.element==e}),this._cacheObserverCallbacks()},notify:function(e,t,n){this[e+"Count"]>0&&this.observers.each(function(i){i[e]&&i[e](e,t,n)}),t.options[e]&&t.options[e](t,n)},_cacheObserverCallbacks:function(){["onStart","onEnd","onDrag"].each(function(e){Draggables[e+"Count"]=Draggables.observers.select(function(t){return t[e]}).length})}},Draggable=Class.create({initialize:function(e){var t={handle:!1,reverteffect:function(e,t,n){var i=.02*Math.sqrt(Math.abs(2^t)+Math.abs(2^n));new Effect.Move(e,{x:-n,y:-t,duration:i,queue:{scope:"_draggable",position:"end"}})},endeffect:function(e){var t=Object.isNumber(e._opacity)?e._opacity:1;new Effect.Opacity(e,{duration:.2,from:.7,to:t,queue:{scope:"_draggable",position:"end"},afterFinish:function(){Draggable._dragging[e]=!1}})},zindex:1e3,revert:!1,quiet:!1,scroll:!1,scrollSensitivity:20,scrollSpeed:15,snap:!1,delay:0};(!arguments[1]||Object.isUndefined(arguments[1].endeffect))&&Object.extend(t,{starteffect:function(e){e._opacity=Element.getOpacity(e),Draggable._dragging[e]=!0,new Effect.Opacity(e,{duration:.2,from:e._opacity,to:.7})}});var n=Object.extend(t,arguments[1]||{});this.element=PJS$(e),n.handle&&Object.isString(n.handle)&&(this.handle=this.element.down("."+n.handle,0)),this.handle||(this.handle=PJS$(n.handle)),this.handle||(this.handle=this.element),!n.scroll||n.scroll.scrollTo||n.scroll.outerHTML||(n.scroll=PJS$(n.scroll),this._isScrollChild=Element.childOf(this.element,n.scroll)),Element.makePositioned(this.element),this.options=n,this.dragging=!1,this.eventMouseDown=this.initDrag.bindAsEventListener(this),Event.observe(this.handle,"mousedown",this.eventMouseDown),Draggables.register(this)},destroy:function(){Event.stopObserving(this.handle,"mousedown",this.eventMouseDown),Draggables.unregister(this)},currentDelta:function(){return[parseInt(Element.getStyle(this.element,"left")||"0"),parseInt(Element.getStyle(this.element,"top")||"0")]},initDrag:function(e){if((Object.isUndefined(Draggable._dragging[this.element])||!Draggable._dragging[this.element])&&Event.isLeftClick(e)){var t=Event.element(e);if((tag_name=t.tagName.toUpperCase())&&("INPUT"==tag_name||"SELECT"==tag_name||"OPTION"==tag_name||"BUTTON"==tag_name||"TEXTAREA"==tag_name))return;var n=[Event.pointerX(e),Event.pointerY(e)],i=this.element.cumulativeOffset();this.offset=[0,1].map(function(e){return n[e]-i[e]}),Draggables.activate(this),Event.stop(e)}},startDrag:function(e){if(this.dragging=!0,this.delta||(this.delta=this.currentDelta()),this.options.zindex&&(this.originalZ=parseInt(Element.getStyle(this.element,"z-index")||0),this.element.style.zIndex=this.options.zindex),this.options.ghosting&&(this._clone=this.element.cloneNode(!0),this._originallyAbsolute="absolute"==this.element.getStyle("position"),this._originallyAbsolute||Position.absolutize(this.element),this.element.parentNode.insertBefore(this._clone,this.element)),this.options.scroll)if(this.options.scroll==window){var t=this._getWindowScroll(this.options.scroll);this.originalScrollLeft=t.left,this.originalScrollTop=t.top}else this.originalScrollLeft=this.options.scroll.scrollLeft,this.originalScrollTop=this.options.scroll.scrollTop;Draggables.notify("onStart",this,e),this.options.starteffect&&this.options.starteffect(this.element)},updateDrag:function(event,pointer){if(this.dragging||this.startDrag(event),this.options.quiet||(Position.prepare(),Droppables.show(pointer,this.element)),Draggables.notify("onDrag",this,event),this.draw(pointer),this.options.change&&this.options.change(this),this.options.scroll){this.stopScrolling();var p;if(this.options.scroll==window)with(this._getWindowScroll(this.options.scroll))p=[left,top,left+width,top+height];else p=Position.page(this.options.scroll).toArray(),p[0]+=this.options.scroll.scrollLeft+Position.deltaX,p[1]+=this.options.scroll.scrollTop+Position.deltaY,p.push(p[0]+this.options.scroll.offsetWidth),p.push(p[1]+this.options.scroll.offsetHeight);var speed=[0,0];pointer[0]p[2]-this.options.scrollSensitivity&&(speed[0]=pointer[0]-(p[2]-this.options.scrollSensitivity)),pointer[1]>p[3]-this.options.scrollSensitivity&&(speed[1]=pointer[1]-(p[3]-this.options.scrollSensitivity)),this.startScrolling(speed) -}Prototype.Browser.WebKit&&window.scrollBy(0,0),Event.stop(event)},finishDrag:function(e,t){if(this.dragging=!1,this.options.quiet){Position.prepare();var n=[Event.pointerX(e),Event.pointerY(e)];Droppables.show(n,this.element)}this.options.ghosting&&(this._originallyAbsolute||Position.relativize(this.element),delete this._originallyAbsolute,Element.remove(this._clone),this._clone=null);var i=!1;t&&(i=Droppables.fire(e,this.element),i||(i=!1)),i&&this.options.onDropped&&this.options.onDropped(this.element),Draggables.notify("onEnd",this,e);var o=this.options.revert;o&&Object.isFunction(o)&&(o=o(this.element));var s=this.currentDelta();o&&this.options.reverteffect?(0==i||"failure"!=o)&&this.options.reverteffect(this.element,s[1]-this.delta[1],s[0]-this.delta[0]):this.delta=s,this.options.zindex&&(this.element.style.zIndex=this.originalZ),this.options.endeffect&&this.options.endeffect(this.element),Draggables.deactivate(this),Droppables.reset()},keyPress:function(e){e.keyCode==Event.KEY_ESC&&(this.finishDrag(e,!1),Event.stop(e))},endDrag:function(e){this.dragging&&(this.stopScrolling(),this.finishDrag(e,!0),Event.stop(e))},draw:function(e){var t=this.element.cumulativeOffset();if(this.options.ghosting){var n=Position.realOffset(this.element);t[0]+=n[0]-Position.deltaX,t[1]+=n[1]-Position.deltaY}var i=this.currentDelta();t[0]-=i[0],t[1]-=i[1],this.options.scroll&&this.options.scroll!=window&&this._isScrollChild&&(t[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft,t[1]-=this.options.scroll.scrollTop-this.originalScrollTop);var o=[0,1].map(function(n){return e[n]-t[n]-this.offset[n]}.bind(this));this.options.snap&&(o=Object.isFunction(this.options.snap)?this.options.snap(o[0],o[1],this):o.map(Object.isArray(this.options.snap)?function(e,t){return(e/this.options.snap[t]).round()*this.options.snap[t]}.bind(this):function(e){return(e/this.options.snap).round()*this.options.snap}.bind(this)));var s=this.element.style;this.options.constraint&&"horizontal"!=this.options.constraint||(s.left=o[0]+"px"),this.options.constraint&&"vertical"!=this.options.constraint||(s.top=o[1]+"px"),"hidden"==s.visibility&&(s.visibility="")},stopScrolling:function(){this.scrollInterval&&(clearInterval(this.scrollInterval),this.scrollInterval=null,Draggables._lastScrollPointer=null)},startScrolling:function(e){(e[0]||e[1])&&(this.scrollSpeed=[e[0]*this.options.scrollSpeed,e[1]*this.options.scrollSpeed],this.lastScrolled=new Date,this.scrollInterval=setInterval(this.scroll.bind(this),10))},scroll:function(){var current=new Date,delta=current-this.lastScrolled;if(this.lastScrolled=current,this.options.scroll==window){with(this._getWindowScroll(this.options.scroll))if(this.scrollSpeed[0]||this.scrollSpeed[1]){var d=delta/1e3;this.options.scroll.scrollTo(left+d*this.scrollSpeed[0],top+d*this.scrollSpeed[1])}}else this.options.scroll.scrollLeft+=this.scrollSpeed[0]*delta/1e3,this.options.scroll.scrollTop+=this.scrollSpeed[1]*delta/1e3;Position.prepare(),Droppables.show(Draggables._lastPointer,this.element),Draggables.notify("onDrag",this),this._isScrollChild&&(Draggables._lastScrollPointer=Draggables._lastScrollPointer||$A(Draggables._lastPointer),Draggables._lastScrollPointer[0]+=this.scrollSpeed[0]*delta/1e3,Draggables._lastScrollPointer[1]+=this.scrollSpeed[1]*delta/1e3,Draggables._lastScrollPointer[0]<0&&(Draggables._lastScrollPointer[0]=0),Draggables._lastScrollPointer[1]<0&&(Draggables._lastScrollPointer[1]=0),this.draw(Draggables._lastScrollPointer)),this.options.change&&this.options.change(this)},_getWindowScroll:function(w){var T,L,W,H;with(w.document)w.document.documentElement&&documentElement.scrollTop?(T=documentElement.scrollTop,L=documentElement.scrollLeft):w.document.body&&(T=body.scrollTop,L=body.scrollLeft),w.innerWidth?(W=w.innerWidth,H=w.innerHeight):w.document.documentElement&&documentElement.clientWidth?(W=documentElement.clientWidth,H=documentElement.clientHeight):(W=body.offsetWidth,H=body.offsetHeight);return{top:T,left:L,width:W,height:H}}});Draggable._dragging={};var SortableObserver=Class.create({initialize:function(e,t){this.element=PJS$(e),this.observer=t,this.lastValue=Sortable.serialize(this.element)},onStart:function(){this.lastValue=Sortable.serialize(this.element)},onEnd:function(){Sortable.unmark(),this.lastValue!=Sortable.serialize(this.element)&&this.observer(this.element)}}),Sortable={SERIALIZE_RULE:/^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,sortables:{},_findRootElement:function(e){for(;"BODY"!=e.tagName.toUpperCase();){if(e.id&&Sortable.sortables[e.id])return e;e=e.parentNode}},options:function(e){return(e=Sortable._findRootElement(PJS$(e)))?Sortable.sortables[e.id]:void 0},destroy:function(e){e=PJS$(e);var t=Sortable.sortables[e.id];t&&(Draggables.removeObserver(t.element),t.droppables.each(function(e){Droppables.remove(e)}),t.draggables.invoke("destroy"),delete Sortable.sortables[t.element.id])},create:function(e){e=PJS$(e);var t=Object.extend({element:e,tag:"li",dropOnEmpty:!1,tree:!1,treeTag:"ul",overlap:"vertical",constraint:"vertical",containment:e,handle:!1,only:!1,delay:0,hoverclass:null,ghosting:!1,quiet:!1,scroll:!1,scrollSensitivity:20,scrollSpeed:15,format:this.SERIALIZE_RULE,elements:!1,handles:!1,onChange:Prototype.emptyFunction,onUpdate:Prototype.emptyFunction},arguments[1]||{});this.destroy(e);var n={revert:!0,quiet:t.quiet,scroll:t.scroll,scrollSpeed:t.scrollSpeed,scrollSensitivity:t.scrollSensitivity,delay:t.delay,ghosting:t.ghosting,constraint:t.constraint,handle:t.handle};t.starteffect&&(n.starteffect=t.starteffect),t.reverteffect?n.reverteffect=t.reverteffect:t.ghosting&&(n.reverteffect=function(e){e.style.top=0,e.style.left=0}),t.endeffect&&(n.endeffect=t.endeffect),t.zindex&&(n.zindex=t.zindex);var i={overlap:t.overlap,containment:t.containment,tree:t.tree,hoverclass:t.hoverclass,onHover:Sortable.onHover},o={onHover:Sortable.onEmptyHover,overlap:t.overlap,containment:t.containment,hoverclass:t.hoverclass};Element.cleanWhitespace(e),t.draggables=[],t.droppables=[],(t.dropOnEmpty||t.tree)&&(Droppables.add(e,o),t.droppables.push(e)),(t.elements||this.findElements(e,t)||[]).each(function(o,s){var r=t.handles?PJS$(t.handles[s]):t.handle?PJS$(o).select("."+t.handle)[0]:o;t.draggables.push(new Draggable(o,Object.extend(n,{handle:r}))),Droppables.add(o,i),t.tree&&(o.treeNode=e),t.droppables.push(o)}),t.tree&&(Sortable.findTreeElements(e,t)||[]).each(function(n){Droppables.add(n,o),n.treeNode=e,t.droppables.push(n)}),this.sortables[e.identify()]=t,Draggables.addObserver(new SortableObserver(e,t.onUpdate))},findElements:function(e,t){return Element.findChildren(e,t.only,t.tree?!0:!1,t.tag)},findTreeElements:function(e,t){return Element.findChildren(e,t.only,t.tree?!0:!1,t.treeTag)},onHover:function(e,t,n){if(!(Element.isParent(t,e)||n>.33&&.66>n&&Sortable.options(t).tree))if(n>.5){if(Sortable.mark(t,"before"),t.previousSibling!=e){var i=e.parentNode;e.style.visibility="hidden",t.parentNode.insertBefore(e,t),t.parentNode!=i&&Sortable.options(i).onChange(e),Sortable.options(t.parentNode).onChange(e)}}else{Sortable.mark(t,"after");var o=t.nextSibling||null;if(o!=e){var i=e.parentNode;e.style.visibility="hidden",t.parentNode.insertBefore(e,o),t.parentNode!=i&&Sortable.options(i).onChange(e),Sortable.options(t.parentNode).onChange(e)}}},onEmptyHover:function(e,t,n){var i=e.parentNode,o=Sortable.options(t);if(!Element.isParent(t,e)){var s,r=Sortable.findElements(t,{tag:o.tag,only:o.only}),l=null;if(r){var a=Element.offsetSize(t,o.overlap)*(1-n);for(s=0;s=0)){if(a-Element.offsetSize(r[s],o.overlap)/2>=0){l=s+10?o.flatten():[]},Element.offsetSize=function(e,t){return e["offset"+("vertical"==t||"height"==t?"Height":"Width")]}; diff --git a/assets/js/src/form_editor_legacy/form_editor.js b/assets/js/src/form_editor_legacy/form_editor.js deleted file mode 100644 index 5816cefc92..0000000000 --- a/assets/js/src/form_editor_legacy/form_editor.js +++ /dev/null @@ -1,1155 +0,0 @@ -/* eslint-disable func-names */ -/* - * name: MailPoet Form Editor - * author: Jonathan Labreuille - * company: Wysija - * framework: prototype 1.7.2 - */ -var Observable; -var WysijaHistory; -var WysijaForm; - -/* LOGGING */ -function info(value) { - if (WysijaForm.options.debug === false) return; - - if (!(window.console && console.log)) { // eslint-disable-line no-console - (function () { - var noop = function () {}; - var methods = [ - 'assert', - 'clear', - 'count', - 'debug', - 'dir', - 'dirxml', - 'error', - 'exception', - 'group', - 'groupCollapsed', - 'groupEnd', - 'info', - 'log', - 'markTimeline', - 'profile', - 'profileEnd', - 'markTimeline', - 'table', - 'time', - 'timeEnd', - 'timeStamp', - 'trace', - 'warn', - ]; - var length = methods.length; - var console = {}; - window.console = {}; - while (length) { - length -= 1; - console[methods[length]] = noop; - } - }()); - } - try { - console.log('[DEBUG] ' + value); // eslint-disable-line no-console - } catch (e) { - // continue regardless of error - } -} - -Event.cacheDelegated = {}; -Object.extend(document, (function () { - var cache = Event.cacheDelegated; - - function getCacheForSelector(selector) { - cache[selector] = cache[selector] || {}; - return cache[selector]; - } - - function getWrappersForSelector(selector, eventName) { - var c = getCacheForSelector(selector); - c[eventName] = c[eventName] || []; - return c[eventName]; - } - - function findWrapper(selector, eventName, handler) { - var c = getWrappersForSelector(selector, eventName); - return c.find(function (wrapper) { - return wrapper.handler === handler; - }); - } - - function destroyWrapper(selector, eventName, handler) { - var wrapper; - var c = getCacheForSelector(selector); - if (!c[eventName]) return false; - wrapper = findWrapper(selector, eventName, handler); - c[eventName] = c[eventName].without(wrapper); - return wrapper; - } - - function createWrapper(selector, eventName, handler, context) { - var wrapper; - var element; - var c = getWrappersForSelector(selector, eventName); - if (c.pluck('handler').include(handler)) return false; - wrapper = function (event) { - element = event.findElement(selector); - if (element) handler.call(context || element, event, element); - }; - wrapper.handler = handler; - c.push(wrapper); - return wrapper; - } - return { - delegate: function (selector, eventName) { - var wrapper = createWrapper.apply(null, arguments); - if (wrapper) document.observe(eventName, wrapper); - return document; - }, - stopDelegating: function (selector, eventName) { - var length = arguments.length; - var wrapper; - switch (length) { - case 2: - getWrappersForSelector(selector, eventName).each(function (selectorWrapper) { - document.stopDelegating(selector, eventName, selectorWrapper.handler); - }); - break; - case 1: - Object.keys(getCacheForSelector(selector)).each(function (event) { - document.stopDelegating(selector, event); - }); - break; - case 0: - Object.keys(cache).each(function (cacheSelector) { - document.stopDelegating(cacheSelector); - }); - break; - default: - wrapper = destroyWrapper.apply(null, arguments); - if (wrapper) document.stopObserving(eventName, wrapper); - } - return document; - }, - }; -}())); - -Observable = (function () { - function getEventName(nameA, namespace) { - var name = nameA.substring(2); - if (namespace) name = namespace + ':' + name; - return name.underscore().split('_').join(':'); - } - - function getWrapper(handler, Klass) { - return function (event) { - return handler.call(new Klass(this), event, event.memo); - }; - } - - function getHandlers(klass) { - var proto = klass.prototype; - var namespace = proto.namespace; - return Object.keys(proto).grep(/^on/).inject(window.$H(), function (handlers, name) { - if (name === 'onDomLoaded') return handlers; - handlers.set(getEventName(name, namespace), getWrapper(proto[name], klass)); - return handlers; - }); - } - - function onDomLoad(selector, Klass) { - window.$$(selector).each(function (element) { - new Klass(element).onDomLoaded(); - }); - } - return { - observe: function (selector) { - var klass = this; - if (!this.handlers) this.handlers = {}; - if (this.handlers[selector]) return; - if (this.prototype.onDomLoaded) { - if (document.loaded) { - onDomLoad(selector, klass); - } else { - document.observe('dom:loaded', onDomLoad.curry(selector, klass)); - } - } - this.handlers[selector] = getHandlers(klass).each(function (handler) { - document.delegate(selector, handler.key, handler.value); - }); - }, - stopObserving: function (selector) { - if (!this.handlers || !this.handlers[selector]) return; - this.handlers[selector].each(function (handler) { - document.stopDelegating(selector, handler.key, handler.value); - }); - delete this.handlers[selector]; - }, - }; -}()); - -// override droppables -Object.extend(window.Droppables, { - deactivate: window.Droppables.deactivate.wrap(function (proceed, drop, draggable) { - if (drop.onLeave) drop.onLeave(draggable, drop.element); - return proceed(drop); - }), - activate: window.Droppables.activate.wrap(function (proceed, drop, draggable) { - if (drop.onEnter) drop.onEnter(draggable, drop.element); - return proceed(drop); - }), - show: function (point, element) { - var drop; - var affected = []; - if (!this.drops.length) return; - this.drops.each(function (dropsDrop) { - if (window.Droppables.isAffected(point, element, dropsDrop)) affected.push(dropsDrop); - }); - if (affected.length > 0) drop = window.Droppables.findDeepestChild(affected); - if (this.last_active && this.last_active !== drop) this.deactivate(this.last_active, element); - if (drop) { - window.Position.within(drop.element, point[0], point[1]); - if (drop.onHover) { - drop.onHover(element, drop.element, window.Position.overlap(drop.overlap, drop.element)); - } - if (drop !== this.last_active) window.Droppables.activate(drop, element); - } - }, - displayArea: function () { - if (!this.drops.length) return; - - // hide controls when displaying drop areas. - WysijaForm.hideBlockControls(); - - this.drops.each(function (drop) { - if (drop.element.hasClassName('block_placeholder')) { - drop.element.addClassName('active'); - } - }); - }, - hideArea: function () { - if (!this.drops.length) return; - this.drops.each(function (drop) { - if (drop.element.hasClassName('block_placeholder')) { - drop.element.removeClassName('active'); - } else if (drop.element.hasClassName('image_placeholder')) { - drop.element.removeClassName('active'); - drop.element.up().removeClassName('active'); - } else if (drop.element.hasClassName('text_placeholder')) { - drop.element.removeClassName('active'); - } - }); - }, - reset: function (draggable) { - if (this.last_active) this.deactivate(this.last_active, draggable); - }, -}); - -/* - Wysija History handling - POTENTIAL FEATURES: - - set a maximum number of items to be stored - -*/ -WysijaHistory = { - container: 'mailpoet_form_history', - size: 30, - enqueue: function (element) { - // create deep clone (includes child elements) of passed element - var clone = element.clone(true); - - // check if the field is unique - if (parseInt(clone.readAttribute('wysija_unique'), 10) === 1) { - // check if the field is already in the queue - window.PJS$(WysijaHistory.container).select('[wysija_name="' + clone.readAttribute('wysija_name') + '"]').invoke('remove'); - } - - // check history size - if (window.PJS$(WysijaHistory.container).select('> div').length >= WysijaHistory.size) { - // remove oldest element (last in the list) - window.PJS$(WysijaHistory.container).select('> div').last().remove(); - } - - // store block in history - window.PJS$(WysijaHistory.container).insert({ - top: clone, - }); - }, - dequeue: function () { - // pop last block off the history - var block = window.PJS$(WysijaHistory.container).select('div').first(); - - if (block !== undefined) { - // insert block back into the editor - window.PJS$(WysijaForm.options.body).insert({ - top: block, - }); - } - }, - clear: function () { - window.PJS$(WysijaHistory.container).innerHTML = ''; - }, - remove: function (field) { - window.PJS$(WysijaHistory.container).select('[wysija_name="' + field + '"]').invoke('remove'); - }, -}; - -/* MailPoet Form */ -WysijaForm = { - version: '0.7', - options: { - container: 'mailpoet_form_container', - editor: 'mailpoet_form_editor', - body: 'mailpoet_form_body', - toolbar: 'mailpoet_form_toolbar', - templates: 'wysija_widget_templates', - debug: false, - }, - toolbar: { - effect: null, - x: null, - y: null, - top: null, - left: null, - }, - scroll: { - top: 0, - left: 0, - }, - flags: { - doSave: false, - }, - locks: { - dragging: false, - selectingColor: false, - showingTools: false, - }, - encodeHtmlValue: function (str) { - return str.replace(/&/g, '&').replace(/>/g, '>').replace(/').replace(/</g, '<').replace(/"/g, '"'); - // ": fix for FileMerge because the previous line fucks up its syntax coloring - }, - loading: function (isLoading) { - if (isLoading) { - window.PJS$(WysijaForm.options.editor).addClassName('loading'); - window.PJS$(WysijaForm.options.toolbar).addClassName('loading'); - } else { - window.PJS$(WysijaForm.options.editor).removeClassName('loading'); - window.PJS$(WysijaForm.options.toolbar).removeClassName('loading'); - } - }, - loadStatic: function (blocks) { - window.$A(blocks).each(function (block) { - // create block - WysijaForm.Block.create(block, window.PJS$('block_placeholder')); - }); - }, - load: function (data) { - var settingsElements; - if (data === undefined) return; - - // load body - if (data.body !== undefined) { - window.$A(data.body).each(function (block) { - // create block - WysijaForm.Block.create(block, window.PJS$('block_placeholder')); - }); - - // load settings - settingsElements = window.PJS$('mailpoet_form_settings').getElements(); - settingsElements.each(function (setting) { - // skip lists - if (setting.name === 'segments') { - return true; - } - if (setting.name === 'on_success') { - // if the input value is equal to the one stored in the settings - if (setting.value === data.settings[setting.name]) { - // check selected value - window.PJS$(setting).checked = true; - } - } else if (data.settings[setting.name] !== undefined) { - if (typeof data.settings[setting.name] === 'string') { - setting.setValue(WysijaForm.decodeHtmlValue(data.settings[setting.name])); - } else { - setting.setValue(data.settings[setting.name]); - } - } - return true; - }); - } - }, - save: function () { - var position = 1; - var styles = null; - var data; - if (window.MailPoet.CodeEditor !== undefined) { - styles = window.MailPoet.CodeEditor.getValue(); - } - data = { - name: window.$F('mailpoet_form_name'), - settings: window.PJS$('mailpoet_form_settings').serialize(true), - body: [], - styles: styles, - }; - // body - WysijaForm.getBlocks().each(function (b) { - var blockData = (typeof (b.block.save) === 'function') ? b.block.save() : null; - - if (blockData !== null) { - // set block position - blockData.position = position; - - // increment position - position += 1; - - // add block data to body - data.body.push(blockData); - } - }); - - return data; - }, - init: function () { - // set document scroll - info('init -> set scroll offsets'); - WysijaForm.setScrollOffsets(); - - // position toolbar - info('init -> set toolbar position'); - WysijaForm.setToolbarPosition(); - - // enable droppable targets - info('init -> make droppable'); - WysijaForm.makeDroppable(); - - // enable sortable - info('init -> make sortable'); - WysijaForm.makeSortable(); - - // hide controls - info('init -> hide controls'); - WysijaForm.hideControls(); - - // hide settings - info('init -> hide settings'); - WysijaForm.hideSettings(); - - // set settings buttons position - info('init -> init settings'); - WysijaForm.setSettingsPosition(); - - // toggle widgets - info('init -> toggle widgets'); - WysijaForm.toggleWidgets(); - }, - getFieldData: function (element) { - // get basic field data - var data = { - type: element.readAttribute('wysija_type'), - name: element.readAttribute('wysija_name'), - id: element.readAttribute('wysija_id'), - unique: parseInt(element.readAttribute('wysija_unique') || 0, 10), - static: parseInt(element.readAttribute('wysija_static') || 0, 10), - element: element, - params: '', - }; - - // get params (may be empty) - if (element.readAttribute('wysija_params') !== null && element.readAttribute('wysija_params').length > 0) { - data.params = JSON.parse(element.readAttribute('wysija_params')); - } - return data; - }, - toggleWidgets: function () { - var hasSegmentSelection; - window.$$('a[wysija_unique="1"]').invoke('removeClassName', 'disabled'); - - // loop through each unique field already inserted in the editor - // and disable its toolbar equivalent - window.$$('#' + WysijaForm.options.editor + ' [wysija_unique="1"]').forEach(function (element) { - var field = window.$$( - '#' + WysijaForm.options.toolbar + ' [wysija_id="' + element.readAttribute('wysija_id') + '"]' - ); - if (field.length > 0) { - field.first().addClassName('disabled'); - } - }); - - hasSegmentSelection = WysijaForm.hasSegmentSelection(); - - if (hasSegmentSelection) { - window.PJS$('mailpoet_form_segments').writeAttribute('required', false).disable(); - window.PJS$('mailpoet_settings_segment_selection').hide(); - } else { - window.PJS$('mailpoet_form_segments').writeAttribute('required', true).enable(); - window.PJS$('mailpoet_settings_segment_selection').show(); - } - }, - hasSegmentSelection: function () { - return (window.$$('#' + WysijaForm.options.editor + ' [wysija_id="segments"]').length > 0); - }, - isSegmentSelectionValid: function () { - var segmentSelection = window.$$('#' + WysijaForm.options.editor + ' [wysija_id="segments"]')[0]; - var block; - if (segmentSelection !== undefined) { - block = WysijaForm.get(segmentSelection).block.getData(); - return ( - (block.params.values !== undefined) - && (block.params.values.length > 0) - ); - } - return false; - }, - setBlockPositions: function (event, target) { - var index = 1; - var blockPlaceholder; - var previousPlaceholder; - // release dragging lock - WysijaForm.locks.dragging = false; - - WysijaForm.getBlocks().each(function (container) { - container.setPosition(index); - index += 1; - // remove z-index value to avoid issues when resizing images - if (container.block !== undefined) { - container.block.element.setStyle({ - zIndex: '', - }); - } - }); - - if (target !== undefined) { - // get placeholders (previous placeholder matches the placeholder linked to the next block) - blockPlaceholder = window.PJS$(target.element.readAttribute('wysija_placeholder')); - previousPlaceholder = target.element.previous('.block_placeholder'); - - if (blockPlaceholder !== null) { - // put block placeholder before the current block - target.element.insert({ - before: blockPlaceholder, - }); - - // if the next block is a wysija_block, insert previous placeholder - if (target.element.next() !== undefined && target.element.next().hasClassName('mailpoet_form_block') && previousPlaceholder !== undefined) { - target.element.insert({ - after: previousPlaceholder, - }); - } - } - } - }, - setScrollOffsets: function () { - WysijaForm.scroll = document.viewport.getScrollOffsets(); - }, - hideSettings: function () { - window.PJS$(WysijaForm.options.container).select('.wysija_settings').invoke('hide'); - }, - setSettingsPosition: function () { - // get viewport offsets and dimensions - var viewportHeight = document.viewport.getHeight(); - - window.PJS$(WysijaForm.options.container).select('.wysija_settings').each(function (element) { - // get parent dimensions and position - var parentDim = element.up('.mailpoet_form_block').getDimensions(); - var parentPos = element.up('.mailpoet_form_block').cumulativeOffset(); - var isVisible = (parentPos.top <= (WysijaForm.scroll.top + viewportHeight)); - var buttonMargin = 5; - var relativeTop = buttonMargin; - - if (isVisible) { - // always center - relativeTop = parseInt((parentDim.height / 2) - (element.getHeight() / 2), 10); - } - // set position for button - window.PJS$(element).setStyle({ - left: parseInt((parentDim.width / 2) - (element.getWidth() / 2), 10) + 'px', - top: relativeTop + 'px', - }); - }); - }, - initToolbarPosition: function () { - if (WysijaForm.toolbar.top === null) { - WysijaForm.toolbar.top = parseInt( - window.PJS$(WysijaForm.options.container).positionedOffset().top, 10 - ); - } - if (WysijaForm.toolbar.y === null) { - WysijaForm.toolbar.y = parseInt(WysijaForm.toolbar.top, 10); - } - - if (window.isRtl) { - if (WysijaForm.toolbar.left === null) WysijaForm.toolbar.left = 0; - } else if (WysijaForm.toolbar.left === null) { - WysijaForm.toolbar.left = parseInt( - window.PJS$(WysijaForm.options.container).positionedOffset().left, 10 - ); - } - if (WysijaForm.toolbar.x === null) { - WysijaForm.toolbar.x = parseInt( - WysijaForm.toolbar.left - + window.PJS$(WysijaForm.options.container).getDimensions().width - + 15, - 10 - ); - } - }, - setToolbarPosition: function () { - var position; - WysijaForm.initToolbarPosition(); - - position = { - top: WysijaForm.toolbar.y + 'px', - visibility: 'visible', - }; - - if (window.isRtl) { - position.right = WysijaForm.toolbar.x + 'px'; - } else { - position.left = WysijaForm.toolbar.x + 'px'; - } - - window.PJS$(WysijaForm.options.toolbar).setStyle(position); - }, - updateToolbarPosition: function () { - // init toolbar position (updates scroll and toolbar y) - WysijaForm.initToolbarPosition(); - - // cancel previous effect - if (WysijaForm.toolbar.effect !== null) WysijaForm.toolbar.effect.cancel(); - - if (WysijaForm.scroll.top >= (WysijaForm.toolbar.top - 20)) { - WysijaForm.toolbar.y = parseInt(20 + WysijaForm.scroll.top, 10); - // start effect - WysijaForm.toolbar.effect = new window.Effect.Move(WysijaForm.options.toolbar, { - x: WysijaForm.toolbar.x, - y: WysijaForm.toolbar.y, - mode: 'absolute', - duration: 0.2, - }); - } else { - window.PJS$(WysijaForm.options.toolbar).setStyle({ - left: WysijaForm.toolbar.x + 'px', - top: WysijaForm.toolbar.top + 'px', - }); - } - }, - blockDropOptions: { - accept: window.$w('mailpoet_form_field'), // acceptable items (classes array) - onEnter: function (draggable, droppable) { - window.PJS$(droppable).addClassName('hover'); - }, - onLeave: function (draggable, droppable) { - window.PJS$(droppable).removeClassName('hover'); - }, - onDrop: function (draggable, droppable) { - // custom data for images - droppable.fire('wjfe:item:drop', WysijaForm.getFieldData(draggable)); - window.PJS$(droppable).removeClassName('hover'); - }, - }, - hideControls: function () { - try { - WysijaForm.getBlocks().invoke('hideControls'); - } catch (e) { - // continue regardless of error - } - }, - hideTools: function () { - window.$$('.wysija_tools').invoke('hide'); - WysijaForm.locks.showingTools = false; - }, - instances: {}, - get: function (element, typ) { - var type = typ; - var id; - var instance; - if (type === undefined) type = 'block'; - // identify element - id = element.identify(); - instance = WysijaForm.instances[id] || new (WysijaForm[type.capitalize().camelize()])(id); - - WysijaForm.instances[id] = instance; - return instance; - }, - makeDroppable: function () { - window.Droppables.add('block_placeholder', WysijaForm.blockDropOptions); - }, - makeSortable: function () { - var body = window.PJS$(WysijaForm.options.body); - window.Sortable.create(body, { - tag: 'div', - only: 'mailpoet_form_block', - scroll: window, - handle: 'handle', - constraint: 'vertical', - - }); - window.Draggables.removeObserver(body); - window.Draggables.addObserver({ - element: body, - onStart: WysijaForm.startBlockPositions, - onEnd: WysijaForm.setBlockPositions, - }); - }, - hideBlockControls: function () { - window.$$('.wysija_controls').invoke('hide'); - this.getBlockElements().invoke('removeClassName', 'hover'); - }, - getBlocks: function () { - return WysijaForm.getBlockElements().map(function (element) { - return WysijaForm.get(element); - }); - }, - getBlockElements: function () { - return window.PJS$(WysijaForm.options.container).select('.mailpoet_form_block'); - }, - startBlockPositions: function (event, target) { - if (target.element.hasClassName('mailpoet_form_block')) { - // store block placeholder id for the block that is being repositionned - if (target.element.previous('.block_placeholder') !== undefined) { - target.element.writeAttribute('wysija_placeholder', target.element.previous('.block_placeholder').identify()); - } - } - WysijaForm.locks.dragging = true; - }, - encodeURIComponent: function (str) { - // check if it's a url and if so, prevent encoding of protocol - var regexp = new RegExp(/^http[s]?:\/\//); - var protocol = regexp.exec(str); - - if (protocol === null) { - // this is not a url so encode the whole thing - return encodeURIComponent(str).replace(/[!'()*]/g, escape); - } - if (protocol.length === 1) { - // this is a url, so do not encode the protocol - return encodeURI(str).replace(/[!'()*]/g, escape); - } - return str; - }, - updateBlock: function (field) { - var hasUpdated = false; - WysijaForm.getBlocks().each(function (b) { - if (b.block.getData().id === field.id) { - hasUpdated = true; - b.block.redraw(field); - } - }); - - return hasUpdated; - }, - removeBlock: function (field, callback) { - var hasRemoved = false; - WysijaForm.getBlocks().each(function (b) { - if (b.block.getData().id === field.id) { - hasRemoved = true; - b.block.removeBlock(callback); - } - }); - - return hasRemoved; - }, -}; - -WysijaForm.DraggableItem = window.Class.create({ - initialize: function (element) { - this.elementType = window.PJS$(element).readAttribute('wysija_type'); - this.element = window.PJS$(element).down() || window.PJS$(element); - this.clone = this.cloneElement(); - this.insert(); - }, - STYLES: new window.Template('position: absolute; top: #{top}px; left: #{left}px;'), - cloneElement: function () { - var clone = this.element.clone(); - var offset = this.element.cumulativeOffset(); - var list = this.getList(); - var styles = this.STYLES.evaluate({ - top: offset.top - list.scrollTop, - left: offset.left - list.scrollLeft, - }); - clone.setStyle(styles); - - clone.addClassName('mailpoet_form_widget'); - clone.addClassName(this.elementType); - clone.innerHTML = this.element.innerHTML; - return clone; - }, - getOffset: function () { - return this.element.offsetTop - this.getList().scrollTop; - }, - getList: function () { - return this.element.up('ul'); - }, - insert: function () { - window.$$('body')[0].insert(this.clone); - }, - onMousedown: function (event) { - var draggable = new window.Draggable(this.clone, { - scroll: window, - onStart: function () { - window.Droppables.displayArea(draggable); - }, - onEnd: function (drag) { - drag.destroy(); - drag.element.remove(); - window.Droppables.hideArea(); - }, - starteffect: function (element) { - new window.Effect.Opacity(element, { // eslint-disable-line no-new - duration: 0.2, - from: element.getOpacity(), - to: 0.7, - }); - }, - endeffect: window.Prototype.emptyFunction, - }); - draggable.initDrag(event); - draggable.startDrag(event); - return draggable; - }, -}); -Object.extend(WysijaForm.DraggableItem, Observable).observe('a[class="mailpoet_form_field"]'); - - -WysijaForm.Block = window.Class.create({ - /* Invoked on load */ - initialize: function (element) { - info('block -> init'); - - this.element = window.PJS$(element); - this.block = new WysijaForm.Widget(this.element); - - // enable block placeholder - this.block.makeBlockDroppable(); - - // setup events - if (this.block.setup !== undefined) { - this.block.setup(); - } - return this; - }, - setPosition: function (position) { - this.element.writeAttribute('wysija_position', position); - }, - hideControls: function () { - if (this.getControls) { - this.element.removeClassName('hover'); - this.getControls().hide(); - } - }, - showControls: function () { - if (this.getControls) { - this.element.addClassName('hover'); - try { - this.getControls().show(); - } catch (e) { - // continue regardless of error - } - } - }, - makeBlockDroppable: function () { - var blockPlaceholder; - if (this.isBlockDroppableEnabled() === false) { - blockPlaceholder = this.getBlockDroppable(); - window.Droppables.add(blockPlaceholder.identify(), WysijaForm.blockDropOptions); - blockPlaceholder.addClassName('enabled'); - } - }, - removeBlockDroppable: function () { - var blockPlaceholder; - if (this.isBlockDroppableEnabled()) { - blockPlaceholder = this.getBlockDroppable(); - window.Droppables.remove(blockPlaceholder.identify()); - blockPlaceholder.removeClassName('enabled'); - } - }, - isBlockDroppableEnabled: function () { - // if the block_placeholder does not exist, create it - var blockPlaceholder = this.getBlockDroppable(); - if (blockPlaceholder === null) { - return this.createBlockDroppable().hasClassName('enabled'); - } - return blockPlaceholder.hasClassName('enabled'); - }, - createBlockDroppable: function () { - info('block -> createBlockDroppable'); - this.element.insert({ - before: '
' + window.PJS$('block_placeholder').innerHTML + '
', - }); - return this.element.previous('.block_placeholder'); - }, - getBlockDroppable: function () { - if (this.element.previous() === undefined || this.element.previous().hasClassName('block_placeholder') === false) { - return null; - } - return this.element.previous(); - }, - getControls: function () { - return this.element.down('.wysija_controls'); - }, - setupControls: function () { - var block; - // enable controls - this.controls = this.getControls(); - - if (this.controls) { - // setup events for block controls - this.element.observe('mouseover', function () { - // special cases where controls shouldn't be displayed - if ( - WysijaForm.locks.dragging === true - || WysijaForm.locks.selectingColor === true - || WysijaForm.locks.showingTools === true - ) return; - - // set block flag - this.element.addClassName('hover'); - - // show controls - this.showControls(); - - // show settings if present - if (this.element.down('.wysija_settings') !== undefined) { - this.element.down('.wysija_settings').show(); - } - }.bind(this)); - - this.element.observe('mouseout', function () { - // special cases where controls shouldn't hide - if (WysijaForm.locks.dragging === true || WysijaForm.locks.selectingColor === true) return; - - // hide controls - this.hideControls(); - - // hide settings if present - if (this.element.down('.wysija_settings') !== undefined) { - this.element.down('.wysija_settings').hide(); - } - }.bind(this)); - - - // setup click event for remove button - this.removeButton = this.controls.down('.remove') || null; - if (this.removeButton !== null) { - this.removeButton.observe('click', function () { - this.removeBlock(); - this.removeButton.stopObserving('click'); - }.bind(this)); - } - - // setup click event for settings button - this.settingsButton = this.element.down('.settings') || null; - - if (this.settingsButton !== null) { - this.settingsButton.observe('click', function (event) { - // TODO: refactor - block = window.PJS$(event.target).up('.mailpoet_form_block') || null; - if (block !== null) { - this.editSettings(); - } - }.bind(this)); - } - } - return this; - }, - removeBlock: function (callback) { - info('block -> removeBlock'); - - // save block in history - WysijaHistory.enqueue(this.element); - - window.Effect.Fade(this.element.identify(), { - duration: 0.2, - afterFinish: function (effect) { - // remove placeholder - if (effect.element.previous('.block_placeholder') !== undefined) { - effect.element.previous('.block_placeholder').remove(); - } - - // remove element from the DOM - this.element.remove(); - - // reset block positions - WysijaForm.setBlockPositions(); - - // toggle widgets - WysijaForm.toggleWidgets(); - - // optional callback execution after completely removing block - if (callback !== undefined && typeof (callback) === 'function') { - callback(); - } - - // remove block instance - delete WysijaForm.instances[this.element.identify()]; - }.bind(this), - }); - }, -}); - -/* Invoked on item dropped */ -WysijaForm.Block.create = function (createBlock, target) { - var block = createBlock; - var body; - var blockTemplate; - var template; - var output; - var settingsSegments; - if (window.PJS$('form_template_' + block.type) === null) { - return false; - } - - body = window.PJS$(WysijaForm.options.body); - blockTemplate = window.Handlebars.compile(window.PJS$('form_template_block').innerHTML); - template = window.Handlebars.compile(window.PJS$('form_template_' + block.type).innerHTML); - output = ''; - - if (block.type === 'segment') { - if (block.params.values === undefined) { - settingsSegments = window.jQuery('#mailpoet_form_segments').val(); - if (settingsSegments !== null && settingsSegments.length > 0) { - block.params.values = window.mailpoet_segments.filter(function (segment) { - return (settingsSegments.indexOf(segment.id) !== -1); - }); - } - } - } - - // set block template (depending on the block type) - block.template = template(block); - output = blockTemplate(block); - - // check if the new block is unique and if there's already an instance - // of it in the history. If so, remove its former instance from the history - if (block.unique === 1) { - WysijaHistory.remove(block.field); - } - - // if the drop target was the bottom placeholder - if (target.identify() === 'block_placeholder') { - // insert block at the bottom - body.insert(output); - // block = body.childElements().last(); - } else { - // insert block before the drop target - target.insert({ - before: output, - }); - // block = target.previous('.mailpoet_form_block'); - } - // refresh sortable items - WysijaForm.makeSortable(); - - // refresh block positions - WysijaForm.setBlockPositions(); - - // position settings - WysijaForm.setSettingsPosition(); - return true; -}; - -document.observe('wjfe:item:drop', function (event) { - info('create block'); - WysijaForm.Block.create(event.memo, event.target); - - // hide block controls - info('hide controls'); - WysijaForm.hideBlockControls(); - - // toggle widgets - setTimeout(function () { - WysijaForm.toggleWidgets(); - }, 1); -}); - -/* Form Widget */ -WysijaForm.Widget = window.Class.create(WysijaForm.Block, { - initialize: function (element) { - info('widget -> init'); - this.element = window.PJS$(element); - return this; - }, - setup: function () { - info('widget -> setup'); - this.setupControls(); - }, - save: function () { - var data = this.getData(); - info('widget -> save'); - - if (data.element !== undefined) { - delete data.element; - } - - return data; - }, - setData: function (data) { - var currentData = this.getData(); - var params = window.$H(currentData.params).merge(data.params).toObject(); - - // update type if it changed - if (data.type !== undefined && data.type !== currentData.type) { - this.element.writeAttribute('wysija_type', data.type); - } - - // update params - this.element.writeAttribute('wysija_params', JSON.stringify(params)); - }, - getData: function () { - var data = WysijaForm.getFieldData(this.element); - // decode params - if (data.params.length > 0) { - data.params = JSON.parse(data.params); - } - return data; - }, - getControls: function () { - return this.element.down('.wysija_controls'); - }, - remove: function () { - this.removeBlock(); - }, - redraw: function (data) { - var options; - var blockTemplate; - var template; - var params; - // set parameters - this.setData(data); - options = this.getData(); - // redraw block - blockTemplate = window.Handlebars.compile(window.PJS$('form_template_block').innerHTML); - template = window.Handlebars.compile(window.PJS$('form_template_' + options.type).innerHTML); - params = window.$H(options).merge({ - template: template(options), - }).toObject(); - this.element.replace(blockTemplate(params)); - - WysijaForm.init(); - }, - editSettings: function () { - window.MailPoet.Modal.popup({ - title: window.MailPoet.I18n.t('editFieldSettings'), - template: window.jQuery('#form_template_field_settings').html(), - data: this.getData(), - minWidth: '500px', - onSuccess: function () { - var data = window.jQuery('#form_field_settings').mailpoetSerializeObject(); - this.redraw(data); - }.bind(this), - }); - }, - getSettings: function () { - return this.element.down('.wysija_settings'); - }, -}); - -/* When dom is loaded, initialize WysijaForm */ -document.observe('dom:loaded', WysijaForm.init); - -module.exports = WysijaForm; diff --git a/assets/js/src/form_editor_legacy/webpack_index.jsx b/assets/js/src/form_editor_legacy/webpack_index.jsx deleted file mode 100644 index 8bbecd8b2a..0000000000 --- a/assets/js/src/form_editor_legacy/webpack_index.jsx +++ /dev/null @@ -1,9 +0,0 @@ -// Initialize Editor dependencies that have side effect (meaning they -// not only define module but also modify/register something on load). - -// This is to avoid undefined import order & messy WebPack config. -// Code can be gradually refactored to avoid side effects completely. - -import 'form_editor_legacy/form_editor.js'; // side effect - calls document.observe() -import 'codemirror'; // side effect - has to be loaded here, used in 'editor.html' -import 'codemirror/mode/css/css'; // side effect - has to be loaded here, used in 'editor.html' diff --git a/lib/AdminPages/Pages/FormEditor.php b/lib/AdminPages/Pages/FormEditor.php index 0d4b90f534..957b07f0bb 100644 --- a/lib/AdminPages/Pages/FormEditor.php +++ b/lib/AdminPages/Pages/FormEditor.php @@ -63,12 +63,6 @@ class FormEditor { 'custom_fields' => $this->customFieldsResponseBuilder->buildBatch($customFields), ]; - if (isset($_GET['legacy']) && (int)$_GET['legacy']) { - $data['date_types'] = $dateTypes; - $this->pageRenderer->displayPage('form/editor_legacy.html', $data); - } else { - $this->pageRenderer->displayPage('form/editor.html', $data); - - } + $this->pageRenderer->displayPage('form/editor.html', $data); } } diff --git a/views/form/editor_legacy.html b/views/form/editor_legacy.html deleted file mode 100644 index 935999e5ef..0000000000 --- a/views/form/editor_legacy.html +++ /dev/null @@ -1,752 +0,0 @@ -<% extends 'layout.html' %> - -<% block title %> -

- <%= __('Form') %> - <%= __('Back') %> -

-

- -

-<% endblock %> - -<% block content %> -
- -
- -
-
-

-
- -

- <%= __('Save') %> -

-
- - - - - -
-
- -<%= javascript( -'lib/prototype.min.js', -'lib/scriptaculous.min.js', -'form_editor_legacy.js' -)%> - - -<% endblock %> - -<% block templates %> - -<%= partial('form_template_fields', 'form/templatesLegacy/toolbar/fields.hbs') %> -<%= partial('form_template_exports', 'form/templatesLegacy/toolbar/exports.hbs') %> - - -<%= partial('form_template_block', 'form/templatesLegacy/blocks/container.hbs') %> -<%= partial('form_template_divider', 'form/templatesLegacy/blocks/divider.hbs') %> -<%= partial('form_template_text', 'form/templatesLegacy/blocks/text.hbs') %> -<%= partial('form_template_submit', 'form/templatesLegacy/blocks/submit.hbs') %> -<%= partial('form_template_segment', 'form/templatesLegacy/blocks/segment.hbs') %> -<%= partial('form_template_radio', 'form/templatesLegacy/blocks/radio.hbs') %> -<%= partial('form_template_select', 'form/templatesLegacy/blocks/select.hbs') %> -<%= partial('form_template_checkbox', 'form/templatesLegacy/blocks/checkbox.hbs') %> -<%= partial('form_template_textarea', 'form/templatesLegacy/blocks/textarea.hbs') %> -<%= partial('form_template_html', 'form/templatesLegacy/blocks/html.hbs') %> - - -<% include 'form/custom_fields_legacy.html' %> - - -<%= partial('mailpoet_form_preview_template', -'form/templatesLegacy/preview.hbs' -) %> -<% endblock %> - -<% block translations %> -<%= localize({ -'editFieldSettings': __('Edit field settings'), -}) %> -<% endblock %> diff --git a/views/form/templatesLegacy/blocks/checkbox.hbs b/views/form/templatesLegacy/blocks/checkbox.hbs deleted file mode 100644 index bd850c52be..0000000000 --- a/views/form/templatesLegacy/blocks/checkbox.hbs +++ /dev/null @@ -1,10 +0,0 @@ -{{#if params.label}} -

- -

-{{/if}} -{{#each params.values}} -

- -

-{{/each}} \ No newline at end of file diff --git a/views/form/templatesLegacy/blocks/container.hbs b/views/form/templatesLegacy/blocks/container.hbs deleted file mode 100644 index 8b2bbf5c1a..0000000000 --- a/views/form/templatesLegacy/blocks/container.hbs +++ /dev/null @@ -1,20 +0,0 @@ -
- {{#ifCond type '!==' 'divider'}} - - {{/ifCond}} - - {{{ template }}} -
\ No newline at end of file diff --git a/views/form/templatesLegacy/blocks/divider.hbs b/views/form/templatesLegacy/blocks/divider.hbs deleted file mode 100644 index 1d6667d2e3..0000000000 --- a/views/form/templatesLegacy/blocks/divider.hbs +++ /dev/null @@ -1 +0,0 @@ -
\ No newline at end of file diff --git a/views/form/templatesLegacy/blocks/html.hbs b/views/form/templatesLegacy/blocks/html.hbs deleted file mode 100644 index 9ae3b42e71..0000000000 --- a/views/form/templatesLegacy/blocks/html.hbs +++ /dev/null @@ -1,7 +0,0 @@ -{{#if params.text}} - {{#ifCond params.nl2br '==' '1'}} - {{{ nl2br params.text }}} - {{else}} - {{{ params.text }}} - {{/ifCond}} -{{/if}} \ No newline at end of file diff --git a/views/form/templatesLegacy/blocks/radio.hbs b/views/form/templatesLegacy/blocks/radio.hbs deleted file mode 100644 index bcec50a8ac..0000000000 --- a/views/form/templatesLegacy/blocks/radio.hbs +++ /dev/null @@ -1,10 +0,0 @@ -{{#if params.label}} -

- -

-{{/if}} -{{#each params.values}} -

- -

-{{/each}} \ No newline at end of file diff --git a/views/form/templatesLegacy/blocks/segment.hbs b/views/form/templatesLegacy/blocks/segment.hbs deleted file mode 100644 index 064b5f9beb..0000000000 --- a/views/form/templatesLegacy/blocks/segment.hbs +++ /dev/null @@ -1,7 +0,0 @@ -{{#if params.label}}

{{ params.label }}

{{/if}} -{{#unless params.values}}

<%= __('Please select at least one list') %>

{{/unless}} -{{#each params.values}} -

- {{ name }} -

-{{/each}} \ No newline at end of file diff --git a/views/form/templatesLegacy/blocks/select.hbs b/views/form/templatesLegacy/blocks/select.hbs deleted file mode 100644 index 248b4be8da..0000000000 --- a/views/form/templatesLegacy/blocks/select.hbs +++ /dev/null @@ -1,17 +0,0 @@ -{{#unless params.label_within}} - {{#if params.label}} -

- -

- {{/if}} -{{/unless}} - \ No newline at end of file diff --git a/views/form/templatesLegacy/blocks/submit.hbs b/views/form/templatesLegacy/blocks/submit.hbs deleted file mode 100644 index 177137fc98..0000000000 --- a/views/form/templatesLegacy/blocks/submit.hbs +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/views/form/templatesLegacy/blocks/text.hbs b/views/form/templatesLegacy/blocks/text.hbs deleted file mode 100644 index a3e94b9fd1..0000000000 --- a/views/form/templatesLegacy/blocks/text.hbs +++ /dev/null @@ -1,2 +0,0 @@ -{{#unless params.label_within}}{{/unless}} - \ No newline at end of file diff --git a/views/form/templatesLegacy/blocks/textarea.hbs b/views/form/templatesLegacy/blocks/textarea.hbs deleted file mode 100644 index 47046558b2..0000000000 --- a/views/form/templatesLegacy/blocks/textarea.hbs +++ /dev/null @@ -1,4 +0,0 @@ -

- {{#unless params.label_within}}{{/unless}} - -

\ No newline at end of file diff --git a/views/form/templatesLegacy/preview.hbs b/views/form/templatesLegacy/preview.hbs deleted file mode 100644 index fc028cda71..0000000000 --- a/views/form/templatesLegacy/preview.hbs +++ /dev/null @@ -1,11 +0,0 @@ - -
-
-

<%= __('This is what the success message looks like.') %>

-

<%= __('This is what the error message looks like.') %>

-
- {{{ html }}} -
diff --git a/views/form/templatesLegacy/toolbar/exports.hbs b/views/form/templatesLegacy/toolbar/exports.hbs deleted file mode 100644 index 20a810de70..0000000000 --- a/views/form/templatesLegacy/toolbar/exports.hbs +++ /dev/null @@ -1,3 +0,0 @@ -{{#each exports}} - -{{/each}} \ No newline at end of file diff --git a/views/form/templatesLegacy/toolbar/fields.hbs b/views/form/templatesLegacy/toolbar/fields.hbs deleted file mode 100644 index 9e7e6aacc8..0000000000 --- a/views/form/templatesLegacy/toolbar/fields.hbs +++ /dev/null @@ -1,27 +0,0 @@ -{{#each fields}} -
  • - - {{ name }} - - - {{#unless readonly}} - - - - - - - {{/unless}} -
  • -{{/each}} \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index 75d638eb8f..a5930af5d3 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -209,7 +209,6 @@ const adminConfig = { 'common/check_spf_record.jsx', ], admin: 'webpack_admin_index.jsx', - form_editor_legacy: 'form_editor_legacy/webpack_index.jsx', newsletter_editor: 'newsletter_editor/webpack_index.jsx', }, plugins: [ @@ -247,12 +246,12 @@ const adminConfig = { // add admin/form_editor_legacy/newsletter_editor shared modules const filteredChunks = chunks.filter((chunk) => { - return ['admin', 'form_editor_legacy', 'newsletter_editor'].includes(chunk.name); + return ['admin', 'newsletter_editor'].includes(chunk.name); }); return filteredChunks.length > 1; }, enforce: true, - chunks: (chunk) => ['admin_vendor', 'admin', 'form_editor_legacy', 'newsletter_editor'].includes(chunk.name), + chunks: (chunk) => ['admin_vendor', 'admin', 'newsletter_editor'].includes(chunk.name), priority: 0, }, }