From: Subject: =?iso-2022-jp?B?REhTIHZpZGVvcyBnZXQgbmF0aW9uYWwgYXVkaWVuY2UgfCBEZW50b24gUmVjb3JkIENocm9uaWNsZSB8IE5ld3MgZm9yIERlbnRvbiBDb3VudHksIFRleGFzIHwgTG9jYWwgTmV3cw==?= Date: Fri, Jun 26 2009 11:18:34 GMT-0500 MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_NextPart_000_0000_4A5C91E5.6309193D"; type="text/html" ------=_NextPart_000_0000_4A5C91E5.6309193D Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-Location: http://www.dentonrc.com/sharedcontent/dws/drc/localnews/stories/DRC_stories_0625.423c510.html =EF=BB=BF DHS videos get national audience |= =20 Denton Record Chronicle | News for Denton County, Texas | Local News
= =09
    = =09
  • Log In
  • |
  • Become a Member<= /li>
  • |
  • Member Center
  • |
  • Make This Your Home Page
  • |
  • Subscribe to the Ne= wspaper
3D""3D""
= =09
= =09
= =20
3D""

3D""

= =09

Whether it's time to change careers or just bosses, search job = postings here.

= =09
= =09 = =09

Search the De= nton Record-Chronicle Classifieds.

= =09

The area&#= x27;s best online directory for local businesses.

= =09
= =20 = =20 = =20

DHS videos get national audience

Student team takes work to c= onference in Houston

07:59 AM CDT on Thursday, June 25, 2009

By Karina Ram=C3=ADrez = / Staff Writer

After three years of learning to tell stories through video,= a group of Denton High School students will finally present their w= ork to someone outside the school.

The Free M= inds, Free People national conference promotes sharing knowledge, ex= periences and strategies to help students understand some of the cha= llenges facing their communities. The conference runs today through = Sunday in Houston.

Five students from Denton High=E2= =80=99s PALS =E2=80=94 Peer Assistance, Leadership and Service =E2= =80=94 program will present their films and discuss their experiences = regarding their use of research, media and storytelling.

= In addition to young people, the conference will include researchers= , teachers, community activists and parents, said Mariela Nu=C3=B1ez= -Janes, one of the program=E2=80=99s co-directors and a professor at= anthropology at the University of North Texas.

= It is the second time that the Denton High group has been invited to the= conference, she said, but the first event was in Chicago and the gr= oup could not afford to go.

This year, howeve= r, Katie Carr, 18, Lauren Kruse, 16, Elisa Martinez, 17, Katrina Gar= cia, 16, and Jessica Solis, 18, will travel to the conference to pre= sent their projects.

=E2=80=9CIt is kind of cool to = go to a conference where more people than just your class can see yo= ur work,=E2=80=9D Carr said.

What began in 2007 when= one student attended a digital storytelling workshop grew into the = digital storytelling component of the PALS class at Denton High Scho= ol. Tim Sanchez teaches that class and co-directs the project with N= u=C3=B1ez-Janes. Shaun Chapa, a UNT graduate student, helps with the= class.

This year, 17 students worked on films based= mostly on family experiences. The five attending the conference wil= l present videos dealing with topics including alcohol abuse, the ef= fects of divorce on children and tributes to parents or other family= members.

Before the students created their two-minu= te digital stories, they participated in a story circle during a PAL= S class.

=E2=80=9CI asked them to share their best a= nd worst moments, something they were comfortable sharing,=E2=80=9D = Sanchez said.

The story circle led to close relation= ships between the 17 students, Sanchez said.

= Martinez, who has been in the U.S. for eight years, said the story c= ircle helped the daily interactions between her classmates.

=E2=80=9CIt=E2=80=99s amazing what we get to share with other peopl= e, because they probably feel the same way you feel and you get to s= ee how you are not alone and the only one struggling. ... Maybe it= =E2=80=99s not on the same issue as you, but it=E2=80=99s their stru= ggle,=E2=80=9D she said. =E2=80=9CYou be there for them and be suppo= rtive, and you get closer.=E2=80=9D

Garcia created a= video dedicated to her mom. Participating in the story circle gave = her a different perspective, she said, adding that it made her think= and gave her a sense of curiosity.

=E2=80=9CIt=E2= =80=99s emotional, but not in the bad way,=E2=80=9D Garcia said. =E2=80=9CW= e had mixed emotions; we were constantly opening up to each other.= =E2=80=9D

Sanchez said that although the students sh= ared explicit details of their lives during their story circle exper= ience, the finished digital stories were different.

= =E2=80=9CThey get to choose what they want to discuss in their video= ,=E2=80=9D Nu=C3=B1ez-Janes said. =E2=80=9CThere were a lot of thank= -yous we noticed; there was also pretty strong stuff. That=E2=80=99s= why it was hard.=E2=80=9D

Sanchez said they will wo= rk on getting more happy stories next year, since the majority of th= e digital projects were somber in nature.

After the = students completed the story circle, they worked to finish their pie= ces during a weekend in November. They spent two days finishing thei= r scripts and then putting everything together in digital form.

=

Sanchez said that because of the PALS project=E2=80=99s popular= ity, two classes will be offered in the fall.

= KARINA RAM=C3=8DREZ can be reached at 940-566-6878. Her e-mail address is kramirez@dentonrc.com .

 

=

 


Create A Screen Name

Screen names can only consist of letters and numbers.
Your screen = name will appear to everyone.
NOTE: You cannot change, de= lete,
or edit your screen name once you hit "Save".


3D"Check = 3D"Cancel

= =09
Leave Comment
= =09
Conversation gu= idelines:= =20 We welcome your thoughts and information related to this article. Whe= n leaving= =20 comments please stay on topic and be respectful of others.
= =09

You must be logged in to contribute. L= og in | Register Now!

You are logged in as screenname | Log Out

You are logged in, but do not have a "= ;screen" name. Creat= e a Screen Name

Showing:


= =09
Comments (1)
= =09
Posted by JS | 19 hours ago

Good job guys!!


0 0
= =09 = =09
= =09
= =09

Report item as: (required)
Comment: (optional)
3D""
= =09
= =09
3D"News RSS
E-Mail newsletters<= /a>

Advertisement
3D""
Most Popular Stories
3D"" 3D""

3D""

 

 

3D""
 
3D"" 3D""
3D"" 3D""

Home | Co= ntact Us | HelpCenter | Advertising | Site Map | About Us | Careers | Find a Business
Terms of Service | Privacy

=C2=A9 2009 Denton Publishing Co.

3D""

Local
3D""
Other News=
Sports
3D""
Sports Home<= /div>
Business/Tech=
Entertainment
Lifestyles
3D""
Travel<= /div>
------=_NextPart_000_0000_4A5C91E5.6309193D Content-Type: text/css Content-Transfer-Encoding: quoted-printable Content-Location: http://www.dentonrc.com/sharedcontent/cgm/ver1.0/assets/styles/slcgm_global.css .slcgm_announcement { border-width:1px; border-style:dotted; padding:10px; margin:0px !important; text-align:justify; font-size: 10pt; font-family: Arial,Verdana,"sans serif"; } .slcgm_red { border-color:#FFCFD1 !important; color:#7F0900 !important; background-color:#FFF0EF !important; } .slcgm_green { border-color:#BFFFC8 !important; color:#009900 !important; background-color:#DFFFDF !important; } .slcgm_blue { border-color:#CBD5DC !important; color:#0D2068 !important; background-color:#DFF5FF !important; } .PersonaHeader_PrivateContent { display:none; } h3.cgmheader { min-height:50px; } /* header login */ div.p_login{ float:right; margin:1px 2px 0 20px;} div.p_links {float:left; display:inline; text-align:right; font-family:Aria= l, Helvetica, sans-serif; font-size:10px; color:#333; line-height:12px; mar= gin:0; padding:0;} div.p_links a:link, div.p_links a:visited{text-decoration:none; color:#0A45= 6F;} div.p_links a:hover{text-decoration:underline; color:#1070B6;} div.p_icon {float:left; display:inline; text-align:right; margin:0 0 0 5px;= } div.p_icon img {border:none;width:24px;height:24px;} ------=_NextPart_000_0000_4A5C91E5.6309193D Content-Type: text/css Content-Transfer-Encoding: quoted-printable Content-Location: http://www.dentonrc.com/sharedcontent/cgm/ver1.0/assets/styles/ui-jQuery/belo_lightblue/jquery-ui-1.7.2.custom.css /* * jQuery UI CSS Framework * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) l= icenses. */ /* Layout helpers ----------------------------------*/ .ui-helper-hidden { display: none; } .ui-helper-hidden-accessible { position: absolute; left: -99999999px; } .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-heigh= t: 1.3; text-decoration: none; font-size: 100%; list-style: none; } .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear:= both; visibility: hidden; } .ui-helper-clearfix { display: inline-block; } /* required comment for clearfix to work in Opera \*/ * html .ui-helper-clearfix { height:1%; } .ui-helper-clearfix { display:block; } /* end clearfix */ .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: abs= olute; opacity: 0; filter:Alpha(Opacity=3D0); } /* Interaction Cues ----------------------------------*/ .ui-state-disabled { cursor: default !important; } /* Icons ----------------------------------*/ /* states and images */ .ui-icon { display: block; text-indent: -99999px; overflow: hidden; backgro= und-repeat: no-repeat; } /* Misc visuals ----------------------------------*/ /* Overlays */ .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; heig= ht: 100%; } /* * jQuery UI CSS Framework * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) l= icenses. * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffD= efault=3DVerdana,Arial,sans-serif&fwDefault=3Dnormal&fsDefault=3D1.2em&corn= erRadius=3D0[px&bgColorHeader=3De6e6e6&bgTextureHeader=3D01_flat.png&bgImgO= pacityHeader=3D75&borderColorHeader=3D666666&fcHeader=3D000000&iconColorHea= der=3D000000&bgColorContent=3Dffffff&bgTextureContent=3D01_flat.png&bgImgOp= acityContent=3D75&borderColorContent=3D666666&fcContent=3D222222&iconColorC= ontent=3D222222&bgColorDefault=3Dededed&bgTextureDefault=3D01_flat.png&bgIm= gOpacityDefault=3D50&borderColorDefault=3D666666&fcDefault=3D000000&iconCol= orDefault=3D0070DC&bgColorHover=3Dbababa&bgTextureHover=3D01_flat.png&bgImg= OpacityHover=3D75&borderColorHover=3D6e6e6e&fcHover=3Dffffff&iconColorHover= =3Dffffff&bgColorActive=3Dffffff&bgTextureActive=3D01_flat.png&bgImgOpacity= Active=3D65&borderColorActive=3Daaaaaa&fcActive=3D000000&iconColorActive=3D= 454545&bgColorHighlight=3Dfffcb3&bgTextureHighlight=3D01_flat.png&bgImgOpac= ityHighlight=3D100&borderColorHighlight=3Dffcb33&fcHighlight=3D000000&iconC= olorHighlight=3D000000&bgColorError=3Dfef1ec&bgTextureError=3D01_flat.png&b= gImgOpacityError=3D95&borderColorError=3Dcd0a0a&fcError=3Dcd0a0a&iconColorE= rror=3Dcd0a0a&bgColorOverlay=3Dffffff&bgTextureOverlay=3D01_flat.png&bgImgO= pacityOverlay=3D50&opacityOverlay=3D70&bgColorShadow=3D808080&bgTextureShad= ow=3D01_flat.png&bgImgOpacityShadow=3D0&opacityShadow=3D30&thicknessShadow= =3D8px&offsetTopShadow=3D-8px&offsetLeftShadow=3D-8px&cornerRadiusShadow=3D= 8px */ /* Component containers ----------------------------------*/ .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.2em; } .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button= { font-family: Verdana,Arial,sans-serif; font-size: 1em; } .ui-widget-content { border: 1px solid #666666; background: #ffffff url(ima= ges/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } .ui-widget-content a { color: #222222; } .ui-widget-header { border: 1px solid #666666; background: #e6e6e6 url(imag= es/ui-bg_flat_75_e6e6e6_40x100.png) 50% 50% repeat-x; color: #000000; font-= weight: bold; } .ui-widget-header a { color: #000000; } /* Interaction states ----------------------------------*/ .ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid= #666666; background: #ededed url(images/ui-bg_flat_50_ededed_40x100.png) 5= 0% 50% repeat-x; font-weight: normal; color: #000000; outline: none; } .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited = { color: #000000; text-decoration: none; outline: none; } .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-w= idget-content .ui-state-focus { border: 1px solid #6e6e6e; background: #bab= aba url(images/ui-bg_flat_75_bababa_40x100.png) 50% 50% repeat-x; font-weig= ht: normal; color: #ffffff; outline: none; } .ui-state-hover a, .ui-state-hover a:hover { color: #ffffff; text-decoratio= n: none; outline: none; } .ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #= aaaaaa; background: #ffffff url(images/ui-bg_flat_65_ffffff_40x100.png) 50%= 50% repeat-x; font-weight: normal; color: #000000; outline: none; } .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { c= olor: #000000; outline: none; text-decoration: none; } /* Interaction Cues ----------------------------------*/ .ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px so= lid #ffcb33; background: #fffcb3 url(images/ui-bg_flat_100_fffcb3_40x100.pn= g) 50% 50% repeat-x; color: #000000; } .ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #0= 00000; } .ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0= a0a; background: #fef1ec url(images/ui-bg_flat_95_fef1ec_40x100.png) 50% 50= % repeat-x; color: #cd0a0a; } .ui-state-error a, .ui-widget-content .ui-state-error a { color: #cd0a0a; } .ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #cd0= a0a; } .ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; f= ilter:Alpha(Opacity=3D35); background-image: none; } .ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight= : bold; } .ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity= : .7; filter:Alpha(Opacity=3D70); font-weight: normal; } /* Icons ----------------------------------*/ /* states and images */ .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons= _222222_256x240.png); } .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_2= 56x240.png); } .ui-widget-header .ui-icon {background-image: url(images/ui-icons_000000_25= 6x240.png); } .ui-state-default .ui-icon { background-image: url(images/ui-icons_0070DC_2= 56x240.png); } .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(i= mages/ui-icons_ffffff_256x240.png); } .ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256= x240.png); } .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_000000_= 256x240.png); } .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: = url(images/ui-icons_cd0a0a_256x240.png); } /* positioning */ .ui-icon-carat-1-n { background-position: 0 0; } .ui-icon-carat-1-ne { background-position: -16px 0; } .ui-icon-carat-1-e { background-position: -32px 0; } .ui-icon-carat-1-se { background-position: -48px 0; } .ui-icon-carat-1-s { background-position: -64px 0; } .ui-icon-carat-1-sw { background-position: -80px 0; } .ui-icon-carat-1-w { background-position: -96px 0; } .ui-icon-carat-1-nw { background-position: -112px 0; } .ui-icon-carat-2-n-s { background-position: -128px 0; } .ui-icon-carat-2-e-w { background-position: -144px 0; } .ui-icon-triangle-1-n { background-position: 0 -16px; } .ui-icon-triangle-1-ne { background-position: -16px -16px; } .ui-icon-triangle-1-e { background-position: -32px -16px; } .ui-icon-triangle-1-se { background-position: -48px -16px; } .ui-icon-triangle-1-s { background-position: -64px -16px; } .ui-icon-triangle-1-sw { background-position: -80px -16px; } .ui-icon-triangle-1-w { background-position: -96px -16px; } .ui-icon-triangle-1-nw { background-position: -112px -16px; } .ui-icon-triangle-2-n-s { background-position: -128px -16px; } .ui-icon-triangle-2-e-w { background-position: -144px -16px; } .ui-icon-arrow-1-n { background-position: 0 -32px; } .ui-icon-arrow-1-ne { background-position: -16px -32px; } .ui-icon-arrow-1-e { background-position: -32px -32px; } .ui-icon-arrow-1-se { background-position: -48px -32px; } .ui-icon-arrow-1-s { background-position: -64px -32px; } .ui-icon-arrow-1-sw { background-position: -80px -32px; } .ui-icon-arrow-1-w { background-position: -96px -32px; } .ui-icon-arrow-1-nw { background-position: -112px -32px; } .ui-icon-arrow-2-n-s { background-position: -128px -32px; } .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } .ui-icon-arrow-2-e-w { background-position: -160px -32px; } .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } .ui-icon-arrowstop-1-n { background-position: -192px -32px; } .ui-icon-arrowstop-1-e { background-position: -208px -32px; } .ui-icon-arrowstop-1-s { background-position: -224px -32px; } .ui-icon-arrowstop-1-w { background-position: -240px -32px; } .ui-icon-arrowthick-1-n { background-position: 0 -48px; } .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } .ui-icon-arrowthick-1-e { background-position: -32px -48px; } .ui-icon-arrowthick-1-se { background-position: -48px -48px; } .ui-icon-arrowthick-1-s { background-position: -64px -48px; } .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } .ui-icon-arrowthick-1-w { background-position: -96px -48px; } .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } .ui-icon-arrow-4 { background-position: 0 -80px; } .ui-icon-arrow-4-diag { background-position: -16px -80px; } .ui-icon-extlink { background-position: -32px -80px; } .ui-icon-newwin { background-position: -48px -80px; } .ui-icon-refresh { background-position: -64px -80px; } .ui-icon-shuffle { background-position: -80px -80px; } .ui-icon-transfer-e-w { background-position: -96px -80px; } .ui-icon-transferthick-e-w { background-position: -112px -80px; } .ui-icon-folder-collapsed { background-position: 0 -96px; } .ui-icon-folder-open { background-position: -16px -96px; } .ui-icon-document { background-position: -32px -96px; } .ui-icon-document-b { background-position: -48px -96px; } .ui-icon-note { background-position: -64px -96px; } .ui-icon-mail-closed { background-position: -80px -96px; } .ui-icon-mail-open { background-position: -96px -96px; } .ui-icon-suitcase { background-position: -112px -96px; } .ui-icon-comment { background-position: -128px -96px; } .ui-icon-person { background-position: -144px -96px; } .ui-icon-print { background-position: -160px -96px; } .ui-icon-trash { background-position: -176px -96px; } .ui-icon-locked { background-position: -192px -96px; } .ui-icon-unlocked { background-position: -208px -96px; } .ui-icon-bookmark { background-position: -224px -96px; } .ui-icon-tag { background-position: -240px -96px; } .ui-icon-home { background-position: 0 -112px; } .ui-icon-flag { background-position: -16px -112px; } .ui-icon-calendar { background-position: -32px -112px; } .ui-icon-cart { background-position: -48px -112px; } .ui-icon-pencil { background-position: -64px -112px; } .ui-icon-clock { background-position: -80px -112px; } .ui-icon-disk { background-position: -96px -112px; } .ui-icon-calculator { background-position: -112px -112px; } .ui-icon-zoomin { background-position: -128px -112px; } .ui-icon-zoomout { background-position: -144px -112px; } .ui-icon-search { background-position: -160px -112px; } .ui-icon-wrench { background-position: -176px -112px; } .ui-icon-gear { background-position: -192px -112px; } .ui-icon-heart { background-position: -208px -112px; } .ui-icon-star { background-position: -224px -112px; } .ui-icon-link { background-position: -240px -112px; } .ui-icon-cancel { background-position: 0 -128px; } .ui-icon-plus { background-position: -16px -128px; } .ui-icon-plusthick { background-position: -32px -128px; } .ui-icon-minus { background-position: -48px -128px; } .ui-icon-minusthick { background-position: -64px -128px; } .ui-icon-close { background-position: -80px -128px; } .ui-icon-closethick { background-position: -96px -128px; } .ui-icon-key { background-position: -112px -128px; } .ui-icon-lightbulb { background-position: -128px -128px; } .ui-icon-scissors { background-position: -144px -128px; } .ui-icon-clipboard { background-position: -160px -128px; } .ui-icon-copy { background-position: -176px -128px; } .ui-icon-contact { background-position: -192px -128px; } .ui-icon-image { background-position: -208px -128px; } .ui-icon-video { background-position: -224px -128px; } .ui-icon-script { background-position: -240px -128px; } .ui-icon-alert { background-position: 0 -144px; } .ui-icon-info { background-position: -16px -144px; } .ui-icon-notice { background-position: -32px -144px; } .ui-icon-help { background-position: -48px -144px; } .ui-icon-check { background-position: -64px -144px; } .ui-icon-bullet { background-position: -80px -144px; } .ui-icon-radio-off { background-position: -96px -144px; } .ui-icon-radio-on { background-position: -112px -144px; } .ui-icon-pin-w { background-position: -128px -144px; } .ui-icon-pin-s { background-position: -144px -144px; } .ui-icon-play { background-position: 0 -160px; } .ui-icon-pause { background-position: -16px -160px; } .ui-icon-seek-next { background-position: -32px -160px; } .ui-icon-seek-prev { background-position: -48px -160px; } .ui-icon-seek-end { background-position: -64px -160px; } .ui-icon-seek-first { background-position: -80px -160px; } .ui-icon-stop { background-position: -96px -160px; } .ui-icon-eject { background-position: -112px -160px; } .ui-icon-volume-off { background-position: -128px -160px; } .ui-icon-volume-on { background-position: -144px -160px; } .ui-icon-power { background-position: 0 -176px; } .ui-icon-signal-diag { background-position: -16px -176px; } .ui-icon-signal { background-position: -32px -176px; } .ui-icon-battery-0 { background-position: -48px -176px; } .ui-icon-battery-1 { background-position: -64px -176px; } .ui-icon-battery-2 { background-position: -80px -176px; } .ui-icon-battery-3 { background-position: -96px -176px; } .ui-icon-circle-plus { background-position: 0 -192px; } .ui-icon-circle-minus { background-position: -16px -192px; } .ui-icon-circle-close { background-position: -32px -192px; } .ui-icon-circle-triangle-e { background-position: -48px -192px; } .ui-icon-circle-triangle-s { background-position: -64px -192px; } .ui-icon-circle-triangle-w { background-position: -80px -192px; } .ui-icon-circle-triangle-n { background-position: -96px -192px; } .ui-icon-circle-arrow-e { background-position: -112px -192px; } .ui-icon-circle-arrow-s { background-position: -128px -192px; } .ui-icon-circle-arrow-w { background-position: -144px -192px; } .ui-icon-circle-arrow-n { background-position: -160px -192px; } .ui-icon-circle-zoomin { background-position: -176px -192px; } .ui-icon-circle-zoomout { background-position: -192px -192px; } .ui-icon-circle-check { background-position: -208px -192px; } .ui-icon-circlesmall-plus { background-position: 0 -208px; } .ui-icon-circlesmall-minus { background-position: -16px -208px; } .ui-icon-circlesmall-close { background-position: -32px -208px; } .ui-icon-squaresmall-plus { background-position: -48px -208px; } .ui-icon-squaresmall-minus { background-position: -64px -208px; } .ui-icon-squaresmall-close { background-position: -80px -208px; } .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } .ui-icon-grip-solid-vertical { background-position: -32px -224px; } .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } .ui-icon-grip-diagonal-se { background-position: -80px -224px; } /* Misc visuals ----------------------------------*/ /* Corner radius */ .ui-corner-tl { -moz-border-radius-topleft: 0[px; -webkit-border-top-left-r= adius: 0[px; } .ui-corner-tr { -moz-border-radius-topright: 0[px; -webkit-border-top-right= -radius: 0[px; } .ui-corner-bl { -moz-border-radius-bottomleft: 0[px; -webkit-border-bottom-= left-radius: 0[px; } .ui-corner-br { -moz-border-radius-bottomright: 0[px; -webkit-border-bottom= -right-radius: 0[px; } .ui-corner-top { -moz-border-radius-topleft: 0[px; -webkit-border-top-left-= radius: 0[px; -moz-border-radius-topright: 0[px; -webkit-border-top-right-r= adius: 0[px; } .ui-corner-bottom { -moz-border-radius-bottomleft: 0[px; -webkit-border-bot= tom-left-radius: 0[px; -moz-border-radius-bottomright: 0[px; -webkit-border= -bottom-right-radius: 0[px; } .ui-corner-right { -moz-border-radius-topright: 0[px; -webkit-border-top-r= ight-radius: 0[px; -moz-border-radius-bottomright: 0[px; -webkit-border-bot= tom-right-radius: 0[px; } .ui-corner-left { -moz-border-radius-topleft: 0[px; -webkit-border-top-left= -radius: 0[px; -moz-border-radius-bottomleft: 0[px; -webkit-border-bottom-l= eft-radius: 0[px; } .ui-corner-all { -moz-border-radius: 0[px; -webkit-border-radius: 0[px; } /* Overlays */ .ui-widget-overlay { background: #ffffff url(images/ui-bg_flat_50_ffffff_40= x100.png) 50% 50% repeat-x; opacity: .70;filter:Alpha(Opacity=3D70); } .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #80808= 0 url(images/ui-bg_flat_0_808080_40x100.png) 50% 50% repeat-x; opacity: .30= ;filter:Alpha(Opacity=3D30); -moz-border-radius: 8px; -webkit-border-radius= : 8px; }/* Accordion ----------------------------------*/ .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; m= argin-top: 1px; zoom: 1; } .ui-accordion .ui-accordion-li-fix { display: inline; } .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } .ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padd= ing: .5em .5em .5em 2.2em; } .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5e= m; top: 50%; margin-top: -8px; } .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; ma= rgin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow:= auto; display: none; } .ui-accordion .ui-accordion-content-active { display: block; }/* Datepicker ----------------------------------*/ .ui-datepicker { width: 17em; padding: .2em .2em 0; } .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { po= sition:absolute; top: 2px; width: 1.8em; height: 1.8em; } .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-nex= t-hover { top: 1px; } .ui-datepicker .ui-datepicker-prev { left:2px; } .ui-datepicker .ui-datepicker-next { right:2px; } .ui-datepicker .ui-datepicker-prev-hover { left:1px; } .ui-datepicker .ui-datepicker-next-hover { right:1px; } .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next= span { display: block; position: absolute; left: 50%; margin-left: -8px; t= op: 50%; margin-top: -8px; } .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; = text-align: center; } .ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; mar= gin:1px 0; } .ui-datepicker select.ui-datepicker-month-year {width: 100%;} .ui-datepicker select.ui-datepicker-month,= =20 .ui-datepicker select.ui-datepicker-year { width: 49%;} .ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: righ= t; } .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collap= se; margin:0 0 .4em; } .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bo= ld; border: 0; } .ui-datepicker td { border: 0; padding: 1px; } .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em= ; text-align: right; text-decoration: none; } .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: = .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom:= 0; } .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5e= m .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; ove= rflow:visible; } .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { flo= at:left; } /* with multiple calendars */ .ui-datepicker.ui-datepicker-multi { width:auto; } .ui-datepicker-multi .ui-datepicker-group { float:left; } .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto = .4em; } .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { bord= er-left-width:0; } .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { bo= rder-left-width:0; } .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } .ui-datepicker-row-break { clear:both; width:100%; } /* RTL support */ .ui-datepicker-rtl { direction: rtl; } .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current {= float:right; } .ui-datepicker-rtl .ui-datepicker-group { float:right; } .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border= -right-width:0; border-left-width:1px; } .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { bord= er-right-width:0; border-left-width:1px; } /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ .ui-datepicker-cover { display: none; /*sorry for IE5*/ display/**/: block; /*sorry for IE5*/ position: absolute; /*must have*/ z-index: -1; /*must have*/ filter: mask(); /*must have*/ top: -4px; /*must have*/ left: -4px; /*must have*/ width: 200px; /*must have*/ height: 200px; /*must have*/ }/* Dialog ----------------------------------*/ .ui-dialog { position: relative; padding: .2em; width: 300px; } .ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: rel= ative; } .ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; }= =20 .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top= : 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-= close:focus { padding: 0; } .ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: n= one; overflow: auto; zoom: 1; } .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 = 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em;= } .ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .= 5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; w= idth:auto; overflow:visible; } .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom= : 3px; } .ui-draggable .ui-dialog-titlebar { cursor: move; } /* Progressbar ----------------------------------*/ .ui-progressbar { height:2em; text-align: left; } .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }/* Resiz= able ----------------------------------*/ .ui-resizable { position: relative;} .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; = display: block;} .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-res= izable-handle { display: none; } .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; le= ft: 0px; } .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px;= left: 0px; } .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; heig= ht: 100%; } .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; heigh= t: 100%; } .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px= ; bottom: 1px; } .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; = bottom: -5px; } .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; = top: -5px; } .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px;= top: -5px;}/* Slider ----------------------------------*/ .ui-slider { position: relative; text-align: left; } .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em= ; height: 1.2em; cursor: default; } .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7= em; display: block; border: 0; } .ui-slider-horizontal { height: .8em; } .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } .ui-slider-horizontal .ui-slider-range-min { left: 0; } .ui-slider-horizontal .ui-slider-range-max { right: 0; } .ui-slider-vertical { width: .8em; height: 100px; } .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin= -bottom: -.6em; } .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } .ui-slider-vertical .ui-slider-range-min { bottom: 0; } .ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs ----------------------------------*/ .ui-tabs { padding: .2em; zoom: 1; } .ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em= .2em 0; } .ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-w= idth: 0 !important; margin: 0 .2em -1px 0; padding: 0; } .ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .= 5em 1em; } .ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bot= tom-width: 0; } .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-st= ate-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: te= xt; } .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui= -tabs-selected a { cursor: pointer; } /* first selector in group seems obso= lete, but required to overcome bug in Opera applying cursor: text overall i= f defined elsewhere... */ .ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width:= 0; background: none; } .ui-tabs .ui-tabs-hide { display: none !important; } ------=_NextPart_000_0000_4A5C91E5.6309193D Content-Type: text/javascript Content-Transfer-Encoding: quoted-printable Content-Location: http://www.dentonrc.com/sharedcontent/cgm/ver1.0/js/slcgmconfig.js var SLCGMOMNITUREPRODUCT =3D "SiteLifeCGMAction | "; /* This object needs be initialized on every page that receives pluck data = */ var _QUERY =3D new Object(); /* PARSE QUERY STRING INTO GLOBAL _QUERY OBJECT */ var _QSPARTS =3D unescape(window.location.search.substring(1)).split('&'); var _QSPARTSLENGTH =3D _QSPARTS.length; var _PARAMS; if (_QSPARTSLENGTH)for(var i=3D0;i< _QSPARTSLENGTH;i++){_PARAMS=3D_QSPARTS= [i].split("=3D");if(_PARAMS.length>1){ _QUERY[_PARAMS[0].toString()]=3Dunes= cape(_PARAMS[1].toString());}} /* SLCGMCONFIG is used to initiate articles */ var SLCGMCONFIG =3D new Object(); SLCGMCONFIG.Contents =3D new Array(); /* SET UP A ITERATOR INT */ var SLCGMCNTR =3D 0; var SLCGMSITEHREF =3D this.location.href; if (SLCGMSITEHREF.indexOf('/profile.html')<0) { //if (window !=3D top) top.location.href =3D location.href; } _QSPARTSLENGTH,i,_QSPARTS,_PARAMS=3Dnull; /* addLoadEvent for adding window.onload */ function addLoadEvent(func) { var oldonload =3D window.onload; if (typeof window.onload !=3D 'function') { window.onload =3D func; } else { window.onload =3D function() { try{ func(); }catch(e){ } if (oldonload) try{ oldonload(); }catch(e){ } }; } } ------=_NextPart_000_0000_4A5C91E5.6309193D Content-Type: text/javascript Content-Transfer-Encoding: quoted-printable Content-Location: http://www.dentonrc.com/sharedcontent/javascript/prototype-1.6.0.2.js /* Prototype JavaScript framework, version 1.6.0.2 * (c) 2005-2008 Sam Stephenson * * Prototype is freely distributable under the terms of an MIT-style licen= se. * For details, see the Prototype web site: http://www.prototypejs.org/ * *-------------------------------------------------------------------------= -*/ var Prototype =3D { Version: '1.6.0.2', Browser: { IE: !!(window.attachEvent && !window.opera), Opera: !!window.opera, WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1, Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgen= t.indexOf('KHTML') =3D=3D -1, MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/) }, BrowserFeatures: { XPath: !!document.evaluate, ElementExtensions: !!window.HTMLElement, SpecificElementExtensions: document.createElement('div').__proto__ && document.createElement('div').__proto__ !=3D=3D document.createElement('form').__proto__ }, ScriptFragment: ']*>([\\S\\s]*?)<\/script>', JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/, emptyFunction: function() { }, K: function(x) { return x } }; if (Prototype.Browser.MobileSafari) Prototype.BrowserFeatures.SpecificElementExtensions =3D false; /* Based on Alex Arnell's inheritance implementation. */ var Class =3D { create: function() { var parent =3D null, properties =3D $A(arguments); if (Object.isFunction(properties[0])) parent =3D properties.shift(); function klass() { this.initialize.apply(this, arguments); } Object.extend(klass, Class.Methods); klass.superclass =3D parent; klass.subclasses =3D []; if (parent) { var subclass =3D function() { }; subclass.prototype =3D parent.prototype; klass.prototype =3D new subclass; parent.subclasses.push(klass); } for (var i =3D 0; i < properties.length; i++) klass.addMethods(properties[i]); if (!klass.prototype.initialize) klass.prototype.initialize =3D Prototype.emptyFunction; klass.prototype.constructor =3D klass; return klass; } }; Class.Methods =3D { addMethods: function(source) { var ancestor =3D this.superclass && this.superclass.prototype; var properties =3D Object.keys(source); if (!Object.keys({ toString: true }).length) properties.push("toString", "valueOf"); for (var i =3D 0, length =3D properties.length; i < length; i++) { var property =3D properties[i], value =3D source[property]; if (ancestor && Object.isFunction(value) && value.argumentNames().first() =3D=3D "$super") { var method =3D value, value =3D Object.extend((function(m) { return function() { return ancestor[m].apply(this, arguments) }; })(property).wrap(method), { valueOf: function() { return method }, toString: function() { return method.toString() } }); } this.prototype[property] =3D value; } return this; } }; var Abstract =3D { }; 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.isUndefined(object)) return 'undefined'; if (object =3D=3D=3D null) return 'null'; return object.inspect ? object.inspect() : String(object); } catch (e) { if (e instanceof RangeError) return '...'; throw e; } }, toJSON: function(object) { var type =3D typeof object; switch (type) { case 'undefined': case 'function': case 'unknown': return; case 'boolean': return object.toString(); } if (object =3D=3D=3D null) return 'null'; if (object.toJSON) return object.toJSON(); if (Object.isElement(object)) return; var results =3D []; for (var property in object) { var value =3D Object.toJSON(object[property]); if (!Object.isUndefined(value)) results.push(property.toJSON() + ': ' + value); } return '{' + results.join(', ') + '}'; }, toQueryString: function(object) { return $H(object).toQueryString(); }, toHTML: function(object) { return object && object.toHTML ? object.toHTML() : String.interpret(obj= ect); }, 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); }, isElement: function(object) { return object && object.nodeType =3D=3D 1; }, isArray: function(object) { return object !=3D null && typeof object =3D=3D "object" && 'splice' in object && 'join' in object; }, isHash: function(object) { return object instanceof Hash; }, isFunction: function(object) { return typeof object =3D=3D "function"; }, isString: function(object) { return typeof object =3D=3D "string"; }, isNumber: function(object) { return typeof object =3D=3D "number"; }, isUndefined: function(object) { return typeof object =3D=3D "undefined"; } }); Object.extend(Function.prototype, { argumentNames: function() { var names =3D this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1= ].split(",").invoke("strip"); return names.length =3D=3D 1 && !names[0] ? [] : names; }, bind: function() { if (arguments.length < 2 && Object.isUndefined(arguments[0])) return th= is; var __method =3D this, args =3D $A(arguments), object =3D args.shift(); return function() { return __method.apply(object, args.concat($A(arguments))); } }, bindAsEventListener: function() { var __method =3D this, args =3D $A(arguments), object =3D args.shift(); return function(event) { return __method.apply(object, [event || window.event].concat(args)); } }, curry: function() { if (!arguments.length) return this; var __method =3D this, args =3D $A(arguments); return function() { return __method.apply(this, args.concat($A(arguments))); } }, delay: function() { var __method =3D this, args =3D $A(arguments), timeout =3D args.shift()= * 1000; return window.setTimeout(function() { return __method.apply(__method, args); }, timeout); }, wrap: function(wrapper) { var __method =3D this; return function() { return wrapper.apply(this, [__method.bind(this)].concat($A(arguments)= )); } }, methodize: function() { if (this._methodized) return this._methodized; var __method =3D this; return this._methodized =3D function() { return __method.apply(null, [this].concat($A(arguments))); }; } }); Function.prototype.defer =3D Function.prototype.delay.curry(0.01); Date.prototype.toJSON =3D function() { return '"' + this.getUTCFullYear() + '-' + (this.getUTCMonth() + 1).toPaddedString(2) + '-' + this.getUTCDate().toPaddedString(2) + 'T' + this.getUTCHours().toPaddedString(2) + ':' + this.getUTCMinutes().toPaddedString(2) + ':' + this.getUTCSeconds().toPaddedString(2) + 'Z"'; }; var Try =3D { these: function() { var returnValue; for (var i =3D 0, length =3D arguments.length; i < length; i++) { var lambda =3D arguments[i]; try { returnValue =3D lambda(); break; } catch (e) { } } return returnValue; } }; RegExp.prototype.match =3D RegExp.prototype.test; RegExp.escape =3D function(str) { return String(str).replace(/([.*+?^=3D!:${}()|[\]\/\\])/g, '\\$1'); }; /*-------------------------------------------------------------------------= -*/ var PeriodicalExecuter =3D Class.create({ 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); }, execute: function() { this.callback(this); }, stop: function() { if (!this.timer) return; clearInterval(this.timer); this.timer =3D null; }, onTimerEvent: function() { if (!this.currentlyExecuting) { try { this.currentlyExecuting =3D true; this.execute(); } finally { this.currentlyExecuting =3D false; } } } }); Object.extend(String, { interpret: function(value) { return value =3D=3D null ? '' : String(value); }, specialChar: { '\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '\\': '\\\\' } }); 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 String.interpret(replacement(match)); 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 Object.isUndefined(count) ? 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 String(this); }, truncate: function(length, truncation) { length =3D length || 30; truncation =3D Object.isUndefined(truncation) ? '...' : truncation; return this.length > length ? this.slice(0, length - truncation.length) + truncation : String(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 self =3D arguments.callee; self.text.data =3D this; return self.div.innerHTML; }, unescapeHTML: function() { var div =3D new Element('div'); div.innerHTML =3D this.stripTags(); return div.childNodes[0] ? (div.childNodes.length > 1 ? $A(div.childNodes).inject('', function(memo, node) { return memo+node= .nodeValue }) : div.childNodes[0].nodeValue) : ''; }, toQueryParams: function(separator) { var match =3D this.strip().match(/([^?#]*)(#.*)?$/); if (!match) return { }; return match[1].split(separator || '&').inject({ }, function(hash, pair= ) { if ((pair =3D pair.split('=3D'))[0]) { var key =3D decodeURIComponent(pair.shift()); var value =3D pair.length > 1 ? pair.join('=3D') : pair[0]; if (value !=3D undefined) value =3D decodeURIComponent(value); if (key in hash) { if (!Object.isArray(hash[key])) hash[key] =3D [hash[key]]; hash[key].push(value); } else hash[key] =3D value; } return hash; }); }, toArray: function() { return this.split(''); }, succ: function() { return this.slice(0, this.length - 1) + String.fromCharCode(this.charCodeAt(this.length - 1) + 1); }, times: function(count) { return count < 1 ? '' : new Array(count + 1).join(this); }, camelize: function() { var parts =3D this.split('-'), len =3D parts.length; if (len =3D=3D 1) return parts[0]; var camelized =3D this.charAt(0) =3D=3D '-' ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1) : parts[0]; for (var i =3D 1; i < len; i++) camelized +=3D parts[i].charAt(0).toUpperCase() + parts[i].substring(= 1); return camelized; }, capitalize: function() { return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); }, underscore: function() { return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gs= ub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase(); }, dasherize: function() { return this.gsub(/_/,'-'); }, inspect: function(useDoubleQuotes) { var escapedString =3D this.gsub(/[\x00-\x1f\\]/, function(match) { var character =3D String.specialChar[match[0]]; return character ? character : '\\u00' + match[0].charCodeAt().toPadd= edString(2, 16); }); if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + = '"'; return "'" + escapedString.replace(/'/g, '\\\'') + "'"; }, toJSON: function() { return this.inspect(true); }, unfilterJSON: function(filter) { return this.sub(filter || Prototype.JSONFilter, '#{1}'); }, isJSON: function() { var str =3D this; if (str.blank()) return false; str =3D this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''); return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str); }, evalJSON: function(sanitize) { var json =3D this.unfilterJSON(); try { if (!sanitize || json.isJSON()) return eval('(' + json + ')'); } catch (e) { } throw new SyntaxError('Badly formed JSON string: ' + this.inspect()); }, include: function(pattern) { return this.indexOf(pattern) > -1; }, startsWith: function(pattern) { return this.indexOf(pattern) =3D=3D=3D 0; }, endsWith: function(pattern) { var d =3D this.length - pattern.length; return d >=3D 0 && this.lastIndexOf(pattern) =3D=3D=3D d; }, empty: function() { return this =3D=3D ''; }, blank: function() { return /^\s*$/.test(this); }, interpolate: function(object, pattern) { return new Template(this, pattern).evaluate(object); } }); if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.= prototype, { escapeHTML: function() { return this.replace(/&/g,'&').replace(//g,'&g= t;'); }, unescapeHTML: function() { return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,= '>'); } }); String.prototype.gsub.prepareReplacement =3D function(replacement) { if (Object.isFunction(replacement)) return replacement; var template =3D new Template(replacement); return function(match) { return template.evaluate(match) }; }; String.prototype.parseQuery =3D String.prototype.toQueryParams; Object.extend(String.prototype.escapeHTML, { div: document.createElement('div'), text: document.createTextNode('') }); with (String.prototype.escapeHTML) div.appendChild(text); var Template =3D Class.create({ initialize: function(template, pattern) { this.template =3D template.toString(); this.pattern =3D pattern || Template.Pattern; }, evaluate: function(object) { if (Object.isFunction(object.toTemplateReplacements)) object =3D object.toTemplateReplacements(); return this.template.gsub(this.pattern, function(match) { if (object =3D=3D null) return ''; var before =3D match[1] || ''; if (before =3D=3D '\\') return match[2]; var ctx =3D object, expr =3D match[3]; var pattern =3D /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/; match =3D pattern.exec(expr); if (match =3D=3D null) return before; while (match !=3D null) { var comp =3D match[1].startsWith('[') ? match[2].gsub('\\\\]', ']')= : match[1]; ctx =3D ctx[comp]; if (null =3D=3D ctx || '' =3D=3D match[3]) break; expr =3D expr.substring('[' =3D=3D match[3] ? match[1].length : mat= ch[0].length); match =3D pattern.exec(expr); } return before + String.interpret(ctx); }); } }); Template.Pattern =3D /(^|.|\r|\n)(#\{(.*?)\})/; var $break =3D { }; var Enumerable =3D { each: function(iterator, context) { var index =3D 0; iterator =3D iterator.bind(context); try { this._each(function(value) { iterator(value, index++); }); } catch (e) { if (e !=3D $break) throw e; } return this; }, eachSlice: function(number, iterator, context) { iterator =3D iterator ? iterator.bind(context) : Prototype.K; 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, context); }, all: function(iterator, context) { iterator =3D iterator ? iterator.bind(context) : Prototype.K; var result =3D true; this.each(function(value, index) { result =3D result && !!iterator(value, index); if (!result) throw $break; }); return result; }, any: function(iterator, context) { iterator =3D iterator ? iterator.bind(context) : Prototype.K; var result =3D false; this.each(function(value, index) { if (result =3D !!iterator(value, index)) throw $break; }); return result; }, collect: function(iterator, context) { iterator =3D iterator ? iterator.bind(context) : Prototype.K; var results =3D []; this.each(function(value, index) { results.push(iterator(value, index)); }); return results; }, detect: function(iterator, context) { iterator =3D iterator.bind(context); var result; this.each(function(value, index) { if (iterator(value, index)) { result =3D value; throw $break; } }); return result; }, findAll: function(iterator, context) { iterator =3D iterator.bind(context); var results =3D []; this.each(function(value, index) { if (iterator(value, index)) results.push(value); }); return results; }, grep: function(filter, iterator, context) { iterator =3D iterator ? iterator.bind(context) : Prototype.K; var results =3D []; if (Object.isString(filter)) filter =3D new RegExp(filter); this.each(function(value, index) { if (filter.match(value)) results.push(iterator(value, index)); }); return results; }, include: function(object) { if (Object.isFunction(this.indexOf)) if (this.indexOf(object) !=3D -1) return true; 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 Object.isUndefined(fillWith) ? null : fillWith; return this.eachSlice(number, function(slice) { while(slice.length < number) slice.push(fillWith); return slice; }); }, inject: function(memo, iterator, context) { iterator =3D iterator.bind(context); 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.map(function(value) { return value[method].apply(value, args); }); }, max: function(iterator, context) { iterator =3D iterator ? iterator.bind(context) : Prototype.K; var result; this.each(function(value, index) { value =3D iterator(value, index); if (result =3D=3D null || value >=3D result) result =3D value; }); return result; }, min: function(iterator, context) { iterator =3D iterator ? iterator.bind(context) : Prototype.K; var result; this.each(function(value, index) { value =3D iterator(value, index); if (result =3D=3D null || value < result) result =3D value; }); return result; }, partition: function(iterator, context) { iterator =3D iterator ? iterator.bind(context) : Prototype.K; var trues =3D [], falses =3D []; this.each(function(value, index) { (iterator(value, index) ? trues : falses).push(value); }); return [trues, falses]; }, pluck: function(property) { var results =3D []; this.each(function(value) { results.push(value[property]); }); return results; }, reject: function(iterator, context) { iterator =3D iterator.bind(context); var results =3D []; this.each(function(value, index) { if (!iterator(value, index)) results.push(value); }); return results; }, sortBy: function(iterator, context) { iterator =3D iterator.bind(context); return this.map(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.map(); }, zip: function() { var iterator =3D Prototype.K, args =3D $A(arguments); if (Object.isFunction(args.last())) iterator =3D args.pop(); var collections =3D [this].concat(args).map($A); return this.map(function(value, index) { return iterator(collections.pluck(index)); }); }, size: function() { return this.toArray().length; }, inspect: function() { return '#'; } }; Object.extend(Enumerable, { map: Enumerable.collect, find: Enumerable.detect, select: Enumerable.findAll, filter: Enumerable.findAll, member: Enumerable.include, entries: Enumerable.toArray, every: Enumerable.all, some: Enumerable.any }); function $A(iterable) { if (!iterable) return []; if (iterable.toArray) return iterable.toArray(); var length =3D iterable.length || 0, results =3D new Array(length); while (length--) results[length] =3D iterable[length]; return results; } if (Prototype.Browser.WebKit) { $A =3D function(iterable) { if (!iterable) return []; if (!(Object.isFunction(iterable) && iterable =3D=3D '[object NodeList]= ') && iterable.toArray) return iterable.toArray(); var length =3D iterable.length || 0, results =3D new Array(length); while (length--) results[length] =3D iterable[length]; return results; }; } Array.from =3D $A; 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 null; }); }, flatten: function() { return this.inject([], function(array, value) { return array.concat(Object.isArray(value) ? value.flatten() : [value]); }); }, without: function() { var values =3D $A(arguments); return this.select(function(value) { return !values.include(value); }); }, reverse: function(inline) { return (inline !=3D=3D false ? this : this.toArray())._reverse(); }, reduce: function() { return this.length > 1 ? this : this[0]; }, uniq: function(sorted) { return this.inject([], function(array, value, index) { if (0 =3D=3D index || (sorted ? array.last() !=3D value : !array.incl= ude(value))) array.push(value); return array; }); }, intersect: function(array) { return this.uniq().findAll(function(item) { return array.detect(function(value) { return item =3D=3D=3D value }); }); }, clone: function() { return [].concat(this); }, size: function() { return this.length; }, inspect: function() { return '[' + this.map(Object.inspect).join(', ') + ']'; }, toJSON: function() { var results =3D []; this.each(function(object) { var value =3D Object.toJSON(object); if (!Object.isUndefined(value)) results.push(value); }); return '[' + results.join(', ') + ']'; } }); // use native browser JS 1.6 implementation if available if (Object.isFunction(Array.prototype.forEach)) Array.prototype._each =3D Array.prototype.forEach; if (!Array.prototype.indexOf) Array.prototype.indexOf =3D function(item, i)= { i || (i =3D 0); var length =3D this.length; if (i < 0) i =3D length + i; for (; i < length; i++) if (this[i] =3D=3D=3D item) return i; return -1; }; if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf =3D function(= item, i) { i =3D isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1; var n =3D this.slice(0, i).reverse().indexOf(item); return (n < 0) ? n : i - n - 1; }; Array.prototype.toArray =3D Array.prototype.clone; function $w(string) { if (!Object.isString(string)) return []; string =3D string.strip(); return string ? string.split(/\s+/) : []; } if (Prototype.Browser.Opera){ Array.prototype.concat =3D function() { var array =3D []; for (var i =3D 0, length =3D this.length; i < length; i++) array.push(t= his[i]); for (var i =3D 0, length =3D arguments.length; i < length; i++) { if (Object.isArray(arguments[i])) { for (var j =3D 0, arrayLength =3D arguments[i].length; j < arrayLen= gth; j++) array.push(arguments[i][j]); } else { array.push(arguments[i]); } } return array; }; } Object.extend(Number.prototype, { toColorPart: function() { return this.toPaddedString(2, 16); }, succ: function() { return this + 1; }, times: function(iterator) { $R(0, this, true).each(iterator); return this; }, toPaddedString: function(length, radix) { var string =3D this.toString(radix || 10); return '0'.times(length - string.length) + string; }, toJSON: function() { return isFinite(this) ? this.toString() : 'null'; } }); $w('abs round ceil floor').each(function(method){ Number.prototype[method] =3D Math[method].methodize(); }); function $H(object) { return new Hash(object); }; var Hash =3D Class.create(Enumerable, (function() { function toQueryPair(key, value) { if (Object.isUndefined(value)) return key; return key + '=3D' + encodeURIComponent(String.interpret(value)); } return { initialize: function(object) { this._object =3D Object.isHash(object) ? object.toObject() : Object.c= lone(object); }, _each: function(iterator) { for (var key in this._object) { var value =3D this._object[key], pair =3D [key, value]; pair.key =3D key; pair.value =3D value; iterator(pair); } }, set: function(key, value) { return this._object[key] =3D value; }, get: function(key) { return this._object[key]; }, unset: function(key) { var value =3D this._object[key]; delete this._object[key]; return value; }, toObject: function() { return Object.clone(this._object); }, keys: function() { return this.pluck('key'); }, values: function() { return this.pluck('value'); }, index: function(value) { var match =3D this.detect(function(pair) { return pair.value =3D=3D=3D value; }); return match && match.key; }, merge: function(object) { return this.clone().update(object); }, update: function(object) { return new Hash(object).inject(this, function(result, pair) { result.set(pair.key, pair.value); return result; }); }, toQueryString: function() { return this.map(function(pair) { var key =3D encodeURIComponent(pair.key), values =3D pair.value; if (values && typeof values =3D=3D 'object') { if (Object.isArray(values)) return values.map(toQueryPair.curry(key)).join('&'); } return toQueryPair(key, values); }).join('&'); }, inspect: function() { return '#'; }, toJSON: function() { return Object.toJSON(this.toObject()); }, clone: function() { return new Hash(this); } } })()); Hash.prototype.toTemplateReplacements =3D Hash.prototype.toObject; Hash.from =3D $H; var ObjectRange =3D Class.create(Enumerable, { 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 (Object.isFunction(responder[callback])) { 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 Class.create({ initialize: function(options) { this.options =3D { method: 'post', asynchronous: true, contentType: 'application/x-www-form-urlencoded', encoding: 'UTF-8', parameters: '', evalJSON: true, evalJS: true }; Object.extend(this.options, options || { }); this.options.method =3D this.options.method.toLowerCase(); if (Object.isString(this.options.parameters)) this.options.parameters =3D this.options.parameters.toQueryParams(); else if (Object.isHash(this.options.parameters)) this.options.parameters =3D this.options.parameters.toObject(); } }); Ajax.Request =3D Class.create(Ajax.Base, { _complete: false, initialize: function($super, url, options) { $super(options); this.transport =3D Ajax.getTransport(); this.request(url); }, request: function(url) { this.url =3D url; this.method =3D this.options.method; var params =3D Object.clone(this.options.parameters); if (!['get', 'post'].include(this.method)) { // simulate other verbs over post params['_method'] =3D this.method; this.method =3D 'post'; } this.parameters =3D params; if (params =3D Object.toQueryString(params)) { // when GET, append parameters to URL if (this.method =3D=3D 'get') this.url +=3D (this.url.include('?') ? '&' : '?') + params; else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) params +=3D '&_=3D'; } try { var response =3D new Ajax.Response(this); if (this.options.onCreate) this.options.onCreate(response); Ajax.Responders.dispatch('onCreate', this, response); this.transport.open(this.method.toUpperCase(), this.url, this.options.asynchronous); if (this.options.asynchronous) this.respondToReadyState.bind(this).de= fer(1); this.transport.onreadystatechange =3D this.onStateChange.bind(this); this.setRequestHeaders(); this.body =3D this.method =3D=3D 'post' ? (this.options.postBody || p= arams) : null; this.transport.send(this.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 && !((readyState =3D=3D 4) && this._complete)) 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.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] < 20= 05) headers['Connection'] =3D 'close'; } // user-defined headers if (typeof this.options.requestHeaders =3D=3D 'object') { var extras =3D this.options.requestHeaders; if (Object.isFunction(extras.push)) for (var i =3D 0, length =3D extras.length; i < 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() { var status =3D this.getStatus(); return !status || (status >=3D 200 && status < 300); }, getStatus: function() { try { return this.transport.status || 0; } catch (e) { return 0 } }, respondToReadyState: function(readyState) { var state =3D Ajax.Request.Events[readyState], response =3D new Ajax.Re= sponse(this); if (state =3D=3D 'Complete') { try { this._complete =3D true; (this.options['on' + response.status] || this.options['on' + (this.success() ? 'Success' : 'Failure')] || Prototype.emptyFunction)(response, response.headerJSON); } catch (e) { this.dispatchException(e); } var contentType =3D response.getHeader('Content-type'); if (this.options.evalJS =3D=3D 'force' || (this.options.evalJS && this.isSameOrigin() && contentType && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)scr= ipt(;.*)?\s*$/i))) this.evalResponse(); } try { (this.options['on' + state] || Prototype.emptyFunction)(response, res= ponse.headerJSON); Ajax.Responders.dispatch('on' + state, this, response, response.heade= rJSON); } catch (e) { this.dispatchException(e); } if (state =3D=3D 'Complete') { // avoid memory leak in MSIE: clean up this.transport.onreadystatechange =3D Prototype.emptyFunction; } }, isSameOrigin: function() { var m =3D this.url.match(/^\s*https?:\/\/[^\/]*/); return !m || (m[0] =3D=3D '#{protocol}//#{domain}#{port}'.interpolate({ protocol: location.protocol, domain: document.domain, port: location.port ? ':' + location.port : '' })); }, getHeader: function(name) { try { return this.transport.getResponseHeader(name) || null; } catch (e) { return null } }, evalResponse: function() { try { return eval((this.transport.responseText || '').unfilterJSON()); } catch (e) { this.dispatchException(e); } }, dispatchException: function(exception) { (this.options.onException || Prototype.emptyFunction)(this, exception); Ajax.Responders.dispatch('onException', this, exception); } }); Ajax.Request.Events =3D ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; Ajax.Response =3D Class.create({ initialize: function(request){ this.request =3D request; var transport =3D this.transport =3D request.transport, readyState =3D this.readyState =3D transport.readyState; if((readyState > 2 && !Prototype.Browser.IE) || readyState =3D=3D 4) { this.status =3D this.getStatus(); this.statusText =3D this.getStatusText(); this.responseText =3D String.interpret(transport.responseText); this.headerJSON =3D this._getHeaderJSON(); } if(readyState =3D=3D 4) { var xml =3D transport.responseXML; this.responseXML =3D Object.isUndefined(xml) ? null : xml; this.responseJSON =3D this._getResponseJSON(); } }, status: 0, statusText: '', getStatus: Ajax.Request.prototype.getStatus, getStatusText: function() { try { return this.transport.statusText || ''; } catch (e) { return '' } }, getHeader: Ajax.Request.prototype.getHeader, getAllHeaders: function() { try { return this.getAllResponseHeaders(); } catch (e) { return null } }, getResponseHeader: function(name) { return this.transport.getResponseHeader(name); }, getAllResponseHeaders: function() { return this.transport.getAllResponseHeaders(); }, _getHeaderJSON: function() { var json =3D this.getHeader('X-JSON'); if (!json) return null; json =3D decodeURIComponent(escape(json)); try { return json.evalJSON(this.request.options.sanitizeJSON || !this.request.isSameOrigin()); } catch (e) { this.request.dispatchException(e); } }, _getResponseJSON: function() { var options =3D this.request.options; if (!options.evalJSON || (options.evalJSON !=3D 'force' && !(this.getHeader('Content-type') || '').include('application/json')) = || this.responseText.blank()) return null; try { return this.responseText.evalJSON(options.sanitizeJSON || !this.request.isSameOrigin()); } catch (e) { this.request.dispatchException(e); } } }); Ajax.Updater =3D Class.create(Ajax.Request, { initialize: function($super, container, url, options) { this.container =3D { success: (container.success || container), failure: (container.failure || (container.success ? null : container)= ) }; options =3D Object.clone(options); var onComplete =3D options.onComplete; options.onComplete =3D (function(response, json) { this.updateContent(response.responseText); if (Object.isFunction(onComplete)) onComplete(response, json); }).bind(this); $super(url, options); }, updateContent: function(responseText) { var receiver =3D this.container[this.success() ? 'success' : 'failure']= , options =3D this.options; if (!options.evalScripts) responseText =3D responseText.stripScripts(); if (receiver =3D $(receiver)) { if (options.insertion) { if (Object.isString(options.insertion)) { var insertion =3D { }; insertion[options.insertion] =3D responseT= ext; receiver.insert(insertion); } else options.insertion(receiver, responseText); } else receiver.update(responseText); } } }); Ajax.PeriodicalUpdater =3D Class.create(Ajax.Base, { initialize: function($super, container, url, options) { $super(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(response) { if (this.options.decay) { this.decay =3D (response.responseText =3D=3D this.lastText ? this.decay * this.options.decay : 1); this.lastText =3D response.responseText; } this.timer =3D this.onTimerEvent.bind(this).delay(this.decay * this.fre= quency); }, onTimerEvent: function() { this.updater =3D new Ajax.Updater(this.container, this.url, this.option= s); } }); function $(element) { if (arguments.length > 1) { for (var i =3D 0, elements =3D [], length =3D arguments.length; i < len= gth; i++) elements.push($(arguments[i])); return elements; } if (Object.isString(element)) 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) || documen= t, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); for (var i =3D 0, length =3D query.snapshotLength; i < length; i++) results.push(Element.extend(query.snapshotItem(i))); return results; }; } /*-------------------------------------------------------------------------= -*/ if (!window.Node) var Node =3D { }; if (!Node.ELEMENT_NODE) { // DOM level 2 ECMAScript Language Binding Object.extend(Node, { ELEMENT_NODE: 1, ATTRIBUTE_NODE: 2, TEXT_NODE: 3, CDATA_SECTION_NODE: 4, ENTITY_REFERENCE_NODE: 5, ENTITY_NODE: 6, PROCESSING_INSTRUCTION_NODE: 7, COMMENT_NODE: 8, DOCUMENT_NODE: 9, DOCUMENT_TYPE_NODE: 10, DOCUMENT_FRAGMENT_NODE: 11, NOTATION_NODE: 12 }); } (function() { var element =3D this.Element; this.Element =3D function(tagName, attributes) { attributes =3D attributes || { }; tagName =3D tagName.toLowerCase(); var cache =3D Element.cache; if (Prototype.Browser.IE && attributes.name) { tagName =3D '<' + tagName + ' name=3D"' + attributes.name + '">'; delete attributes.name; return Element.writeAttribute(document.createElement(tagName), attrib= utes); } if (!cache[tagName]) cache[tagName] =3D Element.extend(document.createE= lement(tagName)); return Element.writeAttribute(cache[tagName].cloneNode(false), attribut= es); }; Object.extend(this.Element, element || { }); }).call(window); Element.cache =3D { }; 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, content) { element =3D $(element); if (content && content.toElement) content =3D content.toElement(); if (Object.isElement(content)) return element.update().insert(content); content =3D Object.toHTML(content); element.innerHTML =3D content.stripScripts(); content.evalScripts.bind(content).defer(); return element; }, replace: function(element, content) { element =3D $(element); if (content && content.toElement) content =3D content.toElement(); else if (!Object.isElement(content)) { content =3D Object.toHTML(content); var range =3D element.ownerDocument.createRange(); range.selectNode(element); content.evalScripts.bind(content).defer(); content =3D range.createContextualFragment(content.stripScripts()); } element.parentNode.replaceChild(content, element); return element; }, insert: function(element, insertions) { element =3D $(element); if (Object.isString(insertions) || Object.isNumber(insertions) || Object.isElement(insertions) || (insertions && (insertions.toElemen= t || insertions.toHTML))) insertions =3D {bottom:insertions}; var content, insert, tagName, childNodes; for (var position in insertions) { content =3D insertions[position]; position =3D position.toLowerCase(); insert =3D Element._insertionTranslations[position]; if (content && content.toElement) content =3D content.toElement(); if (Object.isElement(content)) { insert(element, content); continue; } content =3D Object.toHTML(content); tagName =3D ((position =3D=3D 'before' || position =3D=3D 'after') ? element.parentNode : element).tagName.toUpperCase(); childNodes =3D Element._getContentFromAnonymousElement(tagName, conte= nt.stripScripts()); if (position =3D=3D 'top' || position =3D=3D 'after') childNodes.reve= rse(); childNodes.each(insert.curry(element)); content.evalScripts.bind(content).defer(); } return element; }, wrap: function(element, wrapper, attributes) { element =3D $(element); if (Object.isElement(wrapper)) $(wrapper).writeAttribute(attributes || { }); else if (Object.isString(wrapper)) wrapper =3D new Element(wrapper, att= ributes); else wrapper =3D new Element('div', wrapper); if (element.parentNode) element.parentNode.replaceChild(wrapper, element); wrapper.appendChild(element); return wrapper; }, 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) { return $(element).select("*"); }, firstDescendant: function(element) { element =3D $(element).firstChild; while (element && element.nodeType !=3D 1) element =3D element.nextSibl= ing; return $(element); }, immediateDescendants: function(element) { if (!(element =3D $(element).firstChild)) return []; while (element && element.nodeType !=3D 1) element =3D element.nextSibl= ing; if (element) return [element].concat($(element).nextSiblings()); return []; }, 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) { if (Object.isString(selector)) selector =3D new Selector(selector); return selector.match($(element)); }, up: function(element, expression, index) { element =3D $(element); if (arguments.length =3D=3D 1) return $(element.parentNode); var ancestors =3D element.ancestors(); return Object.isNumber(expression) ? ancestors[expression] : Selector.findElement(ancestors, expression, index); }, down: function(element, expression, index) { element =3D $(element); if (arguments.length =3D=3D 1) return element.firstDescendant(); return Object.isNumber(expression) ? element.descendants()[expression] = : element.select(expression)[index || 0]; }, previous: function(element, expression, index) { element =3D $(element); if (arguments.length =3D=3D 1) return $(Selector.handlers.previousEleme= ntSibling(element)); var previousSiblings =3D element.previousSiblings(); return Object.isNumber(expression) ? previousSiblings[expression] : Selector.findElement(previousSiblings, expression, index); }, next: function(element, expression, index) { element =3D $(element); if (arguments.length =3D=3D 1) return $(Selector.handlers.nextElementSi= bling(element)); var nextSiblings =3D element.nextSiblings(); return Object.isNumber(expression) ? nextSiblings[expression] : Selector.findElement(nextSiblings, expression, index); }, select: function() { var args =3D $A(arguments), element =3D $(args.shift()); return Selector.findChildElements(element, args); }, adjacent: function() { var args =3D $A(arguments), element =3D $(args.shift()); return Selector.findChildElements(element.parentNode, args).without(ele= ment); }, identify: function(element) { element =3D $(element); var id =3D element.readAttribute('id'), self =3D arguments.callee; if (id) return id; do { id =3D 'anonymous_element_' + self.counter++ } while ($(id)); element.writeAttribute('id', id); return id; }, readAttribute: function(element, name) { element =3D $(element); if (Prototype.Browser.IE) { var t =3D Element._attributeTranslations.read; if (t.values[name]) return t.values[name](element, name); if (t.names[name]) name =3D t.names[name]; if (name.include(':')) { return (!element.attributes || !element.attributes[name]) ? null : element.attributes[name].value; } } return element.getAttribute(name); }, writeAttribute: function(element, name, value) { element =3D $(element); var attributes =3D { }, t =3D Element._attributeTranslations.write; if (typeof name =3D=3D 'object') attributes =3D name; else attributes[name] =3D Object.isUndefined(value) ? true : value; for (var attr in attributes) { name =3D t.names[attr] || attr; value =3D attributes[attr]; if (t.values[attr]) name =3D t.values[attr](element, value); if (value =3D=3D=3D false || value =3D=3D=3D null) element.removeAttribute(name); else if (value =3D=3D=3D true) element.setAttribute(name, name); else element.setAttribute(name, value); } return element; }, getHeight: function(element) { return $(element).getDimensions().height; }, getWidth: function(element) { return $(element).getDimensions().width; }, classNames: function(element) { return new Element.ClassNames(element); }, hasClassName: function(element, className) { if (!(element =3D $(element))) return; var elementClassName =3D element.className; return (elementClassName.length > 0 && (elementClassName =3D=3D classNa= me || new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName))= ); }, addClassName: function(element, className) { if (!(element =3D $(element))) return; if (!element.hasClassName(className)) element.className +=3D (element.className ? ' ' : '') + className; return element; }, removeClassName: function(element, className) { if (!(element =3D $(element))) return; element.className =3D element.className.replace( new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip(); return element; }, toggleClassName: function(element, className) { if (!(element =3D $(element))) return; return element[element.hasClassName(className) ? 'removeClassName' : 'addClassName'](className); }, // 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.blank(); }, descendantOf: function(element, ancestor) { element =3D $(element), ancestor =3D $(ancestor); var originalAncestor =3D ancestor; if (element.compareDocumentPosition) return (element.compareDocumentPosition(ancestor) & 8) =3D=3D=3D 8; if (element.sourceIndex && !Prototype.Browser.Opera) { var e =3D element.sourceIndex, a =3D ancestor.sourceIndex, nextAncestor =3D ancestor.nextSibling; if (!nextAncestor) { do { ancestor =3D ancestor.parentNode; } while (!(nextAncestor =3D ancestor.nextSibling) && ancestor.parentN= ode); } if (nextAncestor && nextAncestor.sourceIndex) return (e > a && e < nextAncestor.sourceIndex); } while (element =3D element.parentNode) if (element =3D=3D originalAncestor) return true; return false; }, scrollTo: function(element) { element =3D $(element); var pos =3D element.cumulativeOffset(); window.scrollTo(pos[0], pos[1]); return element; }, getStyle: function(element, style) { element =3D $(element); style =3D style =3D=3D 'float' ? 'cssFloat' : style.camelize(); var value =3D element.style[style]; if (!value) { var css =3D document.defaultView.getComputedStyle(element, null); value =3D css ? css[style] : null; } if (style =3D=3D 'opacity') return value ? parseFloat(value) : 1.0; return value =3D=3D 'auto' ? null : value; }, getOpacity: function(element) { return $(element).getStyle('opacity'); }, setStyle: function(element, styles) { element =3D $(element); var elementStyle =3D element.style, match; if (Object.isString(styles)) { element.style.cssText +=3D ';' + styles; return styles.include('opacity') ? element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : ele= ment; } for (var property in styles) if (property =3D=3D 'opacity') element.setOpacity(styles[property]); else elementStyle[(property =3D=3D 'float' || property =3D=3D 'cssFloat'= ) ? (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styl= eFloat') : property] =3D styles[property]; return element; }, setOpacity: function(element, value) { element =3D $(element); element.style.opacity =3D (value =3D=3D 1 || value =3D=3D=3D '') ? '' : (value < 0.00001) ? 0 : value; return element; }, getDimensions: function(element) { element =3D $(element); var display =3D $(element).getStyle('display'); if (display !=3D 'none' && display !=3D null) // Safari bug return {width: element.offsetWidth, height: element.offsetHeight}; // All *Width and *Height properties give 0 on elements with display no= ne, // so enable the element temporarily var els =3D element.style; var originalVisibility =3D els.visibility; var originalPosition =3D els.position; var originalDisplay =3D els.display; els.visibility =3D 'hidden'; els.position =3D 'absolute'; els.display =3D 'block'; var originalWidth =3D element.clientWidth; var originalHeight =3D element.clientHeight; els.display =3D originalDisplay; 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 define= d 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.getStyle(element, 'overflow') || 'auto'; if (element._overflow !=3D=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' ? '' : eleme= nt._overflow; element._overflow =3D null; return element; }, 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 Element._returnOffset(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 'static') break; } } while (element); return Element._returnOffset(valueL, valueT); }, absolutize: function(element) { element =3D $(element); if (element.getStyle('position') =3D=3D 'absolute') return; // Position.prepare(); // To be done manually by Scripty when it needs = it. var offsets =3D element.positionedOffset(); 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'; return element; }, relativize: function(element) { element =3D $(element); if (element.getStyle('position') =3D=3D 'relative') return; // Position.prepare(); // To be done manually by Scripty when it needs = it. element.style.position =3D 'relative'; var top =3D parseFloat(element.style.top || 0) - (element._originalTo= p || 0); var left =3D parseFloat(element.style.left || 0) - (element._originalLe= ft || 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; return element; }, cumulativeScrollOffset: 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 Element._returnOffset(valueL, valueT); }, getOffsetParent: 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); }, viewportOffset: 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=3D document.body && Element.getStyle(element, 'position') =3D=3D 'absolute') break; } while (element =3D element.offsetParent); element =3D forElement; do { if (!Prototype.Browser.Opera || element.tagName =3D=3D 'BODY') { valueT -=3D element.scrollTop || 0; valueL -=3D element.scrollLeft || 0; } } while (element =3D element.parentNode); return Element._returnOffset(valueL, valueT); }, clonePosition: function(element, source) { 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 source.viewportOffset(); // find coordinate system to use element =3D $(element); 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(element, 'position') =3D=3D 'absolute') { parent =3D element.getOffsetParent(); delta =3D parent.viewportOffset(); } // 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) element.style.left =3D (p[0] - delta[0] + optio= ns.offsetLeft) + 'px'; if (options.setTop) element.style.top =3D (p[1] - delta[1] + optio= ns.offsetTop) + 'px'; if (options.setWidth) element.style.width =3D source.offsetWidth + 'px= '; if (options.setHeight) element.style.height =3D source.offsetHeight + '= px'; return element; } }; Element.Methods.identify.counter =3D 1; Object.extend(Element.Methods, { getElementsBySelector: Element.Methods.select, childElements: Element.Methods.immediateDescendants }); Element._attributeTranslations =3D { write: { names: { className: 'class', htmlFor: 'for' }, values: { } } }; if (Prototype.Browser.Opera) { Element.Methods.getStyle =3D Element.Methods.getStyle.wrap( function(proceed, element, style) { switch (style) { case 'left': case 'top': case 'right': case 'bottom': if (proceed(element, 'position') =3D=3D=3D 'static') return null; case 'height': case 'width': // returns '0px' for hidden elements; we want it to return null if (!Element.visible(element)) return null; // returns the border-box dimensions rather than the content-box // dimensions, so we subtract padding and borders from the value var dim =3D parseInt(proceed(element, style), 10); if (dim !=3D=3D element['offset' + style.capitalize()]) return dim + 'px'; var properties; if (style =3D=3D=3D 'height') { properties =3D ['border-top-width', 'padding-top', 'padding-bottom', 'border-bottom-width']; } else { properties =3D ['border-left-width', 'padding-left', 'padding-right', 'border-right-width']; } return properties.inject(dim, function(memo, property) { var val =3D proceed(element, property); return val =3D=3D=3D null ? memo : memo - parseInt(val, 10); }) + 'px'; default: return proceed(element, style); } } ); Element.Methods.readAttribute =3D Element.Methods.readAttribute.wrap( function(proceed, element, attribute) { if (attribute =3D=3D=3D 'title') return element.title; return proceed(element, attribute); } ); } else if (Prototype.Browser.IE) { // IE doesn't report offsets correctly for static elements, so we change = them // to "relative" to get the values, then change them back. Element.Methods.getOffsetParent =3D Element.Methods.getOffsetParent.wrap( function(proceed, element) { element =3D $(element); var position =3D element.getStyle('position'); if (position !=3D=3D 'static') return proceed(element); element.setStyle({ position: 'relative' }); var value =3D proceed(element); element.setStyle({ position: position }); return value; } ); $w('positionedOffset viewportOffset').each(function(method) { Element.Methods[method] =3D Element.Methods[method].wrap( function(proceed, element) { element =3D $(element); var position =3D element.getStyle('position'); if (position !=3D=3D 'static') return proceed(element); // Trigger hasLayout on the offset parent so that IE6 reports // accurate offsetTop and offsetLeft values for position: fixed. var offsetParent =3D element.getOffsetParent(); if (offsetParent && offsetParent.getStyle('position') =3D=3D=3D 'fi= xed') offsetParent.setStyle({ zoom: 1 }); element.setStyle({ position: 'relative' }); var value =3D proceed(element); element.setStyle({ position: position }); return value; } ); }); Element.Methods.getStyle =3D function(element, style) { element =3D $(element); style =3D (style =3D=3D 'float' || style =3D=3D 'cssFloat') ? 'styleFlo= at' : style.camelize(); var value =3D element.style[style]; if (!value && element.currentStyle) value =3D element.currentStyle[styl= e]; if (style =3D=3D 'opacity') { if (value =3D (element.getStyle('filter') || '').match(/alpha\(opacit= y=3D(.*)\)/)) if (value[1]) return parseFloat(value[1]) / 100; return 1.0; } if (value =3D=3D 'auto') { if ((style =3D=3D 'width' || style =3D=3D 'height') && (element.getSt= yle('display') !=3D 'none')) return element['offset' + style.capitalize()] + 'px'; return null; } return value; }; Element.Methods.setOpacity =3D function(element, value) { function stripAlpha(filter){ return filter.replace(/alpha\([^\)]*\)/gi,''); } element =3D $(element); var currentStyle =3D element.currentStyle; if ((currentStyle && !currentStyle.hasLayout) || (!currentStyle && element.style.zoom =3D=3D 'normal')) element.style.zoom =3D 1; var filter =3D element.getStyle('filter'), style =3D element.style; if (value =3D=3D 1 || value =3D=3D=3D '') { (filter =3D stripAlpha(filter)) ? style.filter =3D filter : style.removeAttribute('filter'); return element; } else if (value < 0.00001) value =3D 0; style.filter =3D stripAlpha(filter) + 'alpha(opacity=3D' + (value * 100) + ')'; return element; }; Element._attributeTranslations =3D { read: { names: { 'class': 'className', 'for': 'htmlFor' }, values: { _getAttr: function(element, attribute) { return element.getAttribute(attribute, 2); }, _getAttrNode: function(element, attribute) { var node =3D element.getAttributeNode(attribute); return node ? node.value : ""; }, _getEv: function(element, attribute) { attribute =3D element.getAttribute(attribute); return attribute ? attribute.toString().slice(23, -2) : null; }, _flag: function(element, attribute) { return $(element).hasAttribute(attribute) ? attribute : null; }, style: function(element) { return element.style.cssText.toLowerCase(); }, title: function(element) { return element.title; } } } }; Element._attributeTranslations.write =3D { names: Object.extend({ cellpadding: 'cellPadding', cellspacing: 'cellSpacing' }, Element._attributeTranslations.read.names), values: { checked: function(element, value) { element.checked =3D !!value; }, style: function(element, value) { element.style.cssText =3D value ? value : ''; } } }; Element._attributeTranslations.has =3D {}; $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' + 'encType maxLength readOnly longDesc').each(function(attr) { Element._attributeTranslations.write.names[attr.toLowerCase()] =3D attr= ; Element._attributeTranslations.has[attr.toLowerCase()] =3D attr; }); (function(v) { Object.extend(v, { href: v._getAttr, src: v._getAttr, type: v._getAttr, action: v._getAttrNode, disabled: v._flag, checked: v._flag, readonly: v._flag, multiple: v._flag, onload: v._getEv, onunload: v._getEv, onclick: v._getEv, ondblclick: v._getEv, onmousedown: v._getEv, onmouseup: v._getEv, onmouseover: v._getEv, onmousemove: v._getEv, onmouseout: v._getEv, onfocus: v._getEv, onblur: v._getEv, onkeypress: v._getEv, onkeydown: v._getEv, onkeyup: v._getEv, onsubmit: v._getEv, onreset: v._getEv, onselect: v._getEv, onchange: v._getEv }); })(Element._attributeTranslations.read.values); } else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent))= { Element.Methods.setOpacity =3D function(element, value) { element =3D $(element); element.style.opacity =3D (value =3D=3D 1) ? 0.999999 : (value =3D=3D=3D '') ? '' : (value < 0.00001) ? 0 : value; return element; }; } else if (Prototype.Browser.WebKit) { Element.Methods.setOpacity =3D function(element, value) { element =3D $(element); element.style.opacity =3D (value =3D=3D 1 || value =3D=3D=3D '') ? '' : (value < 0.00001) ? 0 : value; if (value =3D=3D 1) if(element.tagName =3D=3D 'IMG' && element.width) { element.width++; element.width--; } else try { var n =3D document.createTextNode(' '); element.appendChild(n); element.removeChild(n); } catch (e) { } return element; }; // Safari returns margins on body which is incorrect if the child is abso= lutely // positioned. For performance reasons, redefine Element#cumulativeOffse= t for // KHTML/WebKit only. Element.Methods.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 Element._returnOffset(valueL, valueT); }; } if (Prototype.Browser.IE || Prototype.Browser.Opera) { // IE and Opera are missing .innerHTML support for TABLE-related and SELE= CT elements Element.Methods.update =3D function(element, content) { element =3D $(element); if (content && content.toElement) content =3D content.toElement(); if (Object.isElement(content)) return element.update().insert(content); content =3D Object.toHTML(content); var tagName =3D element.tagName.toUpperCase(); if (tagName in Element._insertionTranslations.tags) { $A(element.childNodes).each(function(node) { element.removeChild(node= ) }); Element._getContentFromAnonymousElement(tagName, content.stripScripts= ()) .each(function(node) { element.appendChild(node) }); } else element.innerHTML =3D content.stripScripts(); content.evalScripts.bind(content).defer(); return element; }; } if ('outerHTML' in document.createElement('div')) { Element.Methods.replace =3D function(element, content) { element =3D $(element); if (content && content.toElement) content =3D content.toElement(); if (Object.isElement(content)) { element.parentNode.replaceChild(content, element); return element; } content =3D Object.toHTML(content); var parent =3D element.parentNode, tagName =3D parent.tagName.toUpperCa= se(); if (Element._insertionTranslations.tags[tagName]) { var nextSibling =3D element.next(); var fragments =3D Element._getContentFromAnonymousElement(tagName, co= ntent.stripScripts()); parent.removeChild(element); if (nextSibling) fragments.each(function(node) { parent.insertBefore(node, nextSibli= ng) }); else fragments.each(function(node) { parent.appendChild(node) }); } else element.outerHTML =3D content.stripScripts(); content.evalScripts.bind(content).defer(); return element; }; } Element._returnOffset =3D function(l, t) { var result =3D [l, t]; result.left =3D l; result.top =3D t; return result; }; Element._getContentFromAnonymousElement =3D function(tagName, html) { var div =3D new Element('div'), t =3D Element._insertionTranslations.tags= [tagName]; if (t) { div.innerHTML =3D t[0] + html + t[1]; t[2].times(function() { div =3D div.firstChild }); } else div.innerHTML =3D html; return $A(div.childNodes); }; Element._insertionTranslations =3D { before: function(element, node) { element.parentNode.insertBefore(node, element); }, top: function(element, node) { element.insertBefore(node, element.firstChild); }, bottom: function(element, node) { element.appendChild(node); }, after: function(element, node) { element.parentNode.insertBefore(node, element.nextSibling); }, tags: { TABLE: ['', '
', 1], TBODY: ['', '
', 2], TR: ['', '
', 3], TD: ['
', '
', 4], SELECT: ['', 1] } }; (function() { Object.extend(this.tags, { THEAD: this.tags.TBODY, TFOOT: this.tags.TBODY, TH: this.tags.TD }); }).call(Element._insertionTranslations); Element.Methods.Simulated =3D { hasAttribute: function(element, attribute) { attribute =3D Element._attributeTranslations.has[attribute] || attribut= e; var node =3D $(element).getAttributeNode(attribute); return node && node.specified; } }; Element.Methods.ByTag =3D { }; Object.extend(Element, Element.Methods); if (!Prototype.BrowserFeatures.ElementExtensions && document.createElement('div').__proto__) { window.HTMLElement =3D { }; window.HTMLElement.prototype =3D document.createElement('div').__proto__; Prototype.BrowserFeatures.ElementExtensions =3D true; } Element.extend =3D (function() { if (Prototype.BrowserFeatures.SpecificElementExtensions) return Prototype.K; var Methods =3D { }, ByTag =3D Element.Methods.ByTag; var extend =3D Object.extend(function(element) { if (!element || element._extendedByPrototype || element.nodeType !=3D 1 || element =3D=3D window) return element; var methods =3D Object.clone(Methods), tagName =3D element.tagName, property, value; // extend methods for specific tags if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]); for (property in methods) { value =3D methods[property]; if (Object.isFunction(value) && !(property in element)) element[property] =3D value.methodize(); } element._extendedByPrototype =3D Prototype.emptyFunction; return element; }, { refresh: function() { // extend methods for all tags (Safari doesn't need this) if (!Prototype.BrowserFeatures.ElementExtensions) { Object.extend(Methods, Element.Methods); Object.extend(Methods, Element.Methods.Simulated); } } }); extend.refresh(); return extend; })(); Element.hasAttribute =3D function(element, attribute) { if (element.hasAttribute) return element.hasAttribute(attribute); return Element.Methods.Simulated.hasAttribute(element, attribute); }; Element.addMethods =3D function(methods) { var F =3D Prototype.BrowserFeatures, T =3D Element.Methods.ByTag; if (!methods) { Object.extend(Form, Form.Methods); Object.extend(Form.Element, Form.Element.Methods); Object.extend(Element.Methods.ByTag, { "FORM": Object.clone(Form.Methods), "INPUT": Object.clone(Form.Element.Methods), "SELECT": Object.clone(Form.Element.Methods), "TEXTAREA": Object.clone(Form.Element.Methods) }); } if (arguments.length =3D=3D 2) { var tagName =3D methods; methods =3D arguments[1]; } if (!tagName) Object.extend(Element.Methods, methods || { }); else { if (Object.isArray(tagName)) tagName.each(extend); else extend(tagName); } function extend(tagName) { tagName =3D tagName.toUpperCase(); if (!Element.Methods.ByTag[tagName]) Element.Methods.ByTag[tagName] =3D { }; Object.extend(Element.Methods.ByTag[tagName], methods); } function copy(methods, destination, onlyIfAbsent) { onlyIfAbsent =3D onlyIfAbsent || false; for (var property in methods) { var value =3D methods[property]; if (!Object.isFunction(value)) continue; if (!onlyIfAbsent || !(property in destination)) destination[property] =3D value.methodize(); } } function findDOMClass(tagName) { var klass; var trans =3D { "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph", "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList", "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading"= , "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote", "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION": "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD": "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR= ": "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET": "FrameSet", "IFRAME": "IFrame" }; if (trans[tagName]) klass =3D 'HTML' + trans[tagName] + 'Element'; if (window[klass]) return window[klass]; klass =3D 'HTML' + tagName + 'Element'; if (window[klass]) return window[klass]; klass =3D 'HTML' + tagName.capitalize() + 'Element'; if (window[klass]) return window[klass]; window[klass] =3D { }; window[klass].prototype =3D document.createElement(tagName).__proto__; return window[klass]; } if (F.ElementExtensions) { copy(Element.Methods, HTMLElement.prototype); copy(Element.Methods.Simulated, HTMLElement.prototype, true); } if (F.SpecificElementExtensions) { for (var tag in Element.Methods.ByTag) { var klass =3D findDOMClass(tag); if (Object.isUndefined(klass)) continue; copy(T[tag], klass.prototype); } } Object.extend(Element, Element.Methods); delete Element.ByTag; if (Element.extend.refresh) Element.extend.refresh(); Element.cache =3D { }; }; document.viewport =3D { getDimensions: function() { var dimensions =3D { }; var B =3D Prototype.Browser; $w('width height').each(function(d) { var D =3D d.capitalize(); dimensions[d] =3D (B.WebKit && !document.evaluate) ? self['inner' + D= ] : (B.Opera) ? document.body['client' + D] : document.documentElement[= 'client' + D]; }); return dimensions; }, getWidth: function() { return this.getDimensions().width; }, getHeight: function() { return this.getDimensions().height; }, getScrollOffsets: function() { return Element._returnOffset( window.pageXOffset || document.documentElement.scrollLeft || document= .body.scrollLeft, window.pageYOffset || document.documentElement.scrollTop || document.= body.scrollTop); } }; /* Portions of the Selector class are derived from Jack Slocum=E2=80=99s Do= mQuery, * part of YUI-Ext version 0.40, distributed under the terms of an MIT-styl= e * license. Please see http://www.yui-ext.com/ for more information. */ var Selector =3D Class.create({ initialize: function(expression) { this.expression =3D expression.strip(); this.compileMatcher(); }, shouldUseXPath: function() { if (!Prototype.BrowserFeatures.XPath) return false; var e =3D this.expression; // Safari 3 chokes on :*-of-type and :empty if (Prototype.Browser.WebKit && (e.include("-of-type") || e.include(":empty"))) return false; // XPath can't do namespaced attributes, nor can it read // the "checked" property from DOM nodes if ((/(\[[\w-]*?:|:checked)/).test(this.expression)) return false; return true; }, compileMatcher: function() { if (this.shouldUseXPath()) return this.compileXPathMatcher(); var e =3D this.expression, ps =3D Selector.patterns, h =3D Selector.han= dlers, c =3D Selector.criteria, le, p, m; if (Selector._cache[e]) { this.matcher =3D Selector._cache[e]; return; } this.matcher =3D ["this.matcher =3D function(root) {", "var r =3D root, h =3D Selector.handlers, c =3D false, = n;"]; while (e && le !=3D e && (/\S/).test(e)) { le =3D e; for (var i in ps) { p =3D ps[i]; if (m =3D e.match(p)) { this.matcher.push(Object.isFunction(c[i]) ? c[i](m) : new Template(c[i]).evaluate(m)); e =3D e.replace(m[0], ''); break; } } } this.matcher.push("return h.unique(n);\n}"); eval(this.matcher.join('\n')); Selector._cache[this.expression] =3D this.matcher; }, compileXPathMatcher: function() { var e =3D this.expression, ps =3D Selector.patterns, x =3D Selector.xpath, le, m; if (Selector._cache[e]) { this.xpath =3D Selector._cache[e]; return; } this.matcher =3D ['.//*']; while (e && le !=3D e && (/\S/).test(e)) { le =3D e; for (var i in ps) { if (m =3D e.match(ps[i])) { this.matcher.push(Object.isFunction(x[i]) ? x[i](m) : new Template(x[i]).evaluate(m)); e =3D e.replace(m[0], ''); break; } } } this.xpath =3D this.matcher.join(''); Selector._cache[this.expression] =3D this.xpath; }, findElements: function(root) { root =3D root || document; if (this.xpath) return document._getElementsByXPath(this.xpath, root); return this.matcher(root); }, match: function(element) { this.tokens =3D []; var e =3D this.expression, ps =3D Selector.patterns, as =3D Selector.as= sertions; var le, p, m; while (e && le !=3D=3D e && (/\S/).test(e)) { le =3D e; for (var i in ps) { p =3D ps[i]; if (m =3D e.match(p)) { // use the Selector.assertions methods unless the selector // is too complex. if (as[i]) { this.tokens.push([i, Object.clone(m)]); e =3D e.replace(m[0], ''); } else { // reluctantly do a document-wide search // and look for a match in the array return this.findElements(document).include(element); } } } } var match =3D true, name, matches; for (var i =3D 0, token; token =3D this.tokens[i]; i++) { name =3D token[0], matches =3D token[1]; if (!Selector.assertions[name](element, matches)) { match =3D false; break; } } return match; }, toString: function() { return this.expression; }, inspect: function() { return "#"; } }); Object.extend(Selector, { _cache: { }, xpath: { descendant: "//*", child: "/*", adjacent: "/following-sibling::*[1]", laterSibling: '/following-sibling::*', tagName: function(m) { if (m[1] =3D=3D '*') return ''; return "[local-name()=3D'" + m[1].toLowerCase() + "' or local-name()=3D'" + m[1].toUpperCase() + "']"; }, className: "[contains(concat(' ', @class, ' '), ' #{1} ')]", id: "[@id=3D'#{1}']", attrPresence: function(m) { m[1] =3D m[1].toLowerCase(); return new Template("[@#{1}]").evaluate(m); }, attr: function(m) { m[1] =3D m[1].toLowerCase(); m[3] =3D m[5] || m[6]; return new Template(Selector.xpath.operators[m[2]]).evaluate(m); }, pseudo: function(m) { var h =3D Selector.xpath.pseudos[m[1]]; if (!h) return ''; if (Object.isFunction(h)) return h(m); return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m); }, operators: { '=3D': "[@#{1}=3D'#{3}']", '!=3D': "[@#{1}!=3D'#{3}']", '^=3D': "[starts-with(@#{1}, '#{3}')]", '$=3D': "[substring(@#{1}, (string-length(@#{1}) - string-length('#{3= }') + 1))=3D'#{3}']", '*=3D': "[contains(@#{1}, '#{3}')]", '~=3D': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]", '|=3D': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]" }, pseudos: { 'first-child': '[not(preceding-sibling::*)]', 'last-child': '[not(following-sibling::*)]', 'only-child': '[not(preceding-sibling::* or following-sibling::*)]', 'empty': "[count(*) =3D 0 and (count(text()) =3D 0 or translate= (text(), ' \t\r\n', '') =3D '')]", 'checked': "[@checked]", 'disabled': "[@disabled]", 'enabled': "[not(@disabled)]", 'not': function(m) { var e =3D m[6], p =3D Selector.patterns, x =3D Selector.xpath, le, v; var exclusion =3D []; while (e && le !=3D e && (/\S/).test(e)) { le =3D e; for (var i in p) { if (m =3D e.match(p[i])) { v =3D Object.isFunction(x[i]) ? x[i](m) : new Template(x[i]).= evaluate(m); exclusion.push("(" + v.substring(1, v.length - 1) + ")"); e =3D e.replace(m[0], ''); break; } } } return "[not(" + exclusion.join(" and ") + ")]"; }, 'nth-child': function(m) { return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) += 1) ", m); }, 'nth-last-child': function(m) { return Selector.xpath.pseudos.nth("(count(./following-sibling::*) += 1) ", m); }, 'nth-of-type': function(m) { return Selector.xpath.pseudos.nth("position() ", m); }, 'nth-last-of-type': function(m) { return Selector.xpath.pseudos.nth("(last() + 1 - position()) ", m); }, 'first-of-type': function(m) { m[6] =3D "1"; return Selector.xpath.pseudos['nth-of-type'](m); }, 'last-of-type': function(m) { m[6] =3D "1"; return Selector.xpath.pseudos['nth-last-of-type'](m); }, 'only-of-type': function(m) { var p =3D Selector.xpath.pseudos; return p['first-of-type'](m) + p[= 'last-of-type'](m); }, nth: function(fragment, m) { var mm, formula =3D m[6], predicate; if (formula =3D=3D 'even') formula =3D '2n+0'; if (formula =3D=3D 'odd') formula =3D '2n+1'; if (mm =3D formula.match(/^(\d+)$/)) // digit only return '[' + fragment + "=3D " + mm[1] + ']'; if (mm =3D formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b if (mm[1] =3D=3D "-") mm[1] =3D -1; var a =3D mm[1] ? Number(mm[1]) : 1; var b =3D mm[2] ? Number(mm[2]) : 0; predicate =3D "[((#{fragment} - #{b}) mod #{a} =3D 0) and " + "((#{fragment} - #{b}) div #{a} >=3D 0)]"; return new Template(predicate).evaluate({ fragment: fragment, a: a, b: b }); } } } }, criteria: { tagName: 'n =3D h.tagName(n, r, "#{1}", c); c =3D false;', className: 'n =3D h.className(n, r, "#{1}", c); c =3D false;', id: 'n =3D h.id(n, r, "#{1}", c); c =3D false;', attrPresence: 'n =3D h.attrPresence(n, r, "#{1}", c); c =3D false;', attr: function(m) { m[3] =3D (m[5] || m[6]); return new Template('n =3D h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c= =3D false;').evaluate(m); }, pseudo: function(m) { if (m[6]) m[6] =3D m[6].replace(/"/g, '\\"'); return new Template('n =3D h.pseudo(n, "#{1}", "#{6}", r, c); c =3D f= alse;').evaluate(m); }, descendant: 'c =3D "descendant";', child: 'c =3D "child";', adjacent: 'c =3D "adjacent";', laterSibling: 'c =3D "laterSibling";' }, patterns: { // combinators must be listed first // (and descendant needs to be last combinator) laterSibling: /^\s*~\s*/, child: /^\s*>\s*/, adjacent: /^\s*\+\s*/, descendant: /^\s/, // selectors follow tagName: /^\s*(\*|[\w\-]+)(\b|$)?/, id: /^#([\w\-\*]+)(\b|$)/, className: /^\.([\w\-\*]+)(\b|$)/, pseudo: /^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)a= bled|not)(\((.*?)\))?(\b|$|(?=3D\s|[:+~>]))/, attrPresence: /^\[([\w]+)\]/, attr: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=3D)\s*((['"])([^\= 4]*?)\4|([^'"][^\]]*?)))?\]/ }, // for Selector.match and Element#match assertions: { tagName: function(element, matches) { return matches[1].toUpperCase() =3D=3D element.tagName.toUpperCase(); }, className: function(element, matches) { return Element.hasClassName(element, matches[1]); }, id: function(element, matches) { return element.id =3D=3D=3D matches[1]; }, attrPresence: function(element, matches) { return Element.hasAttribute(element, matches[1]); }, attr: function(element, matches) { var nodeValue =3D Element.readAttribute(element, matches[1]); return nodeValue && Selector.operators[matches[2]](nodeValue, matches= [5] || matches[6]); } }, handlers: { // UTILITY FUNCTIONS // joins two collections concat: function(a, b) { for (var i =3D 0, node; node =3D b[i]; i++) a.push(node); return a; }, // marks an array of nodes for counting mark: function(nodes) { var _true =3D Prototype.emptyFunction; for (var i =3D 0, node; node =3D nodes[i]; i++) node._countedByPrototype =3D _true; return nodes; }, unmark: function(nodes) { for (var i =3D 0, node; node =3D nodes[i]; i++) node._countedByPrototype =3D undefined; return nodes; }, // mark each child node with its position (for nth calls) // "ofType" flag indicates whether we're indexing for nth-of-type // rather than nth-child index: function(parentNode, reverse, ofType) { parentNode._countedByPrototype =3D Prototype.emptyFunction; if (reverse) { for (var nodes =3D parentNode.childNodes, i =3D nodes.length - 1, j= =3D 1; i >=3D 0; i--) { var node =3D nodes[i]; if (node.nodeType =3D=3D 1 && (!ofType || node._countedByPrototyp= e)) node.nodeIndex =3D j++; } } else { for (var i =3D 0, j =3D 1, nodes =3D parentNode.childNodes; node = =3D nodes[i]; i++) if (node.nodeType =3D=3D 1 && (!ofType || node._countedByPrototyp= e)) node.nodeIndex =3D j++; } }, // filters out duplicates and extends all nodes unique: function(nodes) { if (nodes.length =3D=3D 0) return nodes; var results =3D [], n; for (var i =3D 0, l =3D nodes.length; i < l; i++) if (!(n =3D nodes[i])._countedByPrototype) { n._countedByPrototype =3D Prototype.emptyFunction; results.push(Element.extend(n)); } return Selector.handlers.unmark(results); }, // COMBINATOR FUNCTIONS descendant: function(nodes) { var h =3D Selector.handlers; for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) h.concat(results, node.getElementsByTagName('*')); return results; }, child: function(nodes) { var h =3D Selector.handlers; for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) { for (var j =3D 0, child; child =3D node.childNodes[j]; j++) if (child.nodeType =3D=3D 1 && child.tagName !=3D '!') results.pu= sh(child); } return results; }, adjacent: function(nodes) { for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) { var next =3D this.nextElementSibling(node); if (next) results.push(next); } return results; }, laterSibling: function(nodes) { var h =3D Selector.handlers; for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) h.concat(results, Element.nextSiblings(node)); return results; }, nextElementSibling: function(node) { while (node =3D node.nextSibling) if (node.nodeType =3D=3D 1) return node; return null; }, previousElementSibling: function(node) { while (node =3D node.previousSibling) if (node.nodeType =3D=3D 1) return node; return null; }, // TOKEN FUNCTIONS tagName: function(nodes, root, tagName, combinator) { var uTagName =3D tagName.toUpperCase(); var results =3D [], h =3D Selector.handlers; if (nodes) { if (combinator) { // fastlane for ordinary descendant combinators if (combinator =3D=3D "descendant") { for (var i =3D 0, node; node =3D nodes[i]; i++) h.concat(results, node.getElementsByTagName(tagName)); return results; } else nodes =3D this[combinator](nodes); if (tagName =3D=3D "*") return nodes; } for (var i =3D 0, node; node =3D nodes[i]; i++) if (node.tagName.toUpperCase() =3D=3D=3D uTagName) results.push(n= ode); return results; } else return root.getElementsByTagName(tagName); }, id: function(nodes, root, id, combinator) { var targetNode =3D $(id), h =3D Selector.handlers; if (!targetNode) return []; if (!nodes && root =3D=3D document) return [targetNode]; if (nodes) { if (combinator) { if (combinator =3D=3D 'child') { for (var i =3D 0, node; node =3D nodes[i]; i++) if (targetNode.parentNode =3D=3D node) return [targetNode]; } else if (combinator =3D=3D 'descendant') { for (var i =3D 0, node; node =3D nodes[i]; i++) if (Element.descendantOf(targetNode, node)) return [targetNod= e]; } else if (combinator =3D=3D 'adjacent') { for (var i =3D 0, node; node =3D nodes[i]; i++) if (Selector.handlers.previousElementSibling(targetNode) =3D= =3D node) return [targetNode]; } else nodes =3D h[combinator](nodes); } for (var i =3D 0, node; node =3D nodes[i]; i++) if (node =3D=3D targetNode) return [targetNode]; return []; } return (targetNode && Element.descendantOf(targetNode, root)) ? [targ= etNode] : []; }, className: function(nodes, root, className, combinator) { if (nodes && combinator) nodes =3D this[combinator](nodes); return Selector.handlers.byClassName(nodes, root, className); }, byClassName: function(nodes, root, className) { if (!nodes) nodes =3D Selector.handlers.descendant([root]); var needle =3D ' ' + className + ' '; for (var i =3D 0, results =3D [], node, nodeClassName; node =3D nodes= [i]; i++) { nodeClassName =3D node.className; if (nodeClassName.length =3D=3D 0) continue; if (nodeClassName =3D=3D className || (' ' + nodeClassName + ' ').i= nclude(needle)) results.push(node); } return results; }, attrPresence: function(nodes, root, attr, combinator) { if (!nodes) nodes =3D root.getElementsByTagName("*"); if (nodes && combinator) nodes =3D this[combinator](nodes); var results =3D []; for (var i =3D 0, node; node =3D nodes[i]; i++) if (Element.hasAttribute(node, attr)) results.push(node); return results; }, attr: function(nodes, root, attr, value, operator, combinator) { if (!nodes) nodes =3D root.getElementsByTagName("*"); if (nodes && combinator) nodes =3D this[combinator](nodes); var handler =3D Selector.operators[operator], results =3D []; for (var i =3D 0, node; node =3D nodes[i]; i++) { var nodeValue =3D Element.readAttribute(node, attr); if (nodeValue =3D=3D=3D null) continue; if (handler(nodeValue, value)) results.push(node); } return results; }, pseudo: function(nodes, name, value, root, combinator) { if (nodes && combinator) nodes =3D this[combinator](nodes); if (!nodes) nodes =3D root.getElementsByTagName("*"); return Selector.pseudos[name](nodes, value, root); } }, pseudos: { 'first-child': function(nodes, value, root) { for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) { if (Selector.handlers.previousElementSibling(node)) continue; results.push(node); } return results; }, 'last-child': function(nodes, value, root) { for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) { if (Selector.handlers.nextElementSibling(node)) continue; results.push(node); } return results; }, 'only-child': function(nodes, value, root) { var h =3D Selector.handlers; for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) if (!h.previousElementSibling(node) && !h.nextElementSibling(node)) results.push(node); return results; }, 'nth-child': function(nodes, formula, root) { return Selector.pseudos.nth(nodes, formula, root); }, 'nth-last-child': function(nodes, formula, root) { return Selector.pseudos.nth(nodes, formula, root, true); }, 'nth-of-type': function(nodes, formula, root) { return Selector.pseudos.nth(nodes, formula, root, false, true); }, 'nth-last-of-type': function(nodes, formula, root) { return Selector.pseudos.nth(nodes, formula, root, true, true); }, 'first-of-type': function(nodes, formula, root) { return Selector.pseudos.nth(nodes, "1", root, false, true); }, 'last-of-type': function(nodes, formula, root) { return Selector.pseudos.nth(nodes, "1", root, true, true); }, 'only-of-type': function(nodes, formula, root) { var p =3D Selector.pseudos; return p['last-of-type'](p['first-of-type'](nodes, formula, root), fo= rmula, root); }, // handles the an+b logic getIndices: function(a, b, total) { if (a =3D=3D 0) return b > 0 ? [b] : []; return $R(1, total).inject([], function(memo, i) { if (0 =3D=3D (i - b) % a && (i - b) / a >=3D 0) memo.push(i); return memo; }); }, // handles nth(-last)-child, nth(-last)-of-type, and (first|last)-of-ty= pe nth: function(nodes, formula, root, reverse, ofType) { if (nodes.length =3D=3D 0) return []; if (formula =3D=3D 'even') formula =3D '2n+0'; if (formula =3D=3D 'odd') formula =3D '2n+1'; var h =3D Selector.handlers, results =3D [], indexed =3D [], m; h.mark(nodes); for (var i =3D 0, node; node =3D nodes[i]; i++) { if (!node.parentNode._countedByPrototype) { h.index(node.parentNode, reverse, ofType); indexed.push(node.parentNode); } } if (formula.match(/^\d+$/)) { // just a number formula =3D Number(formula); for (var i =3D 0, node; node =3D nodes[i]; i++) if (node.nodeIndex =3D=3D formula) results.push(node); } else if (m =3D formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b if (m[1] =3D=3D "-") m[1] =3D -1; var a =3D m[1] ? Number(m[1]) : 1; var b =3D m[2] ? Number(m[2]) : 0; var indices =3D Selector.pseudos.getIndices(a, b, nodes.length); for (var i =3D 0, node, l =3D indices.length; node =3D nodes[i]; i+= +) { for (var j =3D 0; j < l; j++) if (node.nodeIndex =3D=3D indices[j]) results.push(node); } } h.unmark(nodes); h.unmark(indexed); return results; }, 'empty': function(nodes, value, root) { for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) { // IE treats comments as element nodes if (node.tagName =3D=3D '!' || (node.firstChild && !node.innerHTML.= match(/^\s*$/))) continue; results.push(node); } return results; }, 'not': function(nodes, selector, root) { var h =3D Selector.handlers, selectorType, m; var exclusions =3D new Selector(selector).findElements(root); h.mark(exclusions); for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) if (!node._countedByPrototype) results.push(node); h.unmark(exclusions); return results; }, 'enabled': function(nodes, value, root) { for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) if (!node.disabled) results.push(node); return results; }, 'disabled': function(nodes, value, root) { for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) if (node.disabled) results.push(node); return results; }, 'checked': function(nodes, value, root) { for (var i =3D 0, results =3D [], node; node =3D nodes[i]; i++) if (node.checked) results.push(node); return results; } }, operators: { '=3D': function(nv, v) { return nv =3D=3D v; }, '!=3D': function(nv, v) { return nv !=3D v; }, '^=3D': function(nv, v) { return nv.startsWith(v); }, '$=3D': function(nv, v) { return nv.endsWith(v); }, '*=3D': function(nv, v) { return nv.include(v); }, '~=3D': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' '= ); }, '|=3D': function(nv, v) { return ('-' + nv.toUpperCase() + '-').include= ('-' + v.toUpperCase() + '-'); } }, split: function(expression) { var expressions =3D []; expression.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m)= { expressions.push(m[1].strip()); }); return expressions; }, matchElements: function(elements, expression) { var matches =3D $$(expression), h =3D Selector.handlers; h.mark(matches); for (var i =3D 0, results =3D [], element; element =3D elements[i]; i++= ) if (element._countedByPrototype) results.push(element); h.unmark(matches); return results; }, findElement: function(elements, expression, index) { if (Object.isNumber(expression)) { index =3D expression; expression =3D false; } return Selector.matchElements(elements, expression || '*')[index || 0]; }, findChildElements: function(element, expressions) { expressions =3D Selector.split(expressions.join(',')); var results =3D [], h =3D Selector.handlers; for (var i =3D 0, l =3D expressions.length, selector; i < l; i++) { selector =3D new Selector(expressions[i].strip()); h.concat(results, selector.findElements(element)); } return (l > 1) ? h.unique(results) : results; } }); if (Prototype.Browser.IE) { Object.extend(Selector.handlers, { // IE returns comment nodes on getElementsByTagName("*"). // Filter them out. concat: function(a, b) { for (var i =3D 0, node; node =3D b[i]; i++) if (node.tagName !=3D=3D "!") a.push(node); return a; }, // IE improperly serializes _countedByPrototype in (inner|outer)HTML. unmark: function(nodes) { for (var i =3D 0, node; node =3D nodes[i]; i++) node.removeAttribute('_countedByPrototype'); return nodes; } }); } function $$() { return Selector.findChildElements(document, $A(arguments)); } var Form =3D { reset: function(form) { $(form).reset(); return form; }, serializeElements: function(elements, options) { if (typeof options !=3D 'object') options =3D { hash: !!options }; else if (Object.isUndefined(options.hash)) options.hash =3D true; var key, value, submitted =3D false, submit =3D options.submit; var data =3D elements.inject({ }, function(result, element) { if (!element.disabled && element.name) { key =3D element.name; value =3D $(element).getValue(); if (value !=3D null && (element.type !=3D 'submit' || (!submitted &= & submit !=3D=3D false && (!submit || key =3D=3D submit) && (subm= itted =3D true)))) { if (key in result) { // a key is already present; construct an array of values if (!Object.isArray(result[key])) result[key] =3D [result[key]]= ; result[key].push(value); } else result[key] =3D value; } } return result; }); return options.hash ? data : Object.toQueryString(data); } }; Form.Methods =3D { serialize: function(form, options) { return Form.serializeElements(Form.getElements(form), options); }, 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 $A(inputs).map(Element.extend); for (var i =3D 0, matchingInputs =3D [], 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(form).invoke('disable'); return form; }, enable: function(form) { form =3D $(form); Form.getElements(form).invoke('enable'); return form; }, findFirstElement: function(form) { var elements =3D $(form).getElements().findAll(function(element) { return 'hidden' !=3D element.type && !element.disabled; }); var firstByIndex =3D elements.findAll(function(element) { return element.hasAttribute('tabIndex') && element.tabIndex >=3D 0; }).sortBy(function(element) { return element.tabIndex }).first(); return firstByIndex ? firstByIndex : elements.find(function(element) { return ['input', 'select', 'textarea'].include(element.tagName.toLowe= rCase()); }); }, focusFirstElement: function(form) { form =3D $(form); form.findFirstElement().activate(); return form; }, request: function(form, options) { form =3D $(form), options =3D Object.clone(options || { }); var params =3D options.parameters, action =3D form.readAttribute('actio= n') || ''; if (action.blank()) action =3D window.location.href; options.parameters =3D form.serialize(true); if (params) { if (Object.isString(params)) params =3D params.toQueryParams(); Object.extend(options.parameters, params); } if (form.hasAttribute('method') && !options.method) options.method =3D form.method; return new Ajax.Request(action, options); } }; /*-------------------------------------------------------------------------= -*/ 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 && element.name) { var value =3D element.getValue(); if (value !=3D undefined) { var pair =3D { }; pair[element.name] =3D value; return Object.toQueryString(pair); } } return ''; }, getValue: function(element) { element =3D $(element); var method =3D element.tagName.toLowerCase(); return Form.Element.Serializers[method](element); }, setValue: function(element, value) { element =3D $(element); var method =3D element.tagName.toLowerCase(); Form.Element.Serializers[method](element, value); return element; }, clear: function(element) { $(element).value =3D ''; return element; }, present: function(element) { return $(element).value !=3D ''; }, activate: function(element) { element =3D $(element); try { element.focus(); if (element.select && (element.tagName.toLowerCase() !=3D 'input' || !['button', 'reset', 'submit'].include(element.type))) element.select(); } catch (e) { } return element; }, disable: function(element) { element =3D $(element); element.blur(); element.disabled =3D true; return element; }, enable: function(element) { element =3D $(element); element.disabled =3D false; return element; } }; /*-------------------------------------------------------------------------= -*/ var Field =3D Form.Element; var $F =3D Form.Element.Methods.getValue; /*-------------------------------------------------------------------------= -*/ Form.Element.Serializers =3D { input: function(element, value) { switch (element.type.toLowerCase()) { case 'checkbox': case 'radio': return Form.Element.Serializers.inputSelector(element, value); default: return Form.Element.Serializers.textarea(element, value); } }, inputSelector: function(element, value) { if (Object.isUndefined(value)) return element.checked ? element.value := null; else element.checked =3D !!value; }, textarea: function(element, value) { if (Object.isUndefined(value)) return element.value; else element.value =3D value; }, select: function(element, index) { if (Object.isUndefined(index)) return this[element.type =3D=3D 'select-one' ? 'selectOne' : 'selectMany'](element); else { var opt, value, single =3D !Object.isArray(index); for (var i =3D 0, length =3D element.length; i < length; i++) { opt =3D element.options[i]; value =3D this.optionValue(opt); if (single) { if (value =3D=3D index) { opt.selected =3D true; return; } } else opt.selected =3D index.include(value); } } }, selectOne: function(element) { var index =3D element.selectedIndex; return index >=3D 0 ? this.optionValue(element.options[index]) : null; }, selectMany: function(element) { var values, length =3D element.length; if (!length) return null; for (var i =3D 0, values =3D []; i < length; i++) { var opt =3D element.options[i]; if (opt.selected) values.push(this.optionValue(opt)); } return values; }, optionValue: function(opt) { // extend element because hasAttribute may not be native return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text= ; } }; /*-------------------------------------------------------------------------= -*/ Abstract.TimedObserver =3D Class.create(PeriodicalExecuter, { initialize: function($super, element, frequency, callback) { $super(callback, frequency); this.element =3D $(element); this.lastValue =3D this.getValue(); }, execute: function() { var value =3D this.getValue(); if (Object.isString(this.lastValue) && Object.isString(value) ? this.lastValue !=3D value : String(this.lastValue) !=3D String(valu= e)) { this.callback(this.element, value); this.lastValue =3D value; } } }); Form.Element.Observer =3D Class.create(Abstract.TimedObserver, { getValue: function() { return Form.Element.getValue(this.element); } }); Form.Observer =3D Class.create(Abstract.TimedObserver, { getValue: function() { return Form.serialize(this.element); } }); /*-------------------------------------------------------------------------= -*/ Abstract.EventObserver =3D Class.create({ 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, 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(Abstract.EventObserver, { getValue: function() { return Form.Element.getValue(this.element); } }); Form.EventObserver =3D Class.create(Abstract.EventObserver, { getValue: function() { return Form.serialize(this.element); } }); if (!window.Event) var Event =3D { }; 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, KEY_INSERT: 45, cache: { }, relatedTarget: function(event) { var element; switch(event.type) { case 'mouseover': element =3D event.fromElement; break; case 'mouseout': element =3D event.toElement; break; default: return null; } return Element.extend(element); } }); Event.Methods =3D (function() { var isButton; if (Prototype.Browser.IE) { var buttonMap =3D { 0: 1, 1: 4, 2: 2 }; isButton =3D function(event, code) { return event.button =3D=3D buttonMap[code]; }; } else if (Prototype.Browser.WebKit) { isButton =3D function(event, code) { switch (code) { case 0: return event.which =3D=3D 1 && !event.metaKey; case 1: return event.which =3D=3D 1 && event.metaKey; default: return false; } }; } else { isButton =3D function(event, code) { return event.which ? (event.which =3D=3D=3D code + 1) : (event.button= =3D=3D=3D code); }; } return { isLeftClick: function(event) { return isButton(event, 0) }, isMiddleClick: function(event) { return isButton(event, 1) }, isRightClick: function(event) { return isButton(event, 2) }, element: function(event) { var node =3D Event.extend(event).target; return Element.extend(node.nodeType =3D=3D Node.TEXT_NODE ? node.pare= ntNode : node); }, findElement: function(event, expression) { var element =3D Event.element(event); if (!expression) return element; var elements =3D [element].concat(element.ancestors()); return Selector.findElement(elements, expression, 0); }, pointer: function(event) { return { x: event.pageX || (event.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft)= ), y: event.pageY || (event.clientY + (document.documentElement.scrollTop || document.body.scrollTop)) }; }, pointerX: function(event) { return Event.pointer(event).x }, pointerY: function(event) { return Event.pointer(event).y }, stop: function(event) { Event.extend(event); event.preventDefault(); event.stopPropagation(); event.stopped =3D true; } }; })(); Event.extend =3D (function() { var methods =3D Object.keys(Event.Methods).inject({ }, function(m, name) = { m[name] =3D Event.Methods[name].methodize(); return m; }); if (Prototype.Browser.IE) { Object.extend(methods, { stopPropagation: function() { this.cancelBubble =3D true }, preventDefault: function() { this.returnValue =3D false }, inspect: function() { return "[object Event]" } }); return function(event) { if (!event) return false; if (event._extendedByPrototype) return event; event._extendedByPrototype =3D Prototype.emptyFunction; var pointer =3D Event.pointer(event); Object.extend(event, { target: event.srcElement, relatedTarget: Event.relatedTarget(event), pageX: pointer.x, pageY: pointer.y }); return Object.extend(event, methods); }; } else { Event.prototype =3D Event.prototype || document.createEvent("HTMLEvents= ").__proto__; Object.extend(Event.prototype, methods); return Prototype.K; } })(); Object.extend(Event, (function() { var cache =3D Event.cache; function getEventID(element) { if (element._prototypeEventID) return element._prototypeEventID[0]; arguments.callee.id =3D arguments.callee.id || 1; return element._prototypeEventID =3D [++arguments.callee.id]; } function getDOMEventName(eventName) { if (eventName && eventName.include(':')) return "dataavailable"; return eventName; } function getCacheForID(id) { return cache[id] =3D cache[id] || { }; } function getWrappersForEventName(id, eventName) { var c =3D getCacheForID(id); return c[eventName] =3D c[eventName] || []; } function createWrapper(element, eventName, handler) { var id =3D getEventID(element); var c =3D getWrappersForEventName(id, eventName); if (c.pluck("handler").include(handler)) return false; var wrapper =3D function(event) { if (!Event || !Event.extend || (event.eventName && event.eventName !=3D eventName)) return false; Event.extend(event); handler.call(element, event); }; wrapper.handler =3D handler; c.push(wrapper); return wrapper; } function findWrapper(id, eventName, handler) { var c =3D getWrappersForEventName(id, eventName); return c.find(function(wrapper) { return wrapper.handler =3D=3D handler= }); } function destroyWrapper(id, eventName, handler) { var c =3D getCacheForID(id); if (!c[eventName]) return false; c[eventName] =3D c[eventName].without(findWrapper(id, eventName, handle= r)); } function destroyCache() { for (var id in cache) for (var eventName in cache[id]) cache[id][eventName] =3D null; } if (window.attachEvent) { window.attachEvent("onunload", destroyCache); } return { observe: function(element, eventName, handler) { element =3D $(element); var name =3D getDOMEventName(eventName); var wrapper =3D createWrapper(element, eventName, handler); if (!wrapper) return element; if (element.addEventListener) { element.addEventListener(name, wrapper, false); } else { element.attachEvent("on" + name, wrapper); } return element; }, stopObserving: function(element, eventName, handler) { element =3D $(element); var id =3D getEventID(element), name =3D getDOMEventName(eventName); if (!handler && eventName) { getWrappersForEventName(id, eventName).each(function(wrapper) { element.stopObserving(eventName, wrapper.handler); }); return element; } else if (!eventName) { Object.keys(getCacheForID(id)).each(function(eventName) { element.stopObserving(eventName); }); return element; } var wrapper =3D findWrapper(id, eventName, handler); if (!wrapper) return element; if (element.removeEventListener) { element.removeEventListener(name, wrapper, false); } else { element.detachEvent("on" + name, wrapper); } destroyWrapper(id, eventName, handler); return element; }, fire: function(element, eventName, memo) { element =3D $(element); if (element =3D=3D document && document.createEvent && !element.dispa= tchEvent) element =3D document.documentElement; var event; if (document.createEvent) { event =3D document.createEvent("HTMLEvents"); event.initEvent("dataavailable", true, true); } else { event =3D document.createEventObject(); event.eventType =3D "ondataavailable"; } event.eventName =3D eventName; event.memo =3D memo || { }; if (document.createEvent) { element.dispatchEvent(event); } else { element.fireEvent(event.eventType, event); } return Event.extend(event); } }; })()); Object.extend(Event, Event.Methods); Element.addMethods({ fire: Event.fire, observe: Event.observe, stopObserving: Event.stopObserving }); Object.extend(document, { fire: Element.Methods.fire.methodize(), observe: Element.Methods.observe.methodize(), stopObserving: Element.Methods.stopObserving.methodize(), loaded: false }); (function() { /* Support for the DOMContentLoaded event is based on work by Dan Webb, Matthias Miller, Dean Edwards and John Resig. */ var timer; function fireContentLoadedEvent() { if (document.loaded) return; if (timer) window.clearInterval(timer); document.fire("dom:loaded"); document.loaded =3D true; } if (document.addEventListener) { if (Prototype.Browser.WebKit) { timer =3D window.setInterval(function() { if (/loaded|complete/.test(document.readyState)) fireContentLoadedEvent(); }, 0); Event.observe(window, "load", fireContentLoadedEvent); } else { document.addEventListener("DOMContentLoaded", fireContentLoadedEvent, false); } } else { document.write("