packr 1.0.2 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,6 @@
1
- class String
2
- def rescape
3
- gsub(/([\/()\[\]{}|*+-.,^$?\\])/, "\\\\1")
4
- end
5
- end
1
+ class String
2
+ def rescape
3
+ gsub(/([\/()\[\]{}|*+-.,^$?\\])/) { |m| "\\#{$1}" }
4
+ end
5
+ end
6
+
@@ -0,0 +1,140 @@
1
+ require 'test/unit'
2
+ require 'fileutils'
3
+ require 'packr'
4
+
5
+ class PackrTest < Test::Unit::TestCase
6
+
7
+ def setup
8
+ dir = File.dirname(__FILE__) + '/assets'
9
+ FileUtils.mkdir_p(dir + '/test')
10
+ @data = {
11
+ :default => [{
12
+ :source => File.read("#{dir}/src/controls.js"),
13
+ :packed => File.read("#{dir}/packed/controls.js").gsub(/\r?\n?/, ''),
14
+ :output => "#{dir}/test/controls.js"
15
+ }],
16
+ :shrink => [{
17
+ :source => File.read("#{dir}/src/dragdrop.js"),
18
+ :packed => File.read("#{dir}/packed/dragdrop.js").gsub(/\r?\n?/, ''),
19
+ :output => "#{dir}/test/dragdrop.js"
20
+ },
21
+ { :source => File.read("#{dir}/src/prototype.js"),
22
+ :packed => File.read("#{dir}/packed/prototype_shrunk.js").gsub(/\r?\n?/, ''),
23
+ :output => "#{dir}/test/prototype_shrunk.js"
24
+ }],
25
+ :base62 => [{
26
+ :source => File.read("#{dir}/src/effects.js"),
27
+ :packed => File.read("#{dir}/packed/effects.js").gsub(/\r?\n?/, ''),
28
+ :output => "#{dir}/test/effects.js"
29
+ }],
30
+ :base62_shrink => [{
31
+ :source => File.read("#{dir}/src/prototype.js"),
32
+ :packed => File.read("#{dir}/packed/prototype.js").gsub(/\r?\n?/, ''),
33
+ :output => "#{dir}/test/prototype.js"
34
+ }],
35
+ :concat_bug => [{
36
+ :source => File.read("#{dir}/src/selector.js"),
37
+ :packed => File.read("#{dir}/packed/selector.js").gsub(/\r?\n?/, ''),
38
+ :output => "#{dir}/test/selector.js"
39
+ }],
40
+ :conditional_comments => [{
41
+ :source => File.read("#{dir}/src/domready.js"),
42
+ :packed => File.read("#{dir}/packed/domready.js").gsub(/\r?\n?/, ''),
43
+ :output => "#{dir}/test/domready.js"
44
+ }]
45
+ }
46
+ end
47
+
48
+ def test_basic_packing
49
+ actual = Packr.pack(@data[:default][0][:source])
50
+ File.open(@data[:default][0][:output], 'wb') { |f| f.write(actual) }
51
+ assert_equal @data[:default][0][:packed], actual
52
+ end
53
+
54
+ def test_shrink_packing
55
+ actual1 = Packr.pack(@data[:shrink][0][:source], :shrink_vars => true)
56
+ File.open(@data[:shrink][0][:output], 'wb') { |f| f.write(actual1) }
57
+ actual2 = Packr.pack(@data[:shrink][1][:source], :shrink_vars => true)
58
+ File.open(@data[:shrink][1][:output], 'wb') { |f| f.write(actual2) }
59
+ assert_equal @data[:shrink][0][:packed], actual1
60
+ assert_equal @data[:shrink][1][:packed], actual2
61
+ end
62
+
63
+ def test_base62_packing
64
+ expected = @data[:base62][0][:packed]
65
+ actual = Packr.pack(@data[:base62][0][:source], :base62 => true)
66
+ File.open(@data[:base62][0][:output], 'wb') { |f| f.write(actual) }
67
+ assert_equal expected.size, actual.size
68
+ expected_words = expected.scan(/'[\w\|]+'/)[-2].gsub(/^'(.*?)'$/, '\1').split("|").sort
69
+ actual_words = actual.scan(/'[\w\|]+'/)[-2].gsub(/^'(.*?)'$/, '\1').split("|").sort
70
+ assert expected_words.eql?(actual_words)
71
+ end
72
+
73
+ def test_base62_and_shrink_packing
74
+ expected = @data[:base62_shrink][0][:packed]
75
+ actual = Packr.pack(@data[:base62_shrink][0][:source], :base62 => true, :shrink_vars => true)
76
+ File.open(@data[:base62_shrink][0][:output], 'wb') { |f| f.write(actual) }
77
+ assert_equal expected.size, actual.size
78
+ expected_words = expected.scan(/'[\w\|]+'/)[-2].gsub(/^'(.*?)'$/, '\1').split("|").sort
79
+ actual_words = actual.scan(/'[\w\|]+'/)[-2].gsub(/^'(.*?)'$/, '\1').split("|").sort
80
+ assert expected_words.eql?(actual_words)
81
+ end
82
+
83
+ def test_private_variable_packing
84
+ script = "var _KEYS = true, _MY_VARS = []; (function() { var foo = _KEYS; _MY_VARS.push({_KEYS: _KEYS}); var bar = 'something _KEYS _MY_VARS' })();"
85
+ expected = "var _0=true,_1=[];(function(){var a=_0;_1.push({_0:_0});var b='something _0 _1'})();"
86
+ assert_equal expected, Packr.pack(script, :shrink_vars => true, :private => true)
87
+ end
88
+
89
+ def test_protected_names
90
+ expected = 'var func=function(a,d,c,b){return c(a+b)}'
91
+ actual = Packr.pack('var func = function(foo, bar, $super, baz) { return $super( foo + baz ); }', :shrink_vars => true)
92
+ assert_equal expected.size, actual.size
93
+ expected = 'var func=function(a,other,b,c,names){return b()(other.apply(names,a))}'
94
+ actual = Packr.pack('var func = function(foo, other, $super, bar, names) { return $super()(other.apply(names, foo)); }', :shrink_vars => true, :protect => (%w(other) + [:method, :names] + ['some random stuff', 24]))
95
+ assert_equal expected.size, actual.size
96
+ expected = 'function(a,$super){}'
97
+ assert_equal expected.size, Packr.pack('function(name, $super) { /* something */ }', :shrink_vars => true, :protect => %w($super)).size
98
+ end
99
+
100
+ def test_dollar_prefix
101
+ expected = 'function(a,b){var c;happening()}'
102
+ actual = Packr.pack('function(something, $nothing) { var is; happening(); }', :shrink_vars => true)
103
+ assert_equal expected, actual
104
+ end
105
+
106
+ def test_object_properties
107
+ expected = 'function(a,b){this.queue.push({func:a,args:b})}'
108
+ actual = Packr.pack('function(method, args) { this.queue.push({func: method, args: args}); }', :shrink_vars => true)
109
+ assert_equal expected, actual
110
+ end
111
+
112
+ def test_concat
113
+ actual = Packr.pack(@data[:concat_bug][0][:source], :shrink_vars => true)
114
+ File.open(@data[:concat_bug][0][:output], 'wb') { |f| f.write(actual) }
115
+ assert_equal @data[:concat_bug][0][:packed], actual
116
+
117
+ code = 'var a={"+":function(){}}'
118
+ assert_equal Packr.pack(code), code
119
+
120
+ code = "var a={'+':function(){}}"
121
+ assert_equal Packr.pack(code), code
122
+
123
+ code = 'var b="something"+"else",a={"+":function(){return"nothing"+"at all"}}'
124
+ expected = 'var b="somethingelse",a={"+":function(){return"nothingat all"}}'
125
+ actual = Packr.pack(code)
126
+ assert_equal expected, actual
127
+
128
+ code = "var b='something'+'else',a={'+':function(){return'nothing'+'at all'}}"
129
+ expected = "var b='somethingelse',a={'+':function(){return'nothingat all'}}"
130
+ actual = Packr.pack(code)
131
+ assert_equal expected, actual
132
+ end
133
+
134
+ def test_conditional_comments
135
+ expected = @data[:conditional_comments][0][:packed]
136
+ actual = Packr.pack(@data[:conditional_comments][0][:source], :shrink_vars => true)
137
+ File.open(@data[:conditional_comments][0][:output], 'wb') { |f| f.write(actual) }
138
+ assert_equal expected, actual
139
+ end
140
+ end
metadata CHANGED
@@ -1,66 +1,94 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
2
  name: packr
5
3
  version: !ruby/object:Gem::Version
6
- version: 1.0.2
7
- date: 2007-12-13 00:00:00 +00:00
8
- summary: A Ruby port of Dean Edwards' JavaScript compressor
9
- require_paths:
10
- - lib
11
- email: james@jcoglan.com
12
- homepage: http://blog.jcoglan.com/packr/
13
- rubyforge_project:
14
- description:
15
- autorequire: lib/packr.rb
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: 3.1.0
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
7
  - James Coglan
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-02-22 00:00:00 +00:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: oyster
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: hoe
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.8.2
34
+ version:
35
+ description: PackR is a Ruby version of Dean Edwards' JavaScript compressor.
36
+ email:
37
+ - jcoglan@googlemail.com
38
+ executables:
39
+ - packr
40
+ extensions: []
41
+
42
+ extra_rdoc_files:
43
+ - History.txt
44
+ - Manifest.txt
45
+ - README.txt
31
46
  files:
32
- - lib/packr
47
+ - History.txt
48
+ - Manifest.txt
49
+ - README.txt
50
+ - Rakefile
51
+ - bin/packr
33
52
  - lib/packr.rb
34
53
  - lib/string.rb
54
+ - lib/packr/map.rb
55
+ - lib/packr/collection.rb
35
56
  - lib/packr/regexp_group.rb
57
+ - lib/packr/constants.rb
58
+ - lib/packr/encoder.rb
59
+ - lib/packr/minifier.rb
60
+ - lib/packr/parser.rb
61
+ - lib/packr/privates.rb
62
+ - lib/packr/shrinker.rb
36
63
  - lib/packr/words.rb
37
- - README
38
- test_files:
39
- - test/assets
40
- - test/packr_test.rb
41
- - test/assets/packed
42
- - test/assets/src
43
- - test/assets/packed/controls.js
44
- - test/assets/packed/dragdrop.js
45
- - test/assets/packed/effects.js
46
- - test/assets/packed/prototype.js
47
- - test/assets/packed/prototype_shrunk.js
48
- - test/assets/src/controls.js
49
- - test/assets/src/dragdrop.js
50
- - test/assets/src/effects.js
51
- - test/assets/src/prototype.js
64
+ - lib/packr/base62.rb
65
+ - test/test_packr.rb
66
+ has_rdoc: true
67
+ homepage: http://github.com/jcoglan/packr
68
+ post_install_message:
52
69
  rdoc_options:
53
70
  - --main
54
- - README
55
- - --line-numbers
56
- - --inline-source
57
- extra_rdoc_files:
58
- - README
59
- executables: []
60
-
61
- extensions: []
62
-
71
+ - README.txt
72
+ require_paths:
73
+ - lib
74
+ required_ruby_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: "0"
79
+ version:
80
+ required_rubygems_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: "0"
85
+ version:
63
86
  requirements: []
64
87
 
65
- dependencies: []
66
-
88
+ rubyforge_project: packr
89
+ rubygems_version: 1.3.1
90
+ signing_key:
91
+ specification_version: 2
92
+ summary: PackR is a Ruby version of Dean Edwards' JavaScript compressor.
93
+ test_files:
94
+ - test/test_packr.rb
data/README DELETED
@@ -1,118 +0,0 @@
1
- == PackR
2
-
3
- PackR is a Ruby port of Dean Edwards' MIT-licensed JavaScript compressor, Packer:
4
-
5
- # Packer version 3.0 (final) - copyright 2004-2007, Dean Edwards
6
- # http://www.opensource.org/licenses/mit-license
7
- http://dean.edwards.name/packer/
8
-
9
- This version is based on Packer 3.0. You may find that the results it produces
10
- are not strictly identical to those of the JavaScript version, but the difference is
11
- just a question of how the base-62 word list is ordered -- your scripts
12
- will work just like those produced with the online version. The level of
13
- compression achieved is identical between the two versions.
14
-
15
- === Installation
16
-
17
- PackR is available both as a gem and as a Rails plugin. The plugin gives you the
18
- +Packr+ class from the gem, plus some helpful +rake+ tasks to use during Rails
19
- development. To get the gem:
20
-
21
- gem install packr
22
-
23
- To get the Rails plugin:
24
-
25
- ruby script/plugin install
26
- http://svn.jcoglan.com/packr/trunk/packr
27
-
28
- === Usage
29
-
30
- Usage is dead simple. Within your Ruby/Rails app, you can compress pieces of code
31
- like this:
32
-
33
- compressed = Packr.pack(script)
34
-
35
- # Pass options to control the type of compression
36
- compressed = Packr.pack(script, :shrink_vars => true)
37
- compressed = Packr.pack(script, :base62 => true)
38
- compressed = Packr.pack(script, :shrink_vars => true, :base62 => true)
39
-
40
- If you want to compress a particular file, you can do this:
41
-
42
- Packr.pack_file(path, ... options as above ...)
43
-
44
- Be careful with that - it will overwrite the contents of the file with
45
- the packed version. Be a good kid and use version control in case something
46
- goes wrong and you lose all your source code!
47
-
48
- If you want PackR's variable-shrinking routine to preserve certain variable names,
49
- you can tell it to do so by instantiating it and telling it which names you want to
50
- preserve:
51
-
52
- my_packr = Packr.new
53
- my_packr.protect_vars(:some, :variable, :names)
54
-
55
- my_packr.pack('var func = function(foo, bar, some) { return some(foo + bar); }', :shrink_vars => true)
56
- #=> "var func=function(a,b,some){return some(a+b)}"
57
-
58
- If you want to protect the same variables for all scripts your program compresses,
59
- tell the +Packr+ class to protect them:
60
-
61
- Packr.protect_vars(:some, :variable, :names)
62
-
63
- Packr.pack('var func = function(foo, bar, some) { return some(foo + bar); }', :shrink_vars => true)
64
- #=> "var func=function(a,b,some){return some(a+b)}"
65
-
66
- By default, PackR always protects the variable <tt>$super</tt> so you can compress
67
- Prototype code that uses class inheritance. The constant +PROTECTED_NAMES+ in the
68
- +Packr+ source code controls which variables are protected by default.
69
-
70
- === Automated packing
71
-
72
- When installed as a Rails plugin, PackR also comes with a +rake+ task to let you
73
- batch-pack all your scripts. To use it, store any files you want to serve in
74
- packed form in the directory <tt>lib/javascripts</tt>. (The idea is that you won't
75
- be serving the source files to the public, so why keep them in the public folder?
76
- Also, it keeps the source files and packed copies nicely separated.) Then run:
77
-
78
- rake packr:pack_libs
79
-
80
- You can specify the type of packing using flags:
81
-
82
- rake packr:pack_libs shrink_vars=
83
- rake packr:pack_libs base62= shrink_vars=
84
-
85
- PackR will put packed copies of all the scripts from <tt>lib/javascripts</tt> in
86
- <tt>public/javascripts</tt>. Again, be careful as this will overwrite any pre-existing
87
- files in your public directory.
88
-
89
- It is not recommended to run this as part of your deployment process, as you will
90
- need to verfiy that your JavaScript works when packed before committing it. PackR
91
- works using regular expressions -- not a true JavaScript interpreter -- and cannot
92
- fix missing semicolons for you.
93
-
94
- Also, DO NOT use PackR to compress files on-the-fly in response to HTTP
95
- requests. The packing process can be quite processor-intensive and it will
96
- make you app very slow when serving script files.
97
-
98
- === License
99
-
100
- Copyright (c) 2007 Dean Edwards, James Coglan
101
-
102
- Permission is hereby granted, free of charge, to any person obtaining
103
- a copy of this software and associated documentation files (the "Software"),
104
- to deal in the Software without restriction, including without limitation
105
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
106
- and/or sell copies of the Software, and to permit persons to whom the
107
- Software is furnished to do so, subject to the following conditions:
108
-
109
- The above copyright notice and this permission notice shall be included
110
- in all copies or substantial portions of the Software.
111
-
112
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
113
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
114
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
115
- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
116
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
117
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
118
- DEALINGS IN THE SOFTWARE.
@@ -1 +0,0 @@
1
- if(typeof Effect=='undefined')throw("controls.js requires including script.aculo.us' effects.js library");var Autocompleter={}Autocompleter.Base=function(){};Autocompleter.Base.prototype={baseInitialize:function(element,update,options){this.element=$(element);this.update=$(update);this.hasFocus=false;this.changed=false;this.active=false;this.index=0;this.entryCount=0;if(this.setOptions)this.setOptions(options);else this.options=options||{};this.options.paramName=this.options.paramName||this.element.name;this.options.tokens=this.options.tokens||[];this.options.frequency=this.options.frequency||0.4;this.options.minChars=this.options.minChars||1;this.options.onShow=this.options.onShow||function(element,update){if(!update.style.position||update.style.position=='absolute'){update.style.position='absolute';Position.clone(element,update,{setHeight:false,offsetTop:element.offsetHeight})}Effect.Appear(update,{duration:0.15})};this.options.onHide=this.options.onHide||function(element,update){new Effect.Fade(update,{duration:0.15})};if(typeof(this.options.tokens)=='string')this.options.tokens=new Array(this.options.tokens);this.observer=null;this.element.setAttribute('autocomplete','off');Element.hide(this.update);Event.observe(this.element,"blur",this.onBlur.bindAsEventListener(this));Event.observe(this.element,"keypress",this.onKeyPress.bindAsEventListener(this))},show:function(){if(Element.getStyle(this.update,'display')=='none')this.options.onShow(this.element,this.update);if(!this.iefix&&(navigator.appVersion.indexOf('MSIE')>0)&&(navigator.userAgent.indexOf('Opera')<0)&&(Element.getStyle(this.update,'position')=='absolute')){new Insertion.After(this.update,'<iframe id="'+this.update.id+'_iefix" '+'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" '+'src="javascript:false;" frameborder="0" scrolling="no"></iframe>');this.iefix=$(this.update.id+'_iefix')}if(this.iefix)setTimeout(this.fixIEOverlapping.bind(this),50)},fixIEOverlapping:function(){Position.clone(this.update,this.iefix,{setTop:(!this.update.style.height)});this.iefix.style.zIndex=1;this.update.style.zIndex=2;Element.show(this.iefix)},hide:function(){this.stopIndicator();if(Element.getStyle(this.update,'display')!='none')this.options.onHide(this.element,this.update);if(this.iefix)Element.hide(this.iefix)},startIndicator:function(){if(this.options.indicator)Element.show(this.options.indicator)},stopIndicator:function(){if(this.options.indicator)Element.hide(this.options.indicator)},onKeyPress:function(event){if(this.active)switch(event.keyCode){case Event.KEY_TAB:case Event.KEY_RETURN:this.selectEntry();Event.stop(event);case Event.KEY_ESC:this.hide();this.active=false;Event.stop(event);return;case Event.KEY_LEFT:case Event.KEY_RIGHT:return;case Event.KEY_UP:this.markPrevious();this.render();if(navigator.appVersion.indexOf('AppleWebKit')>0)Event.stop(event);return;case Event.KEY_DOWN:this.markNext();this.render();if(navigator.appVersion.indexOf('AppleWebKit')>0)Event.stop(event);return}else if(event.keyCode==Event.KEY_TAB||event.keyCode==Event.KEY_RETURN||(navigator.appVersion.indexOf('AppleWebKit')>0&&event.keyCode==0))return;this.changed=true;this.hasFocus=true;if(this.observer)clearTimeout(this.observer);this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000)},activate:function(){this.changed=false;this.hasFocus=true;this.getUpdatedChoices()},onHover:function(event){var element=Event.findElement(event,'LI');if(this.index!=element.autocompleteIndex){this.index=element.autocompleteIndex;this.render()}Event.stop(event)},onClick:function(event){var element=Event.findElement(event,'LI');this.index=element.autocompleteIndex;this.selectEntry();this.hide()},onBlur:function(event){setTimeout(this.hide.bind(this),250);this.hasFocus=false;this.active=false},render:function(){if(this.entryCount>0){for(var i=0;i<this.entryCount;i++)this.index==i?Element.addClassName(this.getEntry(i),"selected"):Element.removeClassName(this.getEntry(i),"selected");if(this.hasFocus){this.show();this.active=true}}else{this.active=false;this.hide()}},markPrevious:function(){if(this.index>0)this.index--else this.index=this.entryCount-1;this.getEntry(this.index)},markNext:function(){if(this.index<this.entryCount-1)this.index++else this.index=0;this.getEntry(this.index)},getEntry:function(index){return this.update.firstChild.childNodes[index]},getCurrentEntry:function(){return this.getEntry(this.index)},selectEntry:function(){this.active=false;this.updateElement(this.getCurrentEntry())},updateElement:function(selectedElement){if(this.options.updateElement){this.options.updateElement(selectedElement);return}var value='';if(this.options.select){var nodes=document.getElementsByClassName(this.options.select,selectedElement)||[];if(nodes.length>0)value=Element.collectTextNodes(nodes[0],this.options.select)}else value=Element.collectTextNodesIgnoreClass(selectedElement,'informal');var lastTokenPos=this.findLastToken();if(lastTokenPos!=-1){var newValue=this.element.value.substr(0,lastTokenPos+1);var whitespace=this.element.value.substr(lastTokenPos+1).match(/^\s+/);if(whitespace)newValue+=whitespace[0];this.element.value=newValue+value}else{this.element.value=value}this.element.focus();if(this.options.afterUpdateElement)this.options.afterUpdateElement(this.element,selectedElement)},updateChoices:function(choices){if(!this.changed&&this.hasFocus){this.update.innerHTML=choices;Element.cleanWhitespace(this.update);Element.cleanWhitespace(this.update.down());if(this.update.firstChild&&this.update.down().childNodes){this.entryCount=this.update.down().childNodes.length;for(var i=0;i<this.entryCount;i++){var entry=this.getEntry(i);entry.autocompleteIndex=i;this.addObservers(entry)}}else{this.entryCount=0}this.stopIndicator();this.index=0;if(this.entryCount==1&&this.options.autoSelect){this.selectEntry();this.hide()}else{this.render()}}},addObservers:function(element){Event.observe(element,"mouseover",this.onHover.bindAsEventListener(this));Event.observe(element,"click",this.onClick.bindAsEventListener(this))},onObserverEvent:function(){this.changed=false;if(this.getToken().length>=this.options.minChars){this.startIndicator();this.getUpdatedChoices()}else{this.active=false;this.hide()}},getToken:function(){var tokenPos=this.findLastToken();if(tokenPos!=-1)var ret=this.element.value.substr(tokenPos+1).replace(/^\s+/,'').replace(/\s+$/,'');else var ret=this.element.value;return/\n/.test(ret)?'':ret},findLastToken:function(){var lastTokenPos=-1;for(var i=0;i<this.options.tokens.length;i++){var thisTokenPos=this.element.value.lastIndexOf(this.options.tokens[i]);if(thisTokenPos>lastTokenPos)lastTokenPos=thisTokenPos}return lastTokenPos}}Ajax.Autocompleter=Class.create();Object.extend(Object.extend(Ajax.Autocompleter.prototype,Autocompleter.Base.prototype),{initialize:function(element,update,url,options){this.baseInitialize(element,update,options);this.options.asynchronous=true;this.options.onComplete=this.onComplete.bind(this);this.options.defaultParams=this.options.parameters||null;this.url=url},getUpdatedChoices:function(){entry=encodeURIComponent(this.options.paramName)+'='+encodeURIComponent(this.getToken());this.options.parameters=this.options.callback?this.options.callback(this.element,entry):entry;if(this.options.defaultParams)this.options.parameters+='&'+this.options.defaultParams;new Ajax.Request(this.url,this.options)},onComplete:function(request){this.updateChoices(request.responseText)}});Autocompleter.Local=Class.create();Autocompleter.Local.prototype=Object.extend(new Autocompleter.Base(),{initialize:function(element,update,array,options){this.baseInitialize(element,update,options);this.options.array=array},getUpdatedChoices:function(){this.updateChoices(this.options.selector(this))},setOptions:function(options){this.options=Object.extend({choices:10,partialSearch:true,partialChars:2,ignoreCase:true,fullSearch:false,selector:function(instance){var ret=[];var partial=[];var entry=instance.getToken();var count=0;for(var i=0;i<instance.options.array.length&&ret.length<instance.options.choices;i++){var elem=instance.options.array[i];var foundPos=instance.options.ignoreCase?elem.toLowerCase().indexOf(entry.toLowerCase()):elem.indexOf(entry);while(foundPos!=-1){if(foundPos==0&&elem.length!=entry.length){ret.push("<li><strong>"+elem.substr(0,entry.length)+"</strong>"+elem.substr(entry.length)+"</li>");break}else if(entry.length>=instance.options.partialChars&&instance.options.partialSearch&&foundPos!=-1){if(instance.options.fullSearch||/\s/.test(elem.substr(foundPos-1,1))){partial.push("<li>"+elem.substr(0,foundPos)+"<strong>"+elem.substr(foundPos,entry.length)+"</strong>"+elem.substr(foundPos+entry.length)+"</li>");break}}foundPos=instance.options.ignoreCase?elem.toLowerCase().indexOf(entry.toLowerCase(),foundPos+1):elem.indexOf(entry,foundPos+1)}}if(partial.length)ret=ret.concat(partial.slice(0,instance.options.choices-ret.length))return"<ul>"+ret.join('')+"</ul>"}},options||{})}});Field.scrollFreeActivate=function(field){setTimeout(function(){Field.activate(field)},1)}Ajax.InPlaceEditor=Class.create();Ajax.InPlaceEditor.defaultHighlightColor="#FFFF99";Ajax.InPlaceEditor.prototype={initialize:function(element,url,options){this.url=url;this.element=$(element);this.options=Object.extend({paramName:"value",okButton:true,okText:"ok",cancelLink:true,cancelText:"cancel",savingText:"Saving...",clickToEditText:"Click to edit",okText:"ok",rows:1,onComplete:function(transport,element){new Effect.Highlight(element,{startcolor:this.options.highlightcolor})},onFailure:function(transport){alert("Error communicating with the server: "+transport.responseText.stripTags())},callback:function(form){return Form.serialize(form)},handleLineBreaks:true,loadingText:'Loading...',savingClassName:'inplaceeditor-saving',loadingClassName:'inplaceeditor-loading',formClassName:'inplaceeditor-form',highlightcolor:Ajax.InPlaceEditor.defaultHighlightColor,highlightendcolor:"#FFFFFF",externalControl:null,submitOnBlur:false,ajaxOptions:{},evalScripts:false},options||{});if(!this.options.formId&&this.element.id){this.options.formId=this.element.id+"-inplaceeditor";if($(this.options.formId)){this.options.formId=null}}if(this.options.externalControl){this.options.externalControl=$(this.options.externalControl)}this.originalBackground=Element.getStyle(this.element,'background-color');if(!this.originalBackground){this.originalBackground="transparent"}this.element.title=this.options.clickToEditText;this.onclickListener=this.enterEditMode.bindAsEventListener(this);this.mouseoverListener=this.enterHover.bindAsEventListener(this);this.mouseoutListener=this.leaveHover.bindAsEventListener(this);Event.observe(this.element,'click',this.onclickListener);Event.observe(this.element,'mouseover',this.mouseoverListener);Event.observe(this.element,'mouseout',this.mouseoutListener);if(this.options.externalControl){Event.observe(this.options.externalControl,'click',this.onclickListener);Event.observe(this.options.externalControl,'mouseover',this.mouseoverListener);Event.observe(this.options.externalControl,'mouseout',this.mouseoutListener)}},enterEditMode:function(evt){if(this.saving)return;if(this.editing)return;this.editing=true;this.onEnterEditMode();if(this.options.externalControl){Element.hide(this.options.externalControl)}Element.hide(this.element);this.createForm();this.element.parentNode.insertBefore(this.form,this.element);if(!this.options.loadTextURL)Field.scrollFreeActivate(this.editField);if(evt){Event.stop(evt)}return false},createForm:function(){this.form=document.createElement("form");this.form.id=this.options.formId;Element.addClassName(this.form,this.options.formClassName)this.form.onsubmit=this.onSubmit.bind(this);this.createEditField();if(this.options.textarea){var br=document.createElement("br");this.form.appendChild(br)}if(this.options.okButton){okButton=document.createElement("input");okButton.type="submit";okButton.value=this.options.okText;okButton.className='editor_ok_button';this.form.appendChild(okButton)}if(this.options.cancelLink){cancelLink=document.createElement("a");cancelLink.href="#";cancelLink.appendChild(document.createTextNode(this.options.cancelText));cancelLink.onclick=this.onclickCancel.bind(this);cancelLink.className='editor_cancel';this.form.appendChild(cancelLink)}},hasHTMLLineBreaks:function(string){if(!this.options.handleLineBreaks)return false;return string.match(/<br/i)||string.match(/<p>/i)},convertHTMLLineBreaks:function(string){return string.replace(/<br>/gi,"\n").replace(/<br\/>/gi,"\n").replace(/<\/p>/gi,"\n").replace(/<p>/gi,"")},createEditField:function(){var text;if(this.options.loadTextURL){text=this.options.loadingText}else{text=this.getText()}var obj=this;if(this.options.rows==1&&!this.hasHTMLLineBreaks(text)){this.options.textarea=false;var textField=document.createElement("input");textField.obj=this;textField.type="text";textField.name=this.options.paramName;textField.value=text;textField.style.backgroundColor=this.options.highlightcolor;textField.className='editor_field';var size=this.options.size||this.options.cols||0;if(size!=0)textField.size=size;if(this.options.submitOnBlur)textField.onblur=this.onSubmit.bind(this);this.editField=textField}else{this.options.textarea=true;var textArea=document.createElement("textarea");textArea.obj=this;textArea.name=this.options.paramName;textArea.value=this.convertHTMLLineBreaks(text);textArea.rows=this.options.rows;textArea.cols=this.options.cols||40;textArea.className='editor_field';if(this.options.submitOnBlur)textArea.onblur=this.onSubmit.bind(this);this.editField=textArea}if(this.options.loadTextURL){this.loadExternalText()}this.form.appendChild(this.editField)},getText:function(){return this.element.innerHTML},loadExternalText:function(){Element.addClassName(this.form,this.options.loadingClassName);this.editField.disabled=true;new Ajax.Request(this.options.loadTextURL,Object.extend({asynchronous:true,onComplete:this.onLoadedExternalText.bind(this)},this.options.ajaxOptions))},onLoadedExternalText:function(transport){Element.removeClassName(this.form,this.options.loadingClassName);this.editField.disabled=false;this.editField.value=transport.responseText.stripTags();Field.scrollFreeActivate(this.editField)},onclickCancel:function(){this.onComplete();this.leaveEditMode();return false},onFailure:function(transport){this.options.onFailure(transport);if(this.oldInnerHTML){this.element.innerHTML=this.oldInnerHTML;this.oldInnerHTML=null}return false},onSubmit:function(){var form=this.form;var value=this.editField.value;this.onLoading();if(this.options.evalScripts){new Ajax.Request(this.url,Object.extend({parameters:this.options.callback(form,value),onComplete:this.onComplete.bind(this),onFailure:this.onFailure.bind(this),asynchronous:true,evalScripts:true},this.options.ajaxOptions))}else{new Ajax.Updater({success:this.element,failure:null},this.url,Object.extend({parameters:this.options.callback(form,value),onComplete:this.onComplete.bind(this),onFailure:this.onFailure.bind(this)},this.options.ajaxOptions))}if(arguments.length>1){Event.stop(arguments[0])}return false},onLoading:function(){this.saving=true;this.removeForm();this.leaveHover();this.showSaving()},showSaving:function(){this.oldInnerHTML=this.element.innerHTML;this.element.innerHTML=this.options.savingText;Element.addClassName(this.element,this.options.savingClassName);this.element.style.backgroundColor=this.originalBackground;Element.show(this.element)},removeForm:function(){if(this.form){if(this.form.parentNode)Element.remove(this.form);this.form=null}},enterHover:function(){if(this.saving)return;this.element.style.backgroundColor=this.options.highlightcolor;if(this.effect){this.effect.cancel()}Element.addClassName(this.element,this.options.hoverClassName)},leaveHover:function(){if(this.options.backgroundColor){this.element.style.backgroundColor=this.oldBackground}Element.removeClassName(this.element,this.options.hoverClassName)if(this.saving)return;this.effect=new Effect.Highlight(this.element,{startcolor:this.options.highlightcolor,endcolor:this.options.highlightendcolor,restorecolor:this.originalBackground})},leaveEditMode:function(){Element.removeClassName(this.element,this.options.savingClassName);this.removeForm();this.leaveHover();this.element.style.backgroundColor=this.originalBackground;Element.show(this.element);if(this.options.externalControl){Element.show(this.options.externalControl)}this.editing=false;this.saving=false;this.oldInnerHTML=null;this.onLeaveEditMode()},onComplete:function(transport){this.leaveEditMode();this.options.onComplete.bind(this)(transport,this.element)},onEnterEditMode:function(){},onLeaveEditMode:function(){},dispose:function(){if(this.oldInnerHTML){this.element.innerHTML=this.oldInnerHTML}this.leaveEditMode();Event.stopObserving(this.element,'click',this.onclickListener);Event.stopObserving(this.element,'mouseover',this.mouseoverListener);Event.stopObserving(this.element,'mouseout',this.mouseoutListener);if(this.options.externalControl){Event.stopObserving(this.options.externalControl,'click',this.onclickListener);Event.stopObserving(this.options.externalControl,'mouseover',this.mouseoverListener);Event.stopObserving(this.options.externalControl,'mouseout',this.mouseoutListener)}}};Ajax.InPlaceCollectionEditor=Class.create();Object.extend(Ajax.InPlaceCollectionEditor.prototype,Ajax.InPlaceEditor.prototype);Object.extend(Ajax.InPlaceCollectionEditor.prototype,{createEditField:function(){if(!this.cached_selectTag){var selectTag=document.createElement("select");var collection=this.options.collection||[];var optionTag;collection.each(function(e,i){optionTag=document.createElement("option");optionTag.value=(e instanceof Array)?e[0]:e;if((typeof this.options.value=='undefined')&&((e instanceof Array)?this.element.innerHTML==e[1]:e==optionTag.value))optionTag.selected=true;if(this.options.value==optionTag.value)optionTag.selected=true;optionTag.appendChild(document.createTextNode((e instanceof Array)?e[1]:e));selectTag.appendChild(optionTag)}.bind(this));this.cached_selectTag=selectTag}this.editField=this.cached_selectTag;if(this.options.loadTextURL)this.loadExternalText();this.form.appendChild(this.editField);this.options.callback=function(form,value){return"value="+encodeURIComponent(value)}}});Form.Element.DelayedObserver=Class.create();Form.Element.DelayedObserver.prototype={initialize:function(element,delay,callback){this.delay=delay||0.5;this.element=$(element);this.callback=callback;this.timer=null;this.lastValue=$F(this.element);Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this))},delayedListener:function(event){if(this.lastValue==$F(this.element))return;if(this.timer)clearTimeout(this.timer);this.timer=setTimeout(this.onTimerEvent.bind(this),this.delay*1000);this.lastValue=$F(this.element)},onTimerEvent:function(){this.timer=null;this.callback(this.element,$F(this.element))}};
@@ -1 +0,0 @@
1
- if(typeof Effect=='undefined')throw("dragdrop.js requires including script.aculo.us' effects.js library");var Droppables={drops:[],remove:function(a){this.drops=this.drops.reject(function(d){return d.element==$(a)})},add:function(a){a=$(a);var b=Object.extend({greedy:true,hoverclass:null,tree:false},arguments[1]||{});if(b.containment){b._containers=[];var d=b.containment;if((typeof d=='object')&&(d.constructor==Array)){d.each(function(c){b._containers.push($(c))})}else{b._containers.push($(d))}}if(b.accept)b.accept=[b.accept].flatten();Element.makePositioned(a);b.element=a;this.drops.push(b)},findDeepestChild:function(a){deepest=a[0];for(i=1;i<a.length;++i)if(Element.isParent(a[i].element,deepest.element))deepest=a[i];return deepest},isContained:function(a,b){var d;if(b.tree){d=a.treeNode}else{d=a.parentNode}return b._containers.detect(function(c){return d==c})},isAffected:function(a,b,c){return((c.element!=b)&&((!c._containers)||this.isContained(b,c))&&((!c.accept)||(Element.classNames(b).detect(function(v){return c.accept.include(v)})))&&Position.within(c.element,a[0],a[1]))},deactivate:function(a){if(a.hoverclass)Element.removeClassName(a.element,a.hoverclass);this.last_active=null},activate:function(a){if(a.hoverclass)Element.addClassName(a.element,a.hoverclass);this.last_active=a},show:function(b,c){if(!this.drops.length)return;var d=[];if(this.last_active)this.deactivate(this.last_active);this.drops.each(function(a){if(Droppables.isAffected(b,c,a))d.push(a)});if(d.length>0){drop=Droppables.findDeepestChild(d);Position.within(drop.element,b[0],b[1]);if(drop.onHover)drop.onHover(c,drop.element,Position.overlap(drop.overlap,drop.element));Droppables.activate(drop)}},fire:function(a,b){if(!this.last_active)return;Position.prepare();if(this.isAffected([Event.pointerX(a),Event.pointerY(a)],b,this.last_active))if(this.last_active.onDrop)this.last_active.onDrop(b,this.last_active.element,a)},reset:function(){if(this.last_active)this.deactivate(this.last_active)}}var Draggables={drags:[],observers:[],register:function(a){if(this.drags.length==0){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(a)},unregister:function(a){this.drags=this.drags.reject(function(d){return d==a});if(this.drags.length==0){Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);Event.stopObserving(document,"keypress",this.eventKeypress)}},activate:function(a){if(a.options.delay){this._timeout=setTimeout(function(){Draggables._timeout=null;window.focus();Draggables.activeDraggable=a}.bind(this),a.options.delay)}else{window.focus();this.activeDraggable=a}},deactivate:function(){this.activeDraggable=null},updateDrag:function(a){if(!this.activeDraggable)return;var b=[Event.pointerX(a),Event.pointerY(a)];if(this._lastPointer&&(this._lastPointer.inspect()==b.inspect()))return;this._lastPointer=b;this.activeDraggable.updateDrag(a,b)},endDrag:function(a){if(this._timeout){clearTimeout(this._timeout);this._timeout=null}if(!this.activeDraggable)return;this._lastPointer=null;this.activeDraggable.endDrag(a);this.activeDraggable=null},keyPress:function(a){if(this.activeDraggable)this.activeDraggable.keyPress(a)},addObserver:function(a){this.observers.push(a);this._cacheObserverCallbacks()},removeObserver:function(a){this.observers=this.observers.reject(function(o){return o.element==a});this._cacheObserverCallbacks()},notify:function(a,b,c){if(this[a+'Count']>0)this.observers.each(function(o){if(o[a])o[a](a,b,c)});if(b.options[a])b.options[a](b,c)},_cacheObserverCallbacks:function(){['onStart','onEnd','onDrag'].each(function(a){Draggables[a+'Count']=Draggables.observers.select(function(o){return o[a]}).length})}}var Draggable=Class.create();Draggable._dragging={};Draggable.prototype={initialize:function(e){var f={handle:false,reverteffect:function(a,b,c){var d=Math.sqrt(Math.abs(b^2)+Math.abs(c^2))*0.02;new Effect.Move(a,{x:-c,y:-b,duration:d,queue:{scope:'_draggable',position:'end'}})},endeffect:function(a){var b=typeof a._opacity=='number'?a._opacity:1.0;new Effect.Opacity(a,{duration:0.2,from:0.7,to:b,queue:{scope:'_draggable',position:'end'},afterFinish:function(){Draggable._dragging[a]=false}})},zindex:1000,revert:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,snap:false,delay:0};if(!arguments[1]||typeof arguments[1].endeffect=='undefined')Object.extend(f,{starteffect:function(a){a._opacity=Element.getOpacity(a);Draggable._dragging[a]=true;new Effect.Opacity(a,{duration:0.2,from:a._opacity,to:0.7})}});var g=Object.extend(f,arguments[1]||{});this.element=$(e);if(g.handle&&(typeof g.handle=='string'))this.handle=this.element.down('.'+g.handle,0);if(!this.handle)this.handle=$(g.handle);if(!this.handle)this.handle=this.element;if(g.scroll&&!g.scroll.scrollTo&&!g.scroll.outerHTML){g.scroll=$(g.scroll);this._isScrollChild=Element.childOf(this.element,g.scroll)}Element.makePositioned(this.element);this.delta=this.currentDelta();this.options=g;this.dragging=false;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(a){if(typeof Draggable._dragging[this.element]!='undefined'&&Draggable._dragging[this.element])return;if(Event.isLeftClick(a)){var b=Event.element(a);if(b.tagName&&(b.tagName=='INPUT'||b.tagName=='SELECT'||b.tagName=='OPTION'||b.tagName=='BUTTON'||b.tagName=='TEXTAREA'))return;var c=[Event.pointerX(a),Event.pointerY(a)];var d=Position.cumulativeOffset(this.element);this.offset=[0,1].map(function(i){return(c[i]-d[i])});Draggables.activate(this);Event.stop(a)}},startDrag:function(a){this.dragging=true;if(this.options.zindex){this.originalZ=parseInt(Element.getStyle(this.element,'z-index')||0);this.element.style.zIndex=this.options.zindex}if(this.options.ghosting){this._clone=this.element.cloneNode(true);Position.absolutize(this.element);this.element.parentNode.insertBefore(this._clone,this.element)}if(this.options.scroll){if(this.options.scroll==window){var b=this._getWindowScroll(this.options.scroll);this.originalScrollLeft=b.left;this.originalScrollTop=b.top}else{this.originalScrollLeft=this.options.scroll.scrollLeft;this.originalScrollTop=this.options.scroll.scrollTop}}Draggables.notify('onStart',this,a);if(this.options.starteffect)this.options.starteffect(this.element)},updateDrag:function(a,b){if(!this.dragging)this.startDrag(a);Position.prepare();Droppables.show(b,this.element);Draggables.notify('onDrag',this,a);this.draw(b);if(this.options.change)this.options.change(this);if(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);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 c=[0,0];if(b[0]<(p[0]+this.options.scrollSensitivity))c[0]=b[0]-(p[0]+this.options.scrollSensitivity);if(b[1]<(p[1]+this.options.scrollSensitivity))c[1]=b[1]-(p[1]+this.options.scrollSensitivity);if(b[0]>(p[2]-this.options.scrollSensitivity))c[0]=b[0]-(p[2]-this.options.scrollSensitivity);if(b[1]>(p[3]-this.options.scrollSensitivity))c[1]=b[1]-(p[3]-this.options.scrollSensitivity);this.startScrolling(c)}if(navigator.appVersion.indexOf('AppleWebKit')>0)window.scrollBy(0,0);Event.stop(a)},finishDrag:function(a,b){this.dragging=false;if(this.options.ghosting){Position.relativize(this.element);Element.remove(this._clone);this._clone=null}if(b)Droppables.fire(a,this.element);Draggables.notify('onEnd',this,a);var c=this.options.revert;if(c&&typeof c=='function')c=c(this.element);var d=this.currentDelta();if(c&&this.options.reverteffect){this.options.reverteffect(this.element,d[1]-this.delta[1],d[0]-this.delta[0])}else{this.delta=d}if(this.options.zindex)this.element.style.zIndex=this.originalZ;if(this.options.endeffect)this.options.endeffect(this.element);Draggables.deactivate(this);Droppables.reset()},keyPress:function(a){if(a.keyCode!=Event.KEY_ESC)return;this.finishDrag(a,false);Event.stop(a)},endDrag:function(a){if(!this.dragging)return;this.stopScrolling();this.finishDrag(a,true);Event.stop(a)},draw:function(a){var b=Position.cumulativeOffset(this.element);if(this.options.ghosting){var r=Position.realOffset(this.element);b[0]+=r[0]-Position.deltaX;b[1]+=r[1]-Position.deltaY}var d=this.currentDelta();b[0]-=d[0];b[1]-=d[1];if(this.options.scroll&&(this.options.scroll!=window&&this._isScrollChild)){b[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft;b[1]-=this.options.scroll.scrollTop-this.originalScrollTop}var p=[0,1].map(function(i){return(a[i]-b[i]-this.offset[i])}.bind(this));if(this.options.snap){if(typeof this.options.snap=='function'){p=this.options.snap(p[0],p[1],this)}else{if(this.options.snap instanceof Array){p=p.map(function(v,i){return Math.round(v/this.options.snap[i])*this.options.snap[i]}.bind(this))}else{p=p.map(function(v){return Math.round(v/this.options.snap)*this.options.snap}.bind(this))}}}var c=this.element.style;if((!this.options.constraint)||(this.options.constraint=='horizontal'))c.left=p[0]+"px";if((!this.options.constraint)||(this.options.constraint=='vertical'))c.top=p[1]+"px";if(c.visibility=="hidden")c.visibility=""},stopScrolling:function(){if(this.scrollInterval){clearInterval(this.scrollInterval);this.scrollInterval=null;Draggables._lastScrollPointer=null}},startScrolling:function(a){if(!(a[0]||a[1]))return;this.scrollSpeed=[a[0]*this.options.scrollSpeed,a[1]*this.options.scrollSpeed];this.lastScrolled=new Date();this.scrollInterval=setInterval(this.scroll.bind(this),10)},scroll:function(){var a=new Date();var b=a-this.lastScrolled;this.lastScrolled=a;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){if(this.scrollSpeed[0]||this.scrollSpeed[1]){var d=b/1000;this.options.scroll.scrollTo(left+d*this.scrollSpeed[0],top+d*this.scrollSpeed[1])}}}else{this.options.scroll.scrollLeft+=this.scrollSpeed[0]*b/1000;this.options.scroll.scrollTop+=this.scrollSpeed[1]*b/1000}Position.prepare();Droppables.show(Draggables._lastPointer,this.element);Draggables.notify('onDrag',this);if(this._isScrollChild){Draggables._lastScrollPointer=Draggables._lastScrollPointer||$A(Draggables._lastPointer);Draggables._lastScrollPointer[0]+=this.scrollSpeed[0]*b/1000;Draggables._lastScrollPointer[1]+=this.scrollSpeed[1]*b/1000;if(Draggables._lastScrollPointer[0]<0)Draggables._lastScrollPointer[0]=0;if(Draggables._lastScrollPointer[1]<0)Draggables._lastScrollPointer[1]=0;this.draw(Draggables._lastScrollPointer)}if(this.options.change)this.options.change(this)},_getWindowScroll:function(w){var T,L,W,H;with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;L=documentElement.scrollLeft}else if(w.document.body){T=body.scrollTop;L=body.scrollLeft}if(w.innerWidth){W=w.innerWidth;H=w.innerHeight}else if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;H=documentElement.clientHeight}else{W=body.offsetWidth;H=body.offsetHeight}}return{top:T,left:L,width:W,height:H}}}var SortableObserver=Class.create();SortableObserver.prototype={initialize:function(a,b){this.element=$(a);this.observer=b;this.lastValue=Sortable.serialize(this.element)},onStart:function(){this.lastValue=Sortable.serialize(this.element)},onEnd:function(){Sortable.unmark();if(this.lastValue!=Sortable.serialize(this.element))this.observer(this.element)}}var Sortable={SERIALIZE_RULE:/^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,sortables:{},_findRootElement:function(a){while(a.tagName!="BODY"){if(a.id&&Sortable.sortables[a.id])return a;a=a.parentNode}},options:function(a){a=Sortable._findRootElement($(a));if(!a)return;return Sortable.sortables[a.id]},destroy:function(a){var s=Sortable.options(a);if(s){Draggables.removeObserver(s.element);s.droppables.each(function(d){Droppables.remove(d)});s.draggables.invoke('destroy');delete Sortable.sortables[s.element.id]}},create:function(b){b=$(b);var c=Object.extend({element:b,tag:'li',dropOnEmpty:false,tree:false,treeTag:'ul',overlap:'vertical',constraint:'vertical',containment:b,handle:false,only:false,delay:0,hoverclass:null,ghosting:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,format:this.SERIALIZE_RULE,onChange:Prototype.emptyFunction,onUpdate:Prototype.emptyFunction},arguments[1]||{});this.destroy(b);var d={revert:true,scroll:c.scroll,scrollSpeed:c.scrollSpeed,scrollSensitivity:c.scrollSensitivity,delay:c.delay,ghosting:c.ghosting,constraint:c.constraint,handle:c.handle};if(c.starteffect)d.starteffect=c.starteffect;if(c.reverteffect)d.reverteffect=c.reverteffect;else if(c.ghosting)d.reverteffect=function(a){a.style.top=0;a.style.left=0};if(c.endeffect)d.endeffect=c.endeffect;if(c.zindex)d.zindex=c.zindex;var f={overlap:c.overlap,containment:c.containment,tree:c.tree,hoverclass:c.hoverclass,onHover:Sortable.onHover}var g={onHover:Sortable.onEmptyHover,overlap:c.overlap,containment:c.containment,hoverclass:c.hoverclass}Element.cleanWhitespace(b);c.draggables=[];c.droppables=[];if(c.dropOnEmpty||c.tree){Droppables.add(b,g);c.droppables.push(b)}(this.findElements(b,c)||[]).each(function(e){var a=c.handle?$(e).down('.'+c.handle,0):e;c.draggables.push(new Draggable(e,Object.extend(d,{handle:a})));Droppables.add(e,f);if(c.tree)e.treeNode=b;c.droppables.push(e)});if(c.tree){(Sortable.findTreeElements(b,c)||[]).each(function(e){Droppables.add(e,g);e.treeNode=b;c.droppables.push(e)})}this.sortables[b.id]=c;Draggables.addObserver(new SortableObserver(b,c.onUpdate))},findElements:function(a,b){return Element.findChildren(a,b.only,b.tree?true:false,b.tag)},findTreeElements:function(a,b){return Element.findChildren(a,b.only,b.tree?true:false,b.treeTag)},onHover:function(a,b,c){if(Element.isParent(b,a))return;if(c>.33&&c<.66&&Sortable.options(b).tree){return}else if(c>0.5){Sortable.mark(b,'before');if(b.previousSibling!=a){var d=a.parentNode;a.style.visibility="hidden";b.parentNode.insertBefore(a,b);if(b.parentNode!=d)Sortable.options(d).onChange(a);Sortable.options(b.parentNode).onChange(a)}}else{Sortable.mark(b,'after');var e=b.nextSibling||null;if(e!=a){var d=a.parentNode;a.style.visibility="hidden";b.parentNode.insertBefore(a,e);if(b.parentNode!=d)Sortable.options(d).onChange(a);Sortable.options(b.parentNode).onChange(a)}}},onEmptyHover:function(a,b,c){var d=a.parentNode;var e=Sortable.options(b);if(!Element.isParent(b,a)){var f;var g=Sortable.findElements(b,{tag:e.tag,only:e.only});var h=null;if(g){var i=Element.offsetSize(b,e.overlap)*(1.0-c);for(f=0;f<g.length;f+=1){if(i-Element.offsetSize(g[f],e.overlap)>=0){i-=Element.offsetSize(g[f],e.overlap)}else if(i-(Element.offsetSize(g[f],e.overlap)/2)>=0){h=f+1<g.length?g[f+1]:null;break}else{h=g[f];break}}}b.insertBefore(a,h);Sortable.options(d).onChange(a);e.onChange(a)}},unmark:function(){if(Sortable._marker)Sortable._marker.hide()},mark:function(a,b){var c=Sortable.options(a.parentNode);if(c&&!c.ghosting)return;if(!Sortable._marker){Sortable._marker=($('dropmarker')||Element.extend(document.createElement('DIV'))).hide().addClassName('dropmarker').setStyle({position:'absolute'});document.getElementsByTagName("body").item(0).appendChild(Sortable._marker)}var d=Position.cumulativeOffset(a);Sortable._marker.setStyle({left:d[0]+'px',top:d[1]+'px'});if(b=='after')if(c.overlap=='horizontal')Sortable._marker.setStyle({left:(d[0]+a.clientWidth)+'px'});else Sortable._marker.setStyle({top:(d[1]+a.clientHeight)+'px'});Sortable._marker.show()},_tree:function(a,b,c){var d=Sortable.findElements(a,b)||[];for(var i=0;i<d.length;++i){var e=d[i].id.match(b.format);if(!e)continue;var f={id:encodeURIComponent(e?e[1]:null),element:a,parent:c,children:[],position:c.children.length,container:$(d[i]).down(b.treeTag)}if(f.container)this._tree(f.container,b,f)c.children.push(f)}return c},tree:function(a){a=$(a);var b=this.options(a);var c=Object.extend({tag:b.tag,treeTag:b.treeTag,only:b.only,name:a.id,format:b.format},arguments[1]||{});var d={id:null,parent:null,children:[],container:a,position:0}return Sortable._tree(a,c,d)},_constructIndex:function(a){var b='';do{if(a.id)b='['+a.position+']'+b}while((a=a.parent)!=null);return b},sequence:function(b){b=$(b);var c=Object.extend(this.options(b),arguments[1]||{});return $(this.findElements(b,c)||[]).map(function(a){return a.id.match(c.format)?a.id.match(c.format)[1]:''})},setSequence:function(b,c){b=$(b);var d=Object.extend(this.options(b),arguments[2]||{});var e={};this.findElements(b,d).each(function(n){if(n.id.match(d.format))e[n.id.match(d.format)[1]]=[n,n.parentNode];n.parentNode.removeChild(n)});c.each(function(a){var n=e[a];if(n){n[1].appendChild(n[0]);delete e[a]}})},serialize:function(b){b=$(b);var c=Object.extend(Sortable.options(b),arguments[1]||{});var d=encodeURIComponent((arguments[1]&&arguments[1].name)?arguments[1].name:b.id);if(c.tree){return Sortable.tree(b,arguments[1]).children.map(function(a){return[d+Sortable._constructIndex(a)+"[id]="+encodeURIComponent(a.id)].concat(a.children.map(arguments.callee))}).flatten().join('&')}else{return Sortable.sequence(b,arguments[1]).map(function(a){return d+"[]="+encodeURIComponent(a)}).join('&')}}}Element.isParent=function(a,b){if(!a.parentNode||a==b)return false;if(a.parentNode==b)return true;return Element.isParent(a.parentNode,b)}Element.findChildren=function(b,c,d,f){if(!b.hasChildNodes())return null;f=f.toUpperCase();if(c)c=[c].flatten();var g=[];$A(b.childNodes).each(function(e){if(e.tagName&&e.tagName.toUpperCase()==f&&(!c||(Element.classNames(e).detect(function(v){return c.include(v)}))))g.push(e);if(d){var a=Element.findChildren(e,c,d,f);if(a)g.push(a)}});return(g.length>0?g.flatten():[])}Element.offsetSize=function(a,b){return a['offset'+((b=='vertical'||b=='height')?'Height':'Width')]}
@@ -1 +0,0 @@
1
- eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('3H.J.1K=a(){j N=\'#\';h(8.2e(0,4)==\'6A(\'){j 4d=8.2e(4,8.1J-1).8d(\',\');j i=0;7V{N+=2z(4d[i]).34()}7p(++i<3)}2j{h(8.2e(0,1)==\'#\'){h(8.1J==4)3Z(j i=1;i<4;i++)N+=(8.39(i)+8.39(i)).3h();h(8.1J==7)N=8.3h()}}l(N.1J==7?N:(C[0]||8))}L.3J=a(6){l $A($(6).2U).4U(a(1c){l(1c.3u==3?1c.3B:(1c.4z()?L.3J(1c):\'\'))}).2P().4u(\'\')}L.3j=a(6,3g){l $A($(6).2U).4U(a(1c){l(1c.3u==3?1c.3B:((1c.4z()&&!L.7h(1c,3g))?L.3j(1c,3g):\'\'))}).2P().4u(\'\')}L.4b=a(6,2H){6=$(6);6.u({1l:(2H/19)+\'38\'});h(1Q.6s.4A(\'6d\')>0)W.5X(0,0);l 6}L.2h=a(6){6=$(6);j Q;h(Q=6.O(\'Q\'))l 1V(Q);h(Q=(6.O(\'2v\')||\'\').3L(/30\\(Q=(.*)\\)/))h(Q[1])l 1V(Q[1])/19;l 1.0}L.2V=a(6,P){6=$(6);h(P==1){6.u({Q:(/8k/.1M(1Q.2f)&&!/89|85|83/.1M(1Q.2f))?0.81:1.0});h(/2Q/.1M(1Q.2f)&&!W.1h)6.u({2v:L.O(6,\'2v\').4N(/30\\([^\\)]*\\)/4J,\'\')})}2j{h(P<0.7N)P=0;6.u({Q:P});h(/2Q/.1M(1Q.2f)&&!W.1h)6.u({2v:6.O(\'2v\').4N(/30\\([^\\)]*\\)/4J,\'\')+\'30(Q=\'+P*19+\')\'})}l 6}L.1x=a(6){l $(6).r.Q||\'\'}L.3q=a(6){7H{6=$(6);j n=29.7x(\' \');6.7v(n);6.7q(n)}7o(e){}};7g.J.7b=a(){j 4a=C;8.13(a(f){f.6Y(8,4a)})}j c={2b:{6Q:\'6L\',6H:\'6D 6C 6B 6 6z 6v 6r, 6o 6l 6g 3Z 8 b 1j 66\'},4g:a(6){h(21 4i==\'5Q\')26("c.4g 5J 5F 5D.5y.5v\' 5r.5o 5j");j 3I=\'w:59\';h(/2Q/.1M(1Q.2f)&&!W.1h)3I+=\';56:1\';6=$(6);$A(6.2U).13(a(2n){h(2n.3u==3){2n.3B.8s().13(a(3K){6.8n(4i.1c(\'8j\',{r:3I},3K==\' \'?3H.8g(8b):3K),2n)});L.3A(2n)}})},8a:a(6,b){j 2d;h(((21 6==\'87\')||(21 6==\'a\'))&&(6.1J))2d=6;2j 2d=$(6).2U;j g=p.o({4T:0.1,2r:0.0},C[2]||{});j 4S=g.2r;$A(2d).13(a(6,4Q){q b(6,p.o(g,{2r:4Q*g.4T+4S}))})},3v:{\'7Z\':[\'4M\',\'4K\'],\'7R\':[\'4H\',\'4G\'],\'4D\':[\'3t\',\'4C\']},7J:a(6,b){6=$(6);b=(b||\'4D\').3h();j g=p.o({1g:{w:\'4w\',3p:(6.7F||\'2A\'),3m:1}},C[2]||{});c[6.7A()?c.3v[b][1]:c.3v[b][0]](6,g)}};j 7z=c;c.1f={7w:4q.K,1N:a(B){l(-S.35(B*S.3e)/2)+0.5},7i:a(B){l 1-B},4h:a(B){l((-S.35(B*S.3e)/4)+0.75)+S.7a()/4},77:a(B){l(-S.35(B*S.3e*(9*B))/2)+0.5},49:a(B,1w){1w=1w||5;l(S.1z((B%(1/1w))*1w)==0?((B*1w*2)-S.47(B*1w*2)):1-((B*1w*2)-S.47(B*1w*2)))},2m:a(B){l 0},44:a(B){l 1}};c.3d=1r.1t();p.o(p.o(c.3d.J,6S),{1v:a(){8.F=[];8.2o=1P},41:a(3Y){8.F.41(3Y)},3X:a(b){j 1R=q 3U().3T();j w=(21 b.g.1g==\'2I\')?b.g.1g:b.g.1g.w;37(w){14\'6y\':8.F.6w(a(e){l e.28==\'3c\'}).13(a(e){e.1L+=b.1I;e.1I+=b.1I});15;14\'6m-6k\':1R=8.F.4c(\'1L\').2i()||1R;15;14\'4w\':1R=8.F.4c(\'1I\').2i()||1R;15}b.1L+=1R;b.1I+=1R;h(!b.g.1g.3m||(8.F.1J<b.g.1g.3m))8.F.45(b);h(!8.2o)8.2o=6c(8.2E.1k(8),40)},3A:a(b){8.F=8.F.4e(a(e){l e==b});h(8.F.1J==0){63(8.2o);8.2o=1P}},2E:a(){j 27=q 3U().3T();8.F.4f(\'2E\',27)}});c.2D={2G:$H(),2C:a(2a){h(21 2a!=\'2I\')l 2a;h(!8.2G[2a])8.2G[2a]=q c.3d();l 8.2G[2a]}}c.5N=c.2D.2C(\'2A\');c.4p={X:c.1f.1N,V:1.0,4r:25.0,10:T,1e:0.0,1j:1.0,2r:0.0,1g:\'5x\'}c.1q=a(){};c.1q.J={w:1P,1E:a(g){8.g=p.o(p.o({},c.4p),g||{});8.3y=0;8.28=\'3c\';8.1L=8.g.2r*2S;8.1I=8.1L+(8.g.V*2S);8.1m(\'5n\');h(!8.g.10)c.2D.2C(21 8.g.1g==\'2I\'?\'2A\':8.g.1g.3p).3X(8)},2E:a(27){h(27>=8.1L){h(27>=8.1I){8.2t(1.0);8.2R();8.1m(\'4O\');h(8.1W)8.1W();8.1m(\'51\');l}j B=(27-8.1L)/(8.1I-8.1L);j 3z=S.1z(B*8.g.4r*8.g.V);h(3z>8.3y){8.2t(B);8.3y=3z}}},2t:a(B){h(8.28==\'3c\'){8.28=\'4Z\';8.1m(\'1Y\');h(8.1U)8.1U();8.1m(\'3D\')}h(8.28==\'4Z\'){h(8.g.X)B=8.g.X(B);B*=(8.g.1j-8.g.1e);B+=8.g.1e;8.w=B;8.1m(\'8x\');h(8.1n)8.1n(B);8.1m(\'8t\')}},2R:a(){h(!8.g.10)c.2D.2C(21 8.g.1g==\'2I\'?\'2A\':8.g.1g.3p).3A(8);8.28=\'8r\'},1m:a(2p){h(8.g[2p+\'54\'])8.g[2p+\'54\'](8);h(8.g[2p])8.g[2p](8)},3i:a(){l\'#<c:\'+$H(8).3i()+\',g:\'+$H(8.g).3i()+\'>\'}}c.1Z=1r.1t();p.o(p.o(c.1Z.J,c.1q.J),{1v:a(F){8.F=F||[];8.1E(C[1])},1n:a(w){8.F.4f(\'2t\',w)},1W:a(w){8.F.13(a(b){b.2t(1.0);b.2R();b.1m(\'4O\');h(b.1W)b.1W(w);b.1m(\'51\')})}});c.5a=1r.1t();p.o(p.o(c.5a.J,c.1q.J),{1v:a(){j g=p.o({V:0},C[0]||{});8.1E(g)},1n:4q.8i});c.1B=1r.1t();p.o(p.o(c.1B.J,c.1q.J),{1v:a(6){8.6=$(6);h(!8.6)26(c.2b);h(/2Q/.1M(1Q.2f)&&!W.1h&&(!8.6.8f.8e))8.6.u({56:1});j g=p.o({1e:8.6.2h()||0.0,1j:1.0},C[1]||{});8.1E(g)},1n:a(w){8.6.2V(w)}});c.18=1r.1t();p.o(p.o(c.18.J,c.1q.J),{1v:a(6){8.6=$(6);h(!8.6)26(c.2b);j g=p.o({x:0,y:0,50:\'59\'},C[1]||{});8.1E(g)},1U:a(){8.6.1A();8.2x=1V(8.6.O(\'M\')||\'0\');8.2w=1V(8.6.O(\'G\')||\'0\');h(8.g.50==\'4Y\'){8.g.x=8.g.x-8.2x;8.g.y=8.g.y-8.2w}},1n:a(w){8.6.u({M:S.1z(8.g.x*w+8.2x)+\'1a\',G:S.1z(8.g.y*w+8.2w)+\'1a\'})}});c.86=a(6,4X,4W){l q c.18(6,p.o({x:4W,y:4X},C[3]||{}))};c.17=1r.1t();p.o(p.o(c.17.J,c.1q.J),{1v:a(6,2H){8.6=$(6);h(!8.6)26(c.2b);j g=p.o({1s:E,2u:E,1p:E,2T:T,1D:\'3x\',1X:19.0,4R:2H},C[2]||{});8.1E(g)},1U:a(){8.1b=8.g.1b||T;8.4P=8.6.O(\'w\');8.3w={};[\'G\',\'M\',\'D\',\'z\',\'1l\'].13(a(k){8.3w[k]=8.6.r[k]}.1k(8));8.2w=8.6.7Y;8.2x=8.6.7X;j 1l=8.6.O(\'7T-4L\')||\'19%\';[\'38\',\'1a\',\'%\',\'4V\'].13(a(2s){h(1l.4A(2s)>0){8.1l=1V(1l);8.2s=2s}}.1k(8));8.4I=(8.g.4R-8.g.1X)/19;8.t=1P;h(8.g.1D==\'3x\')8.t=[8.6.7Q,8.6.7P];h(/^4F/.1M(8.g.1D))8.t=[8.6.4E,8.6.7K];h(!8.t)8.t=[8.g.1D.2Z,8.g.1D.2Y]},1n:a(w){j 2X=(8.g.1X/19.0)+(8.4I*w);h(8.g.1p&&8.1l)8.6.u({1l:8.1l*2X+8.2s});8.4B(8.t[0]*2X,8.t[1]*2X)},1W:a(w){h(8.1b)8.6.u(8.3w)},4B:a(z,D){j d={};h(8.g.1s)d.D=S.1z(D)+\'1a\';h(8.g.2u)d.z=S.1z(z)+\'1a\';h(8.g.2T){j 3s=(z-8.t[0])/2;j 3r=(D-8.t[1])/2;h(8.4P==\'4Y\'){h(8.g.2u)d.G=8.2w-3s+\'1a\';h(8.g.1s)d.M=8.2x-3r+\'1a\'}2j{h(8.g.2u)d.G=-3s+\'1a\';h(8.g.1s)d.M=-3r+\'1a\'}}8.6.u(d)}});c.4y=1r.1t();p.o(p.o(c.4y.J,c.1q.J),{1v:a(6){8.6=$(6);h(!8.6)26(c.2b);j g=p.o({4x:\'#7I\'},C[1]||{});8.1E(g)},1U:a(){h(8.6.O(\'32\')==\'2m\'){8.2R();l}8.Z={31:8.6.O(\'3o-7B\')};8.6.u({31:\'2m\'});h(!8.g.3n)8.g.3n=8.6.O(\'3o-N\').1K(\'#4v\');h(!8.g.3l)8.g.3l=8.6.O(\'3o-N\');8.33=$R(0,2).22(a(i){l 2z(8.g.4x.2e(i*2+1,i*2+3),16)}.1k(8));8.4t=$R(0,2).22(a(i){l 2z(8.g.3n.2e(i*2+1,i*2+3),16)-8.33[i]}.1k(8))},1n:a(w){8.6.u({3k:$R(0,2).4s(\'#\',a(m,v,i){l m+(S.1z(8.33[i]+(8.4t[i]*w)).34())}.1k(8))})},1W:a(){8.6.u(p.o(8.Z,{3k:8.g.3l}))}});c.3M=1r.1t();p.o(p.o(c.3M.J,c.1q.J),{1v:a(6){8.6=$(6);8.1E(C[1]||{})},1U:a(){24.4o();j 2B=24.7s(8.6);h(8.g.4n)2B[1]+=8.g.4n;j 2i=W.4m?W.z-W.4m:29.4l.4E-(29.4k.2g?29.4k.2g:29.4l.2g);8.3f=24.7m;8.4j=(2B[1]>2i?2i:2B[1])-8.3f},1n:a(w){24.4o();W.7l(24.7k,8.3f+(w*8.4j))}});c.4C=a(6){6=$(6);j 2c=6.1x();j g=p.o({1e:6.2h()||1.0,1j:0.0,I:a(b){h(b.g.1j!=0)l;b.6.1u().u({Q:2c})}},C[1]||{});l q c.1B(6,g)}c.3t=a(6){6=$(6);j g=p.o({1e:(6.O(\'32\')==\'2m\'?0.0:6.2h()||0.0),1j:1.0,I:a(b){b.6.3q()},1Y:a(b){b.6.2V(b.g.1e).2q()}},C[1]||{});l q c.1B(6,g)}c.7f=a(6){6=$(6);j Z={Q:6.1x(),w:6.O(\'w\'),G:6.r.G,M:6.r.M,D:6.r.D,z:6.r.z};l q c.1Z([q c.17(6,7e,{10:E,2T:E,1p:E,1b:E}),q c.1B(6,{10:E,1j:0.0})],p.o({V:1.0,7d:a(b){24.79(b.F[0].6)},I:a(b){b.F[0].6.1u().u(Z)}},C[1]||{}))}c.4G=a(6){6=$(6);6.1y();l q c.17(6,0,p.o({1p:T,1s:T,1b:E,I:a(b){b.6.1u().1C()}},C[1]||{}))}c.4H=a(6){6=$(6);j 23=6.2F();l q c.17(6,19,p.o({1p:T,1s:T,1X:0,1D:{2Z:23.z,2Y:23.D},1b:E,3D:a(b){b.6.1y().u({z:\'36\'}).2q()},I:a(b){b.6.1C()}},C[1]||{}))}c.74=a(6){6=$(6);j 2c=6.1x();l q c.3t(6,p.o({V:0.4,1e:0,X:c.1f.4h,I:a(b){q c.17(b.6,1,{V:0.3,2T:E,1s:T,1p:T,1b:E,1Y:a(b){b.6.1A().1y()},I:a(b){b.6.1u().1C().1G().u({Q:2c})}})}},C[1]||{}))}c.72=a(6){6=$(6);j Z={G:6.O(\'G\'),M:6.O(\'M\'),Q:6.1x()};l q c.1Z([q c.18(6,{x:0,y:19,10:E}),q c.1B(6,{10:E,1j:0.0})],p.o({V:0.5,1Y:a(b){b.F[0].6.1A()},I:a(b){b.F[0].6.1u().1G().u(Z)}},C[1]||{}))}c.70=a(6){6=$(6);j Z={G:6.O(\'G\'),M:6.O(\'M\')};l q c.18(6,{x:20,y:0,V:0.48,I:a(b){q c.18(b.6,{x:-40,y:0,V:0.1,I:a(b){q c.18(b.6,{x:40,y:0,V:0.1,I:a(b){q c.18(b.6,{x:-40,y:0,V:0.1,I:a(b){q c.18(b.6,{x:40,y:0,V:0.1,I:a(b){q c.18(b.6,{x:-20,y:0,V:0.48,I:a(b){b.6.1G().u(Z)}})}})}})}})}})}})}c.4M=a(6){6=$(6).46();j 2O=6.1F().O(\'1i\');j 23=6.2F();l q c.17(6,19,p.o({1p:T,1s:T,1X:W.1h?0:1,1D:{2Z:23.z,2Y:23.D},1b:E,3D:a(b){b.6.1A();b.6.1F().1A();h(W.1h)b.6.u({G:\'\'});b.6.1y().u({z:\'36\'}).2q()},3N:a(b){b.6.1F().u({1i:(b.t[0]-b.6.2g)+\'1a\'})},I:a(b){b.6.1C().1G();b.6.1F().1G().u({1i:2O})}},C[1]||{}))}c.4K=a(6){6=$(6).46();j 2O=6.1F().O(\'1i\');l q c.17(6,W.1h?0:1,p.o({1p:T,1s:T,1D:\'3x\',1X:19,1b:E,43:a(b){b.6.1A();b.6.1F().1A();h(W.1h)b.6.u({G:\'\'});b.6.1y().2q()},3N:a(b){b.6.1F().u({1i:(b.t[0]-b.6.2g)+\'1a\'})},I:a(b){b.6.1u().1C().1G().u({1i:2O});b.6.1F().1G()}},C[1]||{}))}c.6X=a(6){l q c.17(6,W.1h?1:0,{1b:E,1Y:a(b){b.6.1y()},I:a(b){b.6.1u().1C()}})}c.6W=a(6){6=$(6);j g=p.o({2y:\'2N\',2M:c.1f.1N,2L:c.1f.1N,2K:c.1f.44},C[1]||{});j Z={G:6.r.G,M:6.r.M,z:6.r.z,D:6.r.D,Q:6.1x()};j t=6.2F();j 1O,1S;j 12,Y;37(g.2y){14\'G-M\':1O=1S=12=Y=0;15;14\'G-2l\':1O=t.D;1S=Y=0;12=-t.D;15;14\'1i-M\':1O=12=0;1S=t.z;Y=-t.z;15;14\'1i-2l\':1O=t.D;1S=t.z;12=-t.D;Y=-t.z;15;14\'2N\':1O=t.D/2;1S=t.z/2;12=-t.D/2;Y=-t.z/2;15}l q c.18(6,{x:1O,y:1S,V:0.6O,1Y:a(b){b.6.1u().1y().1A()},I:a(b){q c.1Z([q c.1B(b.6,{10:E,1j:1.0,1e:0.0,X:g.2K}),q c.18(b.6,{x:12,y:Y,10:E,X:g.2M}),q c.17(b.6,19,{1D:{2Z:t.z,2Y:t.D},10:E,1X:W.1h?1:0,X:g.2L,1b:E})],p.o({1Y:a(b){b.F[0].6.u({z:\'36\'}).2q()},I:a(b){b.F[0].6.1C().1G().u(Z)}},g))}})}c.6M=a(6){6=$(6);j g=p.o({2y:\'2N\',2M:c.1f.1N,2L:c.1f.1N,2K:c.1f.2m},C[1]||{});j Z={G:6.r.G,M:6.r.M,z:6.r.z,D:6.r.D,Q:6.1x()};j t=6.2F();j 12,Y;37(g.2y){14\'G-M\':12=Y=0;15;14\'G-2l\':12=t.D;Y=0;15;14\'1i-M\':12=0;Y=t.z;15;14\'1i-2l\':12=t.D;Y=t.z;15;14\'2N\':12=t.D/2;Y=t.z/2;15}l q c.1Z([q c.1B(6,{10:E,1j:0.0,1e:1.0,X:g.2K}),q c.17(6,W.1h?1:0,{10:E,X:g.2L,1b:E}),q c.18(6,{x:12,y:Y,10:E,X:g.2M})],p.o({43:a(b){b.F[0].6.1A().1y()},I:a(b){b.F[0].6.1u().1C().1G().u(Z)}},g))}c.6K=a(6){6=$(6);j g=C[1]||{};j 2c=6.1x();j X=g.X||c.1f.1N;j 3b=a(B){l X(1-c.1f.49(B,g.1w))};3b.1k(X);l q c.1B(6,p.o(p.o({V:2.0,1e:0,I:a(b){b.6.u({Q:2c})}},g),{X:3b}))}c.6I=a(6){6=$(6);j Z={G:6.r.G,M:6.r.M,D:6.r.D,z:6.r.z};6.1y();l q c.17(6,5,p.o({1p:T,1s:T,I:a(b){q c.17(6,1,{1p:T,2u:T,I:a(b){b.6.1u().1C().u(Z)}})}},C[1]||{}))};c.2J=1r.1t();p.o(p.o(c.2J.J,c.1q.J),{1v:a(6){8.6=$(6);h(!8.6)26(c.2b);j g=p.o({r:\'\'},C[1]||{});8.1E(g)},1U:a(){a 1K(N){h(!N||[\'6G(0, 0, 0, 0)\',\'6F\'].6E(N))N=\'#4v\';N=N.1K();l $R(0,2).22(a(i){l 2z(N.2e(i*2+1,i*2+3),16)})}8.3W=8.g.r.3V().22(a(11){j 1o=8.6.O(11[0]);l $H({r:11[0],1o:11[1].1d==\'N\'?1K(1o):1V(1o||0),2k:11[1].1d==\'N\'?1K(11[1].P):11[1].P,1d:11[1].1d})}.1k(8)).4e(a(U){l((U.1o==U.2k)||(U.1d!=\'N\'&&(3S(U.1o)||3S(U.2k))))})},1n:a(w){j r=$H(),P=1P;8.3W.13(a(U){P=U.1d==\'N\'?$R(0,2).4s(\'#\',a(m,v,i){l m+(S.1z(U.1o[i]+(U.2k[i]-U.1o[i])*w)).34()}):U.1o+S.1z(((U.2k-U.1o)*w)*2S)/2S+U.1d;r[U.r]=P});8.6.u(r)}});c.3R=1r.1t();p.o(c.3R.J,{1v:a(1T){8.1T=[];8.g=C[1]||{};8.3Q(1T)},3Q:a(1T){1T.13(a(1H){j 3P=$H(1H).6x().3O();8.1T.45($H({3a:$H(1H).6J().3O(),b:c.2J,g:{r:3P}}))}.1k(8));l 8},6u:a(){l q c.1Z(8.1T.22(a(1H){j 2d=[$(1H.3a)||$$(1H.3a)].2P();l 2d.22(a(e){l q 1H.b(e,p.o({10:E},1H.g))})}).2P(),8.g)}});L.42=[\'6t\',\'6N\',\'3k\',\'31\',\'6q\',\'6P\',\'6p\',\'6R\',\'6n\',\'6T\',\'6U\',\'6V\',\'6j\',\'6i\',\'6h\',\'6Z\',\'6f\',\'71\',\'6e\',\'73\',\'1i\',\'6b\',\'76\',\'6a\',\'N\',\'4F\',\'78\',\'69\',\'68\',\'67\',\'7c\',\'65\',\'2y\',\'32\',\'64\',\'62\',\'61\',\'1l\',\'60\',\'5Z\',\'5Y\',\'7j\',\'5W\',\'z\',\'M\',\'5V\',\'5U\',\'7n\',\'5T\',\'5S\',\'5R\',\'7r\',\'5P\',\'5O\',\'7t\',\'7u\',\'5M\',\'5L\',\'5K\',\'7y\',\'Q\',\'5I\',\'5H\',\'5G\',\'7C\',\'7D\',\'7E\',\'5E\',\'7G\',\'5C\',\'5B\',\'5A\',\'5z\',\'7L\',\'7M\',\'5w\',\'7O\',\'5u\',\'5t\',\'5s\',\'w\',\'7S\',\'5q\',\'2l\',\'4L\',\'7U\',\'5p\',\'7W\',\'5m\',\'5l\',\'5k\',\'80\',\'5i\',\'82\',\'5h\',\'84\',\'G\',\'5g\',\'5f\',\'5e\',\'88\',\'5d\',\'5c\',\'5b\',\'D\',\'8c\',\'8E\'];L.58=/^(([\\+\\-]?[0-9\\.]+)(38|8D|1a|8B|8z|8y|4V|8w|\\%))|0$/;3H.J.3V=a(){j 6=L.o(29.8v(\'3G\'));6.8u=\'<3G r="\'+8+\'"></3G>\';j r=6.1F().r,3F=$H();L.42.13(a(11){h(r[11])3F[11]=r[11]});j 3C=$H();3F.13(a(3E){j 11=3E[0],P=3E[1],1d=1P;h(P.1K(\'#55\')!=\'#55\'){P=P.1K();1d=\'N\'}2j h(L.58.1M(P))j 2W=P.3L(/^([\\+\\-]?[0-9\\.]+)(.*)$/),P=1V(2W[1]),1d=(2W.1J==3)?2W[2]:1P;3C[11.8q().8p()]=$H({P:P,1d:1d})}.1k(8));l 3C};L.53=a(6,r){q c.2J(6,p.o({r:r},C[2]||{}));l 6};[\'2V\',\'2h\',\'1x\',\'3q\',\'4b\',\'3J\',\'3j\',\'53\'].13(a(f){L.52[f]=L[f]});L.52.8o=a(6,b,g){s=b.8m(/8l/,\'-\').8A();57=s.39(0).8C()+s.8h(1);q c[57](6,g);l $(6)};L.8F();',62,538,'||||||element||this||function|effect|Effect||||options|if||var||return|||extend|Object|new|style||dims|setStyle||position|||height||pos|arguments|width|true|effects|top||afterFinishInternal|prototype||Element|left|color|getStyle|value|opacity||Math|false|transform|duration|window|transition|moveY|oldStyle|sync|property|moveX|each|case|break||Scale|Move|100|px|restoreAfterFinish|node|unit|from|Transitions|queue|opera|bottom|to|bind|fontSize|event|update|originalValue|scaleContent|Base|Class|scaleX|create|hide|initialize|pulses|getInlineOpacity|makeClipping|round|makePositioned|Opacity|undoClipping|scaleMode|start|down|undoPositioned|track|finishOn|length|parseColor|startOn|test|sinoidal|initialMoveX|null|navigator|timestamp|initialMoveY|tracks|setup|parseFloat|finish|scaleFrom|beforeSetup|Parallel||typeof|map|elementDimensions|Position||throw|timePos|state|document|queueName|_elementDoesNotExistError|oldOpacity|elements|slice|userAgent|clientHeight|getOpacity|max|else|targetValue|right|none|child|interval|eventName|show|delay|fontSizeType|render|scaleY|filter|originalTop|originalLeft|direction|parseInt|global|offsets|get|Queues|loop|getDimensions|instances|percent|string|Morph|opacityTransition|scaleTransition|moveTransition|center|oldInnerBottom|flatten|MSIE|cancel|1000|scaleFromCenter|childNodes|setOpacity|components|currentScale|originalWidth|originalHeight|alpha|backgroundImage|display|_base|toColorPart|cos|0px|switch|em|charAt|ids|reverser|idle|ScopedQueue|PI|scrollStart|className|toLowerCase|inspect|collectTextNodesIgnoreClass|backgroundColor|restorecolor|limit|endcolor|background|scope|forceRerendering|leftd|topd|Appear|nodeType|PAIRS|originalStyle|box|currentFrame|frame|remove|nodeValue|result|afterSetup|pair|styleRules|div|String|tagifyStyle|collectTextNodes|character|match|ScrollTo|afterUpdateInternal|first|data|addTracks|Transform|isNaN|getTime|Date|parseStyle|transforms|add|iterator|for||_each|CSS_PROPERTIES|beforeStartInternal|full|push|cleanWhitespace|floor|05|pulse|args|setContentZoom|pluck|cols|reject|invoke|tagifyText|flicker|Builder|delta|documentElement|body|innerHeight|offset|prepare|DefaultOptions|Prototype|fps|inject|_delta|join|ffffff|end|startcolor|Highlight|hasChildNodes|indexOf|setDimensions|Fade|appear|scrollHeight|content|BlindUp|BlindDown|factor|gi|SlideUp|size|SlideDown|replace|beforeFinish|elementPositioning|index|scaleTo|masterDelay|speed|collect|pt|toLeft|toTop|absolute|running|mode|afterFinish|Methods|morph|Internal|zzzzzz|zoom|effect_class|CSS_LENGTH|relative|Event|widows|whiteSpace|volume|visibility|verticalAlign|unicodeBidi|textShadow|textDecoration|library|tableLayout|stress|speechRate|beforeStart|js|speakNumeral|richness|builder|pitchRange|pitch|pauseBefore|us|pageBreakInside|parallel|aculo|page|paddingTop|paddingRight|paddingLeft|script|overflowY|including|outlineOffset|outlineColor|orphans|requires|minHeight|maxWidth|maxHeight|Queue|marginTop|marginRight|undefined|marginBottom|listStyleType|listStylePosition|lineHeight|letterSpacing|fontWeight|scrollBy|fontStyle|fontStretch|fontSizeAdjust|fontFamily|emptyCells|clearInterval|elevation|cursor|operate|cueAfter|cssFloat|counterReset|clip|captionSide|setInterval|AppleWebKit|borderTopStyle|borderSpacing|required|borderRightStyle|borderRightColor|borderLeftWidth|last|is|with|borderBottomWidth|but|borderBottomColor|backgroundPosition|exist|appVersion|azimuth|play|not|findAll|values|front|does|rgb|DOM|specified|The|include|transparent|rgba|message|Fold|keys|Pulsate|ElementDoesNotExistError|Shrink|backgroundAttachment|01|backgroundRepeat|name|borderBottomStyle|Enumerable|borderCollapse|borderLeftColor|borderLeftStyle|Grow|Squish|apply|borderRightWidth|Shake|borderTopColor|DropOut|borderTopWidth|SwitchOff||clear|wobble|counterIncrement|absolutize|random|call|cueBefore|beforeSetupInternal|200|Puff|Array|hasClassName|reverse|fontVariant|deltaX|scrollTo|deltaY|listStyleImage|catch|while|removeChild|marginLeft|cumulativeOffset|markerOffset|marks|appendChild|linear|createTextNode|minWidth|Effect2|visible|image|outlineStyle|outlineWidth|overflowX|id|paddingBottom|try|ffff99|toggle|scrollWidth|pageBreakAfter|pageBreakBefore|00001|pauseAfter|offsetWidth|offsetHeight|blind|quotes|font|speakHeader|do|speakPunctuation|offsetLeft|offsetTop|slide|textAlign|999999|textIndent|KHTML|textTransform|Safari|MoveBy|object|voiceFamily|Konqueror|multiple|160|wordSpacing|split|hasLayout|currentStyle|fromCharCode|substring|emptyFunction|span|Gecko|_|gsub|insertBefore|visualEffect|dasherize|underscore|finished|toArray|afterUpdate|innerHTML|createElement|pc|beforeUpdate|mm|cm|camelize|in|toUpperCase|ex|zIndex|addMethods'.split('|'),0,{}))
@@ -1 +0,0 @@
1
- eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('m 17={5N:\'1.5.0\',5K:{5t:!!J.48},3Y:\'(?:<4M.*?>)((\\n|\\r|.)*?)(?:<\\/4M>)\',2y:7(){},K:7(x){k x}}m 1j={1h:7(){k 7(){6.1C.1R(6,O)}}}m 1q=N B();B.v=7(a,b){U(m c 1J b){a[c]=b[c]}k a}B.v(B,{Y:7(a){1u{l(a===V)k\'V\';l(a===Q)k\'Q\';k a.Y?a.Y():a.1L()}1A(e){l(e 9u 9o)k\'...\';1V e;}},6t:7(a){m b=[];U(m c 1J a)b.G(c);k b},1E:7(a){m b=[];U(m c 1J a)b.G(a[c]);k b},3s:7(a){k B.v({},a)}});4P.C.1i=7(){m a=6,1W=$A(O),4E=1W.4A();k 7(){k a.1R(4E,1W.1s($A(O)))}}4P.C.8z=7(b){m c=6,1W=$A(O),b=1W.4A();k 7(a){k c.1R(b,[(a||1d.8g)].1s(1W).1s($A(O)))}}B.v(89.C,{88:7(){m a=6.1L(16);l(6<16)k\'0\'+a;k a},5G:7(){k 6+1},7V:7(a){$R(0,6,14).P(a);k 6}});m 7F={7z:7(){m a;U(m i=0,u=O.u;i<u;i++){m b=O[i];1u{a=b();15}1A(e){}}k a}}m 7f=1j.1h();7f.C={1C:7(a,b){6.2R=a;6.2x=b;6.4d=11;6.2z()},2z:7(){6.2V=6V(6.2w.1i(6),6.2x*5b)},59:7(){l(!6.2V)k;9A(6.2V);6.2V=Q},2w:7(){l(!6.4d){1u{6.4d=14;6.2R(6)}9x{6.4d=11}}}}1M.54=7(a){k a==Q?\'\':1M(a)}B.v(1M.C,{1N:7(a,b){m c=\'\',2h=6,I;b=O.9j.4W(b);1e(2h.u>0){l(I=2h.I(a)){c+=2h.2Q(0,I.6r);c+=1M.54(b(I));2h=2h.2Q(I.6r+I[0].u)}12{c+=2h,2h=\'\'}}k c},97:7(b,c,d){c=6.1N.4W(c);d=d===V?1:d;k 6.1N(b,7(a){l(--d<0)k a[0];k c(a)})},93:7(a,b){6.1N(a,b);k 6},91:7(a,b){a=a||30;b=b===V?\'...\':b;k 6.u>a?6.2Q(0,a-b.u)+b:6},3D:7(){k 6.1P(/^\\s+/,\'\').1P(/\\s+$/,\'\')},6f:7(){k 6.1P(/<\\/?[^>]+>/3O,\'\')},1Y:7(){k 6.1P(N 4l(17.3Y,\'68\'),\'\')},64:7(){m b=N 4l(17.3Y,\'68\');m c=N 4l(17.3Y,\'8O\');k(6.I(b)||[]).1k(7(a){k(a.I(c)||[\'\',\'\'])[1]})},2M:7(){k 6.64().1k(7(a){k 4z(a)})},8E:7(){m a=J.3g(\'3E\');m b=J.8m(6);a.4w(b);k a.20},8d:7(){m c=J.3g(\'3E\');c.20=6.6f();k c.23[0]?(c.23.u>1?$A(c.23).1T(\'\',7(a,b){k a+b.3B}):c.23[0].3B):\'\'},4G:7(e){m f=6.3D().I(/([^?#]*)(#.*)?$/);l(!f)k{};k f[1].2C(e||\'&\').1T({},7(a,b){l((b=b.2C(\'=\'))[0]){m c=80(b[0]);m d=b[1]?80(b[1]):V;l(a[c]!==V){l(a[c].2r!=1p)a[c]=[a[c]];l(d)a[c].G(d)}12 a[c]=d}k a})},1U:7(){k 6.2C(\'\')},5G:7(){k 6.2Q(0,6.u-1)+1M.aY(6.aT(6.u-1)+1)},5C:7(){m a=6.2C(\'-\'),5B=a.u;l(5B==1)k a[0];m b=6.3V(0)==\'-\'?a[0].3V(0).1B()+a[0].5w(1):a[0];U(m i=1;i<5B;i++)b+=a[i].3V(0).1B()+a[i].5w(1);k b},7C:7(){k 6.3V(0).1B()+6.5w(1).1z()},aI:7(){k 6.1N(/::/,\'/\').1N(/([A-Z]+)([A-Z][a-z])/,\'#{1}3y#{2}\').1N(/([a-z\\d])([A-Z])/,\'#{1}3y#{2}\').1N(/-/,\'3y\').1z()},az:7(){k 6.1N(/3y/,\'-\')},Y:7(a){m b=6.1P(/\\\\/g,\'\\\\\\\\\');l(a)k\'"\'+b.1P(/"/g,\'\\\\"\')+\'"\';12 k"\'"+b.1P(/\'/g,\'\\\\\\\'\')+"\'"}});1M.C.1N.4W=7(b){l(1f b==\'7\')k b;m c=N 3t(b);k 7(a){k c.48(a)}}1M.C.an=1M.C.4G;m 3t=1j.1h();3t.7a=/(^|.|\\r|\\n)(#\\{(.*?)\\})/;3t.C={1C:7(a,b){6.79=a.1L();6.78=b||3t.7a},48:7(c){k 6.79.1N(6.78,7(a){m b=a[1];l(b==\'\\\\\')k a[2];k b+1M.54(c[a[3]])})}}m $15=N B();m $4c=N B();m 1w={P:7(b){m c=0;1u{6.29(7(a){1u{b(a,c++)}1A(e){l(e!=$4c)1V e;}})}1A(e){l(e!=$15)1V e;}k 6},74:7(a,b){m c=-a,5h=[],5g=6.1U();1e((c+=a)<5g.u)5h.G(5g.2Q(c,c+a));k 5h.1k(b)},5m:7(c){m d=14;6.P(7(a,b){d=d&&!!(c||17.K)(a,b);l(!d)1V $15;});k d},9T:7(c){m d=11;6.P(7(a,b){l(d=!!(c||17.K)(a,b))1V $15;});k d},6U:7(c){m d=[];6.P(7(a,b){d.G((c||17.K)(a,b))});k d},6T:7(c){m d;6.P(7(a,b){l(c(a,b)){d=a;1V $15;}});k d},6S:7(c){m d=[];6.P(7(a,b){l(c(a,b))d.G(a)});k d},9J:7(d,e){m f=[];6.P(7(a,b){m c=a.1L();l(c.I(d))f.G((e||17.K)(a,b))})k f},19:7(b){m c=11;6.P(7(a){l(a==b){c=14;1V $15;}});k c},9E:7(b,c){c=c===V?Q:c;k 6.74(b,7(a){1e(a.u<b)a.G(c);k a})},1T:7(c,d){6.P(7(a,b){c=d(c,a,b)});k c},9C:7(b){m c=$A(O).2Q(1);k 6.1k(7(a){k a[b].1R(a,c)})},9z:7(c){m d;6.P(7(a,b){a=(c||17.K)(a,b);l(d==V||a>=d)d=a});k d},9y:7(c){m d;6.P(7(a,b){a=(c||17.K)(a,b);l(d==V||a<d)d=a});k d},9w:7(c){m d=[],57=[];6.P(7(a,b){((c||17.K)(a,b)?d:57).G(a)});k[d,57]},3p:7(c){m d=[];6.P(7(a,b){d.G(a[c])});k d},9r:7(c){m d=[];6.P(7(a,b){l(!c(a,b))d.G(a)});k d},9p:7(e){k 6.1k(7(a,b){k{T:a,51:e(a,b)}}).9n(7(c,d){m a=c.51,b=d.51;k a<b?-1:a>b?1:0}).3p(\'T\')},1U:7(){k 6.1k()},9m:7(){m c=17.K,1W=$A(O);l(1f 1W.4Z()==\'7\')c=1W.9l();m d=[6].1s(1W).1k($A);k 6.1k(7(a,b){k c(d.3p(b))})},6z:7(){k 6.1U().u},Y:7(){k\'#<1w:\'+6.1U().Y()+\'>\'}}B.v(1w,{1k:1w.6U,6x:1w.6T,1F:1w.6S,9i:1w.19,9h:1w.1U});m $A=1p.9f=7(a){l(!a)k[];l(a.1U){k a.1U()}12{m b=[];U(m i=0,u=a.u;i<u;i++)b.G(a[i]);k b}}B.v(1p.C,1w);l(!1p.C.4U)1p.C.4U=1p.C.3Z;B.v(1p.C,{29:7(a){U(m i=0,u=6.u;i<u;i++)a(6[i])},6s:7(){6.u=0;k 6},3k:7(){k 6[0]},4Z:7(){k 6[6.u-1]},6q:7(){k 6.1F(7(a){k a!=Q})},4T:7(){k 6.1T([],7(a,b){k a.1s(b&&b.2r==1p?b.4T():[b])})},4R:7(){m b=$A(O);k 6.1F(7(a){k!b.19(a)})},6p:7(a){U(m i=0,u=6.u;i<u;i++)l(6[i]==a)k i;k-1},3Z:7(a){k(a!==11?6:6.1U()).4U()},6o:7(){k 6.u>1?6:6[0]},96:7(){k 6.1T([],7(a,b){k a.19(b)?a:a.1s([b])})},3s:7(){k[].1s(6)},6z:7(){k 6.u},Y:7(){k\'[\'+6.1k(B.Y).22(\', \')+\']\'}});1p.C.1U=1p.C.3s;7 $w(a){a=a.3D();k a?a.2C(/\\s+/):[]}l(1d.24){1p.C.1s=7(){m a=[];U(m i=0,u=6.u;i<u;i++)a.G(6[i]);U(m i=0,u=O.u;i<u;i++){l(O[i].2r==1p){U(m j=0,6m=O[i].u;j<6m;j++)a.G(O[i][j])}12{a.G(O[i])}}k a}}m 1D=7(a){B.v(6,a||{})};B.v(1D,{2G:7(d){m e=[];6.C.29.8X(d,7(b){l(!b.2k)k;l(b.T&&b.T.2r==1p){m c=b.T.6q();l(c.u<2)b.T=c.6o();12{2k=3R(b.2k);c.P(7(a){a=a!=V?3R(a):\'\';e.G(2k+\'=\'+3R(a))});k}}l(b.T==V)b[1]=\'\';e.G(b.1k(3R).22(\'=\'))});k e.22(\'&\')}});B.v(1D.C,1w);B.v(1D.C,{29:7(a){U(m b 1J 6){m c=6[b];l(c&&c==1D.C[b])4c;m d=[b,c];d.2k=b;d.T=c;a(d)}},6t:7(){k 6.3p(\'2k\')},1E:7(){k 6.3p(\'T\')},8W:7(c){k $H(c).1T(6,7(a,b){a[b.2k]=b.T;k a})},3v:7(){m a;U(m i=0,u=O.u;i<u;i++){m b=6[O[i]];l(b!==V){l(a===V)a=b;12{l(a.2r!=1p)a=[a];a.G(b)}}8V 6[O[i]]}k a},2G:7(){k 1D.2G(6)},Y:7(){k\'#<1D:{\'+6.1k(7(a){k a.1k(B.Y).22(\': \')}).22(\', \')+\'}>\'}});7 $H(a){l(a&&a.2r==1D)k a;k N 1D(a)};3P=1j.1h();B.v(3P.C,1w);B.v(3P.C,{1C:7(a,b,c){6.3z=a;6.4J=b;6.6b=c},29:7(a){m b=6.3z;1e(6.19(b)){a(b);b=b.5G()}},19:7(a){l(a<6.3z)k 11;l(6.6b)k a<6.4J;k a<=6.4J}});m $R=7(a,b,c){k N 3P(a,b,c)}m W={4H:7(){k 7F.7z(7(){k N 69()},7(){k N 67(\'8R.65\')},7(){k N 67(\'8Q.65\')})||11},4D:0}W.2W={3A:[],29:7(a){6.3A.29(a)},61:7(a){l(!6.19(a))6.3A.G(a)},8K:7(a){6.3A=6.3A.4R(a)},3K:7(b,c,d,f){6.P(7(a){l(1f a[b]==\'7\'){1u{a[b].1R(a,[c,d,f])}1A(e){}}})}};B.v(W.2W,1w);W.2W.61({5Z:7(){W.4D++},1Z:7(){W.4D--}});W.3J=7(){};W.3J.C={3I:7(a){6.L={1G:\'3f\',3H:14,5W:\'4x/x-8i-5V-8f\',4t:\'8c-8\',3e:\'\'}B.v(6.L,a||{});6.L.1G=6.L.1G.1z();l(1f 6.L.3e==\'3d\')6.L.3e=6.L.3e.4G()}}W.3c=1j.1h();W.3c.5O=[\'87\',\'86\',\'85\',\'83\',\'5M\'];W.3c.C=B.v(N W.3J(),{4y:11,1C:7(a,b){6.18=W.4H();6.3I(b);6.5J(a)},5J:7(a){6.32=a;6.1G=6.L.1G;m b=6.L.3e;l(![\'7Z\',\'3f\'].19(6.1G)){b[\'b2\']=6.1G;6.1G=\'3f\'}b=1D.2G(b);l(b&&/31|2Z|2U/.2a(1I.25))b+=\'&3y=\'l(6.1G==\'7Z\'&&b)6.32+=(6.32.6p(\'?\')>-1?\'&\':\'?\')+b;1u{W.2W.3K(\'5Z\',6,6.18);6.18.aW(6.1G.1B(),6.32,6.L.3H);l(6.L.3H)2t(7(){6.4K(1)}.1i(6),10);6.18.7N=6.4N.1i(6);6.7L();m c=6.1G==\'3f\'?(6.L.aQ||b):Q;6.18.aP(c);l(!6.L.3H&&6.18.7J)6.4N()}1A(e){6.3l(e)}},4N:7(){m a=6.18.7E;l(a>1&&!((a==4)&&6.4y))6.4K(6.18.7E)},7L:7(){m b={\'X-aM-aL\':\'69\',\'X-17-5N\':17.5N,\'aK\':\'2J/7y, 2J/aH, 4x/7u, 2J/7u, */*\'};l(6.1G==\'3f\'){b[\'7t-21\']=6.L.5W+(6.L.4t?\'; aE=\'+6.L.4t:\'\');l(6.18.7J&&(1I.25.I(/7q\\/(\\d{4})/)||[0,7n])[1]<7n)b[\'aB\']=\'ay\'}l(1f 6.L.7j==\'4E\'){m c=6.L.7j;l(1f c.G==\'7\')U(m i=0,u=c.u;i<u;i+=2)b[c[i]]=c[i+1];12 $H(c).P(7(a){b[a.2k]=a.T})}U(m d 1J b)6.18.av(d,b[d])},2n:7(){k!6.18.49||(6.18.49>=au&&6.18.49<ar)},4K:7(a){m b=W.3c.5O[a];m c=6.18,4a=6.7b();l(b==\'5M\'){1u{6.4y=14;(6.L[\'3a\'+6.18.49]||6.L[\'3a\'+(6.2n()?\'ak\':\'ai\')]||17.2y)(c,4a)}1A(e){6.3l(e)}l((6.5k(\'7t-21\')||\'2J/7y\').3D().I(/^(2J|4x)\\/(x-)?(ae|ab)4M(;.*)?$/i))6.77()}1u{(6.L[\'3a\'+b]||17.2y)(c,4a);W.2W.3K(\'3a\'+b,6,c,4a)}1A(e){6.3l(e)}l(b==\'5M\'){6.18.7N=17.2y}},5k:7(a){1u{k 6.18.a8(a)}1A(e){k Q}},7b:7(){1u{m a=6.5k(\'X-a6\');k a?4z(\'(\'+a+\')\'):Q}1A(e){k Q}},77:7(){1u{k 4z(6.18.4b)}1A(e){6.3l(e)}},3l:7(a){(6.L.76||17.2y)(6,a);W.2W.3K(\'76\',6,a)}});W.5j=1j.1h();B.v(B.v(W.5j.C,W.3c.C),{1C:7(c,d,e){6.4f={2n:(c.2n||c),5i:(c.5i||(c.2n?Q:c))}6.18=W.4H();6.3I(e);m f=6.L.1Z||17.2y;6.L.1Z=(7(a,b){6.7c();f(a,b)}).1i(6);6.5J(d)},7c:7(){m a=6.4f[6.2n()?\'2n\':\'5i\'];m b=6.18.4b;l(!6.L.2M)b=b.1Y();l(a=$(a)){l(6.L.73)N 6.L.73(a,b);12 a.5l(b)}l(6.2n()){l(6.1Z)2t(6.1Z.1i(6),10)}}});W.71=1j.1h();W.71.C=B.v(N W.3J(),{1C:7(a,b,c){6.3I(c);6.1Z=6.L.1Z;6.2x=(6.L.2x||2);6.2u=(6.L.2u||1);6.5o={};6.4f=a;6.32=b;6.3z()},3z:7(){6.L.1Z=6.6Y.1i(6);6.2w()},59:7(){6.5o.L.1Z=V;9U(6.2V);(6.1Z||17.2y).1R(6,O)},6Y:7(a){l(6.L.2u){6.2u=(a.4b==6.6W?6.2u*6.L.2u:1);6.6W=a.4b}6.2V=2t(6.2w.1i(6),6.2u*6.2x*5b)},2w:7(){6.5o=N W.5j(6.4f,6.32,6.L)}});7 $(a){l(O.u>1){U(m i=0,5d=[],u=O.u;i<u;i++)5d.G($(O[i]));k 5d}l(1f a==\'3d\')a=J.9Q(a);k o.v(a)}l(17.5K.5t){J.7o=7(a,b){m c=[];m d=J.48(a,$(b)||J,Q,9N.9M,Q);U(m i=0,u=d.9L;i<u;i++)c.G(d.9K(i));k c}}J.5v=7(a,b){l(17.5K.5t){m q=".//*[9H(1s(\' \', @7K, \' \'), \' "+a+" \')]";k J.7o(q,b)}12{m c=($(b)||J.1x).3j(\'*\');m d=[],4p;U(m i=0,u=c.u;i<u;i++){4p=c[i];l(o.3M(4p,a))d.G(o.v(4p))}k d}};l(!1d.o)m o=N B();o.v=7(a){l(!a||5E||a.4s==3)k a;l(!a.6I&&a.1a&&a!=1d){m b=B.3s(o.1c),3q=o.v.3q;l(a.1a==\'9v\')B.v(b,M.1c);l([\'9t\',\'9s\',\'9q\'].19(a.1a))B.v(b,M.o.1c);B.v(b,o.1c.55);U(m c 1J b){m d=b[c];l(1f d==\'7\'&&!(c 1J a))a[c]=3q.53(d)}}a.6I=14;k a};o.v.3q={53:7(a){k 6[a]=6[a]||7(){k a.1R(Q,[6].1s($A(O)))}}};o.1c={52:7(a){k $(a).D.26!=\'47\'},6F:7(a){a=$(a);o[o.52(a)?\'6E\':\'6D\'](a);k a},6E:7(a){$(a).D.26=\'47\';k a},6D:7(a){$(a).D.26=\'\';k a},3v:7(a){a=$(a);a.1K.50(a);k a},5l:7(a,b){b=1f b==\'V\'?\'\':b.1L();$(a).20=b.1Y();2t(7(){b.2M()},10);k a},1P:7(a,b){a=$(a);b=1f b==\'V\'?\'\':b.1L();l(a.6C){a.6C=b.1Y()}12{m c=a.6B.6A();c.4Y(a);a.1K.9k(c.6y(b.1Y()),a)}2t(7(){b.2M()},10);k a},Y:7(d){d=$(d);m e=\'<\'+d.1a.1z();$H({\'2L\':\'2L\',\'44\':\'7K\'}).P(7(a){m b=a.3k(),6w=a.4Z();m c=(d[b]||\'\').1L();l(c)e+=\' \'+6w+\'=\'+c.Y(14)});k e+\'>\'},43:7(a,b){a=$(a);m c=[];1e(a=a[b])l(a.4s==1)c.G(o.v(a));k c},6v:7(a){k $(a).43(\'1K\')},6u:7(a){k $A($(a).3j(\'*\'))},9g:7(a){l(!(a=$(a).42))k[];1e(a&&a.4s!=1)a=a.41;l(a)k[a].1s($(a).3X());k[]},4V:7(a){k $(a).43(\'9e\')},3X:7(a){k $(a).43(\'41\')},9d:7(a){a=$(a);k a.4V().3Z().1s(a.3X())},I:7(a,b){l(1f b==\'3d\')b=N 1v(b);k b.I($(a))},9c:7(a,b,c){k 1v.2K($(a).6v(),b,c)},9b:7(a,b,c){k 1v.2K($(a).6u(),b,c)},9a:7(a,b,c){k 1v.2K($(a).4V(),b,c)},99:7(a,b,c){k 1v.2K($(a).3X(),b,c)},98:7(){m a=$A(O),E=$(a.4A());k 1v.4S(E,a)},5v:7(a,b){k J.5v(b,a)},56:7(a,b){a=$(a);l(J.5m&&!1d.24){m t=o.1H;l(t.1E[b])k t.1E[b](a,b);l(t.3W[b])b=t.3W[b];m c=a.3o[b];l(c)k c.3B}k a.6n(b)},95:7(a){k $(a).4Q().2g},94:7(a){k $(a).4Q().2f},2s:7(a){k N o.3T(a)},3M:7(a,b){l(!(a=$(a)))k;m c=a.44;l(c.u==0)k 11;l(c==b||c.I(N 4l("(^|\\\\s)"+b+"(\\\\s|$)")))k 14;k 11},92:7(a,b){l(!(a=$(a)))k;o.2s(a).4O(b);k a},90:7(a,b){l(!(a=$(a)))k;o.2s(a).3v(b);k a},8Z:7(a,b){l(!(a=$(a)))k;o.2s(a)[a.3M(b)?\'3v\':\'4O\'](b);k a},2H:7(){1b.2H.1R(1b,O);k $A(O).3k()},3S:7(){1b.3S.1R(1b,O);k $A(O).3k()},8Y:7(a){a=$(a);m b=a.42;1e(b){m c=b.41;l(b.4s==3&&!/\\S/.2a(b.3B))a.50(b);b=c}k a},6l:7(a){k $(a).20.I(/^\\s*$/)},6k:7(a,b){a=$(a),b=$(b);1e(a=a.1K)l(a==b)k 14;k 11},6j:7(a){a=$(a);m b=28.3u(a);1d.6j(b[0],b[1]);k a},1r:7(a,b){a=$(a);l([\'6i\',\'3Q\'].19(b))b=(1f a.D.4k!=\'V\'?\'4k\':\'3Q\');b=b.5C();m c=a.D[b];l(!c){l(J.4L&&J.4L.6h){m d=J.4L.6h(a,Q);c=d?d[b]:Q}12 l(a.6g){c=a.6g[b]}}l((c==\'3h\')&&[\'2f\',\'2g\'].19(b)&&(a.1r(\'26\')!=\'47\'))c=a[\'1y\'+b.7C()]+\'1Q\';l(1d.24&&[\'2i\',\'2l\',\'6d\',\'6c\'].19(b))l(o.1r(a,\'1l\')==\'4I\')c=\'3h\';l(b==\'4g\'){l(c)k 2F(c);l(c=(a.1r(\'2A\')||\'\').I(/3x\\(4g=(.*)\\)/))l(c[1])k 2F(c[1])/6a;k 1.0}k c==\'3h\'?Q:c},8U:7(a,b){a=$(a);U(m c 1J b){m d=b[c];l(c==\'4g\'){l(d==1){d=(/7q/.2a(1I.25)&&!/31|2Z|2U/.2a(1I.25))?0.8T:1.0;l(/5q/.2a(1I.25)&&!1d.24)a.D.2A=a.1r(\'2A\').1P(/3x\\([^\\)]*\\)/3O,\'\')}12 l(d==\'\'){l(/5q/.2a(1I.25)&&!1d.24)a.D.2A=a.1r(\'2A\').1P(/3x\\([^\\)]*\\)/3O,\'\')}12{l(d<0.8S)d=0;l(/5q/.2a(1I.25)&&!1d.24)a.D.2A=a.1r(\'2A\').1P(/3x\\([^\\)]*\\)/3O,\'\')+\'3x(4g=\'+d*6a+\')\'}}12 l([\'6i\',\'3Q\'].19(c))c=(1f a.D.4k!=\'V\')?\'4k\':\'3Q\';a.D[c.5C()]=d}k a},4Q:7(a){a=$(a);m b=$(a).1r(\'26\');l(b!=\'47\'&&b!=Q)k{2f:a.2O,2g:a.2T};m c=a.D;m d=c.4F;m e=c.1l;m f=c.26;c.4F=\'4j\';c.1l=\'2B\';c.26=\'8P\';m g=a.63;m h=a.62;c.26=f;c.1l=e;c.4F=d;k{2f:g,2g:h}},8N:7(a){a=$(a);m b=o.1r(a,\'1l\');l(b==\'4I\'||!b){a.4B=14;a.D.1l=\'4m\';l(1d.24){a.D.2l=0;a.D.2i=0}}k a},8M:7(a){a=$(a);l(a.4B){a.4B=V;a.D.1l=a.D.2l=a.D.2i=a.D.6c=a.D.6d=\'\'}k a},8L:7(a){a=$(a);l(a.2X)k a;a.2X=a.D.3L||\'3h\';l((o.1r(a,\'3L\')||\'52\')!=\'4j\')a.D.3L=\'4j\';k a},8J:7(a){a=$(a);l(!a.2X)k a;a.D.3L=a.2X==\'3h\'?\'\':a.2X;a.2X=Q;k a}};B.v(o.1c,{60:o.1c.6k});o.1H={};o.1H.3W={8I:"8H",8G:"8F",8D:"8C",8B:"8A",8y:"8x",8w:"8v",8u:"8t",8p:"8n",5X:"8l",8k:"8j"};o.1H.1E={5H:7(a,b){k a.6n(b,2)},3m:7(a,b){k $(a).3G(b)?b:Q},D:7(a){k a.D.8h.1z()},5U:7(a){m b=a.5T(\'5U\');k b.5S?b.3B:Q}};B.v(o.1H.1E,{8e:o.1H.1E.5H,8b:o.1H.1E.5H,2c:o.1H.1E.3m,5R:o.1H.1E.3m,5X:o.1H.1E.3m,8a:o.1H.1E.3m});o.1c.55={3G:7(a,b){m t=o.1H;b=t.3W[b]||b;k $(a).5T(b).5S}};l(J.5m&&!1d.24){o.1c.5l=7(b,c){b=$(b);c=1f c==\'V\'?\'\':c.1L();m d=b.1a.1B();l([\'5Q\',\'4v\',\'4u\',\'5P\'].19(d)){m e=J.3g(\'3E\');3b(d){1g\'5Q\':1g\'4v\':e.20=\'<2d><2e>\'+c.1Y()+\'</2e></2d>\';3F=2;15;1g\'4u\':e.20=\'<2d><2e><4r>\'+c.1Y()+\'</4r></2e></2d>\';3F=3;15;1g\'5P\':e.20=\'<2d><2e><4r><5Y>\'+c.1Y()+\'</5Y></4r></2e></2d>\';3F=4}$A(b.23).P(7(a){b.50(a)});3F.7V(7(){e=e.42});$A(e.23).P(7(a){b.4w(a)})}12{b.20=c.1Y()}2t(7(){c.2M()},10);k b}};B.v(o,o.1c);m 5E=11;l(/31|2Z|2U/.2a(1I.25))[\'\',\'M\',\'8o\',\'84\',\'8q\'].P(7(a){m b=\'8r\'+a+\'o\';l(1d[b])k;m c=1d[b]={};c.C=J.3g(a?a.1z():\'3E\').8s});o.82=7(g){B.v(o.1c,g||{});7 3w(a,b,c){c=c||11;m d=o.v.3q;U(m e 1J a){m f=a[e];l(!c||!(e 1J b))b[e]=d.53(f)}}l(1f 5L!=\'V\'){3w(o.1c,5L.C);3w(o.1c.55,5L.C,14);3w(M.1c,b6.C);[b5,b4,b3].P(7(a){3w(M.o.1c,a.C)});5E=14}}m 81=N B();81.26=o.6F;1q.1n=7(a){6.5I=a}1q.1n.C={1C:7(a,b){6.E=$(a);6.4q=b.1Y();l(6.5I&&6.E.7Y){1u{6.E.7Y(6.5I,6.4q)}1A(e){m c=6.E.1a.1B();l([\'4v\',\'4u\'].19(c)){6.2Y(6.7X())}12{1V e;}}}12{6.2m=6.E.6B.6A();l(6.2D)6.2D();6.2Y([6.2m.6y(6.4q)])}2t(7(){b.2M()},10)},7X:7(){m a=J.3g(\'3E\');a.20=\'<2d><2e>\'+6.4q+\'</2e></2d>\';k $A(a.23[0].23[0].23)}}m 1n=N B();1n.7W=1j.1h();1n.7W.C=B.v(N 1q.1n(\'b1\'),{2D:7(){6.2m.b0(6.E)},2Y:7(b){b.P((7(a){6.E.1K.4C(a,6.E)}).1i(6))}});1n.7U=1j.1h();1n.7U.C=B.v(N 1q.1n(\'aZ\'),{2D:7(){6.2m.4Y(6.E);6.2m.7T(14)},2Y:7(b){b.3Z(11).P((7(a){6.E.4C(a,6.E.42)}).1i(6))}});1n.66=1j.1h();1n.66.C=B.v(N 1q.1n(\'aX\'),{2D:7(){6.2m.4Y(6.E);6.2m.7T(6.E)},2Y:7(b){b.P((7(a){6.E.4w(a)}).1i(6))}});1n.7S=1j.1h();1n.7S.C=B.v(N 1q.1n(\'aV\'),{2D:7(){6.2m.aU(6.E)},2Y:7(b){b.P((7(a){6.E.1K.4C(a,6.E.41)}).1i(6))}});o.3T=1j.1h();o.3T.C={1C:7(a){6.E=$(a)},29:7(b){6.E.44.2C(/\\s+/).1F(7(a){k a.u>0}).29(b)},5D:7(a){6.E.44=a},4O:7(a){l(6.19(a))k;6.5D($A(6).1s(a).22(\' \'))},3v:7(a){l(!6.19(a))k;6.5D($A(6).4R(a).22(\' \'))},1L:7(){k $A(6).22(\' \')}};B.v(o.3T.C,1w);m 1v=1j.1h();1v.C={1C:7(a){6.2E={2s:[]};6.3i=a.1L().3D();6.7P();6.7O()},7P:7(){7 4o(a){1V\'aS aR 1J 7M: \'+a;}l(6.3i==\'\')4o(\'6l 3i\');m b=6.2E,2b=6.3i,I,5A,1o,5z;1e(I=2b.I(/^(.*)\\[([a-5y-5x:-]+?)(?:([~\\|!]?=)(?:"([^"]*)"|([^\\]\\s]*)))?\\]$/i)){b.3o=b.3o||[];b.3o.G({2j:I[2],3U:I[3],T:I[4]||I[5]||\'\'});2b=I[1]}l(2b==\'*\')k 6.2E.7I=14;1e(I=2b.I(/^([^a-5y-5x-])?([a-5y-5x-]+)(.*)/i)){5A=I[1],1o=I[2],5z=I[3];3b(5A){1g\'#\':b.2L=1o;15;1g\'.\':b.2s.G(1o);15;1g\'\':1g V:b.1a=1o.1B();15;45:4o(2b.Y())}2b=5z}l(2b.u>0)4o(2b.Y())},7H:7(){m e=6.2E,1O=[],1o;l(e.7I)1O.G(\'14\');l(1o=e.2L)1O.G(\'E.56("2L") == \'+1o.Y());l(1o=e.1a)1O.G(\'E.1a.1B() == \'+1o.Y());l((1o=e.2s).u>0)U(m i=0,u=1o.u;i<u;i++)1O.G(\'E.3M(\'+1o[i].Y()+\')\');l(1o=e.3o){1o.P(7(b){m c=\'E.56(\'+b.2j.Y()+\')\';m d=7(a){k c+\' && \'+c+\'.2C(\'+a.Y()+\')\'}3b(b.3U){1g\'=\':1O.G(c+\' == \'+b.T.Y());15;1g\'~=\':1O.G(d(\' \')+\'.19(\'+b.T.Y()+\')\');15;1g\'|=\':1O.G(d(\'-\')+\'.3k().1B() == \'+b.T.1B().Y());15;1g\'!=\':1O.G(c+\' != \'+b.T.Y());15;1g\'\':1g V:1O.G(\'E.3G(\'+b.2j.Y()+\')\');15;45:1V\'aO 3U \'+b.3U+\' 1J 7M\';}})}k 1O.22(\' && \')},7O:7(){6.I=N 4P(\'E\',\'l (!E.1a) k 11; E = $(E); k \'+6.7H())},7D:7(a){m b;l(b=$(6.2E.2L))l(6.I(b))l(!a||o.60(b,a))k[b];a=(a||J).3j(6.2E.1a||\'*\');m c=[];U(m i=0,u=a.u;i<u;i++)l(6.I(b=a[i]))c.G(o.v(b));k c},1L:7(){k 6.3i}}B.v(1v,{6H:7(a,b){m c=N 1v(b);k a.1F(c.I.1i(c)).1k(o.v)},2K:7(a,b,c){l(1f b==\'aN\')c=b,b=11;k 1v.6H(a,b||\'*\')[c||0]},4S:7(g,h){k h.1k(7(f){k f.I(/[^\\s"]+(?:"[^"]*"[^\\s"]+)*/g).1T([Q],7(c,d){m e=N 1v(d);k c.1T([],7(a,b){k a.1s(e.7D(b||g))})})}).4T()}});7 $$(){k 1v.4S(J,$A(O))}m M={4X:7(a){$(a).4X();k a},7B:7(d,e){m f=d.1T({},7(a,b){l(!b.2c&&b.2j){m c=b.2j,T=$(b).1t();l(T!=V){l(a[c]){l(a[c].2r!=1p)a[c]=[a[c]];a[c].G(T)}12 a[c]=T}}k a});k e?f:1D.2G(f)}};M.1c={4n:7(a,b){k M.7B(M.2I(a),b)},2I:7(c){k $A($(c).3j(\'*\')).1T([],7(a,b){l(M.o.3n[b.1a.1z()])a.G(o.v(b));k a})},aJ:7(a,b,c){a=$(a);m d=a.3j(\'3N\');l(!b&&!c)k $A(d).1k(o.v);U(m i=0,5u=[],u=d.u;i<u;i++){m e=d[i];l((b&&e.21!=b)||(c&&e.2j!=c))4c;5u.G(o.v(e))}k 5u},7x:7(b){b=$(b);b.2I().P(7(a){a.6G();a.2c=\'14\'});k b},7w:7(b){b=$(b);b.2I().P(7(a){a.2c=\'\'});k b},7v:7(b){k $(b).2I().6x(7(a){k a.21!=\'4j\'&&!a.2c&&[\'3N\',\'1F\',\'5s\'].19(a.1a.1z())})},aG:7(a){a=$(a);a.7v().7s();k a}}B.v(M,M.1c);M.o={5r:7(a){$(a).5r();k a},1F:7(a){$(a).1F();k a}}M.o.1c={4n:7(a){a=$(a);l(!a.2c&&a.2j){m b=a.1t();l(b!=V){m c={};c[a.2j]=b;k 1D.2G(c)}}k\'\'},1t:7(a){a=$(a);m b=a.1a.1z();k M.o.3n[b](a)},6s:7(a){$(a).T=\'\';k a},aF:7(a){k $(a).T!=\'\'},7s:7(a){a=$(a);a.5r();l(a.1F&&(a.1a.1z()!=\'3N\'||![\'58\',\'4X\',\'aD\'].19(a.21)))a.1F();k a},7x:7(a){a=$(a);a.2c=14;k a},7w:7(a){a=$(a);a.6G();a.2c=11;k a}}B.v(M.o,M.o.1c);m aC=M.o;m $F=M.o.1t;M.o.3n={3N:7(a){3b(a.21.1z()){1g\'7p\':1g\'6R\':k M.o.3n.6P(a);45:k M.o.3n.5s(a)}},6P:7(a){k a.5R?a.T:Q},5s:7(a){k a.T},1F:7(a){k 6[a.21==\'1F-aA\'?\'6M\':\'7l\'](a)},6M:7(a){m b=a.ax;k b>=0?6.5a(a.L[b]):Q},7l:7(a){m b,u=a.u;l(!u)k Q;U(m i=0,b=[];i<u;i++){m c=a.L[i];l(c.aw)b.G(6.5a(c))}k b},5a:7(a){k o.v(a).3G(\'T\')?a.T:a.2J}}1q.4i=7(){}1q.4i.C={1C:7(a,b,c){6.2x=b;6.E=$(a);6.2R=c;6.2o=6.1t();6.2z()},2z:7(){6V(6.2w.1i(6),6.2x*5b)},2w:7(){m a=6.1t();m b=(\'3d\'==1f 6.2o&&\'3d\'==1f a?6.2o!=a:1M(6.2o)!=1M(a));l(b){6.2R(6.E,a);6.2o=a}}}M.o.4h=1j.1h();M.o.4h.C=B.v(N 1q.4i(),{1t:7(){k M.o.1t(6.E)}});M.4h=1j.1h();M.4h.C=B.v(N 1q.4i(),{1t:7(){k M.4n(6.E)}});1q.2p=7(){}1q.2p.C={1C:7(a,b){6.E=$(a);6.2R=b;6.2o=6.1t();l(6.E.1a.1z()==\'5V\')6.7g();12 6.2z(6.E)},5c:7(){m a=6.1t();l(6.2o!=a){6.2R(6.E,a);6.2o=a}},7g:7(){M.2I(6.E).P(6.2z.1i(6))},2z:7(a){l(a.21){3b(a.21.1z()){1g\'7p\':1g\'6R\':1b.2H(a,\'at\',6.5c.1i(6));15;45:1b.2H(a,\'as\',6.5c.1i(6));15}}}}M.o.2p=1j.1h();M.o.2p.C=B.v(N 1q.2p(),{1t:7(){k M.o.1t(6.E)}});M.2p=1j.1h();M.2p.C=B.v(N 1q.2p(),{1t:7(){k M.4n(6.E)}});l(!1d.1b){m 1b=N B()}B.v(1b,{aq:8,ap:9,ao:13,am:27,al:37,aj:38,ah:39,ag:40,ad:46,aa:36,a9:35,a7:33,ac:34,E:7(a){k a.a5||a.a4},af:7(a){k(((a.75)&&(a.75==1))||((a.58)&&(a.58==1)))},a3:7(a){k a.a2||(a.a1+(J.4e.2S||J.1x.2S))},a0:7(a){k a.9Z||(a.9Y+(J.4e.2P||J.1x.2P))},59:7(a){l(a.72){a.72();a.9X()}12{a.9W=11;a.9V=14}},2K:7(a,b){m c=1b.E(a);1e(c.1K&&(!c.1a||(c.1a.1B()!=b.1B())))c=c.1K;k c},1S:11,70:7(a,b,c,d){l(!6.1S)6.1S=[];l(a.6Z){6.1S.G([a,b,c,d]);a.6Z(b,c,d)}12 l(a.5n){6.1S.G([a,b,c,d]);a.5n(\'3a\'+b,c)}},7e:7(){l(!1b.1S)k;U(m i=0,u=1b.1S.u;i<u;i++){1b.3S.1R(6,1b.1S[i]);1b.1S[i][0]=Q}1b.1S=11},2H:7(a,b,c,d){a=$(a);d=d||11;l(b==\'7d\'&&(1I.5f.I(/31|2Z|2U/)||a.5n))b=\'6X\';1b.70(a,b,c,d)},3S:7(a,b,c,d){a=$(a);d=d||11;l(b==\'7d\'&&(1I.5f.I(/31|2Z|2U/)||a.5e))b=\'6X\';l(a.7h){a.7h(b,c,d)}12 l(a.5e){1u{a.5e(\'3a\'+b,c)}1A(e){}}}});l(1I.5f.I(/\\9S\\b/))1b.2H(1d,\'9R\',1b.7e,11);m 28={7i:11,5p:7(){6.7k=1d.9P||J.4e.2S||J.1x.2S||0;6.7r=1d.9O||J.4e.2P||J.1x.2P||0},7m:7(a){m b=0,1m=0;2N{b+=a.2P||0;1m+=a.2S||0;a=a.1K}1e(a);k[1m,b]},3u:7(a){m b=0,1m=0;2N{b+=a.2v||0;1m+=a.2q||0;a=a.1X}1e(a);k[1m,b]},7G:7(a){m b=0,1m=0;2N{b+=a.2v||0;1m+=a.2q||0;a=a.1X;l(a){l(a.1a==\'7A\')15;m p=o.1r(a,\'1l\');l(p==\'4m\'||p==\'2B\')15}}1e(a);k[1m,b]},1X:7(a){l(a.1X)k a.1X;l(a==J.1x)k a;1e((a=a.1K)&&a!=J.1x)l(o.1r(a,\'1l\')!=\'4I\')k a;k J.1x},9I:7(a,x,y){l(6.7i)k 6.6Q(a,x,y);6.3r=x;6.3C=y;6.1y=6.3u(a);k(y>=6.1y[1]&&y<6.1y[1]+a.2T&&x>=6.1y[0]&&x<6.1y[0]+a.2O)},6Q:7(a,x,y){m b=6.7m(a);6.3r=x+b[0]-6.7k;6.3C=y+b[1]-6.7r;6.1y=6.3u(a);k(6.3C>=6.1y[1]&&6.3C<6.1y[1]+a.2T&&6.3r>=6.1y[0]&&6.3r<6.1y[0]+a.2O)},9G:7(a,b){l(!a)k 0;l(a==\'9F\')k((6.1y[1]+b.2T)-6.3C)/b.2T;l(a==\'9D\')k((6.1y[0]+b.2O)-6.3r)/b.2O},5F:7(a){m b=0,1m=0;m c=a;2N{b+=c.2v||0;1m+=c.2q||0;l(c.1X==J.1x)l(o.1r(c,\'1l\')==\'2B\')15}1e(c=c.1X);c=a;2N{l(!1d.24||c.1a==\'7A\'){b-=c.2P||0;1m-=c.2S||0}}1e(c=c.1K);k[1m,b]},3s:7(a,b){m c=B.v({6O:14,7Q:14,6N:14,7R:14,2v:0,2q:0},O[2]||{})a=$(a);m p=28.5F(a);b=$(b);m d=[0,0];m e=Q;l(o.1r(b,\'1l\')==\'2B\'){e=28.1X(b);d=28.5F(e)}l(e==J.1x){d[0]-=J.1x.2q;d[1]-=J.1x.2v}l(c.6O)b.D.2i=(p[0]-d[0]+c.2q)+\'1Q\';l(c.7Q)b.D.2l=(p[1]-d[1]+c.2v)+\'1Q\';l(c.6N)b.D.2f=a.2O+\'1Q\';l(c.7R)b.D.2g=a.2T+\'1Q\'},9B:7(a){a=$(a);l(a.D.1l==\'2B\')k;28.5p();m b=28.7G(a);m c=b[1];m d=b[0];m e=a.63;m f=a.62;a.6e=d-2F(a.D.2i||0);a.6L=c-2F(a.D.2l||0);a.6K=a.D.2f;a.6J=a.D.2g;a.D.1l=\'2B\';a.D.2l=c+\'1Q\';a.D.2i=d+\'1Q\';a.D.2f=e+\'1Q\';a.D.2g=f+\'1Q\'},b7:7(a){a=$(a);l(a.D.1l==\'4m\')k;28.5p();a.D.1l=\'4m\';m b=2F(a.D.2l||0)-(a.6L||0);m c=2F(a.D.2i||0)-(a.6e||0);a.D.2l=b+\'1Q\';a.D.2i=c+\'1Q\';a.D.2g=a.6J;a.D.2f=a.6K}}l(/31|2Z|2U/.2a(1I.25)){28.3u=7(a){m b=0,1m=0;2N{b+=a.2v||0;1m+=a.2q||0;l(a.1X==J.1x)l(o.1r(a,\'1l\')==\'2B\')15;a=a.1X}1e(a);k[1m,b]}}o.82();',62,690,'||||||this|function|||||||||||||return|if|var||Element||||||length|extend||||||Object|prototype|style|element||push||match|document||options|Form|new|arguments|each|null|||value|for|undefined|Ajax||inspect|||false|else||true|break||Prototype|transport|include|tagName|Event|Methods|window|while|typeof|case|create|bind|Class|map|position|valueL|Insertion|clause|Array|Abstract|getStyle|concat|getValue|try|Selector|Enumerable|body|offset|toLowerCase|catch|toUpperCase|initialize|Hash|values|select|method|_attributeTranslations|navigator|in|parentNode|toString|String|gsub|conditions|replace|px|apply|observers|inject|toArray|throw|args|offsetParent|stripScripts|onComplete|innerHTML|type|join|childNodes|opera|userAgent|display||Position|_each|test|expr|disabled|table|tbody|width|height|source|left|name|key|top|range|success|lastValue|EventObserver|offsetLeft|constructor|classNames|setTimeout|decay|offsetTop|onTimerEvent|frequency|emptyFunction|registerCallback|filter|absolute|split|initializeRange|params|parseFloat|toQueryString|observe|getElements|text|findElement|id|evalScripts|do|offsetWidth|scrollTop|slice|callback|scrollLeft|offsetHeight|KHTML|timer|Responders|_overflow|insertContent|Safari||Konqueror|url||||||||on|switch|Request|string|parameters|post|createElement|auto|expression|getElementsByTagName|first|dispatchException|_flag|Serializers|attributes|pluck|cache|xcomp|clone|Template|cumulativeOffset|remove|copy|alpha|_|start|responders|nodeValue|ycomp|strip|div|depth|hasAttribute|asynchronous|setOptions|Base|dispatch|overflow|hasClassName|input|gi|ObjectRange|cssFloat|encodeURIComponent|stopObserving|ClassNames|operator|charAt|names|nextSiblings|ScriptFragment|reverse||nextSibling|firstChild|recursivelyCollect|className|default||none|evaluate|status|json|responseText|continue|currentlyExecuting|documentElement|container|opacity|Observer|TimedObserver|hidden|styleFloat|RegExp|relative|serialize|abort|child|content|tr|nodeType|encoding|TR|TBODY|appendChild|application|_complete|eval|shift|_madePositioned|insertBefore|activeRequestCount|object|visibility|toQueryParams|getTransport|static|end|respondToReadyState|defaultView|script|onStateChange|add|Function|getDimensions|without|findChildElements|flatten|_reverse|previousSiblings|prepareReplacement|reset|selectNodeContents|last|removeChild|criteria|visible|findOrStore|interpret|Simulated|readAttribute|falses|button|stop|optionValue|1000|onElementEvent|elements|detachEvent|appVersion|array|slices|failure|Updater|getHeader|update|all|attachEvent|updater|prepare|MSIE|focus|textarea|XPath|matchingInputs|getElementsByClassName|substring|9_|z0|rest|modifier|len|camelize|set|_nativeExtensions|page|succ|_getAttr|adjacency|request|BrowserFeatures|HTMLElement|Complete|Version|Events|TD|THEAD|checked|specified|getAttributeNode|title|form|contentType|readonly|td|onCreate|childOf|register|clientHeight|clientWidth|extractScripts|XMLHTTP|Bottom|ActiveXObject|img|XMLHttpRequest|100|exclusive|bottom|right|_originalLeft|stripTags|currentStyle|getComputedStyle|float|scrollTo|descendantOf|empty|arrayLength|getAttribute|reduce|indexOf|compact|index|clear|keys|descendants|ancestors|attribute|find|createContextualFragment|size|createRange|ownerDocument|outerHTML|show|hide|toggle|blur|matchElements|_extended|_originalHeight|_originalWidth|_originalTop|selectOne|setWidth|setLeft|inputSelector|withinIncludingScrolloffsets|radio|findAll|detect|collect|setInterval|lastText|keydown|updateComplete|addEventListener|_observeAndCache|PeriodicalUpdater|preventDefault|insertion|eachSlice|which|onException|evalResponse|pattern|template|Pattern|evalJSON|updateContent|keypress|unloadCache|PeriodicalExecuter|registerFormCallbacks|removeEventListener|includeScrollOffsets|requestHeaders|deltaX|selectMany|realOffset|2005|_getElementsByXPath|checkbox|Gecko|deltaY|activate|Content|xml|findFirstElement|enable|disable|javascript|these|BODY|serializeElements|capitalize|findElements|readyState|Try|positionedOffset|buildMatchExpression|wildcard|overrideMimeType|class|setRequestHeaders|selector|onreadystatechange|compileMatcher|parseExpression|setTop|setHeight|After|collapse|Top|times|Before|contentFromAnonymousTable|insertAdjacentHTML|get|decodeURIComponent|Toggle|addMethods|Interactive|TextArea|Loaded|Loading|Uninitialized|toColorPart|Number|multiple|src|UTF|unescapeHTML|href|urlencoded|event|cssText|www|longDesc|longdesc|readOnly|createTextNode|maxLength|Input|maxlength|Select|HTML|__proto__|encType|enctype|tabIndex|tabindex|accessKey|accesskey|bindAsEventListener|dateTime|datetime|vAlign|valign|escapeHTML|rowSpan|rowspan|colSpan|colspan|undoClipping|unregister|makeClipping|undoPositioned|makePositioned|im|block|Microsoft|Msxml2|00001|999999|setStyle|delete|merge|call|cleanWhitespace|toggleClassName|removeClassName|truncate|addClassName|scan|getWidth|getHeight|uniq|sub|getElementsBySelector|next|previous|down|up|siblings|previousSibling|from|immediateDescendants|entries|member|callee|replaceChild|pop|zip|sort|RangeError|sortBy|SELECT|reject|TEXTAREA|INPUT|instanceof|FORM|partition|finally|min|max|clearInterval|absolutize|invoke|horizontal|inGroupsOf|vertical|overlap|contains|within|grep|snapshotItem|snapshotLength|ORDERED_NODE_SNAPSHOT_TYPE|XPathResult|pageYOffset|pageXOffset|getElementById|unload|bMSIE|any|clearTimeout|cancelBubble|returnValue|stopPropagation|clientY|pageY|pointerY|clientX|pageX|pointerX|srcElement|target|JSON|KEY_PAGEUP|getResponseHeader|KEY_END|KEY_HOME|ecma|KEY_PAGEDOWN|KEY_DELETE|java|isLeftClick|KEY_DOWN|KEY_RIGHT|Failure|KEY_UP|Success|KEY_LEFT|KEY_ESC|parseQuery|KEY_RETURN|KEY_TAB|KEY_BACKSPACE|300|change|click|200|setRequestHeader|selected|selectedIndex|close|dasherize|one|Connection|Field|submit|charset|present|focusFirstElement|html|underscore|getInputs|Accept|With|Requested|number|Unknown|send|postBody|error|Parse|charCodeAt|setStartAfter|afterEnd|open|beforeEnd|fromCharCode|afterBegin|setStartBefore|beforeBegin|_method|HTMLSelectElement|HTMLTextAreaElement|HTMLInputElement|HTMLFormElement|relativize'.split('|'),0,{}))
@@ -1 +0,0 @@
1
- var Prototype={Version:'1.5.0',BrowserFeatures:{XPath:!!document.evaluate},ScriptFragment:'(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)',emptyFunction:function(){},K:function(x){return x}}var Class={create:function(){return function(){this.initialize.apply(this,arguments)}}}var Abstract=new Object();Object.extend=function(a,b){for(var c in b){a[c]=b[c]}return a}Object.extend(Object,{inspect:function(a){try{if(a===undefined)return'undefined';if(a===null)return'null';return a.inspect?a.inspect():a.toString()}catch(e){if(e instanceof RangeError)return'...';throw e;}},keys:function(a){var b=[];for(var c in a)b.push(c);return b},values:function(a){var b=[];for(var c in a)b.push(a[c]);return b},clone:function(a){return Object.extend({},a)}});Function.prototype.bind=function(){var a=this,args=$A(arguments),object=args.shift();return function(){return a.apply(object,args.concat($A(arguments)))}}Function.prototype.bindAsEventListener=function(b){var c=this,args=$A(arguments),b=args.shift();return function(a){return c.apply(b,[(a||window.event)].concat(args).concat($A(arguments)))}}Object.extend(Number.prototype,{toColorPart:function(){var a=this.toString(16);if(this<16)return'0'+a;return a},succ:function(){return this+1},times:function(a){$R(0,this,true).each(a);return this}});var Try={these:function(){var a;for(var i=0,length=arguments.length;i<length;i++){var b=arguments[i];try{a=b();break}catch(e){}}return a}}var PeriodicalExecuter=Class.create();PeriodicalExecuter.prototype={initialize:function(a,b){this.callback=a;this.frequency=b;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},stop:function(){if(!this.timer)return;clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.callback(this)}finally{this.currentlyExecuting=false}}}}String.interpret=function(a){return a==null?'':String(a)}Object.extend(String.prototype,{gsub:function(a,b){var c='',source=this,match;b=arguments.callee.prepareReplacement(b);while(source.length>0){if(match=source.match(a)){c+=source.slice(0,match.index);c+=String.interpret(b(match));source=source.slice(match.index+match[0].length)}else{c+=source,source=''}}return c},sub:function(b,c,d){c=this.gsub.prepareReplacement(c);d=d===undefined?1:d;return this.gsub(b,function(a){if(--d<0)return a[0];return c(a)})},scan:function(a,b){this.gsub(a,b);return this},truncate:function(a,b){a=a||30;b=b===undefined?'...':b;return this.length>a?this.slice(0,a-b.length)+b:this},strip:function(){return this.replace(/^\s+/,'').replace(/\s+$/,'')},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,'')},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,'img'),'')},extractScripts:function(){var b=new RegExp(Prototype.ScriptFragment,'img');var c=new RegExp(Prototype.ScriptFragment,'im');return(this.match(b)||[]).map(function(a){return(a.match(c)||['',''])[1]})},evalScripts:function(){return this.extractScripts().map(function(a){return eval(a)})},escapeHTML:function(){var a=document.createElement('div');var b=document.createTextNode(this);a.appendChild(b);return a.innerHTML},unescapeHTML:function(){var c=document.createElement('div');c.innerHTML=this.stripTags();return c.childNodes[0]?(c.childNodes.length>1?$A(c.childNodes).inject('',function(a,b){return a+b.nodeValue}):c.childNodes[0].nodeValue):''},toQueryParams:function(e){var f=this.strip().match(/([^?#]*)(#.*)?$/);if(!f)return{};return f[1].split(e||'&').inject({},function(a,b){if((b=b.split('='))[0]){var c=decodeURIComponent(b[0]);var d=b[1]?decodeURIComponent(b[1]):undefined;if(a[c]!==undefined){if(a[c].constructor!=Array)a[c]=[a[c]];if(d)a[c].push(d)}else a[c]=d}return a})},toArray:function(){return this.split('')},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)},camelize:function(){var a=this.split('-'),len=a.length;if(len==1)return a[0];var b=this.charAt(0)=='-'?a[0].charAt(0).toUpperCase()+a[0].substring(1):a[0];for(var i=1;i<len;i++)b+=a[i].charAt(0).toUpperCase()+a[i].substring(1);return b},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},underscore:function(){return this.gsub(/::/,'/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase()},dasherize:function(){return this.gsub(/_/,'-')},inspect:function(a){var b=this.replace(/\\/g,'\\\\');if(a)return'"'+b.replace(/"/g,'\\"')+'"';else return"'"+b.replace(/'/g,'\\\'')+"'"}});String.prototype.gsub.prepareReplacement=function(b){if(typeof b=='function')return b;var c=new Template(b);return function(a){return c.evaluate(a)}}String.prototype.parseQuery=String.prototype.toQueryParams;var Template=Class.create();Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;Template.prototype={initialize:function(a,b){this.template=a.toString();this.pattern=b||Template.Pattern},evaluate:function(c){return this.template.gsub(this.pattern,function(a){var b=a[1];if(b=='\\')return a[2];return b+String.interpret(c[a[3]])})}}var $break=new Object();var $continue=new Object();var Enumerable={each:function(b){var c=0;try{this._each(function(a){try{b(a,c++)}catch(e){if(e!=$continue)throw e;}})}catch(e){if(e!=$break)throw e;}return this},eachSlice:function(a,b){var c=-a,slices=[],array=this.toArray();while((c+=a)<array.length)slices.push(array.slice(c,c+a));return slices.map(b)},all:function(c){var d=true;this.each(function(a,b){d=d&&!!(c||Prototype.K)(a,b);if(!d)throw $break;});return d},any:function(c){var d=false;this.each(function(a,b){if(d=!!(c||Prototype.K)(a,b))throw $break;});return d},collect:function(c){var d=[];this.each(function(a,b){d.push((c||Prototype.K)(a,b))});return d},detect:function(c){var d;this.each(function(a,b){if(c(a,b)){d=a;throw $break;}});return d},findAll:function(c){var d=[];this.each(function(a,b){if(c(a,b))d.push(a)});return d},grep:function(d,e){var f=[];this.each(function(a,b){var c=a.toString();if(c.match(d))f.push((e||Prototype.K)(a,b))})return f},include:function(b){var c=false;this.each(function(a){if(a==b){c=true;throw $break;}});return c},inGroupsOf:function(b,c){c=c===undefined?null:c;return this.eachSlice(b,function(a){while(a.length<b)a.push(c);return a})},inject:function(c,d){this.each(function(a,b){c=d(c,a,b)});return c},invoke:function(b){var c=$A(arguments).slice(1);return this.map(function(a){return a[b].apply(a,c)})},max:function(c){var d;this.each(function(a,b){a=(c||Prototype.K)(a,b);if(d==undefined||a>=d)d=a});return d},min:function(c){var d;this.each(function(a,b){a=(c||Prototype.K)(a,b);if(d==undefined||a<d)d=a});return d},partition:function(c){var d=[],falses=[];this.each(function(a,b){((c||Prototype.K)(a,b)?d:falses).push(a)});return[d,falses]},pluck:function(c){var d=[];this.each(function(a,b){d.push(a[c])});return d},reject:function(c){var d=[];this.each(function(a,b){if(!c(a,b))d.push(a)});return d},sortBy:function(e){return this.map(function(a,b){return{value:a,criteria:e(a,b)}}).sort(function(c,d){var a=c.criteria,b=d.criteria;return a<b?-1:a>b?1:0}).pluck('value')},toArray:function(){return this.map()},zip:function(){var c=Prototype.K,args=$A(arguments);if(typeof args.last()=='function')c=args.pop();var d=[this].concat(args).map($A);return this.map(function(a,b){return c(d.pluck(b))})},size:function(){return this.toArray().length},inspect:function(){return'#<Enumerable:'+this.toArray().inspect()+'>'}}Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});var $A=Array.from=function(a){if(!a)return[];if(a.toArray){return a.toArray()}else{var b=[];for(var i=0,length=a.length;i<length;i++)b.push(a[i]);return b}}Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse)Array.prototype._reverse=Array.prototype.reverse;Object.extend(Array.prototype,{_each:function(a){for(var i=0,length=this.length;i<length;i++)a(this[i])},clear:function(){this.length=0;return this},first:function(){return this[0]},last:function(){return this[this.length-1]},compact:function(){return this.select(function(a){return a!=null})},flatten:function(){return this.inject([],function(a,b){return a.concat(b&&b.constructor==Array?b.flatten():[b])})},without:function(){var b=$A(arguments);return this.select(function(a){return!b.include(a)})},indexOf:function(a){for(var i=0,length=this.length;i<length;i++)if(this[i]==a)return i;return-1},reverse:function(a){return(a!==false?this:this.toArray())._reverse()},reduce:function(){return this.length>1?this:this[0]},uniq:function(){return this.inject([],function(a,b){return a.include(b)?a:a.concat([b])})},clone:function(){return[].concat(this)},size:function(){return this.length},inspect:function(){return'['+this.map(Object.inspect).join(', ')+']'}});Array.prototype.toArray=Array.prototype.clone;function $w(a){a=a.strip();return a?a.split(/\s+/):[]}if(window.opera){Array.prototype.concat=function(){var a=[];for(var i=0,length=this.length;i<length;i++)a.push(this[i]);for(var i=0,length=arguments.length;i<length;i++){if(arguments[i].constructor==Array){for(var j=0,arrayLength=arguments[i].length;j<arrayLength;j++)a.push(arguments[i][j])}else{a.push(arguments[i])}}return a}}var Hash=function(a){Object.extend(this,a||{})};Object.extend(Hash,{toQueryString:function(d){var e=[];this.prototype._each.call(d,function(b){if(!b.key)return;if(b.value&&b.value.constructor==Array){var c=b.value.compact();if(c.length<2)b.value=c.reduce();else{key=encodeURIComponent(b.key);c.each(function(a){a=a!=undefined?encodeURIComponent(a):'';e.push(key+'='+encodeURIComponent(a))});return}}if(b.value==undefined)b[1]='';e.push(b.map(encodeURIComponent).join('='))});return e.join('&')}});Object.extend(Hash.prototype,Enumerable);Object.extend(Hash.prototype,{_each:function(a){for(var b in this){var c=this[b];if(c&&c==Hash.prototype[b])continue;var d=[b,c];d.key=b;d.value=c;a(d)}},keys:function(){return this.pluck('key')},values:function(){return this.pluck('value')},merge:function(c){return $H(c).inject(this,function(a,b){a[b.key]=b.value;return a})},remove:function(){var a;for(var i=0,length=arguments.length;i<length;i++){var b=this[arguments[i]];if(b!==undefined){if(a===undefined)a=b;else{if(a.constructor!=Array)a=[a];a.push(b)}}delete this[arguments[i]]}return a},toQueryString:function(){return Hash.toQueryString(this)},inspect:function(){return'#<Hash:{'+this.map(function(a){return a.map(Object.inspect).join(': ')}).join(', ')+'}>'}});function $H(a){if(a&&a.constructor==Hash)return a;return new Hash(a)};ObjectRange=Class.create();Object.extend(ObjectRange.prototype,Enumerable);Object.extend(ObjectRange.prototype,{initialize:function(a,b,c){this.start=a;this.end=b;this.exclusive=c},_each:function(a){var b=this.start;while(this.include(b)){a(b);b=b.succ()}},include:function(a){if(a<this.start)return false;if(this.exclusive)return a<this.end;return a<=this.end}});var $R=function(a,b,c){return new ObjectRange(a,b,c)}var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject('Msxml2.XMLHTTP')},function(){return new ActiveXObject('Microsoft.XMLHTTP')})||false},activeRequestCount:0}Ajax.Responders={responders:[],_each:function(a){this.responders._each(a)},register:function(a){if(!this.include(a))this.responders.push(a)},unregister:function(a){this.responders=this.responders.without(a)},dispatch:function(b,c,d,f){this.each(function(a){if(typeof a[b]=='function'){try{a[b].apply(a,[c,d,f])}catch(e){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=function(){};Ajax.Base.prototype={setOptions:function(a){this.options={method:'post',asynchronous:true,contentType:'application/x-www-form-urlencoded',encoding:'UTF-8',parameters:''}Object.extend(this.options,a||{});this.options.method=this.options.method.toLowerCase();if(typeof this.options.parameters=='string')this.options.parameters=this.options.parameters.toQueryParams()}}Ajax.Request=Class.create();Ajax.Request.Events=['Uninitialized','Loading','Loaded','Interactive','Complete'];Ajax.Request.prototype=Object.extend(new Ajax.Base(),{_complete:false,initialize:function(a,b){this.transport=Ajax.getTransport();this.setOptions(b);this.request(a)},request:function(a){this.url=a;this.method=this.options.method;var b=this.options.parameters;if(!['get','post'].include(this.method)){b['_method']=this.method;this.method='post'}b=Hash.toQueryString(b);if(b&&/Konqueror|Safari|KHTML/.test(navigator.userAgent))b+='&_='if(this.method=='get'&&b)this.url+=(this.url.indexOf('?')>-1?'&':'?')+b;try{Ajax.Responders.dispatch('onCreate',this,this.transport);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous)setTimeout(function(){this.respondToReadyState(1)}.bind(this),10);this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();var c=this.method=='post'?(this.options.postBody||b):null;this.transport.send(c);if(!this.options.asynchronous&&this.transport.overrideMimeType)this.onStateChange()}catch(e){this.dispatchException(e)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete))this.respondToReadyState(this.transport.readyState)},setRequestHeaders:function(){var b={'X-Requested-With':'XMLHttpRequest','X-Prototype-Version':Prototype.Version,'Accept':'text/javascript, text/html, application/xml, text/xml, */*'};if(this.method=='post'){b['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)b['Connection']='close'}if(typeof this.options.requestHeaders=='object'){var c=this.options.requestHeaders;if(typeof c.push=='function')for(var i=0,length=c.length;i<length;i+=2)b[c[i]]=c[i+1];else $H(c).each(function(a){b[a.key]=a.value})}for(var d in b)this.transport.setRequestHeader(d,b[d])},success:function(){return!this.transport.status||(this.transport.status>=200&&this.transport.status<300)},respondToReadyState:function(a){var b=Ajax.Request.Events[a];var c=this.transport,json=this.evalJSON();if(b=='Complete'){try{this._complete=true;(this.options['on'+this.transport.status]||this.options['on'+(this.success()?'Success':'Failure')]||Prototype.emptyFunction)(c,json)}catch(e){this.dispatchException(e)}if((this.getHeader('Content-type')||'text/javascript').strip().match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i))this.evalResponse()}try{(this.options['on'+b]||Prototype.emptyFunction)(c,json);Ajax.Responders.dispatch('on'+b,this,c,json)}catch(e){this.dispatchException(e)}if(b=='Complete'){this.transport.onreadystatechange=Prototype.emptyFunction}},getHeader:function(a){try{return this.transport.getResponseHeader(a)}catch(e){return null}},evalJSON:function(){try{var a=this.getHeader('X-JSON');return a?eval('('+a+')'):null}catch(e){return null}},evalResponse:function(){try{return eval(this.transport.responseText)}catch(e){this.dispatchException(e)}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);Ajax.Responders.dispatch('onException',this,a)}});Ajax.Updater=Class.create();Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(c,d,e){this.container={success:(c.success||c),failure:(c.failure||(c.success?null:c))}this.transport=Ajax.getTransport();this.setOptions(e);var f=this.options.onComplete||Prototype.emptyFunction;this.options.onComplete=(function(a,b){this.updateContent();f(a,b)}).bind(this);this.request(d)},updateContent:function(){var a=this.container[this.success()?'success':'failure'];var b=this.transport.responseText;if(!this.options.evalScripts)b=b.stripScripts();if(a=$(a)){if(this.options.insertion)new this.options.insertion(a,b);else a.update(b)}if(this.success()){if(this.onComplete)setTimeout(this.onComplete.bind(this),10)}}});Ajax.PeriodicalUpdater=Class.create();Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(a,b,c){this.setOptions(c);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=a;this.url=b;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=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(a){if(arguments.length>1){for(var i=0,elements=[],length=arguments.length;i<length;i++)elements.push($(arguments[i]));return elements}if(typeof a=='string')a=document.getElementById(a);return Element.extend(a)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(a,b){var c=[];var d=document.evaluate(a,$(b)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var i=0,length=d.snapshotLength;i<length;i++)c.push(d.snapshotItem(i));return c}}document.getElementsByClassName=function(a,b){if(Prototype.BrowserFeatures.XPath){var q=".//*[contains(concat(' ', @class, ' '), ' "+a+" ')]";return document._getElementsByXPath(q,b)}else{var c=($(b)||document.body).getElementsByTagName('*');var d=[],child;for(var i=0,length=c.length;i<length;i++){child=c[i];if(Element.hasClassName(child,a))d.push(Element.extend(child))}return d}};if(!window.Element)var Element=new Object();Element.extend=function(a){if(!a||_nativeExtensions||a.nodeType==3)return a;if(!a._extended&&a.tagName&&a!=window){var b=Object.clone(Element.Methods),cache=Element.extend.cache;if(a.tagName=='FORM')Object.extend(b,Form.Methods);if(['INPUT','TEXTAREA','SELECT'].include(a.tagName))Object.extend(b,Form.Element.Methods);Object.extend(b,Element.Methods.Simulated);for(var c in b){var d=b[c];if(typeof d=='function'&&!(c in a))a[c]=cache.findOrStore(d)}}a._extended=true;return a};Element.extend.cache={findOrStore:function(a){return this[a]=this[a]||function(){return a.apply(null,[this].concat($A(arguments)))}}};Element.Methods={visible:function(a){return $(a).style.display!='none'},toggle:function(a){a=$(a);Element[Element.visible(a)?'hide':'show'](a);return a},hide:function(a){$(a).style.display='none';return a},show:function(a){$(a).style.display='';return a},remove:function(a){a=$(a);a.parentNode.removeChild(a);return a},update:function(a,b){b=typeof b=='undefined'?'':b.toString();$(a).innerHTML=b.stripScripts();setTimeout(function(){b.evalScripts()},10);return a},replace:function(a,b){a=$(a);b=typeof b=='undefined'?'':b.toString();if(a.outerHTML){a.outerHTML=b.stripScripts()}else{var c=a.ownerDocument.createRange();c.selectNodeContents(a);a.parentNode.replaceChild(c.createContextualFragment(b.stripScripts()),a)}setTimeout(function(){b.evalScripts()},10);return a},inspect:function(d){d=$(d);var e='<'+d.tagName.toLowerCase();$H({'id':'id','className':'class'}).each(function(a){var b=a.first(),attribute=a.last();var c=(d[b]||'').toString();if(c)e+=' '+attribute+'='+c.inspect(true)});return e+'>'},recursivelyCollect:function(a,b){a=$(a);var c=[];while(a=a[b])if(a.nodeType==1)c.push(Element.extend(a));return c},ancestors:function(a){return $(a).recursivelyCollect('parentNode')},descendants:function(a){return $A($(a).getElementsByTagName('*'))},immediateDescendants:function(a){if(!(a=$(a).firstChild))return[];while(a&&a.nodeType!=1)a=a.nextSibling;if(a)return[a].concat($(a).nextSiblings());return[]},previousSiblings:function(a){return $(a).recursivelyCollect('previousSibling')},nextSiblings:function(a){return $(a).recursivelyCollect('nextSibling')},siblings:function(a){a=$(a);return a.previousSiblings().reverse().concat(a.nextSiblings())},match:function(a,b){if(typeof b=='string')b=new Selector(b);return b.match($(a))},up:function(a,b,c){return Selector.findElement($(a).ancestors(),b,c)},down:function(a,b,c){return Selector.findElement($(a).descendants(),b,c)},previous:function(a,b,c){return Selector.findElement($(a).previousSiblings(),b,c)},next:function(a,b,c){return Selector.findElement($(a).nextSiblings(),b,c)},getElementsBySelector:function(){var a=$A(arguments),element=$(a.shift());return Selector.findChildElements(element,a)},getElementsByClassName:function(a,b){return document.getElementsByClassName(b,a)},readAttribute:function(a,b){a=$(a);if(document.all&&!window.opera){var t=Element._attributeTranslations;if(t.values[b])return t.values[b](a,b);if(t.names[b])b=t.names[b];var c=a.attributes[b];if(c)return c.nodeValue}return a.getAttribute(b)},getHeight:function(a){return $(a).getDimensions().height},getWidth:function(a){return $(a).getDimensions().width},classNames:function(a){return new Element.ClassNames(a)},hasClassName:function(a,b){if(!(a=$(a)))return;var c=a.className;if(c.length==0)return false;if(c==b||c.match(new RegExp("(^|\\s)"+b+"(\\s|$)")))return true;return false},addClassName:function(a,b){if(!(a=$(a)))return;Element.classNames(a).add(b);return a},removeClassName:function(a,b){if(!(a=$(a)))return;Element.classNames(a).remove(b);return a},toggleClassName:function(a,b){if(!(a=$(a)))return;Element.classNames(a)[a.hasClassName(b)?'remove':'add'](b);return a},observe:function(){Event.observe.apply(Event,arguments);return $A(arguments).first()},stopObserving:function(){Event.stopObserving.apply(Event,arguments);return $A(arguments).first()},cleanWhitespace:function(a){a=$(a);var b=a.firstChild;while(b){var c=b.nextSibling;if(b.nodeType==3&&!/\S/.test(b.nodeValue))a.removeChild(b);b=c}return a},empty:function(a){return $(a).innerHTML.match(/^\s*$/)},descendantOf:function(a,b){a=$(a),b=$(b);while(a=a.parentNode)if(a==b)return true;return false},scrollTo:function(a){a=$(a);var b=Position.cumulativeOffset(a);window.scrollTo(b[0],b[1]);return a},getStyle:function(a,b){a=$(a);if(['float','cssFloat'].include(b))b=(typeof a.style.styleFloat!='undefined'?'styleFloat':'cssFloat');b=b.camelize();var c=a.style[b];if(!c){if(document.defaultView&&document.defaultView.getComputedStyle){var d=document.defaultView.getComputedStyle(a,null);c=d?d[b]:null}else if(a.currentStyle){c=a.currentStyle[b]}}if((c=='auto')&&['width','height'].include(b)&&(a.getStyle('display')!='none'))c=a['offset'+b.capitalize()]+'px';if(window.opera&&['left','top','right','bottom'].include(b))if(Element.getStyle(a,'position')=='static')c='auto';if(b=='opacity'){if(c)return parseFloat(c);if(c=(a.getStyle('filter')||'').match(/alpha\(opacity=(.*)\)/))if(c[1])return parseFloat(c[1])/100;return 1.0}return c=='auto'?null:c},setStyle:function(a,b){a=$(a);for(var c in b){var d=b[c];if(c=='opacity'){if(d==1){d=(/Gecko/.test(navigator.userAgent)&&!/Konqueror|Safari|KHTML/.test(navigator.userAgent))?0.999999:1.0;if(/MSIE/.test(navigator.userAgent)&&!window.opera)a.style.filter=a.getStyle('filter').replace(/alpha\([^\)]*\)/gi,'')}else if(d==''){if(/MSIE/.test(navigator.userAgent)&&!window.opera)a.style.filter=a.getStyle('filter').replace(/alpha\([^\)]*\)/gi,'')}else{if(d<0.00001)d=0;if(/MSIE/.test(navigator.userAgent)&&!window.opera)a.style.filter=a.getStyle('filter').replace(/alpha\([^\)]*\)/gi,'')+'alpha(opacity='+d*100+')'}}else if(['float','cssFloat'].include(c))c=(typeof a.style.styleFloat!='undefined')?'styleFloat':'cssFloat';a.style[c.camelize()]=d}return a},getDimensions:function(a){a=$(a);var b=$(a).getStyle('display');if(b!='none'&&b!=null)return{width:a.offsetWidth,height:a.offsetHeight};var c=a.style;var d=c.visibility;var e=c.position;var f=c.display;c.visibility='hidden';c.position='absolute';c.display='block';var g=a.clientWidth;var h=a.clientHeight;c.display=f;c.position=e;c.visibility=d;return{width:g,height:h}},makePositioned:function(a){a=$(a);var b=Element.getStyle(a,'position');if(b=='static'||!b){a._madePositioned=true;a.style.position='relative';if(window.opera){a.style.top=0;a.style.left=0}}return a},undoPositioned:function(a){a=$(a);if(a._madePositioned){a._madePositioned=undefined;a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=''}return a},makeClipping:function(a){a=$(a);if(a._overflow)return a;a._overflow=a.style.overflow||'auto';if((Element.getStyle(a,'overflow')||'visible')!='hidden')a.style.overflow='hidden';return a},undoClipping:function(a){a=$(a);if(!a._overflow)return a;a.style.overflow=a._overflow=='auto'?'':a._overflow;a._overflow=null;return a}};Object.extend(Element.Methods,{childOf:Element.Methods.descendantOf});Element._attributeTranslations={};Element._attributeTranslations.names={colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",datetime:"dateTime",accesskey:"accessKey",tabindex:"tabIndex",enctype:"encType",maxlength:"maxLength",readonly:"readOnly",longdesc:"longDesc"};Element._attributeTranslations.values={_getAttr:function(a,b){return a.getAttribute(b,2)},_flag:function(a,b){return $(a).hasAttribute(b)?b:null},style:function(a){return a.style.cssText.toLowerCase()},title:function(a){var b=a.getAttributeNode('title');return b.specified?b.nodeValue:null}};Object.extend(Element._attributeTranslations.values,{href:Element._attributeTranslations.values._getAttr,src:Element._attributeTranslations.values._getAttr,disabled:Element._attributeTranslations.values._flag,checked:Element._attributeTranslations.values._flag,readonly:Element._attributeTranslations.values._flag,multiple:Element._attributeTranslations.values._flag});Element.Methods.Simulated={hasAttribute:function(a,b){var t=Element._attributeTranslations;b=t.names[b]||b;return $(a).getAttributeNode(b).specified}};if(document.all&&!window.opera){Element.Methods.update=function(b,c){b=$(b);c=typeof c=='undefined'?'':c.toString();var d=b.tagName.toUpperCase();if(['THEAD','TBODY','TR','TD'].include(d)){var e=document.createElement('div');switch(d){case'THEAD':case'TBODY':e.innerHTML='<table><tbody>'+c.stripScripts()+'</tbody></table>';depth=2;break;case'TR':e.innerHTML='<table><tbody><tr>'+c.stripScripts()+'</tr></tbody></table>';depth=3;break;case'TD':e.innerHTML='<table><tbody><tr><td>'+c.stripScripts()+'</td></tr></tbody></table>';depth=4}$A(b.childNodes).each(function(a){b.removeChild(a)});depth.times(function(){e=e.firstChild});$A(e.childNodes).each(function(a){b.appendChild(a)})}else{b.innerHTML=c.stripScripts()}setTimeout(function(){c.evalScripts()},10);return b}};Object.extend(Element,Element.Methods);var _nativeExtensions=false;if(/Konqueror|Safari|KHTML/.test(navigator.userAgent))['','Form','Input','TextArea','Select'].each(function(a){var b='HTML'+a+'Element';if(window[b])return;var c=window[b]={};c.prototype=document.createElement(a?a.toLowerCase():'div').__proto__});Element.addMethods=function(g){Object.extend(Element.Methods,g||{});function copy(a,b,c){c=c||false;var d=Element.extend.cache;for(var e in a){var f=a[e];if(!c||!(e in b))b[e]=d.findOrStore(f)}}if(typeof HTMLElement!='undefined'){copy(Element.Methods,HTMLElement.prototype);copy(Element.Methods.Simulated,HTMLElement.prototype,true);copy(Form.Methods,HTMLFormElement.prototype);[HTMLInputElement,HTMLTextAreaElement,HTMLSelectElement].each(function(a){copy(Form.Element.Methods,a.prototype)});_nativeExtensions=true}}var Toggle=new Object();Toggle.display=Element.toggle;Abstract.Insertion=function(a){this.adjacency=a}Abstract.Insertion.prototype={initialize:function(a,b){this.element=$(a);this.content=b.stripScripts();if(this.adjacency&&this.element.insertAdjacentHTML){try{this.element.insertAdjacentHTML(this.adjacency,this.content)}catch(e){var c=this.element.tagName.toUpperCase();if(['TBODY','TR'].include(c)){this.insertContent(this.contentFromAnonymousTable())}else{throw e;}}}else{this.range=this.element.ownerDocument.createRange();if(this.initializeRange)this.initializeRange();this.insertContent([this.range.createContextualFragment(this.content)])}setTimeout(function(){b.evalScripts()},10)},contentFromAnonymousTable:function(){var a=document.createElement('div');a.innerHTML='<table><tbody>'+this.content+'</tbody></table>';return $A(a.childNodes[0].childNodes[0].childNodes)}}var Insertion=new Object();Insertion.Before=Class.create();Insertion.Before.prototype=Object.extend(new Abstract.Insertion('beforeBegin'),{initializeRange:function(){this.range.setStartBefore(this.element)},insertContent:function(b){b.each((function(a){this.element.parentNode.insertBefore(a,this.element)}).bind(this))}});Insertion.Top=Class.create();Insertion.Top.prototype=Object.extend(new Abstract.Insertion('afterBegin'),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(true)},insertContent:function(b){b.reverse(false).each((function(a){this.element.insertBefore(a,this.element.firstChild)}).bind(this))}});Insertion.Bottom=Class.create();Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion('beforeEnd'),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(this.element)},insertContent:function(b){b.each((function(a){this.element.appendChild(a)}).bind(this))}});Insertion.After=Class.create();Insertion.After.prototype=Object.extend(new Abstract.Insertion('afterEnd'),{initializeRange:function(){this.range.setStartAfter(this.element)},insertContent:function(b){b.each((function(a){this.element.parentNode.insertBefore(a,this.element.nextSibling)}).bind(this))}});Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(a){this.element=$(a)},_each:function(b){this.element.className.split(/\s+/).select(function(a){return a.length>0})._each(b)},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);var Selector=Class.create();Selector.prototype={initialize:function(a){this.params={classNames:[]};this.expression=a.toString().strip();this.parseExpression();this.compileMatcher()},parseExpression:function(){function abort(a){throw'Parse error in selector: '+a;}if(this.expression=='')abort('empty expression');var b=this.params,expr=this.expression,match,modifier,clause,rest;while(match=expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){b.attributes=b.attributes||[];b.attributes.push({name:match[2],operator:match[3],value:match[4]||match[5]||''});expr=match[1]}if(expr=='*')return this.params.wildcard=true;while(match=expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)){modifier=match[1],clause=match[2],rest=match[3];switch(modifier){case'#':b.id=clause;break;case'.':b.classNames.push(clause);break;case'':case undefined:b.tagName=clause.toUpperCase();break;default:abort(expr.inspect())}expr=rest}if(expr.length>0)abort(expr.inspect())},buildMatchExpression:function(){var e=this.params,conditions=[],clause;if(e.wildcard)conditions.push('true');if(clause=e.id)conditions.push('element.readAttribute("id") == '+clause.inspect());if(clause=e.tagName)conditions.push('element.tagName.toUpperCase() == '+clause.inspect());if((clause=e.classNames).length>0)for(var i=0,length=clause.length;i<length;i++)conditions.push('element.hasClassName('+clause[i].inspect()+')');if(clause=e.attributes){clause.each(function(b){var c='element.readAttribute('+b.name.inspect()+')';var d=function(a){return c+' && '+c+'.split('+a.inspect()+')'}switch(b.operator){case'=':conditions.push(c+' == '+b.value.inspect());break;case'~=':conditions.push(d(' ')+'.include('+b.value.inspect()+')');break;case'|=':conditions.push(d('-')+'.first().toUpperCase() == '+b.value.toUpperCase().inspect());break;case'!=':conditions.push(c+' != '+b.value.inspect());break;case'':case undefined:conditions.push('element.hasAttribute('+b.name.inspect()+')');break;default:throw'Unknown operator '+b.operator+' in selector';}})}return conditions.join(' && ')},compileMatcher:function(){this.match=new Function('element','if (!element.tagName) return false; element = $(element); return '+this.buildMatchExpression())},findElements:function(a){var b;if(b=$(this.params.id))if(this.match(b))if(!a||Element.childOf(b,a))return[b];a=(a||document).getElementsByTagName(this.params.tagName||'*');var c=[];for(var i=0,length=a.length;i<length;i++)if(this.match(b=a[i]))c.push(Element.extend(b));return c},toString:function(){return this.expression}}Object.extend(Selector,{matchElements:function(a,b){var c=new Selector(b);return a.select(c.match.bind(c)).map(Element.extend)},findElement:function(a,b,c){if(typeof b=='number')c=b,b=false;return Selector.matchElements(a,b||'*')[c||0]},findChildElements:function(g,h){return h.map(function(f){return f.match(/[^\s"]+(?:"[^"]*"[^\s"]+)*/g).inject([null],function(c,d){var e=new Selector(d);return c.inject([],function(a,b){return a.concat(e.findElements(b||g))})})}).flatten()}});function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(a){$(a).reset();return a},serializeElements:function(d,e){var f=d.inject({},function(a,b){if(!b.disabled&&b.name){var c=b.name,value=$(b).getValue();if(value!=undefined){if(a[c]){if(a[c].constructor!=Array)a[c]=[a[c]];a[c].push(value)}else a[c]=value}}return a});return e?f:Hash.toQueryString(f)}};Form.Methods={serialize:function(a,b){return Form.serializeElements(Form.getElements(a),b)},getElements:function(c){return $A($(c).getElementsByTagName('*')).inject([],function(a,b){if(Form.Element.Serializers[b.tagName.toLowerCase()])a.push(Element.extend(b));return a})},getInputs:function(a,b,c){a=$(a);var d=a.getElementsByTagName('input');if(!b&&!c)return $A(d).map(Element.extend);for(var i=0,matchingInputs=[],length=d.length;i<length;i++){var e=d[i];if((b&&e.type!=b)||(c&&e.name!=c))continue;matchingInputs.push(Element.extend(e))}return matchingInputs},disable:function(b){b=$(b);b.getElements().each(function(a){a.blur();a.disabled='true'});return b},enable:function(b){b=$(b);b.getElements().each(function(a){a.disabled=''});return b},findFirstElement:function(b){return $(b).getElements().find(function(a){return a.type!='hidden'&&!a.disabled&&['input','select','textarea'].include(a.tagName.toLowerCase())})},focusFirstElement:function(a){a=$(a);a.findFirstElement().activate();return a}}Object.extend(Form,Form.Methods);Form.Element={focus:function(a){$(a).focus();return a},select:function(a){$(a).select();return a}}Form.Element.Methods={serialize:function(a){a=$(a);if(!a.disabled&&a.name){var b=a.getValue();if(b!=undefined){var c={};c[a.name]=b;return Hash.toQueryString(c)}}return''},getValue:function(a){a=$(a);var b=a.tagName.toLowerCase();return Form.Element.Serializers[b](a)},clear:function(a){$(a).value='';return a},present:function(a){return $(a).value!=''},activate:function(a){a=$(a);a.focus();if(a.select&&(a.tagName.toLowerCase()!='input'||!['button','reset','submit'].include(a.type)))a.select();return a},disable:function(a){a=$(a);a.disabled=true;return a},enable:function(a){a=$(a);a.blur();a.disabled=false;return a}}Object.extend(Form.Element,Form.Element.Methods);var Field=Form.Element;var $F=Form.Element.getValue;Form.Element.Serializers={input:function(a){switch(a.type.toLowerCase()){case'checkbox':case'radio':return Form.Element.Serializers.inputSelector(a);default:return Form.Element.Serializers.textarea(a)}},inputSelector:function(a){return a.checked?a.value:null},textarea:function(a){return a.value},select:function(a){return this[a.type=='select-one'?'selectOne':'selectMany'](a)},selectOne:function(a){var b=a.selectedIndex;return b>=0?this.optionValue(a.options[b]):null},selectMany:function(a){var b,length=a.length;if(!length)return null;for(var i=0,b=[];i<length;i++){var c=a.options[i];if(c.selected)b.push(this.optionValue(c))}return b},optionValue:function(a){return Element.extend(a).hasAttribute('value')?a.value:a.text}}Abstract.TimedObserver=function(){}Abstract.TimedObserver.prototype={initialize:function(a,b,c){this.frequency=b;this.element=$(a);this.callback=c;this.lastValue=this.getValue();this.registerCallback()},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},onTimerEvent:function(){var a=this.getValue();var b=('string'==typeof this.lastValue&&'string'==typeof a?this.lastValue!=a:String(this.lastValue)!=String(a));if(b){this.callback(this.element,a);this.lastValue=a}}}Form.Element.Observer=Class.create();Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create();Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=function(){}Abstract.EventObserver.prototype={initialize:function(a,b){this.element=$(a);this.callback=b;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=='form')this.registerFormCallbacks();else this.registerCallback(this.element)},onElementEvent:function(){var a=this.getValue();if(this.lastValue!=a){this.callback(this.element,a);this.lastValue=a}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback.bind(this))},registerCallback:function(a){if(a.type){switch(a.type.toLowerCase()){case'checkbox':case'radio':Event.observe(a,'click',this.onElementEvent.bind(this));break;default:Event.observe(a,'change',this.onElementEvent.bind(this));break}}}}Form.Element.EventObserver=Class.create();Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create();Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.serialize(this.element)}});if(!window.Event){var Event=new Object()}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,element:function(a){return a.target||a.srcElement},isLeftClick:function(a){return(((a.which)&&(a.which==1))||((a.button)&&(a.button==1)))},pointerX:function(a){return a.pageX||(a.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft))},pointerY:function(a){return a.pageY||(a.clientY+(document.documentElement.scrollTop||document.body.scrollTop))},stop:function(a){if(a.preventDefault){a.preventDefault();a.stopPropagation()}else{a.returnValue=false;a.cancelBubble=true}},findElement:function(a,b){var c=Event.element(a);while(c.parentNode&&(!c.tagName||(c.tagName.toUpperCase()!=b.toUpperCase())))c=c.parentNode;return c},observers:false,_observeAndCache:function(a,b,c,d){if(!this.observers)this.observers=[];if(a.addEventListener){this.observers.push([a,b,c,d]);a.addEventListener(b,c,d)}else if(a.attachEvent){this.observers.push([a,b,c,d]);a.attachEvent('on'+b,c)}},unloadCache:function(){if(!Event.observers)return;for(var i=0,length=Event.observers.length;i<length;i++){Event.stopObserving.apply(this,Event.observers[i]);Event.observers[i][0]=null}Event.observers=false},observe:function(a,b,c,d){a=$(a);d=d||false;if(b=='keypress'&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||a.attachEvent))b='keydown';Event._observeAndCache(a,b,c,d)},stopObserving:function(a,b,c,d){a=$(a);d=d||false;if(b=='keypress'&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||a.detachEvent))b='keydown';if(a.removeEventListener){a.removeEventListener(b,c,d)}else if(a.detachEvent){try{a.detachEvent('on'+b,c)}catch(e){}}}});if(navigator.appVersion.match(/\bMSIE\b/))Event.observe(window,'unload',Event.unloadCache,false);var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},realOffset:function(a){var b=0,valueL=0;do{b+=a.scrollTop||0;valueL+=a.scrollLeft||0;a=a.parentNode}while(a);return[valueL,b]},cumulativeOffset:function(a){var b=0,valueL=0;do{b+=a.offsetTop||0;valueL+=a.offsetLeft||0;a=a.offsetParent}while(a);return[valueL,b]},positionedOffset:function(a){var b=0,valueL=0;do{b+=a.offsetTop||0;valueL+=a.offsetLeft||0;a=a.offsetParent;if(a){if(a.tagName=='BODY')break;var p=Element.getStyle(a,'position');if(p=='relative'||p=='absolute')break}}while(a);return[valueL,b]},offsetParent:function(a){if(a.offsetParent)return a.offsetParent;if(a==document.body)return a;while((a=a.parentNode)&&a!=document.body)if(Element.getStyle(a,'position')!='static')return a;return document.body},within:function(a,x,y){if(this.includeScrollOffsets)return this.withinIncludingScrolloffsets(a,x,y);this.xcomp=x;this.ycomp=y;this.offset=this.cumulativeOffset(a);return(y>=this.offset[1]&&y<this.offset[1]+a.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+a.offsetWidth)},withinIncludingScrolloffsets:function(a,x,y){var b=this.realOffset(a);this.xcomp=x+b[0]-this.deltaX;this.ycomp=y+b[1]-this.deltaY;this.offset=this.cumulativeOffset(a);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+a.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+a.offsetWidth)},overlap:function(a,b){if(!a)return 0;if(a=='vertical')return((this.offset[1]+b.offsetHeight)-this.ycomp)/b.offsetHeight;if(a=='horizontal')return((this.offset[0]+b.offsetWidth)-this.xcomp)/b.offsetWidth},page:function(a){var b=0,valueL=0;var c=a;do{b+=c.offsetTop||0;valueL+=c.offsetLeft||0;if(c.offsetParent==document.body)if(Element.getStyle(c,'position')=='absolute')break}while(c=c.offsetParent);c=a;do{if(!window.opera||c.tagName=='BODY'){b-=c.scrollTop||0;valueL-=c.scrollLeft||0}}while(c=c.parentNode);return[valueL,b]},clone:function(a,b){var c=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{})a=$(a);var p=Position.page(a);b=$(b);var d=[0,0];var e=null;if(Element.getStyle(b,'position')=='absolute'){e=Position.offsetParent(b);d=Position.page(e)}if(e==document.body){d[0]-=document.body.offsetLeft;d[1]-=document.body.offsetTop}if(c.setLeft)b.style.left=(p[0]-d[0]+c.offsetLeft)+'px';if(c.setTop)b.style.top=(p[1]-d[1]+c.offsetTop)+'px';if(c.setWidth)b.style.width=a.offsetWidth+'px';if(c.setHeight)b.style.height=a.offsetHeight+'px'},absolutize:function(a){a=$(a);if(a.style.position=='absolute')return;Position.prepare();var b=Position.positionedOffset(a);var c=b[1];var d=b[0];var e=a.clientWidth;var f=a.clientHeight;a._originalLeft=d-parseFloat(a.style.left||0);a._originalTop=c-parseFloat(a.style.top||0);a._originalWidth=a.style.width;a._originalHeight=a.style.height;a.style.position='absolute';a.style.top=c+'px';a.style.left=d+'px';a.style.width=e+'px';a.style.height=f+'px'},relativize:function(a){a=$(a);if(a.style.position=='relative')return;Position.prepare();a.style.position='relative';var b=parseFloat(a.style.top||0)-(a._originalTop||0);var c=parseFloat(a.style.left||0)-(a._originalLeft||0);a.style.top=b+'px';a.style.left=c+'px';a.style.height=a._originalHeight;a.style.width=a._originalWidth}}if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){Position.cumulativeOffset=function(a){var b=0,valueL=0;do{b+=a.offsetTop||0;valueL+=a.offsetLeft||0;if(a.offsetParent==document.body)if(Element.getStyle(a,'position')=='absolute')break;a=a.offsetParent}while(a);return[valueL,b]}}Element.addMethods();
@@ -1,833 +0,0 @@
1
- // Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
2
- // (c) 2005, 2006 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
3
- // (c) 2005, 2006 Jon Tirsen (http://www.tirsen.com)
4
- // Contributors:
5
- // Richard Livsey
6
- // Rahul Bhargava
7
- // Rob Wills
8
- //
9
- // script.aculo.us is freely distributable under the terms of an MIT-style license.
10
- // For details, see the script.aculo.us web site: http://script.aculo.us/
11
-
12
- // Autocompleter.Base handles all the autocompletion functionality
13
- // that's independent of the data source for autocompletion. This
14
- // includes drawing the autocompletion menu, observing keyboard
15
- // and mouse events, and similar.
16
- //
17
- // Specific autocompleters need to provide, at the very least,
18
- // a getUpdatedChoices function that will be invoked every time
19
- // the text inside the monitored textbox changes. This method
20
- // should get the text for which to provide autocompletion by
21
- // invoking this.getToken(), NOT by directly accessing
22
- // this.element.value. This is to allow incremental tokenized
23
- // autocompletion. Specific auto-completion logic (AJAX, etc)
24
- // belongs in getUpdatedChoices.
25
- //
26
- // Tokenized incremental autocompletion is enabled automatically
27
- // when an autocompleter is instantiated with the 'tokens' option
28
- // in the options parameter, e.g.:
29
- // new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' });
30
- // will incrementally autocomplete with a comma as the token.
31
- // Additionally, ',' in the above example can be replaced with
32
- // a token array, e.g. { tokens: [',', '\n'] } which
33
- // enables autocompletion on multiple tokens. This is most
34
- // useful when one of the tokens is \n (a newline), as it
35
- // allows smart autocompletion after linebreaks.
36
-
37
- if(typeof Effect == 'undefined')
38
- throw("controls.js requires including script.aculo.us' effects.js library");
39
-
40
- var Autocompleter = {}
41
- Autocompleter.Base = function() {};
42
- Autocompleter.Base.prototype = {
43
- baseInitialize: function(element, update, options) {
44
- this.element = $(element);
45
- this.update = $(update);
46
- this.hasFocus = false;
47
- this.changed = false;
48
- this.active = false;
49
- this.index = 0;
50
- this.entryCount = 0;
51
-
52
- if(this.setOptions)
53
- this.setOptions(options);
54
- else
55
- this.options = options || {};
56
-
57
- this.options.paramName = this.options.paramName || this.element.name;
58
- this.options.tokens = this.options.tokens || [];
59
- this.options.frequency = this.options.frequency || 0.4;
60
- this.options.minChars = this.options.minChars || 1;
61
- this.options.onShow = this.options.onShow ||
62
- function(element, update){
63
- if(!update.style.position || update.style.position=='absolute') {
64
- update.style.position = 'absolute';
65
- Position.clone(element, update, {
66
- setHeight: false,
67
- offsetTop: element.offsetHeight
68
- });
69
- }
70
- Effect.Appear(update,{duration:0.15});
71
- };
72
- this.options.onHide = this.options.onHide ||
73
- function(element, update){ new Effect.Fade(update,{duration:0.15}) };
74
-
75
- if(typeof(this.options.tokens) == 'string')
76
- this.options.tokens = new Array(this.options.tokens);
77
-
78
- this.observer = null;
79
-
80
- this.element.setAttribute('autocomplete','off');
81
-
82
- Element.hide(this.update);
83
-
84
- Event.observe(this.element, "blur", this.onBlur.bindAsEventListener(this));
85
- Event.observe(this.element, "keypress", this.onKeyPress.bindAsEventListener(this));
86
- },
87
-
88
- show: function() {
89
- if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update);
90
- if(!this.iefix &&
91
- (navigator.appVersion.indexOf('MSIE')>0) &&
92
- (navigator.userAgent.indexOf('Opera')<0) &&
93
- (Element.getStyle(this.update, 'position')=='absolute')) {
94
- new Insertion.After(this.update,
95
- '<iframe id="' + this.update.id + '_iefix" '+
96
- 'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' +
97
- 'src="javascript:false;" frameborder="0" scrolling="no"></iframe>');
98
- this.iefix = $(this.update.id+'_iefix');
99
- }
100
- if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50);
101
- },
102
-
103
- fixIEOverlapping: function() {
104
- Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)});
105
- this.iefix.style.zIndex = 1;
106
- this.update.style.zIndex = 2;
107
- Element.show(this.iefix);
108
- },
109
-
110
- hide: function() {
111
- this.stopIndicator();
112
- if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update);
113
- if(this.iefix) Element.hide(this.iefix);
114
- },
115
-
116
- startIndicator: function() {
117
- if(this.options.indicator) Element.show(this.options.indicator);
118
- },
119
-
120
- stopIndicator: function() {
121
- if(this.options.indicator) Element.hide(this.options.indicator);
122
- },
123
-
124
- onKeyPress: function(event) {
125
- if(this.active)
126
- switch(event.keyCode) {
127
- case Event.KEY_TAB:
128
- case Event.KEY_RETURN:
129
- this.selectEntry();
130
- Event.stop(event);
131
- case Event.KEY_ESC:
132
- this.hide();
133
- this.active = false;
134
- Event.stop(event);
135
- return;
136
- case Event.KEY_LEFT:
137
- case Event.KEY_RIGHT:
138
- return;
139
- case Event.KEY_UP:
140
- this.markPrevious();
141
- this.render();
142
- if(navigator.appVersion.indexOf('AppleWebKit')>0) Event.stop(event);
143
- return;
144
- case Event.KEY_DOWN:
145
- this.markNext();
146
- this.render();
147
- if(navigator.appVersion.indexOf('AppleWebKit')>0) Event.stop(event);
148
- return;
149
- }
150
- else
151
- if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN ||
152
- (navigator.appVersion.indexOf('AppleWebKit') > 0 && event.keyCode == 0)) return;
153
-
154
- this.changed = true;
155
- this.hasFocus = true;
156
-
157
- if(this.observer) clearTimeout(this.observer);
158
- this.observer =
159
- setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000);
160
- },
161
-
162
- activate: function() {
163
- this.changed = false;
164
- this.hasFocus = true;
165
- this.getUpdatedChoices();
166
- },
167
-
168
- onHover: function(event) {
169
- var element = Event.findElement(event, 'LI');
170
- if(this.index != element.autocompleteIndex)
171
- {
172
- this.index = element.autocompleteIndex;
173
- this.render();
174
- }
175
- Event.stop(event);
176
- },
177
-
178
- onClick: function(event) {
179
- var element = Event.findElement(event, 'LI');
180
- this.index = element.autocompleteIndex;
181
- this.selectEntry();
182
- this.hide();
183
- },
184
-
185
- onBlur: function(event) {
186
- // needed to make click events working
187
- setTimeout(this.hide.bind(this), 250);
188
- this.hasFocus = false;
189
- this.active = false;
190
- },
191
-
192
- render: function() {
193
- if(this.entryCount > 0) {
194
- for (var i = 0; i < this.entryCount; i++)
195
- this.index==i ?
196
- Element.addClassName(this.getEntry(i),"selected") :
197
- Element.removeClassName(this.getEntry(i),"selected");
198
-
199
- if(this.hasFocus) {
200
- this.show();
201
- this.active = true;
202
- }
203
- } else {
204
- this.active = false;
205
- this.hide();
206
- }
207
- },
208
-
209
- markPrevious: function() {
210
- if(this.index > 0) this.index--
211
- else this.index = this.entryCount-1;
212
- this.getEntry(this.index);
213
- },
214
-
215
- markNext: function() {
216
- if(this.index < this.entryCount-1) this.index++
217
- else this.index = 0;
218
- this.getEntry(this.index);
219
- },
220
-
221
- getEntry: function(index) {
222
- return this.update.firstChild.childNodes[index];
223
- },
224
-
225
- getCurrentEntry: function() {
226
- return this.getEntry(this.index);
227
- },
228
-
229
- selectEntry: function() {
230
- this.active = false;
231
- this.updateElement(this.getCurrentEntry());
232
- },
233
-
234
- updateElement: function(selectedElement) {
235
- if (this.options.updateElement) {
236
- this.options.updateElement(selectedElement);
237
- return;
238
- }
239
- var value = '';
240
- if (this.options.select) {
241
- var nodes = document.getElementsByClassName(this.options.select, selectedElement) || [];
242
- if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select);
243
- } else
244
- value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal');
245
-
246
- var lastTokenPos = this.findLastToken();
247
- if (lastTokenPos != -1) {
248
- var newValue = this.element.value.substr(0, lastTokenPos + 1);
249
- var whitespace = this.element.value.substr(lastTokenPos + 1).match(/^\s+/);
250
- if (whitespace)
251
- newValue += whitespace[0];
252
- this.element.value = newValue + value;
253
- } else {
254
- this.element.value = value;
255
- }
256
- this.element.focus();
257
-
258
- if (this.options.afterUpdateElement)
259
- this.options.afterUpdateElement(this.element, selectedElement);
260
- },
261
-
262
- updateChoices: function(choices) {
263
- if(!this.changed && this.hasFocus) {
264
- this.update.innerHTML = choices;
265
- Element.cleanWhitespace(this.update);
266
- Element.cleanWhitespace(this.update.down());
267
-
268
- if(this.update.firstChild && this.update.down().childNodes) {
269
- this.entryCount =
270
- this.update.down().childNodes.length;
271
- for (var i = 0; i < this.entryCount; i++) {
272
- var entry = this.getEntry(i);
273
- entry.autocompleteIndex = i;
274
- this.addObservers(entry);
275
- }
276
- } else {
277
- this.entryCount = 0;
278
- }
279
-
280
- this.stopIndicator();
281
- this.index = 0;
282
-
283
- if(this.entryCount==1 && this.options.autoSelect) {
284
- this.selectEntry();
285
- this.hide();
286
- } else {
287
- this.render();
288
- }
289
- }
290
- },
291
-
292
- addObservers: function(element) {
293
- Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this));
294
- Event.observe(element, "click", this.onClick.bindAsEventListener(this));
295
- },
296
-
297
- onObserverEvent: function() {
298
- this.changed = false;
299
- if(this.getToken().length>=this.options.minChars) {
300
- this.startIndicator();
301
- this.getUpdatedChoices();
302
- } else {
303
- this.active = false;
304
- this.hide();
305
- }
306
- },
307
-
308
- getToken: function() {
309
- var tokenPos = this.findLastToken();
310
- if (tokenPos != -1)
311
- var ret = this.element.value.substr(tokenPos + 1).replace(/^\s+/,'').replace(/\s+$/,'');
312
- else
313
- var ret = this.element.value;
314
-
315
- return /\n/.test(ret) ? '' : ret;
316
- },
317
-
318
- findLastToken: function() {
319
- var lastTokenPos = -1;
320
-
321
- for (var i=0; i<this.options.tokens.length; i++) {
322
- var thisTokenPos = this.element.value.lastIndexOf(this.options.tokens[i]);
323
- if (thisTokenPos > lastTokenPos)
324
- lastTokenPos = thisTokenPos;
325
- }
326
- return lastTokenPos;
327
- }
328
- }
329
-
330
- Ajax.Autocompleter = Class.create();
331
- Object.extend(Object.extend(Ajax.Autocompleter.prototype, Autocompleter.Base.prototype), {
332
- initialize: function(element, update, url, options) {
333
- this.baseInitialize(element, update, options);
334
- this.options.asynchronous = true;
335
- this.options.onComplete = this.onComplete.bind(this);
336
- this.options.defaultParams = this.options.parameters || null;
337
- this.url = url;
338
- },
339
-
340
- getUpdatedChoices: function() {
341
- entry = encodeURIComponent(this.options.paramName) + '=' +
342
- encodeURIComponent(this.getToken());
343
-
344
- this.options.parameters = this.options.callback ?
345
- this.options.callback(this.element, entry) : entry;
346
-
347
- if(this.options.defaultParams)
348
- this.options.parameters += '&' + this.options.defaultParams;
349
-
350
- new Ajax.Request(this.url, this.options);
351
- },
352
-
353
- onComplete: function(request) {
354
- this.updateChoices(request.responseText);
355
- }
356
-
357
- });
358
-
359
- // The local array autocompleter. Used when you'd prefer to
360
- // inject an array of autocompletion options into the page, rather
361
- // than sending out Ajax queries, which can be quite slow sometimes.
362
- //
363
- // The constructor takes four parameters. The first two are, as usual,
364
- // the id of the monitored textbox, and id of the autocompletion menu.
365
- // The third is the array you want to autocomplete from, and the fourth
366
- // is the options block.
367
- //
368
- // Extra local autocompletion options:
369
- // - choices - How many autocompletion choices to offer
370
- //
371
- // - partialSearch - If false, the autocompleter will match entered
372
- // text only at the beginning of strings in the
373
- // autocomplete array. Defaults to true, which will
374
- // match text at the beginning of any *word* in the
375
- // strings in the autocomplete array. If you want to
376
- // search anywhere in the string, additionally set
377
- // the option fullSearch to true (default: off).
378
- //
379
- // - fullSsearch - Search anywhere in autocomplete array strings.
380
- //
381
- // - partialChars - How many characters to enter before triggering
382
- // a partial match (unlike minChars, which defines
383
- // how many characters are required to do any match
384
- // at all). Defaults to 2.
385
- //
386
- // - ignoreCase - Whether to ignore case when autocompleting.
387
- // Defaults to true.
388
- //
389
- // It's possible to pass in a custom function as the 'selector'
390
- // option, if you prefer to write your own autocompletion logic.
391
- // In that case, the other options above will not apply unless
392
- // you support them.
393
-
394
- Autocompleter.Local = Class.create();
395
- Autocompleter.Local.prototype = Object.extend(new Autocompleter.Base(), {
396
- initialize: function(element, update, array, options) {
397
- this.baseInitialize(element, update, options);
398
- this.options.array = array;
399
- },
400
-
401
- getUpdatedChoices: function() {
402
- this.updateChoices(this.options.selector(this));
403
- },
404
-
405
- setOptions: function(options) {
406
- this.options = Object.extend({
407
- choices: 10,
408
- partialSearch: true,
409
- partialChars: 2,
410
- ignoreCase: true,
411
- fullSearch: false,
412
- selector: function(instance) {
413
- var ret = []; // Beginning matches
414
- var partial = []; // Inside matches
415
- var entry = instance.getToken();
416
- var count = 0;
417
-
418
- for (var i = 0; i < instance.options.array.length &&
419
- ret.length < instance.options.choices ; i++) {
420
-
421
- var elem = instance.options.array[i];
422
- var foundPos = instance.options.ignoreCase ?
423
- elem.toLowerCase().indexOf(entry.toLowerCase()) :
424
- elem.indexOf(entry);
425
-
426
- while (foundPos != -1) {
427
- if (foundPos == 0 && elem.length != entry.length) {
428
- ret.push("<li><strong>" + elem.substr(0, entry.length) + "</strong>" +
429
- elem.substr(entry.length) + "</li>");
430
- break;
431
- } else if (entry.length >= instance.options.partialChars &&
432
- instance.options.partialSearch && foundPos != -1) {
433
- if (instance.options.fullSearch || /\s/.test(elem.substr(foundPos-1,1))) {
434
- partial.push("<li>" + elem.substr(0, foundPos) + "<strong>" +
435
- elem.substr(foundPos, entry.length) + "</strong>" + elem.substr(
436
- foundPos + entry.length) + "</li>");
437
- break;
438
- }
439
- }
440
-
441
- foundPos = instance.options.ignoreCase ?
442
- elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) :
443
- elem.indexOf(entry, foundPos + 1);
444
-
445
- }
446
- }
447
- if (partial.length)
448
- ret = ret.concat(partial.slice(0, instance.options.choices - ret.length))
449
- return "<ul>" + ret.join('') + "</ul>";
450
- }
451
- }, options || {});
452
- }
453
- });
454
-
455
- // AJAX in-place editor
456
- //
457
- // see documentation on http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor
458
-
459
- // Use this if you notice weird scrolling problems on some browsers,
460
- // the DOM might be a bit confused when this gets called so do this
461
- // waits 1 ms (with setTimeout) until it does the activation
462
- Field.scrollFreeActivate = function(field) {
463
- setTimeout(function() {
464
- Field.activate(field);
465
- }, 1);
466
- }
467
-
468
- Ajax.InPlaceEditor = Class.create();
469
- Ajax.InPlaceEditor.defaultHighlightColor = "#FFFF99";
470
- Ajax.InPlaceEditor.prototype = {
471
- initialize: function(element, url, options) {
472
- this.url = url;
473
- this.element = $(element);
474
-
475
- this.options = Object.extend({
476
- paramName: "value",
477
- okButton: true,
478
- okText: "ok",
479
- cancelLink: true,
480
- cancelText: "cancel",
481
- savingText: "Saving...",
482
- clickToEditText: "Click to edit",
483
- okText: "ok",
484
- rows: 1,
485
- onComplete: function(transport, element) {
486
- new Effect.Highlight(element, {startcolor: this.options.highlightcolor});
487
- },
488
- onFailure: function(transport) {
489
- alert("Error communicating with the server: " + transport.responseText.stripTags());
490
- },
491
- callback: function(form) {
492
- return Form.serialize(form);
493
- },
494
- handleLineBreaks: true,
495
- loadingText: 'Loading...',
496
- savingClassName: 'inplaceeditor-saving',
497
- loadingClassName: 'inplaceeditor-loading',
498
- formClassName: 'inplaceeditor-form',
499
- highlightcolor: Ajax.InPlaceEditor.defaultHighlightColor,
500
- highlightendcolor: "#FFFFFF",
501
- externalControl: null,
502
- submitOnBlur: false,
503
- ajaxOptions: {},
504
- evalScripts: false
505
- }, options || {});
506
-
507
- if(!this.options.formId && this.element.id) {
508
- this.options.formId = this.element.id + "-inplaceeditor";
509
- if ($(this.options.formId)) {
510
- // there's already a form with that name, don't specify an id
511
- this.options.formId = null;
512
- }
513
- }
514
-
515
- if (this.options.externalControl) {
516
- this.options.externalControl = $(this.options.externalControl);
517
- }
518
-
519
- this.originalBackground = Element.getStyle(this.element, 'background-color');
520
- if (!this.originalBackground) {
521
- this.originalBackground = "transparent";
522
- }
523
-
524
- this.element.title = this.options.clickToEditText;
525
-
526
- this.onclickListener = this.enterEditMode.bindAsEventListener(this);
527
- this.mouseoverListener = this.enterHover.bindAsEventListener(this);
528
- this.mouseoutListener = this.leaveHover.bindAsEventListener(this);
529
- Event.observe(this.element, 'click', this.onclickListener);
530
- Event.observe(this.element, 'mouseover', this.mouseoverListener);
531
- Event.observe(this.element, 'mouseout', this.mouseoutListener);
532
- if (this.options.externalControl) {
533
- Event.observe(this.options.externalControl, 'click', this.onclickListener);
534
- Event.observe(this.options.externalControl, 'mouseover', this.mouseoverListener);
535
- Event.observe(this.options.externalControl, 'mouseout', this.mouseoutListener);
536
- }
537
- },
538
- enterEditMode: function(evt) {
539
- if (this.saving) return;
540
- if (this.editing) return;
541
- this.editing = true;
542
- this.onEnterEditMode();
543
- if (this.options.externalControl) {
544
- Element.hide(this.options.externalControl);
545
- }
546
- Element.hide(this.element);
547
- this.createForm();
548
- this.element.parentNode.insertBefore(this.form, this.element);
549
- if (!this.options.loadTextURL) Field.scrollFreeActivate(this.editField);
550
- // stop the event to avoid a page refresh in Safari
551
- if (evt) {
552
- Event.stop(evt);
553
- }
554
- return false;
555
- },
556
- createForm: function() {
557
- this.form = document.createElement("form");
558
- this.form.id = this.options.formId;
559
- Element.addClassName(this.form, this.options.formClassName)
560
- this.form.onsubmit = this.onSubmit.bind(this);
561
-
562
- this.createEditField();
563
-
564
- if (this.options.textarea) {
565
- var br = document.createElement("br");
566
- this.form.appendChild(br);
567
- }
568
-
569
- if (this.options.okButton) {
570
- okButton = document.createElement("input");
571
- okButton.type = "submit";
572
- okButton.value = this.options.okText;
573
- okButton.className = 'editor_ok_button';
574
- this.form.appendChild(okButton);
575
- }
576
-
577
- if (this.options.cancelLink) {
578
- cancelLink = document.createElement("a");
579
- cancelLink.href = "#";
580
- cancelLink.appendChild(document.createTextNode(this.options.cancelText));
581
- cancelLink.onclick = this.onclickCancel.bind(this);
582
- cancelLink.className = 'editor_cancel';
583
- this.form.appendChild(cancelLink);
584
- }
585
- },
586
- hasHTMLLineBreaks: function(string) {
587
- if (!this.options.handleLineBreaks) return false;
588
- return string.match(/<br/i) || string.match(/<p>/i);
589
- },
590
- convertHTMLLineBreaks: function(string) {
591
- return string.replace(/<br>/gi, "\n").replace(/<br\/>/gi, "\n").replace(/<\/p>/gi, "\n").replace(/<p>/gi, "");
592
- },
593
- createEditField: function() {
594
- var text;
595
- if(this.options.loadTextURL) {
596
- text = this.options.loadingText;
597
- } else {
598
- text = this.getText();
599
- }
600
-
601
- var obj = this;
602
-
603
- if (this.options.rows == 1 && !this.hasHTMLLineBreaks(text)) {
604
- this.options.textarea = false;
605
- var textField = document.createElement("input");
606
- textField.obj = this;
607
- textField.type = "text";
608
- textField.name = this.options.paramName;
609
- textField.value = text;
610
- textField.style.backgroundColor = this.options.highlightcolor;
611
- textField.className = 'editor_field';
612
- var size = this.options.size || this.options.cols || 0;
613
- if (size != 0) textField.size = size;
614
- if (this.options.submitOnBlur)
615
- textField.onblur = this.onSubmit.bind(this);
616
- this.editField = textField;
617
- } else {
618
- this.options.textarea = true;
619
- var textArea = document.createElement("textarea");
620
- textArea.obj = this;
621
- textArea.name = this.options.paramName;
622
- textArea.value = this.convertHTMLLineBreaks(text);
623
- textArea.rows = this.options.rows;
624
- textArea.cols = this.options.cols || 40;
625
- textArea.className = 'editor_field';
626
- if (this.options.submitOnBlur)
627
- textArea.onblur = this.onSubmit.bind(this);
628
- this.editField = textArea;
629
- }
630
-
631
- if(this.options.loadTextURL) {
632
- this.loadExternalText();
633
- }
634
- this.form.appendChild(this.editField);
635
- },
636
- getText: function() {
637
- return this.element.innerHTML;
638
- },
639
- loadExternalText: function() {
640
- Element.addClassName(this.form, this.options.loadingClassName);
641
- this.editField.disabled = true;
642
- new Ajax.Request(
643
- this.options.loadTextURL,
644
- Object.extend({
645
- asynchronous: true,
646
- onComplete: this.onLoadedExternalText.bind(this)
647
- }, this.options.ajaxOptions)
648
- );
649
- },
650
- onLoadedExternalText: function(transport) {
651
- Element.removeClassName(this.form, this.options.loadingClassName);
652
- this.editField.disabled = false;
653
- this.editField.value = transport.responseText.stripTags();
654
- Field.scrollFreeActivate(this.editField);
655
- },
656
- onclickCancel: function() {
657
- this.onComplete();
658
- this.leaveEditMode();
659
- return false;
660
- },
661
- onFailure: function(transport) {
662
- this.options.onFailure(transport);
663
- if (this.oldInnerHTML) {
664
- this.element.innerHTML = this.oldInnerHTML;
665
- this.oldInnerHTML = null;
666
- }
667
- return false;
668
- },
669
- onSubmit: function() {
670
- // onLoading resets these so we need to save them away for the Ajax call
671
- var form = this.form;
672
- var value = this.editField.value;
673
-
674
- // do this first, sometimes the ajax call returns before we get a chance to switch on Saving...
675
- // which means this will actually switch on Saving... *after* we've left edit mode causing Saving...
676
- // to be displayed indefinitely
677
- this.onLoading();
678
-
679
- if (this.options.evalScripts) {
680
- new Ajax.Request(
681
- this.url, Object.extend({
682
- parameters: this.options.callback(form, value),
683
- onComplete: this.onComplete.bind(this),
684
- onFailure: this.onFailure.bind(this),
685
- asynchronous:true,
686
- evalScripts:true
687
- }, this.options.ajaxOptions));
688
- } else {
689
- new Ajax.Updater(
690
- { success: this.element,
691
- // don't update on failure (this could be an option)
692
- failure: null },
693
- this.url, Object.extend({
694
- parameters: this.options.callback(form, value),
695
- onComplete: this.onComplete.bind(this),
696
- onFailure: this.onFailure.bind(this)
697
- }, this.options.ajaxOptions));
698
- }
699
- // stop the event to avoid a page refresh in Safari
700
- if (arguments.length > 1) {
701
- Event.stop(arguments[0]);
702
- }
703
- return false;
704
- },
705
- onLoading: function() {
706
- this.saving = true;
707
- this.removeForm();
708
- this.leaveHover();
709
- this.showSaving();
710
- },
711
- showSaving: function() {
712
- this.oldInnerHTML = this.element.innerHTML;
713
- this.element.innerHTML = this.options.savingText;
714
- Element.addClassName(this.element, this.options.savingClassName);
715
- this.element.style.backgroundColor = this.originalBackground;
716
- Element.show(this.element);
717
- },
718
- removeForm: function() {
719
- if(this.form) {
720
- if (this.form.parentNode) Element.remove(this.form);
721
- this.form = null;
722
- }
723
- },
724
- enterHover: function() {
725
- if (this.saving) return;
726
- this.element.style.backgroundColor = this.options.highlightcolor;
727
- if (this.effect) {
728
- this.effect.cancel();
729
- }
730
- Element.addClassName(this.element, this.options.hoverClassName)
731
- },
732
- leaveHover: function() {
733
- if (this.options.backgroundColor) {
734
- this.element.style.backgroundColor = this.oldBackground;
735
- }
736
- Element.removeClassName(this.element, this.options.hoverClassName)
737
- if (this.saving) return;
738
- this.effect = new Effect.Highlight(this.element, {
739
- startcolor: this.options.highlightcolor,
740
- endcolor: this.options.highlightendcolor,
741
- restorecolor: this.originalBackground
742
- });
743
- },
744
- leaveEditMode: function() {
745
- Element.removeClassName(this.element, this.options.savingClassName);
746
- this.removeForm();
747
- this.leaveHover();
748
- this.element.style.backgroundColor = this.originalBackground;
749
- Element.show(this.element);
750
- if (this.options.externalControl) {
751
- Element.show(this.options.externalControl);
752
- }
753
- this.editing = false;
754
- this.saving = false;
755
- this.oldInnerHTML = null;
756
- this.onLeaveEditMode();
757
- },
758
- onComplete: function(transport) {
759
- this.leaveEditMode();
760
- this.options.onComplete.bind(this)(transport, this.element);
761
- },
762
- onEnterEditMode: function() {},
763
- onLeaveEditMode: function() {},
764
- dispose: function() {
765
- if (this.oldInnerHTML) {
766
- this.element.innerHTML = this.oldInnerHTML;
767
- }
768
- this.leaveEditMode();
769
- Event.stopObserving(this.element, 'click', this.onclickListener);
770
- Event.stopObserving(this.element, 'mouseover', this.mouseoverListener);
771
- Event.stopObserving(this.element, 'mouseout', this.mouseoutListener);
772
- if (this.options.externalControl) {
773
- Event.stopObserving(this.options.externalControl, 'click', this.onclickListener);
774
- Event.stopObserving(this.options.externalControl, 'mouseover', this.mouseoverListener);
775
- Event.stopObserving(this.options.externalControl, 'mouseout', this.mouseoutListener);
776
- }
777
- }
778
- };
779
-
780
- Ajax.InPlaceCollectionEditor = Class.create();
781
- Object.extend(Ajax.InPlaceCollectionEditor.prototype, Ajax.InPlaceEditor.prototype);
782
- Object.extend(Ajax.InPlaceCollectionEditor.prototype, {
783
- createEditField: function() {
784
- if (!this.cached_selectTag) {
785
- var selectTag = document.createElement("select");
786
- var collection = this.options.collection || [];
787
- var optionTag;
788
- collection.each(function(e,i) {
789
- optionTag = document.createElement("option");
790
- optionTag.value = (e instanceof Array) ? e[0] : e;
791
- if((typeof this.options.value == 'undefined') &&
792
- ((e instanceof Array) ? this.element.innerHTML == e[1] : e == optionTag.value)) optionTag.selected = true;
793
- if(this.options.value==optionTag.value) optionTag.selected = true;
794
- optionTag.appendChild(document.createTextNode((e instanceof Array) ? e[1] : e));
795
- selectTag.appendChild(optionTag);
796
- }.bind(this));
797
- this.cached_selectTag = selectTag;
798
- }
799
-
800
- this.editField = this.cached_selectTag;
801
- if(this.options.loadTextURL) this.loadExternalText();
802
- this.form.appendChild(this.editField);
803
- this.options.callback = function(form, value) {
804
- return "value=" + encodeURIComponent(value);
805
- }
806
- }
807
- });
808
-
809
- // Delayed observer, like Form.Element.Observer,
810
- // but waits for delay after last key input
811
- // Ideal for live-search fields
812
-
813
- Form.Element.DelayedObserver = Class.create();
814
- Form.Element.DelayedObserver.prototype = {
815
- initialize: function(element, delay, callback) {
816
- this.delay = delay || 0.5;
817
- this.element = $(element);
818
- this.callback = callback;
819
- this.timer = null;
820
- this.lastValue = $F(this.element);
821
- Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this));
822
- },
823
- delayedListener: function(event) {
824
- if(this.lastValue == $F(this.element)) return;
825
- if(this.timer) clearTimeout(this.timer);
826
- this.timer = setTimeout(this.onTimerEvent.bind(this), this.delay * 1000);
827
- this.lastValue = $F(this.element);
828
- },
829
- onTimerEvent: function() {
830
- this.timer = null;
831
- this.callback(this.element, $F(this.element));
832
- }
833
- };