From: Subject: Bee Base Date: Sun, 22 Mar 2009 09:54:04 -0000 MIME-Version: 1.0 Content-Type: multipart/related; type="text/html"; boundary="----=_NextPart_000_0010_01C9AAD4.224A8EB0" X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 This is a multi-part message in MIME format. ------=_NextPart_000_0010_01C9AAD4.224A8EB0 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Location: mhtml:file://C:\Documents and Settings\Phil\Local Settings\Temporary Internet Files\Content.IE5\QZ1X1QHD\Bee Base.mht =EF=BB=BF Bee Base
Public Pages
Home
 
News = &=20 Vacancies 
Background 
Bee=20 Diseases 
Suspect=20 Poisoning 
L= egislation 
Research & Development
International Development
Food=20 Safety 
Publications 
Bee=20 Health Inspectorate
Bee=20 Health Advisory Panel
= Advisory=20 Leaflets 
C= ontacts 
Maps   =
U= seful=20 links 
=20

















3D"beebase

If you experience any problems or have any suggestions, then please = notify=20 the writeMailTo('vyditep_dqm.mlp@rjw@af', = 'Webmaster')

[You must enable JavaScript to see = this email=20 address]

3D"CSL3D"Defra

3D""=20=20

Advisory Leaflets

 

------=_NextPart_000_0010_01C9AAD4.224A8EB0 Content-Type: image/gif Content-Transfer-Encoding: base64 Content-Location: https://secure.csl.gov.uk/beebase/images/oldBeeBaseBee.gif R0lGODlhUABEAPcAAAAAAAAAMwAAZgAAmQAAzAAA/wAzAAAzMwAzZgAzmQAzzAAz/wBmAABmMwBm ZgBmmQBmzABm/wCZAACZMwCZZgCZmQCZzACZ/wDMAADMMwDMZgDMmQDMzADM/wD/AAD/MwD/ZgD/ mQD/zAD//zMAADMAMzMAZjMAmTMAzDMA/zMzADMzMzMzZjMzmTMzzDMz/zNmADNmMzNmZjNmmTNm zDNm/zOZADOZMzOZZjOZmTOZzDOZ/zPMADPMMzPMZjPMmTPMzDPM/zP/ADP/MzP/ZjP/mTP/zDP/ /2YAAGYAM2YAZmYAmWYAzGYA/2YzAGYzM2YzZmYzmWYzzGYz/2ZmAGZmM2ZmZmZmmWZmzGZm/2aZ AGaZM2aZZmaZmWaZzGaZ/2bMAGbMM2bMZmbMmWbMzGbM/2b/AGb/M2b/Zmb/mWb/zGb//5kAAJkA M5kAZpkAmZkAzJkA/5kzAJkzM5kzZpkzmZkzzJkz/5lmAJlmM5lmZplmmZlmzJlm/5mZAJmZM5mZ ZpmZmZmZzJmZ/5nMAJnMM5nMZpnMmZnMzJnM/5n/AJn/M5n/Zpn/mZn/zJn//8wAAMwAM8wAZswA mcwAzMwA/8wzAMwzM8wzZswzmcwzzMwz/8xmAMxmM8xmZsxmmcxmzMxm/8yZAMyZM8yZZsyZmcyZ zMyZ/8zMAMzMM8zMZszMmczMzMzM/8z/AMz/M8z/Zsz/mcz/zMz///8AAP8AM/8AZv8Amf8AzP8A //8zAP8zM/8zZv8zmf8zzP8z//9mAP9mM/9mZv9mmf9mzP9m//+ZAP+ZM/+ZZv+Zmf+ZzP+Z///M AP/MM//MZv/Mmf/MzP/M////AP//M///Zv//mf//zP///8Ps/gAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAANgALAAAAABQAEQA AAj+ALEJHEiwoMGDCBMqXMiwocOHECNKnBjRA8WLGBtKw7ZRmsWMIDNuLLjxo8GSHkyGXEnQI0mV Aj10xJaSpUEAAAroLDDRpUGYB0faxAaA6E6dEUseBPpTKMudRbEhhaj0pNOlTDPijDpwqkaaCLMO rDkU4c6HPn8ylFn24NGHWckmtHi1rUCvC9MStCg2Zl27dx3q5ThWYcq/gKU6zDq44EfEdvFC/NiX LsScOXlSPKvwqmWGkBFmzolR8tq9eS8jPWqaoebOhQmDTRjabAGcrFk3bB0WbeK7nAvypnm19m+I wwkbF7j8uFTeMx0Hdd4Q922uhavGzG6QFi1s36n+G+SJ0zFbkyYRe19PkL1d7AK37qWLfjvC9d7b ux8Kf2B5kjSx1Z5A4Q2EX4Hg4WfTf0QxSNRCJuUHXnf7JajgSg426F9B7HmAoIQSGljhgQhqBV+G +tHiYYn5hUjgiBdieKJCJHL4nYsvhnjgggX1Z2OMOeJoYYE7siSffDQWKWKFSza54JEPJgnkkCXm OCB/UPqYIpNKpnjlk+WhSOGUXTpJIJZabvgjjmVaCZiYDLU5pZvvpSmlkBYexCSWCqU5Z54UHgen nXuKKN5NWhKK54uH9mhnQt49UOWZjRIk5qO0UOBnpT12ulBRADzwKKfxWZoQVw5gI2oFpDK0FZx/ UWLjAKiajkoqrAZVEJWutnKKpKkGpSrQrL36+uqvBM3qXwXCthqSqP5R8ICzGBIkarHU9pksrtk6 JCyozHabEQWlAuAAq+JeFFWq16YL0rS1uqsVUeHKe1GqxNqrLr3N6lvdQOT6K1Gz2AocrMEUaYrw RKEuLJHCDl8WcboBAQA7 ------=_NextPart_000_0010_01C9AAD4.224A8EB0 Content-Type: image/gif Content-Transfer-Encoding: base64 Content-Location: https://secure.csl.gov.uk/beebase/images/csl.gif R0lGODlhMAAwAOYAAACEAGTCZPH88SmlKbThtA6NDofTh1O1U93y3QCZAHrHepvVm0KvQsnsyR6Y HgCZAGK9Yub35oTNhP///6TapDeoNxiVGHPFcwiTCL3lvUevR+/575TXlACMAIvPi1q8WjOnM9fw 167frgiaCGjBaCCjIA+bD/j++GvFaxikGMPow3rMekG0QQaNBj2yPZvbm9303RicGE26TVO6U/f3 983uzYzTjDKuMrTjtGbMZnLLchCUEKXdpSCeIDqtOkq1ShShFAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5 BAQUAP8ALAAAAAAwADAAAAf/gAmCg4SFhoeIiYIjio2Oj5CRkpOUiB2XHZWahB0aKysfjJuYpJmN FxwHBxc2O5smPh8oEgoQLCmXiAcUPSscLhcXppEjDBQhAicTyxMnCCIQQMOCGCsHGDw8HwMcrpAd PgTM4+QTITMYwxgSPy0iGT8DC96OOysC5fnMIgO5CQcvSriI8UEBimmWdojQx3BZBBem1vHwAUIC BQuPLGRgKEBABHz5ImiI+EGCARQ9EB7Clm+DAR8lYpb48QLkuAj9BpmIEUlBuQgoLFhwQSLYhxQY StiwuSyDqEkulI3L0KPAhQjkNiyIAeAHgmYnwnpQ6QgHuQw7HGzUFwIEgBs2/+La4CDh6aMOLKQu g+FgR42s5EIAASBDRDYeHGKQTbRw3A8AHG5e8EECKzMbkMcJyAmphOVlODqUYHrwEgS9CDD4ZIag xGJDHT7onfCB8LgTNzJ1iPF3mYAbKMa1fl2ogwHhPWyPK90Bg4pxJEgIdx2p8TICIzrcYBohQAkL GAIsGL/gxorpxAs9ZyYBk3VmERrw8E7KBnpII3ov02EKBAyGG9jgwCX2sUbdI/mNs4IpHXCzAUMN JFfgMsNFstYyNpQimg4c8KDCbBMsAIAH90HyXgYYAMEBBS+8wEEJLWCwAwMhCJfAahQe6EgHJMI3 gAkPMkOCKQBAcFMKwRmY3vwgsc12kDjMoCgIOHpFYMIFJT5SQpDL1NCCD+QIcwmOE9TQwXlKSvLe BCsAMOEyL6DAAVMKuJnljhqAyEAHLzRkzg4AoJnjkoVc6FAFRX5GDgEpAaHDnY+wUM4GEHTggAQ1 hHXCBg2ggAEGC0gQAKSPSJAPPEINcMMNJewQAwp/gUJqPWvCx8EHLLAQAA9crmAka1yVAokD6/lJ Ti2ahSpXXBrctQOUxrL3gbELEJqACRIw5acE0/o5liThREvBq8a2N0kxC9SwwWwb1GCDC+n02BAH 1hpiAggyBHABCTOAkN0gwEQn8MBF3bBJAhqqlLCGBzfs8MMQRyzxxBQDKxIIADs= ------=_NextPart_000_0010_01C9AAD4.224A8EB0 Content-Type: image/gif Content-Transfer-Encoding: base64 Content-Location: https://secure.csl.gov.uk/beebase/images/defraVsmall.gif R0lGODdhUgAwAPcAANTUq+/QsdyWUK6ucOGma85tDMbGk25uDvTz6NeIOZqaNP38+ee5ivbl1Ozs 2qSkU+Tky5KSS/359evEnfPbxNJ3HdR/Kbu7fdzcv/nt4fz28IKCKszMmWZmAMxmAP///wAAAAAA AAAAAAAAAJh2FwA0+RIA63/hd6RI43dQxmQAOHgXADh4FwCu0OJ3eAETAHgBEwAAAAAAOHgXAEAG EwA4eBcA6Bc7ACD5EgAkAAAADCz7dwAAEwBIDRMAJAAAAAAAAAD4+BIAAAIAAAAAEwBIhRcAeAET AFcBAAABs/x3vrT8dxi2/HcAAAAAAAAAAKhzSAA4DxYAGA8WAAyEFwAAAAAAJAACAMgOFgBAAAAA AAAAAIj5EgDIDhYAiiz7dwAAEwDADhYAnPkSAPiDFwCKLPt3AAATAPCDFwD4gxcAeAETAHgBEwAw +hIAZH77d0AGEwD/////QPoSAMK3/HfYBxMA+IMXAAyEFwD4gxcACgAAAAAAAAD4+RIAZH77d3gW +Hf/////CPoSAGfn+HeL5/h3APL8d3Dn+Hc4DxYAGA8WAAyEFwAA4P1/AAAAAAAAAAB4ARMAeAET AHgBEwB4ARMAAAATAAcAAAAAAAAADIQXAPiDFwAKAAAAAQ4WAED8/Hes+RIAgPoSAID6EgBkfvt3 eBb4d/////+Q+hIAaFlYfAAAEwAAAAAAAQAAAFWe43cAAAAACgAAAADg/X81AEEAfgBJAPiDFwAA AAAAIAEAAFT6EgAMAAAAsP8SAFQfXHxoHld8//////////9sTkMA+IMXAAAAEwBXAQAAMIQXACiE FwBoARMAAJn0MiQAAAAAU5vNANbFAQAAAABIhRcAbPoSAHgBEwAohBcAMIQXACABAAABAAAAQgoF AEIKBQA0+xIAZH77d1AW+Hf/////RPsSAJ2RV3wAABMACAAUABgBAABVnuN3AAAAAAAAAAAAAAAA AAAAAOTCRABNhBcATAAWAFGEFwDJc0gA/////zCEFwBOw0QATYQXACH5BAAAAAAALAAAAABSADAA QAj/AD8IHEiwoMGDCBMqXMiwocOHEBU+UECxIsWIGDMOXACAg8ePCD4sOPBgIAIAFyhy0MiyZcIO MDtAELghZocDLAV48FBAQIKdHhh80LmzZ4GdBDQQqMBTQFKgUAVosLCzAlGeDQwu4BABJgCXHxJY sCAggIUKAQYGEHC2QgIBAwm8lSAwgd20BeWObcDAbVawgAMLHjzYAQYAiDlcGDCgYEUHhCMLRHD4 44UDGyoagGwg5oaQgRfsFMqQwE6ycDMaOGCzNc6MPz38FTn6A9AAEnLrXjCUpwaBQCcM1HC0At0P AYrOlsy8ufPn0KMvhJCyYknpkRdUf2AAgwMHFS9g/2fpoONHj+bPz/xAEcP4jOXPf1w94DuEiRU7 POD9HvACCTVdNxAErMEUgWCiBeWQaUBldEFrEL6mUQZHFVXbBxn0BVQBQmWwVFNJ+WQBAxPslJoA FSYwAQMCZEBQV66th1Fsx9GmIFBO5XiUcDoV8JttOwknEHEeJKCWcs0lh1QAATCA1AdMIUUBBU0e 1+OPwRHkJE8MrJVlf2CGKeaYZJZp5pkmXTCReGiyhAAHFlEkYJsRwRmnnHQ+tAAEFYEmUEVf5akV BOnJxwEEflLEpqAC7XleoB8MsEGj500EKaNvGnooAgc0NpCdCkTAH6MbafpgZnHWBJN7pA6K2Gqd AtgAmUAY2LRoqwcNANMAfgJgk4RgLcDkcgsFMEEAFGRU4E0P6Porghcu1ECFO8EHoWsuZWBsABlE i+GKEyzXY0HHTelnAxNMUCNBtV7raUYZRAmVgg1QNa8HGjRwr773wkXBvTsRC4GqMM0ZkZIWJItc bVEmkFUDPxUQUo/8bZgjA1u2+AGDBRBLkGJ+YmTvjzYKtWEBKBdQAVq9+QhckANR6EFqC2PVHIME EFQbUDkfdOXLHggpUmxC/mtzcwtcBRWHGwPMX8RYwkxQtxsCVQGuWGet9dZiBgQAOw== ------=_NextPart_000_0010_01C9AAD4.224A8EB0 Content-Type: image/png Content-Transfer-Encoding: base64 Content-Location: https://secure.csl.gov.uk/beebase/images/rss.png iVBORw0KGgoAAAANSUhEUgAAACQAAAAOCAMAAABw6U76AAAAt1BMVEX/ZgD///8/GgH/yKR9MwL/ mlflVgDhm3fGRADwXQDVdkT/j0T7ZADwzbv/eiLoWAD4YgD/9e7/4MzKUBHxpXf78+7/hTPxupnZ glXdUgDUVxH/1rv/cBH02sz9wZndj2b+4MzpoHf/o2b/uIj8tojKRgDXYyL/rXfbZSLnYRHWTQDm n3f/693/mVXkdy7tmGbteTPrl2b/5tWfQQPYd0QhDgH88+7otJnsWwD0XwD99O76llXOXSKFxRG4 AAAAqklEQVR42oWPRw7CQAwAbcqW9JCE3kPovbf/v4sVwkKYQ+YyPoxsGfbFXNZQhlxKf5Fn22Qe oSFMAaoVNAzJPJIywQ0scWH1XOmTWaREjNJHrM+0PxVkvikN70/RQsT+BAIyiwzHLGgPOmaIgczP uXjR4DmiKdEVZB55Z9xBOFrZXZRzMo/ggcn2/XktEuSfCJQCuKrsNrasSDUcIFP0S6C18/UnOhRy Ob0A0VkO6WtrQTIAAAAASUVORK5CYII= ------=_NextPart_000_0010_01C9AAD4.224A8EB0 Content-Type: text/css; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Location: https://secure.csl.gov.uk/beebase/style/sheet.css #container { BACKGROUND-POSITION: right 50%; BACKGROUND-IMAGE: url(rightbg.jpg); = LINE-HEIGHT: 1em; BACKGROUND-REPEAT: repeat-y; BACKGROUND-COLOR: #fff } #banner { BACKGROUND-POSITION: left top; BACKGROUND-IMAGE: url(navbg.jpg); = OVERFLOW: hidden; BACKGROUND-REPEAT: repeat-x; HEIGHT: 100px } #banner H1 { PADDING-RIGHT: 0px; BACKGROUND-POSITION: left top; PADDING-LEFT: 0px; = FONT-SIZE: 12px; FLOAT: left; BACKGROUND-IMAGE: url(logo.jpg); = PADDING-BOTTOM: 0px; OVERFLOW: hidden; WIDTH: 231px; PADDING-TOP: 100px; = BACKGROUND-REPEAT: no-repeat; HEIGHT: 100px } #banner H2 { PADDING-RIGHT: 0px; BACKGROUND-POSITION: right top; PADDING-LEFT: 0px; = FONT-SIZE: 12px; FLOAT: right; BACKGROUND-IMAGE: url(caption.jpg); = PADDING-BOTTOM: 0px; OVERFLOW: hidden; WIDTH: 264px; PADDING-TOP: 100px; = BACKGROUND-REPEAT: no-repeat; HEIGHT: 100px } #content { PADDING-RIGHT: 50px; BACKGROUND-POSITION: left 50%; PADDING-LEFT: = 220px; BACKGROUND-IMAGE: url(leftbg.jpg); COLOR: #000; PADDING-TOP: = 30px; BACKGROUND-REPEAT: repeat-y } #nav { BACKGROUND-POSITION: left 50%; PADDING-LEFT: 5px; FLOAT: left; = BACKGROUND-IMAGE: url(leftbg.jpg); WIDTH: 190px; BACKGROUND-REPEAT: = repeat-y } #nav UL { PADDING-BOTTOM: 1em } #nav LI { LIST-STYLE-TYPE: none } #nav A { FONT-SIZE: 0.8em; COLOR: #333; TEXT-DECORATION: none } #nav A:hover { COLOR: #ff9933 } #footer { CLEAR: both; BACKGROUND-POSITION: left 50%; BACKGROUND-IMAGE: = url(bottombg.jpg); BACKGROUND-REPEAT: no-repeat; HEIGHT: 40px } #end { BACKGROUND-POSITION: right bottom; FLOAT: right; BACKGROUND-IMAGE: = url(bottomrightcorner.jpg); WIDTH: 40px; BACKGROUND-REPEAT: no-repeat; = HEIGHT: 40px } ------=_NextPart_000_0010_01C9AAD4.224A8EB0 Content-Type: text/css; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Location: https://secure.csl.gov.uk/beebase/style/print.css BODY { BACKGROUND-IMAGE: url(white.gif); FONT-FAMILY: arial, helvetica, = sans-serif } #container { LINE-HEIGHT: 1em; BACKGROUND-COLOR: #fff } #banner { DISPLAY: none; VISIBILITY: hidden } #nav { DISPLAY: none; VISIBILITY: hidden } #nav * { DISPLAY: none; VISIBILITY: hidden } #content { PADDING-RIGHT: 50px; PADDING-LEFT: 15px; PADDING-BOTTOM: 30px; = PADDING-TOP: 30px } #footer { DISPLAY: none; VISIBILITY: hidden } #end { DISPLAY: none; VISIBILITY: hidden } FONT.hide { DISPLAY: none; VISIBILITY: hidden } ------=_NextPart_000_0010_01C9AAD4.224A8EB0 Content-Type: text/css; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Location: https://secure.csl.gov.uk/beebase/style/common.css * { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: = 0px; PADDING-TOP: 0px } HTML { =09 } BODY { BACKGROUND-IMAGE: url(pagebg.jpg); FONT-FAMILY: arial, helvetica, = sans-serif } #banner H2 { PADDING-RIGHT: 0px; BACKGROUND-POSITION: right top; PADDING-LEFT: 0px; = FONT-SIZE: 12px; FLOAT: right; BACKGROUND-IMAGE: url(caption.jpg); = PADDING-BOTTOM: 0px; OVERFLOW: hidden; WIDTH: 264px; PADDING-TOP: 100px; = BACKGROUND-REPEAT: no-repeat; HEIGHT: 100px } #banner UL { RIGHT: 23px; OVERFLOW: visible; POSITION: absolute; TOP: 76px } #banner LI { BACKGROUND-POSITION: left top; DISPLAY: inline; FONT-SIZE: 0.8em; = FLOAT: left; BACKGROUND-IMAGE: url(tabbgL.gif); WIDTH: 6em; = BORDER-BOTTOM: #fff 40px solid; BACKGROUND-REPEAT: no-repeat; = LIST-STYLE-TYPE: none; POSITION: relative; TEXT-ALIGN: center } #banner A { BACKGROUND-POSITION: right top; DISPLAY: block; FLOAT: left; = BACKGROUND-IMAGE: url(tabbgR.gif); WIDTH: 6em; COLOR: #666; = BACKGROUND-REPEAT: no-repeat; TEXT-DECORATION: none } H3 { FONT-WEIGHT: lighter; PADDING-BOTTOM: 1em; COLOR: #444; PADDING-TOP: = 1em } P { FONT-SIZE: 0.75em; PADDING-BOTTOM: 1em; PADDING-TOP: 1em } DIV.info { BACKGROUND-POSITION: left top; BACKGROUND-IMAGE: = url(roundedboxtop.jpg); WIDTH: 140px; PADDING-TOP: 10px; = BACKGROUND-REPEAT: no-repeat } DIV.attpopup { BORDER-RIGHT: #000 1px solid; PADDING-RIGHT: 6px; BORDER-TOP: #000 1px = solid; MARGIN-TOP: 95px; DISPLAY: none; PADDING-LEFT: 6px; = PADDING-BOTTOM: 6px; MARGIN-LEFT: 0px; BORDER-LEFT: #000 1px solid; = WIDTH: 250px; PADDING-TOP: 6px; BORDER-BOTTOM: #000 1px solid; POSITION: = absolute; BACKGROUND-COLOR: #ffff99 } DIV.approverpopup { BORDER-RIGHT: #000 1px solid; PADDING-RIGHT: 6px; BORDER-TOP: #000 1px = solid; MARGIN-TOP: 100px; DISPLAY: none; PADDING-LEFT: 6px; = PADDING-BOTTOM: 6px; MARGIN-LEFT: 235px; BORDER-LEFT: #000 1px solid; = WIDTH: 150px; PADDING-TOP: 6px; BORDER-BOTTOM: #000 1px solid; POSITION: = absolute; BACKGROUND-COLOR: #ffff99 } #special { FONT-SIZE: 10px; COLOR: red } #special A:link { FONT-SIZE: 12px; COLOR: blue } #special A:hover { FONT-SIZE: 12px; COLOR: blue } #special A:visited { FONT-SIZE: 12px; COLOR: blue } DIV.info P { PADDING-RIGHT: 10px; BACKGROUND-POSITION: left bottom; PADDING-LEFT: = 10px; FONT-SIZE: 10px; BACKGROUND-IMAGE: url(roundedboxbottom.jpg); = MAX-WIDTH: 140px; PADDING-BOTTOM: 10px; WIDTH: 120px; PADDING-TOP: 0px; = BACKGROUND-REPEAT: no-repeat } A.risk:link { FONT-SIZE: 1em; COLOR: #bdf3f5; TEXT-DECORATION: underline } A.risk:hover { FONT-SIZE: 1em; COLOR: yellow; TEXT-DECORATION: underline } A:link { FONT-SIZE: 1em; TEXT-DECORATION: underline } A:hover { COLOR: #ff9933 } #navlist { PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 4px; MARGIN: 2px = 5px 2px 0px; PADDING-TOP: 4px } #navlist2 { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 5px = 5px 5px 0px; PADDING-TOP: 0px } #navlistVert { PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 4px; MARGIN: 2px = 5px 2px 0px; PADDING-TOP: 4px } #navlist LI { BORDER-RIGHT: #333333 0.2em solid; PADDING-RIGHT: 0.3em; BORDER-TOP: = #333333 0.2em solid; DISPLAY: inline; PADDING-LEFT: 0.3em; FONT-WEIGHT: = 600; FONT-SIZE: 12px; MARGIN-BOTTOM: 0.1em; PADDING-BOTTOM: 0.3em; = BORDER-LEFT: #333333 0.2em solid; COLOR: #333333; MARGIN-RIGHT: 10px; = PADDING-TOP: 0.3em; BORDER-BOTTOM: #333333 0.2em solid; LIST-STYLE-TYPE: = none; BACKGROUND-COLOR: #cc6602; TEXT-ALIGN: center } #navlist2 LI { BORDER-RIGHT: #333333 0.2em solid; PADDING-RIGHT: 0.3em; BORDER-TOP: = #333333 0.2em solid; PADDING-LEFT: 0.3em; FONT-WEIGHT: 600; FONT-SIZE: = 12px; MARGIN-BOTTOM: 0.1em; PADDING-BOTTOM: 0.3em; BORDER-LEFT: #333333 = 0.2em solid; WIDTH: 320px; COLOR: #333333; MARGIN-RIGHT: 10px; = PADDING-TOP: 0.3em; BORDER-BOTTOM: #333333 0.2em solid; LIST-STYLE-TYPE: = none; BACKGROUND-COLOR: #cc6602; TEXT-ALIGN: center } #navlistVert LI { BORDER-RIGHT: #333333 0.2em solid; PADDING-RIGHT: 0.3em; BORDER-TOP: = #333333 0.2em solid; DISPLAY: block; PADDING-LEFT: 0.3em; FONT-WEIGHT: = 600; FONT-SIZE: 12px; MARGIN-BOTTOM: 0.3em; PADDING-BOTTOM: 0.3em; = BORDER-LEFT: #333333 0.2em solid; WIDTH: 180px; COLOR: #333333; = MARGIN-RIGHT: 10px; PADDING-TOP: 0.3em; BORDER-BOTTOM: #333333 0.2em = solid; LIST-STYLE-TYPE: none; BACKGROUND-COLOR: #cc6602; TEXT-ALIGN: = center } #navlist LI A { COLOR: white; TEXT-DECORATION: none } #navlist2 LI A { COLOR: white; TEXT-DECORATION: none } #navlistVert LI A { COLOR: white; TEXT-DECORATION: none } #navlist LI A:hover { COLOR: black; BACKGROUND-COLOR: #dadada } #navlist2 LI A:hover { COLOR: black; BACKGROUND-COLOR: #dadada } #navlistVert LI A:hover { COLOR: black; BACKGROUND-COLOR: #dadada } H1 { LINE-HEIGHT: 1em } H3 { FONT-WEIGHT: lighter; PADDING-BOTTOM: 1em; COLOR: #444; PADDING-TOP: = 1em } P { FONT-SIZE: 0.75em; PADDING-BOTTOM: 1em; COLOR: #000; PADDING-TOP: 1em; = FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-ALIGN: justify } P.red { COLOR: red } .idNum { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: 600; FONT-SIZE: = 13pt; PADDING-BOTTOM: 0px; COLOR: red; PADDING-TOP: 0px } OPTION { PADDING-RIGHT: 0.5em } SPAN.red { COLOR: red } .radiobg { BORDER-RIGHT: black 2px solid; PADDING-RIGHT: 3px; BORDER-TOP: black = 2px solid; PADDING-LEFT: 3px; FONT-WEIGHT: 600; PADDING-BOTTOM: 3px; = BORDER-LEFT: black 2px solid; COLOR: white; PADDING-TOP: 3px; = BORDER-BOTTOM: black 2px solid; BACKGROUND-COLOR: #cc6602 } .dontChange { BORDER-RIGHT: #aaa 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #aaa 1px = solid; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; BORDER-LEFT: #aaa 1px = solid; PADDING-TOP: 2px; BORDER-BOTTOM: #aaa 1px solid; = BACKGROUND-COLOR: #ffffcc } .alignleft { TEXT-ALIGN: left } P.center { TEXT-ALIGN: center } P.indexLinks { FONT-SIZE: 15px; COLOR: #333333; FONT-FAMILY: Arial, Helvetica, = sans-serif; TEXT-ALIGN: left } P.message { PADDING-RIGHT: 0.5em; PADDING-LEFT: 0.5em; FONT-WEIGHT: bold; = FONT-SIZE: 0.75em; PADDING-BOTTOM: 0.5em; COLOR: white; PADDING-TOP: = 0.5em; FONT-FAMILY: Arial, Helvetica, sans-serif; BACKGROUND-COLOR: red; = TEXT-ALIGN: left } P.boxedText { BORDER-RIGHT: #333333 2px solid; PADDING-RIGHT: 5px; BORDER-TOP: = #333333 2px solid; PADDING-LEFT: 5px; FONT-SIZE: 12px; PADDING-BOTTOM: = 5px; BORDER-LEFT: #333333 2px solid; WIDTH: auto; COLOR: #333333; = PADDING-TOP: 5px; BORDER-BOTTOM: #333333 2px solid; FONT-STYLE: normal; = FONT-FAMILY: Arial, Helvetica, sans-serif; HEIGHT: auto } P.boxedTextCentered { BORDER-RIGHT: #333333 2px solid; PADDING-RIGHT: 5px; BORDER-TOP: = #333333 2px solid; PADDING-LEFT: 5px; FONT-SIZE: 12px; FLOAT: right; = PADDING-BOTTOM: 5px; BORDER-LEFT: #333333 2px solid; WIDTH: auto; COLOR: = #333333; PADDING-TOP: 5px; BORDER-BOTTOM: #333333 2px solid; FONT-STYLE: = normal; FONT-FAMILY: Arial, Helvetica, sans-serif; HEIGHT: auto; = BACKGROUND-COLOR: #ffffcc; TEXT-ALIGN: center } DIV.info { BACKGROUND-POSITION: left top; BACKGROUND-IMAGE: = url(roundedboxtop.jpg); WIDTH: 140px; PADDING-TOP: 10px; = BACKGROUND-REPEAT: no-repeat } DIV.info P { PADDING-RIGHT: 10px; BACKGROUND-POSITION: left bottom; PADDING-LEFT: = 10px; FONT-SIZE: 10px; BACKGROUND-IMAGE: url(roundedboxbottom.jpg); = MAX-WIDTH: 140px; PADDING-BOTTOM: 10px; WIDTH: 140px; PADDING-TOP: 0px; = BACKGROUND-REPEAT: no-repeat } DIV.info A:hover { FONT-SIZE: 1em; COLOR: #ff9933 } .floatright { FLOAT: right } .floatleft { FLOAT: left } IMG { BORDER-RIGHT: 0px; PADDING-RIGHT: 5px; BORDER-TOP: 0px; PADDING-LEFT: = 5px; PADDING-BOTTOM: 0px; BORDER-LEFT: 0px; PADDING-TOP: 0px; = BORDER-BOTTOM: 0px } OL.standardList { PADDING-LEFT: 20px; MARGIN-LEFT: 10px; LIST-STYLE-TYPE: decimal } OL.standardList LI { FONT-SIZE: 12px } UL.standardList { PADDING-LEFT: 20px; MARGIN-LEFT: 10px } UL.standardList LI { FONT-SIZE: 12px } H4 { FONT-SIZE: 18px; COLOR: #333333; BORDER-BOTTOM: #ccc 1px solid; = FONT-FAMILY: Arial, Helvetica, sans-serif } H4 A:link { FONT-SIZE: 10pt; COLOR: blue; TEXT-DECORATION: none } H4 A:hover { FONT-SIZE: 10pt; COLOR: blue; BACKGROUND-COLOR: yellow; = TEXT-DECORATION: none } H4 A:visited { FONT-SIZE: 10pt; COLOR: blue; TEXT-DECORATION: none } H5 { FONT-SIZE: 15px; COLOR: #333333; FONT-FAMILY: Arial, Helvetica, = sans-serif; TEXT-ALIGN: left } H6 { FONT-WEIGHT: bold; FONT-SIZE: 0.75em; FONT-FAMILY: Arial, Helvetica, = sans-serif } TABLE.sid3 { BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium = none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse } TABLE.sid3 TH { BORDER-RIGHT: #aaa 1px solid; PADDING-RIGHT: 3px; BORDER-TOP: #aaa 1px = solid; PADDING-LEFT: 3px; FONT-SIZE: 10px; PADDING-BOTTOM: 3px; = BORDER-LEFT: #aaa 1px solid; PADDING-TOP: 3px; BORDER-BOTTOM: #aaa 1px = solid; BACKGROUND-COLOR: #ffffcc } TABLE.sid3 TD { BORDER-RIGHT: #aaa 1px solid; PADDING-RIGHT: 3px; BORDER-TOP: #aaa 1px = solid; PADDING-LEFT: 3px; FONT-SIZE: 11px; PADDING-BOTTOM: 3px; = BORDER-LEFT: #aaa 1px solid; PADDING-TOP: 3px; BORDER-BOTTOM: #aaa 1px = solid; TEXT-ALIGN: center } TABLE.data { BORDER-RIGHT: #aaa 1px solid; BORDER-TOP: #aaa 1px solid; BORDER-LEFT: = #aaa 1px solid; BORDER-BOTTOM: #aaa 1px solid; BORDER-COLLAPSE: collapse } TABLE.data TD { BORDER-RIGHT: #ddd 1px solid; PADDING-RIGHT: 3px; BORDER-TOP: #ddd 1px = solid; PADDING-LEFT: 3px; FONT-SIZE: 12px; PADDING-BOTTOM: 3px; = BORDER-LEFT: #ddd 1px solid; PADDING-TOP: 3px; BORDER-BOTTOM: #ddd 1px = solid } TABLE.data TH { BORDER-RIGHT: #aaa 1px solid; PADDING-RIGHT: 3px; BORDER-TOP: #aaa 1px = solid; PADDING-LEFT: 3px; FONT-SIZE: 12px; PADDING-BOTTOM: 3px; = BORDER-LEFT: #aaa 1px solid; PADDING-TOP: 3px; BORDER-BOTTOM: #aaa 1px = solid; BACKGROUND-COLOR: #ffffcc } TABLE.dataTextCenter { BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: = 0px; BORDER-COLLAPSE: collapse } TABLE.dataTextCenter TH { BORDER-RIGHT: #ddd 1px solid; PADDING-RIGHT: 3px; BORDER-TOP: #ddd 1px = solid; PADDING-LEFT: 3px; FONT-SIZE: 12px; PADDING-BOTTOM: 3px; = BORDER-LEFT: #ddd 1px solid; PADDING-TOP: 3px; BORDER-BOTTOM: #ddd 1px = solid; BACKGROUND-COLOR: #ffffcc } TABLE.dataTextCenter TD { BORDER-RIGHT: #ddd 1px solid; PADDING-RIGHT: 3px; BORDER-TOP: #ddd 1px = solid; PADDING-LEFT: 3px; FONT-SIZE: 12px; PADDING-BOTTOM: 3px; = BORDER-LEFT: #ddd 1px solid; PADDING-TOP: 3px; BORDER-BOTTOM: #ddd 1px = solid; TEXT-ALIGN: center } TABLE.noBorder { BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: = 0px } TABLE.noBorder TH { FONT-SIZE: 12px; BACKGROUND-COLOR: #ffffcc } TABLE.noBorder TD { PADDING-RIGHT: 3px; PADDING-LEFT: 3px; FONT-SIZE: 12px; PADDING-BOTTOM: = 3px; PADDING-TOP: 3px } TABLE.someBorders { BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: = 0px; BORDER-COLLAPSE: collapse } TABLE.someBorders TH { BORDER-RIGHT: #aaa 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #aaa 1px = solid; PADDING-LEFT: 2px; FONT-SIZE: 11px; PADDING-BOTTOM: 2px; = BORDER-LEFT: #aaa 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #aaa 1px = solid; BACKGROUND-COLOR: #ffffcc } TABLE.someBorders TD { PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-SIZE: 11px; PADDING-BOTTOM: = 2px; PADDING-TOP: 2px } TD.border { BORDER-RIGHT: #aaa 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #aaa 1px = solid; PADDING-LEFT: 2px; FONT-SIZE: 11px; PADDING-BOTTOM: 2px; = BORDER-LEFT: #aaa 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #aaa 1px = solid; TEXT-ALIGN: center } TD.labBorder { BORDER-RIGHT: #aaa 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #aaa 1px = solid; PADDING-LEFT: 2px; FONT-SIZE: 11px; PADDING-BOTTOM: 2px; = BORDER-LEFT: #aaa 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #aaa 1px = solid; TEXT-ALIGN: center } TD.highRisk { BORDER-RIGHT: #aaa 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #aaa 1px = solid; PADDING-LEFT: 2px; FONT-WEIGHT: bold; FONT-SIZE: 11px; = PADDING-BOTTOM: 2px; BORDER-LEFT: #aaa 1px solid; COLOR: black; = PADDING-TOP: 2px; BORDER-BOTTOM: #aaa 1px solid; BACKGROUND-COLOR: red; = TEXT-ALIGN: center } TD.medRisk { BORDER-RIGHT: #aaa 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #aaa 1px = solid; PADDING-LEFT: 2px; FONT-WEIGHT: bold; FONT-SIZE: 11px; = PADDING-BOTTOM: 2px; BORDER-LEFT: #aaa 1px solid; COLOR: black; = PADDING-TOP: 2px; BORDER-BOTTOM: #aaa 1px solid; BACKGROUND-COLOR: = #f5a905; TEXT-ALIGN: center } TD.noRisk { BORDER-RIGHT: #aaa 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #aaa 1px = solid; PADDING-LEFT: 2px; FONT-WEIGHT: bold; FONT-SIZE: 11px; = PADDING-BOTTOM: 2px; BORDER-LEFT: #aaa 1px solid; COLOR: black; = PADDING-TOP: 2px; BORDER-BOTTOM: #aaa 1px solid; BACKGROUND-COLOR: = #20c270; TEXT-ALIGN: center } TD.noBorder { BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium = none; BORDER-BOTTOM: medium none } TD.alignleft { BORDER-RIGHT: #aaa 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #aaa 1px = solid; PADDING-LEFT: 2px; FONT-SIZE: 11px; PADDING-BOTTOM: 2px; = BORDER-LEFT: #aaa 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #aaa 1px = solid; BACKGROUND-COLOR: #edebeb; TEXT-ALIGN: left } TD.borderLeftAlign { BORDER-RIGHT: #aaa 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #aaa 1px = solid; PADDING-LEFT: 2px; FONT-SIZE: 11px; PADDING-BOTTOM: 2px; = BORDER-LEFT: #aaa 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #aaa 1px = solid; TEXT-ALIGN: left } TD.alignright { BORDER-RIGHT: #aaa 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #aaa 1px = solid; PADDING-LEFT: 2px; FONT-SIZE: 11px; PADDING-BOTTOM: 2px; = BORDER-LEFT: #aaa 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #aaa 1px = solid; BACKGROUND-COLOR: white; TEXT-ALIGN: right } TD.rightBorderOnly { BORDER-RIGHT: #aaa 1px solid } TD.rightAndBottomBorder { BORDER-RIGHT: #aaa 1px solid; BORDER-BOTTOM: #aaa 1px solid } BLOCKQUOTE { FONT-SIZE: 0.75em; PADDING-BOTTOM: 1em; PADDING-TOP: 1em; FONT-FAMILY: = Arial, Helvetica, sans-serif; TEXT-ALIGN: justify } HR { BORDER-RIGHT: 0px; BORDER-TOP: 0px; MARGIN-BOTTOM: 10px; = PADDING-BOTTOM: 0px; BORDER-LEFT: 0px; PADDING-TOP: 0px; BORDER-BOTTOM: = #ccc 1px solid } .floatright { FLOAT: right } .floatleft { FLOAT: left } .label { FONT-SIZE: 12px } DIV.tipbox { BORDER-RIGHT: #000 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #000 1px = solid; PADDING-LEFT: 2px; FONT-SIZE: 12px; BACKGROUND: #ffffcc; = PADDING-BOTTOM: 2px; MARGIN: 3px; BORDER-LEFT: #000 1px solid; WIDTH: = 420px; PADDING-TOP: 2px; BORDER-BOTTOM: #000 1px solid; FONT-FAMILY: = verdana; TEXT-ALIGN: left } DIV.caution { BACKGROUND: url(../images/caution.png) #ffffcc no-repeat; FLOAT: left; = MARGIN: 5px; WIDTH: 70px; HEIGHT: 60px } DIV.tipbox DIV.message { MARGIN-LEFT: 75px } DIV.tipbox DIV.message P { PADDING-RIGHT: 6px; PADDING-LEFT: 6px; FONT-SIZE: 12px; PADDING-BOTTOM: = 6px; COLOR: #444; PADDING-TOP: 6px } UL.errorlist { PADDING-LEFT: 20px; FONT-WEIGHT: bold; COLOR: red } UL.errorlist LI { PADDING-LEFT: 0px } DIV.entryform LEGEND { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: 600; FONT-SIZE: = 13pt; PADDING-BOTTOM: 0px; COLOR: red; PADDING-TOP: 0px } DIV.entryform FIELDSET { BORDER-RIGHT: #777 1px solid; PADDING-RIGHT: 40px; BORDER-TOP: #777 1px = solid; PADDING-LEFT: 40px; PADDING-BOTTOM: 10px; BORDER-LEFT: #777 1px = solid; WIDTH: auto; PADDING-TOP: 5px; BORDER-BOTTOM: #777 1px solid; = TEXT-ALIGN: right } DIV.entryform LABEL { FONT-WEIGHT: bold; FONT-SIZE: 12px; MARGIN: 4px; WIDTH: 160px; = FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-ALIGN: right } DIV.entryform BR { CLEAR: left } ------=_NextPart_000_0010_01C9AAD4.224A8EB0 Content-Type: application/octet-stream Content-Transfer-Encoding: quoted-printable Content-Location: https://secure.csl.gov.uk/library/validateForm.js /* * Max Spicer, 22/10/2002 * Checkboxes added by Andy Pomfret, 01/09/2004 */ function validateForm(f) { var date; var maxdate; var mindate; var dateArray; var time; var maxtime; var mintime; var timeArray; var emptyFields =3D ""; var errors =3D ""; var msg; var elementName; // If set, checks for empty fields aren't made, but content validation = (e.g. valid date) checks are still // performed var alloptional =3D f.alloptional!=3Dnull && f.alloptional; // Check validation hasn't been specifically turned off. if(f.validate!=3Dnull && !f.validate) { return true; } for(var i=3D0; i0) { if((e.min !=3D null && numCheckede.max)) { if(e.min !=3D null && e.max =3D=3D null) { errors +=3D "- At least " + e.min; } else if(e.min !=3D null && e.max !=3D null) { errors +=3D "- At least " + e.min + " and no more than " + = e.max; } else { errors +=3D "- No more than " + e.max; } errors +=3D " boxes from the list, '" + elementName + "', = must be ticked.\n"; } } if(!optionalCheckGroup && numChecked =3D=3D 0) { emptyFields +=3D "\n " + elementName; } } // End of checkbox validation if((e.type =3D=3D "text" || e.type =3D=3D "password" || e.type = =3D=3D "textarea" || e.type =3D=3D "file" || (e.type =3D=3D "hidden" && = e.required))) { // If the field is empty and mandatory, flag an error, if empty = but optional, skip this field. if(!alloptional && (e.value =3D=3D null || = !e.value.search(/^\s*$/))) { if(!e.optional) { emptyFields +=3D "\n " + elementName; } continue; } // Now check elements that should be numeric if((e.numeric || e.min !=3D null || e.max !=3D null || e.integer = !=3D null) && e.value.search(/^\s*$/)) { var v =3D new Number(e.value); if(isNaN(v) || (e.min !=3D null && v < e.min) || (e.max !=3D null && v > e.max) || (e.integer !=3D null && e.value.search(/\./) !=3D -1)) { errors +=3D "- The text box '" + elementName + "' must = contain a"; if(e.integer !=3D null) { errors +=3D " whole"; } errors +=3D " number"; if (e.min !=3D null && e.max !=3D null) { errors +=3D " between " + e.min + " and " + e.max + ", = inclusive"; } else if (e.min !=3D null) { errors +=3D " that is greater than or equal to " + e.min; } else if (e.max !=3D null) { errors +=3D " that is less than or equal to " + e.max; } errors +=3D ".\n"; } } // Now check elements that should have a minimum length if (e.minLength !=3D null && e.minLength !=3D -1) { if (e.value.length < e.minLength) { errors +=3D "- The contents of text box '" + elementName + = "' must be at least " + e.minLength; if (e.numeric) { errors +=3D " digits long.\n"; } else { errors +=3D " characters long.\n"; } } } // Now check elements that should have a maximum length if (e.maxLength !=3D null && e.maxLength !=3D -1) { if (e.value.length > e.maxLength) { errors +=3D "- The contents of text box '" + elementName + = "' cannot be longer than " + e.maxLength; if (e.numeric) { errors +=3D " digits.\n"; } else { errors +=3D " characters.\n"; } } } // Now check elements that should be a date if((e.date || e.maxdate || e.mindate) && = e.value.search(/^\s*$/)) { if(e.maxdate) { dateArray =3D e.maxdate.split("/"); maxdate =3D new = Date(dateArray[2],dateArray[1]-1,dateArray[0]); } if(e.mindate) { dateArray =3D e.mindate.split("/"); mindate =3D new = Date(dateArray[2],dateArray[1]-1,dateArray[0]); } dateArray =3D e.value.split("/"); if(dateArray.length !=3D 3 || dateArray[2].length !=3D 4 || dateArray[0] > 31 || dateArray[0] < 1 || dateArray[1] > 12 || dateArray[1] < 1 || isNaN(date =3D new Date(dateArray[2], dateArray[1]-1, = dateArray[0])) || date.getDate() !=3D dateArray[0] // Check the actual date = is valid e.g. reject 31/09/2002 (30 days hath September ...) || e.maxdate && = Math.floor((maxdate.getTime()-date.getTime())/(1000*60*60*24)) < 0 || e.mindate && = Math.floor((mindate.getTime()-date.getTime())/(1000*60*60*24)) > 0) { errors +=3D "- The text box '" + elementName + "' must = contain a valid date in dd/mm/yyyy format" if(e.mindate) { errors +=3D " that cannot be before " + e.mindate; if(e.maxdate) { errors +=3D " and cannot be after " + e.maxdate; } } else if(e.maxdate) { errors +=3D " that cannot be after " + e.maxdate; } errors +=3D ".\n"; } } // Now check elements that should be a time if((e.time || e.maxtime || e.mintime) && = e.value.search(/^\s*$/)) { if(e.maxtime) { timeArray =3D e.maxtime.split(":"); maxtime =3D new Date(0,0,0,timeArray[0],timeArray[1]); } if(e.mintime) { timeArray =3D e.mintime.split(":"); mintime =3D new Date(0,0,0,timeArray[0],timeArray[1]); } timeArray =3D e.value.split(":"); if(timeArray.length !=3D 2 || timeArray[1].length !=3D 2 || timeArray[0] < 0 || timeArray[0] > 23 || timeArray[1] < 0 || timeArray[1] > 59 || isNaN(time =3D new Date(0,0,0,timeArray[0],timeArray[1])) || e.maxtime && (maxtime.getTime()-time.getTime()) < 0 || e.mintime && (mintime.getTime()-time.getTime()) > 0) { errors +=3D "- The text box '" + elementName + "' must = contain a valid time in hh:mm format" if(e.mintime) { errors +=3D " that cannot be before " + e.mintime; if(e.maxtime) { errors +=3D " and cannot be after " + e.maxtime; } } else if(e.maxtime) { errors +=3D " that cannot be after " + e.maxtime; } errors +=3D ".\n"; } } } // Check for selects that have not been selected // (assumes the first option in a select is a dummy option, e.g. = '-- Select --' if it's a single select) if( !alloptional=20 && !e.optional=20 && ( (e.type =3D=3D "select-one" && e.selectedIndex < 1) || (e.type =3D=3D "select-multiple" && e.selectedIndex =3D=3D = -1) ) ) { emptyFields +=3D "\n " + elementName; } } } if(!emptyFields && !errors) return true; msg =3D "This page could not be submitted because of the following = error(s):\n" msg +=3D "Please correct these errors and try again.\n" if(emptyFields) { msg +=3D "- The following required text boxes are empty:" + = emptyFields + "\n"; if(errors) msg +=3D "\n"; } msg +=3D errors; alert(msg); return false; } ------=_NextPart_000_0010_01C9AAD4.224A8EB0 Content-Type: application/octet-stream Content-Transfer-Encoding: quoted-printable Content-Location: https://secure.csl.gov.uk/library/validateForm2.js // List of pointers to error messages that have been inserted into the = page by validateForm var _valFormErrorMessages =3D new Array(); // Hash mapping an element's name to its display text var _valFormDisplayNames; /* Validate a form, returning true if no errors are found, false = otherwise * f - form object to validate * e - optional element object to validate, otherwise does all elements = in form. If e is specified, no errors * are reported to the user. This is to allow on the fly = validation. */ function validateForm2(f, e) { // Check validation hasn't been specifically turned off. if (f.validate =3D=3D=3D false) { return true; } var reportErrors =3D (e =3D=3D null); var errorsFound =3D false; // Store the display names of fields with errors var errorFields =3D []; var errorsFound; // Return the text within a parent element, optionally stopping at a = specified child element that is directly // contained in the parent function getLabelText(parent, child) { var text =3D ""; for (var i =3D 0; i < parent.childNodes.length; i++) { var node =3D parent.childNodes[i]; if (child && node =3D=3D child) { break; } if (node.textContent) { text +=3D node.textContent; // DOM } else if (node.innerText) { text +=3D node.innerText; // IE } else if (node.nodeType =3D=3D 3 /* Node.TEXT_NODE */) { text +=3D node.data; // IE again } } text =3D text.replace(/\n/g, ' '); // Remove newlines text =3D text.replace(/^\s*/, ''); // Trim leading whitespace text =3D text.replace(/:?\s*$/, ''); // Trim trailing whitespace return text; } // Highlight element as having an error and display msg after it. = Also add the elements // displayName to the list of fields with errors function reportError(e, msg) { if (reportErrors) { var displayName; if (e.displayName) { // displayName has been explicitly set on this element displayName =3D e.displayName; } else if (_valFormDisplayNames[e.name] && e.type !=3D "radio" && = e.type !=3D "checkbox") { // displayName has been read from a label that targets this = element with the for attribute displayName =3D _valFormDisplayNames[e.name]; } else if (e.parentNode.nodeName =3D=3D 'LABEL' && e.type !=3D = "radio" && e.type !=3D "checkbox") { // read display name from the element's parent, which is a label displayName =3D getLabelText(e.parentNode, e); } else { // use the elements's name, capitalising the first letter displayName =3D e.name.substr(0,1).toUpperCase() + = e.name.substr(1); } // Create a span containing the error message and place it after = the form element var span =3D document.createElement('span'); span.innerHTML =3D ' ' + msg + ''; // A container for error messages can be provided by giving an = element the appropriate id. var errorContainer =3D document.getElementById(e.name + = 'ValErrors'); if (errorContainer) { errorContainer.insertBefore(span, errorContainer.firstChild); _valFormErrorMessages.push(span); } else if (e.type !=3D "radio" && e.type !=3D "checkbox") { // You can't put the message after a radio button or checkbox, = as it needs to go after the group of buttons e.parentNode.insertBefore(span, e.nextSibling); _valFormErrorMessages.push(span); } if (e.type !=3D "radio" && e.type !=3D "checkbox") { // These must be set separately, or you completely lose the = border when resetting the style in IE e.style.borderColor =3D 'red'; e.style.borderStyle =3D 'solid'; e.style.borderWidth =3D '1px'; } errorFields.push(displayName); } errorsFound =3D true; } if (reportErrors) { // Clear any existing error messages from previous attempts errorFields =3D []; while (_valFormErrorMessages.length) { var errorMessage =3D _valFormErrorMessages.pop(); if (errorMessage.previousSibling) { // Assume previousSibling is the form element and reset its = style errorMessage.previousSibling.style.borderColor =3D ''; errorMessage.previousSibling.style.borderStyle =3D ''; errorMessage.previousSibling.style.borderWidth =3D ''; } errorMessage.parentNode.removeChild(errorMessage); } // Build a hash that maps an element's name to its display text. = This is only done // for elements that are labelled by labels that have a for = attribute // Only do this the first time validateForm is called for this page. = This could cause problems // if people are dynamically manipulating their labels! if (_valFormDisplayNames =3D=3D null) { var labels =3D document.getElementsByTagName('label'); _valFormDisplayNames =3D new Object(); for (var i =3D 0; i < labels.length; i++) { l =3D labels[i]; if (l.htmlFor && document.getElementById(l.htmlFor)) { _valFormDisplayNames[document.getElementById(l.htmlFor).name] = =3D getLabelText(l); } } } } // Get the elements to check var elements; if (e =3D=3D null) { elements =3D f.elements; } else { elements =3D [e]; } // Check the form fields for (var i =3D 0; i < elements.length; i++) { var msg =3D []; // Array of error messages for this element var e =3D elements[i]; var optional =3D e.optional || f.allOptional; // every element in = the form can be made optional by setting form.allOptional =3D true // Some conditions imply others e.numeric =3D e.numeric || e.min !=3D null || e.max !=3D null || = e.integer !=3D null || e.positive !=3D null || e.natural !=3D null; e.date =3D e.date || e.minDate || e.maxDate; e.time =3D e.time || e.minTime || e.maxTime; if (! e.disabled) { // Text fields if (e.type =3D=3D 'text' || e.type =3D=3D "password" || e.type = =3D=3D "textarea" || e.type =3D=3D "file") { var empty =3D ! e.value.search(/^\s*$/); // Numeric elements if (e.numeric) { if (! (empty && optional)) { var v =3D new Number(e.value); if (empty || isNaN(v) || (e.min !=3D null && v < e.min) || (e.max !=3D null && v > e.max) || (e.exmin !=3D null && v <=3D e.exmin) || (e.exmax !=3D null && v >=3D e.exmax) || ((e.positive || e.natural) && v < 0) || ((e.integer || e.natural) && e.value.search(/\./) = !=3D -1)) { msg[0] =3D "must be a"; if (e.positive || e.natural) { msg[0] +=3D " positive"; } if (e.integer || e.natural) { msg[0] +=3D " whole"; } msg[0] +=3D " number"; if (e.min !=3D null && e.max !=3D null) { msg[0] +=3D " between " + e.min + " and " + e.max + ", = inclusive"; } else if (e.min !=3D null) { msg[0] +=3D " that is greater than or equal to " + = e.min; } else if (e.max !=3D null) { msg[0] +=3D " that is less than or equal to " + e.max; } if (e.exmin !=3D null && e.exmax !=3D null) { msg[0] +=3D " between " + e.exmin + " and " + e.exmax + = ", exclusive"; } else if (e.exmin !=3D null) { msg[0] +=3D " that is greater than " + e.exmin; } else if (e.exmax !=3D null) { msg[0] +=3D " that is less than " + e.exmax; } } } // Date elements } else if (e.date) { if (! (empty && optional)) { if (e.minDate =3D=3D "today" || e.maxDate =3D=3D "today") { // minDate & maxDate can be set to the special string = "today" var today =3D new Date(); // Throw away the hours, mins secs etc today =3D new Date(today.getFullYear(), today.getMonth(), = today.getDate()); var todayStr =3D today.getDate() + '/' + (today.getMonth() = + 1) + '/' + today.getFullYear(); } if (e.maxDate) { if (e.maxDate =3D=3D 'today') { var maxDate =3D today; } else { maxDate =3D e.maxDate.split("/"); maxDate =3D new Date(maxDate[2], maxDate[1] - 1, = maxDate[0]); } } if (e.minDate) { if (e.minDate =3D=3D 'today') { var minDate =3D today; } else { var minDate =3D e.minDate.split("/"); minDate =3D new Date(minDate[2], minDate[1] - 1, = minDate[0]); } } var dateArray =3D e.value.split("/"); if (dateArray.length !=3D 3 || dateArray[2].length !=3D 4 || dateArray[0] > 31 || dateArray[0] < 1 || dateArray[1] > 12 || dateArray[1] < 1 || isNaN(date =3D new Date(dateArray[2], dateArray[1] - = 1, dateArray[0])) || date.getDate() !=3D dateArray[0] // Check the actual = date is valid e.g. reject 31/09/2002 || e.maxDate && ((maxDate.getTime() - date.getTime()) / = 86400000) < 0 // 1000*60*60*24 || e.minDate && ((minDate.getTime() - date.getTime()) / = 86400000) > 0) { msg[0] =3D "must be a valid date in d/m/yyyy format"; if (e.minDate) { msg[0] +=3D " that cannot be before " + e.minDate; if (e.minDate =3D=3D 'today') { msg[0] +=3D " (" + todayStr + ")"; } if (e.maxDate) { msg[0] +=3D " and cannot be after " + e.maxDate; if (e.maxDate =3D=3D 'today') { msg[0] +=3D " (" + todayStr + ")"; } } } else if (e.maxDate) { msg[0] +=3D " that cannot be after " + e.maxDate; if (e.maxDate =3D=3D 'today') { msg[0] +=3D " (" + todayStr + ")"; } } } } // Time elements } else if (e.time) { if (! (empty && optional)) { if (e.minTime =3D=3D "now" || e.maxTime =3D=3D "now") { // minTime & maxTime can be set to the special string = "now" var now =3D new Date(); // Throw away the hours, mins secs etc now =3D new Date(0, 0, 0, now.getHours(), = now.getMinutes()); nowStr =3D now.getHours() + ":"; if (now.getMinutes < 10) { nowStr +=3D "0"; } nowStr +=3D now.getMinutes(); } if (e.maxTime) { if (e.maxTime =3D=3D "now") { var maxTime =3D now; var maxTimeStr =3D "the current time (" + nowStr + ")"; } else { maxTime =3D e.maxTime.split(":"); maxTime =3D new Date(0, 0, 0, maxTime[0], maxTime[1]); maxTimeStr =3D e.maxTime; } } if (e.minTime) { if (e.minTime =3D=3D "now") { var minTime =3D now; var minTimeStr =3D "the current time (" + nowStr + ")"; } else { minTime =3D e.minTime.split(":"); minTime =3D new Date(0, 0, 0, minTime[0], minTime[1]); minTimeStr =3D e.minTime; } } var timeArray =3D e.value.split(":"); if (timeArray.length !=3D 2 || timeArray[1].length !=3D 2 || timeArray[0] < 0 || timeArray[0] > 23 || timeArray[1] < 0 || timeArray[1] > 59 || isNaN(time =3D new Date(0, 0, 0, timeArray[0], = timeArray[1])) || e.maxTime && (maxTime.getTime() - time.getTime()) < 0 || e.minTime && (minTime.getTime() - time.getTime()) > = 0) { msg[0] =3D "must be a valid time in hh:mm format" if (e.minTime) { msg[0] +=3D " that cannot be before " + minTimeStr; if (e.maxTime) { msg[0] +=3D " and cannot be after " + maxTimeStr; } } else if (e.maxTime) { msg[0] +=3D " that cannot be after " + maxTimeStr; } } } // Email addresses (only checks that it at least looks like an = email address!) } else if (e.email) { if (! (empty && optional) && = e.value.search(/^[^@]+@[A-Za-z0-9-.]+\.[A-Za-z0-9-]+$/) =3D=3D -1) { msg[0] =3D "must be an email address"; } // validation against a supplied javascript regular expression } else if (typeof e.regex =3D=3D 'object') { // e.regex should be an object two properties: // regex - a RegExp object // msg - a string to display if the regex isn't found if (! (empty && optional) && e.value.search(e.regex.regex) = =3D=3D -1) { msg[0] =3D e.regex.msg; } // All other elements } else if (empty && ! optional) { msg[0] =3D "must not be left empty"; } // Do checks that can apply on top of the previous ones // Text/numeric elements with a minimum length. if (! (empty && optional)) { if (e.minLength && (msg.length || e.value.length < = e.minLength)) { var pos =3D msg.length; msg[pos] =3D "must be at least " + e.minLength; if (e.numeric) { msg[pos] +=3D " digits long"; } else { msg[pos] +=3D " characters long"; } } // Text/numeric elements with a maximum length (IE defaults = this to 2147483647, Mozilla to -1) if (e.maxLength > 0 && e.maxLength < 2147483647 && (msg.length = || e.value.length > e.maxLength)) { var pos =3D msg.length; msg[pos] =3D "cannot be longer than " + e.maxLength; if (e.numeric) { msg[pos] +=3D " digits"; } else { msg[pos] +=3D " characters"; } } } // Radio buttons } else if (e.type =3D=3D "radio") { // This is one of a group of radio buttons, so get the group. = Attributes for radio // buttons are set on the first member of the group var radioGroup =3D eval('f.' + e.name); // Only run checks if this is the first radio in the group (this = will check the whole group) if (radioGroup[0] =3D=3D e && ! optional) { var radioChecked =3D false; for (var j=3D0; j < radioGroup.length; j++) { if (radioGroup[j].checked) { radioChecked =3D true; break; } } if (! radioChecked) { msg[0] =3D "please tick one"; } } // Checkboxes } else if (e.type =3D=3D "checkbox") { // As with radio buttons, this could be one of a group of = checkboxes. If it's only one, we don't care about it var checkGroup =3D eval('f.' + e.name); if (checkGroup[0] =3D=3D e && (! optional || e.min || e.max)) { if (! optional && ! e.min) { e.min =3D 1; } var numChecked =3D 0; for (var j=3D0; j < checkGroup.length; j++) { if (checkGroup[j].checked) { numChecked +=3D 1; } } if (! f.allOptional || numChecked > 0) { if ((e.min && numChecked < e.min) || (e.max && numChecked > = e.max)) { if (e.min =3D=3D e.max) { msg[0] =3D "exactly " + e.min; } else { msg[0] =3D ""; if (e.min) { msg[0] +=3D "at least " + e.min; if (e.max) { msg[0] +=3D ", and "; } } if (e.max) { msg[0] +=3D "no more than " + e.max; } } if (e.min > 1 || e.max > 1) { msg[0] +=3D " boxes "; } else { msg[0] +=3D " box "; } msg[0] +=3D "must be ticked"; } } } // Selects (only when multiple selection is not allowed) } else if (e.type =3D=3D "select-one") { // Assume that the first entry in the select box is something = like "-- Please Select --" if (! optional && e.selectedIndex =3D=3D 0) { msg[0] =3D "please select one"; } } // Call custom validation function (on top of other validation!). = To disable the standard validation checks // before this, the element should be marked as optional if (e.valFunction) { var newMsg =3D e.valFunction(e, msg, optional, f.allOptional); msg =3D []; // valFunction can choose to discard all previous = messages if (typeof newMsg =3D=3D 'object') { msg =3D newMsg; } } // Concatenate error messages in a language natural way and = display them if (msg.length) { var errorMsg =3D msg[0]; if (msg.length > 1) { for (var j =3D 1; j < msg.length - 1; j++) { errorMsg +=3D ", " + msg[j]; } errorMsg +=3D " and " + msg[msg.length - 1]; } reportError(e, errorMsg); } } } if (reportErrors && errorsFound) { var errorText =3D 'This form could not be submitted as the following = fields had errors:\n'; for (var i =3D 0; i < errorFields.length; i++) { errorText +=3D '\n' + errorFields[i]; } errorText +=3D '\n\nPlease correct the errors and try again.'; alert(errorText); } return ! errorsFound; } ------=_NextPart_000_0010_01C9AAD4.224A8EB0 Content-Type: application/octet-stream Content-Transfer-Encoding: quoted-printable Content-Location: https://secure.csl.gov.uk/library/scriptaculous/prototype.js /* Prototype JavaScript framework, version 1.6.0.2=0A= * (c) 2005-2008 Sam Stephenson=0A= *=0A= * Prototype is freely distributable under the terms of an MIT-style = license.=0A= * For details, see the Prototype web site: http://www.prototypejs.org/=0A= *=0A= = *------------------------------------------------------------------------= --*/=0A= =0A= var Prototype =3D {=0A= Version: '1.6.0.2',=0A= =0A= Browser: {=0A= IE: !!(window.attachEvent && !window.opera),=0A= Opera: !!window.opera,=0A= WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,=0A= Gecko: navigator.userAgent.indexOf('Gecko') > -1 && = navigator.userAgent.indexOf('KHTML') =3D=3D -1,=0A= MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/)=0A= },=0A= =0A= BrowserFeatures: {=0A= XPath: !!document.evaluate,=0A= ElementExtensions: !!window.HTMLElement,=0A= SpecificElementExtensions:=0A= document.createElement('div').__proto__ &&=0A= document.createElement('div').__proto__ !=3D=3D=0A= document.createElement('form').__proto__=0A= },=0A= =0A= ScriptFragment: ']*>([\\S\\s]*?)<\/script>',=0A= JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/,=0A= =0A= emptyFunction: function() { },=0A= K: function(x) { return x }=0A= };=0A= =0A= if (Prototype.Browser.MobileSafari)=0A= Prototype.BrowserFeatures.SpecificElementExtensions =3D false;=0A= =0A= =0A= /* Based on Alex Arnell's inheritance implementation. */=0A= var Class =3D {=0A= create: function() {=0A= var parent =3D null, properties =3D $A(arguments);=0A= if (Object.isFunction(properties[0]))=0A= parent =3D properties.shift();=0A= =0A= function klass() {=0A= this.initialize.apply(this, arguments);=0A= }=0A= =0A= Object.extend(klass, Class.Methods);=0A= klass.superclass =3D parent;=0A= klass.subclasses =3D [];=0A= =0A= if (parent) {=0A= var subclass =3D function() { };=0A= subclass.prototype =3D parent.prototype;=0A= klass.prototype =3D new subclass;=0A= parent.subclasses.push(klass);=0A= }=0A= =0A= for (var i =3D 0; i < properties.length; i++)=0A= klass.addMethods(properties[i]);=0A= =0A= if (!klass.prototype.initialize)=0A= klass.prototype.initialize =3D Prototype.emptyFunction;=0A= =0A= klass.prototype.constructor =3D klass;=0A= =0A= return klass;=0A= }=0A= };=0A= =0A= Class.Methods =3D {=0A= addMethods: function(source) {=0A= var ancestor =3D this.superclass && this.superclass.prototype;=0A= var properties =3D Object.keys(source);=0A= =0A= if (!Object.keys({ toString: true }).length)=0A= properties.push("toString", "valueOf");=0A= =0A= for (var i =3D 0, length =3D properties.length; i < length; i++) {=0A= var property =3D properties[i], value =3D source[property];=0A= if (ancestor && Object.isFunction(value) &&=0A= value.argumentNames().first() =3D=3D "$super") {=0A= var method =3D value, value =3D Object.extend((function(m) {=0A= return function() { return ancestor[m].apply(this, arguments) = };=0A= })(property).wrap(method), {=0A= valueOf: function() { return method },=0A= toString: function() { return method.toString() }=0A= });=0A= }=0A= this.prototype[property] =3D value;=0A= }=0A= =0A= return this;=0A= }=0A= };=0A= =0A= var Abstract =3D { };=0A= =0A= Object.extend =3D function(destination, source) {=0A= for (var property in source)=0A= destination[property] =3D source[property];=0A= return destination;=0A= };=0A= =0A= Object.extend(Object, {=0A= inspect: function(object) {=0A= try {=0A= if (Object.isUndefined(object)) return 'undefined';=0A= if (object =3D=3D=3D null) return 'null';=0A= return object.inspect ? object.inspect() : String(object);=0A= } catch (e) {=0A= if (e instanceof RangeError) return '...';=0A= throw e;=0A= }=0A= },=0A= =0A= toJSON: function(object) {=0A= var type =3D typeof object;=0A= switch (type) {=0A= case 'undefined':=0A= case 'function':=0A= case 'unknown': return;=0A= case 'boolean': return object.toString();=0A= }=0A= =0A= if (object =3D=3D=3D null) return 'null';=0A= if (object.toJSON) return object.toJSON();=0A= if (Object.isElement(object)) return;=0A= =0A= var results =3D [];=0A= for (var property in object) {=0A= var value =3D Object.toJSON(object[property]);=0A= if (!Object.isUndefined(value))=0A= results.push(property.toJSON() + ': ' + value);=0A= }=0A= =0A= return '{' + results.join(', ') + '}';=0A= },=0A= =0A= toQueryString: function(object) {=0A= return $H(object).toQueryString();=0A= },=0A= =0A= toHTML: function(object) {=0A= return object && object.toHTML ? object.toHTML() : = String.interpret(object);=0A= },=0A= =0A= keys: function(object) {=0A= var keys =3D [];=0A= for (var property in object)=0A= keys.push(property);=0A= return keys;=0A= },=0A= =0A= values: function(object) {=0A= var values =3D [];=0A= for (var property in object)=0A= values.push(object[property]);=0A= return values;=0A= },=0A= =0A= clone: function(object) {=0A= return Object.extend({ }, object);=0A= },=0A= =0A= isElement: function(object) {=0A= return object && object.nodeType =3D=3D 1;=0A= },=0A= =0A= isArray: function(object) {=0A= return object !=3D null && typeof object =3D=3D "object" &&=0A= 'splice' in object && 'join' in object;=0A= },=0A= =0A= isHash: function(object) {=0A= return object instanceof Hash;=0A= },=0A= =0A= isFunction: function(object) {=0A= return typeof object =3D=3D "function";=0A= },=0A= =0A= isString: function(object) {=0A= return typeof object =3D=3D "string";=0A= },=0A= =0A= isNumber: function(object) {=0A= return typeof object =3D=3D "number";=0A= },=0A= =0A= isUndefined: function(object) {=0A= return typeof object =3D=3D "undefined";=0A= }=0A= });=0A= =0A= Object.extend(Function.prototype, {=0A= argumentNames: function() {=0A= var names =3D = this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").inv= oke("strip");=0A= return names.length =3D=3D 1 && !names[0] ? [] : names;=0A= },=0A= =0A= bind: function() {=0A= if (arguments.length < 2 && Object.isUndefined(arguments[0])) return = this;=0A= var __method =3D this, args =3D $A(arguments), object =3D = args.shift();=0A= return function() {=0A= return __method.apply(object, args.concat($A(arguments)));=0A= }=0A= },=0A= =0A= bindAsEventListener: function() {=0A= var __method =3D this, args =3D $A(arguments), object =3D = args.shift();=0A= return function(event) {=0A= return __method.apply(object, [event || = window.event].concat(args));=0A= }=0A= },=0A= =0A= curry: function() {=0A= if (!arguments.length) return this;=0A= var __method =3D this, args =3D $A(arguments);=0A= return function() {=0A= return __method.apply(this, args.concat($A(arguments)));=0A= }=0A= },=0A= =0A= delay: function() {=0A= var __method =3D this, args =3D $A(arguments), timeout =3D = args.shift() * 1000;=0A= return window.setTimeout(function() {=0A= return __method.apply(__method, args);=0A= }, timeout);=0A= },=0A= =0A= wrap: function(wrapper) {=0A= var __method =3D this;=0A= return function() {=0A= return wrapper.apply(this, = [__method.bind(this)].concat($A(arguments)));=0A= }=0A= },=0A= =0A= methodize: function() {=0A= if (this._methodized) return this._methodized;=0A= var __method =3D this;=0A= return this._methodized =3D function() {=0A= return __method.apply(null, [this].concat($A(arguments)));=0A= };=0A= }=0A= });=0A= =0A= Function.prototype.defer =3D Function.prototype.delay.curry(0.01);=0A= =0A= Date.prototype.toJSON =3D function() {=0A= return '"' + this.getUTCFullYear() + '-' +=0A= (this.getUTCMonth() + 1).toPaddedString(2) + '-' +=0A= this.getUTCDate().toPaddedString(2) + 'T' +=0A= this.getUTCHours().toPaddedString(2) + ':' +=0A= this.getUTCMinutes().toPaddedString(2) + ':' +=0A= this.getUTCSeconds().toPaddedString(2) + 'Z"';=0A= };=0A= =0A= var Try =3D {=0A= these: function() {=0A= var returnValue;=0A= =0A= for (var i =3D 0, length =3D arguments.length; i < length; i++) {=0A= var lambda =3D arguments[i];=0A= try {=0A= returnValue =3D lambda();=0A= break;=0A= } catch (e) { }=0A= }=0A= =0A= return returnValue;=0A= }=0A= };=0A= =0A= RegExp.prototype.match =3D RegExp.prototype.test;=0A= =0A= RegExp.escape =3D function(str) {=0A= return String(str).replace(/([.*+?^=3D!:${}()|[\]\/\\])/g, '\\$1');=0A= };=0A= =0A= /*-----------------------------------------------------------------------= ---*/=0A= =0A= var PeriodicalExecuter =3D Class.create({=0A= initialize: function(callback, frequency) {=0A= this.callback =3D callback;=0A= this.frequency =3D frequency;=0A= this.currentlyExecuting =3D false;=0A= =0A= this.registerCallback();=0A= },=0A= =0A= registerCallback: function() {=0A= this.timer =3D setInterval(this.onTimerEvent.bind(this), = this.frequency * 1000);=0A= },=0A= =0A= execute: function() {=0A= this.callback(this);=0A= },=0A= =0A= stop: function() {=0A= if (!this.timer) return;=0A= clearInterval(this.timer);=0A= this.timer =3D null;=0A= },=0A= =0A= onTimerEvent: function() {=0A= if (!this.currentlyExecuting) {=0A= try {=0A= this.currentlyExecuting =3D true;=0A= this.execute();=0A= } finally {=0A= this.currentlyExecuting =3D false;=0A= }=0A= }=0A= }=0A= });=0A= Object.extend(String, {=0A= interpret: function(value) {=0A= return value =3D=3D null ? '' : String(value);=0A= },=0A= specialChar: {=0A= '\b': '\\b',=0A= '\t': '\\t',=0A= '\n': '\\n',=0A= '\f': '\\f',=0A= '\r': '\\r',=0A= '\\': '\\\\'=0A= }=0A= });=0A= =0A= Object.extend(String.prototype, {=0A= gsub: function(pattern, replacement) {=0A= var result =3D '', source =3D this, match;=0A= replacement =3D arguments.callee.prepareReplacement(replacement);=0A= =0A= while (source.length > 0) {=0A= if (match =3D source.match(pattern)) {=0A= result +=3D source.slice(0, match.index);=0A= result +=3D String.interpret(replacement(match));=0A= source =3D source.slice(match.index + match[0].length);=0A= } else {=0A= result +=3D source, source =3D '';=0A= }=0A= }=0A= return result;=0A= },=0A= =0A= sub: function(pattern, replacement, count) {=0A= replacement =3D this.gsub.prepareReplacement(replacement);=0A= count =3D Object.isUndefined(count) ? 1 : count;=0A= =0A= return this.gsub(pattern, function(match) {=0A= if (--count < 0) return match[0];=0A= return replacement(match);=0A= });=0A= },=0A= =0A= scan: function(pattern, iterator) {=0A= this.gsub(pattern, iterator);=0A= return String(this);=0A= },=0A= =0A= truncate: function(length, truncation) {=0A= length =3D length || 30;=0A= truncation =3D Object.isUndefined(truncation) ? '...' : truncation;=0A= return this.length > length ?=0A= this.slice(0, length - truncation.length) + truncation : = String(this);=0A= },=0A= =0A= strip: function() {=0A= return this.replace(/^\s+/, '').replace(/\s+$/, '');=0A= },=0A= =0A= stripTags: function() {=0A= return this.replace(/<\/?[^>]+>/gi, '');=0A= },=0A= =0A= stripScripts: function() {=0A= return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');=0A= },=0A= =0A= extractScripts: function() {=0A= var matchAll =3D new RegExp(Prototype.ScriptFragment, 'img');=0A= var matchOne =3D new RegExp(Prototype.ScriptFragment, 'im');=0A= return (this.match(matchAll) || []).map(function(scriptTag) {=0A= return (scriptTag.match(matchOne) || ['', ''])[1];=0A= });=0A= },=0A= =0A= evalScripts: function() {=0A= return this.extractScripts().map(function(script) { return = eval(script) });=0A= },=0A= =0A= escapeHTML: function() {=0A= var self =3D arguments.callee;=0A= self.text.data =3D this;=0A= return self.div.innerHTML;=0A= },=0A= =0A= unescapeHTML: function() {=0A= var div =3D new Element('div');=0A= div.innerHTML =3D this.stripTags();=0A= return div.childNodes[0] ? (div.childNodes.length > 1 ?=0A= $A(div.childNodes).inject('', function(memo, node) { return = memo+node.nodeValue }) :=0A= div.childNodes[0].nodeValue) : '';=0A= },=0A= =0A= toQueryParams: function(separator) {=0A= var match =3D this.strip().match(/([^?#]*)(#.*)?$/);=0A= if (!match) return { };=0A= =0A= return match[1].split(separator || '&').inject({ }, function(hash, = pair) {=0A= if ((pair =3D pair.split('=3D'))[0]) {=0A= var key =3D decodeURIComponent(pair.shift());=0A= var value =3D pair.length > 1 ? pair.join('=3D') : pair[0];=0A= if (value !=3D undefined) value =3D decodeURIComponent(value);=0A= =0A= if (key in hash) {=0A= if (!Object.isArray(hash[key])) hash[key] =3D [hash[key]];=0A= hash[key].push(value);=0A= }=0A= else hash[key] =3D value;=0A= }=0A= return hash;=0A= });=0A= },=0A= =0A= toArray: function() {=0A= return this.split('');=0A= },=0A= =0A= succ: function() {=0A= return this.slice(0, this.length - 1) +=0A= String.fromCharCode(this.charCodeAt(this.length - 1) + 1);=0A= },=0A= =0A= times: function(count) {=0A= return count < 1 ? '' : new Array(count + 1).join(this);=0A= },=0A= =0A= camelize: function() {=0A= var parts =3D this.split('-'), len =3D parts.length;=0A= if (len =3D=3D 1) return parts[0];=0A= =0A= var camelized =3D this.charAt(0) =3D=3D '-'=0A= ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1)=0A= : parts[0];=0A= =0A= for (var i =3D 1; i < len; i++)=0A= camelized +=3D parts[i].charAt(0).toUpperCase() + = parts[i].substring(1);=0A= =0A= return camelized;=0A= },=0A= =0A= capitalize: function() {=0A= return this.charAt(0).toUpperCase() + = this.substring(1).toLowerCase();=0A= },=0A= =0A= underscore: function() {=0A= return this.gsub(/::/, = '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{= 1}_#{2}').gsub(/-/,'_').toLowerCase();=0A= },=0A= =0A= dasherize: function() {=0A= return this.gsub(/_/,'-');=0A= },=0A= =0A= inspect: function(useDoubleQuotes) {=0A= var escapedString =3D this.gsub(/[\x00-\x1f\\]/, function(match) {=0A= var character =3D String.specialChar[match[0]];=0A= return character ? character : '\\u00' + = match[0].charCodeAt().toPaddedString(2, 16);=0A= });=0A= if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') = + '"';=0A= return "'" + escapedString.replace(/'/g, '\\\'') + "'";=0A= },=0A= =0A= toJSON: function() {=0A= return this.inspect(true);=0A= },=0A= =0A= unfilterJSON: function(filter) {=0A= return this.sub(filter || Prototype.JSONFilter, '#{1}');=0A= },=0A= =0A= isJSON: function() {=0A= var str =3D this;=0A= if (str.blank()) return false;=0A= str =3D this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, '');=0A= return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);=0A= },=0A= =0A= evalJSON: function(sanitize) {=0A= var json =3D this.unfilterJSON();=0A= try {=0A= if (!sanitize || json.isJSON()) return eval('(' + json + ')');=0A= } catch (e) { }=0A= throw new SyntaxError('Badly formed JSON string: ' + this.inspect());=0A= },=0A= =0A= include: function(pattern) {=0A= return this.indexOf(pattern) > -1;=0A= },=0A= =0A= startsWith: function(pattern) {=0A= return this.indexOf(pattern) =3D=3D=3D 0;=0A= },=0A= =0A= endsWith: function(pattern) {=0A= var d =3D this.length - pattern.length;=0A= return d >=3D 0 && this.lastIndexOf(pattern) =3D=3D=3D d;=0A= },=0A= =0A= empty: function() {=0A= return this =3D=3D '';=0A= },=0A= =0A= blank: function() {=0A= return /^\s*$/.test(this);=0A= },=0A= =0A= interpolate: function(object, pattern) {=0A= return new Template(this, pattern).evaluate(object);=0A= }=0A= });=0A= =0A= if (Prototype.Browser.WebKit || Prototype.Browser.IE) = Object.extend(String.prototype, {=0A= escapeHTML: function() {=0A= return = this.replace(/&/g,'&').replace(//g,'>');=0A= },=0A= unescapeHTML: function() {=0A= return = this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');=0A= }=0A= });=0A= =0A= String.prototype.gsub.prepareReplacement =3D function(replacement) {=0A= if (Object.isFunction(replacement)) return replacement;=0A= var template =3D new Template(replacement);=0A= return function(match) { return template.evaluate(match) };=0A= };=0A= =0A= String.prototype.parseQuery =3D String.prototype.toQueryParams;=0A= =0A= Object.extend(String.prototype.escapeHTML, {=0A= div: document.createElement('div'),=0A= text: document.createTextNode('')=0A= });=0A= =0A= with (String.prototype.escapeHTML) div.appendChild(text);=0A= =0A= var Template =3D Class.create({=0A= initialize: function(template, pattern) {=0A= this.template =3D template.toString();=0A= this.pattern =3D pattern || Template.Pattern;=0A= },=0A= =0A= evaluate: function(object) {=0A= if (Object.isFunction(object.toTemplateReplacements))=0A= object =3D object.toTemplateReplacements();=0A= =0A= return this.template.gsub(this.pattern, function(match) {=0A= if (object =3D=3D null) return '';=0A= =0A= var before =3D match[1] || '';=0A= if (before =3D=3D '\\') return match[2];=0A= =0A= var ctx =3D object, expr =3D match[3];=0A= var pattern =3D /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;=0A= match =3D pattern.exec(expr);=0A= if (match =3D=3D null) return before;=0A= =0A= while (match !=3D null) {=0A= var comp =3D match[1].startsWith('[') ? match[2].gsub('\\\\]', = ']') : match[1];=0A= ctx =3D ctx[comp];=0A= if (null =3D=3D ctx || '' =3D=3D match[3]) break;=0A= expr =3D expr.substring('[' =3D=3D match[3] ? match[1].length : = match[0].length);=0A= match =3D pattern.exec(expr);=0A= }=0A= =0A= return before + String.interpret(ctx);=0A= });=0A= }=0A= });=0A= Template.Pattern =3D /(^|.|\r|\n)(#\{(.*?)\})/;=0A= =0A= var $break =3D { };=0A= =0A= var Enumerable =3D {=0A= each: function(iterator, context) {=0A= var index =3D 0;=0A= iterator =3D iterator.bind(context);=0A= try {=0A= this._each(function(value) {=0A= iterator(value, index++);=0A= });=0A= } catch (e) {=0A= if (e !=3D $break) throw e;=0A= }=0A= return this;=0A= },=0A= =0A= eachSlice: function(number, iterator, context) {=0A= iterator =3D iterator ? iterator.bind(context) : Prototype.K;=0A= var index =3D -number, slices =3D [], array =3D this.toArray();=0A= while ((index +=3D number) < array.length)=0A= slices.push(array.slice(index, index+number));=0A= return slices.collect(iterator, context);=0A= },=0A= =0A= all: function(iterator, context) {=0A= iterator =3D iterator ? iterator.bind(context) : Prototype.K;=0A= var result =3D true;=0A= this.each(function(value, index) {=0A= result =3D result && !!iterator(value, index);=0A= if (!result) throw $break;=0A= });=0A= return result;=0A= },=0A= =0A= any: function(iterator, context) {=0A= iterator =3D iterator ? iterator.bind(context) : Prototype.K;=0A= var result =3D false;=0A= this.each(function(value, index) {=0A= if (result =3D !!iterator(value, index))=0A= throw $break;=0A= });=0A= return result;=0A= },=0A= =0A= collect: function(iterator, context) {=0A= iterator =3D iterator ? iterator.bind(context) : Prototype.K;=0A= var results =3D [];=0A= this.each(function(value, index) {=0A= results.push(iterator(value, index));=0A= });=0A= return results;=0A= },=0A= =0A= detect: function(iterator, context) {=0A= iterator =3D iterator.bind(context);=0A= var result;=0A= this.each(function(value, index) {=0A= if (iterator(value, index)) {=0A= result =3D value;=0A= throw $break;=0A= }=0A= });=0A= return result;=0A= },=0A= =0A= findAll: function(iterator, context) {=0A= iterator =3D iterator.bind(context);=0A= var results =3D [];=0A= this.each(function(value, index) {=0A= if (iterator(value, index))=0A= results.push(value);=0A= });=0A= return results;=0A= },=0A= =0A= grep: function(filter, iterator, context) {=0A= iterator =3D iterator ? iterator.bind(context) : Prototype.K;=0A= var results =3D [];=0A= =0A= if (Object.isString(filter))=0A= filter =3D new RegExp(filter);=0A= =0A= this.each(function(value, index) {=0A= if (filter.match(value))=0A= results.push(iterator(value, index));=0A= });=0A= return results;=0A= },=0A= =0A= include: function(object) {=0A= if (Object.isFunction(this.indexOf))=0A= if (this.indexOf(object) !=3D -1) return true;=0A= =0A= var found =3D false;=0A= this.each(function(value) {=0A= if (value =3D=3D object) {=0A= found =3D true;=0A= throw $break;=0A= }=0A= });=0A= return found;=0A= },=0A= =0A= inGroupsOf: function(number, fillWith) {=0A= fillWith =3D Object.isUndefined(fillWith) ? null : fillWith;=0A= return this.eachSlice(number, function(slice) {=0A= while(slice.length < number) slice.push(fillWith);=0A= return slice;=0A= });=0A= },=0A= =0A= inject: function(memo, iterator, context) {=0A= iterator =3D iterator.bind(context);=0A= this.each(function(value, index) {=0A= memo =3D iterator(memo, value, index);=0A= });=0A= return memo;=0A= },=0A= =0A= invoke: function(method) {=0A= var args =3D $A(arguments).slice(1);=0A= return this.map(function(value) {=0A= return value[method].apply(value, args);=0A= });=0A= },=0A= =0A= max: function(iterator, context) {=0A= iterator =3D iterator ? iterator.bind(context) : Prototype.K;=0A= var result;=0A= this.each(function(value, index) {=0A= value =3D iterator(value, index);=0A= if (result =3D=3D null || value >=3D result)=0A= result =3D value;=0A= });=0A= return result;=0A= },=0A= =0A= min: function(iterator, context) {=0A= iterator =3D iterator ? iterator.bind(context) : Prototype.K;=0A= var result;=0A= this.each(function(value, index) {=0A= value =3D iterator(value, index);=0A= if (result =3D=3D null || value < result)=0A= result =3D value;=0A= });=0A= return result;=0A= },=0A= =0A= partition: function(iterator, context) {=0A= iterator =3D iterator ? iterator.bind(context) : Prototype.K;=0A= var trues =3D [], falses =3D [];=0A= this.each(function(value, index) {=0A= (iterator(value, index) ?=0A= trues : falses).push(value);=0A= });=0A= return [trues, falses];=0A= },=0A= =0A= pluck: function(property) {=0A= var results =3D [];=0A= this.each(function(value) {=0A= results.push(value[property]);=0A= });=0A= return results;=0A= },=0A= =0A= reject: function(iterator, context) {=0A= iterator =3D iterator.bind(context);=0A= var results =3D [];=0A= this.each(function(value, index) {=0A= if (!iterator(value, index))=0A= results.push(value);=0A= });=0A= return results;=0A= },=0A= =0A= sortBy: function(iterator, context) {=0A= iterator =3D iterator.bind(context);=0A= return this.map(function(value, index) {=0A= return {value: value, criteria: iterator(value, index)};=0A= }).sort(function(left, right) {=0A= var a =3D left.criteria, b =3D right.criteria;=0A= return a < b ? -1 : a > b ? 1 : 0;=0A= }).pluck('value');=0A= },=0A= =0A= toArray: function() {=0A= return this.map();=0A= },=0A= =0A= zip: function() {=0A= var iterator =3D Prototype.K, args =3D $A(arguments);=0A= if (Object.isFunction(args.last()))=0A= iterator =3D args.pop();=0A= =0A= var collections =3D [this].concat(args).map($A);=0A= return this.map(function(value, index) {=0A= return iterator(collections.pluck(index));=0A= });=0A= },=0A= =0A= size: function() {=0A= return this.toArray().length;=0A= },=0A= =0A= inspect: function() {=0A= return '#';=0A= }=0A= };=0A= =0A= Object.extend(Enumerable, {=0A= map: Enumerable.collect,=0A= find: Enumerable.detect,=0A= select: Enumerable.findAll,=0A= filter: Enumerable.findAll,=0A= member: Enumerable.include,=0A= entries: Enumerable.toArray,=0A= every: Enumerable.all,=0A= some: Enumerable.any=0A= });=0A= function $A(iterable) {=0A= if (!iterable) return [];=0A= if (iterable.toArray) return iterable.toArray();=0A= var length =3D iterable.length || 0, results =3D new Array(length);=0A= while (length--) results[length] =3D iterable[length];=0A= return results;=0A= }=0A= =0A= if (Prototype.Browser.WebKit) {=0A= $A =3D function(iterable) {=0A= if (!iterable) return [];=0A= if (!(Object.isFunction(iterable) && iterable =3D=3D '[object = NodeList]') &&=0A= iterable.toArray) return iterable.toArray();=0A= var length =3D iterable.length || 0, results =3D new Array(length);=0A= while (length--) results[length] =3D iterable[length];=0A= return results;=0A= };=0A= }=0A= =0A= Array.from =3D $A;=0A= =0A= Object.extend(Array.prototype, Enumerable);=0A= =0A= if (!Array.prototype._reverse) Array.prototype._reverse =3D = Array.prototype.reverse;=0A= =0A= Object.extend(Array.prototype, {=0A= _each: function(iterator) {=0A= for (var i =3D 0, length =3D this.length; i < length; i++)=0A= iterator(this[i]);=0A= },=0A= =0A= clear: function() {=0A= this.length =3D 0;=0A= return this;=0A= },=0A= =0A= first: function() {=0A= return this[0];=0A= },=0A= =0A= last: function() {=0A= return this[this.length - 1];=0A= },=0A= =0A= compact: function() {=0A= return this.select(function(value) {=0A= return value !=3D null;=0A= });=0A= },=0A= =0A= flatten: function() {=0A= return this.inject([], function(array, value) {=0A= return array.concat(Object.isArray(value) ?=0A= value.flatten() : [value]);=0A= });=0A= },=0A= =0A= without: function() {=0A= var values =3D $A(arguments);=0A= return this.select(function(value) {=0A= return !values.include(value);=0A= });=0A= },=0A= =0A= reverse: function(inline) {=0A= return (inline !=3D=3D false ? this : this.toArray())._reverse();=0A= },=0A= =0A= reduce: function() {=0A= return this.length > 1 ? this : this[0];=0A= },=0A= =0A= uniq: function(sorted) {=0A= return this.inject([], function(array, value, index) {=0A= if (0 =3D=3D index || (sorted ? array.last() !=3D value : = !array.include(value)))=0A= array.push(value);=0A= return array;=0A= });=0A= },=0A= =0A= intersect: function(array) {=0A= return this.uniq().findAll(function(item) {=0A= return array.detect(function(value) { return item =3D=3D=3D value = });=0A= });=0A= },=0A= =0A= clone: function() {=0A= return [].concat(this);=0A= },=0A= =0A= size: function() {=0A= return this.length;=0A= },=0A= =0A= inspect: function() {=0A= return '[' + this.map(Object.inspect).join(', ') + ']';=0A= },=0A= =0A= toJSON: function() {=0A= var results =3D [];=0A= this.each(function(object) {=0A= var value =3D Object.toJSON(object);=0A= if (!Object.isUndefined(value)) results.push(value);=0A= });=0A= return '[' + results.join(', ') + ']';=0A= }=0A= });=0A= =0A= // use native browser JS 1.6 implementation if available=0A= if (Object.isFunction(Array.prototype.forEach))=0A= Array.prototype._each =3D Array.prototype.forEach;=0A= =0A= if (!Array.prototype.indexOf) Array.prototype.indexOf =3D function(item, = i) {=0A= i || (i =3D 0);=0A= var length =3D this.length;=0A= if (i < 0) i =3D length + i;=0A= for (; i < length; i++)=0A= if (this[i] =3D=3D=3D item) return i;=0A= return -1;=0A= };=0A= =0A= if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf =3D = function(item, i) {=0A= i =3D isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1;=0A= var n =3D this.slice(0, i).reverse().indexOf(item);=0A= return (n < 0) ? n : i - n - 1;=0A= };=0A= =0A= Array.prototype.toArray =3D Array.prototype.clone;=0A= =0A= function $w(string) {=0A= if (!Object.isString(string)) return [];=0A= string =3D string.strip();=0A= return string ? string.split(/\s+/) : [];=0A= }=0A= =0A= if (Prototype.Browser.Opera){=0A= Array.prototype.concat =3D function() {=0A= var array =3D [];=0A= for (var i =3D 0, length =3D this.length; i < length; i++) = array.push(this[i]);=0A= for (var i =3D 0, length =3D arguments.length; i < length; i++) {=0A= if (Object.isArray(arguments[i])) {=0A= for (var j =3D 0, arrayLength =3D arguments[i].length; j < = arrayLength; j++)=0A= array.push(arguments[i][j]);=0A= } else {=0A= array.push(arguments[i]);=0A= }=0A= }=0A= return array;=0A= };=0A= }=0A= Object.extend(Number.prototype, {=0A= toColorPart: function() {=0A= return this.toPaddedString(2, 16);=0A= },=0A= =0A= succ: function() {=0A= return this + 1;=0A= },=0A= =0A= times: function(iterator) {=0A= $R(0, this, true).each(iterator);=0A= return this;=0A= },=0A= =0A= toPaddedString: function(length, radix) {=0A= var string =3D this.toString(radix || 10);=0A= return '0'.times(length - string.length) + string;=0A= },=0A= =0A= toJSON: function() {=0A= return isFinite(this) ? this.toString() : 'null';=0A= }=0A= });=0A= =0A= $w('abs round ceil floor').each(function(method){=0A= Number.prototype[method] =3D Math[method].methodize();=0A= });=0A= function $H(object) {=0A= return new Hash(object);=0A= };=0A= =0A= var Hash =3D Class.create(Enumerable, (function() {=0A= =0A= function toQueryPair(key, value) {=0A= if (Object.isUndefined(value)) return key;=0A= return key + '=3D' + encodeURIComponent(String.interpret(value));=0A= }=0A= =0A= return {=0A= initialize: function(object) {=0A= this._object =3D Object.isHash(object) ? object.toObject() : = Object.clone(object);=0A= },=0A= =0A= _each: function(iterator) {=0A= for (var key in this._object) {=0A= var value =3D this._object[key], pair =3D [key, value];=0A= pair.key =3D key;=0A= pair.value =3D value;=0A= iterator(pair);=0A= }=0A= },=0A= =0A= set: function(key, value) {=0A= return this._object[key] =3D value;=0A= },=0A= =0A= get: function(key) {=0A= return this._object[key];=0A= },=0A= =0A= unset: function(key) {=0A= var value =3D this._object[key];=0A= delete this._object[key];=0A= return value;=0A= },=0A= =0A= toObject: function() {=0A= return Object.clone(this._object);=0A= },=0A= =0A= keys: function() {=0A= return this.pluck('key');=0A= },=0A= =0A= values: function() {=0A= return this.pluck('value');=0A= },=0A= =0A= index: function(value) {=0A= var match =3D this.detect(function(pair) {=0A= return pair.value =3D=3D=3D value;=0A= });=0A= return match && match.key;=0A= },=0A= =0A= merge: function(object) {=0A= return this.clone().update(object);=0A= },=0A= =0A= update: function(object) {=0A= return new Hash(object).inject(this, function(result, pair) {=0A= result.set(pair.key, pair.value);=0A= return result;=0A= });=0A= },=0A= =0A= toQueryString: function() {=0A= return this.map(function(pair) {=0A= var key =3D encodeURIComponent(pair.key), values =3D pair.value;=0A= =0A= if (values && typeof values =3D=3D 'object') {=0A= if (Object.isArray(values))=0A= return values.map(toQueryPair.curry(key)).join('&');=0A= }=0A= return toQueryPair(key, values);=0A= }).join('&');=0A= },=0A= =0A= inspect: function() {=0A= return '#';=0A= },=0A= =0A= toJSON: function() {=0A= return Object.toJSON(this.toObject());=0A= },=0A= =0A= clone: function() {=0A= return new Hash(this);=0A= }=0A= }=0A= })());=0A= =0A= Hash.prototype.toTemplateReplacements =3D Hash.prototype.toObject;=0A= Hash.from =3D $H;=0A= var ObjectRange =3D Class.create(Enumerable, {=0A= initialize: function(start, end, exclusive) {=0A= this.start =3D start;=0A= this.end =3D end;=0A= this.exclusive =3D exclusive;=0A= },=0A= =0A= _each: function(iterator) {=0A= var value =3D this.start;=0A= while (this.include(value)) {=0A= iterator(value);=0A= value =3D value.succ();=0A= }=0A= },=0A= =0A= include: function(value) {=0A= if (value < this.start)=0A= return false;=0A= if (this.exclusive)=0A= return value < this.end;=0A= return value <=3D this.end;=0A= }=0A= });=0A= =0A= var $R =3D function(start, end, exclusive) {=0A= return new ObjectRange(start, end, exclusive);=0A= };=0A= =0A= var Ajax =3D {=0A= getTransport: function() {=0A= return Try.these(=0A= function() {return new XMLHttpRequest()},=0A= function() {return new ActiveXObject('Msxml2.XMLHTTP')},=0A= function() {return new ActiveXObject('Microsoft.XMLHTTP')}=0A= ) || false;=0A= },=0A= =0A= activeRequestCount: 0=0A= };=0A= =0A= Ajax.Responders =3D {=0A= responders: [],=0A= =0A= _each: function(iterator) {=0A= this.responders._each(iterator);=0A= },=0A= =0A= register: function(responder) {=0A= if (!this.include(responder))=0A= this.responders.push(responder);=0A= },=0A= =0A= unregister: function(responder) {=0A= this.responders =3D this.responders.without(responder);=0A= },=0A= =0A= dispatch: function(callback, request, transport, json) {=0A= this.each(function(responder) {=0A= if (Object.isFunction(responder[callback])) {=0A= try {=0A= responder[callback].apply(responder, [request, transport, = json]);=0A= } catch (e) { }=0A= }=0A= });=0A= }=0A= };=0A= =0A= Object.extend(Ajax.Responders, Enumerable);=0A= =0A= Ajax.Responders.register({=0A= onCreate: function() { Ajax.activeRequestCount++ },=0A= onComplete: function() { Ajax.activeRequestCount-- }=0A= });=0A= =0A= Ajax.Base =3D Class.create({=0A= initialize: function(options) {=0A= this.options =3D {=0A= method: 'post',=0A= asynchronous: true,=0A= contentType: 'application/x-www-form-urlencoded',=0A= encoding: 'UTF-8',=0A= parameters: '',=0A= evalJSON: true,=0A= evalJS: true=0A= };=0A= Object.extend(this.options, options || { });=0A= =0A= this.options.method =3D this.options.method.toLowerCase();=0A= =0A= if (Object.isString(this.options.parameters))=0A= this.options.parameters =3D = this.options.parameters.toQueryParams();=0A= else if (Object.isHash(this.options.parameters))=0A= this.options.parameters =3D this.options.parameters.toObject();=0A= }=0A= });=0A= =0A= Ajax.Request =3D Class.create(Ajax.Base, {=0A= _complete: false,=0A= =0A= initialize: function($super, url, options) {=0A= $super(options);=0A= this.transport =3D Ajax.getTransport();=0A= this.request(url);=0A= },=0A= =0A= request: function(url) {=0A= this.url =3D url;=0A= this.method =3D this.options.method;=0A= var params =3D Object.clone(this.options.parameters);=0A= =0A= if (!['get', 'post'].include(this.method)) {=0A= // simulate other verbs over post=0A= params['_method'] =3D this.method;=0A= this.method =3D 'post';=0A= }=0A= =0A= this.parameters =3D params;=0A= =0A= if (params =3D Object.toQueryString(params)) {=0A= // when GET, append parameters to URL=0A= if (this.method =3D=3D 'get')=0A= this.url +=3D (this.url.include('?') ? '&' : '?') + params;=0A= else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent))=0A= params +=3D '&_=3D';=0A= }=0A= =0A= try {=0A= var response =3D new Ajax.Response(this);=0A= if (this.options.onCreate) this.options.onCreate(response);=0A= Ajax.Responders.dispatch('onCreate', this, response);=0A= =0A= this.transport.open(this.method.toUpperCase(), this.url,=0A= this.options.asynchronous);=0A= =0A= if (this.options.asynchronous) = this.respondToReadyState.bind(this).defer(1);=0A= =0A= this.transport.onreadystatechange =3D = this.onStateChange.bind(this);=0A= this.setRequestHeaders();=0A= =0A= this.body =3D this.method =3D=3D 'post' ? (this.options.postBody = || params) : null;=0A= this.transport.send(this.body);=0A= =0A= /* Force Firefox to handle ready state 4 for synchronous requests = */=0A= if (!this.options.asynchronous && this.transport.overrideMimeType)=0A= this.onStateChange();=0A= =0A= }=0A= catch (e) {=0A= this.dispatchException(e);=0A= }=0A= },=0A= =0A= onStateChange: function() {=0A= var readyState =3D this.transport.readyState;=0A= if (readyState > 1 && !((readyState =3D=3D 4) && this._complete))=0A= this.respondToReadyState(this.transport.readyState);=0A= },=0A= =0A= setRequestHeaders: function() {=0A= var headers =3D {=0A= 'X-Requested-With': 'XMLHttpRequest',=0A= 'X-Prototype-Version': Prototype.Version,=0A= 'Accept': 'text/javascript, text/html, application/xml, text/xml, = */*'=0A= };=0A= =0A= if (this.method =3D=3D 'post') {=0A= headers['Content-type'] =3D this.options.contentType +=0A= (this.options.encoding ? '; charset=3D' + this.options.encoding = : '');=0A= =0A= /* Force "Connection: close" for older Mozilla browsers to work=0A= * around a bug where XMLHttpRequest sends an incorrect=0A= * Content-length header. See Mozilla Bugzilla #246651.=0A= */=0A= if (this.transport.overrideMimeType &&=0A= (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < = 2005)=0A= headers['Connection'] =3D 'close';=0A= }=0A= =0A= // user-defined headers=0A= if (typeof this.options.requestHeaders =3D=3D 'object') {=0A= var extras =3D this.options.requestHeaders;=0A= =0A= if (Object.isFunction(extras.push))=0A= for (var i =3D 0, length =3D extras.length; i < length; i +=3D 2)=0A= headers[extras[i]] =3D extras[i+1];=0A= else=0A= $H(extras).each(function(pair) { headers[pair.key] =3D = pair.value });=0A= }=0A= =0A= for (var name in headers)=0A= this.transport.setRequestHeader(name, headers[name]);=0A= },=0A= =0A= success: function() {=0A= var status =3D this.getStatus();=0A= return !status || (status >=3D 200 && status < 300);=0A= },=0A= =0A= getStatus: function() {=0A= try {=0A= return this.transport.status || 0;=0A= } catch (e) { return 0 }=0A= },=0A= =0A= respondToReadyState: function(readyState) {=0A= var state =3D Ajax.Request.Events[readyState], response =3D new = Ajax.Response(this);=0A= =0A= if (state =3D=3D 'Complete') {=0A= try {=0A= this._complete =3D true;=0A= (this.options['on' + response.status]=0A= || this.options['on' + (this.success() ? 'Success' : 'Failure')]=0A= || Prototype.emptyFunction)(response, response.headerJSON);=0A= } catch (e) {=0A= this.dispatchException(e);=0A= }=0A= =0A= var contentType =3D response.getHeader('Content-type');=0A= if (this.options.evalJS =3D=3D 'force'=0A= || (this.options.evalJS && this.isSameOrigin() && contentType=0A= && = contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s= *$/i)))=0A= this.evalResponse();=0A= }=0A= =0A= try {=0A= (this.options['on' + state] || Prototype.emptyFunction)(response, = response.headerJSON);=0A= Ajax.Responders.dispatch('on' + state, this, response, = response.headerJSON);=0A= } catch (e) {=0A= this.dispatchException(e);=0A= }=0A= =0A= if (state =3D=3D 'Complete') {=0A= // avoid memory leak in MSIE: clean up=0A= this.transport.onreadystatechange =3D Prototype.emptyFunction;=0A= }=0A= },=0A= =0A= isSameOrigin: function() {=0A= var m =3D this.url.match(/^\s*https?:\/\/[^\/]*/);=0A= return !m || (m[0] =3D=3D = '#{protocol}//#{domain}#{port}'.interpolate({=0A= protocol: location.protocol,=0A= domain: document.domain,=0A= port: location.port ? ':' + location.port : ''=0A= }));=0A= },=0A= =0A= getHeader: function(name) {=0A= try {=0A= return this.transport.getResponseHeader(name) || null;=0A= } catch (e) { return null }=0A= },=0A= =0A= evalResponse: function() {=0A= try {=0A= return eval((this.transport.responseText || '').unfilterJSON());=0A= } catch (e) {=0A= this.dispatchException(e);=0A= }=0A= },=0A= =0A= dispatchException: function(exception) {=0A= (this.options.onException || Prototype.emptyFunction)(this, = exception);=0A= Ajax.Responders.dispatch('onException', this, exception);=0A= }=0A= });=0A= =0A= Ajax.Request.Events =3D=0A= ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];=0A= =0A= Ajax.Response =3D Class.create({=0A= initialize: function(request){=0A= this.request =3D request;=0A= var transport =3D this.transport =3D request.transport,=0A= readyState =3D this.readyState =3D transport.readyState;=0A= =0A= if((readyState > 2 && !Prototype.Browser.IE) || readyState =3D=3D 4) = {=0A= this.status =3D this.getStatus();=0A= this.statusText =3D this.getStatusText();=0A= this.responseText =3D String.interpret(transport.responseText);=0A= this.headerJSON =3D this._getHeaderJSON();=0A= }=0A= =0A= if(readyState =3D=3D 4) {=0A= var xml =3D transport.responseXML;=0A= this.responseXML =3D Object.isUndefined(xml) ? null : xml;=0A= this.responseJSON =3D this._getResponseJSON();=0A= }=0A= },=0A= =0A= status: 0,=0A= statusText: '',=0A= =0A= getStatus: Ajax.Request.prototype.getStatus,=0A= =0A= getStatusText: function() {=0A= try {=0A= return this.transport.statusText || '';=0A= } catch (e) { return '' }=0A= },=0A= =0A= getHeader: Ajax.Request.prototype.getHeader,=0A= =0A= getAllHeaders: function() {=0A= try {=0A= return this.getAllResponseHeaders();=0A= } catch (e) { return null }=0A= },=0A= =0A= getResponseHeader: function(name) {=0A= return this.transport.getResponseHeader(name);=0A= },=0A= =0A= getAllResponseHeaders: function() {=0A= return this.transport.getAllResponseHeaders();=0A= },=0A= =0A= _getHeaderJSON: function() {=0A= var json =3D this.getHeader('X-JSON');=0A= if (!json) return null;=0A= json =3D decodeURIComponent(escape(json));=0A= try {=0A= return json.evalJSON(this.request.options.sanitizeJSON ||=0A= !this.request.isSameOrigin());=0A= } catch (e) {=0A= this.request.dispatchException(e);=0A= }=0A= },=0A= =0A= _getResponseJSON: function() {=0A= var options =3D this.request.options;=0A= if (!options.evalJSON || (options.evalJSON !=3D 'force' &&=0A= !(this.getHeader('Content-type') || = '').include('application/json')) ||=0A= this.responseText.blank())=0A= return null;=0A= try {=0A= return this.responseText.evalJSON(options.sanitizeJSON ||=0A= !this.request.isSameOrigin());=0A= } catch (e) {=0A= this.request.dispatchException(e);=0A= }=0A= }=0A= });=0A= =0A= Ajax.Updater =3D Class.create(Ajax.Request, {=0A= initialize: function($super, container, url, options) {=0A= this.container =3D {=0A= success: (container.success || container),=0A= failure: (container.failure || (container.success ? null : = container))=0A= };=0A= =0A= options =3D Object.clone(options);=0A= var onComplete =3D options.onComplete;=0A= options.onComplete =3D (function(response, json) {=0A= this.updateContent(response.responseText);=0A= if (Object.isFunction(onComplete)) onComplete(response, json);=0A= }).bind(this);=0A= =0A= $super(url, options);=0A= },=0A= =0A= updateContent: function(responseText) {=0A= var receiver =3D this.container[this.success() ? 'success' : = 'failure'],=0A= options =3D this.options;=0A= =0A= if (!options.evalScripts) responseText =3D = responseText.stripScripts();=0A= =0A= if (receiver =3D $(receiver)) {=0A= if (options.insertion) {=0A= if (Object.isString(options.insertion)) {=0A= var insertion =3D { }; insertion[options.insertion] =3D = responseText;=0A= receiver.insert(insertion);=0A= }=0A= else options.insertion(receiver, responseText);=0A= }=0A= else receiver.update(responseText);=0A= }=0A= }=0A= });=0A= =0A= Ajax.PeriodicalUpdater =3D Class.create(Ajax.Base, {=0A= initialize: function($super, container, url, options) {=0A= $super(options);=0A= this.onComplete =3D this.options.onComplete;=0A= =0A= this.frequency =3D (this.options.frequency || 2);=0A= this.decay =3D (this.options.decay || 1);=0A= =0A= this.updater =3D { };=0A= this.container =3D container;=0A= this.url =3D url;=0A= =0A= this.start();=0A= },=0A= =0A= start: function() {=0A= this.options.onComplete =3D this.updateComplete.bind(this);=0A= this.onTimerEvent();=0A= },=0A= =0A= stop: function() {=0A= this.updater.options.onComplete =3D undefined;=0A= clearTimeout(this.timer);=0A= (this.onComplete || Prototype.emptyFunction).apply(this, arguments);=0A= },=0A= =0A= updateComplete: function(response) {=0A= if (this.options.decay) {=0A= this.decay =3D (response.responseText =3D=3D this.lastText ?=0A= this.decay * this.options.decay : 1);=0A= =0A= this.lastText =3D response.responseText;=0A= }=0A= this.timer =3D this.onTimerEvent.bind(this).delay(this.decay * = this.frequency);=0A= },=0A= =0A= onTimerEvent: function() {=0A= this.updater =3D new Ajax.Updater(this.container, this.url, = this.options);=0A= }=0A= });=0A= function $(element) {=0A= if (arguments.length > 1) {=0A= for (var i =3D 0, elements =3D [], length =3D arguments.length; i < = length; i++)=0A= elements.push($(arguments[i]));=0A= return elements;=0A= }=0A= if (Object.isString(element))=0A= element =3D document.getElementById(element);=0A= return Element.extend(element);=0A= }=0A= =0A= if (Prototype.BrowserFeatures.XPath) {=0A= document._getElementsByXPath =3D function(expression, parentElement) {=0A= var results =3D [];=0A= var query =3D document.evaluate(expression, $(parentElement) || = document,=0A= null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);=0A= for (var i =3D 0, length =3D query.snapshotLength; i < length; i++)=0A= results.push(Element.extend(query.snapshotItem(i)));=0A= return results;=0A= };=0A= }=0A= =0A= /*-----------------------------------------------------------------------= ---*/=0A= =0A= if (!window.Node) var Node =3D { };=0A= =0A= if (!Node.ELEMENT_NODE) {=0A= // DOM level 2 ECMAScript Language Binding=0A= Object.extend(Node, {=0A= ELEMENT_NODE: 1,=0A= ATTRIBUTE_NODE: 2,=0A= TEXT_NODE: 3,=0A= CDATA_SECTION_NODE: 4,=0A= ENTITY_REFERENCE_NODE: 5,=0A= ENTITY_NODE: 6,=0A= PROCESSING_INSTRUCTION_NODE: 7,=0A= COMMENT_NODE: 8,=0A= DOCUMENT_NODE: 9,=0A= DOCUMENT_TYPE_NODE: 10,=0A= DOCUMENT_FRAGMENT_NODE: 11,=0A= NOTATION_NODE: 12=0A= });=0A= }=0A= =0A= (function() {=0A= var element =3D this.Element;=0A= this.Element =3D function(tagName, attributes) {=0A= attributes =3D attributes || { };=0A= tagName =3D tagName.toLowerCase();=0A= var cache =3D Element.cache;=0A= if (Prototype.Browser.IE && attributes.name) {=0A= tagName =3D '<' + tagName + ' name=3D"' + attributes.name + '">';=0A= delete attributes.name;=0A= return Element.writeAttribute(document.createElement(tagName), = attributes);=0A= }=0A= if (!cache[tagName]) cache[tagName] =3D = Element.extend(document.createElement(tagName));=0A= return Element.writeAttribute(cache[tagName].cloneNode(false), = attributes);=0A= };=0A= Object.extend(this.Element, element || { });=0A= }).call(window);=0A= =0A= Element.cache =3D { };=0A= =0A= Element.Methods =3D {=0A= visible: function(element) {=0A= return $(element).style.display !=3D 'none';=0A= },=0A= =0A= toggle: function(element) {=0A= element =3D $(element);=0A= Element[Element.visible(element) ? 'hide' : 'show'](element);=0A= return element;=0A= },=0A= =0A= hide: function(element) {=0A= $(element).style.display =3D 'none';=0A= return element;=0A= },=0A= =0A= show: function(element) {=0A= $(element).style.display =3D '';=0A= return element;=0A= },=0A= =0A= remove: function(element) {=0A= element =3D $(element);=0A= element.parentNode.removeChild(element);=0A= return element;=0A= },=0A= =0A= update: function(element, content) {=0A= element =3D $(element);=0A= if (content && content.toElement) content =3D content.toElement();=0A= if (Object.isElement(content)) return = element.update().insert(content);=0A= content =3D Object.toHTML(content);=0A= element.innerHTML =3D content.stripScripts();=0A= content.evalScripts.bind(content).defer();=0A= return element;=0A= },=0A= =0A= replace: function(element, content) {=0A= element =3D $(element);=0A= if (content && content.toElement) content =3D content.toElement();=0A= else if (!Object.isElement(content)) {=0A= content =3D Object.toHTML(content);=0A= var range =3D element.ownerDocument.createRange();=0A= range.selectNode(element);=0A= content.evalScripts.bind(content).defer();=0A= content =3D range.createContextualFragment(content.stripScripts());=0A= }=0A= element.parentNode.replaceChild(content, element);=0A= return element;=0A= },=0A= =0A= insert: function(element, insertions) {=0A= element =3D $(element);=0A= =0A= if (Object.isString(insertions) || Object.isNumber(insertions) ||=0A= Object.isElement(insertions) || (insertions && = (insertions.toElement || insertions.toHTML)))=0A= insertions =3D {bottom:insertions};=0A= =0A= var content, insert, tagName, childNodes;=0A= =0A= for (var position in insertions) {=0A= content =3D insertions[position];=0A= position =3D position.toLowerCase();=0A= insert =3D Element._insertionTranslations[position];=0A= =0A= if (content && content.toElement) content =3D content.toElement();=0A= if (Object.isElement(content)) {=0A= insert(element, content);=0A= continue;=0A= }=0A= =0A= content =3D Object.toHTML(content);=0A= =0A= tagName =3D ((position =3D=3D 'before' || position =3D=3D 'after')=0A= ? element.parentNode : element).tagName.toUpperCase();=0A= =0A= childNodes =3D Element._getContentFromAnonymousElement(tagName, = content.stripScripts());=0A= =0A= if (position =3D=3D 'top' || position =3D=3D 'after') = childNodes.reverse();=0A= childNodes.each(insert.curry(element));=0A= =0A= content.evalScripts.bind(content).defer();=0A= }=0A= =0A= return element;=0A= },=0A= =0A= wrap: function(element, wrapper, attributes) {=0A= element =3D $(element);=0A= if (Object.isElement(wrapper))=0A= $(wrapper).writeAttribute(attributes || { });=0A= else if (Object.isString(wrapper)) wrapper =3D new Element(wrapper, = attributes);=0A= else wrapper =3D new Element('div', wrapper);=0A= if (element.parentNode)=0A= element.parentNode.replaceChild(wrapper, element);=0A= wrapper.appendChild(element);=0A= return wrapper;=0A= },=0A= =0A= inspect: function(element) {=0A= element =3D $(element);=0A= var result =3D '<' + element.tagName.toLowerCase();=0A= $H({'id': 'id', 'className': 'class'}).each(function(pair) {=0A= var property =3D pair.first(), attribute =3D pair.last();=0A= var value =3D (element[property] || '').toString();=0A= if (value) result +=3D ' ' + attribute + '=3D' + = value.inspect(true);=0A= });=0A= return result + '>';=0A= },=0A= =0A= recursivelyCollect: function(element, property) {=0A= element =3D $(element);=0A= var elements =3D [];=0A= while (element =3D element[property])=0A= if (element.nodeType =3D=3D 1)=0A= elements.push(Element.extend(element));=0A= return elements;=0A= },=0A= =0A= ancestors: function(element) {=0A= return $(element).recursivelyCollect('parentNode');=0A= },=0A= =0A= descendants: function(element) {=0A= return $(element).select("*");=0A= },=0A= =0A= firstDescendant: function(element) {=0A= element =3D $(element).firstChild;=0A= while (element && element.nodeType !=3D 1) element =3D = element.nextSibling;=0A= return $(element);=0A= },=0A= =0A= immediateDescendants: function(element) {=0A= if (!(element =3D $(element).firstChild)) return [];=0A= while (element && element.nodeType !=3D 1) element =3D = element.nextSibling;=0A= if (element) return [element].concat($(element).nextSiblings());=0A= return [];=0A= },=0A= =0A= previousSiblings: function(element) {=0A= return $(element).recursivelyCollect('previousSibling');=0A= },=0A= =0A= nextSiblings: function(element) {=0A= return $(element).recursivelyCollect('nextSibling');=0A= },=0A= =0A= siblings: function(element) {=0A= element =3D $(element);=0A= return = element.previousSiblings().reverse().concat(element.nextSiblings());=0A= },=0A= =0A= match: function(element, selector) {=0A= if (Object.isString(selector))=0A= selector =3D new Selector(selector);=0A= return selector.match($(element));=0A= },=0A= =0A= up: function(element, expression, index) {=0A= element =3D $(element);=0A= if (arguments.length =3D=3D 1) return $(element.parentNode);=0A= var ancestors =3D element.ancestors();=0A= return Object.isNumber(expression) ? ancestors[expression] :=0A= Selector.findElement(ancestors, expression, index);=0A= },=0A= =0A= down: function(element, expression, index) {=0A= element =3D $(element);=0A= if (arguments.length =3D=3D 1) return element.firstDescendant();=0A= return Object.isNumber(expression) ? = element.descendants()[expression] :=0A= element.select(expression)[index || 0];=0A= },=0A= =0A= previous: function(element, expression, index) {=0A= element =3D $(element);=0A= if (arguments.length =3D=3D 1) return = $(Selector.handlers.previousElementSibling(element));=0A= var previousSiblings =3D element.previousSiblings();=0A= return Object.isNumber(expression) ? previousSiblings[expression] :=0A= Selector.findElement(previousSiblings, expression, index);=0A= },=0A= =0A= next: function(element, expression, index) {=0A= element =3D $(element);=0A= if (arguments.length =3D=3D 1) return = $(Selector.handlers.nextElementSibling(element));=0A= var nextSiblings =3D element.nextSiblings();=0A= return Object.isNumber(expression) ? nextSiblings[expression] :=0A= Selector.findElement(nextSiblings, expression, index);=0A= },=0A= =0A= select: function() {=0A= var args =3D $A(arguments), element =3D $(args.shift());=0A= return Selector.findChildElements(element, args);=0A= },=0A= =0A= adjacent: function() {=0A= var args =3D $A(arguments), element =3D $(args.shift());=0A= return Selector.findChildElements(element.parentNode, = args).without(element);=0A= },=0A= =0A= identify: function(element) {=0A= element =3D $(element);=0A= var id =3D element.readAttribute('id'), self =3D arguments.callee;=0A= if (id) return id;=0A= do { id =3D 'anonymous_element_' + self.counter++ } while ($(id));=0A= element.writeAttribute('id', id);=0A= return id;=0A= },=0A= =0A= readAttribute: function(element, name) {=0A= element =3D $(element);=0A= if (Prototype.Browser.IE) {=0A= var t =3D Element._attributeTranslations.read;=0A= if (t.values[name]) return t.values[name](element, name);=0A= if (t.names[name]) name =3D t.names[name];=0A= if (name.include(':')) {=0A= return (!element.attributes || !element.attributes[name]) ? null = :=0A= element.attributes[name].value;=0A= }=0A= }=0A= return element.getAttribute(name);=0A= },=0A= =0A= writeAttribute: function(element, name, value) {=0A= element =3D $(element);=0A= var attributes =3D { }, t =3D Element._attributeTranslations.write;=0A= =0A= if (typeof name =3D=3D 'object') attributes =3D name;=0A= else attributes[name] =3D Object.isUndefined(value) ? true : value;=0A= =0A= for (var attr in attributes) {=0A= name =3D t.names[attr] || attr;=0A= value =3D attributes[attr];=0A= if (t.values[attr]) name =3D t.values[attr](element, value);=0A= if (value =3D=3D=3D false || value =3D=3D=3D null)=0A= element.removeAttribute(name);=0A= else if (value =3D=3D=3D true)=0A= element.setAttribute(name, name);=0A= else element.setAttribute(name, value);=0A= }=0A= return element;=0A= },=0A= =0A= getHeight: function(element) {=0A= return $(element).getDimensions().height;=0A= },=0A= =0A= getWidth: function(element) {=0A= return $(element).getDimensions().width;=0A= },=0A= =0A= classNames: function(element) {=0A= return new Element.ClassNames(element);=0A= },=0A= =0A= hasClassName: function(element, className) {=0A= if (!(element =3D $(element))) return;=0A= var elementClassName =3D element.className;=0A= return (elementClassName.length > 0 && (elementClassName =3D=3D = className ||=0A= new RegExp("(^|\\s)" + className + = "(\\s|$)").test(elementClassName)));=0A= },=0A= =0A= addClassName: function(element, className) {=0A= if (!(element =3D $(element))) return;=0A= if (!element.hasClassName(className))=0A= element.className +=3D (element.className ? ' ' : '') + className;=0A= return element;=0A= },=0A= =0A= removeClassName: function(element, className) {=0A= if (!(element =3D $(element))) return;=0A= element.className =3D element.className.replace(=0A= new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip();=0A= return element;=0A= },=0A= =0A= toggleClassName: function(element, className) {=0A= if (!(element =3D $(element))) return;=0A= return element[element.hasClassName(className) ?=0A= 'removeClassName' : 'addClassName'](className);=0A= },=0A= =0A= // removes whitespace-only text node children=0A= cleanWhitespace: function(element) {=0A= element =3D $(element);=0A= var node =3D element.firstChild;=0A= while (node) {=0A= var nextNode =3D node.nextSibling;=0A= if (node.nodeType =3D=3D 3 && !/\S/.test(node.nodeValue))=0A= element.removeChild(node);=0A= node =3D nextNode;=0A= }=0A= return element;=0A= },=0A= =0A= empty: function(element) {=0A= return $(element).innerHTML.blank();=0A= },=0A= =0A= descendantOf: function(element, ancestor) {=0A= element =3D $(element), ancestor =3D $(ancestor);=0A= var originalAncestor =3D ancestor;=0A= =0A= if (element.compareDocumentPosition)=0A= return (element.compareDocumentPosition(ancestor) & 8) =3D=3D=3D 8;=0A= =0A= if (element.sourceIndex && !Prototype.Browser.Opera) {=0A= var e =3D element.sourceIndex, a =3D ancestor.sourceIndex,=0A= nextAncestor =3D ancestor.nextSibling;=0A= if (!nextAncestor) {=0A= do { ancestor =3D ancestor.parentNode; }=0A= while (!(nextAncestor =3D ancestor.nextSibling) && = ancestor.parentNode);=0A= }=0A= if (nextAncestor && nextAncestor.sourceIndex)=0A= return (e > a && e < nextAncestor.sourceIndex);=0A= }=0A= =0A= while (element =3D element.parentNode)=0A= if (element =3D=3D originalAncestor) return true;=0A= return false;=0A= },=0A= =0A= scrollTo: function(element) {=0A= element =3D $(element);=0A= var pos =3D element.cumulativeOffset();=0A= window.scrollTo(pos[0], pos[1]);=0A= return element;=0A= },=0A= =0A= getStyle: function(element, style) {=0A= element =3D $(element);=0A= style =3D style =3D=3D 'float' ? 'cssFloat' : style.camelize();=0A= var value =3D element.style[style];=0A= if (!value) {=0A= var css =3D document.defaultView.getComputedStyle(element, null);=0A= value =3D css ? css[style] : null;=0A= }=0A= if (style =3D=3D 'opacity') return value ? parseFloat(value) : 1.0;=0A= return value =3D=3D 'auto' ? null : value;=0A= },=0A= =0A= getOpacity: function(element) {=0A= return $(element).getStyle('opacity');=0A= },=0A= =0A= setStyle: function(element, styles) {=0A= element =3D $(element);=0A= var elementStyle =3D element.style, match;=0A= if (Object.isString(styles)) {=0A= element.style.cssText +=3D ';' + styles;=0A= return styles.include('opacity') ?=0A= element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : = element;=0A= }=0A= for (var property in styles)=0A= if (property =3D=3D 'opacity') = element.setOpacity(styles[property]);=0A= else=0A= elementStyle[(property =3D=3D 'float' || property =3D=3D = 'cssFloat') ?=0A= (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : = 'styleFloat') :=0A= property] =3D styles[property];=0A= =0A= return element;=0A= },=0A= =0A= setOpacity: function(element, value) {=0A= element =3D $(element);=0A= element.style.opacity =3D (value =3D=3D 1 || value =3D=3D=3D '') ? = '' :=0A= (value < 0.00001) ? 0 : value;=0A= return element;=0A= },=0A= =0A= getDimensions: function(element) {=0A= element =3D $(element);=0A= var display =3D $(element).getStyle('display');=0A= if (display !=3D 'none' && display !=3D null) // Safari bug=0A= return {width: element.offsetWidth, height: element.offsetHeight};=0A= =0A= // All *Width and *Height properties give 0 on elements with display = none,=0A= // so enable the element temporarily=0A= var els =3D element.style;=0A= var originalVisibility =3D els.visibility;=0A= var originalPosition =3D els.position;=0A= var originalDisplay =3D els.display;=0A= els.visibility =3D 'hidden';=0A= els.position =3D 'absolute';=0A= els.display =3D 'block';=0A= var originalWidth =3D element.clientWidth;=0A= var originalHeight =3D element.clientHeight;=0A= els.display =3D originalDisplay;=0A= els.position =3D originalPosition;=0A= els.visibility =3D originalVisibility;=0A= return {width: originalWidth, height: originalHeight};=0A= },=0A= =0A= makePositioned: function(element) {=0A= element =3D $(element);=0A= var pos =3D Element.getStyle(element, 'position');=0A= if (pos =3D=3D 'static' || !pos) {=0A= element._madePositioned =3D true;=0A= element.style.position =3D 'relative';=0A= // Opera returns the offset relative to the positioning context, = when an=0A= // element is position relative but top and left have not been = defined=0A= if (window.opera) {=0A= element.style.top =3D 0;=0A= element.style.left =3D 0;=0A= }=0A= }=0A= return element;=0A= },=0A= =0A= undoPositioned: function(element) {=0A= element =3D $(element);=0A= if (element._madePositioned) {=0A= element._madePositioned =3D undefined;=0A= element.style.position =3D=0A= element.style.top =3D=0A= element.style.left =3D=0A= element.style.bottom =3D=0A= element.style.right =3D '';=0A= }=0A= return element;=0A= },=0A= =0A= makeClipping: function(element) {=0A= element =3D $(element);=0A= if (element._overflow) return element;=0A= element._overflow =3D Element.getStyle(element, 'overflow') || = 'auto';=0A= if (element._overflow !=3D=3D 'hidden')=0A= element.style.overflow =3D 'hidden';=0A= return element;=0A= },=0A= =0A= undoClipping: function(element) {=0A= element =3D $(element);=0A= if (!element._overflow) return element;=0A= element.style.overflow =3D element._overflow =3D=3D 'auto' ? '' : = element._overflow;=0A= element._overflow =3D null;=0A= return element;=0A= },=0A= =0A= cumulativeOffset: function(element) {=0A= var valueT =3D 0, valueL =3D 0;=0A= do {=0A= valueT +=3D element.offsetTop || 0;=0A= valueL +=3D element.offsetLeft || 0;=0A= element =3D element.offsetParent;=0A= } while (element);=0A= return Element._returnOffset(valueL, valueT);=0A= },=0A= =0A= positionedOffset: function(element) {=0A= var valueT =3D 0, valueL =3D 0;=0A= do {=0A= valueT +=3D element.offsetTop || 0;=0A= valueL +=3D element.offsetLeft || 0;=0A= element =3D element.offsetParent;=0A= if (element) {=0A= if (element.tagName =3D=3D 'BODY') break;=0A= var p =3D Element.getStyle(element, 'position');=0A= if (p !=3D=3D 'static') break;=0A= }=0A= } while (element);=0A= return Element._returnOffset(valueL, valueT);=0A= },=0A= =0A= absolutize: function(element) {=0A= element =3D $(element);=0A= if (element.getStyle('position') =3D=3D 'absolute') return;=0A= // Position.prepare(); // To be done manually by Scripty when it = needs it.=0A= =0A= var offsets =3D element.positionedOffset();=0A= var top =3D offsets[1];=0A= var left =3D offsets[0];=0A= var width =3D element.clientWidth;=0A= var height =3D element.clientHeight;=0A= =0A= element._originalLeft =3D left - parseFloat(element.style.left || = 0);=0A= element._originalTop =3D top - parseFloat(element.style.top || = 0);=0A= element._originalWidth =3D element.style.width;=0A= element._originalHeight =3D element.style.height;=0A= =0A= element.style.position =3D 'absolute';=0A= element.style.top =3D top + 'px';=0A= element.style.left =3D left + 'px';=0A= element.style.width =3D width + 'px';=0A= element.style.height =3D height + 'px';=0A= return element;=0A= },=0A= =0A= relativize: function(element) {=0A= element =3D $(element);=0A= if (element.getStyle('position') =3D=3D 'relative') return;=0A= // Position.prepare(); // To be done manually by Scripty when it = needs it.=0A= =0A= element.style.position =3D 'relative';=0A= var top =3D parseFloat(element.style.top || 0) - = (element._originalTop || 0);=0A= var left =3D parseFloat(element.style.left || 0) - = (element._originalLeft || 0);=0A= =0A= element.style.top =3D top + 'px';=0A= element.style.left =3D left + 'px';=0A= element.style.height =3D element._originalHeight;=0A= element.style.width =3D element._originalWidth;=0A= return element;=0A= },=0A= =0A= cumulativeScrollOffset: function(element) {=0A= var valueT =3D 0, valueL =3D 0;=0A= do {=0A= valueT +=3D element.scrollTop || 0;=0A= valueL +=3D element.scrollLeft || 0;=0A= element =3D element.parentNode;=0A= } while (element);=0A= return Element._returnOffset(valueL, valueT);=0A= },=0A= =0A= getOffsetParent: function(element) {=0A= if (element.offsetParent) return $(element.offsetParent);=0A= if (element =3D=3D document.body) return $(element);=0A= =0A= while ((element =3D element.parentNode) && element !=3D = document.body)=0A= if (Element.getStyle(element, 'position') !=3D 'static')=0A= return $(element);=0A= =0A= return $(document.body);=0A= },=0A= =0A= viewportOffset: function(forElement) {=0A= var valueT =3D 0, valueL =3D 0;=0A= =0A= var element =3D forElement;=0A= do {=0A= valueT +=3D element.offsetTop || 0;=0A= valueL +=3D element.offsetLeft || 0;=0A= =0A= // Safari fix=0A= if (element.offsetParent =3D=3D document.body &&=0A= Element.getStyle(element, 'position') =3D=3D 'absolute') break;=0A= =0A= } while (element =3D element.offsetParent);=0A= =0A= element =3D forElement;=0A= do {=0A= if (!Prototype.Browser.Opera || element.tagName =3D=3D 'BODY') {=0A= valueT -=3D element.scrollTop || 0;=0A= valueL -=3D element.scrollLeft || 0;=0A= }=0A= } while (element =3D element.parentNode);=0A= =0A= return Element._returnOffset(valueL, valueT);=0A= },=0A= =0A= clonePosition: function(element, source) {=0A= var options =3D Object.extend({=0A= setLeft: true,=0A= setTop: true,=0A= setWidth: true,=0A= setHeight: true,=0A= offsetTop: 0,=0A= offsetLeft: 0=0A= }, arguments[2] || { });=0A= =0A= // find page position of source=0A= source =3D $(source);=0A= var p =3D source.viewportOffset();=0A= =0A= // find coordinate system to use=0A= element =3D $(element);=0A= var delta =3D [0, 0];=0A= var parent =3D null;=0A= // delta [0,0] will do fine with position: fixed elements,=0A= // position:absolute needs offsetParent deltas=0A= if (Element.getStyle(element, 'position') =3D=3D 'absolute') {=0A= parent =3D element.getOffsetParent();=0A= delta =3D parent.viewportOffset();=0A= }=0A= =0A= // correct by body offsets (fixes Safari)=0A= if (parent =3D=3D document.body) {=0A= delta[0] -=3D document.body.offsetLeft;=0A= delta[1] -=3D document.body.offsetTop;=0A= }=0A= =0A= // set position=0A= if (options.setLeft) element.style.left =3D (p[0] - delta[0] + = options.offsetLeft) + 'px';=0A= if (options.setTop) element.style.top =3D (p[1] - delta[1] + = options.offsetTop) + 'px';=0A= if (options.setWidth) element.style.width =3D source.offsetWidth + = 'px';=0A= if (options.setHeight) element.style.height =3D source.offsetHeight = + 'px';=0A= return element;=0A= }=0A= };=0A= =0A= Element.Methods.identify.counter =3D 1;=0A= =0A= Object.extend(Element.Methods, {=0A= getElementsBySelector: Element.Methods.select,=0A= childElements: Element.Methods.immediateDescendants=0A= });=0A= =0A= Element._attributeTranslations =3D {=0A= write: {=0A= names: {=0A= className: 'class',=0A= htmlFor: 'for'=0A= },=0A= values: { }=0A= }=0A= };=0A= =0A= if (Prototype.Browser.Opera) {=0A= Element.Methods.getStyle =3D Element.Methods.getStyle.wrap(=0A= function(proceed, element, style) {=0A= switch (style) {=0A= case 'left': case 'top': case 'right': case 'bottom':=0A= if (proceed(element, 'position') =3D=3D=3D 'static') return = null;=0A= case 'height': case 'width':=0A= // returns '0px' for hidden elements; we want it to return null=0A= if (!Element.visible(element)) return null;=0A= =0A= // returns the border-box dimensions rather than the = content-box=0A= // dimensions, so we subtract padding and borders from the = value=0A= var dim =3D parseInt(proceed(element, style), 10);=0A= =0A= if (dim !=3D=3D element['offset' + style.capitalize()])=0A= return dim + 'px';=0A= =0A= var properties;=0A= if (style =3D=3D=3D 'height') {=0A= properties =3D ['border-top-width', 'padding-top',=0A= 'padding-bottom', 'border-bottom-width'];=0A= }=0A= else {=0A= properties =3D ['border-left-width', 'padding-left',=0A= 'padding-right', 'border-right-width'];=0A= }=0A= return properties.inject(dim, function(memo, property) {=0A= var val =3D proceed(element, property);=0A= return val =3D=3D=3D null ? memo : memo - parseInt(val, 10);=0A= }) + 'px';=0A= default: return proceed(element, style);=0A= }=0A= }=0A= );=0A= =0A= Element.Methods.readAttribute =3D Element.Methods.readAttribute.wrap(=0A= function(proceed, element, attribute) {=0A= if (attribute =3D=3D=3D 'title') return element.title;=0A= return proceed(element, attribute);=0A= }=0A= );=0A= }=0A= =0A= else if (Prototype.Browser.IE) {=0A= // IE doesn't report offsets correctly for static elements, so we = change them=0A= // to "relative" to get the values, then change them back.=0A= Element.Methods.getOffsetParent =3D = Element.Methods.getOffsetParent.wrap(=0A= function(proceed, element) {=0A= element =3D $(element);=0A= var position =3D element.getStyle('position');=0A= if (position !=3D=3D 'static') return proceed(element);=0A= element.setStyle({ position: 'relative' });=0A= var value =3D proceed(element);=0A= element.setStyle({ position: position });=0A= return value;=0A= }=0A= );=0A= =0A= $w('positionedOffset viewportOffset').each(function(method) {=0A= Element.Methods[method] =3D Element.Methods[method].wrap(=0A= function(proceed, element) {=0A= element =3D $(element);=0A= var position =3D element.getStyle('position');=0A= if (position !=3D=3D 'static') return proceed(element);=0A= // Trigger hasLayout on the offset parent so that IE6 reports=0A= // accurate offsetTop and offsetLeft values for position: fixed.=0A= var offsetParent =3D element.getOffsetParent();=0A= if (offsetParent && offsetParent.getStyle('position') =3D=3D=3D = 'fixed')=0A= offsetParent.setStyle({ zoom: 1 });=0A= element.setStyle({ position: 'relative' });=0A= var value =3D proceed(element);=0A= element.setStyle({ position: position });=0A= return value;=0A= }=0A= );=0A= });=0A= =0A= Element.Methods.getStyle =3D function(element, style) {=0A= element =3D $(element);=0A= style =3D (style =3D=3D 'float' || style =3D=3D 'cssFloat') ? = 'styleFloat' : style.camelize();=0A= var value =3D element.style[style];=0A= if (!value && element.currentStyle) value =3D = element.currentStyle[style];=0A= =0A= if (style =3D=3D 'opacity') {=0A= if (value =3D (element.getStyle('filter') || = '').match(/alpha\(opacity=3D(.*)\)/))=0A= if (value[1]) return parseFloat(value[1]) / 100;=0A= return 1.0;=0A= }=0A= =0A= if (value =3D=3D 'auto') {=0A= if ((style =3D=3D 'width' || style =3D=3D 'height') && = (element.getStyle('display') !=3D 'none'))=0A= return element['offset' + style.capitalize()] + 'px';=0A= return null;=0A= }=0A= return value;=0A= };=0A= =0A= Element.Methods.setOpacity =3D function(element, value) {=0A= function stripAlpha(filter){=0A= return filter.replace(/alpha\([^\)]*\)/gi,'');=0A= }=0A= element =3D $(element);=0A= var currentStyle =3D element.currentStyle;=0A= if ((currentStyle && !currentStyle.hasLayout) ||=0A= (!currentStyle && element.style.zoom =3D=3D 'normal'))=0A= element.style.zoom =3D 1;=0A= =0A= var filter =3D element.getStyle('filter'), style =3D element.style;=0A= if (value =3D=3D 1 || value =3D=3D=3D '') {=0A= (filter =3D stripAlpha(filter)) ?=0A= style.filter =3D filter : style.removeAttribute('filter');=0A= return element;=0A= } else if (value < 0.00001) value =3D 0;=0A= style.filter =3D stripAlpha(filter) +=0A= 'alpha(opacity=3D' + (value * 100) + ')';=0A= return element;=0A= };=0A= =0A= Element._attributeTranslations =3D {=0A= read: {=0A= names: {=0A= 'class': 'className',=0A= 'for': 'htmlFor'=0A= },=0A= values: {=0A= _getAttr: function(element, attribute) {=0A= return element.getAttribute(attribute, 2);=0A= },=0A= _getAttrNode: function(element, attribute) {=0A= var node =3D element.getAttributeNode(attribute);=0A= return node ? node.value : "";=0A= },=0A= _getEv: function(element, attribute) {=0A= attribute =3D element.getAttribute(attribute);=0A= return attribute ? attribute.toString().slice(23, -2) : null;=0A= },=0A= _flag: function(element, attribute) {=0A= return $(element).hasAttribute(attribute) ? attribute : null;=0A= },=0A= style: function(element) {=0A= return element.style.cssText.toLowerCase();=0A= },=0A= title: function(element) {=0A= return element.title;=0A= }=0A= }=0A= }=0A= };=0A= =0A= Element._attributeTranslations.write =3D {=0A= names: Object.extend({=0A= cellpadding: 'cellPadding',=0A= cellspacing: 'cellSpacing'=0A= }, Element._attributeTranslations.read.names),=0A= values: {=0A= checked: function(element, value) {=0A= element.checked =3D !!value;=0A= },=0A= =0A= style: function(element, value) {=0A= element.style.cssText =3D value ? value : '';=0A= }=0A= }=0A= };=0A= =0A= Element._attributeTranslations.has =3D {};=0A= =0A= $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' +=0A= 'encType maxLength readOnly longDesc').each(function(attr) {=0A= Element._attributeTranslations.write.names[attr.toLowerCase()] =3D = attr;=0A= Element._attributeTranslations.has[attr.toLowerCase()] =3D attr;=0A= });=0A= =0A= (function(v) {=0A= Object.extend(v, {=0A= href: v._getAttr,=0A= src: v._getAttr,=0A= type: v._getAttr,=0A= action: v._getAttrNode,=0A= disabled: v._flag,=0A= checked: v._flag,=0A= readonly: v._flag,=0A= multiple: v._flag,=0A= onload: v._getEv,=0A= onunload: v._getEv,=0A= onclick: v._getEv,=0A= ondblclick: v._getEv,=0A= onmousedown: v._getEv,=0A= onmouseup: v._getEv,=0A= onmouseover: v._getEv,=0A= onmousemove: v._getEv,=0A= onmouseout: v._getEv,=0A= onfocus: v._getEv,=0A= onblur: v._getEv,=0A= onkeypress: v._getEv,=0A= onkeydown: v._getEv,=0A= onkeyup: v._getEv,=0A= onsubmit: v._getEv,=0A= onreset: v._getEv,=0A= onselect: v._getEv,=0A= onchange: v._getEv=0A= });=0A= })(Element._attributeTranslations.read.values);=0A= }=0A= =0A= else if (Prototype.Browser.Gecko && = /rv:1\.8\.0/.test(navigator.userAgent)) {=0A= Element.Methods.setOpacity =3D function(element, value) {=0A= element =3D $(element);=0A= element.style.opacity =3D (value =3D=3D 1) ? 0.999999 :=0A= (value =3D=3D=3D '') ? '' : (value < 0.00001) ? 0 : value;=0A= return element;=0A= };=0A= }=0A= =0A= else if (Prototype.Browser.WebKit) {=0A= Element.Methods.setOpacity =3D function(element, value) {=0A= element =3D $(element);=0A= element.style.opacity =3D (value =3D=3D 1 || value =3D=3D=3D '') ? = '' :=0A= (value < 0.00001) ? 0 : value;=0A= =0A= if (value =3D=3D 1)=0A= if(element.tagName =3D=3D 'IMG' && element.width) {=0A= element.width++; element.width--;=0A= } else try {=0A= var n =3D document.createTextNode(' ');=0A= element.appendChild(n);=0A= element.removeChild(n);=0A= } catch (e) { }=0A= =0A= return element;=0A= };=0A= =0A= // Safari returns margins on body which is incorrect if the child is = absolutely=0A= // positioned. For performance reasons, redefine = Element#cumulativeOffset for=0A= // KHTML/WebKit only.=0A= Element.Methods.cumulativeOffset =3D function(element) {=0A= var valueT =3D 0, valueL =3D 0;=0A= do {=0A= valueT +=3D element.offsetTop || 0;=0A= valueL +=3D element.offsetLeft || 0;=0A= if (element.offsetParent =3D=3D document.body)=0A= if (Element.getStyle(element, 'position') =3D=3D 'absolute') = break;=0A= =0A= element =3D element.offsetParent;=0A= } while (element);=0A= =0A= return Element._returnOffset(valueL, valueT);=0A= };=0A= }=0A= =0A= if (Prototype.Browser.IE || Prototype.Browser.Opera) {=0A= // IE and Opera are missing .innerHTML support for TABLE-related and = SELECT elements=0A= Element.Methods.update =3D function(element, content) {=0A= element =3D $(element);=0A= =0A= if (content && content.toElement) content =3D content.toElement();=0A= if (Object.isElement(content)) return = element.update().insert(content);=0A= =0A= content =3D Object.toHTML(content);=0A= var tagName =3D element.tagName.toUpperCase();=0A= =0A= if (tagName in Element._insertionTranslations.tags) {=0A= $A(element.childNodes).each(function(node) { = element.removeChild(node) });=0A= Element._getContentFromAnonymousElement(tagName, = content.stripScripts())=0A= .each(function(node) { element.appendChild(node) });=0A= }=0A= else element.innerHTML =3D content.stripScripts();=0A= =0A= content.evalScripts.bind(content).defer();=0A= return element;=0A= };=0A= }=0A= =0A= if ('outerHTML' in document.createElement('div')) {=0A= Element.Methods.replace =3D function(element, content) {=0A= element =3D $(element);=0A= =0A= if (content && content.toElement) content =3D content.toElement();=0A= if (Object.isElement(content)) {=0A= element.parentNode.replaceChild(content, element);=0A= return element;=0A= }=0A= =0A= content =3D Object.toHTML(content);=0A= var parent =3D element.parentNode, tagName =3D = parent.tagName.toUpperCase();=0A= =0A= if (Element._insertionTranslations.tags[tagName]) {=0A= var nextSibling =3D element.next();=0A= var fragments =3D Element._getContentFromAnonymousElement(tagName, = content.stripScripts());=0A= parent.removeChild(element);=0A= if (nextSibling)=0A= fragments.each(function(node) { parent.insertBefore(node, = nextSibling) });=0A= else=0A= fragments.each(function(node) { parent.appendChild(node) });=0A= }=0A= else element.outerHTML =3D content.stripScripts();=0A= =0A= content.evalScripts.bind(content).defer();=0A= return element;=0A= };=0A= }=0A= =0A= Element._returnOffset =3D function(l, t) {=0A= var result =3D [l, t];=0A= result.left =3D l;=0A= result.top =3D t;=0A= return result;=0A= };=0A= =0A= Element._getContentFromAnonymousElement =3D function(tagName, html) {=0A= var div =3D new Element('div'), t =3D = Element._insertionTranslations.tags[tagName];=0A= if (t) {=0A= div.innerHTML =3D t[0] + html + t[1];=0A= t[2].times(function() { div =3D div.firstChild });=0A= } else div.innerHTML =3D html;=0A= return $A(div.childNodes);=0A= };=0A= =0A= Element._insertionTranslations =3D {=0A= before: function(element, node) {=0A= element.parentNode.insertBefore(node, element);=0A= },=0A= top: function(element, node) {=0A= element.insertBefore(node, element.firstChild);=0A= },=0A= bottom: function(element, node) {=0A= element.appendChild(node);=0A= },=0A= after: function(element, node) {=0A= element.parentNode.insertBefore(node, element.nextSibling);=0A= },=0A= tags: {=0A= TABLE: ['', '
', 1],=0A= TBODY: ['', '
', 2],=0A= TR: ['', '
', 3],=0A= TD: ['
', '
', 4],=0A= SELECT: ['', 1]=0A= }=0A= };=0A= =0A= (function() {=0A= Object.extend(this.tags, {=0A= THEAD: this.tags.TBODY,=0A= TFOOT: this.tags.TBODY,=0A= TH: this.tags.TD=0A= });=0A= }).call(Element._insertionTranslations);=0A= =0A= Element.Methods.Simulated =3D {=0A= hasAttribute: function(element, attribute) {=0A= attribute =3D Element._attributeTranslations.has[attribute] || = attribute;=0A= var node =3D $(element).getAttributeNode(attribute);=0A= return node && node.specified;=0A= }=0A= };=0A= =0A= Element.Methods.ByTag =3D { };=0A= =0A= Object.extend(Element, Element.Methods);=0A= =0A= if (!Prototype.BrowserFeatures.ElementExtensions &&=0A= document.createElement('div').__proto__) {=0A= window.HTMLElement =3D { };=0A= window.HTMLElement.prototype =3D = document.createElement('div').__proto__;=0A= Prototype.BrowserFeatures.ElementExtensions =3D true;=0A= }=0A= =0A= Element.extend =3D (function() {=0A= if (Prototype.BrowserFeatures.SpecificElementExtensions)=0A= return Prototype.K;=0A= =0A= var Methods =3D { }, ByTag =3D Element.Methods.ByTag;=0A= =0A= var extend =3D Object.extend(function(element) {=0A= if (!element || element._extendedByPrototype ||=0A= element.nodeType !=3D 1 || element =3D=3D window) return element;=0A= =0A= var methods =3D Object.clone(Methods),=0A= tagName =3D element.tagName, property, value;=0A= =0A= // extend methods for specific tags=0A= if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]);=0A= =0A= for (property in methods) {=0A= value =3D methods[property];=0A= if (Object.isFunction(value) && !(property in element))=0A= element[property] =3D value.methodize();=0A= }=0A= =0A= element._extendedByPrototype =3D Prototype.emptyFunction;=0A= return element;=0A= =0A= }, {=0A= refresh: function() {=0A= // extend methods for all tags (Safari doesn't need this)=0A= if (!Prototype.BrowserFeatures.ElementExtensions) {=0A= Object.extend(Methods, Element.Methods);=0A= Object.extend(Methods, Element.Methods.Simulated);=0A= }=0A= }=0A= });=0A= =0A= extend.refresh();=0A= return extend;=0A= })();=0A= =0A= Element.hasAttribute =3D function(element, attribute) {=0A= if (element.hasAttribute) return element.hasAttribute(attribute);=0A= return Element.Methods.Simulated.hasAttribute(element, attribute);=0A= };=0A= =0A= Element.addMethods =3D function(methods) {=0A= var F =3D Prototype.BrowserFeatures, T =3D Element.Methods.ByTag;=0A= =0A= if (!methods) {=0A= Object.extend(Form, Form.Methods);=0A= Object.extend(Form.Element, Form.Element.Methods);=0A= Object.extend(Element.Methods.ByTag, {=0A= "FORM": Object.clone(Form.Methods),=0A= "INPUT": Object.clone(Form.Element.Methods),=0A= "SELECT": Object.clone(Form.Element.Methods),=0A= "TEXTAREA": Object.clone(Form.Element.Methods)=0A= });=0A= }=0A= =0A= if (arguments.length =3D=3D 2) {=0A= var tagName =3D methods;=0A= methods =3D arguments[1];=0A= }=0A= =0A= if (!tagName) Object.extend(Element.Methods, methods || { });=0A= else {=0A= if (Object.isArray(tagName)) tagName.each(extend);=0A= else extend(tagName);=0A= }=0A= =0A= function extend(tagName) {=0A= tagName =3D tagName.toUpperCase();=0A= if (!Element.Methods.ByTag[tagName])=0A= Element.Methods.ByTag[tagName] =3D { };=0A= Object.extend(Element.Methods.ByTag[tagName], methods);=0A= }=0A= =0A= function copy(methods, destination, onlyIfAbsent) {=0A= onlyIfAbsent =3D onlyIfAbsent || false;=0A= for (var property in methods) {=0A= var value =3D methods[property];=0A= if (!Object.isFunction(value)) continue;=0A= if (!onlyIfAbsent || !(property in destination))=0A= destination[property] =3D value.methodize();=0A= }=0A= }=0A= =0A= function findDOMClass(tagName) {=0A= var klass;=0A= var trans =3D {=0A= "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph",=0A= "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": = "DList",=0A= "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": = "Heading",=0A= "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote",=0A= "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", = "CAPTION":=0A= "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD":=0A= "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", = "TR":=0A= "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET":=0A= "FrameSet", "IFRAME": "IFrame"=0A= };=0A= if (trans[tagName]) klass =3D 'HTML' + trans[tagName] + 'Element';=0A= if (window[klass]) return window[klass];=0A= klass =3D 'HTML' + tagName + 'Element';=0A= if (window[klass]) return window[klass];=0A= klass =3D 'HTML' + tagName.capitalize() + 'Element';=0A= if (window[klass]) return window[klass];=0A= =0A= window[klass] =3D { };=0A= window[klass].prototype =3D = document.createElement(tagName).__proto__;=0A= return window[klass];=0A= }=0A= =0A= if (F.ElementExtensions) {=0A= copy(Element.Methods, HTMLElement.prototype);=0A= copy(Element.Methods.Simulated, HTMLElement.prototype, true);=0A= }=0A= =0A= if (F.SpecificElementExtensions) {=0A= for (var tag in Element.Methods.ByTag) {=0A= var klass =3D findDOMClass(tag);=0A= if (Object.isUndefined(klass)) continue;=0A= copy(T[tag], klass.prototype);=0A= }=0A= }=0A= =0A= Object.extend(Element, Element.Methods);=0A= delete Element.ByTag;=0A= =0A= if (Element.extend.refresh) Element.extend.refresh();=0A= Element.cache =3D { };=0A= };=0A= =0A= document.viewport =3D {=0A= getDimensions: function() {=0A= var dimensions =3D { };=0A= var B =3D Prototype.Browser;=0A= $w('width height').each(function(d) {=0A= var D =3D d.capitalize();=0A= dimensions[d] =3D (B.WebKit && !document.evaluate) ? self['inner' = + D] :=0A= (B.Opera) ? document.body['client' + D] : = document.documentElement['client' + D];=0A= });=0A= return dimensions;=0A= },=0A= =0A= getWidth: function() {=0A= return this.getDimensions().width;=0A= },=0A= =0A= getHeight: function() {=0A= return this.getDimensions().height;=0A= },=0A= =0A= getScrollOffsets: function() {=0A= return Element._returnOffset(=0A= window.pageXOffset || document.documentElement.scrollLeft || = document.body.scrollLeft,=0A= window.pageYOffset || document.documentElement.scrollTop || = document.body.scrollTop);=0A= }=0A= };=0A= /* Portions of the Selector class are derived from Jack Slocum=E2=80=99s = DomQuery,=0A= * part of YUI-Ext version 0.40, distributed under the terms of an = MIT-style=0A= * license. Please see http://www.yui-ext.com/ for more information. */=0A= =0A= var Selector =3D Class.create({=0A= initialize: function(expression) {=0A= this.expression =3D expression.strip();=0A= this.compileMatcher();=0A= },=0A= =0A= shouldUseXPath: function() {=0A= if (!Prototype.BrowserFeatures.XPath) return false;=0A= =0A= var e =3D this.expression;=0A= =0A= // Safari 3 chokes on :*-of-type and :empty=0A= if (Prototype.Browser.WebKit &&=0A= (e.include("-of-type") || e.include(":empty")))=0A= return false;=0A= =0A= // XPath can't do namespaced attributes, nor can it read=0A= // the "checked" property from DOM nodes=0A= if ((/(\[[\w-]*?:|:checked)/).test(this.expression))=0A= return false;=0A= =0A= return true;=0A= },=0A= =0A= compileMatcher: function() {=0A= if (this.shouldUseXPath())=0A= return this.compileXPathMatcher();=0A= =0A= var e =3D this.expression, ps =3D Selector.patterns, h =3D = Selector.handlers,=0A= c =3D Selector.criteria, le, p, m;=0A= =0A= if (Selector._cache[e]) {=0A= this.matcher =3D Selector._cache[e];=0A= return;=0A= }=0A= =0A= this.matcher =3D ["this.matcher =3D function(root) {",=0A= "var r =3D root, h =3D Selector.handlers, c =3D = false, n;"];=0A= =0A= while (e && le !=3D e && (/\S/).test(e)) {=0A= le =3D e;=0A= for (var i in ps) {=0A= p =3D ps[i];=0A= if (m =3D e.match(p)) {=0A= this.matcher.push(Object.isFunction(c[i]) ? c[i](m) :=0A= new Template(c[i]).evaluate(m));=0A= e =3D e.replace(m[0], '');=0A= break;=0A= }=0A= }=0A= }=0A= =0A= this.matcher.push("return h.unique(n);\n}");=0A= eval(this.matcher.join('\n'));=0A= Selector._cache[this.expression] =3D this.matcher;=0A= },=0A= =0A= compileXPathMatcher: function() {=0A= var e =3D this.expression, ps =3D Selector.patterns,=0A= x =3D Selector.xpath, le, m;=0A= =0A= if (Selector._cache[e]) {=0A= this.xpath =3D Selector._cache[e]; return;=0A= }=0A= =0A= this.matcher =3D ['.//*'];=0A= while (e && le !=3D e && (/\S/).test(e)) {=0A= le =3D e;=0A= for (var i in ps) {=0A= if (m =3D e.match(ps[i])) {=0A= this.matcher.push(Object.isFunction(x[i]) ? x[i](m) :=0A= new Template(x[i]).evaluate(m));=0A= e =3D e.replace(m[0], '');=0A= break;=0A= }=0A= }=0A= }=0A= =0A= this.xpath =3D this.matcher.join('');=0A= Selector._cache[this.expression] =3D this.xpath;=0A= },=0A= =0A= findElements: function(root) {=0A= root =3D root || document;=0A= if (this.xpath) return document._getElementsByXPath(this.xpath, = root);=0A= return this.matcher(root);=0A= },=0A= =0A= match: function(element) {=0A= this.tokens =3D [];=0A= =0A= var e =3D this.expression, ps =3D Selector.patterns, as =3D = Selector.assertions;=0A= var le, p, m;=0A= =0A= while (e && le !=3D=3D e && (/\S/).test(e)) {=0A= le =3D e;=0A= for (var i in ps) {=0A= p =3D ps[i];=0A= if (m =3D e.match(p)) {=0A= // use the Selector.assertions methods unless the selector=0A= // is too complex.=0A= if (as[i]) {=0A= this.tokens.push([i, Object.clone(m)]);=0A= e =3D e.replace(m[0], '');=0A= } else {=0A= // reluctantly do a document-wide search=0A= // and look for a match in the array=0A= return this.findElements(document).include(element);=0A= }=0A= }=0A= }=0A= }=0A= =0A= var match =3D true, name, matches;=0A= for (var i =3D 0, token; token =3D this.tokens[i]; i++) {=0A= name =3D token[0], matches =3D token[1];=0A= if (!Selector.assertions[name](element, matches)) {=0A= match =3D false; break;=0A= }=0A= }=0A= =0A= return match;=0A= },=0A= =0A= toString: function() {=0A= return this.expression;=0A= },=0A= =0A= inspect: function() {=0A= return "#";=0A= }=0A= });=0A= =0A= Object.extend(Selector, {=0A= _cache: { },=0A= =0A= xpath: {=0A= descendant: "//*",=0A= child: "/*",=0A= adjacent: "/following-sibling::*[1]",=0A= laterSibling: '/following-sibling::*',=0A= tagName: function(m) {=0A= if (m[1] =3D=3D '*') return '';=0A= return "[local-name()=3D'" + m[1].toLowerCase() +=0A= "' or local-name()=3D'" + m[1].toUpperCase() + "']";=0A= },=0A= className: "[contains(concat(' ', @class, ' '), ' #{1} ')]",=0A= id: "[@id=3D'#{1}']",=0A= attrPresence: function(m) {=0A= m[1] =3D m[1].toLowerCase();=0A= return new Template("[@#{1}]").evaluate(m);=0A= },=0A= attr: function(m) {=0A= m[1] =3D m[1].toLowerCase();=0A= m[3] =3D m[5] || m[6];=0A= return new Template(Selector.xpath.operators[m[2]]).evaluate(m);=0A= },=0A= pseudo: function(m) {=0A= var h =3D Selector.xpath.pseudos[m[1]];=0A= if (!h) return '';=0A= if (Object.isFunction(h)) return h(m);=0A= return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m);=0A= },=0A= operators: {=0A= '=3D': "[@#{1}=3D'#{3}']",=0A= '!=3D': "[@#{1}!=3D'#{3}']",=0A= '^=3D': "[starts-with(@#{1}, '#{3}')]",=0A= '$=3D': "[substring(@#{1}, (string-length(@#{1}) - = string-length('#{3}') + 1))=3D'#{3}']",=0A= '*=3D': "[contains(@#{1}, '#{3}')]",=0A= '~=3D': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]",=0A= '|=3D': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]"=0A= },=0A= pseudos: {=0A= 'first-child': '[not(preceding-sibling::*)]',=0A= 'last-child': '[not(following-sibling::*)]',=0A= 'only-child': '[not(preceding-sibling::* or = following-sibling::*)]',=0A= 'empty': "[count(*) =3D 0 and (count(text()) =3D 0 or = translate(text(), ' \t\r\n', '') =3D '')]",=0A= 'checked': "[@checked]",=0A= 'disabled': "[@disabled]",=0A= 'enabled': "[not(@disabled)]",=0A= 'not': function(m) {=0A= var e =3D m[6], p =3D Selector.patterns,=0A= x =3D Selector.xpath, le, v;=0A= =0A= var exclusion =3D [];=0A= while (e && le !=3D e && (/\S/).test(e)) {=0A= le =3D e;=0A= for (var i in p) {=0A= if (m =3D e.match(p[i])) {=0A= v =3D Object.isFunction(x[i]) ? x[i](m) : new = Template(x[i]).evaluate(m);=0A= exclusion.push("(" + v.substring(1, v.length - 1) + ")");=0A= e =3D e.replace(m[0], '');=0A= break;=0A= }=0A= }=0A= }=0A= return "[not(" + exclusion.join(" and ") + ")]";=0A= },=0A= 'nth-child': function(m) {=0A= return = Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ", m);=0A= },=0A= 'nth-last-child': function(m) {=0A= return = Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ", m);=0A= },=0A= 'nth-of-type': function(m) {=0A= return Selector.xpath.pseudos.nth("position() ", m);=0A= },=0A= 'nth-last-of-type': function(m) {=0A= return Selector.xpath.pseudos.nth("(last() + 1 - position()) ", = m);=0A= },=0A= 'first-of-type': function(m) {=0A= m[6] =3D "1"; return Selector.xpath.pseudos['nth-of-type'](m);=0A= },=0A= 'last-of-type': function(m) {=0A= m[6] =3D "1"; return = Selector.xpath.pseudos['nth-last-of-type'](m);=0A= },=0A= 'only-of-type': function(m) {=0A= var p =3D Selector.xpath.pseudos; return p['first-of-type'](m) + = p['last-of-type'](m);=0A= },=0A= nth: function(fragment, m) {=0A= var mm, formula =3D m[6], predicate;=0A= if (formula =3D=3D 'even') formula =3D '2n+0';=0A= if (formula =3D=3D 'odd') formula =3D '2n+1';=0A= if (mm =3D formula.match(/^(\d+)$/)) // digit only=0A= return '[' + fragment + "=3D " + mm[1] + ']';=0A= if (mm =3D formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b=0A= if (mm[1] =3D=3D "-") mm[1] =3D -1;=0A= var a =3D mm[1] ? Number(mm[1]) : 1;=0A= var b =3D mm[2] ? Number(mm[2]) : 0;=0A= predicate =3D "[((#{fragment} - #{b}) mod #{a} =3D 0) and " +=0A= "((#{fragment} - #{b}) div #{a} >=3D 0)]";=0A= return new Template(predicate).evaluate({=0A= fragment: fragment, a: a, b: b });=0A= }=0A= }=0A= }=0A= },=0A= =0A= criteria: {=0A= tagName: 'n =3D h.tagName(n, r, "#{1}", c); c =3D false;',=0A= className: 'n =3D h.className(n, r, "#{1}", c); c =3D false;',=0A= id: 'n =3D h.id(n, r, "#{1}", c); c =3D false;',=0A= attrPresence: 'n =3D h.attrPresence(n, r, "#{1}", c); c =3D false;',=0A= attr: function(m) {=0A= m[3] =3D (m[5] || m[6]);=0A= return new Template('n =3D h.attr(n, r, "#{1}", "#{3}", "#{2}", = c); c =3D false;').evaluate(m);=0A= },=0A= pseudo: function(m) {=0A= if (m[6]) m[6] =3D m[6].replace(/"/g, '\\"');=0A= return new Template('n =3D h.pseudo(n, "#{1}", "#{6}", r, c); c = =3D false;').evaluate(m);=0A= },=0A= descendant: 'c =3D "descendant";',=0A= child: 'c =3D "child";',=0A= adjacent: 'c =3D "adjacent";',=0A= laterSibling: 'c =3D "laterSibling";'=0A= },=0A= =0A= patterns: {=0A= // combinators must be listed first=0A= // (and descendant needs to be last combinator)=0A= laterSibling: /^\s*~\s*/,=0A= child: /^\s*>\s*/,=0A= adjacent: /^\s*\+\s*/,=0A= descendant: /^\s/,=0A= =0A= // selectors follow=0A= tagName: /^\s*(\*|[\w\-]+)(\b|$)?/,=0A= id: /^#([\w\-\*]+)(\b|$)/,=0A= className: /^\.([\w\-\*]+)(\b|$)/,=0A= pseudo:=0A= /^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis= )abled|not)(\((.*?)\))?(\b|$|(?=3D\s|[:+~>]))/,=0A= attrPresence: /^\[([\w]+)\]/,=0A= attr: = /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=3D)\s*((['"])([^\4]*?)\4|([^'"][^= \]]*?)))?\]/=0A= },=0A= =0A= // for Selector.match and Element#match=0A= assertions: {=0A= tagName: function(element, matches) {=0A= return matches[1].toUpperCase() =3D=3D = element.tagName.toUpperCase();=0A= },=0A= =0A= className: function(element, matches) {=0A= return Element.hasClassName(element, matches[1]);=0A= },=0A= =0A= id: function(element, matches) {=0A= return element.id =3D=3D=3D matches[1];=0A= },=0A= =0A= attrPresence: function(element, matches) {=0A= return Element.hasAttribute(element, matches[1]);=0A= },=0A= =0A= attr: function(element, matches) {=0A= var nodeValue =3D Element.readAttribute(element, matches[1]);=0A= return nodeValue && Selector.operators[matches[2]](nodeValue, = matches[5] || matches[6]);=0A= }=0A= },=0A= =0A= handlers: {=0A= // UTILITY FUNCTIONS=0A= // joins two collections=0A= concat: function(a, b) {=0A= for (var i =3D 0, node; node =3D b[i]; i++)=0A= a.push(node);=0A= return a;=0A= },=0A= =0A= // marks an array of nodes for counting=0A= mark: function(nodes) {=0A= var _true =3D Prototype.emptyFunction;=0A= for (var i =3D 0, node; node =3D nodes[i]; i++)=0A= node._countedByPrototype =3D _true;=0A= return nodes;=0A= },=0A= =0A= unmark: function(nodes) {=0A= for (var i =3D 0, node; node =3D nodes[i]; i++)=0A= node._countedByPrototype =3D undefined;=0A= return nodes;=0A= },=0A= =0A= // mark each child node with its position (for nth calls)=0A= // "ofType" flag indicates whether we're indexing for nth-of-type=0A= // rather than nth-child=0A= index: function(parentNode, reverse, ofType) {=0A= parentNode._countedByPrototype =3D Prototype.emptyFunction;=0A= if (reverse) {=0A= for (var nodes =3D parentNode.childNodes, i =3D nodes.length - = 1, j =3D 1; i >=3D 0; i--) {=0A= var node =3D nodes[i];=0A= if (node.nodeType =3D=3D 1 && (!ofType || = node._countedByPrototype)) node.nodeIndex =3D j++;=0A= }=0A= } else {=0A= for (var i =3D 0, j =3D 1, nodes =3D parentNode.childNodes; node = =3D nodes[i]; i++)=0A= if (node.nodeType =3D=3D 1 && (!ofType || = node._countedByPrototype)) node.nodeIndex =3D j++;=0A= }=0A= },=0A= =0A= // filters out duplicates and extends all nodes=0A= unique: function(nodes) {=0A= if (nodes.length =3D=3D 0) return nodes;=0A= var results =3D [], n;=0A= for (var i =3D 0, l =3D nodes.length; i < l; i++)=0A= if (!(n =3D nodes[i])._countedByPrototype) {=0A= n._countedByPrototype =3D Prototype.emptyFunction;=0A= results.push(Element.extend(n));=0A= }=0A= return Selector.handlers.unmark(results);=0A= },=0A= =0A= // COMBINATOR FUNCTIONS=0A= descendant: function(nodes) {=0A= var h =3D Selector.handlers;=0A= for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++)=0A= h.concat(results, node.getElementsByTagName('*'));=0A= return results;=0A= },=0A= =0A= child: function(nodes) {=0A= var h =3D Selector.handlers;=0A= for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) {=0A= for (var j =3D 0, child; child =3D node.childNodes[j]; j++)=0A= if (child.nodeType =3D=3D 1 && child.tagName !=3D '!') = results.push(child);=0A= }=0A= return results;=0A= },=0A= =0A= adjacent: function(nodes) {=0A= for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) {=0A= var next =3D this.nextElementSibling(node);=0A= if (next) results.push(next);=0A= }=0A= return results;=0A= },=0A= =0A= laterSibling: function(nodes) {=0A= var h =3D Selector.handlers;=0A= for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++)=0A= h.concat(results, Element.nextSiblings(node));=0A= return results;=0A= },=0A= =0A= nextElementSibling: function(node) {=0A= while (node =3D node.nextSibling)=0A= if (node.nodeType =3D=3D 1) return node;=0A= return null;=0A= },=0A= =0A= previousElementSibling: function(node) {=0A= while (node =3D node.previousSibling)=0A= if (node.nodeType =3D=3D 1) return node;=0A= return null;=0A= },=0A= =0A= // TOKEN FUNCTIONS=0A= tagName: function(nodes, root, tagName, combinator) {=0A= var uTagName =3D tagName.toUpperCase();=0A= var results =3D [], h =3D Selector.handlers;=0A= if (nodes) {=0A= if (combinator) {=0A= // fastlane for ordinary descendant combinators=0A= if (combinator =3D=3D "descendant") {=0A= for (var i =3D 0, node; node =3D nodes[i]; i++)=0A= h.concat(results, node.getElementsByTagName(tagName));=0A= return results;=0A= } else nodes =3D this[combinator](nodes);=0A= if (tagName =3D=3D "*") return nodes;=0A= }=0A= for (var i =3D 0, node; node =3D nodes[i]; i++)=0A= if (node.tagName.toUpperCase() =3D=3D=3D uTagName) = results.push(node);=0A= return results;=0A= } else return root.getElementsByTagName(tagName);=0A= },=0A= =0A= id: function(nodes, root, id, combinator) {=0A= var targetNode =3D $(id), h =3D Selector.handlers;=0A= if (!targetNode) return [];=0A= if (!nodes && root =3D=3D document) return [targetNode];=0A= if (nodes) {=0A= if (combinator) {=0A= if (combinator =3D=3D 'child') {=0A= for (var i =3D 0, node; node =3D nodes[i]; i++)=0A= if (targetNode.parentNode =3D=3D node) return [targetNode];=0A= } else if (combinator =3D=3D 'descendant') {=0A= for (var i =3D 0, node; node =3D nodes[i]; i++)=0A= if (Element.descendantOf(targetNode, node)) return = [targetNode];=0A= } else if (combinator =3D=3D 'adjacent') {=0A= for (var i =3D 0, node; node =3D nodes[i]; i++)=0A= if (Selector.handlers.previousElementSibling(targetNode) = =3D=3D node)=0A= return [targetNode];=0A= } else nodes =3D h[combinator](nodes);=0A= }=0A= for (var i =3D 0, node; node =3D nodes[i]; i++)=0A= if (node =3D=3D targetNode) return [targetNode];=0A= return [];=0A= }=0A= return (targetNode && Element.descendantOf(targetNode, root)) ? = [targetNode] : [];=0A= },=0A= =0A= className: function(nodes, root, className, combinator) {=0A= if (nodes && combinator) nodes =3D this[combinator](nodes);=0A= return Selector.handlers.byClassName(nodes, root, className);=0A= },=0A= =0A= byClassName: function(nodes, root, className) {=0A= if (!nodes) nodes =3D Selector.handlers.descendant([root]);=0A= var needle =3D ' ' + className + ' ';=0A= for (var i =3D 0, results =3D [], node, nodeClassName; node =3D = nodes[i]; i++) {=0A= nodeClassName =3D node.className;=0A= if (nodeClassName.length =3D=3D 0) continue;=0A= if (nodeClassName =3D=3D className || (' ' + nodeClassName + ' = ').include(needle))=0A= results.push(node);=0A= }=0A= return results;=0A= },=0A= =0A= attrPresence: function(nodes, root, attr, combinator) {=0A= if (!nodes) nodes =3D root.getElementsByTagName("*");=0A= if (nodes && combinator) nodes =3D this[combinator](nodes);=0A= var results =3D [];=0A= for (var i =3D 0, node; node =3D nodes[i]; i++)=0A= if (Element.hasAttribute(node, attr)) results.push(node);=0A= return results;=0A= },=0A= =0A= attr: function(nodes, root, attr, value, operator, combinator) {=0A= if (!nodes) nodes =3D root.getElementsByTagName("*");=0A= if (nodes && combinator) nodes =3D this[combinator](nodes);=0A= var handler =3D Selector.operators[operator], results =3D [];=0A= for (var i =3D 0, node; node =3D nodes[i]; i++) {=0A= var nodeValue =3D Element.readAttribute(node, attr);=0A= if (nodeValue =3D=3D=3D null) continue;=0A= if (handler(nodeValue, value)) results.push(node);=0A= }=0A= return results;=0A= },=0A= =0A= pseudo: function(nodes, name, value, root, combinator) {=0A= if (nodes && combinator) nodes =3D this[combinator](nodes);=0A= if (!nodes) nodes =3D root.getElementsByTagName("*");=0A= return Selector.pseudos[name](nodes, value, root);=0A= }=0A= },=0A= =0A= pseudos: {=0A= 'first-child': function(nodes, value, root) {=0A= for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) {=0A= if (Selector.handlers.previousElementSibling(node)) continue;=0A= results.push(node);=0A= }=0A= return results;=0A= },=0A= 'last-child': function(nodes, value, root) {=0A= for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) {=0A= if (Selector.handlers.nextElementSibling(node)) continue;=0A= results.push(node);=0A= }=0A= return results;=0A= },=0A= 'only-child': function(nodes, value, root) {=0A= var h =3D Selector.handlers;=0A= for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++)=0A= if (!h.previousElementSibling(node) && = !h.nextElementSibling(node))=0A= results.push(node);=0A= return results;=0A= },=0A= 'nth-child': function(nodes, formula, root) {=0A= return Selector.pseudos.nth(nodes, formula, root);=0A= },=0A= 'nth-last-child': function(nodes, formula, root) {=0A= return Selector.pseudos.nth(nodes, formula, root, true);=0A= },=0A= 'nth-of-type': function(nodes, formula, root) {=0A= return Selector.pseudos.nth(nodes, formula, root, false, true);=0A= },=0A= 'nth-last-of-type': function(nodes, formula, root) {=0A= return Selector.pseudos.nth(nodes, formula, root, true, true);=0A= },=0A= 'first-of-type': function(nodes, formula, root) {=0A= return Selector.pseudos.nth(nodes, "1", root, false, true);=0A= },=0A= 'last-of-type': function(nodes, formula, root) {=0A= return Selector.pseudos.nth(nodes, "1", root, true, true);=0A= },=0A= 'only-of-type': function(nodes, formula, root) {=0A= var p =3D Selector.pseudos;=0A= return p['last-of-type'](p['first-of-type'](nodes, formula, root), = formula, root);=0A= },=0A= =0A= // handles the an+b logic=0A= getIndices: function(a, b, total) {=0A= if (a =3D=3D 0) return b > 0 ? [b] : [];=0A= return $R(1, total).inject([], function(memo, i) {=0A= if (0 =3D=3D (i - b) % a && (i - b) / a >=3D 0) memo.push(i);=0A= return memo;=0A= });=0A= },=0A= =0A= // handles nth(-last)-child, nth(-last)-of-type, and = (first|last)-of-type=0A= nth: function(nodes, formula, root, reverse, ofType) {=0A= if (nodes.length =3D=3D 0) return [];=0A= if (formula =3D=3D 'even') formula =3D '2n+0';=0A= if (formula =3D=3D 'odd') formula =3D '2n+1';=0A= var h =3D Selector.handlers, results =3D [], indexed =3D [], m;=0A= h.mark(nodes);=0A= for (var i =3D 0, node; node =3D nodes[i]; i++) {=0A= if (!node.parentNode._countedByPrototype) {=0A= h.index(node.parentNode, reverse, ofType);=0A= indexed.push(node.parentNode);=0A= }=0A= }=0A= if (formula.match(/^\d+$/)) { // just a number=0A= formula =3D Number(formula);=0A= for (var i =3D 0, node; node =3D nodes[i]; i++)=0A= if (node.nodeIndex =3D=3D formula) results.push(node);=0A= } else if (m =3D formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // = an+b=0A= if (m[1] =3D=3D "-") m[1] =3D -1;=0A= var a =3D m[1] ? Number(m[1]) : 1;=0A= var b =3D m[2] ? Number(m[2]) : 0;=0A= var indices =3D Selector.pseudos.getIndices(a, b, nodes.length);=0A= for (var i =3D 0, node, l =3D indices.length; node =3D nodes[i]; = i++) {=0A= for (var j =3D 0; j < l; j++)=0A= if (node.nodeIndex =3D=3D indices[j]) results.push(node);=0A= }=0A= }=0A= h.unmark(nodes);=0A= h.unmark(indexed);=0A= return results;=0A= },=0A= =0A= 'empty': function(nodes, value, root) {=0A= for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) {=0A= // IE treats comments as element nodes=0A= if (node.tagName =3D=3D '!' || (node.firstChild && = !node.innerHTML.match(/^\s*$/))) continue;=0A= results.push(node);=0A= }=0A= return results;=0A= },=0A= =0A= 'not': function(nodes, selector, root) {=0A= var h =3D Selector.handlers, selectorType, m;=0A= var exclusions =3D new Selector(selector).findElements(root);=0A= h.mark(exclusions);=0A= for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++)=0A= if (!node._countedByPrototype) results.push(node);=0A= h.unmark(exclusions);=0A= return results;=0A= },=0A= =0A= 'enabled': function(nodes, value, root) {=0A= for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++)=0A= if (!node.disabled) results.push(node);=0A= return results;=0A= },=0A= =0A= 'disabled': function(nodes, value, root) {=0A= for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++)=0A= if (node.disabled) results.push(node);=0A= return results;=0A= },=0A= =0A= 'checked': function(nodes, value, root) {=0A= for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++)=0A= if (node.checked) results.push(node);=0A= return results;=0A= }=0A= },=0A= =0A= operators: {=0A= '=3D': function(nv, v) { return nv =3D=3D v; },=0A= '!=3D': function(nv, v) { return nv !=3D v; },=0A= '^=3D': function(nv, v) { return nv.startsWith(v); },=0A= '$=3D': function(nv, v) { return nv.endsWith(v); },=0A= '*=3D': function(nv, v) { return nv.include(v); },=0A= '~=3D': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + = ' '); },=0A= '|=3D': function(nv, v) { return ('-' + nv.toUpperCase() + = '-').include('-' + v.toUpperCase() + '-'); }=0A= },=0A= =0A= split: function(expression) {=0A= var expressions =3D [];=0A= expression.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, = function(m) {=0A= expressions.push(m[1].strip());=0A= });=0A= return expressions;=0A= },=0A= =0A= matchElements: function(elements, expression) {=0A= var matches =3D $$(expression), h =3D Selector.handlers;=0A= h.mark(matches);=0A= for (var i =3D 0, results =3D [], element; element =3D elements[i]; = i++)=0A= if (element._countedByPrototype) results.push(element);=0A= h.unmark(matches);=0A= return results;=0A= },=0A= =0A= findElement: function(elements, expression, index) {=0A= if (Object.isNumber(expression)) {=0A= index =3D expression; expression =3D false;=0A= }=0A= return Selector.matchElements(elements, expression || '*')[index || = 0];=0A= },=0A= =0A= findChildElements: function(element, expressions) {=0A= expressions =3D Selector.split(expressions.join(','));=0A= var results =3D [], h =3D Selector.handlers;=0A= for (var i =3D 0, l =3D expressions.length, selector; i < l; i++) {=0A= selector =3D new Selector(expressions[i].strip());=0A= h.concat(results, selector.findElements(element));=0A= }=0A= return (l > 1) ? h.unique(results) : results;=0A= }=0A= });=0A= =0A= if (Prototype.Browser.IE) {=0A= Object.extend(Selector.handlers, {=0A= // IE returns comment nodes on getElementsByTagName("*").=0A= // Filter them out.=0A= concat: function(a, b) {=0A= for (var i =3D 0, node; node =3D b[i]; i++)=0A= if (node.tagName !=3D=3D "!") a.push(node);=0A= return a;=0A= },=0A= =0A= // IE improperly serializes _countedByPrototype in (inner|outer)HTML.=0A= unmark: function(nodes) {=0A= for (var i =3D 0, node; node =3D nodes[i]; i++)=0A= node.removeAttribute('_countedByPrototype');=0A= return nodes;=0A= }=0A= });=0A= }=0A= =0A= function $$() {=0A= return Selector.findChildElements(document, $A(arguments));=0A= }=0A= var Form =3D {=0A= reset: function(form) {=0A= $(form).reset();=0A= return form;=0A= },=0A= =0A= serializeElements: function(elements, options) {=0A= if (typeof options !=3D 'object') options =3D { hash: !!options };=0A= else if (Object.isUndefined(options.hash)) options.hash =3D true;=0A= var key, value, submitted =3D false, submit =3D options.submit;=0A= =0A= var data =3D elements.inject({ }, function(result, element) {=0A= if (!element.disabled && element.name) {=0A= key =3D element.name; value =3D $(element).getValue();=0A= if (value !=3D null && (element.type !=3D 'submit' || = (!submitted &&=0A= submit !=3D=3D false && (!submit || key =3D=3D submit) && = (submitted =3D true)))) {=0A= if (key in result) {=0A= // a key is already present; construct an array of values=0A= if (!Object.isArray(result[key])) result[key] =3D = [result[key]];=0A= result[key].push(value);=0A= }=0A= else result[key] =3D value;=0A= }=0A= }=0A= return result;=0A= });=0A= =0A= return options.hash ? data : Object.toQueryString(data);=0A= }=0A= };=0A= =0A= Form.Methods =3D {=0A= serialize: function(form, options) {=0A= return Form.serializeElements(Form.getElements(form), options);=0A= },=0A= =0A= getElements: function(form) {=0A= return $A($(form).getElementsByTagName('*')).inject([],=0A= function(elements, child) {=0A= if (Form.Element.Serializers[child.tagName.toLowerCase()])=0A= elements.push(Element.extend(child));=0A= return elements;=0A= }=0A= );=0A= },=0A= =0A= getInputs: function(form, typeName, name) {=0A= form =3D $(form);=0A= var inputs =3D form.getElementsByTagName('input');=0A= =0A= if (!typeName && !name) return $A(inputs).map(Element.extend);=0A= =0A= for (var i =3D 0, matchingInputs =3D [], length =3D inputs.length; i = < length; i++) {=0A= var input =3D inputs[i];=0A= if ((typeName && input.type !=3D typeName) || (name && input.name = !=3D name))=0A= continue;=0A= matchingInputs.push(Element.extend(input));=0A= }=0A= =0A= return matchingInputs;=0A= },=0A= =0A= disable: function(form) {=0A= form =3D $(form);=0A= Form.getElements(form).invoke('disable');=0A= return form;=0A= },=0A= =0A= enable: function(form) {=0A= form =3D $(form);=0A= Form.getElements(form).invoke('enable');=0A= return form;=0A= },=0A= =0A= findFirstElement: function(form) {=0A= var elements =3D $(form).getElements().findAll(function(element) {=0A= return 'hidden' !=3D element.type && !element.disabled;=0A= });=0A= var firstByIndex =3D elements.findAll(function(element) {=0A= return element.hasAttribute('tabIndex') && element.tabIndex >=3D 0;=0A= }).sortBy(function(element) { return element.tabIndex }).first();=0A= =0A= return firstByIndex ? firstByIndex : elements.find(function(element) = {=0A= return ['input', 'select', = 'textarea'].include(element.tagName.toLowerCase());=0A= });=0A= },=0A= =0A= focusFirstElement: function(form) {=0A= form =3D $(form);=0A= form.findFirstElement().activate();=0A= return form;=0A= },=0A= =0A= request: function(form, options) {=0A= form =3D $(form), options =3D Object.clone(options || { });=0A= =0A= var params =3D options.parameters, action =3D = form.readAttribute('action') || '';=0A= if (action.blank()) action =3D window.location.href;=0A= options.parameters =3D form.serialize(true);=0A= =0A= if (params) {=0A= if (Object.isString(params)) params =3D params.toQueryParams();=0A= Object.extend(options.parameters, params);=0A= }=0A= =0A= if (form.hasAttribute('method') && !options.method)=0A= options.method =3D form.method;=0A= =0A= return new Ajax.Request(action, options);=0A= }=0A= };=0A= =0A= /*-----------------------------------------------------------------------= ---*/=0A= =0A= Form.Element =3D {=0A= focus: function(element) {=0A= $(element).focus();=0A= return element;=0A= },=0A= =0A= select: function(element) {=0A= $(element).select();=0A= return element;=0A= }=0A= };=0A= =0A= Form.Element.Methods =3D {=0A= serialize: function(element) {=0A= element =3D $(element);=0A= if (!element.disabled && element.name) {=0A= var value =3D element.getValue();=0A= if (value !=3D undefined) {=0A= var pair =3D { };=0A= pair[element.name] =3D value;=0A= return Object.toQueryString(pair);=0A= }=0A= }=0A= return '';=0A= },=0A= =0A= getValue: function(element) {=0A= element =3D $(element);=0A= var method =3D element.tagName.toLowerCase();=0A= return Form.Element.Serializers[method](element);=0A= },=0A= =0A= setValue: function(element, value) {=0A= element =3D $(element);=0A= var method =3D element.tagName.toLowerCase();=0A= Form.Element.Serializers[method](element, value);=0A= return element;=0A= },=0A= =0A= clear: function(element) {=0A= $(element).value =3D '';=0A= return element;=0A= },=0A= =0A= present: function(element) {=0A= return $(element).value !=3D '';=0A= },=0A= =0A= activate: function(element) {=0A= element =3D $(element);=0A= try {=0A= element.focus();=0A= if (element.select && (element.tagName.toLowerCase() !=3D 'input' = ||=0A= !['button', 'reset', 'submit'].include(element.type)))=0A= element.select();=0A= } catch (e) { }=0A= return element;=0A= },=0A= =0A= disable: function(element) {=0A= element =3D $(element);=0A= element.blur();=0A= element.disabled =3D true;=0A= return element;=0A= },=0A= =0A= enable: function(element) {=0A= element =3D $(element);=0A= element.disabled =3D false;=0A= return element;=0A= }=0A= };=0A= =0A= /*-----------------------------------------------------------------------= ---*/=0A= =0A= var Field =3D Form.Element;=0A= var $F =3D Form.Element.Methods.getValue;=0A= =0A= /*-----------------------------------------------------------------------= ---*/=0A= =0A= Form.Element.Serializers =3D {=0A= input: function(element, value) {=0A= switch (element.type.toLowerCase()) {=0A= case 'checkbox':=0A= case 'radio':=0A= return Form.Element.Serializers.inputSelector(element, value);=0A= default:=0A= return Form.Element.Serializers.textarea(element, value);=0A= }=0A= },=0A= =0A= inputSelector: function(element, value) {=0A= if (Object.isUndefined(value)) return element.checked ? = element.value : null;=0A= else element.checked =3D !!value;=0A= },=0A= =0A= textarea: function(element, value) {=0A= if (Object.isUndefined(value)) return element.value;=0A= else element.value =3D value;=0A= },=0A= =0A= select: function(element, index) {=0A= if (Object.isUndefined(index))=0A= return this[element.type =3D=3D 'select-one' ?=0A= 'selectOne' : 'selectMany'](element);=0A= else {=0A= var opt, value, single =3D !Object.isArray(index);=0A= for (var i =3D 0, length =3D element.length; i < length; i++) {=0A= opt =3D element.options[i];=0A= value =3D this.optionValue(opt);=0A= if (single) {=0A= if (value =3D=3D index) {=0A= opt.selected =3D true;=0A= return;=0A= }=0A= }=0A= else opt.selected =3D index.include(value);=0A= }=0A= }=0A= },=0A= =0A= selectOne: function(element) {=0A= var index =3D element.selectedIndex;=0A= return index >=3D 0 ? this.optionValue(element.options[index]) : = null;=0A= },=0A= =0A= selectMany: function(element) {=0A= var values, length =3D element.length;=0A= if (!length) return null;=0A= =0A= for (var i =3D 0, values =3D []; i < length; i++) {=0A= var opt =3D element.options[i];=0A= if (opt.selected) values.push(this.optionValue(opt));=0A= }=0A= return values;=0A= },=0A= =0A= optionValue: function(opt) {=0A= // extend element because hasAttribute may not be native=0A= return Element.extend(opt).hasAttribute('value') ? opt.value : = opt.text;=0A= }=0A= };=0A= =0A= /*-----------------------------------------------------------------------= ---*/=0A= =0A= Abstract.TimedObserver =3D Class.create(PeriodicalExecuter, {=0A= initialize: function($super, element, frequency, callback) {=0A= $super(callback, frequency);=0A= this.element =3D $(element);=0A= this.lastValue =3D this.getValue();=0A= },=0A= =0A= execute: function() {=0A= var value =3D this.getValue();=0A= if (Object.isString(this.lastValue) && Object.isString(value) ?=0A= this.lastValue !=3D value : String(this.lastValue) !=3D = String(value)) {=0A= this.callback(this.element, value);=0A= this.lastValue =3D value;=0A= }=0A= }=0A= });=0A= =0A= Form.Element.Observer =3D Class.create(Abstract.TimedObserver, {=0A= getValue: function() {=0A= return Form.Element.getValue(this.element);=0A= }=0A= });=0A= =0A= Form.Observer =3D Class.create(Abstract.TimedObserver, {=0A= getValue: function() {=0A= return Form.serialize(this.element);=0A= }=0A= });=0A= =0A= /*-----------------------------------------------------------------------= ---*/=0A= =0A= Abstract.EventObserver =3D Class.create({=0A= initialize: function(element, callback) {=0A= this.element =3D $(element);=0A= this.callback =3D callback;=0A= =0A= this.lastValue =3D this.getValue();=0A= if (this.element.tagName.toLowerCase() =3D=3D 'form')=0A= this.registerFormCallbacks();=0A= else=0A= this.registerCallback(this.element);=0A= },=0A= =0A= onElementEvent: function() {=0A= var value =3D this.getValue();=0A= if (this.lastValue !=3D value) {=0A= this.callback(this.element, value);=0A= this.lastValue =3D value;=0A= }=0A= },=0A= =0A= registerFormCallbacks: function() {=0A= Form.getElements(this.element).each(this.registerCallback, this);=0A= },=0A= =0A= registerCallback: function(element) {=0A= if (element.type) {=0A= switch (element.type.toLowerCase()) {=0A= case 'checkbox':=0A= case 'radio':=0A= Event.observe(element, 'click', = this.onElementEvent.bind(this));=0A= break;=0A= default:=0A= Event.observe(element, 'change', = this.onElementEvent.bind(this));=0A= break;=0A= }=0A= }=0A= }=0A= });=0A= =0A= Form.Element.EventObserver =3D Class.create(Abstract.EventObserver, {=0A= getValue: function() {=0A= return Form.Element.getValue(this.element);=0A= }=0A= });=0A= =0A= Form.EventObserver =3D Class.create(Abstract.EventObserver, {=0A= getValue: function() {=0A= return Form.serialize(this.element);=0A= }=0A= });=0A= if (!window.Event) var Event =3D { };=0A= =0A= Object.extend(Event, {=0A= KEY_BACKSPACE: 8,=0A= KEY_TAB: 9,=0A= KEY_RETURN: 13,=0A= KEY_ESC: 27,=0A= KEY_LEFT: 37,=0A= KEY_UP: 38,=0A= KEY_RIGHT: 39,=0A= KEY_DOWN: 40,=0A= KEY_DELETE: 46,=0A= KEY_HOME: 36,=0A= KEY_END: 35,=0A= KEY_PAGEUP: 33,=0A= KEY_PAGEDOWN: 34,=0A= KEY_INSERT: 45,=0A= =0A= cache: { },=0A= =0A= relatedTarget: function(event) {=0A= var element;=0A= switch(event.type) {=0A= case 'mouseover': element =3D event.fromElement; break;=0A= case 'mouseout': element =3D event.toElement; break;=0A= default: return null;=0A= }=0A= return Element.extend(element);=0A= }=0A= });=0A= =0A= Event.Methods =3D (function() {=0A= var isButton;=0A= =0A= if (Prototype.Browser.IE) {=0A= var buttonMap =3D { 0: 1, 1: 4, 2: 2 };=0A= isButton =3D function(event, code) {=0A= return event.button =3D=3D buttonMap[code];=0A= };=0A= =0A= } else if (Prototype.Browser.WebKit) {=0A= isButton =3D function(event, code) {=0A= switch (code) {=0A= case 0: return event.which =3D=3D 1 && !event.metaKey;=0A= case 1: return event.which =3D=3D 1 && event.metaKey;=0A= default: return false;=0A= }=0A= };=0A= =0A= } else {=0A= isButton =3D function(event, code) {=0A= return event.which ? (event.which =3D=3D=3D code + 1) : = (event.button =3D=3D=3D code);=0A= };=0A= }=0A= =0A= return {=0A= isLeftClick: function(event) { return isButton(event, 0) },=0A= isMiddleClick: function(event) { return isButton(event, 1) },=0A= isRightClick: function(event) { return isButton(event, 2) },=0A= =0A= element: function(event) {=0A= var node =3D Event.extend(event).target;=0A= return Element.extend(node.nodeType =3D=3D Node.TEXT_NODE ? = node.parentNode : node);=0A= },=0A= =0A= findElement: function(event, expression) {=0A= var element =3D Event.element(event);=0A= if (!expression) return element;=0A= var elements =3D [element].concat(element.ancestors());=0A= return Selector.findElement(elements, expression, 0);=0A= },=0A= =0A= pointer: function(event) {=0A= return {=0A= x: event.pageX || (event.clientX +=0A= (document.documentElement.scrollLeft || = document.body.scrollLeft)),=0A= y: event.pageY || (event.clientY +=0A= (document.documentElement.scrollTop || = document.body.scrollTop))=0A= };=0A= },=0A= =0A= pointerX: function(event) { return Event.pointer(event).x },=0A= pointerY: function(event) { return Event.pointer(event).y },=0A= =0A= stop: function(event) {=0A= Event.extend(event);=0A= event.preventDefault();=0A= event.stopPropagation();=0A= event.stopped =3D true;=0A= }=0A= };=0A= })();=0A= =0A= Event.extend =3D (function() {=0A= var methods =3D Object.keys(Event.Methods).inject({ }, function(m, = name) {=0A= m[name] =3D Event.Methods[name].methodize();=0A= return m;=0A= });=0A= =0A= if (Prototype.Browser.IE) {=0A= Object.extend(methods, {=0A= stopPropagation: function() { this.cancelBubble =3D true },=0A= preventDefault: function() { this.returnValue =3D false },=0A= inspect: function() { return "[object Event]" }=0A= });=0A= =0A= return function(event) {=0A= if (!event) return false;=0A= if (event._extendedByPrototype) return event;=0A= =0A= event._extendedByPrototype =3D Prototype.emptyFunction;=0A= var pointer =3D Event.pointer(event);=0A= Object.extend(event, {=0A= target: event.srcElement,=0A= relatedTarget: Event.relatedTarget(event),=0A= pageX: pointer.x,=0A= pageY: pointer.y=0A= });=0A= return Object.extend(event, methods);=0A= };=0A= =0A= } else {=0A= Event.prototype =3D Event.prototype || = document.createEvent("HTMLEvents").__proto__;=0A= Object.extend(Event.prototype, methods);=0A= return Prototype.K;=0A= }=0A= })();=0A= =0A= Object.extend(Event, (function() {=0A= var cache =3D Event.cache;=0A= =0A= function getEventID(element) {=0A= if (element._prototypeEventID) return element._prototypeEventID[0];=0A= arguments.callee.id =3D arguments.callee.id || 1;=0A= return element._prototypeEventID =3D [++arguments.callee.id];=0A= }=0A= =0A= function getDOMEventName(eventName) {=0A= if (eventName && eventName.include(':')) return "dataavailable";=0A= return eventName;=0A= }=0A= =0A= function getCacheForID(id) {=0A= return cache[id] =3D cache[id] || { };=0A= }=0A= =0A= function getWrappersForEventName(id, eventName) {=0A= var c =3D getCacheForID(id);=0A= return c[eventName] =3D c[eventName] || [];=0A= }=0A= =0A= function createWrapper(element, eventName, handler) {=0A= var id =3D getEventID(element);=0A= var c =3D getWrappersForEventName(id, eventName);=0A= if (c.pluck("handler").include(handler)) return false;=0A= =0A= var wrapper =3D function(event) {=0A= if (!Event || !Event.extend ||=0A= (event.eventName && event.eventName !=3D eventName))=0A= return false;=0A= =0A= Event.extend(event);=0A= handler.call(element, event);=0A= };=0A= =0A= wrapper.handler =3D handler;=0A= c.push(wrapper);=0A= return wrapper;=0A= }=0A= =0A= function findWrapper(id, eventName, handler) {=0A= var c =3D getWrappersForEventName(id, eventName);=0A= return c.find(function(wrapper) { return wrapper.handler =3D=3D = handler });=0A= }=0A= =0A= function destroyWrapper(id, eventName, handler) {=0A= var c =3D getCacheForID(id);=0A= if (!c[eventName]) return false;=0A= c[eventName] =3D c[eventName].without(findWrapper(id, eventName, = handler));=0A= }=0A= =0A= function destroyCache() {=0A= for (var id in cache)=0A= for (var eventName in cache[id])=0A= cache[id][eventName] =3D null;=0A= }=0A= =0A= if (window.attachEvent) {=0A= window.attachEvent("onunload", destroyCache);=0A= }=0A= =0A= return {=0A= observe: function(element, eventName, handler) {=0A= element =3D $(element);=0A= var name =3D getDOMEventName(eventName);=0A= =0A= var wrapper =3D createWrapper(element, eventName, handler);=0A= if (!wrapper) return element;=0A= =0A= if (element.addEventListener) {=0A= element.addEventListener(name, wrapper, false);=0A= } else {=0A= element.attachEvent("on" + name, wrapper);=0A= }=0A= =0A= return element;=0A= },=0A= =0A= stopObserving: function(element, eventName, handler) {=0A= element =3D $(element);=0A= var id =3D getEventID(element), name =3D = getDOMEventName(eventName);=0A= =0A= if (!handler && eventName) {=0A= getWrappersForEventName(id, eventName).each(function(wrapper) {=0A= element.stopObserving(eventName, wrapper.handler);=0A= });=0A= return element;=0A= =0A= } else if (!eventName) {=0A= Object.keys(getCacheForID(id)).each(function(eventName) {=0A= element.stopObserving(eventName);=0A= });=0A= return element;=0A= }=0A= =0A= var wrapper =3D findWrapper(id, eventName, handler);=0A= if (!wrapper) return element;=0A= =0A= if (element.removeEventListener) {=0A= element.removeEventListener(name, wrapper, false);=0A= } else {=0A= element.detachEvent("on" + name, wrapper);=0A= }=0A= =0A= destroyWrapper(id, eventName, handler);=0A= =0A= return element;=0A= },=0A= =0A= fire: function(element, eventName, memo) {=0A= element =3D $(element);=0A= if (element =3D=3D document && document.createEvent && = !element.dispatchEvent)=0A= element =3D document.documentElement;=0A= =0A= var event;=0A= if (document.createEvent) {=0A= event =3D document.createEvent("HTMLEvents");=0A= event.initEvent("dataavailable", true, true);=0A= } else {=0A= event =3D document.createEventObject();=0A= event.eventType =3D "ondataavailable";=0A= }=0A= =0A= event.eventName =3D eventName;=0A= event.memo =3D memo || { };=0A= =0A= if (document.createEvent) {=0A= element.dispatchEvent(event);=0A= } else {=0A= element.fireEvent(event.eventType, event);=0A= }=0A= =0A= return Event.extend(event);=0A= }=0A= };=0A= })());=0A= =0A= Object.extend(Event, Event.Methods);=0A= =0A= Element.addMethods({=0A= fire: Event.fire,=0A= observe: Event.observe,=0A= stopObserving: Event.stopObserving=0A= });=0A= =0A= Object.extend(document, {=0A= fire: Element.Methods.fire.methodize(),=0A= observe: Element.Methods.observe.methodize(),=0A= stopObserving: Element.Methods.stopObserving.methodize(),=0A= loaded: false=0A= });=0A= =0A= (function() {=0A= /* Support for the DOMContentLoaded event is based on work by Dan Webb,=0A= Matthias Miller, Dean Edwards and John Resig. */=0A= =0A= var timer;=0A= =0A= function fireContentLoadedEvent() {=0A= if (document.loaded) return;=0A= if (timer) window.clearInterval(timer);=0A= document.fire("dom:loaded");=0A= document.loaded =3D true;=0A= }=0A= =0A= if (document.addEventListener) {=0A= if (Prototype.Browser.WebKit) {=0A= timer =3D window.setInterval(function() {=0A= if (/loaded|complete/.test(document.readyState))=0A= fireContentLoadedEvent();=0A= }, 0);=0A= =0A= Event.observe(window, "load", fireContentLoadedEvent);=0A= =0A= } else {=0A= document.addEventListener("DOMContentLoaded",=0A= fireContentLoadedEvent, false);=0A= }=0A= =0A= } else {=0A= document.write("