From: <ÓÉ Windows Internet Explorer 8 ±£´æ> Subject: Caltech Undergraduate Admissions: Frequently Asked Questions Date: Tue, 21 Jul 2009 12:37:41 +0800 MIME-Version: 1.0 Content-Type: multipart/related; type="text/html"; boundary="----=_NextPart_000_0078_01CA0A00.0A0B4930" X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 This is a multi-part message in MIME format. ------=_NextPart_000_0078_01CA0A00.0A0B4930 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Location: http://www.admissions.caltech.edu/faqs Caltech Undergraduate Admissions: Frequently Asked = Questions
3D"Caltech =20

California Institute of Technology

Caltech Undergraduate Admissions

Frequently Asked Questions


About = Caltech=20
Printable=20 Version of General FAQ (pdf)
General = Information=20
Academics=20
Research=20 Opportunities and Facilities
Extracurricula= r=20 Activities
Campus=20 Life
Pasadena=20 and Los Angeles
Life After = Caltech
Getting to Know=20 Caltech

Applying to = Caltech -=20 Freshman Admissions

Printable=20 Version of Applying FAQ (pdf)
High School=20 Preparation
Submitting = the=20 Application
Filling Out the=20 Application
Recommend= ation=20 Letters and Supplementary Information
Early = Action
Special Programs = and=20 Circumstances
Admission=20 Decisions
Admissions = Policy
Financial=20 Aid

Transfer=20 Admissions



About Caltech

General Information

Where is the = campus?
Caltech is=20 located in Pasadena, California, a "suburb" of Los Angeles with = many=20 shops, restaurants, and cultural venues and beautiful, leafy residential = neighborhoods.

What is Caltech's=20 mission?
The mission of the California Institute of = Technology=20 is to expand human knowledge and benefit society through research = integrated=20 with education. We investigate the most challenging, fundamental = problems in=20 science and technology in a singularly collegial, interdisciplinary = atmosphere,=20 while educating outstanding students to become creative members of=20 society.

How many students are enrolled at=20 Caltech?
In the fall of 2007, there were 634 = undergraduate men=20 and 279 undergraduate women, and 861 graduate men and 359 graduate=20 women.

How many faculty members are there at=20 Caltech?
As of December 2007, there were 296 = professors, 104=20 emeriti faculty, 60 research faculty, 100 visiting professors, and 53 = other=20 faculty. There are 535 postdoctoral scholars, 24 senior postdoctoral = scholars,=20 and 108 visiting postdoctoral scholars.

Academics

How are academics structured at=20 Caltech?
All students must complete a core curriculum, = which=20 lasts from the beginning of freshman year through the middle or end of = sophomore=20 year. Students begin taking classes in their intended major as early as = freshman=20 year, then progress to upper-level courses in their major through their=20 sophomore, junior and senior years.

Is Caltech on the = semester or quarter system?
Trick question! The answer = is=20 neither. Caltech has three terms, or trimesters, each academic year: = fall term=20 begins late in September and runs to mid-December; winter term runs from = January=20 to late March; and spring term runs from April to mid-June. Caltech = offers no=20 summer courses.

Does Caltech have a summer=20 session?
Caltech does not offer courses in the summer. = However,=20 many students are involved in research projects on campus through the Summer = Undergraduate Research=20 Fellowships (SURF) program.

How many credits do = students=20 take per term?

The credits per class differ depending = on the=20 hours required for class time, homework, and lab time, where applicable. = Most=20 students take four to five classes per term.

When do = students declare a major?
Students typically choose an = academic=20 option (the Techer term for "major") at the end of their freshman=20 year.

Can students create their own majors or double=20 major?

Absolutely. Our students have many interests, = and we=20 want them to pursue their passions, so we give them the opportunity to = create=20 their own major through the Independent Studies Program, in which they = design a=20 customized course of study under the guidance of faculty. Double = majoring is=20 also possible - about 20% of students are currently pursuing two=20 majors.

Can students take graduate level=20 courses?

Yes - and they do. There is no clear = separation=20 between coursework for undergraduates and graduate students. Students = naturally=20 progress through the curriculum and often by the end of their junior or = senior=20 year end up in graduate classes in their option (the Techer term for=20 "major.")

Does Caltech have a premed=20 program?
Yes, Caltech offers a premed=20 program that advises students throughout their time at Caltech and = assists=20 them through the medical school application process. Clinical experience = and=20 research opportunities are also offered to premed students through = arrangements=20 with Huntington Memorial Hospital, City of Hope, and Children's Hospital = Los=20 Angeles. Every year, many of our students are admitted to the nation's = most=20 selective medical schools. Caltech also has an active Premed Club and a BS/MD program in cooperation with = the=20 University of California San Diego Medical School. =

What if I=20 also want to study humanities and the social = sciences?
Not only=20 are you required to do so at Caltech, you'll want to. Almost 30% of = Caltech's=20 course offerings are in the humanities and social science division, with = fascinating classes and excellent professors. There are opportunities to = learn=20 about topics completely unrelated to science, and also to merge your = interests=20 through coursework and research. A number of students will double-major = in a=20 science field and a humanities/social science field each=20 year.

Can I take classes at other colleges and = receive=20 credit?

Caltech has special arrangements at nearby = Occidental=20 College and the Art Center College of Design. Students can also arrange = to=20 receive credit from other colleges with permission of the appropriate=20 division.

Are there opportunities to study=20 abroad?
Yes. Caltech offers four study = abroad=20 programs: the Cambridge Scholars Program, London Scholars Program,=20 Copenhagen Scholars Program and the Edinburgh Scholars Program.=20

What are typical class = sizes?

Classes tend=20 to be small: 37% of classes have fewer than 10 students, 69% have fewer = than 20=20 students, and 92% have fewer than 50 students.

What = is your=20 student-to-faculty ratio?

3:1

Who = teaches=20 the classes?

Our professors teach our courses, not our = graduate=20 students. There are a few larger lecture classes, like the core math and = physics=20 courses, in which teaching assistants will help answer questions in = smaller=20 sessions. These sessions are not required, but are available for all = students,=20 many of whom find them to be very helpful.

Do = professors=20 interact with undergraduates?
Yes; it is one of the = hallmarks=20 of Caltech's teaching and learning culture. Professors hold regular = office=20 hours, frequently email students, lunch with them, and take questions = after=20 class. Not only are they teachers, they also serve as mentors, helping = students=20 choose their fields of study, research topics, and summer and = post-graduation=20 options.

How do graduate students and undergraduates=20 interact?
In some cases, graduate students take some of = the=20 same classes as undergraduates, or act as teaching assistants for some = courses,=20 and a few serve as residence assistants in the undergraduate houses. Due = to the=20 many research opportunities available, many undergraduates find = themselves=20 working alongside graduate students in labs and collaborating with them = on=20 research projects. Caltech is an intimate community where clubs and=20 extracurricular activities are open to all, so graduates and = undergraduates may=20 play soccer together, sing in the same choral group, or tutor together = in local=20 schools.

Research Opportunities and Facilities

Is it = difficult to=20 pursue research at Caltech?
No, in fact, you could say = that the=20 Caltech undergraduate education is research. Students constantly do = research in=20 and out of the classroom to learn and contribute to science at the = highest=20 level.

How many Caltech undergraduates do research = outside=20 the classroom?
In the 2008 graduating class, 74% of the = graduating seniors had "SURF"ed at Caltech. Still others did research = during the=20 academic year or in other ways outside the SURF = program.

Can=20 students do research in the humanities and social=20 sciences?
They can and they do. In addition to pursuing = research projects through SURF, many students work independently with = their=20 professors and often explore the intersection of humanities and social=20 science.

Do undergraduates publish in major=20 journals?
Yes. Frequently.

What are = the=20 technology resources on campus?
Needless to say, = Caltech is=20 very well-wired. In addition to high-quality computing = facilities and=20 services, there are centers for Advanced Computing Research and Digital=20 Media.

What library resources are=20 available?
In addition to five campus libraries, Caltech Library = Services=20 offers online access to all major research and scientific=20 databases.

Extracurricular Activities

Do Techers study all the=20 time?

Of course not! Most students are in class or in = lab in=20 the mornings and early afternoon but spend their late afternoons and = evenings=20 participating in a wide range of activities. Each student's class = schedule and=20 study habits are unique, but Techers always find time to pursue their = outside=20 interests. They get involved in everything from music and sports to = community=20 service and cultural clubs. There are over 150 clubs and=20 organizations on campus, and Techers are always encouraged to start = new=20 ones.

Do Techers play sports?

Athletics=20 is one of the most popular activities on campus, from = intercollegiate=20 varsity athletics (Division III) to House intramurals to club teams. = Students=20 with all levels of experience are encouraged to play. =

Do=20 Techers play music?
In addition to music courses taught = by=20 faculty, extracurricular music groups of all sizes and styles are also = very=20 popular on campus and in the community. Students also have = round-the-clock=20 access to an excellent Music House devoted to practice and performance=20 space.

Campus Life

Ho= w is the=20 housing arranged?
Caltech has eight undergraduate = "houses,"=20 which are designed like dorms, but have the intimate and collegial = atmosphere of=20 a home. Students are involved in choosing their house at the beginning = of=20 freshman year after participating in "rotation," the process of learning = about=20 each of the houses.

Are freshmen required to live on=20 campus?
Yes. Students are not required to live on = campus after=20 their first year, but most do. Caltech guarantees housing for all four = years,=20 and all but a few students choose to live either in the houses or in=20 Caltech-owned and Caltech-adjacent homes and = apartments.

Can=20 students live off campus?

After freshman year, students = can=20 choose to live in Caltech-owned apartments or houses on or near the = campus or=20 rent from the local housing market.

Do students = choose their=20 roommates?
Yes. Students choose their roommates all = four=20 years.

Are the houses coed?
Yes. The = houses=20 and the floors within the houses are coed.

Is there a = Greek=20 system?
No. While there are neither fraternities nor = sororities=20 on campus, the houses provide a strong sense of community and = camaraderie within=20 the larger Caltech community.

What is the board=20 plan?
Caltech provides a sit-down dinner with table = service in=20 each house on weeknights, where the food is served family style. Each = house also=20 has an "open kitchen" for breakfast and lunch where items like cold cuts = for=20 sandwiches are available. The board plan includes a stipend for dining = in other=20 campus cafes. On the weekends, students enjoy their meals in local=20 eateries.

What if I have dietary=20 restrictions?
Caltech provides ample kosher, halal, = vegetarian,=20 and vegan options. The dining staff also can accommodate other dietary=20 needs.

Do I need a car?
No. Many = amenities=20 are within walking distance of campus; there are also public = transportation=20 options and other students to carpool with.

Can I = keep a car=20 on campus?
Yes. Students, including freshmen, can have = cars on=20 campus. There is designated and convenient student parking. However, = fewer than=20 a third of undergraduates have cars on campus.

Do I = need a=20 bicycle?
No. The campus is compact, and it is easy to = get=20 around on foot. If you'd like a bicycle, it's easy to ride around campus = and=20 there are ample bicycle racks for parking.

What do = students=20 do for fun?
Everything and anything! The houses hold = parties=20 regularly and the student government hosts campus-wide barbeques, = dances, and=20 concerts. On any given night, students may be holding a movie marathon, = playing=20 midnight Capture the Flag, or hanging out in Pasadena. =

What=20 are the resources for religious life on campus?
While = there is=20 no formal chaplain's office, there are a number of religious communities = on and=20 around campus, including the Caltech-Hillel, Muslim Students = Association, and=20 Christian Fellowship.

What kind of academic and = personal=20 support is available at Caltech?

In addition to = academic=20 advisors, each house has Residence Assistants (RAs) and Upper-class = Counselors=20 (UCCs) to support students in all aspects of college life. The resources = of the=20 Counseling Center are always available to students as well. Students are = also=20 involved with the Women's Center, the Office of Minority Student = Education, and=20 the International Student Programs Office.

What = health=20 services are available at Caltech?
There is a = comprehensive=20 on-campus Health Center with doctors, nurse practitioners, and = counselors on=20 staff. The highly acclaimed Huntington Memorial Hospital is minutes away = for any=20 needs that may arise.

Pasadena and Los Angeles

What is Pasadena=20 like?
Pasadena blends the best attributes of city and = suburban=20 life. While you can easily walk or take a short bus ride to many shops,=20 restaurants, and theatres from campus, Caltech is nestled in a beautiful = residential area with quiet streets ideal for jogging or=20 bicycling.

Is it safe?
Caltech is in = a safe=20 residential neighborhood. The campus has its own 24-hour security = services as=20 well.

How far is Caltech from Los=20 Angeles?
Los Angeles is essentially a sprawling mix of = diverse=20 communities. Downtown is about 20 minutes away by car, while Hollywood, = the=20 Westside, and the beaches are about a 45-minute drive=20 away.

Do students hang out in Los Angeles for=20 fun?

While some students prefer staying on campus, many = others=20 explore the city on the weekends. Pasadena also has an active night = life,=20 particularly in Old Town.

What outdoor activities = are=20 available?

There is a nature preserve with hiking = trails two=20 miles north of campus, and the Angeles National Forest is a 20 minute = drive=20 away. The beaches are a 45-minute drive away, mountains with ski slopes = are a=20 90-minute drive, and the desert (most notably, Joshua Tree) is about two = hours=20 away.

What is the weather = like?
Glorious!=20 Contrary to popular belief, there are seasons in Southern = California-they all=20 just happen to be very pleasant. The fall is warm (80s), the winter is = brisk=20 (60s), and the spring is balmy (70s). In the summer, the temperatures = sometimes=20 hit triple digits, but usually hover in the low 90s.

Life = After=20 Caltech

What do = graduating seniors=20 do?

In 2006, about 60% of the seniors went on to = graduate=20 school, 30% accepted employment, and about 10% pursued other activities, = like=20 research fellowships or travel.

Where do Techers go = to=20 graduate school?
Every year, students are admitted to = the top=20 programs around the world. Last year, Stanford, MIT, Caltech, and UC = Berkeley=20 were among the more popular schools.

Where do Techers = go to=20 medical school?

Every year, students are admitted to = the best=20 schools across the country. Last year, Harvard, UC San Diego, and USC = were among=20 the schools chosen most often by seniors.

What = resources are=20 available for choosing career paths?

Caltech has an = excellent=20 Career Development Center with skilled and dedicated counselors who = guide=20 Techers to the right post-graduation decisions.

Is = there an=20 alumni network?

The Alumni Association has active job=20 connection and network services. Given the unparalleled preparation a = Caltech=20 education gives students, alumni are always eager to hire fellow = Techers. There=20 are alums around the country who organize recruiting, networking = activities and=20 social events.

Getting to Know = Caltech

W= here=20 should I stay when I visit the campus?
Pasadena offers = a wide=20 range of hotels and other accommodations. If you are likely to be = looking for=20 something to do during the evenings away from campus, we recommend that = you look=20 for a hotel near Old Town. We've noted some of the hotels on our Local = Accommodations page.

Does Caltech offer overnight = stays?
Caltech does not sponsor overnight visits. All = admitted=20 students are invited to participate in our April Prefrosh Weekend = program, when=20 students can stay on campus Thursday through Sunday. Admitted students = who=20 cannot attend Prefosh Weekend can arrange for Caltech in a Day, a = day-long=20 personalized visit.

Can prospective students sit in = on=20 classes?
You are welcome to sit in on classes. Consult = the=20 current schedule of courses and plan accordingly. Please stop by the = admissions=20 office first to get a map and directions to the = classroom.

Is=20 there someone I can mail or talk to on campus?
You can = contact=20 your admissions=20 counselor. If you'd like to speak with a current student your = admission=20 counselor can direct you to someone who shares your interests..=20

Will I be at a disadvantage in the admission process = if I=20 don't visit campus?
No. We don't require visits, nor do = we=20 consider whether you have visited as a factor in making our admission=20 decisions.


Applying to Caltech - Freshman = Admissions


High-School = Preparation

What kind of high-school preparation = should I=20 have?

4 years of math (including calculus)
1 year of = physics
1 year of chemistry
3 years of English (4 years = recommended)
1=20 year of U.S. history/government (waived for international=20 students)

What if my high school does not offer = Advanced=20 Placement (AP) or International Baccalaureate (IB)=20 courses?
Many schools don't offer the AP or IB = curricula.=20 Regardless of the curriculum your school offers, we expect that you will = have=20 challenged yourself with demanding courses. The Caltech curriculum will = require=20 that you have completed rigorous courses in calculus and in physics. If = these=20 courses are not available in your high school, we strongly encourage you = to take=20 them at a local college or online.

Do you give more = weight=20 to AP courses?

We expect that students have challenged=20 themselves in the context of what their high school has to offer. Some = schools=20 offer AP courses, some IB courses, and some neither. Students without = courses=20 designated as AP or IB won't be disadvantaged if those courses weren't = available=20 within their school.

Is it better to get a "B" in an = AP=20 course or an "A" in a regular course?
This is a popular = question. Realistically, students admitted to Caltech are mostly getting = "A"=20 grades in the AP/IB or other most rigorous course they are=20 taking.

If I have exhausted the math and science = courses at=20 my high school, what should I do?
Consider taking = courses at a=20 nearby college or an appropriate online course, or arranging an = independent=20 study project at your high school.

Is there a = minimum GPA=20 you require?
No. Most admitted students, however, = perform near=20 the top of their graduating class.

What if my high = school=20 doesn't rank students?
This isn't a problem. Your = school will=20 usually send us a profile that includes a grade distribution that allows = us to=20 see how your performance compares to that of your=20 classmates.

What tests do you = require?

The=20 SAT: Critical Reading, Math and Writing
OR the old SAT I: Verbal and=20 Math
OR the ACT (with or without the optional writing section)
AND = SAT=20 Subject Test Mathematics Level 2
AND One of the following SAT Subject = Tests:=20 Biology, (Ecological), Biology (Molecular), Chemistry, or=20 Physics

Is the TOEFL required for non-English=20 speakers?
If your native language is not English, and = you have=20 not studied for at least two years in an English-speaking country, we = encourage=20 (but don't require) you to take the TOEFL (Test of English as a Foreign=20 Language). Both paper-and computer-based TOEFL are=20 acceptable.

Are there minimum SAT/ACT scores you=20 require?
No. There are no cutoffs and we do not admit = "by the=20 numbers." The mid 50% for students admitted to the class of 2011 are as = follows:=20 SAT 2170-2310 and ACT (English/math) 33-35.

If I take = the=20 SATs or the ACT more than once, which results will you=20 consider?
When we review your application we have all = of your=20 test scores available to us. We will look at all of your scores, paying=20 particular attention to the general pattern of scores and emphasizing = the=20 highest score for each individual exam.

Can I take or = retake=20 the SATs or ACT after the application deadline?
You = can, but=20 the scores may not arrive in time for consideration. You should complete = tests=20 by October for Early Action and by December for Regular=20 Decision.

Should I pay extra money for the express = delivery=20 of my scores?

No. Never pay to have scores delivered = via an=20 express service. We receive the scores electronically. Normal delivery = is the=20 fastest way to have your scores matched to your application in our=20 office.

Do you prefer the ACT or the = SAT?

We=20 do not have a preference, but please note that we require SAT Subject = tests for=20 all applicants.

If I am admitted, will you give me = credit for=20 AP or IB courses, or for college classes taken in high=20 school?
When we review your application, we will take = into=20 account that you have enrolled in a rigorous course of study. Caltech = does not,=20 however, grant credit based on AP or IB examination results. New = students will=20 have the opportunity to take placement exams in math, physics, = chemistry, and=20 writing. How students score on these exams sometimes results in their = being=20 placed in upper level courses and being given credit for Caltech = courses.=20

Submitting the Application

When are applications=20 available?
Freshman applications are typically = available after=20 July 1 of each year. Transfer and 3/2 applications are usually available = by the=20 end of August.

Can I apply=20 online?
Yes. In fact, we encourage you to apply online. = We have=20 many fewer problems with lost applications and missing documents when a = student=20 applies online.

Do I need to submit official AP or = IB=20 scores?

We ask you to self-report available AP or IB = scores on=20 the application, and we will consider them when we are making admissions = decisions. There is no need to send official reports. =

Are=20 interviews required as part of the application = process?
We do=20 not conduct interviews. You are, however, encouraged to visit the campus = to=20 participate in an information session and campus tour. In addition, if = you'd=20 like to speak to Caltech alumni in your area, please contact the Alumni=20 Association at 626.395.6852.

Filling Out the = Application


Can I attach a resume = rather than=20 fill out the activities section?

You may attach a = resume, but=20 you must still fill out the activities section on both the Common = Application=20 and the Supplement. We are interested in which activities are most = important to=20 you. If you include additional information, please be sure that it = follows the=20 format used on the application and supplement.

How = long=20 should my essays be?
The Common Application and Caltech = Supplement provide general guidance as to the length of each essay or = short=20 answer. If you go over a word limit by a sentence or two, don't worry = about it.=20 Be sure that your responses are well developed and respond fully to the = question=20 or prompt.

How long should my short answers=20 be?
At least as long as is necessary to answer the = question and=20 no longer than the space allowed. We limit you to the space provided = because we=20 aren't looking for long answers. These really are designed to be = short=20 answers.

What are you looking for in the short = answers and=20 essays?
You. We want to hear your stories in your own = voice.=20 The writing matters a lot in our deliberations. Take your time and make = sure=20 your writing reflects who you are.

What if I have = something=20 else to tell you?
If there is other information you = want to=20 submit, for example, extenuating family or personal circumstances, you = can add=20 it to the "Additional Information" section on the Common Application or = Caltech=20 Supplement.

Recommendation Letters and Supplementary=20 Information


Who should I=20 ask to write my recommendation letters?

Always choose = junior=20 or senior year teachers who know you well and like you a lot. We require = one=20 letter from a humanities or social science teacher and one letter from a = math or=20 science teacher. Junior or senior year teachers are important because = they are=20 able to describe your intellectual abilities as they are today rather = than as=20 they were when you were much younger.

Should I submit = more=20 than two teacher recommendations?

We only require two. = However,=20 if you'd like to send additional teacher recommendations, they should = provide=20 new information and speak directly to your ability to do demanding = college-level=20 work or scientific research.

Do you accept = supplementary=20 recommendation letters?
Yes. If you have conducted = research, we=20 strongly encourage you to submit a letter of recommendation from your = mentor.=20 You also may submit other recommendation letters if they add information = to your=20 application that we would have not otherwise = known.

Can=20 recommenders send the recommendations via = email?
Recommendation=20 letters should be submitted either via the online Common Application or = via=20 regular mail. We do not accept letters of recommendation via=20 e-mail.

Do you accept research = papers?
Yes.=20 If you have research experience in math, science, or engineering, you = are=20 welcome to submit a copy of any research paper or report you have = written.=20 Papers must be submitted as a PDF file and e-mailed to:=20 papers@admissions.caltech.edu. Please clearly mark your = full=20 name and birth date on your submission. To assure consideration, papers = should=20 be submitted no later than the application deadline. Papers that do not = have=20 your name and birth date clearly indicated on the first page may not be=20 considered.

Do you accept music CDs, art slides, or = other=20 materials?
If you would like to submit additional = materials=20 (CDs, music, written submissions, or art samples) you may mail them to = our=20 office postmarked by our admission deadline. Please note that we may not = always=20 use supplemental materials in our evaluation process but sometimes find = them=20 helpful. All supplementary materials should be clearly labeled with your = full=20 name and date of birth.

Early Action

Who should apply under Early Action (vs. = Regular=20 Decision)?
Students should consider applying under = Early Action=20 if they:
  • Can demonstrate strong academic preparation and achievement, = without the=20 benefit of senior-year first semester grades
  • Have taken all required standardized tests by the October test = date;=20 and/or
  • Want to apply for the Medical Scholars = Program
Is there=20 an advantage to applying Early Action?
You get an = earlier=20 reply, but there is no strategic advantage or disadvantage to applying = Early=20 Action. Our Early Action program is non-binding, and students admitted = under it=20 will have until May 1, like all other admitted students, to decide on=20 matriculation.

What happens if a student is not = admitted=20 Early Action?

Students can be denied or held over to = the=20 Regular Decision round. Those who are held over will be reevaluated and = receive=20 a decision at the same time as Regular Decision=20 candidates.

If I am denied Early Action, can I = reapply=20 Regular Decision?

No. You can only apply once during an = admissions cycle. If you are denied admission Early Action, you must = wait one=20 full year and reapply for admission (as a freshman or=20 transfer).

What is the percentage of students who are = typically held over to Regular Decision?

While it = varies from=20 year to year, approximately 40% of our Early Action applicants were held = for=20 consideration during the Regular Decision round. In 2007, just over 16% = of those=20 held over were ultimately offered admission.

If you = are held=20 over to Regular Decision, are you at a disadvantage compared to the = applicants=20 who only applied Regular Decision?
No. There is no=20 disadvantage.

Special Programs and Circumstances

What is the Medical Scholars=20 Program?

It is an eight-year BS/MD program in which = students=20 first earn an undergraduate degree at Caltech and then pursue a medical = degree=20 at the University of California, San Diego, Medical School.=20

How do I apply to the Medical Scholars=20 Program?

You must complete a Caltech application by the = Early=20 Action deadline, indicating an interest in the program. If you are = admitted to=20 Caltech early, you will be instructed to submit another essay and = recommendation=20 letter; both should detail your interest in medicine. You may then be = selected=20 for an interview and then for a place in the=20 program.

Can students apply to Caltech = before senior=20 year, without having finished high school?
Yes. A high = school=20 diploma is not required for admission to Caltech. We have a number of = such=20 candidates each year, and we evaluate them exactly as we do four-year = high=20 school students, expecting a comparable high-school=20 preparation.

I'm an international applicant - Is any = part of=20 the application process different?

The application = process is=20 nearly identical. We expect the application, transcripts, and = recommendation=20 letters to be in English or translated into English. =

If I am=20 an international student who needs financial aid, will this hurt my = chances for=20 admission?
Because of the limited financial aid for=20 international students, a family's ability to pay Caltech's tuition and = fees is=20 a consideration in our admission decisions. Twenty-two international = students=20 admitted to Caltech last year were offered some form of financial = assistance.=20 Because a student cannot receive financial aid if they apply for = admission=20 indicating that they do not need financial assistance it is imperative = that=20 those students needing financial assistance apply for financial aid = despite the=20 increased competition for admission.

Admissions = Decisions

Who evaluates freshman = applications?
The=20 Freshman Admissions Committee is responsible for admitting the freshman = class to=20 Caltech. The committee is composed of admissions staff, faculty, and=20 undergraduate students.

How are decisions=20 made?

The Freshman Admissions Committee devotes = substantial=20 time and resources to the evaluation of applications for each freshman = class.=20 Each application is read by a regional admissions counselor and then = routed to=20 the director of admissions or to the faculty and students for = evaluation. All of=20 these evaluations conclude with a written summary of the file. At this = point,=20 either a final decision is made based on these evaluations or the = application is=20 further considered by a committee made up of admissions staff, faculty, = and=20 students before a final decision is made.

What is the = most=20 important part of the admissions process?

The focus of = the=20 Admissions Committee is to admit students on the basis of significant = potential=20 in mathematics, science, and engineering. There is no single academic or = personal profile of students who have such potential. In particular, = there is no=20 specific SAT score or grade-point average that ensures or precludes = freshman=20 applicants from gaining admission. All of the components of the freshman = application contain important information regarding academic potential, = and all=20 affect the chances of admission. Prospective applicants should note, = however,=20 that they have control over the quality of two parts of their freshman=20 application in particular: the rigor of the courses selected in the = context of=20 the school curriculum and the application essays. Applicants would do = well to=20 treat these as especially important parts of the admission process - by = choosing=20 to enroll in an appropriately rigorous course of study and by submitting = thoughtful and carefully written essays.

How = important are=20 test scores?
Test scores matter, but are always = evaluated in=20 the context of the whole application, including curriculum, grades,=20 recommendations, and essays. Test scores alone do not determine a = student's=20 admission decision, and small differences in scores are insignificant.=20

How many students apply?

There were = 3,952=20 applicants for the class of 2012.

How many students = are=20 admitted?
688 students were offered admission to the = class of=20 2012.

How many students are wait-listed and then = admitted=20 from the waiting list?
Approximately 540 students were = offered=20 a place on the waiting list for the class of 2012. Approximately 20 = students=20 were offered admission from the waiting list.

Do you = rank=20 high schools?
No. We evaluate each applicant in the = context of=20 the opportunities and resources specifically=20 available.

Admissions Policy

Is it=20 harder for me to get in if there are a lot of applicants from my high=20 school?
No. We neither read nor evaluate applications = in any=20 sort of grouping. Each application is considered individually against = the entire=20 pool. Our goal is to admit the best possible class; therefore, we may = admit all,=20 some, or none of the students from any particular high=20 school.

Do I have an advantage if I'm from=20 California?

No. Caltech is a private institution , so = it=20 doesn't matter which state a student comes from. We work to ensure that = we have=20 a geographically diverse applicant pool, but we don't consider geography = when=20 making decisions.

Financial Aid


Is Caltech = need-blind in=20 admissions?
Caltech is need-blind for all U.S. citizens = and=20 permanent residents and need-sensitive for international=20 students.

Do you give athletic=20 scholarships?
As an NCAA Division III institution, we = are not=20 permitted to offer athletic scholarships.

Do you = offer merit=20 scholarships?
In order to strengthen our need-based = financial=20 aid program even further, we will be redirecting our freshman = merit-based=20 scholarship programs to our need-based financial aid program, effective = with the=20 class that will enter in September 2009.

Transfer = Admissions

When are = applications=20 available?
The freshman application becomes available = on July 1=20 of each year. The transfer and 3/2 applications are generally available = by=20 September 1.

When is the transfer exam=20 available?
Transfer exams are made available to your = selected=20 proctor after March 1.

How can I study for the = transfer=20 exam?
We recommend that students review the content of = areas=20 covered in Caltech core physics and math courses. See Transfer=20 Applicants for more information.

What courses = should I=20 take at my current school to prepare for Caltech?

A = strong=20 background in physics and math is necessary to do well on the transfer = exams.=20 Otherwise we would recommend any rigorous course of study that = emphasizes math,=20 science, and engineering courses.

For which courses = does=20 Caltech offer transfer credits?

Transfer credits are = determined=20 on an individual basis by the faculty at the time of enrollment. It is = not=20 possible for us to advise students about credit transfer before they = arrive on=20 campus.



 

Caltech Undergraduate Admissions
1200 = E.=20 California Blvd MC 1-94 Pasadena CA = 91125
626 395=20 6341
ugadmissions@caltech.edu
------=_NextPart_000_0078_01CA0A00.0A0B4930 Content-Type: image/gif Content-Transfer-Encoding: base64 Content-Location: http://www.admissions.caltech.edu/images/blank.gif R0lGODlhAQABAJH/AP///wAAAMDAwAAAACH5BAEAAAIALAAAAAABAAEAQAICVAEAOw== ------=_NextPart_000_0078_01CA0A00.0A0B4930 Content-Type: application/octet-stream Content-Transfer-Encoding: quoted-printable Content-Location: http://www.admissions.caltech.edu/stylesheets/admissions.css?1181865834 #debug { POSITION: absolute; BACKGROUND: white; TOP: 40px; RIGHT: 0px } BODY { PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: = 0px; BACKGROUND: white; FONT-SIZE: 90%; PADDING-TOP: 0px } #centering_container { TEXT-ALIGN: center } #container { POSITION: relative; TEXT-ALIGN: left; PADDING-BOTTOM: 0px; MARGIN: = auto; PADDING-LEFT: 0px; WIDTH: 740px; PADDING-RIGHT: 0px; PADDING-TOP: = 0px } #pageHeader H1 { DISPLAY: none } #pageHeader H2 { DISPLAY: none } #pageHeader { WIDTH: 740px; BACKGROUND: url(/images/header.gif) no-repeat; HEIGHT: = 102px } #linkList { BACKGROUND-IMAGE: url(/images/nav-top.gif); POSITION: absolute; WIDTH: = 190px; BACKGROUND-REPEAT: no-repeat; BACKGROUND-POSITION: 50% top; = FLOAT: left; TOP: 96px; LEFT: 0px } #linkList2 { BACKGROUND-IMAGE: url(/images/nav-middle.gif); POSITION: relative; = PADDING-BOTTOM: 0px; MARGIN-TOP: 20px; PADDING-LEFT: 0px; PADDING-RIGHT: = 0px; TOP: 10px; PADDING-TOP: 0px } #lresources { BACKGROUND-IMAGE: url(/images/nav-bottom.gif); PADDING-BOTTOM: 20px; = BACKGROUND-REPEAT: no-repeat; BACKGROUND-POSITION: 50% bottom; = MARGIN-BOTTOM: 0px } #linkList UL { LIST-STYLE-TYPE: none; MARGIN-TOP: 3px; PADDING-LEFT: 38px; = PADDING-RIGHT: 2px; FONT-FAMILY: courier; MARGIN-LEFT: 0px; = LIST-STYLE-IMAGE: none } #linkList UL.sublist { MARGIN-TOP: 3px; PADDING-LEFT: 2em; FONT-FAMILY: courier; MARGIN-LEFT: = 0px; FONT-SIZE: 86%; LIST-STYLE-IMAGE: url(/images/dash.gif) } #linkList LI { MARGIN-TOP: 1em } #linkList UL.sublist LI { MARGIN-TOP: 0.3em } #linkList A { BORDER-BOTTOM: 0px; COLOR: #4a4a4a; FONT-WEIGHT: normal; = TEXT-DECORATION: none } #linkList A:visited { BORDER-BOTTOM: 0px; COLOR: #4a4a4a; FONT-WEIGHT: normal; = TEXT-DECORATION: none } #linkList B { COLOR: #41412d; FONT-WEIGHT: bold } #linkList A:hover { BORDER-BOTTOM: 0px; COLOR: #000 } #mininav { BACKGROUND-IMAGE: url(/images/mininav-top.gif); WIDTH: 190px; = BACKGROUND-REPEAT: no-repeat; FONT-FAMILY: courier; BACKGROUND-POSITION: = 50% top; COLOR: #67674b; FONT-SIZE: 86%; PADDING-TOP: 27px } #mininav_content { BACKGROUND-IMAGE: url(/images/mininav-middle.gif) } #mininav_bottom { BACKGROUND-IMAGE: url(/images/mininav-bottom.gif); PADDING-BOTTOM: = 20px; BACKGROUND-REPEAT: no-repeat; BACKGROUND-POSITION: 50% bottom; = MARGIN-BOTTOM: 20px } #mininav UL { LIST-STYLE-TYPE: none; MARGIN-TOP: 3px; PADDING-LEFT: 40px; = PADDING-RIGHT: 35px; FONT-FAMILY: courier; MARGIN-LEFT: 0px; = LIST-STYLE-IMAGE: none } #mininav LI { MARGIN-TOP: 0.75em } #content { WIDTH: 580px; FONT-FAMILY: verdana; MARGIN-LEFT: 200px; FONT-SIZE: 90% } #subpage_content { WIDTH: 580px; FONT-FAMILY: verdana; MARGIN-LEFT: 200px; FONT-SIZE: 90% } #content A { COLOR: #cc3300; TEXT-DECORATION: none } #subpage_content A { COLOR: #cc3300; TEXT-DECORATION: none } #content A:hover { BORDER-BOTTOM: 1px dotted; COLOR: #cc3300; TEXT-DECORATION: none } #subpage_content A:hover { BORDER-BOTTOM: 1px dotted; COLOR: #cc3300; TEXT-DECORATION: none } H3 { PADDING-LEFT: 22px; FONT-FAMILY: courier; COLOR: #ff5300; FONT-SIZE: = 195%; FONT-WEIGHT: bold } H2 { FONT-FAMILY: verdana; COLOR: #333333; FONT-SIZE: 100%; FONT-WEIGHT: = bold } H1 { FONT-FAMILY: verdana; COLOR: #333333; FONT-SIZE: 100%; FONT-WEIGHT: = bold } STRONG { COLOR: #333333 } .bold_orange { COLOR: #ff5300; FONT-WEIGHT: bold } #latest_news { MIN-HEIGHT: 600px; PADDING-LEFT: 22px; PADDING-RIGHT: 110px } #homepage_news P { PADDING-LEFT: 15px; PADDING-RIGHT: 110px } TABLE { FONT-FAMILY: verdana; FONT-SIZE: small } .TopRight { PADDING-BOTTOM: 15px; PADDING-LEFT: 15px; PADDING-RIGHT: 0px; FLOAT: = right; PADDING-TOP: 0px } .Bottom { PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 15px; = PADDING-TOP: 15px } .MiddleLeft { PADDING-BOTTOM: 15px; PADDING-LEFT: 0px; PADDING-RIGHT: 15px; FLOAT: = left; PADDING-TOP: 8px } .Left { PADDING-BOTTOM: 3px; PADDING-LEFT: 0px; PADDING-RIGHT: 15px; FLOAT: = left; PADDING-TOP: 3px } .MiddleRight { PADDING-BOTTOM: 15px; PADDING-LEFT: 15px; PADDING-RIGHT: 0px; FLOAT: = right; PADDING-TOP: 15px } .BottomRight { PADDING-BOTTOM: 0px; PADDING-LEFT: 15px; PADDING-RIGHT: 0px; FLOAT: = right; PADDING-TOP: 15px } #footer { BACKGROUND-IMAGE: url(/images/footer-top.gif); TEXT-ALIGN: right; = WIDTH: 386px; BACKGROUND-REPEAT: no-repeat; FONT-FAMILY: courier; = BACKGROUND-POSITION: 50% top; FLOAT: right; COLOR: #4a4a4a; FONT-SIZE: = 90% } #footer_content { BACKGROUND-IMAGE: url(/images/footer-bottom.gif); PADDING-BOTTOM: 20px; = MIN-HEIGHT: 40px; PADDING-LEFT: 10px; PADDING-RIGHT: 20px; = BACKGROUND-REPEAT: no-repeat; BACKGROUND-POSITION: 50% bottom; = MARGIN-BOTTOM: 0px; PADDING-TOP: 20px } #footer A { COLOR: #474723; FONT-WEIGHT: normal; TEXT-DECORATION: underline } #footer A:hover { COLOR: #41412d; FONT-WEIGHT: bold; TEXT-DECORATION: underline } .destination_category { BORDER-BOTTOM: #70743c 2px solid; PADDING-BOTTOM: 0.5em; MARGIN-TOP: = 2em; PADDING-LEFT: 0.5em; PADDING-RIGHT: 0.5em; BACKGROUND: #cdcd97; = FONT-SIZE: 110%; BORDER-TOP: #70743c 2px solid; FONT-WEIGHT: bold; = PADDING-TOP: 0.5em } .destination_title { FONT-WEIGHT: bold; PADDING-TOP: 1em } .destination_description { PADDING-TOP: 0.2em } .boxes { align: right } .walking { BACKGROUND: #747730; MARGIN-LEFT: 260px } .walking:hover { BACKGROUND: #888d19 } .walking_selected { BACKGROUND: #888d19 } .short-drive { BACKGROUND: #cfa24e; MARGIN-LEFT: 295px } .short-drive:hover { BACKGROUND: #e99a37 } .short-drive_selected { BACKGROUND: #e99a37 } .one-day { BACKGROUND: #c2ba41; MARGIN-LEFT: 330px } .one-day:hover { BACKGROUND: #d8d433 } .one-day_selected { BACKGROUND: #d8d433 } .weekend { BACKGROUND: #ca9d31; MARGIN-LEFT: 365px } .weekend:hover { BACKGROUND: #e4a716 } .weekend_selected { BACKGROUND: #e4a716 } .west-coast { BACKGROUND: #a6a539; MARGIN-LEFT: 400px } .west-coast:hover { BACKGROUND: #a4b523 } .west-coast_selected { BACKGROUND: #a4b523 } .box { BORDER-BOTTOM: #cdcd97 0px solid; POSITION: absolute; BORDER-LEFT: = #cdcd97 3px solid; MARGIN-TOP: -24px; WIDTH: 30px; HEIGHT: 31px; = BORDER-TOP: #cdcd97 0px solid; BORDER-RIGHT: #cdcd97 2px solid } .box:hover { CURSOR: pointer } .hover_pointer { CURSOR: pointer } .rollover_text { POSITION: relative; TEXT-ALIGN: right; WIDTH: 450px; HEIGHT: 30px; TOP: = 40px } .fieldWithErrors { PADDING-BOTTOM: 2px; BACKGROUND-COLOR: red; PADDING-LEFT: 2px; = PADDING-RIGHT: 2px; DISPLAY: table; PADDING-TOP: 2px } #errorExplanation { BORDER-BOTTOM: red 2px solid; BORDER-LEFT: red 2px solid; = PADDING-BOTTOM: 12px; BACKGROUND-COLOR: #f0f0f0; PADDING-LEFT: 7px; = PADDING-RIGHT: 7px; MARGIN-BOTTOM: 20px; BORDER-TOP: red 2px solid; = BORDER-RIGHT: red 2px solid; PADDING-TOP: 7px } #errorExplanation H2 { TEXT-ALIGN: left; PADDING-BOTTOM: 5px; BACKGROUND-COLOR: #c00; MARGIN: = -7px; PADDING-LEFT: 15px; PADDING-RIGHT: 5px; COLOR: #fff; FONT-SIZE: = 12px; FONT-WEIGHT: bold; PADDING-TOP: 5px } #errorExplanation P { PADDING-BOTTOM: 5px; PADDING-LEFT: 5px; PADDING-RIGHT: 5px; = MARGIN-BOTTOM: 0px; COLOR: #333; PADDING-TOP: 5px } #errorExplanation UL LI { LIST-STYLE-TYPE: square; FONT-SIZE: 12px } DIV.uploadStatus { MARGIN: 5px } DIV.progressBar { MARGIN: 5px } DIV.progressBar DIV.border { BORDER-BOTTOM: grey 1px solid; BORDER-LEFT: grey 1px solid; = BACKGROUND-COLOR: #fff; WIDTH: 100%; BORDER-TOP: grey 1px solid; = BORDER-RIGHT: grey 1px solid } DIV.progressBar DIV.background { BACKGROUND-COLOR: #333; WIDTH: 0%; HEIGHT: 18px } ------=_NextPart_000_0078_01CA0A00.0A0B4930 Content-Type: application/octet-stream Content-Transfer-Encoding: quoted-printable Content-Location: http://www.admissions.caltech.edu/javascripts/prototype.js?1170291493 /* Prototype JavaScript framework, version 1.5.0_rc0=0A= * (c) 2005 Sam Stephenson =0A= *=0A= * Prototype is freely distributable under the terms of an MIT-style = license.=0A= * For details, see the Prototype web site: http://prototype.conio.net/=0A= *=0A= /*-----------------------------------------------------------------------= ---*/=0A= =0A= var Prototype =3D {=0A= Version: '1.5.0_rc0',=0A= ScriptFragment: '(?:)((\n|\r|.)*?)(?:<\/script>)',=0A= =0A= emptyFunction: function() {},=0A= K: function(x) {return x}=0A= }=0A= =0A= var Class =3D {=0A= create: function() {=0A= return function() {=0A= this.initialize.apply(this, arguments);=0A= }=0A= }=0A= }=0A= =0A= var Abstract =3D new Object();=0A= =0A= Object.extend =3D function(destination, source) {=0A= for (var property in source) {=0A= destination[property] =3D source[property];=0A= }=0A= return destination;=0A= }=0A= =0A= Object.inspect =3D function(object) {=0A= try {=0A= if (object =3D=3D undefined) return 'undefined';=0A= if (object =3D=3D null) return 'null';=0A= return object.inspect ? object.inspect() : object.toString();=0A= } catch (e) {=0A= if (e instanceof RangeError) return '...';=0A= throw e;=0A= }=0A= }=0A= =0A= Function.prototype.bind =3D function() {=0A= var __method =3D this, args =3D $A(arguments), object =3D args.shift();=0A= return function() {=0A= return __method.apply(object, args.concat($A(arguments)));=0A= }=0A= }=0A= =0A= Function.prototype.bindAsEventListener =3D function(object) {=0A= var __method =3D this;=0A= return function(event) {=0A= return __method.call(object, event || window.event);=0A= }=0A= }=0A= =0A= Object.extend(Number.prototype, {=0A= toColorPart: function() {=0A= var digits =3D this.toString(16);=0A= if (this < 16) return '0' + digits;=0A= return digits;=0A= },=0A= =0A= succ: function() {=0A= return this + 1;=0A= },=0A= =0A= times: function(iterator) {=0A= $R(0, this, true).each(iterator);=0A= return this;=0A= }=0A= });=0A= =0A= var Try =3D {=0A= these: function() {=0A= var returnValue;=0A= =0A= for (var i =3D 0; i < arguments.length; i++) {=0A= var lambda =3D arguments[i];=0A= try {=0A= returnValue =3D lambda();=0A= break;=0A= } catch (e) {}=0A= }=0A= =0A= return returnValue;=0A= }=0A= }=0A= =0A= /*-----------------------------------------------------------------------= ---*/=0A= =0A= var PeriodicalExecuter =3D Class.create();=0A= PeriodicalExecuter.prototype =3D {=0A= initialize: function(callback, frequency) {=0A= this.callback =3D callback;=0A= this.frequency =3D frequency;=0A= this.currentlyExecuting =3D false;=0A= =0A= this.registerCallback();=0A= },=0A= =0A= registerCallback: function() {=0A= setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);=0A= },=0A= =0A= onTimerEvent: function() {=0A= if (!this.currentlyExecuting) {=0A= try {=0A= this.currentlyExecuting =3D true;=0A= this.callback();=0A= } finally {=0A= this.currentlyExecuting =3D false;=0A= }=0A= }=0A= }=0A= }=0A= Object.extend(String.prototype, {=0A= gsub: function(pattern, replacement) {=0A= var result =3D '', source =3D this, match;=0A= replacement =3D arguments.callee.prepareReplacement(replacement);=0A= =0A= while (source.length > 0) {=0A= if (match =3D source.match(pattern)) {=0A= result +=3D source.slice(0, match.index);=0A= result +=3D (replacement(match) || '').toString();=0A= source =3D source.slice(match.index + match[0].length);=0A= } else {=0A= result +=3D source, source =3D '';=0A= }=0A= }=0A= return result;=0A= },=0A= =0A= sub: function(pattern, replacement, count) {=0A= replacement =3D this.gsub.prepareReplacement(replacement);=0A= count =3D count =3D=3D=3D undefined ? 1 : count;=0A= =0A= return this.gsub(pattern, function(match) {=0A= if (--count < 0) return match[0];=0A= return replacement(match);=0A= });=0A= },=0A= =0A= scan: function(pattern, iterator) {=0A= this.gsub(pattern, iterator);=0A= return this;=0A= },=0A= =0A= truncate: function(length, truncation) {=0A= length =3D length || 30;=0A= truncation =3D truncation =3D=3D=3D undefined ? '...' : truncation;=0A= return this.length > length ?=0A= this.slice(0, length - truncation.length) + truncation : this;=0A= },=0A= =0A= strip: function() {=0A= return this.replace(/^\s+/, '').replace(/\s+$/, '');=0A= },=0A= =0A= stripTags: function() {=0A= return this.replace(/<\/?[^>]+>/gi, '');=0A= },=0A= =0A= stripScripts: function() {=0A= return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');=0A= },=0A= =0A= extractScripts: function() {=0A= var matchAll =3D new RegExp(Prototype.ScriptFragment, 'img');=0A= var matchOne =3D new RegExp(Prototype.ScriptFragment, 'im');=0A= return (this.match(matchAll) || []).map(function(scriptTag) {=0A= return (scriptTag.match(matchOne) || ['', ''])[1];=0A= });=0A= },=0A= =0A= evalScripts: function() {=0A= return this.extractScripts().map(function(script) { return = eval(script) });=0A= },=0A= =0A= escapeHTML: function() {=0A= var div =3D document.createElement('div');=0A= var text =3D document.createTextNode(this);=0A= div.appendChild(text);=0A= return div.innerHTML;=0A= },=0A= =0A= unescapeHTML: function() {=0A= var div =3D document.createElement('div');=0A= div.innerHTML =3D this.stripTags();=0A= return div.childNodes[0] ? div.childNodes[0].nodeValue : '';=0A= },=0A= =0A= toQueryParams: function() {=0A= var pairs =3D this.match(/^\??(.*)$/)[1].split('&');=0A= return pairs.inject({}, function(params, pairString) {=0A= var pair =3D pairString.split('=3D');=0A= params[pair[0]] =3D pair[1];=0A= return params;=0A= });=0A= },=0A= =0A= toArray: function() {=0A= return this.split('');=0A= },=0A= =0A= camelize: function() {=0A= var oStringList =3D this.split('-');=0A= if (oStringList.length =3D=3D 1) return oStringList[0];=0A= =0A= var camelizedString =3D this.indexOf('-') =3D=3D 0=0A= ? oStringList[0].charAt(0).toUpperCase() + = oStringList[0].substring(1)=0A= : oStringList[0];=0A= =0A= for (var i =3D 1, len =3D oStringList.length; i < len; i++) {=0A= var s =3D oStringList[i];=0A= camelizedString +=3D s.charAt(0).toUpperCase() + s.substring(1);=0A= }=0A= =0A= return camelizedString;=0A= },=0A= =0A= inspect: function() {=0A= return "'" + this.replace(/\\/g, '\\\\').replace(/'/g, '\\\'') + "'";=0A= }=0A= });=0A= =0A= String.prototype.gsub.prepareReplacement =3D function(replacement) {=0A= if (typeof replacement =3D=3D 'function') return replacement;=0A= var template =3D new Template(replacement);=0A= return function(match) { return template.evaluate(match) };=0A= }=0A= =0A= String.prototype.parseQuery =3D String.prototype.toQueryParams;=0A= =0A= var Template =3D Class.create();=0A= Template.Pattern =3D /(^|.|\r|\n)(#\{(.*?)\})/;=0A= Template.prototype =3D {=0A= initialize: function(template, pattern) {=0A= this.template =3D template.toString();=0A= this.pattern =3D pattern || Template.Pattern;=0A= },=0A= =0A= evaluate: function(object) {=0A= return this.template.gsub(this.pattern, function(match) {=0A= var before =3D match[1];=0A= if (before =3D=3D '\\') return match[2];=0A= return before + (object[match[3]] || '').toString();=0A= });=0A= }=0A= }=0A= =0A= var $break =3D new Object();=0A= var $continue =3D new Object();=0A= =0A= var Enumerable =3D {=0A= each: function(iterator) {=0A= var index =3D 0;=0A= try {=0A= this._each(function(value) {=0A= try {=0A= iterator(value, index++);=0A= } catch (e) {=0A= if (e !=3D $continue) throw e;=0A= }=0A= });=0A= } catch (e) {=0A= if (e !=3D $break) throw e;=0A= }=0A= },=0A= =0A= all: function(iterator) {=0A= var result =3D true;=0A= this.each(function(value, index) {=0A= result =3D result && !!(iterator || Prototype.K)(value, index);=0A= if (!result) throw $break;=0A= });=0A= return result;=0A= },=0A= =0A= any: function(iterator) {=0A= var result =3D true;=0A= this.each(function(value, index) {=0A= if (result =3D !!(iterator || Prototype.K)(value, index))=0A= throw $break;=0A= });=0A= return result;=0A= },=0A= =0A= collect: function(iterator) {=0A= var results =3D [];=0A= this.each(function(value, index) {=0A= results.push(iterator(value, index));=0A= });=0A= return results;=0A= },=0A= =0A= detect: function (iterator) {=0A= var result;=0A= this.each(function(value, index) {=0A= if (iterator(value, index)) {=0A= result =3D value;=0A= throw $break;=0A= }=0A= });=0A= return result;=0A= },=0A= =0A= findAll: function(iterator) {=0A= var results =3D [];=0A= this.each(function(value, index) {=0A= if (iterator(value, index))=0A= results.push(value);=0A= });=0A= return results;=0A= },=0A= =0A= grep: function(pattern, iterator) {=0A= var results =3D [];=0A= this.each(function(value, index) {=0A= var stringValue =3D value.toString();=0A= if (stringValue.match(pattern))=0A= results.push((iterator || Prototype.K)(value, index));=0A= })=0A= return results;=0A= },=0A= =0A= include: function(object) {=0A= var found =3D false;=0A= this.each(function(value) {=0A= if (value =3D=3D object) {=0A= found =3D true;=0A= throw $break;=0A= }=0A= });=0A= return found;=0A= },=0A= =0A= inject: function(memo, iterator) {=0A= this.each(function(value, index) {=0A= memo =3D iterator(memo, value, index);=0A= });=0A= return memo;=0A= },=0A= =0A= invoke: function(method) {=0A= var args =3D $A(arguments).slice(1);=0A= return this.collect(function(value) {=0A= return value[method].apply(value, args);=0A= });=0A= },=0A= =0A= max: function(iterator) {=0A= var result;=0A= this.each(function(value, index) {=0A= value =3D (iterator || Prototype.K)(value, index);=0A= if (result =3D=3D undefined || value >=3D result)=0A= result =3D value;=0A= });=0A= return result;=0A= },=0A= =0A= min: function(iterator) {=0A= var result;=0A= this.each(function(value, index) {=0A= value =3D (iterator || Prototype.K)(value, index);=0A= if (result =3D=3D undefined || value < result)=0A= result =3D value;=0A= });=0A= return result;=0A= },=0A= =0A= partition: function(iterator) {=0A= var trues =3D [], falses =3D [];=0A= this.each(function(value, index) {=0A= ((iterator || Prototype.K)(value, index) ?=0A= trues : falses).push(value);=0A= });=0A= return [trues, falses];=0A= },=0A= =0A= pluck: function(property) {=0A= var results =3D [];=0A= this.each(function(value, index) {=0A= results.push(value[property]);=0A= });=0A= return results;=0A= },=0A= =0A= reject: function(iterator) {=0A= var results =3D [];=0A= this.each(function(value, index) {=0A= if (!iterator(value, index))=0A= results.push(value);=0A= });=0A= return results;=0A= },=0A= =0A= sortBy: function(iterator) {=0A= return this.collect(function(value, index) {=0A= return {value: value, criteria: iterator(value, index)};=0A= }).sort(function(left, right) {=0A= var a =3D left.criteria, b =3D right.criteria;=0A= return a < b ? -1 : a > b ? 1 : 0;=0A= }).pluck('value');=0A= },=0A= =0A= toArray: function() {=0A= return this.collect(Prototype.K);=0A= },=0A= =0A= zip: function() {=0A= var iterator =3D Prototype.K, args =3D $A(arguments);=0A= if (typeof args.last() =3D=3D 'function')=0A= iterator =3D args.pop();=0A= =0A= var collections =3D [this].concat(args).map($A);=0A= return this.map(function(value, index) {=0A= return iterator(collections.pluck(index));=0A= });=0A= },=0A= =0A= inspect: function() {=0A= return '#';=0A= }=0A= }=0A= =0A= Object.extend(Enumerable, {=0A= map: Enumerable.collect,=0A= find: Enumerable.detect,=0A= select: Enumerable.findAll,=0A= member: Enumerable.include,=0A= entries: Enumerable.toArray=0A= });=0A= var $A =3D Array.from =3D function(iterable) {=0A= if (!iterable) return [];=0A= if (iterable.toArray) {=0A= return iterable.toArray();=0A= } else {=0A= var results =3D [];=0A= for (var i =3D 0; i < iterable.length; i++)=0A= results.push(iterable[i]);=0A= return results;=0A= }=0A= }=0A= =0A= Object.extend(Array.prototype, Enumerable);=0A= =0A= if (!Array.prototype._reverse)=0A= Array.prototype._reverse =3D Array.prototype.reverse;=0A= =0A= Object.extend(Array.prototype, {=0A= _each: function(iterator) {=0A= for (var i =3D 0; i < this.length; i++)=0A= iterator(this[i]);=0A= },=0A= =0A= clear: function() {=0A= this.length =3D 0;=0A= return this;=0A= },=0A= =0A= first: function() {=0A= return this[0];=0A= },=0A= =0A= last: function() {=0A= return this[this.length - 1];=0A= },=0A= =0A= compact: function() {=0A= return this.select(function(value) {=0A= return value !=3D undefined || value !=3D null;=0A= });=0A= },=0A= =0A= flatten: function() {=0A= return this.inject([], function(array, value) {=0A= return array.concat(value && value.constructor =3D=3D Array ?=0A= value.flatten() : [value]);=0A= });=0A= },=0A= =0A= without: function() {=0A= var values =3D $A(arguments);=0A= return this.select(function(value) {=0A= return !values.include(value);=0A= });=0A= },=0A= =0A= indexOf: function(object) {=0A= for (var i =3D 0; i < this.length; i++)=0A= if (this[i] =3D=3D object) return i;=0A= return -1;=0A= },=0A= =0A= reverse: function(inline) {=0A= return (inline !=3D=3D false ? this : this.toArray())._reverse();=0A= },=0A= =0A= inspect: function() {=0A= return '[' + this.map(Object.inspect).join(', ') + ']';=0A= }=0A= });=0A= var Hash =3D {=0A= _each: function(iterator) {=0A= for (var key in this) {=0A= var value =3D this[key];=0A= if (typeof value =3D=3D 'function') continue;=0A= =0A= var pair =3D [key, value];=0A= pair.key =3D key;=0A= pair.value =3D value;=0A= iterator(pair);=0A= }=0A= },=0A= =0A= keys: function() {=0A= return this.pluck('key');=0A= },=0A= =0A= values: function() {=0A= return this.pluck('value');=0A= },=0A= =0A= merge: function(hash) {=0A= return $H(hash).inject($H(this), function(mergedHash, pair) {=0A= mergedHash[pair.key] =3D pair.value;=0A= return mergedHash;=0A= });=0A= },=0A= =0A= toQueryString: function() {=0A= return this.map(function(pair) {=0A= return pair.map(encodeURIComponent).join('=3D');=0A= }).join('&');=0A= },=0A= =0A= inspect: function() {=0A= return '#';=0A= }=0A= }=0A= =0A= function $H(object) {=0A= var hash =3D Object.extend({}, object || {});=0A= Object.extend(hash, Enumerable);=0A= Object.extend(hash, Hash);=0A= return hash;=0A= }=0A= ObjectRange =3D Class.create();=0A= Object.extend(ObjectRange.prototype, Enumerable);=0A= Object.extend(ObjectRange.prototype, {=0A= initialize: function(start, end, exclusive) {=0A= this.start =3D start;=0A= this.end =3D end;=0A= this.exclusive =3D exclusive;=0A= },=0A= =0A= _each: function(iterator) {=0A= var value =3D this.start;=0A= do {=0A= iterator(value);=0A= value =3D value.succ();=0A= } while (this.include(value));=0A= },=0A= =0A= include: function(value) {=0A= if (value < this.start)=0A= return false;=0A= if (this.exclusive)=0A= return value < this.end;=0A= return value <=3D this.end;=0A= }=0A= });=0A= =0A= var $R =3D function(start, end, exclusive) {=0A= return new ObjectRange(start, end, exclusive);=0A= }=0A= =0A= var Ajax =3D {=0A= getTransport: function() {=0A= return Try.these(=0A= function() {return new XMLHttpRequest()},=0A= function() {return new ActiveXObject('Msxml2.XMLHTTP')},=0A= function() {return new ActiveXObject('Microsoft.XMLHTTP')}=0A= ) || false;=0A= },=0A= =0A= activeRequestCount: 0=0A= }=0A= =0A= Ajax.Responders =3D {=0A= responders: [],=0A= =0A= _each: function(iterator) {=0A= this.responders._each(iterator);=0A= },=0A= =0A= register: function(responderToAdd) {=0A= if (!this.include(responderToAdd))=0A= this.responders.push(responderToAdd);=0A= },=0A= =0A= unregister: function(responderToRemove) {=0A= this.responders =3D this.responders.without(responderToRemove);=0A= },=0A= =0A= dispatch: function(callback, request, transport, json) {=0A= this.each(function(responder) {=0A= if (responder[callback] && typeof responder[callback] =3D=3D = 'function') {=0A= try {=0A= responder[callback].apply(responder, [request, transport, = json]);=0A= } catch (e) {}=0A= }=0A= });=0A= }=0A= };=0A= =0A= Object.extend(Ajax.Responders, Enumerable);=0A= =0A= Ajax.Responders.register({=0A= onCreate: function() {=0A= Ajax.activeRequestCount++;=0A= },=0A= =0A= onComplete: function() {=0A= Ajax.activeRequestCount--;=0A= }=0A= });=0A= =0A= Ajax.Base =3D function() {};=0A= Ajax.Base.prototype =3D {=0A= setOptions: function(options) {=0A= this.options =3D {=0A= method: 'post',=0A= asynchronous: true,=0A= contentType: 'application/x-www-form-urlencoded',=0A= parameters: ''=0A= }=0A= Object.extend(this.options, options || {});=0A= },=0A= =0A= responseIsSuccess: function() {=0A= return this.transport.status =3D=3D undefined=0A= || this.transport.status =3D=3D 0=0A= || (this.transport.status >=3D 200 && this.transport.status < = 300);=0A= },=0A= =0A= responseIsFailure: function() {=0A= return !this.responseIsSuccess();=0A= }=0A= }=0A= =0A= Ajax.Request =3D Class.create();=0A= Ajax.Request.Events =3D=0A= ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];=0A= =0A= Ajax.Request.prototype =3D Object.extend(new Ajax.Base(), {=0A= initialize: function(url, options) {=0A= this.transport =3D Ajax.getTransport();=0A= this.setOptions(options);=0A= this.request(url);=0A= },=0A= =0A= request: function(url) {=0A= var parameters =3D this.options.parameters || '';=0A= if (parameters.length > 0) parameters +=3D '&_=3D';=0A= =0A= try {=0A= this.url =3D url;=0A= if (this.options.method =3D=3D 'get' && parameters.length > 0)=0A= this.url +=3D (this.url.match(/\?/) ? '&' : '?') + parameters;=0A= =0A= Ajax.Responders.dispatch('onCreate', this, this.transport);=0A= =0A= this.transport.open(this.options.method, this.url,=0A= this.options.asynchronous);=0A= =0A= if (this.options.asynchronous) {=0A= this.transport.onreadystatechange =3D = this.onStateChange.bind(this);=0A= setTimeout((function() = {this.respondToReadyState(1)}).bind(this), 10);=0A= }=0A= =0A= this.setRequestHeaders();=0A= =0A= var body =3D this.options.postBody ? this.options.postBody : = parameters;=0A= this.transport.send(this.options.method =3D=3D 'post' ? body : = null);=0A= =0A= } catch (e) {=0A= this.dispatchException(e);=0A= }=0A= },=0A= =0A= setRequestHeaders: function() {=0A= var requestHeaders =3D=0A= ['X-Requested-With', 'XMLHttpRequest',=0A= 'X-Prototype-Version', Prototype.Version,=0A= 'Accept', 'text/javascript, text/html, application/xml, text/xml, = */*'];=0A= =0A= if (this.options.method =3D=3D 'post') {=0A= requestHeaders.push('Content-type', this.options.contentType);=0A= =0A= /* Force "Connection: close" for Mozilla browsers to work around=0A= * a bug where XMLHttpReqeuest sends an incorrect Content-length=0A= * header. See Mozilla Bugzilla #246651.=0A= */=0A= if (this.transport.overrideMimeType)=0A= requestHeaders.push('Connection', 'close');=0A= }=0A= =0A= if (this.options.requestHeaders)=0A= requestHeaders.push.apply(requestHeaders, = this.options.requestHeaders);=0A= =0A= for (var i =3D 0; i < requestHeaders.length; i +=3D 2)=0A= this.transport.setRequestHeader(requestHeaders[i], = requestHeaders[i+1]);=0A= },=0A= =0A= onStateChange: function() {=0A= var readyState =3D this.transport.readyState;=0A= if (readyState !=3D 1)=0A= this.respondToReadyState(this.transport.readyState);=0A= },=0A= =0A= header: function(name) {=0A= try {=0A= return this.transport.getResponseHeader(name);=0A= } catch (e) {}=0A= },=0A= =0A= evalJSON: function() {=0A= try {=0A= return eval('(' + this.header('X-JSON') + ')');=0A= } catch (e) {}=0A= },=0A= =0A= evalResponse: function() {=0A= try {=0A= return eval(this.transport.responseText);=0A= } catch (e) {=0A= this.dispatchException(e);=0A= }=0A= },=0A= =0A= respondToReadyState: function(readyState) {=0A= var event =3D Ajax.Request.Events[readyState];=0A= var transport =3D this.transport, json =3D this.evalJSON();=0A= =0A= if (event =3D=3D 'Complete') {=0A= try {=0A= (this.options['on' + this.transport.status]=0A= || this.options['on' + (this.responseIsSuccess() ? 'Success' : = 'Failure')]=0A= || Prototype.emptyFunction)(transport, json);=0A= } catch (e) {=0A= this.dispatchException(e);=0A= }=0A= =0A= if ((this.header('Content-type') || = '').match(/^text\/javascript/i))=0A= this.evalResponse();=0A= }=0A= =0A= try {=0A= (this.options['on' + event] || Prototype.emptyFunction)(transport, = json);=0A= Ajax.Responders.dispatch('on' + event, this, transport, json);=0A= } catch (e) {=0A= this.dispatchException(e);=0A= }=0A= =0A= /* Avoid memory leak in MSIE: clean up the oncomplete event handler = */=0A= if (event =3D=3D 'Complete')=0A= this.transport.onreadystatechange =3D Prototype.emptyFunction;=0A= },=0A= =0A= dispatchException: function(exception) {=0A= (this.options.onException || Prototype.emptyFunction)(this, = exception);=0A= Ajax.Responders.dispatch('onException', this, exception);=0A= }=0A= });=0A= =0A= Ajax.Updater =3D Class.create();=0A= =0A= Object.extend(Object.extend(Ajax.Updater.prototype, = Ajax.Request.prototype), {=0A= initialize: function(container, url, options) {=0A= this.containers =3D {=0A= success: container.success ? $(container.success) : $(container),=0A= failure: container.failure ? $(container.failure) :=0A= (container.success ? null : $(container))=0A= }=0A= =0A= this.transport =3D Ajax.getTransport();=0A= this.setOptions(options);=0A= =0A= var onComplete =3D this.options.onComplete || = Prototype.emptyFunction;=0A= this.options.onComplete =3D (function(transport, object) {=0A= this.updateContent();=0A= onComplete(transport, object);=0A= }).bind(this);=0A= =0A= this.request(url);=0A= },=0A= =0A= updateContent: function() {=0A= var receiver =3D this.responseIsSuccess() ?=0A= this.containers.success : this.containers.failure;=0A= var response =3D this.transport.responseText;=0A= =0A= if (!this.options.evalScripts)=0A= response =3D response.stripScripts();=0A= =0A= if (receiver) {=0A= if (this.options.insertion) {=0A= new this.options.insertion(receiver, response);=0A= } else {=0A= Element.update(receiver, response);=0A= }=0A= }=0A= =0A= if (this.responseIsSuccess()) {=0A= if (this.onComplete)=0A= setTimeout(this.onComplete.bind(this), 10);=0A= }=0A= }=0A= });=0A= =0A= Ajax.PeriodicalUpdater =3D Class.create();=0A= Ajax.PeriodicalUpdater.prototype =3D Object.extend(new Ajax.Base(), {=0A= initialize: function(container, url, options) {=0A= this.setOptions(options);=0A= this.onComplete =3D this.options.onComplete;=0A= =0A= this.frequency =3D (this.options.frequency || 2);=0A= this.decay =3D (this.options.decay || 1);=0A= =0A= this.updater =3D {};=0A= this.container =3D container;=0A= this.url =3D url;=0A= =0A= this.start();=0A= },=0A= =0A= start: function() {=0A= this.options.onComplete =3D this.updateComplete.bind(this);=0A= this.onTimerEvent();=0A= },=0A= =0A= stop: function() {=0A= this.updater.onComplete =3D undefined;=0A= clearTimeout(this.timer);=0A= (this.onComplete || Prototype.emptyFunction).apply(this, arguments);=0A= },=0A= =0A= updateComplete: function(request) {=0A= if (this.options.decay) {=0A= this.decay =3D (request.responseText =3D=3D this.lastText ?=0A= this.decay * this.options.decay : 1);=0A= =0A= this.lastText =3D request.responseText;=0A= }=0A= this.timer =3D setTimeout(this.onTimerEvent.bind(this),=0A= this.decay * this.frequency * 1000);=0A= },=0A= =0A= onTimerEvent: function() {=0A= this.updater =3D new Ajax.Updater(this.container, this.url, = this.options);=0A= }=0A= });=0A= function $() {=0A= var results =3D [], element;=0A= for (var i =3D 0; i < arguments.length; i++) {=0A= element =3D arguments[i];=0A= if (typeof element =3D=3D 'string')=0A= element =3D document.getElementById(element);=0A= results.push(Element.extend(element));=0A= }=0A= return results.length < 2 ? results[0] : results;=0A= }=0A= =0A= document.getElementsByClassName =3D function(className, parentElement) {=0A= var children =3D ($(parentElement) || = document.body).getElementsByTagName('*');=0A= return $A(children).inject([], function(elements, child) {=0A= if (child.className.match(new RegExp("(^|\\s)" + className + = "(\\s|$)")))=0A= elements.push(Element.extend(child));=0A= return elements;=0A= });=0A= }=0A= =0A= /*-----------------------------------------------------------------------= ---*/=0A= =0A= if (!window.Element)=0A= var Element =3D new Object();=0A= =0A= Element.extend =3D function(element) {=0A= if (!element) return;=0A= if (_nativeExtensions) return element;=0A= =0A= if (!element._extended && element.tagName && element !=3D window) {=0A= var methods =3D Element.Methods, cache =3D Element.extend.cache;=0A= for (property in methods) {=0A= var value =3D methods[property];=0A= if (typeof value =3D=3D 'function')=0A= element[property] =3D cache.findOrStore(value);=0A= }=0A= }=0A= =0A= element._extended =3D true;=0A= return element;=0A= }=0A= =0A= Element.extend.cache =3D {=0A= findOrStore: function(value) {=0A= return this[value] =3D this[value] || function() {=0A= return value.apply(null, [this].concat($A(arguments)));=0A= }=0A= }=0A= }=0A= =0A= Element.Methods =3D {=0A= visible: function(element) {=0A= return $(element).style.display !=3D 'none';=0A= },=0A= =0A= toggle: function() {=0A= for (var i =3D 0; i < arguments.length; i++) {=0A= var element =3D $(arguments[i]);=0A= Element[Element.visible(element) ? 'hide' : 'show'](element);=0A= }=0A= },=0A= =0A= hide: function() {=0A= for (var i =3D 0; i < arguments.length; i++) {=0A= var element =3D $(arguments[i]);=0A= element.style.display =3D 'none';=0A= }=0A= },=0A= =0A= show: function() {=0A= for (var i =3D 0; i < arguments.length; i++) {=0A= var element =3D $(arguments[i]);=0A= element.style.display =3D '';=0A= }=0A= },=0A= =0A= remove: function(element) {=0A= element =3D $(element);=0A= element.parentNode.removeChild(element);=0A= },=0A= =0A= update: function(element, html) {=0A= $(element).innerHTML =3D html.stripScripts();=0A= setTimeout(function() {html.evalScripts()}, 10);=0A= },=0A= =0A= replace: function(element, html) {=0A= element =3D $(element);=0A= if (element.outerHTML) {=0A= element.outerHTML =3D html.stripScripts();=0A= } else {=0A= var range =3D element.ownerDocument.createRange();=0A= range.selectNodeContents(element);=0A= element.parentNode.replaceChild(=0A= range.createContextualFragment(html.stripScripts()), element);=0A= }=0A= setTimeout(function() {html.evalScripts()}, 10);=0A= },=0A= =0A= getHeight: function(element) {=0A= element =3D $(element);=0A= return element.offsetHeight;=0A= },=0A= =0A= classNames: function(element) {=0A= return new Element.ClassNames(element);=0A= },=0A= =0A= hasClassName: function(element, className) {=0A= if (!(element =3D $(element))) return;=0A= return Element.classNames(element).include(className);=0A= },=0A= =0A= addClassName: function(element, className) {=0A= if (!(element =3D $(element))) return;=0A= return Element.classNames(element).add(className);=0A= },=0A= =0A= removeClassName: function(element, className) {=0A= if (!(element =3D $(element))) return;=0A= return Element.classNames(element).remove(className);=0A= },=0A= =0A= // removes whitespace-only text node children=0A= cleanWhitespace: function(element) {=0A= element =3D $(element);=0A= for (var i =3D 0; i < element.childNodes.length; i++) {=0A= var node =3D element.childNodes[i];=0A= if (node.nodeType =3D=3D 3 && !/\S/.test(node.nodeValue))=0A= Element.remove(node);=0A= }=0A= },=0A= =0A= empty: function(element) {=0A= return $(element).innerHTML.match(/^\s*$/);=0A= },=0A= =0A= childOf: function(element, ancestor) {=0A= element =3D $(element), ancestor =3D $(ancestor);=0A= while (element =3D element.parentNode)=0A= if (element =3D=3D ancestor) return true;=0A= return false;=0A= },=0A= =0A= scrollTo: function(element) {=0A= element =3D $(element);=0A= var x =3D element.x ? element.x : element.offsetLeft,=0A= y =3D element.y ? element.y : element.offsetTop;=0A= window.scrollTo(x, y);=0A= },=0A= =0A= getStyle: function(element, style) {=0A= element =3D $(element);=0A= var value =3D element.style[style.camelize()];=0A= if (!value) {=0A= if (document.defaultView && document.defaultView.getComputedStyle) = {=0A= var css =3D document.defaultView.getComputedStyle(element, null);=0A= value =3D css ? css.getPropertyValue(style) : null;=0A= } else if (element.currentStyle) {=0A= value =3D element.currentStyle[style.camelize()];=0A= }=0A= }=0A= =0A= if (window.opera && ['left', 'top', 'right', = 'bottom'].include(style))=0A= if (Element.getStyle(element, 'position') =3D=3D 'static') value = =3D 'auto';=0A= =0A= return value =3D=3D 'auto' ? null : value;=0A= },=0A= =0A= setStyle: function(element, style) {=0A= element =3D $(element);=0A= for (var name in style)=0A= element.style[name.camelize()] =3D style[name];=0A= },=0A= =0A= getDimensions: function(element) {=0A= element =3D $(element);=0A= if (Element.getStyle(element, 'display') !=3D 'none')=0A= return {width: element.offsetWidth, height: element.offsetHeight};=0A= =0A= // All *Width and *Height properties give 0 on elements with display = none,=0A= // so enable the element temporarily=0A= var els =3D element.style;=0A= var originalVisibility =3D els.visibility;=0A= var originalPosition =3D els.position;=0A= els.visibility =3D 'hidden';=0A= els.position =3D 'absolute';=0A= els.display =3D '';=0A= var originalWidth =3D element.clientWidth;=0A= var originalHeight =3D element.clientHeight;=0A= els.display =3D 'none';=0A= els.position =3D originalPosition;=0A= els.visibility =3D originalVisibility;=0A= return {width: originalWidth, height: originalHeight};=0A= },=0A= =0A= makePositioned: function(element) {=0A= element =3D $(element);=0A= var pos =3D Element.getStyle(element, 'position');=0A= if (pos =3D=3D 'static' || !pos) {=0A= element._madePositioned =3D true;=0A= element.style.position =3D 'relative';=0A= // Opera returns the offset relative to the positioning context, = when an=0A= // element is position relative but top and left have not been = defined=0A= if (window.opera) {=0A= element.style.top =3D 0;=0A= element.style.left =3D 0;=0A= }=0A= }=0A= },=0A= =0A= undoPositioned: function(element) {=0A= element =3D $(element);=0A= if (element._madePositioned) {=0A= element._madePositioned =3D undefined;=0A= element.style.position =3D=0A= element.style.top =3D=0A= element.style.left =3D=0A= element.style.bottom =3D=0A= element.style.right =3D '';=0A= }=0A= },=0A= =0A= makeClipping: function(element) {=0A= element =3D $(element);=0A= if (element._overflow) return;=0A= element._overflow =3D element.style.overflow;=0A= if ((Element.getStyle(element, 'overflow') || 'visible') !=3D = 'hidden')=0A= element.style.overflow =3D 'hidden';=0A= },=0A= =0A= undoClipping: function(element) {=0A= element =3D $(element);=0A= if (element._overflow) return;=0A= element.style.overflow =3D element._overflow;=0A= element._overflow =3D undefined;=0A= }=0A= }=0A= =0A= Object.extend(Element, Element.Methods);=0A= =0A= var _nativeExtensions =3D false;=0A= =0A= if(!HTMLElement && /Konqueror|Safari|KHTML/.test(navigator.userAgent)) {=0A= var HTMLElement =3D {}=0A= HTMLElement.prototype =3D document.createElement('div').__proto__;=0A= }=0A= =0A= Element.addMethods =3D function(methods) {=0A= Object.extend(Element.Methods, methods || {});=0A= =0A= if(typeof HTMLElement !=3D 'undefined') {=0A= var methods =3D Element.Methods, cache =3D Element.extend.cache;=0A= for (property in methods) {=0A= var value =3D methods[property];=0A= if (typeof value =3D=3D 'function')=0A= HTMLElement.prototype[property] =3D cache.findOrStore(value);=0A= }=0A= _nativeExtensions =3D true;=0A= }=0A= }=0A= =0A= Element.addMethods();=0A= =0A= var Toggle =3D new Object();=0A= Toggle.display =3D Element.toggle;=0A= =0A= /*-----------------------------------------------------------------------= ---*/=0A= =0A= Abstract.Insertion =3D function(adjacency) {=0A= this.adjacency =3D adjacency;=0A= }=0A= =0A= Abstract.Insertion.prototype =3D {=0A= initialize: function(element, content) {=0A= this.element =3D $(element);=0A= this.content =3D content.stripScripts();=0A= =0A= if (this.adjacency && this.element.insertAdjacentHTML) {=0A= try {=0A= this.element.insertAdjacentHTML(this.adjacency, this.content);=0A= } catch (e) {=0A= var tagName =3D this.element.tagName.toLowerCase();=0A= if (tagName =3D=3D 'tbody' || tagName =3D=3D 'tr') {=0A= this.insertContent(this.contentFromAnonymousTable());=0A= } else {=0A= throw e;=0A= }=0A= }=0A= } else {=0A= this.range =3D this.element.ownerDocument.createRange();=0A= if (this.initializeRange) this.initializeRange();=0A= = this.insertContent([this.range.createContextualFragment(this.content)]);=0A= }=0A= =0A= setTimeout(function() {content.evalScripts()}, 10);=0A= },=0A= =0A= contentFromAnonymousTable: function() {=0A= var div =3D document.createElement('div');=0A= div.innerHTML =3D '' + this.content + = '
';=0A= return $A(div.childNodes[0].childNodes[0].childNodes);=0A= }=0A= }=0A= =0A= var Insertion =3D new Object();=0A= =0A= Insertion.Before =3D Class.create();=0A= Insertion.Before.prototype =3D Object.extend(new = Abstract.Insertion('beforeBegin'), {=0A= initializeRange: function() {=0A= this.range.setStartBefore(this.element);=0A= },=0A= =0A= insertContent: function(fragments) {=0A= fragments.each((function(fragment) {=0A= this.element.parentNode.insertBefore(fragment, this.element);=0A= }).bind(this));=0A= }=0A= });=0A= =0A= Insertion.Top =3D Class.create();=0A= Insertion.Top.prototype =3D Object.extend(new = Abstract.Insertion('afterBegin'), {=0A= initializeRange: function() {=0A= this.range.selectNodeContents(this.element);=0A= this.range.collapse(true);=0A= },=0A= =0A= insertContent: function(fragments) {=0A= fragments.reverse(false).each((function(fragment) {=0A= this.element.insertBefore(fragment, this.element.firstChild);=0A= }).bind(this));=0A= }=0A= });=0A= =0A= Insertion.Bottom =3D Class.create();=0A= Insertion.Bottom.prototype =3D Object.extend(new = Abstract.Insertion('beforeEnd'), {=0A= initializeRange: function() {=0A= this.range.selectNodeContents(this.element);=0A= this.range.collapse(this.element);=0A= },=0A= =0A= insertContent: function(fragments) {=0A= fragments.each((function(fragment) {=0A= this.element.appendChild(fragment);=0A= }).bind(this));=0A= }=0A= });=0A= =0A= Insertion.After =3D Class.create();=0A= Insertion.After.prototype =3D Object.extend(new = Abstract.Insertion('afterEnd'), {=0A= initializeRange: function() {=0A= this.range.setStartAfter(this.element);=0A= },=0A= =0A= insertContent: function(fragments) {=0A= fragments.each((function(fragment) {=0A= this.element.parentNode.insertBefore(fragment,=0A= this.element.nextSibling);=0A= }).bind(this));=0A= }=0A= });=0A= =0A= /*-----------------------------------------------------------------------= ---*/=0A= =0A= Element.ClassNames =3D Class.create();=0A= Element.ClassNames.prototype =3D {=0A= initialize: function(element) {=0A= this.element =3D $(element);=0A= },=0A= =0A= _each: function(iterator) {=0A= this.element.className.split(/\s+/).select(function(name) {=0A= return name.length > 0;=0A= })._each(iterator);=0A= },=0A= =0A= set: function(className) {=0A= this.element.className =3D className;=0A= },=0A= =0A= add: function(classNameToAdd) {=0A= if (this.include(classNameToAdd)) return;=0A= this.set(this.toArray().concat(classNameToAdd).join(' '));=0A= },=0A= =0A= remove: function(classNameToRemove) {=0A= if (!this.include(classNameToRemove)) return;=0A= this.set(this.select(function(className) {=0A= return className !=3D classNameToRemove;=0A= }).join(' '));=0A= },=0A= =0A= toString: function() {=0A= return this.toArray().join(' ');=0A= }=0A= }=0A= =0A= Object.extend(Element.ClassNames.prototype, Enumerable);=0A= var Selector =3D Class.create();=0A= Selector.prototype =3D {=0A= initialize: function(expression) {=0A= this.params =3D {classNames: []};=0A= this.expression =3D expression.toString().strip();=0A= this.parseExpression();=0A= this.compileMatcher();=0A= },=0A= =0A= parseExpression: function() {=0A= function abort(message) { throw 'Parse error in selector: ' + = message; }=0A= =0A= if (this.expression =3D=3D '') abort('empty expression');=0A= =0A= var params =3D this.params, expr =3D this.expression, match, = modifier, clause, rest;=0A= while (match =3D = expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=3D)(?:"([^"]*)"|([^\]\s]*))= )?\]$/i)) {=0A= params.attributes =3D params.attributes || [];=0A= params.attributes.push({name: match[2], operator: match[3], value: = match[4] || match[5] || ''});=0A= expr =3D match[1];=0A= }=0A= =0A= if (expr =3D=3D '*') return this.params.wildcard =3D true;=0A= =0A= while (match =3D expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)) {=0A= modifier =3D match[1], clause =3D match[2], rest =3D match[3];=0A= switch (modifier) {=0A= case '#': params.id =3D clause; break;=0A= case '.': params.classNames.push(clause); break;=0A= case '':=0A= case undefined: params.tagName =3D clause.toUpperCase(); break;=0A= default: abort(expr.inspect());=0A= }=0A= expr =3D rest;=0A= }=0A= =0A= if (expr.length > 0) abort(expr.inspect());=0A= },=0A= =0A= buildMatchExpression: function() {=0A= var params =3D this.params, conditions =3D [], clause;=0A= =0A= if (params.wildcard)=0A= conditions.push('true');=0A= if (clause =3D params.id)=0A= conditions.push('element.id =3D=3D ' + clause.inspect());=0A= if (clause =3D params.tagName)=0A= conditions.push('element.tagName.toUpperCase() =3D=3D ' + = clause.inspect());=0A= if ((clause =3D params.classNames).length > 0)=0A= for (var i =3D 0; i < clause.length; i++)=0A= conditions.push('Element.hasClassName(element, ' + = clause[i].inspect() + ')');=0A= if (clause =3D params.attributes) {=0A= clause.each(function(attribute) {=0A= var value =3D 'element.getAttribute(' + attribute.name.inspect() = + ')';=0A= var splitValueBy =3D function(delimiter) {=0A= return value + ' && ' + value + '.split(' + = delimiter.inspect() + ')';=0A= }=0A= =0A= switch (attribute.operator) {=0A= case '=3D': conditions.push(value + ' =3D=3D ' + = attribute.value.inspect()); break;=0A= case '~=3D': conditions.push(splitValueBy(' ') + = '.include(' + attribute.value.inspect() + ')'); break;=0A= case '|=3D': conditions.push(=0A= splitValueBy('-') + '.first().toUpperCase() = =3D=3D ' + attribute.value.toUpperCase().inspect()=0A= ); break;=0A= case '!=3D': conditions.push(value + ' !=3D ' + = attribute.value.inspect()); break;=0A= case '':=0A= case undefined: conditions.push(value + ' !=3D null'); break;=0A= default: throw 'Unknown operator ' + attribute.operator = + ' in selector';=0A= }=0A= });=0A= }=0A= =0A= return conditions.join(' && ');=0A= },=0A= =0A= compileMatcher: function() {=0A= this.match =3D new Function('element', 'if (!element.tagName) return = false; \=0A= return ' + this.buildMatchExpression());=0A= },=0A= =0A= findElements: function(scope) {=0A= var element;=0A= =0A= if (element =3D $(this.params.id))=0A= if (this.match(element))=0A= if (!scope || Element.childOf(element, scope))=0A= return [element];=0A= =0A= scope =3D (scope || = document).getElementsByTagName(this.params.tagName || '*');=0A= =0A= var results =3D [];=0A= for (var i =3D 0; i < scope.length; i++)=0A= if (this.match(element =3D scope[i]))=0A= results.push(Element.extend(element));=0A= =0A= return results;=0A= },=0A= =0A= toString: function() {=0A= return this.expression;=0A= }=0A= }=0A= =0A= function $$() {=0A= return $A(arguments).map(function(expression) {=0A= return expression.strip().split(/\s+/).inject([null], = function(results, expr) {=0A= var selector =3D new Selector(expr);=0A= return results.map(selector.findElements.bind(selector)).flatten();=0A= });=0A= }).flatten();=0A= }=0A= var Field =3D {=0A= clear: function() {=0A= for (var i =3D 0; i < arguments.length; i++)=0A= $(arguments[i]).value =3D '';=0A= },=0A= =0A= focus: function(element) {=0A= $(element).focus();=0A= },=0A= =0A= present: function() {=0A= for (var i =3D 0; i < arguments.length; i++)=0A= if ($(arguments[i]).value =3D=3D '') return false;=0A= return true;=0A= },=0A= =0A= select: function(element) {=0A= $(element).select();=0A= },=0A= =0A= activate: function(element) {=0A= element =3D $(element);=0A= element.focus();=0A= if (element.select)=0A= element.select();=0A= }=0A= }=0A= =0A= /*-----------------------------------------------------------------------= ---*/=0A= =0A= var Form =3D {=0A= serialize: function(form) {=0A= var elements =3D Form.getElements($(form));=0A= var queryComponents =3D new Array();=0A= =0A= for (var i =3D 0; i < elements.length; i++) {=0A= var queryComponent =3D Form.Element.serialize(elements[i]);=0A= if (queryComponent)=0A= queryComponents.push(queryComponent);=0A= }=0A= =0A= return queryComponents.join('&');=0A= },=0A= =0A= getElements: function(form) {=0A= form =3D $(form);=0A= var elements =3D new Array();=0A= =0A= for (var tagName in Form.Element.Serializers) {=0A= var tagElements =3D form.getElementsByTagName(tagName);=0A= for (var j =3D 0; j < tagElements.length; j++)=0A= elements.push(tagElements[j]);=0A= }=0A= return elements;=0A= },=0A= =0A= getInputs: function(form, typeName, name) {=0A= form =3D $(form);=0A= var inputs =3D form.getElementsByTagName('input');=0A= =0A= if (!typeName && !name)=0A= return inputs;=0A= =0A= var matchingInputs =3D new Array();=0A= for (var i =3D 0; i < inputs.length; i++) {=0A= var input =3D inputs[i];=0A= if ((typeName && input.type !=3D typeName) ||=0A= (name && input.name !=3D name))=0A= continue;=0A= matchingInputs.push(input);=0A= }=0A= =0A= return matchingInputs;=0A= },=0A= =0A= disable: function(form) {=0A= var elements =3D Form.getElements(form);=0A= for (var i =3D 0; i < elements.length; i++) {=0A= var element =3D elements[i];=0A= element.blur();=0A= element.disabled =3D 'true';=0A= }=0A= },=0A= =0A= enable: function(form) {=0A= var elements =3D Form.getElements(form);=0A= for (var i =3D 0; i < elements.length; i++) {=0A= var element =3D elements[i];=0A= element.disabled =3D '';=0A= }=0A= },=0A= =0A= findFirstElement: function(form) {=0A= return Form.getElements(form).find(function(element) {=0A= return element.type !=3D 'hidden' && !element.disabled &&=0A= ['input', 'select', = 'textarea'].include(element.tagName.toLowerCase());=0A= });=0A= },=0A= =0A= focusFirstElement: function(form) {=0A= Field.activate(Form.findFirstElement(form));=0A= },=0A= =0A= reset: function(form) {=0A= $(form).reset();=0A= }=0A= }=0A= =0A= Form.Element =3D {=0A= serialize: function(element) {=0A= element =3D $(element);=0A= var method =3D element.tagName.toLowerCase();=0A= var parameter =3D Form.Element.Serializers[method](element);=0A= =0A= if (parameter) {=0A= var key =3D encodeURIComponent(parameter[0]);=0A= if (key.length =3D=3D 0) return;=0A= =0A= if (parameter[1].constructor !=3D Array)=0A= parameter[1] =3D [parameter[1]];=0A= =0A= return parameter[1].map(function(value) {=0A= return key + '=3D' + encodeURIComponent(value);=0A= }).join('&');=0A= }=0A= },=0A= =0A= getValue: function(element) {=0A= element =3D $(element);=0A= var method =3D element.tagName.toLowerCase();=0A= var parameter =3D Form.Element.Serializers[method](element);=0A= =0A= if (parameter)=0A= return parameter[1];=0A= }=0A= }=0A= =0A= Form.Element.Serializers =3D {=0A= input: function(element) {=0A= switch (element.type.toLowerCase()) {=0A= case 'submit':=0A= case 'hidden':=0A= case 'password':=0A= case 'text':=0A= return Form.Element.Serializers.textarea(element);=0A= case 'checkbox':=0A= case 'radio':=0A= return Form.Element.Serializers.inputSelector(element);=0A= }=0A= return false;=0A= },=0A= =0A= inputSelector: function(element) {=0A= if (element.checked)=0A= return [element.name, element.value];=0A= },=0A= =0A= textarea: function(element) {=0A= return [element.name, element.value];=0A= },=0A= =0A= select: function(element) {=0A= return Form.Element.Serializers[element.type =3D=3D 'select-one' ?=0A= 'selectOne' : 'selectMany'](element);=0A= },=0A= =0A= selectOne: function(element) {=0A= var value =3D '', opt, index =3D element.selectedIndex;=0A= if (index >=3D 0) {=0A= opt =3D element.options[index];=0A= value =3D opt.value || opt.text;=0A= }=0A= return [element.name, value];=0A= },=0A= =0A= selectMany: function(element) {=0A= var value =3D [];=0A= for (var i =3D 0; i < element.length; i++) {=0A= var opt =3D element.options[i];=0A= if (opt.selected)=0A= value.push(opt.value || opt.text);=0A= }=0A= return [element.name, value];=0A= }=0A= }=0A= =0A= /*-----------------------------------------------------------------------= ---*/=0A= =0A= var $F =3D Form.Element.getValue;=0A= =0A= /*-----------------------------------------------------------------------= ---*/=0A= =0A= Abstract.TimedObserver =3D function() {}=0A= Abstract.TimedObserver.prototype =3D {=0A= initialize: function(element, frequency, callback) {=0A= this.frequency =3D frequency;=0A= this.element =3D $(element);=0A= this.callback =3D callback;=0A= =0A= this.lastValue =3D this.getValue();=0A= this.registerCallback();=0A= },=0A= =0A= registerCallback: function() {=0A= setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);=0A= },=0A= =0A= onTimerEvent: function() {=0A= var value =3D this.getValue();=0A= if (this.lastValue !=3D value) {=0A= this.callback(this.element, value);=0A= this.lastValue =3D value;=0A= }=0A= }=0A= }=0A= =0A= Form.Element.Observer =3D Class.create();=0A= Form.Element.Observer.prototype =3D Object.extend(new = Abstract.TimedObserver(), {=0A= getValue: function() {=0A= return Form.Element.getValue(this.element);=0A= }=0A= });=0A= =0A= Form.Observer =3D Class.create();=0A= Form.Observer.prototype =3D Object.extend(new Abstract.TimedObserver(), {=0A= getValue: function() {=0A= return Form.serialize(this.element);=0A= }=0A= });=0A= =0A= /*-----------------------------------------------------------------------= ---*/=0A= =0A= Abstract.EventObserver =3D function() {}=0A= Abstract.EventObserver.prototype =3D {=0A= initialize: function(element, callback) {=0A= this.element =3D $(element);=0A= this.callback =3D callback;=0A= =0A= this.lastValue =3D this.getValue();=0A= if (this.element.tagName.toLowerCase() =3D=3D 'form')=0A= this.registerFormCallbacks();=0A= else=0A= this.registerCallback(this.element);=0A= },=0A= =0A= onElementEvent: function() {=0A= var value =3D this.getValue();=0A= if (this.lastValue !=3D value) {=0A= this.callback(this.element, value);=0A= this.lastValue =3D value;=0A= }=0A= },=0A= =0A= registerFormCallbacks: function() {=0A= var elements =3D Form.getElements(this.element);=0A= for (var i =3D 0; i < elements.length; i++)=0A= this.registerCallback(elements[i]);=0A= },=0A= =0A= registerCallback: function(element) {=0A= if (element.type) {=0A= switch (element.type.toLowerCase()) {=0A= case 'checkbox':=0A= case 'radio':=0A= Event.observe(element, 'click', = this.onElementEvent.bind(this));=0A= break;=0A= case 'password':=0A= case 'text':=0A= case 'textarea':=0A= case 'select-one':=0A= case 'select-multiple':=0A= Event.observe(element, 'change', = this.onElementEvent.bind(this));=0A= break;=0A= }=0A= }=0A= }=0A= }=0A= =0A= Form.Element.EventObserver =3D Class.create();=0A= Form.Element.EventObserver.prototype =3D Object.extend(new = Abstract.EventObserver(), {=0A= getValue: function() {=0A= return Form.Element.getValue(this.element);=0A= }=0A= });=0A= =0A= Form.EventObserver =3D Class.create();=0A= Form.EventObserver.prototype =3D Object.extend(new = Abstract.EventObserver(), {=0A= getValue: function() {=0A= return Form.serialize(this.element);=0A= }=0A= });=0A= if (!window.Event) {=0A= var Event =3D new Object();=0A= }=0A= =0A= Object.extend(Event, {=0A= KEY_BACKSPACE: 8,=0A= KEY_TAB: 9,=0A= KEY_RETURN: 13,=0A= KEY_ESC: 27,=0A= KEY_LEFT: 37,=0A= KEY_UP: 38,=0A= KEY_RIGHT: 39,=0A= KEY_DOWN: 40,=0A= KEY_DELETE: 46,=0A= =0A= element: function(event) {=0A= return event.target || event.srcElement;=0A= },=0A= =0A= isLeftClick: function(event) {=0A= return (((event.which) && (event.which =3D=3D 1)) ||=0A= ((event.button) && (event.button =3D=3D 1)));=0A= },=0A= =0A= pointerX: function(event) {=0A= return event.pageX || (event.clientX +=0A= (document.documentElement.scrollLeft || document.body.scrollLeft));=0A= },=0A= =0A= pointerY: function(event) {=0A= return event.pageY || (event.clientY +=0A= (document.documentElement.scrollTop || document.body.scrollTop));=0A= },=0A= =0A= stop: function(event) {=0A= if (event.preventDefault) {=0A= event.preventDefault();=0A= event.stopPropagation();=0A= } else {=0A= event.returnValue =3D false;=0A= event.cancelBubble =3D true;=0A= }=0A= },=0A= =0A= // find the first node with the given tagName, starting from the=0A= // node the event was triggered on; traverses the DOM upwards=0A= findElement: function(event, tagName) {=0A= var element =3D Event.element(event);=0A= while (element.parentNode && (!element.tagName ||=0A= (element.tagName.toUpperCase() !=3D tagName.toUpperCase())))=0A= element =3D element.parentNode;=0A= return element;=0A= },=0A= =0A= observers: false,=0A= =0A= _observeAndCache: function(element, name, observer, useCapture) {=0A= if (!this.observers) this.observers =3D [];=0A= if (element.addEventListener) {=0A= this.observers.push([element, name, observer, useCapture]);=0A= element.addEventListener(name, observer, useCapture);=0A= } else if (element.attachEvent) {=0A= this.observers.push([element, name, observer, useCapture]);=0A= element.attachEvent('on' + name, observer);=0A= }=0A= },=0A= =0A= unloadCache: function() {=0A= if (!Event.observers) return;=0A= for (var i =3D 0; i < Event.observers.length; i++) {=0A= Event.stopObserving.apply(this, Event.observers[i]);=0A= Event.observers[i][0] =3D null;=0A= }=0A= Event.observers =3D false;=0A= },=0A= =0A= observe: function(element, name, observer, useCapture) {=0A= var element =3D $(element);=0A= useCapture =3D useCapture || false;=0A= =0A= if (name =3D=3D 'keypress' &&=0A= (navigator.appVersion.match(/Konqueror|Safari|KHTML/)=0A= || element.attachEvent))=0A= name =3D 'keydown';=0A= =0A= this._observeAndCache(element, name, observer, useCapture);=0A= },=0A= =0A= stopObserving: function(element, name, observer, useCapture) {=0A= var element =3D $(element);=0A= useCapture =3D useCapture || false;=0A= =0A= if (name =3D=3D 'keypress' &&=0A= (navigator.appVersion.match(/Konqueror|Safari|KHTML/)=0A= || element.detachEvent))=0A= name =3D 'keydown';=0A= =0A= if (element.removeEventListener) {=0A= element.removeEventListener(name, observer, useCapture);=0A= } else if (element.detachEvent) {=0A= element.detachEvent('on' + name, observer);=0A= }=0A= }=0A= });=0A= =0A= /* prevent memory leaks in IE */=0A= if (navigator.appVersion.match(/\bMSIE\b/))=0A= Event.observe(window, 'unload', Event.unloadCache, false);=0A= var Position =3D {=0A= // set to true if needed, warning: firefox performance problems=0A= // NOT neeeded for page scrolling, only if draggable contained in=0A= // scrollable elements=0A= includeScrollOffsets: false,=0A= =0A= // must be called before calling withinIncludingScrolloffset, every = time the=0A= // page is scrolled=0A= prepare: function() {=0A= this.deltaX =3D window.pageXOffset=0A= || document.documentElement.scrollLeft=0A= || document.body.scrollLeft=0A= || 0;=0A= this.deltaY =3D window.pageYOffset=0A= || document.documentElement.scrollTop=0A= || document.body.scrollTop=0A= || 0;=0A= },=0A= =0A= realOffset: function(element) {=0A= var valueT =3D 0, valueL =3D 0;=0A= do {=0A= valueT +=3D element.scrollTop || 0;=0A= valueL +=3D element.scrollLeft || 0;=0A= element =3D element.parentNode;=0A= } while (element);=0A= return [valueL, valueT];=0A= },=0A= =0A= cumulativeOffset: function(element) {=0A= var valueT =3D 0, valueL =3D 0;=0A= do {=0A= valueT +=3D element.offsetTop || 0;=0A= valueL +=3D element.offsetLeft || 0;=0A= element =3D element.offsetParent;=0A= } while (element);=0A= return [valueL, valueT];=0A= },=0A= =0A= positionedOffset: function(element) {=0A= var valueT =3D 0, valueL =3D 0;=0A= do {=0A= valueT +=3D element.offsetTop || 0;=0A= valueL +=3D element.offsetLeft || 0;=0A= element =3D element.offsetParent;=0A= if (element) {=0A= p =3D Element.getStyle(element, 'position');=0A= if (p =3D=3D 'relative' || p =3D=3D 'absolute') break;=0A= }=0A= } while (element);=0A= return [valueL, valueT];=0A= },=0A= =0A= offsetParent: function(element) {=0A= if (element.offsetParent) return element.offsetParent;=0A= if (element =3D=3D document.body) return element;=0A= =0A= while ((element =3D element.parentNode) && element !=3D = document.body)=0A= if (Element.getStyle(element, 'position') !=3D 'static')=0A= return element;=0A= =0A= return document.body;=0A= },=0A= =0A= // caches x/y coordinate pair to use with overlap=0A= within: function(element, x, y) {=0A= if (this.includeScrollOffsets)=0A= return this.withinIncludingScrolloffsets(element, x, y);=0A= this.xcomp =3D x;=0A= this.ycomp =3D y;=0A= this.offset =3D this.cumulativeOffset(element);=0A= =0A= return (y >=3D this.offset[1] &&=0A= y < this.offset[1] + element.offsetHeight &&=0A= x >=3D this.offset[0] &&=0A= x < this.offset[0] + element.offsetWidth);=0A= },=0A= =0A= withinIncludingScrolloffsets: function(element, x, y) {=0A= var offsetcache =3D this.realOffset(element);=0A= =0A= this.xcomp =3D x + offsetcache[0] - this.deltaX;=0A= this.ycomp =3D y + offsetcache[1] - this.deltaY;=0A= this.offset =3D this.cumulativeOffset(element);=0A= =0A= return (this.ycomp >=3D this.offset[1] &&=0A= this.ycomp < this.offset[1] + element.offsetHeight &&=0A= this.xcomp >=3D this.offset[0] &&=0A= this.xcomp < this.offset[0] + element.offsetWidth);=0A= },=0A= =0A= // within must be called directly before=0A= overlap: function(mode, element) {=0A= if (!mode) return 0;=0A= if (mode =3D=3D 'vertical')=0A= return ((this.offset[1] + element.offsetHeight) - this.ycomp) /=0A= element.offsetHeight;=0A= if (mode =3D=3D 'horizontal')=0A= return ((this.offset[0] + element.offsetWidth) - this.xcomp) /=0A= element.offsetWidth;=0A= },=0A= =0A= clone: function(source, target) {=0A= source =3D $(source);=0A= target =3D $(target);=0A= target.style.position =3D 'absolute';=0A= var offsets =3D this.cumulativeOffset(source);=0A= target.style.top =3D offsets[1] + 'px';=0A= target.style.left =3D offsets[0] + 'px';=0A= target.style.width =3D source.offsetWidth + 'px';=0A= target.style.height =3D source.offsetHeight + 'px';=0A= },=0A= =0A= page: function(forElement) {=0A= var valueT =3D 0, valueL =3D 0;=0A= =0A= var element =3D forElement;=0A= do {=0A= valueT +=3D element.offsetTop || 0;=0A= valueL +=3D element.offsetLeft || 0;=0A= =0A= // Safari fix=0A= if (element.offsetParent=3D=3Ddocument.body)=0A= if (Element.getStyle(element,'position')=3D=3D'absolute') break;=0A= =0A= } while (element =3D element.offsetParent);=0A= =0A= element =3D forElement;=0A= do {=0A= valueT -=3D element.scrollTop || 0;=0A= valueL -=3D element.scrollLeft || 0;=0A= } while (element =3D element.parentNode);=0A= =0A= return [valueL, valueT];=0A= },=0A= =0A= clone: function(source, target) {=0A= var options =3D Object.extend({=0A= setLeft: true,=0A= setTop: true,=0A= setWidth: true,=0A= setHeight: true,=0A= offsetTop: 0,=0A= offsetLeft: 0=0A= }, arguments[2] || {})=0A= =0A= // find page position of source=0A= source =3D $(source);=0A= var p =3D Position.page(source);=0A= =0A= // find coordinate system to use=0A= target =3D $(target);=0A= var delta =3D [0, 0];=0A= var parent =3D null;=0A= // delta [0,0] will do fine with position: fixed elements,=0A= // position:absolute needs offsetParent deltas=0A= if (Element.getStyle(target,'position') =3D=3D 'absolute') {=0A= parent =3D Position.offsetParent(target);=0A= delta =3D Position.page(parent);=0A= }=0A= =0A= // correct by body offsets (fixes Safari)=0A= if (parent =3D=3D document.body) {=0A= delta[0] -=3D document.body.offsetLeft;=0A= delta[1] -=3D document.body.offsetTop;=0A= }=0A= =0A= // set position=0A= if(options.setLeft) target.style.left =3D (p[0] - delta[0] + = options.offsetLeft) + 'px';=0A= if(options.setTop) target.style.top =3D (p[1] - delta[1] + = options.offsetTop) + 'px';=0A= if(options.setWidth) target.style.width =3D source.offsetWidth + = 'px';=0A= if(options.setHeight) target.style.height =3D source.offsetHeight + = 'px';=0A= },=0A= =0A= absolutize: function(element) {=0A= element =3D $(element);=0A= if (element.style.position =3D=3D 'absolute') return;=0A= Position.prepare();=0A= =0A= var offsets =3D Position.positionedOffset(element);=0A= var top =3D offsets[1];=0A= var left =3D offsets[0];=0A= var width =3D element.clientWidth;=0A= var height =3D element.clientHeight;=0A= =0A= element._originalLeft =3D left - parseFloat(element.style.left || = 0);=0A= element._originalTop =3D top - parseFloat(element.style.top || = 0);=0A= element._originalWidth =3D element.style.width;=0A= element._originalHeight =3D element.style.height;=0A= =0A= element.style.position =3D 'absolute';=0A= element.style.top =3D top + 'px';;=0A= element.style.left =3D left + 'px';;=0A= element.style.width =3D width + 'px';;=0A= element.style.height =3D height + 'px';;=0A= },=0A= =0A= relativize: function(element) {=0A= element =3D $(element);=0A= if (element.style.position =3D=3D 'relative') return;=0A= Position.prepare();=0A= =0A= element.style.position =3D 'relative';=0A= var top =3D parseFloat(element.style.top || 0) - = (element._originalTop || 0);=0A= var left =3D parseFloat(element.style.left || 0) - = (element._originalLeft || 0);=0A= =0A= element.style.top =3D top + 'px';=0A= element.style.left =3D left + 'px';=0A= element.style.height =3D element._originalHeight;=0A= element.style.width =3D element._originalWidth;=0A= }=0A= }=0A= =0A= // Safari returns margins on body which is incorrect if the child is = absolutely=0A= // positioned. For performance reasons, redefine = Position.cumulativeOffset for=0A= // KHTML/WebKit only.=0A= if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) {=0A= Position.cumulativeOffset =3D function(element) {=0A= var valueT =3D 0, valueL =3D 0;=0A= do {=0A= valueT +=3D element.offsetTop || 0;=0A= valueL +=3D element.offsetLeft || 0;=0A= if (element.offsetParent =3D=3D document.body)=0A= if (Element.getStyle(element, 'position') =3D=3D 'absolute') = break;=0A= =0A= element =3D element.offsetParent;=0A= } while (element);=0A= =0A= return [valueL, valueT];=0A= }=0A= } ------=_NextPart_000_0078_01CA0A00.0A0B4930 Content-Type: application/octet-stream Content-Transfer-Encoding: quoted-printable Content-Location: http://www.admissions.caltech.edu/javascripts/effects.js?1170291493 // Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, = http://mir.aculo.us)=0A= // Contributors:=0A= // Justin Palmer (http://encytemedia.com/)=0A= // Mark Pilgrim (http://diveintomark.org/)=0A= // Martin Bialasinki=0A= // =0A= // See scriptaculous.js for full license. =0A= =0A= // converts rgb() and #xxx to #xxxxxx format, =0A= // returns self (or first argument) if not convertable =0A= String.prototype.parseColor =3D function() { =0A= var color =3D '#'; =0A= if(this.slice(0,4) =3D=3D 'rgb(') { =0A= var cols =3D this.slice(4,this.length-1).split(','); =0A= var i=3D0; do { color +=3D parseInt(cols[i]).toColorPart() } while = (++i<3); =0A= } else { =0A= if(this.slice(0,1) =3D=3D '#') { =0A= if(this.length=3D=3D4) for(var i=3D1;i<4;i++) color +=3D = (this.charAt(i) + this.charAt(i)).toLowerCase(); =0A= if(this.length=3D=3D7) color =3D this.toLowerCase(); =0A= } =0A= } =0A= return(color.length=3D=3D7 ? color : (arguments[0] || this)); =0A= }=0A= =0A= /*-----------------------------------------------------------------------= ---*/=0A= =0A= Element.collectTextNodes =3D function(element) { =0A= return $A($(element).childNodes).collect( function(node) {=0A= return (node.nodeType=3D=3D3 ? node.nodeValue : =0A= (node.hasChildNodes() ? Element.collectTextNodes(node) : ''));=0A= }).flatten().join('');=0A= }=0A= =0A= Element.collectTextNodesIgnoreClass =3D function(element, className) { =0A= return $A($(element).childNodes).collect( function(node) {=0A= return (node.nodeType=3D=3D3 ? node.nodeValue : =0A= ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? =0A= Element.collectTextNodesIgnoreClass(node, className) : ''));=0A= }).flatten().join('');=0A= }=0A= =0A= Element.setContentZoom =3D function(element, percent) {=0A= element =3D $(element); =0A= Element.setStyle(element, {fontSize: (percent/100) + 'em'}); =0A= if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0);=0A= }=0A= =0A= Element.getOpacity =3D function(element){ =0A= var opacity;=0A= if (opacity =3D Element.getStyle(element, 'opacity')) =0A= return parseFloat(opacity); =0A= if (opacity =3D (Element.getStyle(element, 'filter') || = '').match(/alpha\(opacity=3D(.*)\)/)) =0A= if(opacity[1]) return parseFloat(opacity[1]) / 100; =0A= return 1.0; =0A= }=0A= =0A= Element.setOpacity =3D function(element, value){ =0A= element=3D $(element); =0A= if (value =3D=3D 1){=0A= Element.setStyle(element, { opacity: =0A= (/Gecko/.test(navigator.userAgent) && = !/Konqueror|Safari|KHTML/.test(navigator.userAgent)) ? =0A= 0.999999 : null });=0A= if(/MSIE/.test(navigator.userAgent)) =0A= Element.setStyle(element, {filter: = Element.getStyle(element,'filter').replace(/alpha\([^\)]*\)/gi,'')}); =0A= } else { =0A= if(value < 0.00001) value =3D 0; =0A= Element.setStyle(element, {opacity: value});=0A= if(/MSIE/.test(navigator.userAgent)) =0A= Element.setStyle(element, =0A= { filter: = Element.getStyle(element,'filter').replace(/alpha\([^\)]*\)/gi,'') +=0A= 'alpha(opacity=3D'+value*100+')' }); =0A= }=0A= } =0A= =0A= Element.getInlineOpacity =3D function(element){ =0A= return $(element).style.opacity || '';=0A= } =0A= =0A= Element.childrenWithClassName =3D function(element, className, = findFirst) {=0A= var classNameRegExp =3D new RegExp("(^|\\s)" + className + "(\\s|$)");=0A= var results =3D $A($(element).getElementsByTagName('*'))[findFirst ? = 'detect' : 'select']( function(c) { =0A= return (c.className && c.className.match(classNameRegExp));=0A= });=0A= if(!results) results =3D [];=0A= return results;=0A= }=0A= =0A= Element.forceRerendering =3D function(element) {=0A= try {=0A= element =3D $(element);=0A= var n =3D document.createTextNode(' ');=0A= element.appendChild(n);=0A= element.removeChild(n);=0A= } catch(e) { }=0A= };=0A= =0A= /*-----------------------------------------------------------------------= ---*/=0A= =0A= Array.prototype.call =3D function() {=0A= var args =3D arguments;=0A= this.each(function(f){ f.apply(this, args) });=0A= }=0A= =0A= /*-----------------------------------------------------------------------= ---*/=0A= =0A= var Effect =3D {=0A= tagifyText: function(element) {=0A= var tagifyStyle =3D 'position:relative';=0A= if(/MSIE/.test(navigator.userAgent)) tagifyStyle +=3D ';zoom:1';=0A= element =3D $(element);=0A= $A(element.childNodes).each( function(child) {=0A= if(child.nodeType=3D=3D3) {=0A= child.nodeValue.toArray().each( function(character) {=0A= element.insertBefore(=0A= Builder.node('span',{style: tagifyStyle},=0A= character =3D=3D ' ' ? String.fromCharCode(160) : = character), =0A= child);=0A= });=0A= Element.remove(child);=0A= }=0A= });=0A= },=0A= multiple: function(element, effect) {=0A= var elements;=0A= if(((typeof element =3D=3D 'object') || =0A= (typeof element =3D=3D 'function')) && =0A= (element.length))=0A= elements =3D element;=0A= else=0A= elements =3D $(element).childNodes;=0A= =0A= var options =3D Object.extend({=0A= speed: 0.1,=0A= delay: 0.0=0A= }, arguments[2] || {});=0A= var masterDelay =3D options.delay;=0A= =0A= $A(elements).each( function(element, index) {=0A= new effect(element, Object.extend(options, { delay: index * = options.speed + masterDelay }));=0A= });=0A= },=0A= PAIRS: {=0A= 'slide': ['SlideDown','SlideUp'],=0A= 'blind': ['BlindDown','BlindUp'],=0A= 'appear': ['Appear','Fade']=0A= },=0A= toggle: function(element, effect) {=0A= element =3D $(element);=0A= effect =3D (effect || 'appear').toLowerCase();=0A= var options =3D Object.extend({=0A= queue: { position:'end', scope:(element.id || 'global'), limit: 1 }=0A= }, arguments[2] || {});=0A= Effect[element.visible() ? =0A= Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, = options);=0A= }=0A= };=0A= =0A= var Effect2 =3D Effect; // deprecated=0A= =0A= /* ------------- transitions ------------- */=0A= =0A= Effect.Transitions =3D {}=0A= =0A= Effect.Transitions.linear =3D function(pos) {=0A= return pos;=0A= }=0A= Effect.Transitions.sinoidal =3D function(pos) {=0A= return (-Math.cos(pos*Math.PI)/2) + 0.5;=0A= }=0A= Effect.Transitions.reverse =3D function(pos) {=0A= return 1-pos;=0A= }=0A= Effect.Transitions.flicker =3D function(pos) {=0A= return ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4;=0A= }=0A= Effect.Transitions.wobble =3D function(pos) {=0A= return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5;=0A= }=0A= Effect.Transitions.pulse =3D function(pos) {=0A= return (Math.floor(pos*10) % 2 =3D=3D 0 ? =0A= (pos*10-Math.floor(pos*10)) : 1-(pos*10-Math.floor(pos*10)));=0A= }=0A= Effect.Transitions.none =3D function(pos) {=0A= return 0;=0A= }=0A= Effect.Transitions.full =3D function(pos) {=0A= return 1;=0A= }=0A= =0A= /* ------------- core effects ------------- */=0A= =0A= Effect.ScopedQueue =3D Class.create();=0A= Object.extend(Object.extend(Effect.ScopedQueue.prototype, Enumerable), {=0A= initialize: function() {=0A= this.effects =3D [];=0A= this.interval =3D null;=0A= },=0A= _each: function(iterator) {=0A= this.effects._each(iterator);=0A= },=0A= add: function(effect) {=0A= var timestamp =3D new Date().getTime();=0A= =0A= var position =3D (typeof effect.options.queue =3D=3D 'string') ? =0A= effect.options.queue : effect.options.queue.position;=0A= =0A= switch(position) {=0A= case 'front':=0A= // move unstarted effects after this effect =0A= this.effects.findAll(function(e){ return e.state=3D=3D'idle' = }).each( function(e) {=0A= e.startOn +=3D effect.finishOn;=0A= e.finishOn +=3D effect.finishOn;=0A= });=0A= break;=0A= case 'end':=0A= // start effect after last queued effect has finished=0A= timestamp =3D this.effects.pluck('finishOn').max() || timestamp;=0A= break;=0A= }=0A= =0A= effect.startOn +=3D timestamp;=0A= effect.finishOn +=3D timestamp;=0A= =0A= if(!effect.options.queue.limit || (this.effects.length < = effect.options.queue.limit))=0A= this.effects.push(effect);=0A= =0A= if(!this.interval) =0A= this.interval =3D setInterval(this.loop.bind(this), 40);=0A= },=0A= remove: function(effect) {=0A= this.effects =3D this.effects.reject(function(e) { return = e=3D=3Deffect });=0A= if(this.effects.length =3D=3D 0) {=0A= clearInterval(this.interval);=0A= this.interval =3D null;=0A= }=0A= },=0A= loop: function() {=0A= var timePos =3D new Date().getTime();=0A= this.effects.invoke('loop', timePos);=0A= }=0A= });=0A= =0A= Effect.Queues =3D {=0A= instances: $H(),=0A= get: function(queueName) {=0A= if(typeof queueName !=3D 'string') return queueName;=0A= =0A= if(!this.instances[queueName])=0A= this.instances[queueName] =3D new Effect.ScopedQueue();=0A= =0A= return this.instances[queueName];=0A= }=0A= }=0A= Effect.Queue =3D Effect.Queues.get('global');=0A= =0A= Effect.DefaultOptions =3D {=0A= transition: Effect.Transitions.sinoidal,=0A= duration: 1.0, // seconds=0A= fps: 25.0, // max. 25fps due to Effect.Queue implementation=0A= sync: false, // true for combining=0A= from: 0.0,=0A= to: 1.0,=0A= delay: 0.0,=0A= queue: 'parallel'=0A= }=0A= =0A= Effect.Base =3D function() {};=0A= Effect.Base.prototype =3D {=0A= position: null,=0A= start: function(options) {=0A= this.options =3D = Object.extend(Object.extend({},Effect.DefaultOptions), options || {});=0A= this.currentFrame =3D 0;=0A= this.state =3D 'idle';=0A= this.startOn =3D this.options.delay*1000;=0A= this.finishOn =3D this.startOn + (this.options.duration*1000);=0A= this.event('beforeStart');=0A= if(!this.options.sync)=0A= Effect.Queues.get(typeof this.options.queue =3D=3D 'string' ? =0A= 'global' : this.options.queue.scope).add(this);=0A= },=0A= loop: function(timePos) {=0A= if(timePos >=3D this.startOn) {=0A= if(timePos >=3D this.finishOn) {=0A= this.render(1.0);=0A= this.cancel();=0A= this.event('beforeFinish');=0A= if(this.finish) this.finish(); =0A= this.event('afterFinish');=0A= return; =0A= }=0A= var pos =3D (timePos - this.startOn) / (this.finishOn - = this.startOn);=0A= var frame =3D Math.round(pos * this.options.fps * = this.options.duration);=0A= if(frame > this.currentFrame) {=0A= this.render(pos);=0A= this.currentFrame =3D frame;=0A= }=0A= }=0A= },=0A= render: function(pos) {=0A= if(this.state =3D=3D 'idle') {=0A= this.state =3D 'running';=0A= this.event('beforeSetup');=0A= if(this.setup) this.setup();=0A= this.event('afterSetup');=0A= }=0A= if(this.state =3D=3D 'running') {=0A= if(this.options.transition) pos =3D this.options.transition(pos);=0A= pos *=3D (this.options.to-this.options.from);=0A= pos +=3D this.options.from;=0A= this.position =3D pos;=0A= this.event('beforeUpdate');=0A= if(this.update) this.update(pos);=0A= this.event('afterUpdate');=0A= }=0A= },=0A= cancel: function() {=0A= if(!this.options.sync)=0A= Effect.Queues.get(typeof this.options.queue =3D=3D 'string' ? =0A= 'global' : this.options.queue.scope).remove(this);=0A= this.state =3D 'finished';=0A= },=0A= event: function(eventName) {=0A= if(this.options[eventName + 'Internal']) this.options[eventName + = 'Internal'](this);=0A= if(this.options[eventName]) this.options[eventName](this);=0A= },=0A= inspect: function() {=0A= return '#';=0A= }=0A= }=0A= =0A= Effect.Parallel =3D Class.create();=0A= Object.extend(Object.extend(Effect.Parallel.prototype, = Effect.Base.prototype), {=0A= initialize: function(effects) {=0A= this.effects =3D effects || [];=0A= this.start(arguments[1]);=0A= },=0A= update: function(position) {=0A= this.effects.invoke('render', position);=0A= },=0A= finish: function(position) {=0A= this.effects.each( function(effect) {=0A= effect.render(1.0);=0A= effect.cancel();=0A= effect.event('beforeFinish');=0A= if(effect.finish) effect.finish(position);=0A= effect.event('afterFinish');=0A= });=0A= }=0A= });=0A= =0A= Effect.Opacity =3D Class.create();=0A= Object.extend(Object.extend(Effect.Opacity.prototype, = Effect.Base.prototype), {=0A= initialize: function(element) {=0A= this.element =3D $(element);=0A= // make this work on IE on elements without 'layout'=0A= if(/MSIE/.test(navigator.userAgent) && (!this.element.hasLayout))=0A= this.element.setStyle({zoom: 1});=0A= var options =3D Object.extend({=0A= from: this.element.getOpacity() || 0.0,=0A= to: 1.0=0A= }, arguments[1] || {});=0A= this.start(options);=0A= },=0A= update: function(position) {=0A= this.element.setOpacity(position);=0A= }=0A= });=0A= =0A= Effect.Move =3D Class.create();=0A= Object.extend(Object.extend(Effect.Move.prototype, = Effect.Base.prototype), {=0A= initialize: function(element) {=0A= this.element =3D $(element);=0A= var options =3D Object.extend({=0A= x: 0,=0A= y: 0,=0A= mode: 'relative'=0A= }, arguments[1] || {});=0A= this.start(options);=0A= },=0A= setup: function() {=0A= // Bug in Opera: Opera returns the "real" position of a static = element or=0A= // relative element that does not have top/left explicitly set.=0A= // =3D=3D> Always set top and left for position relative elements in = your stylesheets =0A= // (to 0 if you do not need them) =0A= this.element.makePositioned();=0A= this.originalLeft =3D parseFloat(this.element.getStyle('left') || = '0');=0A= this.originalTop =3D parseFloat(this.element.getStyle('top') || = '0');=0A= if(this.options.mode =3D=3D 'absolute') {=0A= // absolute movement, so we need to calc deltaX and deltaY=0A= this.options.x =3D this.options.x - this.originalLeft;=0A= this.options.y =3D this.options.y - this.originalTop;=0A= }=0A= },=0A= update: function(position) {=0A= this.element.setStyle({=0A= left: this.options.x * position + this.originalLeft + 'px',=0A= top: this.options.y * position + this.originalTop + 'px'=0A= });=0A= }=0A= });=0A= =0A= // for backwards compatibility=0A= Effect.MoveBy =3D function(element, toTop, toLeft) {=0A= return new Effect.Move(element, =0A= Object.extend({ x: toLeft, y: toTop }, arguments[3] || {}));=0A= };=0A= =0A= Effect.Scale =3D Class.create();=0A= Object.extend(Object.extend(Effect.Scale.prototype, = Effect.Base.prototype), {=0A= initialize: function(element, percent) {=0A= this.element =3D $(element)=0A= var options =3D Object.extend({=0A= scaleX: true,=0A= scaleY: true,=0A= scaleContent: true,=0A= scaleFromCenter: false,=0A= scaleMode: 'box', // 'box' or 'contents' or {} with = provided values=0A= scaleFrom: 100.0,=0A= scaleTo: percent=0A= }, arguments[2] || {});=0A= this.start(options);=0A= },=0A= setup: function() {=0A= this.restoreAfterFinish =3D this.options.restoreAfterFinish || false;=0A= this.elementPositioning =3D this.element.getStyle('position');=0A= =0A= this.originalStyle =3D {};=0A= ['top','left','width','height','fontSize'].each( function(k) {=0A= this.originalStyle[k] =3D this.element.style[k];=0A= }.bind(this));=0A= =0A= this.originalTop =3D this.element.offsetTop;=0A= this.originalLeft =3D this.element.offsetLeft;=0A= =0A= var fontSize =3D this.element.getStyle('font-size') || '100%';=0A= ['em','px','%'].each( function(fontSizeType) {=0A= if(fontSize.indexOf(fontSizeType)>0) {=0A= this.fontSize =3D parseFloat(fontSize);=0A= this.fontSizeType =3D fontSizeType;=0A= }=0A= }.bind(this));=0A= =0A= this.factor =3D (this.options.scaleTo - this.options.scaleFrom)/100;=0A= =0A= this.dims =3D null;=0A= if(this.options.scaleMode=3D=3D'box')=0A= this.dims =3D [this.element.offsetHeight, = this.element.offsetWidth];=0A= if(/^content/.test(this.options.scaleMode))=0A= this.dims =3D [this.element.scrollHeight, = this.element.scrollWidth];=0A= if(!this.dims)=0A= this.dims =3D [this.options.scaleMode.originalHeight,=0A= this.options.scaleMode.originalWidth];=0A= },=0A= update: function(position) {=0A= var currentScale =3D (this.options.scaleFrom/100.0) + (this.factor * = position);=0A= if(this.options.scaleContent && this.fontSize)=0A= this.element.setStyle({fontSize: this.fontSize * currentScale + = this.fontSizeType });=0A= this.setDimensions(this.dims[0] * currentScale, this.dims[1] * = currentScale);=0A= },=0A= finish: function(position) {=0A= if (this.restoreAfterFinish) = this.element.setStyle(this.originalStyle);=0A= },=0A= setDimensions: function(height, width) {=0A= var d =3D {};=0A= if(this.options.scaleX) d.width =3D width + 'px';=0A= if(this.options.scaleY) d.height =3D height + 'px';=0A= if(this.options.scaleFromCenter) {=0A= var topd =3D (height - this.dims[0])/2;=0A= var leftd =3D (width - this.dims[1])/2;=0A= if(this.elementPositioning =3D=3D 'absolute') {=0A= if(this.options.scaleY) d.top =3D this.originalTop-topd + 'px';=0A= if(this.options.scaleX) d.left =3D this.originalLeft-leftd + = 'px';=0A= } else {=0A= if(this.options.scaleY) d.top =3D -topd + 'px';=0A= if(this.options.scaleX) d.left =3D -leftd + 'px';=0A= }=0A= }=0A= this.element.setStyle(d);=0A= }=0A= });=0A= =0A= Effect.Highlight =3D Class.create();=0A= Object.extend(Object.extend(Effect.Highlight.prototype, = Effect.Base.prototype), {=0A= initialize: function(element) {=0A= this.element =3D $(element);=0A= var options =3D Object.extend({ startcolor: '#ffff99' }, = arguments[1] || {});=0A= this.start(options);=0A= },=0A= setup: function() {=0A= // Prevent executing on elements not in the layout flow=0A= if(this.element.getStyle('display')=3D=3D'none') { this.cancel(); = return; }=0A= // Disable background image during the effect=0A= this.oldStyle =3D {=0A= backgroundImage: this.element.getStyle('background-image') };=0A= this.element.setStyle({backgroundImage: 'none'});=0A= if(!this.options.endcolor)=0A= this.options.endcolor =3D = this.element.getStyle('background-color').parseColor('#ffffff');=0A= if(!this.options.restorecolor)=0A= this.options.restorecolor =3D = this.element.getStyle('background-color');=0A= // init color calculations=0A= this._base =3D $R(0,2).map(function(i){ return = parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this));=0A= this._delta =3D $R(0,2).map(function(i){ return = parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] = }.bind(this));=0A= },=0A= update: function(position) {=0A= this.element.setStyle({backgroundColor: = $R(0,2).inject('#',function(m,v,i){=0A= return = m+(Math.round(this._base[i]+(this._delta[i]*position)).toColorPart()); = }.bind(this)) });=0A= },=0A= finish: function() {=0A= this.element.setStyle(Object.extend(this.oldStyle, {=0A= backgroundColor: this.options.restorecolor=0A= }));=0A= }=0A= });=0A= =0A= Effect.ScrollTo =3D Class.create();=0A= Object.extend(Object.extend(Effect.ScrollTo.prototype, = Effect.Base.prototype), {=0A= initialize: function(element) {=0A= this.element =3D $(element);=0A= this.start(arguments[1] || {});=0A= },=0A= setup: function() {=0A= Position.prepare();=0A= var offsets =3D Position.cumulativeOffset(this.element);=0A= if(this.options.offset) offsets[1] +=3D this.options.offset;=0A= var max =3D window.innerHeight ? =0A= window.height - window.innerHeight :=0A= document.body.scrollHeight - =0A= (document.documentElement.clientHeight ? =0A= document.documentElement.clientHeight : = document.body.clientHeight);=0A= this.scrollStart =3D Position.deltaY;=0A= this.delta =3D (offsets[1] > max ? max : offsets[1]) - = this.scrollStart;=0A= },=0A= update: function(position) {=0A= Position.prepare();=0A= window.scrollTo(Position.deltaX, =0A= this.scrollStart + (position*this.delta));=0A= }=0A= });=0A= =0A= /* ------------- combination effects ------------- */=0A= =0A= Effect.Fade =3D function(element) {=0A= element =3D $(element);=0A= var oldOpacity =3D element.getInlineOpacity();=0A= var options =3D Object.extend({=0A= from: element.getOpacity() || 1.0,=0A= to: 0.0,=0A= afterFinishInternal: function(effect) { =0A= if(effect.options.to!=3D0) return;=0A= effect.element.hide();=0A= effect.element.setStyle({opacity: oldOpacity}); =0A= }}, arguments[1] || {});=0A= return new Effect.Opacity(element,options);=0A= }=0A= =0A= Effect.Appear =3D function(element) {=0A= element =3D $(element);=0A= var options =3D Object.extend({=0A= from: (element.getStyle('display') =3D=3D 'none' ? 0.0 : = element.getOpacity() || 0.0),=0A= to: 1.0,=0A= // force Safari to render floated elements properly=0A= afterFinishInternal: function(effect) {=0A= effect.element.forceRerendering();=0A= },=0A= beforeSetup: function(effect) {=0A= effect.element.setOpacity(effect.options.from);=0A= effect.element.show(); =0A= }}, arguments[1] || {});=0A= return new Effect.Opacity(element,options);=0A= }=0A= =0A= Effect.Puff =3D function(element) {=0A= element =3D $(element);=0A= var oldStyle =3D { opacity: element.getInlineOpacity(), position: = element.getStyle('position') };=0A= return new Effect.Parallel(=0A= [ new Effect.Scale(element, 200, =0A= { sync: true, scaleFromCenter: true, scaleContent: true, = restoreAfterFinish: true }), =0A= new Effect.Opacity(element, { sync: true, to: 0.0 } ) ], =0A= Object.extend({ duration: 1.0, =0A= beforeSetupInternal: function(effect) {=0A= effect.effects[0].element.setStyle({position: 'absolute'}); },=0A= afterFinishInternal: function(effect) {=0A= effect.effects[0].element.hide();=0A= effect.effects[0].element.setStyle(oldStyle); }=0A= }, arguments[1] || {})=0A= );=0A= }=0A= =0A= Effect.BlindUp =3D function(element) {=0A= element =3D $(element);=0A= element.makeClipping();=0A= return new Effect.Scale(element, 0, =0A= Object.extend({ scaleContent: false, =0A= scaleX: false, =0A= restoreAfterFinish: true,=0A= afterFinishInternal: function(effect) {=0A= effect.element.hide();=0A= effect.element.undoClipping();=0A= } =0A= }, arguments[1] || {})=0A= );=0A= }=0A= =0A= Effect.BlindDown =3D function(element) {=0A= element =3D $(element);=0A= var elementDimensions =3D element.getDimensions();=0A= return new Effect.Scale(element, 100, =0A= Object.extend({ scaleContent: false, =0A= scaleX: false,=0A= scaleFrom: 0,=0A= scaleMode: {originalHeight: elementDimensions.height, = originalWidth: elementDimensions.width},=0A= restoreAfterFinish: true,=0A= afterSetup: function(effect) {=0A= effect.element.makeClipping();=0A= effect.element.setStyle({height: '0px'});=0A= effect.element.show(); =0A= }, =0A= afterFinishInternal: function(effect) {=0A= effect.element.undoClipping();=0A= }=0A= }, arguments[1] || {})=0A= );=0A= }=0A= =0A= Effect.SwitchOff =3D function(element) {=0A= element =3D $(element);=0A= var oldOpacity =3D element.getInlineOpacity();=0A= return new Effect.Appear(element, { =0A= duration: 0.4,=0A= from: 0,=0A= transition: Effect.Transitions.flicker,=0A= afterFinishInternal: function(effect) {=0A= new Effect.Scale(effect.element, 1, { =0A= duration: 0.3, scaleFromCenter: true,=0A= scaleX: false, scaleContent: false, restoreAfterFinish: true,=0A= beforeSetup: function(effect) { =0A= effect.element.makePositioned();=0A= effect.element.makeClipping();=0A= },=0A= afterFinishInternal: function(effect) {=0A= effect.element.hide();=0A= effect.element.undoClipping();=0A= effect.element.undoPositioned();=0A= effect.element.setStyle({opacity: oldOpacity});=0A= }=0A= })=0A= }=0A= });=0A= }=0A= =0A= Effect.DropOut =3D function(element) {=0A= element =3D $(element);=0A= var oldStyle =3D {=0A= top: element.getStyle('top'),=0A= left: element.getStyle('left'),=0A= opacity: element.getInlineOpacity() };=0A= return new Effect.Parallel(=0A= [ new Effect.Move(element, {x: 0, y: 100, sync: true }), =0A= new Effect.Opacity(element, { sync: true, to: 0.0 }) ],=0A= Object.extend(=0A= { duration: 0.5,=0A= beforeSetup: function(effect) {=0A= effect.effects[0].element.makePositioned(); =0A= },=0A= afterFinishInternal: function(effect) {=0A= effect.effects[0].element.hide();=0A= effect.effects[0].element.undoPositioned();=0A= effect.effects[0].element.setStyle(oldStyle);=0A= } =0A= }, arguments[1] || {}));=0A= }=0A= =0A= Effect.Shake =3D function(element) {=0A= element =3D $(element);=0A= var oldStyle =3D {=0A= top: element.getStyle('top'),=0A= left: element.getStyle('left') };=0A= return new Effect.Move(element, =0A= { x: 20, y: 0, duration: 0.05, afterFinishInternal: = function(effect) {=0A= new Effect.Move(effect.element,=0A= { x: -40, y: 0, duration: 0.1, afterFinishInternal: = function(effect) {=0A= new Effect.Move(effect.element,=0A= { x: 40, y: 0, duration: 0.1, afterFinishInternal: = function(effect) {=0A= new Effect.Move(effect.element,=0A= { x: -40, y: 0, duration: 0.1, afterFinishInternal: = function(effect) {=0A= new Effect.Move(effect.element,=0A= { x: 40, y: 0, duration: 0.1, afterFinishInternal: = function(effect) {=0A= new Effect.Move(effect.element,=0A= { x: -20, y: 0, duration: 0.05, afterFinishInternal: = function(effect) {=0A= effect.element.undoPositioned();=0A= effect.element.setStyle(oldStyle);=0A= }}) }}) }}) }}) }}) }});=0A= }=0A= =0A= Effect.SlideDown =3D function(element) {=0A= element =3D $(element);=0A= element.cleanWhitespace();=0A= // SlideDown need to have the content of the element wrapped in a = container element with fixed height!=0A= var oldInnerBottom =3D $(element.firstChild).getStyle('bottom');=0A= var elementDimensions =3D element.getDimensions();=0A= return new Effect.Scale(element, 100, Object.extend({ =0A= scaleContent: false, =0A= scaleX: false, =0A= scaleFrom: 0,=0A= scaleMode: {originalHeight: elementDimensions.height, originalWidth: = elementDimensions.width},=0A= restoreAfterFinish: true,=0A= afterSetup: function(effect) {=0A= effect.element.makePositioned();=0A= effect.element.firstChild.makePositioned();=0A= if(window.opera) effect.element.setStyle({top: ''});=0A= effect.element.makeClipping();=0A= effect.element.setStyle({height: '0px'});=0A= effect.element.show(); },=0A= afterUpdateInternal: function(effect) {=0A= effect.element.firstChild.setStyle({bottom:=0A= (effect.dims[0] - effect.element.clientHeight) + 'px' }); =0A= },=0A= afterFinishInternal: function(effect) {=0A= effect.element.undoClipping(); =0A= // IE will crash if child is undoPositioned first=0A= if(/MSIE/.test(navigator.userAgent)){=0A= effect.element.undoPositioned();=0A= effect.element.firstChild.undoPositioned();=0A= }else{=0A= effect.element.firstChild.undoPositioned();=0A= effect.element.undoPositioned();=0A= }=0A= effect.element.firstChild.setStyle({bottom: oldInnerBottom}); }=0A= }, arguments[1] || {})=0A= );=0A= }=0A= =0A= Effect.SlideUp =3D function(element) {=0A= element =3D $(element);=0A= element.cleanWhitespace();=0A= var oldInnerBottom =3D $(element.firstChild).getStyle('bottom');=0A= return new Effect.Scale(element, 0, =0A= Object.extend({ scaleContent: false, =0A= scaleX: false, =0A= scaleMode: 'box',=0A= scaleFrom: 100,=0A= restoreAfterFinish: true,=0A= beforeStartInternal: function(effect) {=0A= effect.element.makePositioned();=0A= effect.element.firstChild.makePositioned();=0A= if(window.opera) effect.element.setStyle({top: ''});=0A= effect.element.makeClipping();=0A= effect.element.show(); }, =0A= afterUpdateInternal: function(effect) {=0A= effect.element.firstChild.setStyle({bottom:=0A= (effect.dims[0] - effect.element.clientHeight) + 'px' }); },=0A= afterFinishInternal: function(effect) {=0A= effect.element.hide();=0A= effect.element.undoClipping();=0A= effect.element.firstChild.undoPositioned();=0A= effect.element.undoPositioned();=0A= effect.element.setStyle({bottom: oldInnerBottom}); }=0A= }, arguments[1] || {})=0A= );=0A= }=0A= =0A= // Bug in opera makes the TD containing this element expand for a = instance after finish =0A= Effect.Squish =3D function(element) {=0A= return new Effect.Scale(element, window.opera ? 1 : 0, =0A= { restoreAfterFinish: true,=0A= beforeSetup: function(effect) {=0A= effect.element.makeClipping(effect.element); }, =0A= afterFinishInternal: function(effect) {=0A= effect.element.hide(effect.element); =0A= effect.element.undoClipping(effect.element); }=0A= });=0A= }=0A= =0A= Effect.Grow =3D function(element) {=0A= element =3D $(element);=0A= var options =3D Object.extend({=0A= direction: 'center',=0A= moveTransition: Effect.Transitions.sinoidal,=0A= scaleTransition: Effect.Transitions.sinoidal,=0A= opacityTransition: Effect.Transitions.full=0A= }, arguments[1] || {});=0A= var oldStyle =3D {=0A= top: element.style.top,=0A= left: element.style.left,=0A= height: element.style.height,=0A= width: element.style.width,=0A= opacity: element.getInlineOpacity() };=0A= =0A= var dims =3D element.getDimensions(); =0A= var initialMoveX, initialMoveY;=0A= var moveX, moveY;=0A= =0A= switch (options.direction) {=0A= case 'top-left':=0A= initialMoveX =3D initialMoveY =3D moveX =3D moveY =3D 0; =0A= break;=0A= case 'top-right':=0A= initialMoveX =3D dims.width;=0A= initialMoveY =3D moveY =3D 0;=0A= moveX =3D -dims.width;=0A= break;=0A= case 'bottom-left':=0A= initialMoveX =3D moveX =3D 0;=0A= initialMoveY =3D dims.height;=0A= moveY =3D -dims.height;=0A= break;=0A= case 'bottom-right':=0A= initialMoveX =3D dims.width;=0A= initialMoveY =3D dims.height;=0A= moveX =3D -dims.width;=0A= moveY =3D -dims.height;=0A= break;=0A= case 'center':=0A= initialMoveX =3D dims.width / 2;=0A= initialMoveY =3D dims.height / 2;=0A= moveX =3D -dims.width / 2;=0A= moveY =3D -dims.height / 2;=0A= break;=0A= }=0A= =0A= return new Effect.Move(element, {=0A= x: initialMoveX,=0A= y: initialMoveY,=0A= duration: 0.01, =0A= beforeSetup: function(effect) {=0A= effect.element.hide();=0A= effect.element.makeClipping();=0A= effect.element.makePositioned();=0A= },=0A= afterFinishInternal: function(effect) {=0A= new Effect.Parallel(=0A= [ new Effect.Opacity(effect.element, { sync: true, to: 1.0, = from: 0.0, transition: options.opacityTransition }),=0A= new Effect.Move(effect.element, { x: moveX, y: moveY, sync: = true, transition: options.moveTransition }),=0A= new Effect.Scale(effect.element, 100, {=0A= scaleMode: { originalHeight: dims.height, originalWidth: = dims.width }, =0A= sync: true, scaleFrom: window.opera ? 1 : 0, transition: = options.scaleTransition, restoreAfterFinish: true})=0A= ], Object.extend({=0A= beforeSetup: function(effect) {=0A= effect.effects[0].element.setStyle({height: '0px'});=0A= effect.effects[0].element.show(); =0A= },=0A= afterFinishInternal: function(effect) {=0A= effect.effects[0].element.undoClipping();=0A= effect.effects[0].element.undoPositioned();=0A= effect.effects[0].element.setStyle(oldStyle); =0A= }=0A= }, options)=0A= )=0A= }=0A= });=0A= }=0A= =0A= Effect.Shrink =3D function(element) {=0A= element =3D $(element);=0A= var options =3D Object.extend({=0A= direction: 'center',=0A= moveTransition: Effect.Transitions.sinoidal,=0A= scaleTransition: Effect.Transitions.sinoidal,=0A= opacityTransition: Effect.Transitions.none=0A= }, arguments[1] || {});=0A= var oldStyle =3D {=0A= top: element.style.top,=0A= left: element.style.left,=0A= height: element.style.height,=0A= width: element.style.width,=0A= opacity: element.getInlineOpacity() };=0A= =0A= var dims =3D element.getDimensions();=0A= var moveX, moveY;=0A= =0A= switch (options.direction) {=0A= case 'top-left':=0A= moveX =3D moveY =3D 0;=0A= break;=0A= case 'top-right':=0A= moveX =3D dims.width;=0A= moveY =3D 0;=0A= break;=0A= case 'bottom-left':=0A= moveX =3D 0;=0A= moveY =3D dims.height;=0A= break;=0A= case 'bottom-right':=0A= moveX =3D dims.width;=0A= moveY =3D dims.height;=0A= break;=0A= case 'center': =0A= moveX =3D dims.width / 2;=0A= moveY =3D dims.height / 2;=0A= break;=0A= }=0A= =0A= return new Effect.Parallel(=0A= [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, = transition: options.opacityTransition }),=0A= new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, = transition: options.scaleTransition, restoreAfterFinish: true}),=0A= new Effect.Move(element, { x: moveX, y: moveY, sync: true, = transition: options.moveTransition })=0A= ], Object.extend({ =0A= beforeStartInternal: function(effect) {=0A= effect.effects[0].element.makePositioned();=0A= effect.effects[0].element.makeClipping(); },=0A= afterFinishInternal: function(effect) {=0A= effect.effects[0].element.hide();=0A= effect.effects[0].element.undoClipping();=0A= effect.effects[0].element.undoPositioned();=0A= effect.effects[0].element.setStyle(oldStyle); }=0A= }, options)=0A= );=0A= }=0A= =0A= Effect.Pulsate =3D function(element) {=0A= element =3D $(element);=0A= var options =3D arguments[1] || {};=0A= var oldOpacity =3D element.getInlineOpacity();=0A= var transition =3D options.transition || Effect.Transitions.sinoidal;=0A= var reverser =3D function(pos){ return = transition(1-Effect.Transitions.pulse(pos)) };=0A= reverser.bind(transition);=0A= return new Effect.Opacity(element, =0A= Object.extend(Object.extend({ duration: 3.0, from: 0,=0A= afterFinishInternal: function(effect) { = effect.element.setStyle({opacity: oldOpacity}); }=0A= }, options), {transition: reverser}));=0A= }=0A= =0A= Effect.Fold =3D function(element) {=0A= element =3D $(element);=0A= var oldStyle =3D {=0A= top: element.style.top,=0A= left: element.style.left,=0A= width: element.style.width,=0A= height: element.style.height };=0A= Element.makeClipping(element);=0A= return new Effect.Scale(element, 5, Object.extend({ =0A= scaleContent: false,=0A= scaleX: false,=0A= afterFinishInternal: function(effect) {=0A= new Effect.Scale(element, 1, { =0A= scaleContent: false, =0A= scaleY: false,=0A= afterFinishInternal: function(effect) {=0A= effect.element.hide();=0A= effect.element.undoClipping(); =0A= effect.element.setStyle(oldStyle);=0A= } });=0A= }}, arguments[1] || {}));=0A= };=0A= =0A= ['setOpacity','getOpacity','getInlineOpacity','forceRerendering','setCont= entZoom',=0A= = 'collectTextNodes','collectTextNodesIgnoreClass','childrenWithClassName']= .each( =0A= function(f) { Element.Methods[f] =3D Element[f]; }=0A= );=0A= =0A= Element.Methods.visualEffect =3D function(element, effect, options) {=0A= s =3D effect.gsub(/_/, '-').camelize();=0A= effect_class =3D s.charAt(0).toUpperCase() + s.substring(1);=0A= new Effect[effect_class](element, options);=0A= return $(element);=0A= };=0A= =0A= Element.addMethods(); ------=_NextPart_000_0078_01CA0A00.0A0B4930 Content-Type: application/octet-stream Content-Transfer-Encoding: quoted-printable Content-Location: http://www.admissions.caltech.edu/javascripts/dragdrop.js?1170291493 // Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, = http://mir.aculo.us)=0A= // Copyright (c) 2005 Sammi Williams (http://www.oriontransfer.co.nz, = sammi@oriontransfer.co.nz)=0A= // =0A= // See scriptaculous.js for full license.=0A= =0A= /* Returns true if child is contained within element */=0A= Element.isParent =3D function(child, element) {=0A= if (!child.parentNode || child =3D=3D element) return false;=0A= =0A= if (child.parentNode =3D=3D element) return true;=0A= =0A= return arguments.callee (child.parentNode, element);=0A= }=0A= =0A= Element.findChildren =3D function(element, onlyClasses, recursive, = tagName) { =0A= if(!element.hasChildNodes()) return null;=0A= var elements =3D [];=0A= $A(element.childNodes).each( function(e) {=0A= if(e.tagName && e.tagName=3D=3DtagName &&=0A= (!onlyClasses || (Element.hasClassName(e, onlyClasses))))=0A= elements.push(e);=0A= if(recursive) {=0A= var grandchildren =3D Element.findChildren(e, onlyClasses, = recursive, tagName);=0A= if(grandchildren) elements.push(grandchildren);=0A= }=0A= });=0A= =0A= return (elements.length>0 ? elements.flatten() : []);=0A= }=0A= =0A= Element.offsetSize =3D function (element, type) {=0A= if (type =3D=3D 'vertical' || type =3D=3D 'height')=0A= return element.offsetHeight;=0A= else=0A= return element.offsetWidth;=0A= }=0A= =0A= var Droppables =3D {=0A= drops: [],=0A= =0A= remove: function(element) {=0A= this.drops =3D this.drops.reject(function(d) { return = d.element=3D=3D$(element) });=0A= },=0A= =0A= add: function(element) {=0A= element =3D $(element);=0A= var options =3D Object.extend({=0A= greedy: true,=0A= hoverclass: null,=0A= tree: false=0A= }, arguments[1] || {});=0A= =0A= // cache containers=0A= if(options.containment) {=0A= options._containers =3D [];=0A= var containment =3D options.containment;=0A= if((typeof containment =3D=3D 'object') && =0A= (containment.constructor =3D=3D Array)) {=0A= containment.each( function(c) { options._containers.push($(c)) });=0A= } else {=0A= options._containers.push($(containment));=0A= }=0A= }=0A= =0A= if(options.accept) options.accept =3D [options.accept].flatten();=0A= =0A= Element.makePositioned(element); // fix IE=0A= options.element =3D element;=0A= =0A= this.drops.push(options);=0A= },=0A= =0A= findDeepestChild: function(drops) {=0A= deepest =3D drops[0];=0A= =0A= for (i =3D 1; i < drops.length; ++i) {=0A= if (Element.isParent(drops[i].element, deepest.element))=0A= deepest =3D drops[i];=0A= }=0A= =0A= return deepest;=0A= },=0A= =0A= isContained: function(element, drop) {=0A= var parentNode =3D element.parentNode;=0A= return drop._containers.detect(function(c) { return parentNode =3D=3D = c });=0A= },=0A= =0A= isAffected: function(point, element, drop) {=0A= return (=0A= (drop.element!=3Delement) &&=0A= // ((!drop._containers) ||=0A= // this.isContained(element, drop)) &&=0A= ((!drop.accept) ||=0A= (Element.classNames(element).detect( =0A= function(v) { return drop.accept.include(v) } ) )) &&=0A= Position.within(drop.element, point[0], point[1]) );=0A= },=0A= =0A= deactivate: function(drop) {=0A= if(drop.hoverclass)=0A= Element.removeClassName(drop.element, drop.hoverclass);=0A= this.last_active =3D null;=0A= },=0A= =0A= activate: function(drop) {=0A= if(drop.hoverclass)=0A= Element.addClassName(drop.element, drop.hoverclass);=0A= this.last_active =3D drop;=0A= },=0A= =0A= show: function(point, element) {=0A= var affected =3D Array();=0A= if(!this.drops.length) return;=0A= =0A= if(this.last_active) this.deactivate(this.last_active);=0A= this.drops.each( function(drop) {=0A= if(Droppables.isAffected(point, element, drop))=0A= affected.push(drop);=0A= });=0A= =0A= if (affected.length) {=0A= drop =3D Droppables.findDeepestChild (affected);=0A= Position.within(drop.element, point[0], point[1]);=0A= if(drop.onHover)=0A= drop.onHover(element, drop.element, Position.overlap(drop.overlap, = drop.element));=0A= Droppables.activate(drop);=0A= }=0A= },=0A= =0A= fire: function(event, element) {=0A= if(!this.last_active) return;=0A= Position.prepare();=0A= =0A= if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], = element, this.last_active))=0A= if (this.last_active.onDrop) =0A= this.last_active.onDrop(element, this.last_active.element, event);=0A= },=0A= =0A= reset: function() {=0A= if(this.last_active)=0A= this.deactivate(this.last_active);=0A= }=0A= }=0A= =0A= var Draggables =3D {=0A= drags: [],=0A= observers: [],=0A= =0A= register: function(draggable) {=0A= if(this.drags.length =3D=3D 0) {=0A= this.eventMouseUp =3D this.endDrag.bindAsEventListener(this);=0A= this.eventMouseMove =3D this.updateDrag.bindAsEventListener(this);=0A= this.eventKeypress =3D this.keyPress.bindAsEventListener(this);=0A= =0A= Event.observe(document, "mouseup", this.eventMouseUp);=0A= Event.observe(document, "mousemove", this.eventMouseMove);=0A= Event.observe(document, "keypress", this.eventKeypress);=0A= }=0A= this.drags.push(draggable);=0A= },=0A= =0A= unregister: function(draggable) {=0A= this.drags =3D this.drags.reject(function(d) { return d=3D=3Ddraggable = });=0A= if(this.drags.length =3D=3D 0) {=0A= Event.stopObserving(document, "mouseup", this.eventMouseUp);=0A= Event.stopObserving(document, "mousemove", this.eventMouseMove);=0A= Event.stopObserving(document, "keypress", this.eventKeypress);=0A= }=0A= },=0A= =0A= activate: function(draggable) {=0A= window.focus(); // allows keypress events if window isn't currently = focused, fails for Safari=0A= this.activeDraggable =3D draggable;=0A= },=0A= =0A= deactivate: function() {=0A= this.activeDraggable =3D null;=0A= },=0A= =0A= updateDrag: function(event) {=0A= if(!this.activeDraggable) return;=0A= var pointer =3D [Event.pointerX(event), Event.pointerY(event)];=0A= // Mozilla-based browsers fire successive mousemove events with=0A= // the same coordinates, prevent needless redrawing (moz bug?)=0A= if(this._lastPointer && (this._lastPointer.inspect() =3D=3D = pointer.inspect())) return;=0A= this._lastPointer =3D pointer;=0A= this.activeDraggable.updateDrag(event, pointer);=0A= },=0A= =0A= endDrag: function(event) {=0A= if(!this.activeDraggable) return;=0A= this._lastPointer =3D null;=0A= this.activeDraggable.endDrag(event);=0A= this.activeDraggable =3D null;=0A= },=0A= =0A= keyPress: function(event) {=0A= if(this.activeDraggable)=0A= this.activeDraggable.keyPress(event);=0A= },=0A= =0A= addObserver: function(observer) {=0A= this.observers.push(observer);=0A= this._cacheObserverCallbacks();=0A= },=0A= =0A= removeObserver: function(element) { // element instead of observer = fixes mem leaks=0A= this.observers =3D this.observers.reject( function(o) { return = o.element=3D=3Delement });=0A= this._cacheObserverCallbacks();=0A= },=0A= =0A= notify: function(eventName, draggable, event) { // 'onStart', 'onEnd', = 'onDrag'=0A= if(this[eventName+'Count'] > 0)=0A= this.observers.each( function(o) {=0A= if(o[eventName]) o[eventName](eventName, draggable, event);=0A= });=0A= },=0A= =0A= _cacheObserverCallbacks: function() {=0A= ['onStart','onEnd','onDrag'].each( function(eventName) {=0A= Draggables[eventName+'Count'] =3D Draggables.observers.select(=0A= function(o) { return o[eventName]; }=0A= ).length;=0A= });=0A= }=0A= }=0A= =0A= /*-----------------------------------------------------------------------= ---*/=0A= =0A= var Draggable =3D Class.create();=0A= Draggable.prototype =3D {=0A= initialize: function(element) {=0A= var options =3D Object.extend({=0A= handle: false,=0A= starteffect: function(element) { =0A= new Effect.Opacity(element, {duration:0.2, from:1.0, to:0.7}); =0A= },=0A= reverteffect: function(element, top_offset, left_offset) {=0A= var dur =3D = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02;=0A= element._revert =3D new Effect.Move(element, { x: -left_offset, y: = -top_offset, duration: dur});=0A= },=0A= endeffect: function(element) { =0A= new Effect.Opacity(element, {duration:0.2, from:0.7, to:1.0}); =0A= },=0A= zindex: 1000,=0A= revert: false,=0A= scroll: false,=0A= scrollSensitivity: 20,=0A= scrollSpeed: 15,=0A= snap: false // false, or xy or [x,y] or function(x,y){ return [x,y] }=0A= }, arguments[1] || {});=0A= =0A= this.element =3D $(element);=0A= =0A= if(options.handle && (typeof options.handle =3D=3D 'string'))=0A= this.handle =3D Element.childrenWithClassName(this.element, = options.handle)[0]; =0A= if(!this.handle) this.handle =3D $(options.handle);=0A= if(!this.handle) this.handle =3D this.element;=0A= =0A= if(options.scroll) options.scroll =3D $(options.scroll);=0A= =0A= Element.makePositioned(this.element); // fix IE =0A= =0A= this.delta =3D this.currentDelta();=0A= this.options =3D options;=0A= this.dragging =3D false; =0A= =0A= this.eventMouseDown =3D this.initDrag.bindAsEventListener(this);=0A= Event.observe(this.handle, "mousedown", this.eventMouseDown);=0A= =0A= Draggables.register(this);=0A= },=0A= =0A= destroy: function() {=0A= Event.stopObserving(this.handle, "mousedown", this.eventMouseDown);=0A= Draggables.unregister(this);=0A= },=0A= =0A= currentDelta: function() {=0A= return([=0A= parseInt(Element.getStyle(this.element,'left') || '0'),=0A= parseInt(Element.getStyle(this.element,'top') || '0')]);=0A= },=0A= =0A= initDrag: function(event) {=0A= if(Event.isLeftClick(event)) { =0A= // abort on form elements, fixes a Firefox issue=0A= var src =3D Event.element(event);=0A= if(src.tagName && (=0A= src.tagName=3D=3D'INPUT' ||=0A= src.tagName=3D=3D'SELECT' ||=0A= src.tagName=3D=3D'OPTION' ||=0A= src.tagName=3D=3D'BUTTON' ||=0A= src.tagName=3D=3D'TEXTAREA')) return;=0A= =0A= if(this.element._revert) {=0A= this.element._revert.cancel();=0A= this.element._revert =3D null;=0A= }=0A= =0A= var pointer =3D [Event.pointerX(event), Event.pointerY(event)];=0A= var pos =3D Position.cumulativeOffset(this.element);=0A= this.offset =3D [0,1].map( function(i) { return (pointer[i] - pos[i]) = });=0A= =0A= Draggables.activate(this);=0A= Event.stop(event);=0A= }=0A= },=0A= =0A= startDrag: function(event) {=0A= this.dragging =3D true;=0A= =0A= if(this.options.zindex) {=0A= this.originalZ =3D parseInt(Element.getStyle(this.element,'z-index') = || 0);=0A= this.element.style.zIndex =3D this.options.zindex;=0A= }=0A= =0A= if(this.options.ghosting) {=0A= this._clone =3D this.element.cloneNode(true);=0A= Position.absolutize(this.element);=0A= this.element.parentNode.insertBefore(this._clone, this.element);=0A= }=0A= =0A= if(this.options.scroll) {=0A= this.originalScrollLeft =3D this.options.scroll.scrollLeft;=0A= this.originalScrollTop =3D this.options.scroll.scrollTop;=0A= }=0A= =0A= Draggables.notify('onStart', this, event);=0A= if(this.options.starteffect) this.options.starteffect(this.element);=0A= },=0A= =0A= updateDrag: function(event, pointer) {=0A= if(!this.dragging) this.startDrag(event);=0A= Position.prepare();=0A= Droppables.show(pointer, this.element);=0A= Draggables.notify('onDrag', this, event);=0A= this.draw(pointer);=0A= if(this.options.change) this.options.change(this);=0A= =0A= if(this.options.scroll) {=0A= //if(this.scrollInterval) this.scroll();=0A= this.stopScrolling();=0A= var p =3D Position.page(this.options.scroll);=0A= p[0] +=3D this.options.scroll.scrollLeft;=0A= p[1] +=3D this.options.scroll.scrollTop;=0A= p.push(p[0]+this.options.scroll.offsetWidth);=0A= p.push(p[1]+this.options.scroll.offsetHeight);=0A= var speed =3D [0,0];=0A= if(pointer[0] < (p[0]+this.options.scrollSensitivity)) speed[0] =3D = pointer[0]-(p[0]+this.options.scrollSensitivity);=0A= if(pointer[1] < (p[1]+this.options.scrollSensitivity)) speed[1] =3D = pointer[1]-(p[1]+this.options.scrollSensitivity);=0A= if(pointer[0] > (p[2]-this.options.scrollSensitivity)) speed[0] =3D = pointer[0]-(p[2]-this.options.scrollSensitivity);=0A= if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] =3D = pointer[1]-(p[3]-this.options.scrollSensitivity);=0A= this.startScrolling(speed);=0A= }=0A= =0A= // fix AppleWebKit rendering=0A= if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0);=0A= =0A= Event.stop(event);=0A= },=0A= =0A= finishDrag: function(event, success) {=0A= this.dragging =3D false;=0A= =0A= if(this.options.ghosting) {=0A= Position.relativize(this.element);=0A= Element.remove(this._clone);=0A= this._clone =3D null;=0A= }=0A= =0A= if(success) Droppables.fire(event, this.element);=0A= Draggables.notify('onEnd', this, event);=0A= =0A= var revert =3D this.options.revert;=0A= if(revert && typeof revert =3D=3D 'function') revert =3D = revert(this.element);=0A= =0A= var d =3D this.currentDelta();=0A= if(revert && this.options.reverteffect) {=0A= this.options.reverteffect(this.element, =0A= d[1]-this.delta[1], d[0]-this.delta[0]);=0A= } else {=0A= this.delta =3D d;=0A= }=0A= =0A= if(this.options.zindex)=0A= this.element.style.zIndex =3D this.originalZ;=0A= =0A= if(this.options.endeffect) =0A= this.options.endeffect(this.element);=0A= =0A= Draggables.deactivate(this);=0A= Droppables.reset();=0A= },=0A= =0A= keyPress: function(event) {=0A= if(!event.keyCode=3D=3DEvent.KEY_ESC) return;=0A= this.finishDrag(event, false);=0A= Event.stop(event);=0A= },=0A= =0A= endDrag: function(event) {=0A= if(!this.dragging) return;=0A= this.stopScrolling();=0A= this.finishDrag(event, true);=0A= Event.stop(event);=0A= },=0A= =0A= draw: function(point) {=0A= var pos =3D Position.cumulativeOffset(this.element);=0A= var d =3D this.currentDelta();=0A= pos[0] -=3D d[0]; pos[1] -=3D d[1];=0A= =0A= if(this.options.scroll) {=0A= pos[0] -=3D this.options.scroll.scrollLeft-this.originalScrollLeft;=0A= pos[1] -=3D this.options.scroll.scrollTop-this.originalScrollTop;=0A= }=0A= =0A= var p =3D [0,1].map(function(i){ =0A= return (point[i]-pos[i]-this.offset[i]) =0A= }.bind(this));=0A= =0A= if(this.options.snap) {=0A= if(typeof this.options.snap =3D=3D 'function') {=0A= p =3D this.options.snap(p[0],p[1]);=0A= } else {=0A= if(this.options.snap instanceof Array) {=0A= p =3D p.map( function(v, i) {=0A= return Math.round(v/this.options.snap[i])*this.options.snap[i] = }.bind(this))=0A= } else {=0A= p =3D p.map( function(v) {=0A= return Math.round(v/this.options.snap)*this.options.snap = }.bind(this))=0A= }=0A= }}=0A= =0A= var style =3D this.element.style;=0A= if((!this.options.constraint) || = (this.options.constraint=3D=3D'horizontal'))=0A= style.left =3D p[0] + "px";=0A= if((!this.options.constraint) || = (this.options.constraint=3D=3D'vertical'))=0A= style.top =3D p[1] + "px";=0A= if(style.visibility=3D=3D"hidden") style.visibility =3D ""; // fix = gecko rendering=0A= },=0A= =0A= stopScrolling: function() {=0A= if(this.scrollInterval) {=0A= clearInterval(this.scrollInterval);=0A= this.scrollInterval =3D null;=0A= }=0A= },=0A= =0A= startScrolling: function(speed) {=0A= this.scrollSpeed =3D = [speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed];=0A= this.lastScrolled =3D new Date();=0A= this.scrollInterval =3D setInterval(this.scroll.bind(this), 10);=0A= },=0A= =0A= scroll: function() {=0A= var current =3D new Date();=0A= var delta =3D current - this.lastScrolled;=0A= this.lastScrolled =3D current;=0A= this.options.scroll.scrollLeft +=3D this.scrollSpeed[0] * delta / 1000;=0A= this.options.scroll.scrollTop +=3D this.scrollSpeed[1] * delta / 1000;=0A= =0A= Position.prepare();=0A= Droppables.show(Draggables._lastPointer, this.element);=0A= Draggables.notify('onDrag', this);=0A= this.draw(Draggables._lastPointer); =0A= =0A= if(this.options.change) this.options.change(this);=0A= }=0A= }=0A= =0A= /*-----------------------------------------------------------------------= ---*/=0A= =0A= var SortableObserver =3D Class.create();=0A= SortableObserver.prototype =3D {=0A= initialize: function(element, observer) {=0A= this.element =3D $(element);=0A= this.observer =3D observer;=0A= this.lastValue =3D Sortable.serialize(this.element);=0A= },=0A= =0A= onStart: function() {=0A= this.lastValue =3D Sortable.serialize(this.element);=0A= },=0A= =0A= onEnd: function() {=0A= Sortable.unmark();=0A= if(this.lastValue !=3D Sortable.serialize(this.element))=0A= this.observer(this.element)=0A= }=0A= }=0A= =0A= var Sortable =3D {=0A= sortables: {},=0A= =0A= _findRootElement: function(element) {=0A= =0A= while (element.tagName !=3D "BODY") { =0A= =0A= if (element.id && this.sortables[element.id] !=3D null) =0A= return element;=0A= =0A= element =3D element.parentNode;=0A= }=0A= =0A= return null;=0A= },=0A= =0A= setOptions: function(element, options) {=0A= this.sortables[element.id] =3D options;=0A= },=0A= =0A= options: function(element) {=0A= /* Optimized by Sammi Williams 15 Feb */=0A= element =3D Sortable._findRootElement($(element));=0A= if (element)=0A= return Sortable.sortables[element.id];=0A= return null;=0A= },=0A= =0A= destroy: function(element){=0A= /* Optimized by Sammi Williams 15 Feb */=0A= var s =3D Sortable.options(element);=0A= =0A= if (s !=3D null) {=0A= Draggables.removeObserver(s.element);=0A= s.droppables.each(function(d){ Droppables.remove(d) });=0A= s.draggables.invoke('destroy');=0A= =0A= delete Sortable.sortables[element.id];=0A= }=0A= },=0A= =0A= create: function(element) { =0A= element =3D $(element);=0A= var options =3D Object.extend({ =0A= element: element,=0A= tag: 'li', // assumes li children, override with = tag: 'tagname'=0A= dropOnEmpty: false,=0A= tree: false,=0A= treeTag: 'ul',=0A= overlap: 'vertical', // one of 'vertical', 'horizontal'=0A= constraint: 'vertical', // one of 'vertical', 'horizontal', false=0A= containment: element, // also takes array of elements (or = id's); or false=0A= handle: false, // or a CSS class=0A= only: false,=0A= hoverclass: null,=0A= ghosting: false,=0A= scroll: false,=0A= format: /^[^_]*_(.*)$/,=0A= onChange: Prototype.emptyFunction,=0A= onUpdate: Prototype.emptyFunction=0A= }, arguments[1] || {});=0A= =0A= // clear any old sortable with same element=0A= this.destroy(element);=0A= =0A= // build options for the draggables=0A= var options_for_draggable =3D {=0A= revert: true,=0A= scroll: options.scroll,=0A= ghosting: options.ghosting,=0A= constraint: options.constraint,=0A= handle: options.handle };=0A= =0A= if(options.starteffect)=0A= options_for_draggable.starteffect =3D options.starteffect;=0A= =0A= if(options.reverteffect)=0A= options_for_draggable.reverteffect =3D options.reverteffect;=0A= else=0A= if(options.ghosting) options_for_draggable.reverteffect =3D = function(element) {=0A= element.style.top =3D 0;=0A= element.style.left =3D 0;=0A= };=0A= =0A= if(options.endeffect)=0A= options_for_draggable.endeffect =3D options.endeffect;=0A= =0A= if(options.zindex)=0A= options_for_draggable.zindex =3D options.zindex;=0A= =0A= // build options for the droppables =0A= var options_for_droppable =3D {=0A= overlap: options.overlap,=0A= containment: options.containment,=0A= hoverclass: options.hoverclass,=0A= onHover: Sortable.onHover,=0A= greedy: !options.dropOnEmpty=0A= }=0A= =0A= // fix for gecko engine=0A= Element.cleanWhitespace(element); =0A= =0A= options.draggables =3D [];=0A= options.droppables =3D [];=0A= =0A= // make it so=0A= var options_for_tree =3D {=0A= onHover: Sortable.onEmptyHover,=0A= overlap: options.overlap,=0A= containment: options.containment,=0A= hoverclass: options.hoverclass=0A= }=0A= =0A= // drop on empty handling=0A= if(options.dropOnEmpty || options.tree) {=0A= Droppables.add(element, options_for_tree);=0A= options.droppables.push(element);=0A= }=0A= =0A= (this.findElements(element, options) || []).each( function(e) {=0A= // handles are per-draggable=0A= var handle =3D options.handle ? =0A= Element.childrenWithClassName(e, options.handle)[0] : e; =0A= options.draggables.push(=0A= new Draggable(e, Object.extend(options_for_draggable, { handle: = handle })));=0A= Droppables.add(e, options_for_droppable);=0A= options.droppables.push(e); =0A= });=0A= =0A= if (options.tree) {=0A= (Sortable.findTreeElements(element, options) || []).each( function = (e) {=0A= Droppables.add(e, options_for_tree);=0A= options.droppables.push(e);=0A= });=0A= }=0A= =0A= // keep reference=0A= Sortable.setOptions(element, options);=0A= =0A= // for onupdate=0A= Draggables.addObserver(new SortableObserver(element, = options.onUpdate));=0A= },=0A= =0A= /* Convenience functions - return all suitable-for-sortable elements in = a guaranteed order */=0A= findElements: function(element, options) {=0A= return Element.findChildren (element, options.only, options.tree ? = true : false, options.tag.toUpperCase());=0A= },=0A= =0A= findTreeElements: function(element, options) {=0A= return Element.findChildren (element, options.only, options.tree ? = true : false, options.treeTag.toUpperCase());=0A= },=0A= =0A= onHover: function(element, dropon, overlap) {=0A= /* Cannot drop on itself - avoids some DOM exceptions */=0A= if (Element.isParent(dropon, element)) return;=0A= =0A= if (overlap > .33 && overlap < .66 && Sortable.options(dropon).tree) {=0A= return;=0A= } else if(overlap>0.5) {=0A= Sortable.mark(dropon, 'before');=0A= if(dropon.previousSibling !=3D element) {=0A= var oldParentNode =3D element.parentNode;=0A= element.style.visibility =3D "hidden"; // fix gecko rendering=0A= dropon.parentNode.insertBefore(element, dropon);=0A= if(dropon.parentNode!=3DoldParentNode) =0A= Sortable.options(oldParentNode).onChange(element);=0A= Sortable.options(dropon.parentNode).onChange(element);=0A= }=0A= } else {=0A= Sortable.mark(dropon, 'after');=0A= var nextElement =3D dropon.nextSibling || null;=0A= if(nextElement !=3D element) {=0A= var oldParentNode =3D element.parentNode;=0A= element.style.visibility =3D "hidden"; // fix gecko rendering=0A= dropon.parentNode.insertBefore(element, nextElement);=0A= if(dropon.parentNode!=3DoldParentNode) =0A= Sortable.options(oldParentNode).onChange(element);=0A= Sortable.options(dropon.parentNode).onChange(element);=0A= }=0A= }=0A= },=0A= =0A= onEmptyHover: function(element, dropon, overlap) {=0A= var oldParentNode =3D element.parentNode;=0A= =0A= var droponOptions =3D Sortable.options(dropon);=0A= =0A= if(!Element.isParent (dropon, element)) {=0A= var index;=0A= =0A= var children =3D Sortable.findElements (dropon, {tag: = droponOptions.tag});=0A= var child =3D null;=0A= =0A= if (children) {=0A= var offset =3D Element.offsetSize (dropon, droponOptions.overlap) * = (1.0 - overlap);=0A= =0A= for (index =3D 0; index < children.length; index +=3D 1) {=0A= if (offset - Element.offsetSize (children[index], = droponOptions.overlap) >=3D 0) {=0A= offset -=3D Element.offsetSize (children[index], = droponOptions.overlap);=0A= } else if (offset - (Element.offsetSize (children[index], = droponOptions.overlap) / 2) >=3D 0) {=0A= child =3D index + 1 < children.length ? children[index + 1] : null;=0A= break;=0A= } else {=0A= child =3D children[index];=0A= break;=0A= }=0A= }=0A= }=0A= =0A= dropon.insertBefore(element, child);=0A= =0A= Sortable.options(oldParentNode).onChange(element);=0A= droponOptions.onChange(element);=0A= }=0A= },=0A= =0A= unmark: function() {=0A= if(Sortable._marker) Element.hide(Sortable._marker);=0A= },=0A= =0A= mark: function(dropon, position) {=0A= // mark on ghosting only=0A= var sortable =3D Sortable.options(dropon.parentNode);=0A= if(sortable && !sortable.ghosting) return; =0A= =0A= if(!Sortable._marker) {=0A= Sortable._marker =3D $('dropmarker') || document.createElement('DIV');=0A= Element.hide(Sortable._marker);=0A= Element.addClassName(Sortable._marker, 'dropmarker');=0A= Sortable._marker.style.position =3D 'absolute';=0A= = document.getElementsByTagName("body").item(0).appendChild(Sortable._marke= r);=0A= } =0A= var offsets =3D Position.cumulativeOffset(dropon);=0A= Sortable._marker.style.left =3D offsets[0] + 'px';=0A= Sortable._marker.style.top =3D offsets[1] + 'px';=0A= =0A= if(position=3D=3D'after')=0A= if(sortable.overlap =3D=3D 'horizontal') =0A= Sortable._marker.style.left =3D (offsets[0]+dropon.clientWidth) + = 'px';=0A= else=0A= Sortable._marker.style.top =3D (offsets[1]+dropon.clientHeight) + = 'px';=0A= =0A= Element.show(Sortable._marker);=0A= },=0A= =0A= sequence: function(element) {=0A= element =3D $(element);=0A= var sortableOptions =3D this.options(element);=0A= var options =3D Object.extend({=0A= tag: sortableOptions.tag,=0A= only: sortableOptions.only,=0A= name: element.id,=0A= format: sortableOptions.format=0A= }, arguments[1] || {});=0A= return $(this.findElements(element, options) || []).map( = function(item) {=0A= return item.id.match(options.format) ? = item.id.match(options.format)[1] : '';=0A= });=0A= },=0A= =0A= _tree: function(element, options, parent) {=0A= var children =3D Sortable.findElements(element, options) || [];=0A= =0A= for (var i =3D 0; i < children.length; ++i) {=0A= var match =3D children[i].id.match(options.format);=0A= =0A= if (!match) continue;=0A= =0A= var child =3D {=0A= id: encodeURIComponent(match ? match[1] : null),=0A= element: element,=0A= parent: parent,=0A= children: new Array,=0A= position: parent.children.length,=0A= container: Sortable._findChildrenElement(children[i], = options.treeTag.toUpperCase())=0A= }=0A= =0A= /* Get the element containing the children and recurse over it */=0A= if (child.container)=0A= arguments.callee(child.container, options, child)=0A= =0A= parent.children.push (child);=0A= }=0A= =0A= return parent; =0A= },=0A= =0A= /* Finds the first element of the given tag type within a parent = element.=0A= Used for finding the first LI[ST] within a L[IST]I[TEM].*/=0A= _findChildrenElement: function (element, containerTag) {=0A= if (element && element.hasChildNodes)=0A= for (var i =3D 0; i < element.childNodes.length; ++i)=0A= if (element.childNodes[i].tagName =3D=3D containerTag)=0A= return element.childNodes[i];=0A= =0A= return null;=0A= },=0A= =0A= tree: function(element) {=0A= element =3D $(element);=0A= var sortableOptions =3D this.options(element);=0A= var options =3D Object.extend({=0A= tag: sortableOptions.tag,=0A= treeTag: sortableOptions.treeTag,=0A= only: sortableOptions.only,=0A= name: element.id,=0A= format: sortableOptions.format=0A= }, arguments[1] || {});=0A= =0A= var root =3D {=0A= id: null,=0A= parent: null,=0A= children: new Array,=0A= container: element,=0A= position: 0=0A= }=0A= =0A= return Sortable._tree (element, options, root);=0A= },=0A= =0A= /* Construct a [i] index for a particular node */=0A= _constructIndex: function(node) {=0A= var index =3D '';=0A= do {=0A= if (node.id) index =3D '[' + node.position + ']' + index;=0A= } while ((node =3D node.parent) !=3D null);=0A= return index;=0A= },=0A= =0A= serialize: function(element) {=0A= element =3D $(element);=0A= var options =3D Sortable.options (element);=0A= =0A= if (options.tree) {=0A= return Sortable.tree(element, arguments[1]).children.map( function = (item) {=0A= return [encodeURIComponent(element.id) + = Sortable._constructIndex(item) + "[id]=3D" + = encodeURIComponent(item.id)].concat = (item.children.map(arguments.callee));=0A= }).flatten().join('&');=0A= } else {=0A= return Sortable.sequence(element, arguments[1]).map( function(item) {=0A= return encodeURIComponent(element.id) + "[]=3D" + = encodeURIComponent(item);=0A= }).join('&');=0A= }=0A= }=0A= }=0A= ------=_NextPart_000_0078_01CA0A00.0A0B4930 Content-Type: application/octet-stream Content-Transfer-Encoding: quoted-printable Content-Location: http://www.admissions.caltech.edu/javascripts/controls.js?1170291493 // Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, = http://mir.aculo.us)=0A= // (c) 2005 Ivan Krstic (http://blogs.law.harvard.edu/ivan)=0A= // (c) 2005 Jon Tirsen (http://www.tirsen.com)=0A= // Contributors:=0A= // Richard Livsey=0A= // Rahul Bhargava=0A= // Rob Wills=0A= // =0A= // See scriptaculous.js for full license.=0A= =0A= // Autocompleter.Base handles all the autocompletion functionality =0A= // that's independent of the data source for autocompletion. This=0A= // includes drawing the autocompletion menu, observing keyboard=0A= // and mouse events, and similar.=0A= //=0A= // Specific autocompleters need to provide, at the very least, =0A= // a getUpdatedChoices function that will be invoked every time=0A= // the text inside the monitored textbox changes. This method =0A= // should get the text for which to provide autocompletion by=0A= // invoking this.getToken(), NOT by directly accessing=0A= // this.element.value. This is to allow incremental tokenized=0A= // autocompletion. Specific auto-completion logic (AJAX, etc)=0A= // belongs in getUpdatedChoices.=0A= //=0A= // Tokenized incremental autocompletion is enabled automatically=0A= // when an autocompleter is instantiated with the 'tokens' option=0A= // in the options parameter, e.g.:=0A= // new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' });=0A= // will incrementally autocomplete with a comma as the token.=0A= // Additionally, ',' in the above example can be replaced with=0A= // a token array, e.g. { tokens: [',', '\n'] } which=0A= // enables autocompletion on multiple tokens. This is most =0A= // useful when one of the tokens is \n (a newline), as it =0A= // allows smart autocompletion after linebreaks.=0A= =0A= var Autocompleter =3D {}=0A= Autocompleter.Base =3D function() {};=0A= Autocompleter.Base.prototype =3D {=0A= baseInitialize: function(element, update, options) {=0A= this.element =3D $(element); =0A= this.update =3D $(update); =0A= this.hasFocus =3D false; =0A= this.changed =3D false; =0A= this.active =3D false; =0A= this.index =3D 0; =0A= this.entryCount =3D 0;=0A= =0A= if (this.setOptions)=0A= this.setOptions(options);=0A= else=0A= this.options =3D options || {};=0A= =0A= this.options.paramName =3D this.options.paramName || = this.element.name;=0A= this.options.tokens =3D this.options.tokens || [];=0A= this.options.frequency =3D this.options.frequency || 0.4;=0A= this.options.minChars =3D this.options.minChars || 1;=0A= this.options.onShow =3D this.options.onShow || =0A= function(element, update){ =0A= if(!update.style.position || = update.style.position=3D=3D'absolute') {=0A= update.style.position =3D 'absolute';=0A= Position.clone(element, update, {setHeight: false, offsetTop: = element.offsetHeight});=0A= }=0A= Effect.Appear(update,{duration:0.15});=0A= };=0A= this.options.onHide =3D this.options.onHide || =0A= function(element, update){ new Effect.Fade(update,{duration:0.15}) };=0A= =0A= if (typeof(this.options.tokens) =3D=3D 'string') =0A= this.options.tokens =3D new Array(this.options.tokens);=0A= =0A= this.observer =3D null;=0A= =0A= this.element.setAttribute('autocomplete','off');=0A= =0A= Element.hide(this.update);=0A= =0A= Event.observe(this.element, "blur", = this.onBlur.bindAsEventListener(this));=0A= Event.observe(this.element, "keypress", = this.onKeyPress.bindAsEventListener(this));=0A= },=0A= =0A= show: function() {=0A= if(Element.getStyle(this.update, 'display')=3D=3D'none') = this.options.onShow(this.element, this.update);=0A= if(!this.iefix && =0A= (navigator.appVersion.indexOf('MSIE')>0) &&=0A= (navigator.userAgent.indexOf('Opera')<0) &&=0A= (Element.getStyle(this.update, 'position')=3D=3D'absolute')) {=0A= new Insertion.After(this.update, =0A= '');=0A= this.iefix =3D $(this.update.id+'_iefix');=0A= }=0A= if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50);=0A= },=0A= =0A= fixIEOverlapping: function() {=0A= Position.clone(this.update, this.iefix);=0A= this.iefix.style.zIndex =3D 1;=0A= this.update.style.zIndex =3D 2;=0A= Element.show(this.iefix);=0A= },=0A= =0A= hide: function() {=0A= this.stopIndicator();=0A= if(Element.getStyle(this.update, 'display')!=3D'none') = this.options.onHide(this.element, this.update);=0A= if(this.iefix) Element.hide(this.iefix);=0A= },=0A= =0A= startIndicator: function() {=0A= if(this.options.indicator) Element.show(this.options.indicator);=0A= },=0A= =0A= stopIndicator: function() {=0A= if(this.options.indicator) Element.hide(this.options.indicator);=0A= },=0A= =0A= onKeyPress: function(event) {=0A= if(this.active)=0A= switch(event.keyCode) {=0A= case Event.KEY_TAB:=0A= case Event.KEY_RETURN:=0A= this.selectEntry();=0A= Event.stop(event);=0A= case Event.KEY_ESC:=0A= this.hide();=0A= this.active =3D false;=0A= Event.stop(event);=0A= return;=0A= case Event.KEY_LEFT:=0A= case Event.KEY_RIGHT:=0A= return;=0A= case Event.KEY_UP:=0A= this.markPrevious();=0A= this.render();=0A= if(navigator.appVersion.indexOf('AppleWebKit')>0) = Event.stop(event);=0A= return;=0A= case Event.KEY_DOWN:=0A= this.markNext();=0A= this.render();=0A= if(navigator.appVersion.indexOf('AppleWebKit')>0) = Event.stop(event);=0A= return;=0A= }=0A= else =0A= if(event.keyCode=3D=3DEvent.KEY_TAB || = event.keyCode=3D=3DEvent.KEY_RETURN || =0A= (navigator.appVersion.indexOf('AppleWebKit') > 0 && = event.keyCode =3D=3D 0)) return;=0A= =0A= this.changed =3D true;=0A= this.hasFocus =3D true;=0A= =0A= if(this.observer) clearTimeout(this.observer);=0A= this.observer =3D =0A= setTimeout(this.onObserverEvent.bind(this), = this.options.frequency*1000);=0A= },=0A= =0A= activate: function() {=0A= this.changed =3D false;=0A= this.hasFocus =3D true;=0A= this.getUpdatedChoices();=0A= },=0A= =0A= onHover: function(event) {=0A= var element =3D Event.findElement(event, 'LI');=0A= if(this.index !=3D element.autocompleteIndex) =0A= {=0A= this.index =3D element.autocompleteIndex;=0A= this.render();=0A= }=0A= Event.stop(event);=0A= },=0A= =0A= onClick: function(event) {=0A= var element =3D Event.findElement(event, 'LI');=0A= this.index =3D element.autocompleteIndex;=0A= this.selectEntry();=0A= this.hide();=0A= },=0A= =0A= onBlur: function(event) {=0A= // needed to make click events working=0A= setTimeout(this.hide.bind(this), 250);=0A= this.hasFocus =3D false;=0A= this.active =3D false; =0A= }, =0A= =0A= render: function() {=0A= if(this.entryCount > 0) {=0A= for (var i =3D 0; i < this.entryCount; i++)=0A= this.index=3D=3Di ? =0A= Element.addClassName(this.getEntry(i),"selected") : =0A= Element.removeClassName(this.getEntry(i),"selected");=0A= =0A= if(this.hasFocus) { =0A= this.show();=0A= this.active =3D true;=0A= }=0A= } else {=0A= this.active =3D false;=0A= this.hide();=0A= }=0A= },=0A= =0A= markPrevious: function() {=0A= if(this.index > 0) this.index--=0A= else this.index =3D this.entryCount-1;=0A= },=0A= =0A= markNext: function() {=0A= if(this.index < this.entryCount-1) this.index++=0A= else this.index =3D 0;=0A= },=0A= =0A= getEntry: function(index) {=0A= return this.update.firstChild.childNodes[index];=0A= },=0A= =0A= getCurrentEntry: function() {=0A= return this.getEntry(this.index);=0A= },=0A= =0A= selectEntry: function() {=0A= this.active =3D false;=0A= this.updateElement(this.getCurrentEntry());=0A= },=0A= =0A= updateElement: function(selectedElement) {=0A= if (this.options.updateElement) {=0A= this.options.updateElement(selectedElement);=0A= return;=0A= }=0A= var value =3D '';=0A= if (this.options.select) {=0A= var nodes =3D document.getElementsByClassName(this.options.select, = selectedElement) || [];=0A= if(nodes.length>0) value =3D Element.collectTextNodes(nodes[0], = this.options.select);=0A= } else=0A= value =3D Element.collectTextNodesIgnoreClass(selectedElement, = 'informal');=0A= =0A= var lastTokenPos =3D this.findLastToken();=0A= if (lastTokenPos !=3D -1) {=0A= var newValue =3D this.element.value.substr(0, lastTokenPos + 1);=0A= var whitespace =3D this.element.value.substr(lastTokenPos + = 1).match(/^\s+/);=0A= if (whitespace)=0A= newValue +=3D whitespace[0];=0A= this.element.value =3D newValue + value;=0A= } else {=0A= this.element.value =3D value;=0A= }=0A= this.element.focus();=0A= =0A= if (this.options.afterUpdateElement)=0A= this.options.afterUpdateElement(this.element, selectedElement);=0A= },=0A= =0A= updateChoices: function(choices) {=0A= if(!this.changed && this.hasFocus) {=0A= this.update.innerHTML =3D choices;=0A= Element.cleanWhitespace(this.update);=0A= Element.cleanWhitespace(this.update.firstChild);=0A= =0A= if(this.update.firstChild && this.update.firstChild.childNodes) {=0A= this.entryCount =3D =0A= this.update.firstChild.childNodes.length;=0A= for (var i =3D 0; i < this.entryCount; i++) {=0A= var entry =3D this.getEntry(i);=0A= entry.autocompleteIndex =3D i;=0A= this.addObservers(entry);=0A= }=0A= } else { =0A= this.entryCount =3D 0;=0A= }=0A= =0A= this.stopIndicator();=0A= =0A= this.index =3D 0;=0A= this.render();=0A= }=0A= },=0A= =0A= addObservers: function(element) {=0A= Event.observe(element, "mouseover", = this.onHover.bindAsEventListener(this));=0A= Event.observe(element, "click", = this.onClick.bindAsEventListener(this));=0A= },=0A= =0A= onObserverEvent: function() {=0A= this.changed =3D false; =0A= if(this.getToken().length>=3Dthis.options.minChars) {=0A= this.startIndicator();=0A= this.getUpdatedChoices();=0A= } else {=0A= this.active =3D false;=0A= this.hide();=0A= }=0A= },=0A= =0A= getToken: function() {=0A= var tokenPos =3D this.findLastToken();=0A= if (tokenPos !=3D -1)=0A= var ret =3D this.element.value.substr(tokenPos + = 1).replace(/^\s+/,'').replace(/\s+$/,'');=0A= else=0A= var ret =3D this.element.value;=0A= =0A= return /\n/.test(ret) ? '' : ret;=0A= },=0A= =0A= findLastToken: function() {=0A= var lastTokenPos =3D -1;=0A= =0A= for (var i=3D0; i lastTokenPos)=0A= lastTokenPos =3D thisTokenPos;=0A= }=0A= return lastTokenPos;=0A= }=0A= }=0A= =0A= Ajax.Autocompleter =3D Class.create();=0A= Object.extend(Object.extend(Ajax.Autocompleter.prototype, = Autocompleter.Base.prototype), {=0A= initialize: function(element, update, url, options) {=0A= this.baseInitialize(element, update, options);=0A= this.options.asynchronous =3D true;=0A= this.options.onComplete =3D this.onComplete.bind(this);=0A= this.options.defaultParams =3D this.options.parameters || null;=0A= this.url =3D url;=0A= },=0A= =0A= getUpdatedChoices: function() {=0A= entry =3D encodeURIComponent(this.options.paramName) + '=3D' + =0A= encodeURIComponent(this.getToken());=0A= =0A= this.options.parameters =3D this.options.callback ?=0A= this.options.callback(this.element, entry) : entry;=0A= =0A= if(this.options.defaultParams) =0A= this.options.parameters +=3D '&' + this.options.defaultParams;=0A= =0A= new Ajax.Request(this.url, this.options);=0A= },=0A= =0A= onComplete: function(request) {=0A= this.updateChoices(request.responseText);=0A= }=0A= =0A= });=0A= =0A= // The local array autocompleter. Used when you'd prefer to=0A= // inject an array of autocompletion options into the page, rather=0A= // than sending out Ajax queries, which can be quite slow sometimes.=0A= //=0A= // The constructor takes four parameters. The first two are, as usual,=0A= // the id of the monitored textbox, and id of the autocompletion menu.=0A= // The third is the array you want to autocomplete from, and the fourth=0A= // is the options block.=0A= //=0A= // Extra local autocompletion options:=0A= // - choices - How many autocompletion choices to offer=0A= //=0A= // - partialSearch - If false, the autocompleter will match entered=0A= // text only at the beginning of strings in the =0A= // autocomplete array. Defaults to true, which will=0A= // match text at the beginning of any *word* in the=0A= // strings in the autocomplete array. If you want to=0A= // search anywhere in the string, additionally set=0A= // the option fullSearch to true (default: off).=0A= //=0A= // - fullSsearch - Search anywhere in autocomplete array strings.=0A= //=0A= // - partialChars - How many characters to enter before triggering=0A= // a partial match (unlike minChars, which defines=0A= // how many characters are required to do any match=0A= // at all). Defaults to 2.=0A= //=0A= // - ignoreCase - Whether to ignore case when autocompleting.=0A= // Defaults to true.=0A= //=0A= // It's possible to pass in a custom function as the 'selector' =0A= // option, if you prefer to write your own autocompletion logic.=0A= // In that case, the other options above will not apply unless=0A= // you support them.=0A= =0A= Autocompleter.Local =3D Class.create();=0A= Autocompleter.Local.prototype =3D Object.extend(new = Autocompleter.Base(), {=0A= initialize: function(element, update, array, options) {=0A= this.baseInitialize(element, update, options);=0A= this.options.array =3D array;=0A= },=0A= =0A= getUpdatedChoices: function() {=0A= this.updateChoices(this.options.selector(this));=0A= },=0A= =0A= setOptions: function(options) {=0A= this.options =3D Object.extend({=0A= choices: 10,=0A= partialSearch: true,=0A= partialChars: 2,=0A= ignoreCase: true,=0A= fullSearch: false,=0A= selector: function(instance) {=0A= var ret =3D []; // Beginning matches=0A= var partial =3D []; // Inside matches=0A= var entry =3D instance.getToken();=0A= var count =3D 0;=0A= =0A= for (var i =3D 0; i < instance.options.array.length && =0A= ret.length < instance.options.choices ; i++) { =0A= =0A= var elem =3D instance.options.array[i];=0A= var foundPos =3D instance.options.ignoreCase ? =0A= elem.toLowerCase().indexOf(entry.toLowerCase()) : =0A= elem.indexOf(entry);=0A= =0A= while (foundPos !=3D -1) {=0A= if (foundPos =3D=3D 0 && elem.length !=3D entry.length) { =0A= ret.push("
  • " + elem.substr(0, entry.length) + = "" + =0A= elem.substr(entry.length) + "
  • ");=0A= break;=0A= } else if (entry.length >=3D instance.options.partialChars = && =0A= instance.options.partialSearch && foundPos !=3D -1) {=0A= if (instance.options.fullSearch || = /\s/.test(elem.substr(foundPos-1,1))) {=0A= partial.push("
  • " + elem.substr(0, foundPos) + = "" +=0A= elem.substr(foundPos, entry.length) + "" + = elem.substr(=0A= foundPos + entry.length) + "
  • ");=0A= break;=0A= }=0A= }=0A= =0A= foundPos =3D instance.options.ignoreCase ? =0A= elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + = 1) : =0A= elem.indexOf(entry, foundPos + 1);=0A= =0A= }=0A= }=0A= if (partial.length)=0A= ret =3D ret.concat(partial.slice(0, instance.options.choices - = ret.length))=0A= return "
      " + ret.join('') + "
    ";=0A= }=0A= }, options || {});=0A= }=0A= });=0A= =0A= // AJAX in-place editor=0A= //=0A= // see documentation on = http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor=0A= =0A= // Use this if you notice weird scrolling problems on some browsers,=0A= // the DOM might be a bit confused when this gets called so do this=0A= // waits 1 ms (with setTimeout) until it does the activation=0A= Field.scrollFreeActivate =3D function(field) {=0A= setTimeout(function() {=0A= Field.activate(field);=0A= }, 1);=0A= }=0A= =0A= Ajax.InPlaceEditor =3D Class.create();=0A= Ajax.InPlaceEditor.defaultHighlightColor =3D "#FFFF99";=0A= Ajax.InPlaceEditor.prototype =3D {=0A= initialize: function(element, url, options) {=0A= this.url =3D url;=0A= this.element =3D $(element);=0A= =0A= this.options =3D Object.extend({=0A= okButton: true,=0A= okText: "ok",=0A= cancelLink: true,=0A= cancelText: "cancel",=0A= savingText: "Saving...",=0A= clickToEditText: "Click to edit",=0A= okText: "ok",=0A= rows: 1,=0A= onComplete: function(transport, element) {=0A= new Effect.Highlight(element, {startcolor: = this.options.highlightcolor});=0A= },=0A= onFailure: function(transport) {=0A= alert("Error communicating with the server: " + = transport.responseText.stripTags());=0A= },=0A= callback: function(form) {=0A= return Form.serialize(form);=0A= },=0A= handleLineBreaks: true,=0A= loadingText: 'Loading...',=0A= savingClassName: 'inplaceeditor-saving',=0A= loadingClassName: 'inplaceeditor-loading',=0A= formClassName: 'inplaceeditor-form',=0A= highlightcolor: Ajax.InPlaceEditor.defaultHighlightColor,=0A= highlightendcolor: "#FFFFFF",=0A= externalControl: null,=0A= submitOnBlur: false,=0A= ajaxOptions: {},=0A= evalScripts: false=0A= }, options || {});=0A= =0A= if(!this.options.formId && this.element.id) {=0A= this.options.formId =3D this.element.id + "-inplaceeditor";=0A= if ($(this.options.formId)) {=0A= // there's already a form with that name, don't specify an id=0A= this.options.formId =3D null;=0A= }=0A= }=0A= =0A= if (this.options.externalControl) {=0A= this.options.externalControl =3D $(this.options.externalControl);=0A= }=0A= =0A= this.originalBackground =3D Element.getStyle(this.element, = 'background-color');=0A= if (!this.originalBackground) {=0A= this.originalBackground =3D "transparent";=0A= }=0A= =0A= this.element.title =3D this.options.clickToEditText;=0A= =0A= this.onclickListener =3D = this.enterEditMode.bindAsEventListener(this);=0A= this.mouseoverListener =3D this.enterHover.bindAsEventListener(this);=0A= this.mouseoutListener =3D this.leaveHover.bindAsEventListener(this);=0A= Event.observe(this.element, 'click', this.onclickListener);=0A= Event.observe(this.element, 'mouseover', this.mouseoverListener);=0A= Event.observe(this.element, 'mouseout', this.mouseoutListener);=0A= if (this.options.externalControl) {=0A= Event.observe(this.options.externalControl, 'click', = this.onclickListener);=0A= Event.observe(this.options.externalControl, 'mouseover', = this.mouseoverListener);=0A= Event.observe(this.options.externalControl, 'mouseout', = this.mouseoutListener);=0A= }=0A= },=0A= enterEditMode: function(evt) {=0A= if (this.saving) return;=0A= if (this.editing) return;=0A= this.editing =3D true;=0A= this.onEnterEditMode();=0A= if (this.options.externalControl) {=0A= Element.hide(this.options.externalControl);=0A= }=0A= Element.hide(this.element);=0A= this.createForm();=0A= this.element.parentNode.insertBefore(this.form, this.element);=0A= Field.scrollFreeActivate(this.editField);=0A= // stop the event to avoid a page refresh in Safari=0A= if (evt) {=0A= Event.stop(evt);=0A= }=0A= return false;=0A= },=0A= createForm: function() {=0A= this.form =3D document.createElement("form");=0A= this.form.id =3D this.options.formId;=0A= Element.addClassName(this.form, this.options.formClassName)=0A= this.form.onsubmit =3D this.onSubmit.bind(this);=0A= =0A= this.createEditField();=0A= =0A= if (this.options.textarea) {=0A= var br =3D document.createElement("br");=0A= this.form.appendChild(br);=0A= }=0A= =0A= if (this.options.okButton) {=0A= okButton =3D document.createElement("input");=0A= okButton.type =3D "submit";=0A= okButton.value =3D this.options.okText;=0A= okButton.className =3D 'editor_ok_button';=0A= this.form.appendChild(okButton);=0A= }=0A= =0A= if (this.options.cancelLink) {=0A= cancelLink =3D document.createElement("a");=0A= cancelLink.href =3D "#";=0A= = cancelLink.appendChild(document.createTextNode(this.options.cancelText));=0A= cancelLink.onclick =3D this.onclickCancel.bind(this);=0A= cancelLink.className =3D 'editor_cancel'; =0A= this.form.appendChild(cancelLink);=0A= }=0A= },=0A= hasHTMLLineBreaks: function(string) {=0A= if (!this.options.handleLineBreaks) return false;=0A= return string.match(/
    /i);=0A= },=0A= convertHTMLLineBreaks: function(string) {=0A= return string.replace(/
    /gi, "\n").replace(//gi, = "\n").replace(/<\/p>/gi, "\n").replace(/

    /gi, "");=0A= },=0A= createEditField: function() {=0A= var text;=0A= if(this.options.loadTextURL) {=0A= text =3D this.options.loadingText;=0A= } else {=0A= text =3D this.getText();=0A= }=0A= =0A= var obj =3D this;=0A= =0A= if (this.options.rows =3D=3D 1 && !this.hasHTMLLineBreaks(text)) {=0A= this.options.textarea =3D false;=0A= var textField =3D document.createElement("input");=0A= textField.obj =3D this;=0A= textField.type =3D "text";=0A= textField.name =3D "value";=0A= textField.value =3D text;=0A= textField.style.backgroundColor =3D this.options.highlightcolor;=0A= textField.className =3D 'editor_field';=0A= var size =3D this.options.size || this.options.cols || 0;=0A= if (size !=3D 0) textField.size =3D size;=0A= if (this.options.submitOnBlur)=0A= textField.onblur =3D this.onSubmit.bind(this);=0A= this.editField =3D textField;=0A= } else {=0A= this.options.textarea =3D true;=0A= var textArea =3D document.createElement("textarea");=0A= textArea.obj =3D this;=0A= textArea.name =3D "value";=0A= textArea.value =3D this.convertHTMLLineBreaks(text);=0A= textArea.rows =3D this.options.rows;=0A= textArea.cols =3D this.options.cols || 40;=0A= textArea.className =3D 'editor_field'; =0A= if (this.options.submitOnBlur)=0A= textArea.onblur =3D this.onSubmit.bind(this);=0A= this.editField =3D textArea;=0A= }=0A= =0A= if(this.options.loadTextURL) {=0A= this.loadExternalText();=0A= }=0A= this.form.appendChild(this.editField);=0A= },=0A= getText: function() {=0A= return this.element.innerHTML;=0A= },=0A= loadExternalText: function() {=0A= Element.addClassName(this.form, this.options.loadingClassName);=0A= this.editField.disabled =3D true;=0A= new Ajax.Request(=0A= this.options.loadTextURL,=0A= Object.extend({=0A= asynchronous: true,=0A= onComplete: this.onLoadedExternalText.bind(this)=0A= }, this.options.ajaxOptions)=0A= );=0A= },=0A= onLoadedExternalText: function(transport) {=0A= Element.removeClassName(this.form, this.options.loadingClassName);=0A= this.editField.disabled =3D false;=0A= this.editField.value =3D transport.responseText.stripTags();=0A= },=0A= onclickCancel: function() {=0A= this.onComplete();=0A= this.leaveEditMode();=0A= return false;=0A= },=0A= onFailure: function(transport) {=0A= this.options.onFailure(transport);=0A= if (this.oldInnerHTML) {=0A= this.element.innerHTML =3D this.oldInnerHTML;=0A= this.oldInnerHTML =3D null;=0A= }=0A= return false;=0A= },=0A= onSubmit: function() {=0A= // onLoading resets these so we need to save them away for the Ajax = call=0A= var form =3D this.form;=0A= var value =3D this.editField.value;=0A= =0A= // do this first, sometimes the ajax call returns before we get a = chance to switch on Saving...=0A= // which means this will actually switch on Saving... *after* we've = left edit mode causing Saving...=0A= // to be displayed indefinitely=0A= this.onLoading();=0A= =0A= if (this.options.evalScripts) {=0A= new Ajax.Request(=0A= this.url, Object.extend({=0A= parameters: this.options.callback(form, value),=0A= onComplete: this.onComplete.bind(this),=0A= onFailure: this.onFailure.bind(this),=0A= asynchronous:true, =0A= evalScripts:true=0A= }, this.options.ajaxOptions));=0A= } else {=0A= new Ajax.Updater(=0A= { success: this.element,=0A= // don't update on failure (this could be an option)=0A= failure: null }, =0A= this.url, Object.extend({=0A= parameters: this.options.callback(form, value),=0A= onComplete: this.onComplete.bind(this),=0A= onFailure: this.onFailure.bind(this)=0A= }, this.options.ajaxOptions));=0A= }=0A= // stop the event to avoid a page refresh in Safari=0A= if (arguments.length > 1) {=0A= Event.stop(arguments[0]);=0A= }=0A= return false;=0A= },=0A= onLoading: function() {=0A= this.saving =3D true;=0A= this.removeForm();=0A= this.leaveHover();=0A= this.showSaving();=0A= },=0A= showSaving: function() {=0A= this.oldInnerHTML =3D this.element.innerHTML;=0A= this.element.innerHTML =3D this.options.savingText;=0A= Element.addClassName(this.element, this.options.savingClassName);=0A= this.element.style.backgroundColor =3D this.originalBackground;=0A= Element.show(this.element);=0A= },=0A= removeForm: function() {=0A= if(this.form) {=0A= if (this.form.parentNode) Element.remove(this.form);=0A= this.form =3D null;=0A= }=0A= },=0A= enterHover: function() {=0A= if (this.saving) return;=0A= this.element.style.backgroundColor =3D this.options.highlightcolor;=0A= if (this.effect) {=0A= this.effect.cancel();=0A= }=0A= Element.addClassName(this.element, this.options.hoverClassName)=0A= },=0A= leaveHover: function() {=0A= if (this.options.backgroundColor) {=0A= this.element.style.backgroundColor =3D this.oldBackground;=0A= }=0A= Element.removeClassName(this.element, this.options.hoverClassName)=0A= if (this.saving) return;=0A= this.effect =3D new Effect.Highlight(this.element, {=0A= startcolor: this.options.highlightcolor,=0A= endcolor: this.options.highlightendcolor,=0A= restorecolor: this.originalBackground=0A= });=0A= },=0A= leaveEditMode: function() {=0A= Element.removeClassName(this.element, this.options.savingClassName);=0A= this.removeForm();=0A= this.leaveHover();=0A= this.element.style.backgroundColor =3D this.originalBackground;=0A= Element.show(this.element);=0A= if (this.options.externalControl) {=0A= Element.show(this.options.externalControl);=0A= }=0A= this.editing =3D false;=0A= this.saving =3D false;=0A= this.oldInnerHTML =3D null;=0A= this.onLeaveEditMode();=0A= },=0A= onComplete: function(transport) {=0A= this.leaveEditMode();=0A= this.options.onComplete.bind(this)(transport, this.element);=0A= },=0A= onEnterEditMode: function() {},=0A= onLeaveEditMode: function() {},=0A= dispose: function() {=0A= if (this.oldInnerHTML) {=0A= this.element.innerHTML =3D this.oldInnerHTML;=0A= }=0A= this.leaveEditMode();=0A= Event.stopObserving(this.element, 'click', this.onclickListener);=0A= Event.stopObserving(this.element, 'mouseover', = this.mouseoverListener);=0A= Event.stopObserving(this.element, 'mouseout', this.mouseoutListener);=0A= if (this.options.externalControl) {=0A= Event.stopObserving(this.options.externalControl, 'click', = this.onclickListener);=0A= Event.stopObserving(this.options.externalControl, 'mouseover', = this.mouseoverListener);=0A= Event.stopObserving(this.options.externalControl, 'mouseout', = this.mouseoutListener);=0A= }=0A= }=0A= };=0A= =0A= Ajax.InPlaceCollectionEditor =3D Class.create();=0A= Object.extend(Ajax.InPlaceCollectionEditor.prototype, = Ajax.InPlaceEditor.prototype);=0A= Object.extend(Ajax.InPlaceCollectionEditor.prototype, {=0A= createEditField: function() {=0A= if (!this.cached_selectTag) {=0A= var selectTag =3D document.createElement("select");=0A= var collection =3D this.options.collection || [];=0A= var optionTag;=0A= collection.each(function(e,i) {=0A= optionTag =3D document.createElement("option");=0A= optionTag.value =3D (e instanceof Array) ? e[0] : e;=0A= if(this.options.value=3D=3DoptionTag.value) optionTag.selected = =3D true;=0A= optionTag.appendChild(document.createTextNode((e instanceof = Array) ? e[1] : e));=0A= selectTag.appendChild(optionTag);=0A= }.bind(this));=0A= this.cached_selectTag =3D selectTag;=0A= }=0A= =0A= this.editField =3D this.cached_selectTag;=0A= if(this.options.loadTextURL) this.loadExternalText();=0A= this.form.appendChild(this.editField);=0A= this.options.callback =3D function(form, value) {=0A= return "value=3D" + encodeURIComponent(value);=0A= }=0A= }=0A= });=0A= =0A= // Delayed observer, like Form.Element.Observer, =0A= // but waits for delay after last key input=0A= // Ideal for live-search fields=0A= =0A= Form.Element.DelayedObserver =3D Class.create();=0A= Form.Element.DelayedObserver.prototype =3D {=0A= initialize: function(element, delay, callback) {=0A= this.delay =3D delay || 0.5;=0A= this.element =3D $(element);=0A= this.callback =3D callback;=0A= this.timer =3D null;=0A= this.lastValue =3D $F(this.element); =0A= = Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListen= er(this));=0A= },=0A= delayedListener: function(event) {=0A= if(this.lastValue =3D=3D $F(this.element)) return;=0A= if(this.timer) clearTimeout(this.timer);=0A= this.timer =3D setTimeout(this.onTimerEvent.bind(this), this.delay * = 1000);=0A= this.lastValue =3D $F(this.element);=0A= },=0A= onTimerEvent: function() {=0A= this.timer =3D null;=0A= this.callback(this.element, $F(this.element));=0A= }=0A= };=0A= ------=_NextPart_000_0078_01CA0A00.0A0B4930 Content-Type: application/octet-stream Content-Transfer-Encoding: quoted-printable Content-Location: http://www.admissions.caltech.edu/javascripts/application.js?1243905981 // Place your application-specific JavaScript functions and classes here=0A= // This file is automatically included by javascript_include_tag = :defaults=0A= =0A= function popup(mylink, windowname) {=0A= if (! window.focus)return true;=0A= var href;=0A= if (typeof(mylink) =3D=3D 'string')=0A= href=3Dmylink;=0A= else=0A= href=3Dmylink.href;=0A= window.open(href, windowname, = 'width=3D360,height=3D320,scrollbars=3Dyes');=0A= return false;=0A= }=0A= ------=_NextPart_000_0078_01CA0A00.0A0B4930--