From: Subject: =?windows-1250?B?2nZvZCB8IFBSQUhBIFNUT1bMjkFUwQ==?= Date: Sun, 27 Jul 2008 08:13:16 +0200 MIME-Version: 1.0 Content-Type: multipart/related; type="text/html"; boundary="----=_NextPart_000_0000_01C8EFC0.9F226590" X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 This is a multi-part message in MIME format. ------=_NextPart_000_0000_01C8EFC0.9F226590 Content-Type: text/html; charset="windows-1250" Content-Transfer-Encoding: quoted-printable Content-Location: http://www.stovezata.praha.eu/index.html =DAvod | PRAHA = STOV=CC=8EAT=C1
praha.eu | magistrat.praha.eu | pis.cz

Praha stov=C4=9B=C5=BEat=C3=A1

virtu=C3=A1ln=C3­ prohl=C3­dka z = pra=C5=BEsk=C3=BDch v=C4=9B=C5=BE=C3­

=20

N=E1hodn=EC vybran=E1 lokalita: Vod=E1re= nsk=E1 v=EC=9E=20 D=ECv=EDn, Praha 5 - Sm=EDchov


Pozor!=20 Na=9Ae automatick=E1 detekce zistila, =9Ee nem=E1te nainstalovan=FD = Adobe Flash Player=20 veze 9 a vy=9A=9A=ED, kter=FD je nutn=FD pro zobrazen=ED virtu=E1ln=EDch = prohl=EDdek na tomto=20 port=E1lu. St=E1hnout a instalovat si jej m=F9=9Eete kliknut=EDm sem.
Seznam = v=9Aech
katastr=E1ln=ED = =E8len=ECn=ED
Star=E9 = M=ECsto ( 17 ) Nov=E9 M=ECsto = ( 22 ) Mal=E1 Strana = ( 9 ) Hrad=E8any ( = 11 ) Vy=9Aehrad ( 1 = ) Vinohrady ( 5 = ) Troja ( 2 = ) Josefov ( 1 = ) Nusle ( 2 = ) Sm=EDchov ( 8 = ) Bubene=E8 ( 1 = ) =8Ei=9Ekov ( = 3 ) Bran=EDk ( 2 = ) Podol=ED ( 1 = ) Ko=9A=ED=F8e = ( 1 ) Hlubo=E8epy ( = 1 ) Dejvice ( 2 = ) St=F8e=9Aovice= ( 1 ) B=F8evnov ( 1 = ) Hole=9Aovice = ( 4 ) Karl=EDn ( 1 = ) Vr=9Aovice ( = 3 )
administrativn=ED=20 =E8len=ECn=ED
Praha 1 ( 50 = ) Praha 2 ( 15 = ) Praha 3 ( 3 = ) Praha 4 ( 6 = ) Praha 5 ( 10 = ) Praha 6 ( 5 = ) Praha 7 ( 6 = ) Praha 8 ( 1 = ) Praha 10 ( 4 = )
kategorie

Praha Stov=EC=9Eat=E1

M=ECsto Praha je ov=ECn=E8eno mnoha lichotiv=FDmi p=F8=EDzvisky. Mezi = velmi =E8asto=20 pou=9E=EDvan=E1 pat=F8=ED =96 stov=EC=9Eat=E9 m=ECsto nad Vltavou. = Skute=E8n=EC, pod=EDv=E1me=96li se z=20 n=ECkter=E9ho vyhl=EDdkov=E9ho bodu, vid=EDme doslova les v=EC=9E=ED a = v=EC=9Ei=E8ek. V=EC=9Ee dekoruj=ED=20 =E8etn=E9 sakr=E1ln=ED stavby, ale upozor=F2uj=ED i na v=FDznamn=E9 = ve=F8ejn=E9 budovy. V panoramatu=20 m=ECsta se t=E9=9E v=FDrazn=EC uplat=F2uj=ED historick=E9 vod=E1rensk=E9 = v=EC=9Ee, v minulosti zcela=20 nezbytn=E9 pro =9Eivot m=ECsta, stejn=EC jako samostatn=EC stoj=EDc=ED = zvonice. Pov=ECt=9Ainou=20 n=E1ro=9En=ED v=EC=9Ee zdob=ED i n=ECkter=E9 pal=E1ce a = m=EC=9A=9Dansk=E9 domy, p=F8edev=9A=EDm na Star=E9m a=20 Nov=E9m M=ECst=EC, Mal=E9 Stran=EC a Hrad=E8anech. I na=9Ae doba = p=F8isp=ECla do celkov=E9ho v=FD=E8tu=20 mnoh=FDmi stavbami industri=E1ln=ED architektury. M=F9=9Eeme tak = konstatovat, =9Ee ozna=E8en=ED=20 Praha stov=EC=9Eat=E1, je v=EDce ne=9E historick=E1 z=E1le=9Eitost. = Pra=9Esk=FDch v=EC=9E=ED a v=EC=9Ei=E8ek je=20 ve skute=E8nosti n=ECkolik tis=EDc. Proto n=E1sleduj=EDc=ED = virtu=E1ln=ED prohl=EDdka a dopl=F2uj=EDc=ED=20 texty zat=EDm zahrnuj=ED pouh=FD zlomek. V=EC=F8=EDme, =9Ee v=EC=9Ee = nejzn=E1m=ECj=9A=ED a nejzaj=EDmav=ECj=9A=ED,=20 nav=EDc mnoh=E9 z nich p=F8=EDstupn=E9 ve=F8ejnosti.


Novinky

  • 30/05/2008=20

    Publikov=E1no 100 virtu=E1ln=EDch prohl=EDdek z pra=9Esk=FDch = v=EC=9E=ED

    Ofici=E1ln=ED spu=9At=ECn=ED port=E1lu.


2008 =A9 Magistr=E1t = hl. m. Prahy=20 & Panoramas s.r.o., = v=9Aechna pr=E1va=20 vyhrazena
=20
------=_NextPart_000_0000_01C8EFC0.9F226590 Content-Type: application/octet-stream Content-Transfer-Encoding: base64 Content-Location: http://toplist.cz/dot.asp?id=792951 R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAEALAAAAAABAAEAAAIBTAA7 ------=_NextPart_000_0000_01C8EFC0.9F226590 Content-Type: image/gif Content-Transfer-Encoding: base64 Content-Location: http://www.stovezata.praha.eu/css2/images/search_submit.gif R0lGODlhZQAWAOYAADMzMw8PDxUVFTExMTU1NQcHBzc3NwUFBTIyMi8vLy4uLgkJCQ4ODjQ0NAyl ywWexA6nzQOcwg6mzQsLCy0tLSwsLBQUFCYmJhERERh+lwdUZxp/mQ0NDRAQEAlviCsrKykpKRMT EycnJyEhIQtwighthx2CnAa55RyCmxuBmgSdwyMjIxl+mAWdxB2DnA+bvg2mzAV4lC47PgPC8gHA 8ASQsxEeIR9rfxsbGx8fHxBDUA+nzh54jgWEpBYWFitfayZZZgK14SRxhB4eHiJuggqv2SAgIAsY GyxSXAhIWAa45S9JTxgYGAO14gOo0ge55gOp0iRXZDJLUgaStQ4bHgPD8iNjcwpKWgpkeiFhcTA9 QChOWC06PRSUsyVYZRiKpweTtgk8SRaJpQwzPAs+SxE3QQ81PwdgdwokKhApMAxMXASq0wZshSRw hBGdwDY2NhISEgwMDDAwMAgICDg4OAYGBgEBATo6OgoKCgICAgQEBDk5OTs7Ozw8PADM/wAAACH5 BAAAAAAALAAAAABlABYAAAf/gBcXInJvfIeIiXx9jI2Oj5CRkpOUlY2KmG9yIoIXIHR3oaJ3iJam p6ipj4ijonQgggZ7s7R7oaWqubq5rHe1tAYXcnTExLSiuLvKy5C9vrPFxHIEBtUGxse3mNvc3d7f 4N2itcTWBgTo6G/VdL+t761CLj+i8vQufjvw8Dt+LvsAA4b6Rafam3QEAChs0IDAm3XXsP2aSAuC HxMVL+4x4QcCRYoWMX6U0kbkR4rFDB5kqBAAgpcIADB0+JBdtJs4LaIoppMOio44g9LpKfQnBKFI Va5s4BKmnKdyBrxc2DDdw6tYs0rwk+Lq1q4p/Ei4ykOCBCJXkXSRkOLrmyU8/9xI+LLkDZEnfqpI QJK170OELJsOgCpHgYIECaAOkAqzpePHjmH4gbGh8gk/GwBsmKywiJ8il8UAAOKntOnMViZfnqFl s2kgkGMrhIlgMVTEhitUoEDBMGLChBcLHz7cgenjLAaw8ONgwA3mA2RclvHCz4sBW2b4SR59gJfL N5RDJ07eNvCnuBXw1v2hvW7ehg8jTny+vhzjDjLoV+Ing5wMzMlRnRIOOKBdFKVl8ZRx/nFRnWn+ AeiAffbNl0B861XQ3gcggCDCEEzAEcKIFpRogQAopqjiigI84AcJKboIIwl+PNCiH008oOMDZZSm A4oy3giGDmu8KACNNrKoZP+KJlowYghwMDGECB2KsAIcAQTQwZYYdIkBHGCGKeaYYLbghwdhmomm B360AAcWfkCRBpg2wGHmFHCYQcOZcJSmhg1B8MlmEHWSaWiYXmKwZQdZwrGClQzEwcGkDFRaaZaY Zqpppir4UQKmnX5agh8qBECFE8eVesVxe37aaWmtBjCGaWRsamumllY6KQdxMLCCD3gEi8cExE4Q x7HIJqussjFEoAGyzT6rQQQxHHvEGRFEUEMSx4ZRg7PTPntEDxGwEe6xSdTQAxrLtrtssRMIi4cP cSxg770LyKvvvvz26++/AAcsML73xoFHHQgXoPDCDM/h8MMQRyzxxBRXbPFuxRMzrHEBCNeBBxwH hCzyyB2XbPLJKKes8sost1zyyDAfAIcRdehh880456zzzjz37PPPQAetcx1GjIBDHXkkrfTSTDft 9NNQRy311FQvXQcOI2SdAxwF2OH112CHLfbYZJdt9tlop10AHDlkHQgAOw== ------=_NextPart_000_0000_01C8EFC0.9F226590 Content-Type: text/css; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable Content-Location: http://www.stovezata.praha.eu/css2/styl-et.css BODY { BACKGROUND-POSITION: 50% 25px; FONT-SIZE: 9pt; BACKGROUND-IMAGE: = url(images/body_bg.gif); MARGIN: 0px; COLOR: #ffffff; BACKGROUND-REPEAT: = repeat-x; FONT-FAMILY: Verdana, Arial, sans-serif; BACKGROUND-COLOR: = #000000 } A { COLOR: #0ecfff } A:hover { TEXT-DECORATION: none } P { MARGIN: 6px 0px; LINE-HEIGHT: 1.8em } HR { BORDER-TOP: #333333 1px solid; BORDER-RIGHT-STYLE: none; = BORDER-LEFT-STYLE: none; HEIGHT: 0px; BORDER-BOTTOM-STYLE: none } H2 { FONT-SIZE: 100%; MARGIN: 1em 0px; COLOR: #0ecfff } H3 { MARGIN-TOP: 0px; FONT-SIZE: 100% } #container { MARGIN: 0px auto; WIDTH: 783px } #supheader { WIDTH: 100%; HEIGHT: 25px; BACKGROUND-COLOR: #2d2d2d } #supheader DIV { PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 0px; MARGIN: = 0px auto; WIDTH: 763px; LINE-HEIGHT: 25px; PADDING-TOP: 0px; HEIGHT: = 25px; BACKGROUND-COLOR: #393939; TEXT-ALIGN: right } #supheader A:link { COLOR: #fff; TEXT-DECORATION: none } #supheader A:visited { COLOR: #fff; TEXT-DECORATION: none } #supheader A:hover { COLOR: #0ecfff } #supheader A:active { COLOR: #0ecfff } #header { HEIGHT: 90px } #header #title { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: = url(images/title.gif) no-repeat 0px 0px; FLOAT: left; PADDING-BOTTOM: = 0px; MARGIN: 18px 0px 0px; WIDTH: 272px; TEXT-INDENT: -500em; = PADDING-TOP: 0px; HEIGHT: 50px } #header #ENtitle { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: = url(images/en_title.jpg) no-repeat 0px 0px; FLOAT: left; PADDING-BOTTOM: = 0px; MARGIN: 18px 0px 0px; WIDTH: 306px; TEXT-INDENT: -500em; = PADDING-TOP: 0px; HEIGHT: 50px } #header #subtitle { FLOAT: left; TEXT-INDENT: -500em } #header #search { MARGIN-TOP: 38px; FLOAT: right; VERTICAL-ALIGN: top } #header #search INPUT { DISPLAY: block; FLOAT: left } #header #search .query { BORDER-TOP-WIDTH: 0px; PADDING-RIGHT: 2px; PADDING-LEFT: 2px; = BORDER-LEFT-WIDTH: 0px; BACKGROUND: url(images/search_field.gif) = no-repeat 0px 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 2px; = MARGIN: 0px; WIDTH: 184px; PADDING-TOP: 2px; HEIGHT: 22px; = BORDER-RIGHT-WIDTH: 0px } #header #search .submit { MARGIN: 0px 0px 0px 12px; WIDTH: 101px; HEIGHT: 22px } #menu { CLEAR: both; BACKGROUND: url(images/nav_bg.gif) repeat-x 0px 0px; = HEIGHT: 30px } #menu .start { BACKGROUND-POSITION: 0px 0px; DISPLAY: block; WIDTH: 6px; = BACKGROUND-REPEAT: no-repeat; HEIGHT: 30px } #menu .end { BACKGROUND-POSITION: 0px 0px; DISPLAY: block; WIDTH: 6px; = BACKGROUND-REPEAT: no-repeat; HEIGHT: 30px } #menu .start { FLOAT: left; BACKGROUND-IMAGE: url(images/nav_start.gif) } #menu .end { FLOAT: right; BACKGROUND-IMAGE: url(images/nav_end.gif) } #menu UL { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: = 0px; PADDING-TOP: 0px; LIST-STYLE-TYPE: none } #menu UL#language-versions { FLOAT: right } #menu LI { FLOAT: left } #menu LI A { BORDER-RIGHT: #000000 1px solid; BACKGROUND-POSITION: 0px 0px; DISPLAY: = block; TEXT-INDENT: -500em; BACKGROUND-REPEAT: no-repeat; HEIGHT: 30px } #menu UL#language-versions LI A { BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: = none; BORDER-BOTTOM-STYLE: none } #menu LI A.index { BACKGROUND-IMAGE: url(images/m_home.gif); WIDTH: 60px } #menu LI A.seznam { BACKGROUND-IMAGE: url(images/m_seznam.gif); WIDTH: 76px } #menu LI A.mapa { BACKGROUND-IMAGE: url(images/m_mapa.gif); WIDTH: 63px } #menu LI A.napoveda { BACKGROUND-IMAGE: url(images/m_napoveda.gif); WIDTH: 92px } #menu LI A.en { BACKGROUND-IMAGE: url(images/m_en.gif); WIDTH: 92px } #menu LI A.cs { BACKGROUND-IMAGE: url(images/m_cs.gif); WIDTH: 84px } #menu LI A.homepage { BACKGROUND-IMAGE: url(images/m_en_home.jpg); WIDTH: 59px } #menu LI A.list { BACKGROUND-IMAGE: url(images/m_en_list.jpg); WIDTH: 60px } #menu LI A.map { BACKGROUND-IMAGE: url(images/m_en_map.jpg); WIDTH: 61px } #menu LI A.help { BACKGROUND-IMAGE: url(images/m_en_help.jpg); WIDTH: 60px } #menu LI A.index:hover { BACKGROUND-IMAGE: url(images/m_home_a.gif) } #menu LI.active A.index { BACKGROUND-IMAGE: url(images/m_home_a.gif) } #menu LI A.seznam:hover { BACKGROUND-IMAGE: url(images/m_seznam_a.gif) } #menu LI.active A.seznam { BACKGROUND-IMAGE: url(images/m_seznam_a.gif) } #menu LI A.mapa:hover { BACKGROUND-IMAGE: url(images/m_mapa_a.gif) } #menu LI.active A.mapa { BACKGROUND-IMAGE: url(images/m_mapa_a.gif) } #menu LI A.napoveda:hover { BACKGROUND-IMAGE: url(images/m_napoveda_a.gif) } #menu LI.active A.napoveda { BACKGROUND-IMAGE: url(images/m_napoveda_a.gif) } #menu LI A.en:hover { BACKGROUND-IMAGE: url(images/m_en_a.gif) } #menu LI A.cs:hover { BACKGROUND-IMAGE: url(images/m_cs_a.gif) } #menu LI A.homepage:hover { BACKGROUND-IMAGE: url(images/m_en_home_a.jpg) } #menu LI.active A.homepage { BACKGROUND-IMAGE: url(images/m_en_home_a.jpg) } #menu LI A.list:hover { BACKGROUND-IMAGE: url(images/m_en_list_a.jpg) } #menu LI.active A.list { BACKGROUND-IMAGE: url(images/m_en_list_a.jpg) } #menu LI A.map:hover { BACKGROUND-IMAGE: url(images/m_en_map_a.jpg) } #menu LI.active A.map { BACKGROUND-IMAGE: url(images/m_en_map_a.jpg) } #menu LI A.help:hover { BACKGROUND-IMAGE: url(images/m_en_help_a.jpg) } #menu LI.active A.help { BACKGROUND-IMAGE: url(images/m_en_help_a.jpg) } #content { MARGIN: 8px 0px } #content P { MARGIN: 8px 0px } #footer { BORDER-TOP: #333333 1px solid; MARGIN-BOTTOM: 8px; COLOR: #cccccc; = PADDING-TOP: 8px; TEXT-ALIGN: center } #footer A { COLOR: #ffffff } .news { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: = 0px; PADDING-TOP: 0px; LIST-STYLE-TYPE: none } .news LI { MARGIN-BOTTOM: 2em } .news H3 { MARGIN-BOTTOM: 0.5em } .news H3 A { COLOR: #ffffff } .news H3 A:hover { COLOR: #0ecfff } .side { PADDING-RIGHT: 12px; PADDING-LEFT: 12px; MIN-HEIGHT: 400px; BACKGROUND: = url(images/side_bg.gif) no-repeat 0px 0px; PADDING-BOTTOM: 12px; MARGIN: = 4px 0px 0px 8px; WIDTH: 266px; PADDING-TOP: 12px } .parts { PADDING-RIGHT: 20px; PADDING-LEFT: 20px; PADDING-BOTTOM: 5px; = PADDING-TOP: 5px } .parts A:link { DISPLAY: block; HEIGHT: 20px } .parts A:visited { DISPLAY: block; HEIGHT: 20px } .toggleParts A { PADDING-RIGHT: 8px; DISPLAY: block; PADDING-LEFT: 8px; BACKGROUND: = url(images/li_collapsed.gif) no-repeat 98% 50%; PADDING-BOTTOM: 8px; = COLOR: #ffffff; PADDING-TOP: 8px; BORDER-BOTTOM: #333 1px solid; = TEXT-DECORATION: none } #gmap { PADDING-RIGHT: 8px; PADDING-LEFT: 8px; BACKGROUND: = url(images/map_bg.gif) no-repeat 0px 0px; FLOAT: right; PADDING-BOTTOM: = 8px; MARGIN: 4px 0px 0px 8px; WIDTH: 328px; PADDING-TOP: 8px; HEIGHT: = 284px } #map { WIDTH: 100%; HEIGHT: 100%; BACKGROUND-COLOR: white } #randomPano { BACKGROUND-POSITION: 60% 50%; WIDTH: 783px; HEIGHT: 300px } ------=_NextPart_000_0000_01C8EFC0.9F226590 Content-Type: application/octet-stream Content-Transfer-Encoding: quoted-printable Content-Location: http://www.stovezata.praha.eu/lib/prototype.js /* Prototype JavaScript framework, version 1.5.0_rc1 * (c) 2005 Sam Stephenson * * Prototype is freely distributable under the terms of an MIT-style = license. * For details, see the Prototype web site: http://prototype.conio.net/ * /*-----------------------------------------------------------------------= ---*/ var Prototype =3D { Version: '1.5.0_rc1', BrowserFeatures: { XPath: !!document.evaluate }, ScriptFragment: '(?:)((\n|\r|.)*?)(?:<\/script>)', emptyFunction: function() {}, K: function(x) { return x } } var Class =3D { create: function() { return function() { this.initialize.apply(this, arguments); } } } var Abstract =3D new Object(); Object.extend =3D function(destination, source) { for (var property in source) { destination[property] =3D source[property]; } return destination; } Object.extend(Object, { inspect: function(object) { try { if (object =3D=3D=3D undefined) return 'undefined'; if (object =3D=3D=3D null) return 'null'; return object.inspect ? object.inspect() : object.toString(); } catch (e) { if (e instanceof RangeError) return '...'; throw e; } }, keys: function(object) { var keys =3D []; for (var property in object) keys.push(property); return keys; }, values: function(object) { var values =3D []; for (var property in object) values.push(object[property]); return values; }, clone: function(object) { return Object.extend({}, object); } }); Function.prototype.bind =3D function() { var __method =3D this, args =3D $A(arguments), object =3D = args.shift(); return function() { return __method.apply(object, args.concat($A(arguments))); } } Function.prototype.bindAsEventListener =3D function(object) { var __method =3D this, args =3D $A(arguments), object =3D = args.shift(); return function(event) { return __method.apply(object, [( event || = window.event)].concat(args).concat($A(arguments))); } } Object.extend(Number.prototype, { toColorPart: function() { var digits =3D this.toString(16); if (this < 16) return '0' + digits; return digits; }, succ: function() { return this + 1; }, times: function(iterator) { $R(0, this, true).each(iterator); return this; } }); var Try =3D { these: function() { var returnValue; for (var i =3D 0; i < arguments.length; i++) { var lambda =3D arguments[i]; try { returnValue =3D lambda(); break; } catch (e) {} } return returnValue; } } /*-----------------------------------------------------------------------= ---*/ var PeriodicalExecuter =3D Class.create(); PeriodicalExecuter.prototype =3D { initialize: function(callback, frequency) { this.callback =3D callback; this.frequency =3D frequency; this.currentlyExecuting =3D false; this.registerCallback(); }, registerCallback: function() { this.timer =3D setInterval(this.onTimerEvent.bind(this), = this.frequency * 1000); }, stop: function() { if (!this.timer) return; clearInterval(this.timer); this.timer =3D null; }, onTimerEvent: function() { if (!this.currentlyExecuting) { try { this.currentlyExecuting =3D true; this.callback(this); } finally { this.currentlyExecuting =3D false; } } } } Object.extend(String.prototype, { gsub: function(pattern, replacement) { var result =3D '', source =3D this, match; replacement =3D arguments.callee.prepareReplacement(replacement); while (source.length > 0) { if (match =3D source.match(pattern)) { result +=3D source.slice(0, match.index); result +=3D (replacement(match) || '').toString(); source =3D source.slice(match.index + match[0].length); } else { result +=3D source, source =3D ''; } } return result; }, sub: function(pattern, replacement, count) { replacement =3D this.gsub.prepareReplacement(replacement); count =3D count =3D=3D=3D undefined ? 1 : count; return this.gsub(pattern, function(match) { if (--count < 0) return match[0]; return replacement(match); }); }, scan: function(pattern, iterator) { this.gsub(pattern, iterator); return this; }, truncate: function(length, truncation) { length =3D length || 30; truncation =3D truncation =3D=3D=3D undefined ? '...' : truncation; return this.length > length ? this.slice(0, length - truncation.length) + truncation : this; }, strip: function() { return this.replace(/^\s+/, '').replace(/\s+$/, ''); }, stripTags: function() { return this.replace(/<\/?[^>]+>/gi, ''); }, stripScripts: function() { return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), = ''); }, extractScripts: function() { var matchAll =3D new RegExp(Prototype.ScriptFragment, 'img'); var matchOne =3D new RegExp(Prototype.ScriptFragment, 'im'); return (this.match(matchAll) || []).map(function(scriptTag) { return (scriptTag.match(matchOne) || ['', ''])[1]; }); }, evalScripts: function() { return this.extractScripts().map(function(script) { return = eval(script) }); }, escapeHTML: function() { var div =3D document.createElement('div'); var text =3D document.createTextNode(this); div.appendChild(text); return div.innerHTML; }, unescapeHTML: function() { var div =3D document.createElement('div'); div.innerHTML =3D this.stripTags(); return div.childNodes[0] ? div.childNodes[0].nodeValue : ''; }, toQueryParams: function() { var match =3D this.strip().match(/[^?]*$/)[0]; if (!match) return {}; var pairs =3D match.split('&'); return pairs.inject({}, function(params, pairString) { var pair =3D pairString.split('=3D'); var value =3D pair[1] ? decodeURIComponent(pair[1]) : undefined; params[decodeURIComponent(pair[0])] =3D value; return params; }); }, toArray: function() { return this.split(''); }, camelize: function() { var oStringList =3D this.split('-'); if (oStringList.length =3D=3D 1) return oStringList[0]; var camelizedString =3D this.indexOf('-') =3D=3D 0 ? oStringList[0].charAt(0).toUpperCase() + = oStringList[0].substring(1) : oStringList[0]; for (var i =3D 1, length =3D oStringList.length; i < length; i++) { var s =3D oStringList[i]; camelizedString +=3D s.charAt(0).toUpperCase() + s.substring(1); } return camelizedString; }, inspect: function(useDoubleQuotes) { var escapedString =3D this.replace(/\\/g, '\\\\'); if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"'; else return "'" + escapedString.replace(/'/g, '\\\'') + "'"; } }); String.prototype.gsub.prepareReplacement =3D function(replacement) { if (typeof replacement =3D=3D 'function') return replacement; var template =3D new Template(replacement); return function(match) { return template.evaluate(match) }; } String.prototype.parseQuery =3D String.prototype.toQueryParams; var Template =3D Class.create(); Template.Pattern =3D /(^|.|\r|\n)(#\{(.*?)\})/; Template.prototype =3D { initialize: function(template, pattern) { this.template =3D template.toString(); this.pattern =3D pattern || Template.Pattern; }, evaluate: function(object) { return this.template.gsub(this.pattern, function(match) { var before =3D match[1]; if (before =3D=3D '\\') return match[2]; return before + (object[match[3]] || '').toString(); }); } } var $break =3D new Object(); var $continue =3D new Object(); var Enumerable =3D { each: function(iterator) { var index =3D 0; try { this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e !=3D $continue) throw e; } }); } catch (e) { if (e !=3D $break) throw e; } return this; }, eachSlice: function(number, iterator) { var index =3D -number, slices =3D [], array =3D this.toArray(); while ((index +=3D number) < array.length) slices.push(array.slice(index, index+number)); return slices.collect(iterator || Prototype.K); }, all: function(iterator) { var result =3D true; this.each(function(value, index) { result =3D result && !!(iterator || Prototype.K)(value, index); if (!result) throw $break; }); return result; }, any: function(iterator) { var result =3D false; this.each(function(value, index) { if (result =3D !!(iterator || Prototype.K)(value, index)) throw $break; }); return result; }, collect: function(iterator) { var results =3D []; this.each(function(value, index) { results.push(iterator(value, index)); }); return results; }, detect: function(iterator) { var result; this.each(function(value, index) { if (iterator(value, index)) { result =3D value; throw $break; } }); return result; }, findAll: function(iterator) { var results =3D []; this.each(function(value, index) { if (iterator(value, index)) results.push(value); }); return results; }, grep: function(pattern, iterator) { var results =3D []; this.each(function(value, index) { var stringValue =3D value.toString(); if (stringValue.match(pattern)) results.push((iterator || Prototype.K)(value, index)); }) return results; }, include: function(object) { var found =3D false; this.each(function(value) { if (value =3D=3D object) { found =3D true; throw $break; } }); return found; }, inGroupsOf: function(number, fillWith) { fillWith =3D fillWith || null; var results =3D this.eachSlice(number); if (results.length > 0) (number - = results.last().length).times(function() { results.last().push(fillWith) }); return results; }, inject: function(memo, iterator) { this.each(function(value, index) { memo =3D iterator(memo, value, index); }); return memo; }, invoke: function(method) { var args =3D $A(arguments).slice(1); return this.collect(function(value) { return value[method].apply(value, args); }); }, max: function(iterator) { var result; this.each(function(value, index) { value =3D (iterator || Prototype.K)(value, index); if (result =3D=3D undefined || value >=3D result) result =3D value; }); return result; }, min: function(iterator) { var result; this.each(function(value, index) { value =3D (iterator || Prototype.K)(value, index); if (result =3D=3D undefined || value < result) result =3D value; }); return result; }, partition: function(iterator) { var trues =3D [], falses =3D []; this.each(function(value, index) { ((iterator || Prototype.K)(value, index) ? trues : falses).push(value); }); return [trues, falses]; }, pluck: function(property) { var results =3D []; this.each(function(value, index) { results.push(value[property]); }); return results; }, reject: function(iterator) { var results =3D []; this.each(function(value, index) { if (!iterator(value, index)) results.push(value); }); return results; }, sortBy: function(iterator) { return this.collect(function(value, index) { return {value: value, criteria: iterator(value, index)}; }).sort(function(left, right) { var a =3D left.criteria, b =3D right.criteria; return a < b ? -1 : a > b ? 1 : 0; }).pluck('value'); }, toArray: function() { return this.collect(Prototype.K); }, zip: function() { var iterator =3D Prototype.K, args =3D $A(arguments); if (typeof args.last() =3D=3D 'function') iterator =3D args.pop(); var collections =3D [this].concat(args).map($A); return this.map(function(value, index) { return iterator(collections.pluck(index)); }); }, inspect: function() { return '#'; } } Object.extend(Enumerable, { map: Enumerable.collect, find: Enumerable.detect, select: Enumerable.findAll, member: Enumerable.include, entries: Enumerable.toArray }); var $A =3D Array.from =3D function(iterable) { if (!iterable) return []; if (iterable.toArray) { return iterable.toArray(); } else { var results =3D []; for (var i =3D 0, length =3D iterable.length; i < length; i++) results.push(iterable[i]); return results; } } Object.extend(Array.prototype, Enumerable); if (!Array.prototype._reverse) Array.prototype._reverse =3D Array.prototype.reverse; Object.extend(Array.prototype, { _each: function(iterator) { for (var i =3D 0, length =3D this.length; i < length; i++) iterator(this[i]); }, clear: function() { this.length =3D 0; return this; }, first: function() { return this[0]; }, last: function() { return this[this.length - 1]; }, compact: function() { return this.select(function(value) { return value !=3D undefined || value !=3D null; }); }, flatten: function() { return this.inject([], function(array, value) { return array.concat(value && value.constructor =3D=3D Array ? value.flatten() : [value]); }); }, without: function() { var values =3D $A(arguments); return this.select(function(value) { return !values.include(value); }); }, indexOf: function(object) { for (var i =3D 0, length =3D this.length; i < length; i++) if (this[i] =3D=3D object) return i; return -1; }, reverse: function(inline) { return (inline !=3D=3D false ? this : this.toArray())._reverse(); }, reduce: function() { return this.length > 1 ? this : this[0]; }, uniq: function() { return this.inject([], function(array, value) { return array.include(value) ? array : array.concat([value]); }); }, clone: function() { return [].concat(this); }, inspect: function() { return '[' + this.map(Object.inspect).join(', ') + ']'; } }); Array.prototype.toArray =3D Array.prototype.clone; var Hash =3D { _each: function(iterator) { for (var key in this) { var value =3D this[key]; if (typeof value =3D=3D 'function') continue; var pair =3D [key, value]; pair.key =3D key; pair.value =3D value; iterator(pair); } }, keys: function() { return this.pluck('key'); }, values: function() { return this.pluck('value'); }, merge: function(hash) { return $H(hash).inject(this, function(mergedHash, pair) { mergedHash[pair.key] =3D pair.value; return mergedHash; }); }, toQueryString: function() { return this.map(function(pair) { if (!pair.value && pair.value !=3D=3D 0) pair[1] =3D ''; if (!pair.key) return; return pair.map(encodeURIComponent).join('=3D'); }).join('&'); }, inspect: function() { return '#'; } } function $H(object) { var hash =3D Object.extend({}, object || {}); Object.extend(hash, Enumerable); Object.extend(hash, Hash); return hash; } ObjectRange =3D Class.create(); Object.extend(ObjectRange.prototype, Enumerable); Object.extend(ObjectRange.prototype, { initialize: function(start, end, exclusive) { this.start =3D start; this.end =3D end; this.exclusive =3D exclusive; }, _each: function(iterator) { var value =3D this.start; while (this.include(value)) { iterator(value); value =3D value.succ(); } }, include: function(value) { if (value < this.start) return false; if (this.exclusive) return value < this.end; return value <=3D this.end; } }); var $R =3D function(start, end, exclusive) { return new ObjectRange(start, end, exclusive); } var Ajax =3D { getTransport: function() { return Try.these( function() {return new XMLHttpRequest()}, function() {return new ActiveXObject('Msxml2.XMLHTTP')}, function() {return new ActiveXObject('Microsoft.XMLHTTP')} ) || false; }, activeRequestCount: 0 } Ajax.Responders =3D { responders: [], _each: function(iterator) { this.responders._each(iterator); }, register: function(responder) { if (!this.include(responder)) this.responders.push(responder); }, unregister: function(responder) { this.responders =3D this.responders.without(responder); }, dispatch: function(callback, request, transport, json) { this.each(function(responder) { if (typeof responder[callback] =3D=3D 'function') { try { responder[callback].apply(responder, [request, transport, = json]); } catch (e) {} } }); } }; Object.extend(Ajax.Responders, Enumerable); Ajax.Responders.register({ onCreate: function() { Ajax.activeRequestCount++; }, onComplete: function() { Ajax.activeRequestCount--; } }); Ajax.Base =3D function() {}; Ajax.Base.prototype =3D { setOptions: function(options) { this.options =3D { method: 'post', asynchronous: true, contentType: 'application/x-www-form-urlencoded', encoding: 'UTF-8', parameters: '' } Object.extend(this.options, options || {}); this.options.method =3D this.options.method.toLowerCase(); this.options.parameters =3D $H(typeof this.options.parameters =3D=3D = 'string' ? this.options.parameters.toQueryParams() : = this.options.parameters); } } Ajax.Request =3D Class.create(); Ajax.Request.Events =3D ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; Ajax.Request.prototype =3D Object.extend(new Ajax.Base(), { initialize: function(url, options) { this.transport =3D Ajax.getTransport(); this.setOptions(options); this.request(url); }, request: function(url) { var params =3D this.options.parameters; if (params.any()) params['_'] =3D ''; if (!['get', 'post'].include(this.options.method)) { // simulate other verbs over post params['_method'] =3D this.options.method; this.options.method =3D 'post'; } this.url =3D url; // when GET, append parameters to URL if (this.options.method =3D=3D 'get' && params.any()) this.url +=3D (this.url.indexOf('?') >=3D 0 ? '&' : '?') + params.toQueryString(); try { Ajax.Responders.dispatch('onCreate', this, this.transport); this.transport.open(this.options.method.toUpperCase(), this.url, this.options.asynchronous, this.options.username, this.options.password); if (this.options.asynchronous) setTimeout(function() { this.respondToReadyState(1) = }.bind(this), 10); this.transport.onreadystatechange =3D = this.onStateChange.bind(this); this.setRequestHeaders(); var body =3D this.options.method =3D=3D 'post' ? (this.options.postBody || params.toQueryString()) : null; this.transport.send(body); /* Force Firefox to handle ready state 4 for synchronous requests = */ if (!this.options.asynchronous && this.transport.overrideMimeType) this.onStateChange(); } catch (e) { this.dispatchException(e); } }, onStateChange: function() { var readyState =3D this.transport.readyState; if (readyState > 1) this.respondToReadyState(this.transport.readyState); }, setRequestHeaders: function() { var headers =3D { 'X-Requested-With': 'XMLHttpRequest', 'X-Prototype-Version': Prototype.Version, 'Accept': 'text/javascript, text/html, application/xml, text/xml, = */*' }; if (this.options.method =3D=3D 'post') { headers['Content-type'] =3D this.options.contentType + (this.options.encoding ? '; charset=3D' + this.options.encoding = : ''); /* Force "Connection: close" for older Mozilla browsers to work * around a bug where XMLHttpRequest sends an incorrect * Content-length header. See Mozilla Bugzilla #246651. */ if (this.transport.overrideMimeType && (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < = 2005) headers['Connection'] =3D 'close'; } // user-defined headers if (typeof this.options.requestHeaders =3D=3D 'object') { var extras =3D this.options.requestHeaders; if (typeof extras.push =3D=3D 'function') for (var i =3D 0; i < extras.length; i +=3D 2) headers[extras[i]] =3D extras[i+1]; else $H(extras).each(function(pair) { headers[pair.key] =3D = pair.value }); } for (var name in headers) this.transport.setRequestHeader(name, headers[name]); }, success: function() { return !this.transport.status || (this.transport.status >=3D 200 && this.transport.status < = 300); }, respondToReadyState: function(readyState) { var state =3D Ajax.Request.Events[readyState]; var transport =3D this.transport, json =3D this.evalJSON(); if (state =3D=3D 'Complete') { try { (this.options['on' + this.transport.status] || this.options['on' + (this.success() ? 'Success' : = 'Failure')] || Prototype.emptyFunction)(transport, json); } catch (e) { this.dispatchException(e); } } try { (this.options['on' + state] || Prototype.emptyFunction)(transport, = json); Ajax.Responders.dispatch('on' + state, this, transport, json); } catch (e) { this.dispatchException(e); } if (state =3D=3D 'Complete') { if ((this.getHeader('Content-type') || '').strip(). match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i)) this.evalResponse(); // avoid memory leak in MSIE: clean up this.transport.onreadystatechange =3D Prototype.emptyFunction; } }, getHeader: function(name) { try { return this.transport.getResponseHeader(name); } catch (e) { return null } }, evalJSON: function() { try { var json =3D this.getHeader('X-JSON'); return json ? eval('(' + json + ')') : null; } catch (e) { return null } }, evalResponse: function() { try { return eval(this.transport.responseText); } catch (e) { this.dispatchException(e); } }, dispatchException: function(exception) { (this.options.onException || Prototype.emptyFunction)(this, = exception); Ajax.Responders.dispatch('onException', this, exception); } }); Ajax.Updater =3D Class.create(); Object.extend(Object.extend(Ajax.Updater.prototype, = Ajax.Request.prototype), { initialize: function(container, url, options) { this.container =3D { success: (container.success || container), failure: (container.failure || (container.success ? null : = container)) } this.transport =3D Ajax.getTransport(); this.setOptions(options); var onComplete =3D this.options.onComplete || = Prototype.emptyFunction; this.options.onComplete =3D (function(transport, param) { this.updateContent(); onComplete(transport, param); }).bind(this); this.request(url); }, updateContent: function() { var receiver =3D this.container[this.success() ? 'success' : = 'failure']; var response =3D this.transport.responseText; if (!this.options.evalScripts) response =3D response.stripScripts(); if (receiver =3D $(receiver)) { if (this.options.insertion) new this.options.insertion(receiver, response); else receiver.update(response); } if (this.success()) { if (this.onComplete) setTimeout(this.onComplete.bind(this), 10); } } }); Ajax.PeriodicalUpdater =3D Class.create(); Ajax.PeriodicalUpdater.prototype =3D Object.extend(new Ajax.Base(), { initialize: function(container, url, options) { this.setOptions(options); this.onComplete =3D this.options.onComplete; this.frequency =3D (this.options.frequency || 2); this.decay =3D (this.options.decay || 1); this.updater =3D {}; this.container =3D container; this.url =3D url; this.start(); }, start: function() { this.options.onComplete =3D this.updateComplete.bind(this); this.onTimerEvent(); }, stop: function() { this.updater.options.onComplete =3D undefined; clearTimeout(this.timer); (this.onComplete || Prototype.emptyFunction).apply(this, arguments); }, updateComplete: function(request) { if (this.options.decay) { this.decay =3D (request.responseText =3D=3D this.lastText ? this.decay * this.options.decay : 1); this.lastText =3D request.responseText; } this.timer =3D setTimeout(this.onTimerEvent.bind(this), this.decay * this.frequency * 1000); }, onTimerEvent: function() { this.updater =3D new Ajax.Updater(this.container, this.url, = this.options); } }); function $(element) { if (arguments.length > 1) { for (var i =3D 0, elements =3D [], length =3D arguments.length; i < = length; i++) elements.push($(arguments[i])); return elements; } if (typeof element =3D=3D 'string') element =3D document.getElementById(element); return Element.extend(element); } if (Prototype.BrowserFeatures.XPath) { document._getElementsByXPath =3D function(expression, parentElement) { var results =3D []; var query =3D document.evaluate(expression, $(parentElement) || = document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); for (var i =3D 0, len =3D query.snapshotLength; i < len; i++) results.push(query.snapshotItem(i)); return results; } } document.getElementsByClassName =3D function(className, parentElement) { if (Prototype.BrowserFeatures.XPath) { var q =3D ".//*[contains(concat(' ', @class, ' '), ' " + className + = " ')]"; return document._getElementsByXPath(q, parentElement); } else { var children =3D ($(parentElement) || = document.body).getElementsByTagName('*'); var elements =3D [], child; for (var i =3D 0, length =3D children.length; i < length; i++) { child =3D children[i]; if (Element.hasClassName(child, className)) elements.push(Element.extend(child)); } return elements; } } /*-----------------------------------------------------------------------= ---*/ if (!window.Element) var Element =3D new Object(); Element.extend =3D function(element) { if (!element) return; if (_nativeExtensions || element.nodeType =3D=3D 3) return element; if (!element._extended && element.tagName && element !=3D window) { var methods =3D Object.clone(Element.Methods), cache =3D = Element.extend.cache; if (element.tagName =3D=3D 'FORM') Object.extend(methods, Form.Methods); if (['INPUT', 'TEXTAREA', 'SELECT'].include(element.tagName)) Object.extend(methods, Form.Element.Methods); for (var property in methods) { var value =3D methods[property]; if (typeof value =3D=3D 'function') element[property] =3D cache.findOrStore(value); } var methods =3D Object.clone(Element.Methods.Simulated), cache =3D = Element.extend.cache; for (var property in methods) { var value =3D methods[property]; if ('function' =3D=3D typeof value && !(property in element)) element[property] =3D cache.findOrStore(value); } } element._extended =3D true; return element; } Element.extend.cache =3D { findOrStore: function(value) { return this[value] =3D this[value] || function() { return value.apply(null, [this].concat($A(arguments))); } } } Element.Methods =3D { visible: function(element) { return $(element).style.display !=3D 'none'; }, toggle: function(element) { element =3D $(element); Element[Element.visible(element) ? 'hide' : 'show'](element); return element; }, hide: function(element) { $(element).style.display =3D 'none'; return element; }, show: function(element) { $(element).style.display =3D ''; return element; }, remove: function(element) { element =3D $(element); element.parentNode.removeChild(element); return element; }, update: function(element, html) { html =3D typeof html =3D=3D 'undefined' ? '' : html.toString(); $(element).innerHTML =3D html.stripScripts(); setTimeout(function() {html.evalScripts()}, 10); return element; }, replace: function(element, html) { element =3D $(element); if (element.outerHTML) { element.outerHTML =3D html.stripScripts(); } else { var range =3D element.ownerDocument.createRange(); range.selectNodeContents(element); element.parentNode.replaceChild( range.createContextualFragment(html.stripScripts()), element); } setTimeout(function() {html.evalScripts()}, 10); return element; }, inspect: function(element) { element =3D $(element); var result =3D '<' + element.tagName.toLowerCase(); $H({'id': 'id', 'className': 'class'}).each(function(pair) { var property =3D pair.first(), attribute =3D pair.last(); var value =3D (element[property] || '').toString(); if (value) result +=3D ' ' + attribute + '=3D' + = value.inspect(true); }); return result + '>'; }, recursivelyCollect: function(element, property) { element =3D $(element); var elements =3D []; while (element =3D element[property]) if (element.nodeType =3D=3D 1) elements.push(Element.extend(element)); return elements; }, ancestors: function(element) { return $(element).recursivelyCollect('parentNode'); }, descendants: function(element) { element =3D $(element); return $A(element.getElementsByTagName('*')); }, previousSiblings: function(element) { return $(element).recursivelyCollect('previousSibling'); }, nextSiblings: function(element) { return $(element).recursivelyCollect('nextSibling'); }, siblings: function(element) { element =3D $(element); return = element.previousSiblings().reverse().concat(element.nextSiblings()); }, match: function(element, selector) { element =3D $(element); if (typeof selector =3D=3D 'string') selector =3D new Selector(selector); return selector.match(element); }, up: function(element, expression, index) { return Selector.findElement($(element).ancestors(), expression, = index); }, down: function(element, expression, index) { return Selector.findElement($(element).descendants(), expression, = index); }, previous: function(element, expression, index) { return Selector.findElement($(element).previousSiblings(), = expression, index); }, next: function(element, expression, index) { return Selector.findElement($(element).nextSiblings(), expression, = index); }, getElementsBySelector: function() { var args =3D $A(arguments), element =3D $(args.shift()); return Selector.findChildElements(element, args); }, getElementsByClassName: function(element, className) { element =3D $(element); return document.getElementsByClassName(className, element); }, getHeight: function(element) { element =3D $(element); return element.offsetHeight; }, classNames: function(element) { return new Element.ClassNames(element); }, hasClassName: function(element, className) { if (!(element =3D $(element))) return; var elementClassName =3D element.className; if (elementClassName.length =3D=3D 0) return false; if (elementClassName =3D=3D className || elementClassName.match(new RegExp("(^|\\s)" + className + = "(\\s|$)"))) return true; return false; }, addClassName: function(element, className) { if (!(element =3D $(element))) return; Element.classNames(element).add(className); return element; }, removeClassName: function(element, className) { if (!(element =3D $(element))) return; Element.classNames(element).remove(className); return element; }, observe: function() { Event.observe.apply(Event, arguments); return $A(arguments).first(); }, stopObserving: function() { Event.stopObserving.apply(Event, arguments); return $A(arguments).first(); }, // removes whitespace-only text node children cleanWhitespace: function(element) { element =3D $(element); var node =3D element.firstChild; while (node) { var nextNode =3D node.nextSibling; if (node.nodeType =3D=3D 3 && !/\S/.test(node.nodeValue)) element.removeChild(node); node =3D nextNode; } return element; }, empty: function(element) { return $(element).innerHTML.match(/^\s*$/); }, childOf: function(element, ancestor) { element =3D $(element), ancestor =3D $(ancestor); while (element =3D element.parentNode) if (element =3D=3D ancestor) return true; return false; }, scrollTo: function(element) { element =3D $(element); var x =3D element.x ? element.x : element.offsetLeft, y =3D element.y ? element.y : element.offsetTop; window.scrollTo(x, y); return element; }, getStyle: function(element, style) { element =3D $(element); var value =3D element.style[style.camelize()]; if (!value) { if (document.defaultView && document.defaultView.getComputedStyle) = { var css =3D document.defaultView.getComputedStyle(element, = null); value =3D css ? css.getPropertyValue(style) : null; } else if (element.currentStyle) { value =3D element.currentStyle[style.camelize()]; } } if (window.opera && ['left', 'top', 'right', = 'bottom'].include(style)) if (Element.getStyle(element, 'position') =3D=3D 'static') value = =3D 'auto'; return value =3D=3D 'auto' ? null : value; }, setStyle: function(element, style) { element =3D $(element); for (var name in style) element.style[name.camelize()] =3D style[name]; return element; }, getDimensions: function(element) { element =3D $(element); if (Element.getStyle(element, 'display') !=3D 'none') return {width: element.offsetWidth, height: element.offsetHeight}; // All *Width and *Height properties give 0 on elements with display = none, // so enable the element temporarily var els =3D element.style; var originalVisibility =3D els.visibility; var originalPosition =3D els.position; els.visibility =3D 'hidden'; els.position =3D 'absolute'; els.display =3D ''; var originalWidth =3D element.clientWidth; var originalHeight =3D element.clientHeight; els.display =3D 'none'; els.position =3D originalPosition; els.visibility =3D originalVisibility; return {width: originalWidth, height: originalHeight}; }, makePositioned: function(element) { element =3D $(element); var pos =3D Element.getStyle(element, 'position'); if (pos =3D=3D 'static' || !pos) { element._madePositioned =3D true; element.style.position =3D 'relative'; // Opera returns the offset relative to the positioning context, = when an // element is position relative but top and left have not been = defined if (window.opera) { element.style.top =3D 0; element.style.left =3D 0; } } return element; }, undoPositioned: function(element) { element =3D $(element); if (element._madePositioned) { element._madePositioned =3D undefined; element.style.position =3D element.style.top =3D element.style.left =3D element.style.bottom =3D element.style.right =3D ''; } return element; }, makeClipping: function(element) { element =3D $(element); if (element._overflow) return element; element._overflow =3D element.style.overflow || 'auto'; if ((Element.getStyle(element, 'overflow') || 'visible') !=3D = 'hidden') element.style.overflow =3D 'hidden'; return element; }, undoClipping: function(element) { element =3D $(element); if (!element._overflow) return element; element.style.overflow =3D element._overflow =3D=3D 'auto' ? '' : = element._overflow; element._overflow =3D null; return element; } } Element.Methods.Simulated =3D { hasAttribute: function(element, attribute) { return $(element).getAttributeNode(attribute).specified; } } // IE is missing .innerHTML support for TABLE-related elements if(document.all){ Element.Methods.update =3D function(element, html) { element =3D $(element); html =3D typeof html =3D=3D 'undefined' ? '' : html.toString(); var tagName =3D element.tagName.toUpperCase(); if (['THEAD','TBODY','TR','TD'].indexOf(tagName) > -1) { var div =3D document.createElement('div'); switch (tagName) { case 'THEAD': case 'TBODY': div.innerHTML =3D '' + html.stripScripts() + = '
'; depth =3D 2; break; case 'TR': div.innerHTML =3D '' + html.stripScripts() = + '
'; depth =3D 3; break; case 'TD': div.innerHTML =3D '
' + = html.stripScripts() + '
'; depth =3D 4; } $A(element.childNodes).each(function(node){ element.removeChild(node) }); depth.times(function(){ div =3D div.firstChild }); $A(div.childNodes).each( function(node){ element.appendChild(node) }); } else { element.innerHTML =3D html.stripScripts(); } setTimeout(function() {html.evalScripts()}, 10); return element; } } Object.extend(Element, Element.Methods); var _nativeExtensions =3D false; if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)) ['', 'Form', 'Input', 'TextArea', 'Select'].each(function(tag) { var className =3D 'HTML' + tag + 'Element'; if(window[className]) return; var klass =3D window[className] =3D {}; klass.prototype =3D document.createElement(tag ? tag.toLowerCase() : = 'div').__proto__; }); Element.addMethods =3D function(methods) { Object.extend(Element.Methods, methods || {}); function copy(methods, destination, onlyIfAbsent) { onlyIfAbsent =3D onlyIfAbsent || false; var cache =3D Element.extend.cache; for (var property in methods) { var value =3D methods[property]; if (!onlyIfAbsent || !(property in destination)) destination[property] =3D cache.findOrStore(value); } } if (typeof HTMLElement !=3D 'undefined') { copy(Element.Methods, HTMLElement.prototype); copy(Element.Methods.Simulated, HTMLElement.prototype, true); copy(Form.Methods, HTMLFormElement.prototype); [HTMLInputElement, HTMLTextAreaElement, = HTMLSelectElement].each(function(klass) { copy(Form.Element.Methods, klass.prototype); }); _nativeExtensions =3D true; } } var Toggle =3D new Object(); Toggle.display =3D Element.toggle; /*-----------------------------------------------------------------------= ---*/ Abstract.Insertion =3D function(adjacency) { this.adjacency =3D adjacency; } Abstract.Insertion.prototype =3D { initialize: function(element, content) { this.element =3D $(element); this.content =3D content.stripScripts(); if (this.adjacency && this.element.insertAdjacentHTML) { try { this.element.insertAdjacentHTML(this.adjacency, this.content); } catch (e) { var tagName =3D this.element.tagName.toLowerCase(); if (tagName =3D=3D 'tbody' || tagName =3D=3D 'tr') { this.insertContent(this.contentFromAnonymousTable()); } else { throw e; } } } else { this.range =3D this.element.ownerDocument.createRange(); if (this.initializeRange) this.initializeRange(); = this.insertContent([this.range.createContextualFragment(this.content)]); } setTimeout(function() {content.evalScripts()}, 10); }, contentFromAnonymousTable: function() { var div =3D document.createElement('div'); div.innerHTML =3D '' + this.content + = '
'; return $A(div.childNodes[0].childNodes[0].childNodes); } } var Insertion =3D new Object(); Insertion.Before =3D Class.create(); Insertion.Before.prototype =3D Object.extend(new = Abstract.Insertion('beforeBegin'), { initializeRange: function() { this.range.setStartBefore(this.element); }, insertContent: function(fragments) { fragments.each((function(fragment) { this.element.parentNode.insertBefore(fragment, this.element); }).bind(this)); } }); Insertion.Top =3D Class.create(); Insertion.Top.prototype =3D Object.extend(new = Abstract.Insertion('afterBegin'), { initializeRange: function() { this.range.selectNodeContents(this.element); this.range.collapse(true); }, insertContent: function(fragments) { fragments.reverse(false).each((function(fragment) { this.element.insertBefore(fragment, this.element.firstChild); }).bind(this)); } }); Insertion.Bottom =3D Class.create(); Insertion.Bottom.prototype =3D Object.extend(new = Abstract.Insertion('beforeEnd'), { initializeRange: function() { this.range.selectNodeContents(this.element); this.range.collapse(this.element); }, insertContent: function(fragments) { fragments.each((function(fragment) { this.element.appendChild(fragment); }).bind(this)); } }); Insertion.After =3D Class.create(); Insertion.After.prototype =3D Object.extend(new = Abstract.Insertion('afterEnd'), { initializeRange: function() { this.range.setStartAfter(this.element); }, insertContent: function(fragments) { fragments.each((function(fragment) { this.element.parentNode.insertBefore(fragment, this.element.nextSibling); }).bind(this)); } }); /*-----------------------------------------------------------------------= ---*/ Element.ClassNames =3D Class.create(); Element.ClassNames.prototype =3D { initialize: function(element) { this.element =3D $(element); }, _each: function(iterator) { this.element.className.split(/\s+/).select(function(name) { return name.length > 0; })._each(iterator); }, set: function(className) { this.element.className =3D className; }, add: function(classNameToAdd) { if (this.include(classNameToAdd)) return; this.set($A(this).concat(classNameToAdd).join(' ')); }, remove: function(classNameToRemove) { if (!this.include(classNameToRemove)) return; this.set($A(this).without(classNameToRemove).join(' ')); }, toString: function() { return $A(this).join(' '); } } Object.extend(Element.ClassNames.prototype, Enumerable); var Selector =3D Class.create(); Selector.prototype =3D { initialize: function(expression) { this.params =3D {classNames: []}; this.expression =3D expression.toString().strip(); this.parseExpression(); this.compileMatcher(); }, parseExpression: function() { function abort(message) { throw 'Parse error in selector: ' + = message; } if (this.expression =3D=3D '') abort('empty expression'); var params =3D this.params, expr =3D this.expression, match, = modifier, clause, rest; while (match =3D = expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=3D)(?:"([^"]*)"|([^\]\s]*))= )?\]$/i)) { params.attributes =3D params.attributes || []; params.attributes.push({name: match[2], operator: match[3], value: = match[4] || match[5] || ''}); expr =3D match[1]; } if (expr =3D=3D '*') return this.params.wildcard =3D true; while (match =3D expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)) { modifier =3D match[1], clause =3D match[2], rest =3D match[3]; switch (modifier) { case '#': params.id =3D clause; break; case '.': params.classNames.push(clause); break; case '': case undefined: params.tagName =3D clause.toUpperCase(); break; default: abort(expr.inspect()); } expr =3D rest; } if (expr.length > 0) abort(expr.inspect()); }, buildMatchExpression: function() { var params =3D this.params, conditions =3D [], clause; if (params.wildcard) conditions.push('true'); if (clause =3D params.id) conditions.push('element.id =3D=3D ' + clause.inspect()); if (clause =3D params.tagName) conditions.push('element.tagName.toUpperCase() =3D=3D ' + = clause.inspect()); if ((clause =3D params.classNames).length > 0) for (var i =3D 0; i < clause.length; i++) conditions.push('Element.hasClassName(element, ' + = clause[i].inspect() + ')'); if (clause =3D params.attributes) { clause.each(function(attribute) { var value =3D 'element.getAttribute(' + attribute.name.inspect() = + ')'; var splitValueBy =3D function(delimiter) { return value + ' && ' + value + '.split(' + = delimiter.inspect() + ')'; } switch (attribute.operator) { case '=3D': conditions.push(value + ' =3D=3D ' + = attribute.value.inspect()); break; case '~=3D': conditions.push(splitValueBy(' ') + = '.include(' + attribute.value.inspect() + ')'); break; case '|=3D': conditions.push( splitValueBy('-') + '.first().toUpperCase() = =3D=3D ' + attribute.value.toUpperCase().inspect() ); break; case '!=3D': conditions.push(value + ' !=3D ' + = attribute.value.inspect()); break; case '': case undefined: conditions.push(value + ' !=3D null'); break; default: throw 'Unknown operator ' + attribute.operator = + ' in selector'; } }); } return conditions.join(' && '); }, compileMatcher: function() { this.match =3D new Function('element', 'if (!element.tagName) return = false; \ return ' + this.buildMatchExpression()); }, findElements: function(scope) { var element; if (element =3D $(this.params.id)) if (this.match(element)) if (!scope || Element.childOf(element, scope)) return [element]; scope =3D (scope || = document).getElementsByTagName(this.params.tagName || '*'); var results =3D []; for (var i =3D 0, length =3D scope.length; i < length; i++) if (this.match(element =3D scope[i])) results.push(Element.extend(element)); return results; }, toString: function() { return this.expression; } } Object.extend(Selector, { matchElements: function(elements, expression) { var selector =3D new Selector(expression); return = elements.select(selector.match.bind(selector)).collect(Element.extend); }, findElement: function(elements, expression, index) { if (typeof expression =3D=3D 'number') index =3D expression, = expression =3D false; return Selector.matchElements(elements, expression || '*')[index || = 0]; }, findChildElements: function(element, expressions) { return expressions.map(function(expression) { return expression.strip().split(/\s+/).inject([null], = function(results, expr) { var selector =3D new Selector(expr); return results.inject([], function(elements, result) { return elements.concat(selector.findElements(result || = element)); }); }); }).flatten(); } }); function $$() { return Selector.findChildElements(document, $A(arguments)); } var Form =3D { reset: function(form) { $(form).reset(); return form; }, serializeElements: function(elements) { return elements.inject([], function(queryComponents, element) { var queryComponent =3D Form.Element.serialize(element); if (queryComponent) queryComponents.push(queryComponent); return queryComponents; }).join('&'); } }; Form.Methods =3D { serialize: function(form) { return Form.serializeElements($(form).getElements()); }, getElements: function(form) { return $A($(form).getElementsByTagName('*')).inject([], function(elements, child) { if (Form.Element.Serializers[child.tagName.toLowerCase()]) elements.push(Element.extend(child)); return elements; } ); }, getInputs: function(form, typeName, name) { form =3D $(form); var inputs =3D form.getElementsByTagName('input'); if (!typeName && !name) return inputs; var matchingInputs =3D new Array(); for (var i =3D 0, length =3D inputs.length; i < length; i++) { var input =3D inputs[i]; if ((typeName && input.type !=3D typeName) || (name && input.name !=3D name)) continue; matchingInputs.push(Element.extend(input)); } return matchingInputs; }, disable: function(form) { form =3D $(form); form.getElements().each(function(element) { element.blur(); element.disabled =3D 'true'; }); return form; }, enable: function(form) { form =3D $(form); form.getElements().each(function(element) { element.disabled =3D ''; }); return form; }, findFirstElement: function(form) { return $(form).getElements().find(function(element) { return element.type !=3D 'hidden' && !element.disabled && ['input', 'select', = 'textarea'].include(element.tagName.toLowerCase()); }); }, focusFirstElement: function(form) { form =3D $(form); form.findFirstElement().activate(); return form; } } Object.extend(Form, Form.Methods); /*-----------------------------------------------------------------------= ---*/ Form.Element =3D { focus: function(element) { $(element).focus(); return element; }, select: function(element) { $(element).select(); return element; } } Form.Element.Methods =3D { serialize: function(element) { element =3D $(element); if (element.disabled) return ''; var method =3D element.tagName.toLowerCase(); var parameter =3D Form.Element.Serializers[method](element); if (parameter) { var key =3D encodeURIComponent(parameter[0]); if (key.length =3D=3D 0) return; if (parameter[1].constructor !=3D Array) parameter[1] =3D [parameter[1]]; return parameter[1].map(function(value) { return key + '=3D' + encodeURIComponent(value); }).join('&'); } }, getValue: function(element) { element =3D $(element); var method =3D element.tagName.toLowerCase(); var parameter =3D Form.Element.Serializers[method](element); if (parameter) return parameter[1]; }, clear: function(element) { $(element).value =3D ''; return element; }, present: function(element) { return $(element).value !=3D ''; }, activate: function(element) { element =3D $(element); element.focus(); if (element.select) element.select(); return element; }, disable: function(element) { element =3D $(element); element.disabled =3D true; return element; }, enable: function(element) { element =3D $(element); element.blur(); element.disabled =3D false; return element; } } Object.extend(Form.Element, Form.Element.Methods); var Field =3D Form.Element; /*-----------------------------------------------------------------------= ---*/ Form.Element.Serializers =3D { input: function(element) { switch (element.type.toLowerCase()) { case 'checkbox': case 'radio': return Form.Element.Serializers.inputSelector(element); default: return Form.Element.Serializers.textarea(element); } return false; }, inputSelector: function(element) { if (element.checked) return [element.name, element.value]; }, textarea: function(element) { return [element.name, element.value]; }, select: function(element) { return Form.Element.Serializers[element.type =3D=3D 'select-one' ? 'selectOne' : 'selectMany'](element); }, selectOne: function(element) { var value =3D '', opt, index =3D element.selectedIndex; if (index >=3D 0) { opt =3D Element.extend(element.options[index]); // Uses the new potential extension if hasAttribute isn't native. value =3D opt.hasAttribute('value') ? opt.value : opt.text; } return [element.name, value]; }, selectMany: function(element) { var value =3D []; for (var i =3D 0; i < element.length; i++) { var opt =3D Element.extend(element.options[i]); if (opt.selected) // Uses the new potential extension if hasAttribute isn't = native. value.push(opt.hasAttribute('value') ? opt.value : opt.text); } return [element.name, value]; } } /*-----------------------------------------------------------------------= ---*/ var $F =3D Form.Element.getValue; /*-----------------------------------------------------------------------= ---*/ Abstract.TimedObserver =3D function() {} Abstract.TimedObserver.prototype =3D { initialize: function(element, frequency, callback) { this.frequency =3D frequency; this.element =3D $(element); this.callback =3D callback; this.lastValue =3D this.getValue(); this.registerCallback(); }, registerCallback: function() { setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); }, onTimerEvent: function() { var value =3D this.getValue(); if (this.lastValue !=3D value) { this.callback(this.element, value); this.lastValue =3D value; } } } Form.Element.Observer =3D Class.create(); Form.Element.Observer.prototype =3D Object.extend(new = Abstract.TimedObserver(), { getValue: function() { return Form.Element.getValue(this.element); } }); Form.Observer =3D Class.create(); Form.Observer.prototype =3D Object.extend(new Abstract.TimedObserver(), = { getValue: function() { return Form.serialize(this.element); } }); /*-----------------------------------------------------------------------= ---*/ Abstract.EventObserver =3D function() {} Abstract.EventObserver.prototype =3D { initialize: function(element, callback) { this.element =3D $(element); this.callback =3D callback; this.lastValue =3D this.getValue(); if (this.element.tagName.toLowerCase() =3D=3D 'form') this.registerFormCallbacks(); else this.registerCallback(this.element); }, onElementEvent: function() { var value =3D this.getValue(); if (this.lastValue !=3D value) { this.callback(this.element, value); this.lastValue =3D value; } }, registerFormCallbacks: function() { = Form.getElements(this.element).each(this.registerCallback.bind(this)); }, registerCallback: function(element) { if (element.type) { switch (element.type.toLowerCase()) { case 'checkbox': case 'radio': Event.observe(element, 'click', = this.onElementEvent.bind(this)); break; default: Event.observe(element, 'change', = this.onElementEvent.bind(this)); break; } } } } Form.Element.EventObserver =3D Class.create(); Form.Element.EventObserver.prototype =3D Object.extend(new = Abstract.EventObserver(), { getValue: function() { return Form.Element.getValue(this.element); } }); Form.EventObserver =3D Class.create(); Form.EventObserver.prototype =3D Object.extend(new = Abstract.EventObserver(), { getValue: function() { return Form.serialize(this.element); } }); if (!window.Event) { var Event =3D new Object(); } Object.extend(Event, { KEY_BACKSPACE: 8, KEY_TAB: 9, KEY_RETURN: 13, KEY_ESC: 27, KEY_LEFT: 37, KEY_UP: 38, KEY_RIGHT: 39, KEY_DOWN: 40, KEY_DELETE: 46, KEY_HOME: 36, KEY_END: 35, KEY_PAGEUP: 33, KEY_PAGEDOWN: 34, element: function(event) { return event.target || event.srcElement; }, isLeftClick: function(event) { return (((event.which) && (event.which =3D=3D 1)) || ((event.button) && (event.button =3D=3D 1))); }, pointerX: function(event) { return event.pageX || (event.clientX + (document.documentElement.scrollLeft || = document.body.scrollLeft)); }, pointerY: function(event) { return event.pageY || (event.clientY + (document.documentElement.scrollTop || document.body.scrollTop)); }, stop: function(event) { if (event.preventDefault) { event.preventDefault(); event.stopPropagation(); } else { event.returnValue =3D false; event.cancelBubble =3D true; } }, // find the first node with the given tagName, starting from the // node the event was triggered on; traverses the DOM upwards findElement: function(event, tagName) { var element =3D Event.element(event); while (element.parentNode && (!element.tagName || (element.tagName.toUpperCase() !=3D tagName.toUpperCase()))) element =3D element.parentNode; return element; }, observers: false, _observeAndCache: function(element, name, observer, useCapture) { if (!this.observers) this.observers =3D []; if (element.addEventListener) { this.observers.push([element, name, observer, useCapture]); element.addEventListener(name, observer, useCapture); } else if (element.attachEvent) { this.observers.push([element, name, observer, useCapture]); element.attachEvent('on' + name, observer); } }, unloadCache: function() { if (!Event.observers) return; for (var i =3D 0, length =3D Event.observers.length; i < length; = i++) { Event.stopObserving.apply(this, Event.observers[i]); Event.observers[i][0] =3D null; } Event.observers =3D false; }, observe: function(element, name, observer, useCapture) { element =3D $(element); useCapture =3D useCapture || false; if (name =3D=3D 'keypress' && (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.attachEvent)) name =3D 'keydown'; Event._observeAndCache(element, name, observer, useCapture); }, stopObserving: function(element, name, observer, useCapture) { element =3D $(element); useCapture =3D useCapture || false; if (name =3D=3D 'keypress' && (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.detachEvent)) name =3D 'keydown'; if (element.removeEventListener) { element.removeEventListener(name, observer, useCapture); } else if (element.detachEvent) { try { element.detachEvent('on' + name, observer); } catch (e) {} } } }); /* prevent memory leaks in IE */ if (navigator.appVersion.match(/\bMSIE\b/)) Event.observe(window, 'unload', Event.unloadCache, false); var Position =3D { // set to true if needed, warning: firefox performance problems // NOT neeeded for page scrolling, only if draggable contained in // scrollable elements includeScrollOffsets: false, // must be called before calling withinIncludingScrolloffset, every = time the // page is scrolled prepare: function() { this.deltaX =3D window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0; this.deltaY =3D window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; }, realOffset: function(element) { var valueT =3D 0, valueL =3D 0; do { valueT +=3D element.scrollTop || 0; valueL +=3D element.scrollLeft || 0; element =3D element.parentNode; } while (element); return [valueL, valueT]; }, cumulativeOffset: function(element) { var valueT =3D 0, valueL =3D 0; do { valueT +=3D element.offsetTop || 0; valueL +=3D element.offsetLeft || 0; element =3D element.offsetParent; } while (element); return [valueL, valueT]; }, positionedOffset: function(element) { var valueT =3D 0, valueL =3D 0; do { valueT +=3D element.offsetTop || 0; valueL +=3D element.offsetLeft || 0; element =3D element.offsetParent; if (element) { if(element.tagName=3D=3D'BODY') break; var p =3D Element.getStyle(element, 'position'); if (p =3D=3D 'relative' || p =3D=3D 'absolute') break; } } while (element); return [valueL, valueT]; }, offsetParent: function(element) { if (element.offsetParent) return element.offsetParent; if (element =3D=3D document.body) return element; while ((element =3D element.parentNode) && element !=3D = document.body) if (Element.getStyle(element, 'position') !=3D 'static') return element; return document.body; }, // caches x/y coordinate pair to use with overlap within: function(element, x, y) { if (this.includeScrollOffsets) return this.withinIncludingScrolloffsets(element, x, y); this.xcomp =3D x; this.ycomp =3D y; this.offset =3D this.cumulativeOffset(element); return (y >=3D this.offset[1] && y < this.offset[1] + element.offsetHeight && x >=3D this.offset[0] && x < this.offset[0] + element.offsetWidth); }, withinIncludingScrolloffsets: function(element, x, y) { var offsetcache =3D this.realOffset(element); this.xcomp =3D x + offsetcache[0] - this.deltaX; this.ycomp =3D y + offsetcache[1] - this.deltaY; this.offset =3D this.cumulativeOffset(element); return (this.ycomp >=3D this.offset[1] && this.ycomp < this.offset[1] + element.offsetHeight && this.xcomp >=3D this.offset[0] && this.xcomp < this.offset[0] + element.offsetWidth); }, // within must be called directly before overlap: function(mode, element) { if (!mode) return 0; if (mode =3D=3D 'vertical') return ((this.offset[1] + element.offsetHeight) - this.ycomp) / element.offsetHeight; if (mode =3D=3D 'horizontal') return ((this.offset[0] + element.offsetWidth) - this.xcomp) / element.offsetWidth; }, page: function(forElement) { var valueT =3D 0, valueL =3D 0; var element =3D forElement; do { valueT +=3D element.offsetTop || 0; valueL +=3D element.offsetLeft || 0; // Safari fix if (element.offsetParent=3D=3Ddocument.body) if (Element.getStyle(element,'position')=3D=3D'absolute') break; } while (element =3D element.offsetParent); element =3D forElement; do { if (!window.opera || element.tagName=3D=3D'BODY') { valueT -=3D element.scrollTop || 0; valueL -=3D element.scrollLeft || 0; } } while (element =3D element.parentNode); return [valueL, valueT]; }, clone: function(source, target) { var options =3D Object.extend({ setLeft: true, setTop: true, setWidth: true, setHeight: true, offsetTop: 0, offsetLeft: 0 }, arguments[2] || {}) // find page position of source source =3D $(source); var p =3D Position.page(source); // find coordinate system to use target =3D $(target); var delta =3D [0, 0]; var parent =3D null; // delta [0,0] will do fine with position: fixed elements, // position:absolute needs offsetParent deltas if (Element.getStyle(target,'position') =3D=3D 'absolute') { parent =3D Position.offsetParent(target); delta =3D Position.page(parent); } // correct by body offsets (fixes Safari) if (parent =3D=3D document.body) { delta[0] -=3D document.body.offsetLeft; delta[1] -=3D document.body.offsetTop; } // set position if(options.setLeft) target.style.left =3D (p[0] - delta[0] + = options.offsetLeft) + 'px'; if(options.setTop) target.style.top =3D (p[1] - delta[1] + = options.offsetTop) + 'px'; if(options.setWidth) target.style.width =3D source.offsetWidth + = 'px'; if(options.setHeight) target.style.height =3D source.offsetHeight + = 'px'; }, absolutize: function(element) { element =3D $(element); if (element.style.position =3D=3D 'absolute') return; Position.prepare(); var offsets =3D Position.positionedOffset(element); var top =3D offsets[1]; var left =3D offsets[0]; var width =3D element.clientWidth; var height =3D element.clientHeight; element._originalLeft =3D left - parseFloat(element.style.left || = 0); element._originalTop =3D top - parseFloat(element.style.top || = 0); element._originalWidth =3D element.style.width; element._originalHeight =3D element.style.height; element.style.position =3D 'absolute'; element.style.top =3D top + 'px';; element.style.left =3D left + 'px';; element.style.width =3D width + 'px';; element.style.height =3D height + 'px';; }, relativize: function(element) { element =3D $(element); if (element.style.position =3D=3D 'relative') return; Position.prepare(); element.style.position =3D 'relative'; var top =3D parseFloat(element.style.top || 0) - = (element._originalTop || 0); var left =3D parseFloat(element.style.left || 0) - = (element._originalLeft || 0); element.style.top =3D top + 'px'; element.style.left =3D left + 'px'; element.style.height =3D element._originalHeight; element.style.width =3D element._originalWidth; } } // Safari returns margins on body which is incorrect if the child is = absolutely // positioned. For performance reasons, redefine = Position.cumulativeOffset for // KHTML/WebKit only. if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) { Position.cumulativeOffset =3D function(element) { var valueT =3D 0, valueL =3D 0; do { valueT +=3D element.offsetTop || 0; valueL +=3D element.offsetLeft || 0; if (element.offsetParent =3D=3D document.body) if (Element.getStyle(element, 'position') =3D=3D 'absolute') = break; element =3D element.offsetParent; } while (element); return [valueL, valueT]; } } Element.addMethods(); ------=_NextPart_000_0000_01C8EFC0.9F226590 Content-Type: application/octet-stream Content-Transfer-Encoding: quoted-printable Content-Location: http://www.stovezata.praha.eu/src/scriptaculous.js // script.aculo.us scriptaculous.js v1.6.5, Wed Nov 08 14:17:49 CET 2006 // Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, = http://mir.aculo.us) //=20 // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: //=20 // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS = BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN = ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // For details, see the script.aculo.us web site: = http://script.aculo.us/ var Scriptaculous =3D { Version: '1.6.5', require: function(libraryName) { // inserting via DOM fails in Safari 2.0, so brute force approach document.write(''); }, load: function() { if((typeof Prototype=3D=3D'undefined') ||=20 (typeof Element =3D=3D 'undefined') ||=20 (typeof Element.Methods=3D=3D'undefined') || parseFloat(Prototype.Version.split(".")[0] + "." + Prototype.Version.split(".")[1]) < 1.5) throw("script.aculo.us requires the Prototype JavaScript = framework >=3D 1.5.0"); =20 $A(document.getElementsByTagName("script")).findAll( function(s) { return (s.src && s.src.match(/scriptaculous\.js(\?.*)?$/)) }).each( function(s) { var path =3D s.src.replace(/scriptaculous\.js(\?.*)?$/,''); var includes =3D s.src.match(/\?.*load=3D([a-z,]*)/); (includes ? includes[1] : = 'builder,effects,dragdrop,controls,slider').split(',').each( function(include) { Scriptaculous.require(path+include+'.js') }); }); } } Scriptaculous.load(); ------=_NextPart_000_0000_01C8EFC0.9F226590 Content-Type: application/octet-stream Content-Transfer-Encoding: quoted-printable Content-Location: http://www.stovezata.praha.eu/src/unittest.js // script.aculo.us unittest.js v1.6.5, Wed Nov 08 14:17:49 CET 2006 // Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, = http://mir.aculo.us) // (c) 2005, 2006 Jon Tirsen (http://www.tirsen.com) // (c) 2005, 2006 Michael Schuerig = (http://www.schuerig.de/michael/) // // script.aculo.us is freely distributable under the terms of an = MIT-style license. // For details, see the script.aculo.us web site: = http://script.aculo.us/ // experimental, Firefox-only Event.simulateMouse =3D function(element, eventName) { var options =3D Object.extend({ pointerX: 0, pointerY: 0, buttons: 0, ctrlKey: false, altKey: false, shiftKey: false, metaKey: false }, arguments[2] || {}); var oEvent =3D document.createEvent("MouseEvents"); oEvent.initMouseEvent(eventName, true, true, document.defaultView,=20 options.buttons, options.pointerX, options.pointerY, = options.pointerX, options.pointerY,=20 options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, = 0, $(element)); =20 if(this.mark) Element.remove(this.mark); this.mark =3D document.createElement('div'); this.mark.appendChild(document.createTextNode(" ")); document.body.appendChild(this.mark); this.mark.style.position =3D 'absolute'; this.mark.style.top =3D options.pointerY + "px"; this.mark.style.left =3D options.pointerX + "px"; this.mark.style.width =3D "5px"; this.mark.style.height =3D "5px;"; this.mark.style.borderTop =3D "1px solid red;" this.mark.style.borderLeft =3D "1px solid red;" =20 if(this.step) alert('['+new Date().getTime().toString()+'] = '+eventName+'/'+Test.Unit.inspect(options)); =20 $(element).dispatchEvent(oEvent); }; // Note: Due to a fix in Firefox 1.0.5/6 that probably fixed "too much", = this doesn't work in 1.0.6 or DP2. // You need to downgrade to 1.0.4 for now to get this working // See https://bugzilla.mozilla.org/show_bug.cgi?id=3D289940 for the fix = that fixed too much Event.simulateKey =3D function(element, eventName) { var options =3D Object.extend({ ctrlKey: false, altKey: false, shiftKey: false, metaKey: false, keyCode: 0, charCode: 0 }, arguments[2] || {}); var oEvent =3D document.createEvent("KeyEvents"); oEvent.initKeyEvent(eventName, true, true, window,=20 options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, options.keyCode, options.charCode ); $(element).dispatchEvent(oEvent); }; Event.simulateKeys =3D function(element, command) { for(var i=3D0; i' + '' + = '' + '' + '
StatusTestMessage
'; this.logsummary =3D $('logsummary') this.loglines =3D $('loglines'); }, _toHTML: function(txt) { return txt.escapeHTML().replace(/\n/g,"
"); }, addLinksToResults: function(){=20 $$("tr.failed .nameCell").each( function(td){ // todo: limit to = children of this.log td.title =3D "Run only this test" Event.observe(td, 'click', function(){ window.location.search =3D = "?tests=3D" + td.innerHTML;}); }); $$("tr.passed .nameCell").each( function(td){ // todo: limit to = children of this.log td.title =3D "Run all tests" Event.observe(td, 'click', function(){ window.location.search =3D = "";}); }); } } Test.Unit.Runner =3D Class.create(); Test.Unit.Runner.prototype =3D { initialize: function(testcases) { this.options =3D Object.extend({ testLog: 'testlog' }, arguments[1] || {}); this.options.resultsURL =3D this.parseResultsURLQueryParameter(); this.options.tests =3D this.parseTestsQueryParameter(); if (this.options.testLog) { this.options.testLog =3D $(this.options.testLog) || null; } if(this.options.tests) { this.tests =3D []; for(var i =3D 0; i < this.options.tests.length; i++) { if(/^test/.test(this.options.tests[i])) { this.tests.push(new Test.Unit.Testcase(this.options.tests[i], = testcases[this.options.tests[i]], testcases["setup"], = testcases["teardown"])); } } } else { if (this.options.test) { this.tests =3D [new Test.Unit.Testcase(this.options.test, = testcases[this.options.test], testcases["setup"], = testcases["teardown"])]; } else { this.tests =3D []; for(var testcase in testcases) { if(/^test/.test(testcase)) { this.tests.push( new Test.Unit.Testcase( this.options.context ? ' -> ' + = this.options.titles[testcase] : testcase,=20 testcases[testcase], testcases["setup"], = testcases["teardown"] )); } } } } this.currentTest =3D 0; this.logger =3D new Test.Unit.Logger(this.options.testLog); setTimeout(this.runTests.bind(this), 1000); }, parseResultsURLQueryParameter: function() { return window.location.search.parseQuery()["resultsURL"]; }, parseTestsQueryParameter: function(){ if (window.location.search.parseQuery()["tests"]){ return window.location.search.parseQuery()["tests"].split(','); }; }, // Returns: // "ERROR" if there was an error, // "FAILURE" if there was a failure, or // "SUCCESS" if there was neither getResult: function() { var hasFailure =3D false; for(var i=3D0;i 0) { return "ERROR"; } if (this.tests[i].failures > 0) { hasFailure =3D true; } } if (hasFailure) { return "FAILURE"; } else { return "SUCCESS"; } }, postResults: function() { if (this.options.resultsURL) { new Ajax.Request(this.options.resultsURL,=20 { method: 'get', parameters: 'result=3D' + this.getResult(), = asynchronous: false }); } }, runTests: function() { var test =3D this.tests[this.currentTest]; if (!test) { // finished! this.postResults(); this.logger.summary(this.summary()); return; } if(!test.isWaiting) { this.logger.start(test.name); } test.run(); if(test.isWaiting) { this.logger.message("Waiting for " + test.timeToWait + "ms"); setTimeout(this.runTests.bind(this), test.timeToWait || 1000); } else { this.logger.finish(test.status(), test.summary()); this.currentTest++; // tail recursive, hopefully the browser will skip the stackframe this.runTests(); } }, summary: function() { var assertions =3D 0; var failures =3D 0; var errors =3D 0; var messages =3D []; for(var i=3D0;i 0) return 'failed'; if (this.errors > 0) return 'error'; return 'passed'; }, assert: function(expression) { var message =3D arguments[1] || 'assert: got "' + = Test.Unit.inspect(expression) + '"'; try { expression ? this.pass() :=20 this.fail(message); } catch(e) { this.error(e); } }, assertEqual: function(expected, actual) { var message =3D arguments[2] || "assertEqual"; try { (expected =3D=3D actual) ? this.pass() : this.fail(message + ': expected "' + Test.Unit.inspect(expected) + = '", actual "' + Test.Unit.inspect(actual) + '"'); } catch(e) { this.error(e); } }, assertEnumEqual: function(expected, actual) { var message =3D arguments[2] || "assertEnumEqual"; try { $A(expected).length =3D=3D $A(actual).length &&=20 expected.zip(actual).all(function(pair) { return pair[0] =3D=3D = pair[1] }) ? this.pass() : this.fail(message + ': expected ' + = Test.Unit.inspect(expected) +=20 ', actual ' + Test.Unit.inspect(actual)); } catch(e) { this.error(e); } }, assertNotEqual: function(expected, actual) { var message =3D arguments[2] || "assertNotEqual"; try { (expected !=3D actual) ? this.pass() :=20 this.fail(message + ': got "' + Test.Unit.inspect(actual) + '"'); = } catch(e) { this.error(e); } }, assertIdentical: function(expected, actual) {=20 var message =3D arguments[2] || "assertIdentical";=20 try { (expected =3D=3D=3D actual) ? this.pass() :=20 this.fail(message + ': expected "' + Test.Unit.inspect(expected) + = =20 '", actual "' + Test.Unit.inspect(actual) + '"'); }=20 catch(e) { this.error(e); }=20 }, assertNotIdentical: function(expected, actual) {=20 var message =3D arguments[2] || "assertNotIdentical";=20 try { !(expected =3D=3D=3D actual) ? this.pass() :=20 this.fail(message + ': expected "' + Test.Unit.inspect(expected) + = =20 '", actual "' + Test.Unit.inspect(actual) + '"'); }=20 catch(e) { this.error(e); }=20 }, assertNull: function(obj) { var message =3D arguments[1] || 'assertNull' try { (obj=3D=3Dnull) ? this.pass() :=20 this.fail(message + ': got "' + Test.Unit.inspect(obj) + '"'); } catch(e) { this.error(e); } }, assertMatch: function(expected, actual) { var message =3D arguments[2] || 'assertMatch'; var regex =3D new RegExp(expected); try { (regex.exec(actual)) ? this.pass() : this.fail(message + ' : regex: "' + Test.Unit.inspect(expected) + = ' did not match: ' + Test.Unit.inspect(actual) + '"'); } catch(e) { this.error(e); } }, assertHidden: function(element) { var message =3D arguments[1] || 'assertHidden'; this.assertEqual("none", element.style.display, message); }, assertNotNull: function(object) { var message =3D arguments[1] || 'assertNotNull'; this.assert(object !=3D null, message); }, assertType: function(expected, actual) { var message =3D arguments[2] || 'assertType'; try {=20 (actual.constructor =3D=3D expected) ? this.pass() :=20 this.fail(message + ': expected "' + Test.Unit.inspect(expected) + = =20 '", actual "' + (actual.constructor) + '"'); } catch(e) { this.error(e); } }, assertNotOfType: function(expected, actual) { var message =3D arguments[2] || 'assertNotOfType'; try {=20 (actual.constructor !=3D expected) ? this.pass() :=20 this.fail(message + ': expected "' + Test.Unit.inspect(expected) + = =20 '", actual "' + (actual.constructor) + '"'); } catch(e) { this.error(e); } }, assertInstanceOf: function(expected, actual) { var message =3D arguments[2] || 'assertInstanceOf'; try {=20 (actual instanceof expected) ? this.pass() :=20 this.fail(message + ": object was not an instance of the expected = type"); } catch(e) { this.error(e); }=20 }, assertNotInstanceOf: function(expected, actual) { var message =3D arguments[2] || 'assertNotInstanceOf'; try {=20 !(actual instanceof expected) ? this.pass() :=20 this.fail(message + ": object was an instance of the not expected = type"); } catch(e) { this.error(e); }=20 }, assertRespondsTo: function(method, obj) { var message =3D arguments[2] || 'assertRespondsTo'; try { (obj[method] && typeof obj[method] =3D=3D 'function') ? = this.pass() :=20 this.fail(message + ": object doesn't respond to [" + method + = "]"); } catch(e) { this.error(e); } }, assertReturnsTrue: function(method, obj) { var message =3D arguments[2] || 'assertReturnsTrue'; try { var m =3D obj[method]; if(!m) m =3D = obj['is'+method.charAt(0).toUpperCase()+method.slice(1)]; m() ? this.pass() :=20 this.fail(message + ": method returned false"); } catch(e) { this.error(e); } }, assertReturnsFalse: function(method, obj) { var message =3D arguments[2] || 'assertReturnsFalse'; try { var m =3D obj[method]; if(!m) m =3D = obj['is'+method.charAt(0).toUpperCase()+method.slice(1)]; !m() ? this.pass() :=20 this.fail(message + ": method returned true"); } catch(e) { this.error(e); } }, assertRaise: function(exceptionName, method) { var message =3D arguments[2] || 'assertRaise'; try {=20 method(); this.fail(message + ": exception expected but none was raised"); } catch(e) { (e.name=3D=3DexceptionName) ? this.pass() : this.error(e);=20 } }, assertElementsMatch: function() { var expressions =3D $A(arguments), elements =3D = $A(expressions.shift()); if (elements.length !=3D expressions.length) { this.fail('assertElementsMatch: size mismatch: ' + elements.length = + ' elements, ' + expressions.length + ' expressions'); return false; } elements.zip(expressions).all(function(pair, index) { var element =3D $(pair.first()), expression =3D pair.last(); if (element.match(expression)) return true; this.fail('assertElementsMatch: (in index ' + index + ') expected = ' + expression.inspect() + ' but got ' + element.inspect()); }.bind(this)) && this.pass(); }, assertElementMatches: function(element, expression) { this.assertElementsMatch([element], expression); }, benchmark: function(operation, iterations) { var startAt =3D new Date(); (iterations || 1).times(operation); var timeTaken =3D ((new Date())-startAt); this.info((arguments[2] || 'Operation') + ' finished ' +=20 iterations + ' iterations in ' + (timeTaken/1000)+'s' ); return timeTaken; }, _isVisible: function(element) { element =3D $(element); if(!element.parentNode) return true; this.assertNotNull(element); if(element.style && Element.getStyle(element, 'display') =3D=3D = 'none') return false; =20 return this._isVisible(element.parentNode); }, assertNotVisible: function(element) { this.assert(!this._isVisible(element), Test.Unit.inspect(element) + = " was not hidden and didn't have a hidden parent either. " + ("" || = arguments[1])); }, assertVisible: function(element) { this.assert(this._isVisible(element), Test.Unit.inspect(element) + " = was not visible. " + ("" || arguments[1])); }, benchmark: function(operation, iterations) { var startAt =3D new Date(); (iterations || 1).times(operation); var timeTaken =3D ((new Date())-startAt); this.info((arguments[2] || 'Operation') + ' finished ' +=20 iterations + ' iterations in ' + (timeTaken/1000)+'s' ); return timeTaken; } } Test.Unit.Testcase =3D Class.create(); Object.extend(Object.extend(Test.Unit.Testcase.prototype, = Test.Unit.Assertions.prototype), { initialize: function(name, test, setup, teardown) { Test.Unit.Assertions.prototype.initialize.bind(this)(); this.name =3D name; =20 if(typeof test =3D=3D 'string') { test =3D test.gsub(/(\.should[^\(]+\()/,'#{0}this,'); test =3D test.gsub(/(\.should[^\(]+)\(this,\)/,'#{1}(this)'); this.test =3D function() { eval('with(this){'+test+'}'); } } else { this.test =3D test || function() {}; } =20 this.setup =3D setup || function() {}; this.teardown =3D teardown || function() {}; this.isWaiting =3D false; this.timeToWait =3D 1000; }, wait: function(time, nextPart) { this.isWaiting =3D true; this.test =3D nextPart; this.timeToWait =3D time; }, run: function() { try { try { if (!this.isWaiting) this.setup.bind(this)(); this.isWaiting =3D false; this.test.bind(this)(); } finally { if(!this.isWaiting) { this.teardown.bind(this)(); } } } catch(e) { this.error(e); } } }); // *EXPERIMENTAL* BDD-style testing to please non-technical folk // This draws many ideas from RSpec http://rspec.rubyforge.org/ Test.setupBDDExtensionMethods =3D function(){ var METHODMAP =3D { shouldEqual: 'assertEqual', shouldNotEqual: 'assertNotEqual', shouldEqualEnum: 'assertEnumEqual', shouldBeA: 'assertType', shouldNotBeA: 'assertNotOfType', shouldBeAn: 'assertType', shouldNotBeAn: 'assertNotOfType', shouldBeNull: 'assertNull', shouldNotBeNull: 'assertNotNull', =20 shouldBe: 'assertReturnsTrue', shouldNotBe: 'assertReturnsFalse', shouldRespondTo: 'assertRespondsTo' }; Test.BDDMethods =3D {}; for(m in METHODMAP) { Test.BDDMethods[m] =3D eval( 'function(){'+ 'var args =3D $A(arguments);'+ 'var scope =3D args.shift();'+ 'scope.'+METHODMAP[m]+'.apply(scope,(args || []).concat([this])); = }'); } [Array.prototype, String.prototype, Number.prototype].each( function(p){ Object.extend(p, Test.BDDMethods) } ); } Test.context =3D function(name, spec, log){ Test.setupBDDExtensionMethods(); =20 var compiledSpec =3D {}; var titles =3D {}; for(specName in spec) { switch(specName){ case "setup": case "teardown": compiledSpec[specName] =3D spec[specName]; break; default: var testName =3D 'test'+specName.gsub(/\s+/,'-').camelize(); var body =3D spec[specName].toString().split('\n').slice(1); if(/^\{/.test(body[0])) body =3D body.slice(1); body.pop(); body =3D body.map(function(statement){=20 return statement.strip() }); compiledSpec[testName] =3D body.join('\n'); titles[testName] =3D specName; } } new Test.Unit.Runner(compiledSpec, { titles: titles, testLog: log || = 'testlog', context: name }); }; ------=_NextPart_000_0000_01C8EFC0.9F226590--