Content-Type: multipart/related; start=; boundary=----------GRdmKkLcvs6qnZ1AQyG3wo Content-Location: http://www.sciencedaily.com/releases/2010/02/100224132651.htm Subject: =?utf-8?Q?Psychiatry's=20main=20method=20to=20prevent=20mistaken=20diagnoses=20of=20depression=20doesn't=20work:=20study?= MIME-Version: 1.0 ------------GRdmKkLcvs6qnZ1AQyG3wo Content-Disposition: inline; filename=100224132651.htm Content-Type: text/html; charset=iso-8859-1; name=100224132651.htm Content-ID: Content-Location: http://www.sciencedaily.com/releases/2010/02/100224132651.htm Content-Transfer-Encoding: Quoted-Printable Psychiatry's main method to prevent mistaken diagnoses of depress= ion doesn't work: study

Science News<= /h1>

3D"" Share &nbs= p; 3D"" Blog   3D"" Cite<= /div>
=

Psychiatry's Main Method to Preve= nt Mistaken Diagnoses of Depression Doesn't Work: Study

=

ScienceDaily (Feb. 25, 2010) — A study in the March edition of the American Journal of = Psychiatry senior-authored by Jerome C. Wakefield, a professor at t= he Silver School of Social Work at New York University with Mark Schmitz= of Temple University and Judith Baer of Rutgers University, empirically= challenges the effectiveness of psychiatrists' official diagnostic manu= al in preventing mistaken, false-positive diagnoses of depression.

=

=

The findings concerning the American Psychiatric Association's Diagno= stic and Statistical Manual of Mental Disorders' (DSM) criteria for diag= nosing depression rebuts recent criticism of earlier research by Wakefie= ld. That earlier research suggested that misdiagnoses of depression are = widespread, and touched off considerable controversy.

According to the DSM, the diagnosis of major depression requires the = presence -- for two weeks -- of at least five possible symptoms out of a= list of nine, which include, for example, sadness, loss of interest in = usual activities, lowered appetite, fatigue, and insomnia. However, thes= e symptoms can also occur in normal responses to loss and stress. False = positive diagnoses occur when someone reacting with intense normal sadne= ss to life's stresses is misdiagnosed as having major depressive disorde= r. Recent studies suggest that a very large percentage of people have su= ch symptoms for two weeks or longer at some point in their lives; theref= ore, how many of these individuals really are afflicted by a mental diso= rder or are responding within normal limits to loss or stress has been a= matter of debate.

The journal article examines the primary method by which the official= diagnostic criteria for depression -the Clinical Significance Criterion= (CSC) -- are supposed to distinguish normal from disordered cases and t= hereby prevent false positive diagnoses. The CSC was added to the sympto= m and duration criteria in the DSM's fourth edition in 1994 (DSM-IV) in = the wake of criticism that too many of the listed symptoms -- loss of ap= petite, say, or sadness, insomnia, or fatigue -- were being identified a= s evidence of major depressive disorder even when they were mild and pos= sibly normal responses to distress arising from such events as the loss = of a job, the dissolution of a marriage, or other triggers for sadness, = and that such errors might be contributing to the very high reported rat= es of untreated depression in the American population drawn from epidemi= ological surveys.

Under the 1994 DSM revision, in addition to the two weeks of sadness = and other depressive symptoms, a specified minimal "clinically sign= ificant" threshold in the form of harm due to distress or role impa= irment (in occupational, family, or interpersonal contexts) must have re= sulted from the symptoms in evidence before they could be considered sig= ns of depression. Researchers have subsequently assumed -- without defin= itive evidence -- that the CSC eliminates substantial numbers of false p= ositives.

In a 1999 article in American Journal of Psychiatry, Wakefie= ld and co-author Robert Spitzer, the originator of the modern DSM sympto= m-based approach to diagnosis, argued that the CSC would not eliminate f= alse-positive diagnoses of major depression because anyone having the sp= ecified symptoms -- even an individual experiencing a normal intense rea= ction to loss -- would be likely to experience distress or role impairme= nt. Thus, they asserted, the CSC was redundant with the symptom criteria= and could not distinguish normal from disordered symptoms -- a claim th= at has come to be known as the "redundancy hypothesis." The re= searchers' argument was purely conceptual, and largely ignored.

The issue of whether the redundancy hypothesis is correct became sudd= enly more important after Wakefield senior-authored a much-discussed 200= 7 article in Archives of General Psychiatry. The article argued that the= re were indeed large numbers of false-positive diagnoses of major depres= sion in community surveys of mental disorder -- possibly as high as 25% = to 33%. However, that study used data from a national survey that was co= nducted before the DSM-IV's addition of the CSC to the major depression = diagnostic criteria. Thus, there was no CSC in the criteria that Wakefie= ld and his team used to identify cases of major depression at the time.<= /p>

Critics of that study argued that the lack of a CSC was fatal to the = argument because if the CSC had been used, then the supposed false-posit= ive diagnoses that Wakefield and his group identified would likely have = been eliminated as cases too mild for diagnosis. For example, one noted = psychiatrist argued that Wakefield's results were due to a "glitch&= quot; in the diagnostic criteria Wakefield used, and that the diagnosed = individuals identified by Wakefield as having normal reactions would hav= e been eliminated from the depression category if current diagnostic cri= teria including the CSC were used.

A paper later submitted by Wakefield that built on the 2007 article w= as rejected for publication partly based on a reviewer's assertion that = if the CSC had been included in the earlier study, the supposed false po= sitives likely would have been eliminated. So, the issue of whether the = CSC is in fact redundant or actually eliminated many false-positive majo= r depression diagnoses became key to the debate, which is still ongoing,= about the prevalence of depressive disorder.

The latest study, coming in the American Journal of Psychiatry, offers an empirical demonstration, based on nationally representativ= e data, that the Critical Significance Criterion fails to distinguish no= rmal from disordered conditions. In this analysis, Wakefield undertook t= o evaluate independently the impact of the CSC on epidemiological survey= estimates of major depressive disorder by using data from a later surve= y that included a carefully worked out CSC criterion for depression whos= e inclusion, according to the claims of its authors, was an effective wa= y of eliminating former false positives. Wakefield then compared estimat= es of depressive disorder with and without the use of the CSC.

Confirming the redundancy hypothesis put forward a decade earlier, he= found that the CSC eliminated virtually no one from diagnosis -- in fac= t, even among those who experienced prolonged sadness without meeting ot= her diagnostic criteria for depression, about 94% of them satisfied the = CSC just on the basis of the "distress" component alone. Thus = the Clinical Significance Criterion, according to Wakefield and his co-a= uthors, is not doing what it is supposed to do -- reducing the over-diag= nosis of normal mood fluctuations as depression -- and the issue of prev= enting false positives needs to be revisited. And contrary to critics' s= peculations, the earlier findings suggesting many false positives in com= munity surveys cannot be dismissed on the basis of the CSC.

The results take on further importance, Wakefield says, in light of p= roposals for changes to the DSM in a revision currently taking place tha= t will lead to DSM-V. Concern about increasing false positives is at the= heart of criticisms of the proposals that have been put forward by lead= ing psychiatrists, including Allen Frances, the Editor of DSM-IV. Moreov= er, some of the proposals seem to rely heavily on the CSC to justify dia= gnosis of disorder even when symptoms are minimal -- when in fact the cu= rrent research underscores that normal distress can easily satisfy the C= SC.

=
Email = or share this story:
| More

=

Story Source:

=
Adapted from materials provided by New York U= niversity.
=

=

Journal Reference:

  1. Jerome C. Wakefield, Mark F. Schmitz, Judith C. Baer. Does t= he DSM-IV Clinical Significance Criterion for Major Depression Reduce Fa= lse Positives? Evidence From the National Comorbidity Survey Replication= . American Journal of Psychiatry, 2010; DOI: 10.1= 176/appi.ajp.2009.09040553
=
APA

= MLA

Note: If no author is given, the source is cited instead.

=
=
=

Related Stories


=
Errors In Diagnosis Of Depression Lead To Over And Under Di= agnosis In Primary Care (Aug. 3= , 2009) — A meta-analysis of more than 50,000 patients has s= hown that general practitioners have great difficulty separating those w= ith and without depression, with substantial numbers of missed and ... &= nbsp;> read more
Many Physicians Not Using Estab= lished Criteria When Diagnosing Major Depressive Disorder in Patients, S= tudy Finds (Feb. 2, 2010) — A new study indicates that a majority of non-psychiatrist physi= cians and a substantial minority of psychiatrists reported that they oft= en do not use the criteria outlined in the Diagnostic and ...  >=  r= ead more
Depression And Anxiety Disorders Of Adol= escents Are Not The Same Thing = (Sep. 24, 2009) — Adolescent depression and anxiety disorder= s are two distinct psychiatric disorders, according to a recent ... &nbs= p;> read more
Successful Treatment Of Mothers Wi= th Depression Helps Their Children, Too (Mar. 23, 2006) — Children whose mothers are depres= sed are more likely to suffer from anxiety, mental-health problems and d= isruptive behavior than those whose moms aren't. And if the mothers don'= t get better, these ...  > read more
Diagno= ses Of Fatigue In Primary Care Patients (Oct. 26, 2009) — Patients who visit their family d= octors for fatigue have a wide range of diagnoses yet the prevalence of = serious illness was low, according to a Dutch ...  > read more
Elderly Most at Risk for Major Depression Identified= (Dec. 22, 2009) — = Researchers have pinpointed the prime factors identifying which elderly = persons are at the highest risk for developing major ...  > = ;read m= ore
Is There A Developmental Component To The Ris= k For Depression? (Dec. 11, 200= 7) — Psychiatrists remain divided as to how to define and cl= assify the mood and anxiety disorders, the most common mental disorders.= Authors of a new study explain that their findings support a proposed .= ..  > read more
Using Genetics To Improve Tra= ditional Psychiatric Diagnoses = (July 17, 2008) — Psychiatry has begun the laborious effort = of preparing the DSM-V, the new iteration of its diagnostic manual. In s= o doing, it once again wrestles with the task set by Carl Linnaeus, to "= cleave nature ...  > read more
=
=
=

Search = ScienceDaily

Number of stories in archives: 82,027

Find with keyword(s):
=  
Enter a key= word or phrase to search ScienceDaily's archives for related news topics= ,
the latest news stories, reference articles, science videos, ima= ges, and books.
=
=
 
=
=

Science Video= News


3D""

Lost And Found

Cognitive scientists ran an experiment to understand how the b= rain searches for an object with a known shape. They asked subjects to t= rack the. ...  > full story
=
=

Breaking News

... from NewsDaily.com

=
3D""

In Other News ...

Copyright Reuters 2008. See Re= strictions.

Free Sub= scriptions

... from ScienceDaily

Get the latest science news with our free email newsletters, upd= ated daily and weekly. Or view hourly updated newsfeeds in your RSS read= er:

Feedback

... we want to hear from you!
=

Tell us what you think of the new ScienceDaily -- we welcome bot= h positive and negative comments. Have any problems using the site? Ques= tions?
  • =
About This Site  |  Editorial Staff  | = ; Awards & Reviews  |  Contribute News  |  Advertise With Us  |  P= rivacy Policy  |  Terms of Use<= br /> Copyright © 1995-2009 ScienceDaily= LLC  —  All rights reserved  —  Contact= : editor@sciencedaily.com=
Part of the iVillage Your = Total Health Network
3D""
Include this item in your blog or web site:
Cite this article in your essay, paper, or repor= t:
Email this page's link to a friend or colleague= :
  • =
------------GRdmKkLcvs6qnZ1AQyG3wo Content-Disposition: inline Content-Type: image/gif Content-Location: http://www.sciencedaily.com/images/top.gif Content-Transfer-Encoding: Base64 R0lGODdhMgCWAPcAAAAAAObm5uDg4Nvb2+vr69XV1dDQ0MrKysXFxb+/v7q6urS0 tK+vr6mpqaSkpJ6enpmZmZOTk46OjoiIiIODg319ffHx8XJycm1tbWdnZ2JiYlxc XFdXV1FRUUxMTEZGRkFBQTs7OzY2NjAwMCsrKyUlJSAgIBoaGhUVFQ8PDwoKCgQE BHh4eFFRUWdnZ8LCwtbW1sfHx+Hh4c7Ozt7e3tLS0re3t+np6cnJyZubm/X19ZiY mKCgoNnZ2aOjo6enp5CQkO/v79HR0YyMjNzc3M/Pz/b29oSEhKurq8zMzIGBgd/f 33x8fLOzs9fX13l5eeLi4nV1dbu7u3FxceTk5MTEx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r78///3xBSjggAQWaOCBBHag4IIMNujggxBG yKAHG3RQ4YUWZojhhhpeyKGHGobo4QYklmjiiSimqOKKJmrg4oswxijjjDTWKCMG GuCoY4487uhjj0D+KGSQGBRp5JFIJqnkkkwiecGTUEYp5ZRUVmmllBVckOWWWnbJ 5ZdehgnmmGJqWcGZaKap5ppstummmhTEKeecdNZp5514zikBBXv22SefgP4paKCE DmpooBIkquiijDbq6KIRPOpopBFUaumlmGaq6aacYvpABJ+GCuqoopZK6qmmpooq qA+06uqrsMbfKuustMLqwK245qrrrrz26muuDDgQ7LDCFkvsscYmi+yyygrLwLPQ RivttNRWa220C2Sr7bbcduvtt+Bym8AC45ZL7rnmpovuuuqayy66CcQr77z01mvv vfjWi8C+/Pbr778AByxwvwbsW/DBCCCscMIML4xwwxA7nLABFFds8cUYZ6zxxhYX 4PHHIIcs8sgklwyyAQIIUEDKK6vs8sotx8yyyy/PTLPMN6es88489+zzz0D7HMDQ RBdt9NFIJ6300RYE0PTTTkcN9dRSV0311VZboPXWXHft9ddgh911QAA7 ------------GRdmKkLcvs6qnZ1AQyG3wo Content-Disposition: inline Content-Type: image/gif Content-Location: http://www.sciencedaily.com/images/bullet_black.gif Content-Transfer-Encoding: Base64 R0lGODlhBQAJAIAAAAAAAP///yH5BAEAAAEALAAAAAAFAAkAAAIMRB5gp9v2YlJs JRQKADs= ------------GRdmKkLcvs6qnZ1AQyG3wo Content-Disposition: inline Content-Type: image/gif Content-Location: http://www.sciencedaily.com/images/blank.gif Content-Transfer-Encoding: Base64 R0lGODlhAQABAIAAAP///////yH5BAEAAAAALAAAAAABAAEAAAICRAEAOw== ------------GRdmKkLcvs6qnZ1AQyG3wo Content-Disposition: inline Content-Type: image/gif Content-Location: http://www.sciencedaily.com/images/gray.gif Content-Transfer-Encoding: Base64 R0lGODlhAQAUAPcAAP///xkZGSsrKyMjIxwcHBQUFAwMDAUFBQMDAwoKChISEjMz MyEhISkpKTExMTg4OEBAQEhISE9PT1dXV19fXwkJlwoKlwoKlwsLlwsLlwwMlwwM lg0Nlg0Nlg4Olg4Olg8Plg8PlhAQlhAQlhERlhERlRISlRISlRMTlRMTlRQUlRQU lRUVlRUVlRYWlRYWlBcXlBcXlBgYlBgYlBkZlBkZlBoalBoalBsbkxsbkxwckxwc kx0dkx0dkx4ekx4ekx8fkx8fkyAgkiAgkiEhkiEhkiIikiIikiMjkiMjkiQkkiQk kiUlkSUlkSYmkSYmkScnkScnkSgokSgokSkpkSkpkSoqkCoqkCsrkCsrkCwskCws kC0tkC0tkC4ukC4ukC8vjy8vjzAwjzAwjzExjzExjzIyjzIyjzMzjzMzjjQ0jjQ0 jjU1jjU1jjY2jjY2jjc3jjc3jjg4jjg4jTk5jTk5jTo6jTo6jTs7jTs7jTw8jTw8 jT09jT09jD4+jD4+jD8/jD8/jEBAjEBAjEFBjEFBjEJCjEJCi0NDi0NDi0REi0RE i0VFi0VFi0ZGi0ZGi0dHi0dHikhIikhIiklJiklJikpKikpKiktLiktLikxMikxM iU1NiU1NiU5OiU5OiU9PiU9PiVBQiVBQiVFRiFFRiFJSiFJSiFNTiFNTiFRUiFRU iFVViFVViFZWh1ZWh1dXh1dXh1hYh1hYh1lZh1lZh1pah1pah1tbhltbhlxchlxc hl1dhl1dhl5ehl5ehl9fhl9fhmBghWBghWFhhWFhhWJihWJihWNjhWNjhWRkhWRk hWVlhGVlhGZmhGZmhGdnhGdnhGhohGhohGlphGlpg2pqg2pqg2trg2trg2xsg2xs g21tg21tg25ug25ugm9vgm9vgnBwgnBwgnFxgnFxgnJygnJygnNzgnNzgXR0gXR0 gXV1gXV1gXZ2gXZ2gXd3gXd3gXh4gXh4gHl5gHl5gHp6gHp6gHt7gHt7gHx8gHx8 gH19gH19f35+f35+fyH5BAEAAAAALAAAAAABABQAAAgZAClMkBABwgMHDRgEUJAA QYIECgIwaOAgIAA7 ------------GRdmKkLcvs6qnZ1AQyG3wo Content-Disposition: inline Content-Type: image/gif Content-Location: http://www.sciencedaily.com/images/red.gif Content-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QAAAgZAClMkAABwgIHDRgYOHAA wQEDDBo0cLAgIAA7 ------------GRdmKkLcvs6qnZ1AQyG3wo Content-Disposition: inline; filename=main8-new.css Content-Type: text/css; charset=iso-8859-1; name=main8-new.css Content-Location: http://www.sciencedaily.com/styles/main8-new.css Content-Transfer-Encoding: 8bit html, body { margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif; color: #000; background: #fff url('/images/top.gif') repeat-x top; font-size: 13px; line-height: 1.2; } #wrapper { width: 1000px; text-align: left; margin: 0 auto; } #content { display: inline; width: 678px; float: left; margin: 92px 0 0 6px; padding: 0 0 10px 0; } #date { text-align: right; padding: 0 0 10px 0; } #textsize { text-align: right; height: 20px; } #title { width: 1000px; position: absolute; top: 160px; margin: 0 auto; } #titleleft { display: inline; width: 678px; float: left; margin: 0 0 0 6px; } #titleleftcontent { padding: 0; } #titleleftcontent h1 { font-size: 20px; } #titleright { display: inline; float: left; text-align: right; width: 310px; } #titlerightcontent { padding: 0; margin: 6px 0 0 0; } #titleside { display: inline; float: left; text-align: right; width: 310px; margin: 6px 6px 0 0; } #titlesidecontent { padding: 0; } #top { border-top: 1px solid #000; } #topleft { display: inline; width: 344px; float: left; } #topleftcontent { margin: 10px 0 0 0; } #topright { display: inline; width: 334px; float: left; } #toprightcontent { margin: 10px 0 0 10px; } #mainleft { display: inline; width: 276px; float: left; } #mainleftcontent { margin: 0; } #mainright { display: inline; width: 240px; float: left; } #mainrightcontent { margin: 0 0 0 10px; } #main { border-top: 1px solid #000; } #mainmenu { display: inline; width: 130px; float: left; } #mainmenucontent { padding: 8px 0 10px 0; } #mainmenucontent ul { } #mainmenucontent li { padding: 0; } #mainlist { display: inline; width: 548px; float: left; } #mainlistcontent { padding: 8px 0 20px 10px; } .botleft { display: inline; width: 222px; float: left; } .botleftcontent { padding: 5px 0 0 0; } .botcenter { display: inline; width: 228px; float: left; } .botcentercontent { padding: 5px 0 0 10px; } .botright { width: 224px; float: left; } .botrightcontent { padding: 5px 0 0 10px; } #side { display: inline; float: right; width: 310px; margin: 92px 6px 0 0; } #sidecontent { margin: 0 0 10px 10px; padding: 5px 0 10px 0; border-top: 1px solid #000; } div.leaderboard { display: inline; float: right; width: 728px; height: 90px; margin: 0; padding: 0; border: none; } div.rectangle { width: 300px; height: 250px; padding: 0; margin: 10px 0; border: none; } div.skyscraper-container { float: right; width: 161px; margin: 7px 0 10px 5px; padding: 0; border: none; } div.skyscraper { width: 160px; height: 600px; margin: 0; padding: 0; border: none; } div.custom { height: 5px; } #header { text-align: center; height: 93px; padding: 5px 5px 0 5px; margin: 0 0 -3px 0; } #headercontent { width: 990px; margin: 0 auto; } #footer { clear: both; width: 100%; padding: 10px; margin: 0; text-align: center; font-size: 13px; background: #ccc; } #footercontents { display: inline; width: 1000px; margin: 0 auto; color: #000; } #footercontents a { color: #000; text-decoration: none; } #footercontents a:hover { color: #000; text-decoration: underline; } #footercontents a.red { color: #900; text-decoration: none; } #footercontents a.red:hover { color: #900; text-decoration: underline; } #searchcontents { display: inline; padding: 5px 10px 0 0; float: right; color: #fff; font-size: 13px; background: transparent; vertical-align: middle; line-height: 15px; } #searchcontents a { color: #fff; text-decoration: none; } #searchcontents a:hover { text-decoration: underline; } #searchcontents input.searchinput { width: 230px; height: 17px; padding: 2px 0 0 2px; margin: 0; border: none; vertical-align: top; } #navbar { width: 100%; position: absolute; top: 97px; left: 0; } #navbarwrapper { width: 1000px; margin: 0 auto; } #navbarcontents { width: 660px; margin: 0; padding: 0 0 0 5px; background: transparent; } ul { margin: 5px 0 5px 15px; padding: 0; } ol { margin: 5px 0 5px 18px; padding: 0; } li { padding: 0 0 5px 0; } ul.black { margin: 5px 0; padding: 0; list-style: none; } ul.black li { padding-left: 12px; background: white url('/images/bullet_black.gif') no-repeat; background-position: 0 3px; } ul.white { list-style-image:url('/images/bullet_white.gif'); } /************* Son-of-Suckerfish Horizontal Menu **************/ #nav, #nav ul { float: left; padding: 0; margin: 0; list-style: none; font-weight: bold; margin-bottom: 4px; font-size: 13px; background: url('/images/blank.gif') repeat-x bottom; line-height: 15px; } #nav a { display: block; width: 116px; color: #fff; background-color: #000; background: url('/images/gray.gif') repeat-x bottom; text-decoration: none; padding: 3px; } #nav a:hover { color: #fff; background-color: #900; background: url('/images/red.gif') repeat-x bottom; } #nav li { float: left; padding: 0; width: 122px; margin-top: 5px; margin-right: 10px; } #nav li a { text-align: center; vertical-align: middle; } #nav li ul { position: absolute; left: -999em; width: 155px; font-weight: normal; margin: 0; } #nav li ul li { background: none; border: 0; margin: 0; } #nav li ul li a { font-weight: normal; background: none; background-color: #ddd; color: #009; text-decoration: none; text-align: left; } #nav li ul li a strong { color: #900; } #nav li ul li a:hover { color: #900; background: none; background-color: #fff; } #nav li:hover ul, #nav li.sfhover ul { left: auto; } *:first-child+html #nav li:hover ul, #nav li.sfhover ul { position: static; } #sections { position: absolute; top: 125px; left: 0; width: 100%; border-bottom: 1px solid #fff; } #sectioncontents { width: 77em; margin: 0 auto; padding: 0; } #sectiontabs, #sectiontabs ul { float: left; list-style: none; padding: 0; margin: 0; font-size: 13px; line-height: 15px; } #sectiontabs a { display: block; width: 9em; height: 15px; padding: 2px 0; text-decoration: none; } #sectiontabs li { display: inline; float: left; padding: 0; margin: 5px 4px 0 4px; width: 9em; } #sectiontabs li a { color: #009; background-color: #eee; text-align: center; margin: 0; } #sectiontabs li a.thissection { background-color: #fff; color: #900; } #sectiontabs li a:hover { color: #900; background-color: #fff; } #sectiontabs li ul { position: absolute; left: -999em; width: 155px; margin: 0; } #sectiontabs li ul li { border: 0; margin: 0; width: 155px; } #sectiontabs li ul li a { width: 145px; background-color: #ddd; color: #009; text-decoration: none; text-align: left; padding: 2px 5px; } #sectiontabs li ul li a:hover { color: #900; background-color: #fff; } #sectiontabs li:hover ul, #sectiontabs li.sfhover ul { left: auto; } *:first-child+html #sectiontabs li:hover ul, #sectiontabs li.sfhover ul { position: static; } #tablist { border-bottom: 1px solid #999; margin: 6px 0 0 0; padding-bottom: 22px; } #tablist ul, #tablist li { display: inline; list-style-type: none; margin: 0; padding: 0; } #tablist a { background: #eee; border: 1px solid #999; color: #009; float: left; font-size: 13px; font-weight: bold; line-height: 17px; margin-right: 8px; padding: 2px 10px 2px 10px; text-decoration: none; } #tablist a:hover { background: #fff; color: #900; } #tablist li a.activetab { background: #fff; border-bottom: 1px solid #fff; color: #900; } #tablist ul a:hover { background: #fff; color: #900 !important; } #tabcontainer { background: #fff; border: 1px solid #999; border-top: none; clear: both; margin: 0; padding: 10px; } h1 { margin: 0; padding: 0; color: #900; font-size: 18px; } h1.moreleft { float: left; margin-bottom: -3px; color: #000; } h1.story { font-size: 20px; padding: 10px 0; } h2 { margin: 0; padding: 0; color: #900; font-size: 16px; } h2.block { color: #000; } h2.videos { padding-top: 6px; } h2.headleft { float: left; color: #000; padding-top: 5px; } div.headright { text-align: right; padding-top: 7px; } div.moreright { text-align: right; padding-top: 5px; margin-bottom: -3px; } div.nextedition { text-align: right; margin-top: -3px; } div.otherleft { float: left; width: 339px; margin: -15px 0 0 0; padding: 0 10px 15px 0; } div.otherright { float: left; width: 329px; margin: 5px 0 0 0; } h3 { margin: 0; padding: 0; color: #000; font-size: 14px; } hr { border: 0; border-top: 1px solid #000; height: 0; background: #000; } a { color: #009; text-decoration: none; } a:hover { text-decoration: underline; } a.red { color: #900; text-decoration: none; } a.red:hover { text-decoration: underline; } a.blue { color: #009; text-decoration: none; } a.blue:visited { color: #006; } a.blue:hover { text-decoration: underline; } a.black { color: #000; text-decoration: none; } a.black:hover { text-decoration: underline; } a.gray { color: #666; text-decoration: none; } a.gray:hover { text-decoration: underline; } img.floatLeft { float: left; margin: 2px 5px 5px 0; } .left { float: left; } .right { float: right; } .alignRight { text-align: right; } .clear { clear: both; } #topstories { position: relative; overflow: visible; padding: 0; margin: 0 0 10px 0; height: 215px; } div.panel { display:none; } #topstories div.storyphoto { float: left; width: 100px; max-height: 150px; margin: 2px 10px 2px 0; overflow: hidden; } #topstories div.storyblurb { float: left; width: 230px; } div.moreon { float: left; width: 70px; margin: 10px 5px 0 0; } div.moreon ul { padding: 0; margin: 0 0 10px 15px; list-style-image:url('/images/bullet_black.gif'); } div.moretopics { float: left; width: 249px; margin: 10px 10px 0 0; } #mainstories { position: relative; overflow: visible; padding: 0; margin: 5px 0; height: 160px; } #mainstories div.storyphoto { float: left; width: 75px; max-height: 125px; margin: 2px 10px 2px 0; overflow: hidden; } #mainstories div.storyblurb { float: left; width: 190px; } #story1 { display:block; } div.firststory { padding: 5px 0 10px 0; } div.secondstory { clear: both; padding: 5px 0 10px 0; } #videos { padding-top: 3px; } #video { padding-bottom: 10px; } #googlesearch table { margin: 0 auto; padding-top: 10px; } #googlesearch table table { margin: 0; } blockquote { margin: 0; padding: 5px 10px; } #misc { display: none; } .amazon { clear: both; margin: 10px 0; } form { margin: 0; padding: 0; } #story { float: left; width: 365px; } #first { padding-top: 0; margin-top: 0; font-size: medium; margin-bottom: -2px; } span.date { color: #666; font-style: italic; } #seealso { float: left; width: 140px; padding: 2px 10px 10px 0; } #seealso div { padding-top: 10px; } #seealso ul { margin: 0 0 0 20px; padding: 0; } #seealso ul li { padding: 0; } #photo { margin: 5px 0; } p { font-size: 13px; padding: 5px 0; margin: 0; } #related { float: right; width: 300px; padding: 0 0 10px 10px; } #relatedstories div { padding: 10px 0 0 0; } #related_articles div { padding: 5px 0; } #morenewsleft { float: left; width: 260px; } #morenewsright { float: right; width: 230px; } #rssbox { border: 1px solid #999; padding: 10px; margin: 8px 0 10px 10px; width: 200px; } #article_note { border: 1px solid #999; padding: 10px; margin: 10px 0; } #book_details { margin: 0 0 10px 0; } #moreheadlines { float: left; padding: 2px 0 0 0; } div.edition { display: none; } div.morepanel { display: none; } #panel1 { display:block; } #scroll { padding: 2px 0 0 0; } div.scroll_topics { float: left; width: 150px; } div.scroll_headlines { float: left; width: 295px; margin: 0 0 12px 10px; } div.section_topics { float: left; width: 150px; } div.section_headlines { float: left; width: 324px; margin: 0 10px 12px 10px; } div.search_topics { float: left; width: 150px; } div.search_headlines { float: left; width: 295px; margin: 0 0 12px 10px; } #citationbox { margin: 10px 0; padding: 10px; border: 1px solid #999; } #citationformat { float: left; width: 55px; } #citationtext { margin: 0 0 0 65px; } #bottomsearch { margin: 5px 0 0 0; padding: 0; border: none; } #googleside { width: 175px; padding: 10px 0 10px 0; font-size: 13px; } #googleside div { padding: 5px 0; overflow: hidden; } #googleside div.left { float: left; font-size: 11px; padding: 0; } #googleside div.right { text-align: right; font-size: 11px; padding: 0; } #googleside div.clear { clear: both; padding: 0; } #googlephoto { width: 300px; padding: 0 0 15px 0; font-size: 13px; } #googlephoto div { padding: 5px 0; overflow: hidden; } #googlephoto div.left { float: left; font-size: 11px; padding: 0; } #googlephoto div.right { text-align: right; font-size: 11px; padding: 0; } #googlephoto div.clear { clear: both; padding: 0; } #googlerelated { width: 300px; padding: 10px 0 15px 0; font-size: 13px; } #googlerelated div { padding: 5px 0; overflow: hidden; } #googlerelated div.left { float: left; font-size: 11px; padding: 0; } #googlerelated div.right { text-align: right; font-size: 11px; padding: 0; } #googlerelated div.clear { clear: both; padding: 0; } #googlestory { width: 358px; padding: 10px 0 10px 0; font-size: 13px; } #googlestory div { padding: 5px 0; overflow: hidden; } #googlestory div.left { float: left; font-size: 11px; padding: 0; } #googlestory div.right { text-align: right; font-size: 11px; padding: 0; } #googlestory div.clear { clear: both; padding: 0; } #googleleft { width: 138px; margin: 5px 0 0 0; font-size: 13px; } #googleleft div { padding: 5px 0; overflow: hidden; } #googleleft div.left { float: left; font-size: 11px; padding: 0; } #googleleft div.right { text-align: right; font-size: 11px; padding: 0; } #googleleft div.clear { clear: both; padding: 0; } #googlesearch { float: right; width: 175px; padding: 10px 0 10px 10px; font-size: 13px; overflow: hidden; } #googlesearch div { padding: 5px 0; overflow: hidden; } #googlesearch div.left { float: left; font-size: 11px; padding: 0; } #googlesearch div.right { text-align: right; font-size: 11px; padding: 0; } #googlesearch div.clear { clear: both; padding: 0; } #googlehome { width: 180px; padding: 5px 10px 10px 0; font-size: 13px; overflow: hidden; } #googlehome div { padding: 5px 0; overflow: hidden; } #googlehome div.left { float: left; font-size: 11px; padding: 0; } #googlehome div.right { text-align: right; font-size: 11px; padding: 0; } #googlehome div.clear { clear: both; padding: 0; } #googletop { margin: 0 0 10px 0; font-size: 13px; } #googletop div { overflow: hidden; } #googletop div.left { float: left; font-size: 11px; padding: 0; } #googletop div.right { text-align: right; font-size: 11px; padding: 0; } #googletop div.clear { clear: both; padding: 0; } #googletop div.col1 { padding: 5px 5px 5px 0; float: left; width: 164px; } #googletop div.col2 { padding: 5px; float: left; width: 164px; } #googletop div.col3 { padding: 5px 0 5px 5px; float: right; width: 164px; } #googleend { margin: 0 0 10px 0; font-size: 13px; } #googleend div { overflow: hidden; } #googleend div.left { float: left; font-size: 11px; padding: 0; } #googleend div.right { text-align: right; font-size: 11px; padding: 0; } #googleend div.clear { clear: both; padding: 0; } #googleend div.col1 { padding: 5px 5px 5px 0; float: left; width: 164px; } #googleend div.col2 { padding: 5px; float: left; width: 164px; } #googleend div.col3 { padding: 5px 0 5px 5px; float: right; width: 164px; } #googlebottom { width: 678px; margin: 20px 0 10px 0; font-size: 13px; } #googlebottom div { overflow: hidden; } #googlebottom div.left { float: left; font-size: 11px; padding: 0; } #googlebottom div.right { text-align: right; font-size: 11px; padding: 0; } #googlebottom div.clear { clear: both; padding: 0; } #googlebottom div.col1 { padding: 5px 5px 5px 0; float: left; width: 210px; } #googlebottom div.col2 { padding: 5px; float: left; width: 220px; } #googlebottom div.col3 { padding: 5px 0 5px 5px; float: right; width: 210px; } #share_form { background: #eee; border: 1px solid #999; display: none; position: absolute; width: 300px; z-index: 999; } #share_title { float: left; margin: 5px; width: 60%; } #share_close { float: right; margin: 5px; font-style: italic; } #share_close a { color: #009; text-decoration: none; } #share_close a:hover { color: #900; text-decoration: none; } #share_form div.clear { clear: both; float: none; } #share_social { background: #fff; padding: 5px 10px 5px 7px; } #share_social ul { list-style: none; margin: 0; padding: 0; } #share_social ul li { float: left; margin: 0; padding: 0; width: 50%; } #share_social ul li a { background-position: 0px 2px; background-repeat: no-repeat; display: block; float: left; height: 20px; padding: 4px 0 0 22px; vertical-align: middle; text-decoration: none; color: #009; } #share_social ul li a:hover { text-decoration: underline; color: #900; } #share_delicious { background-image: url('/images/delicious.gif') !important; } #share_digg { background-image: url('/images/digg.gif') !important; } #share_furl { background-image: url('/images/furl.gif') !important; } #share_netscape { background-image: url('/images/netscape.gif') !important; } #share_yahoo_myweb { background-image: url('/images/yahoo_myweb.gif') !important; } #share_stumbleupon { background-image: url('/images/stumbleupon.gif') !important; } #share_google_bmarks { background-image: url('/images/google_bmarks.gif') !important; } #share_technorati { background-image: url('/images/technorati.gif') !important; } #share_blinklist { background-image: url('/images/blinklist.gif') !important; } #share_newsvine { background-image: url('/images/newsvine.gif') !important; } #share_magnolia { background-image: url('/images/magnolia.gif') !important; } #share_reddit { background-image: url('/images/reddit.gif') !important; } #share_facebook { background-image: url('/images/facebook.gif') !important; } #share_tailrank { background-image: url('/images/tailrank.gif') !important; } #share_slashdot { background-image: url('/images/slashdot.gif') !important; } #share_fark { background-image: url('/images/fark.gif') !important; } #blog_form { background: #eee; border: 1px solid #999; display: none; position: absolute; width: 475px; z-index: 999; } #blog_title { float: left; margin: 5px; width: 60%; } #blog_close { float: right; margin: 5px; font-style: italic; } #blog_close a { color: #009; text-decoration: none; } #blog_close a:hover { color: #900; text-decoration: none; } #blog_form div.clear { clear: both; float: none; } #blog_fields { background: #fff; padding: 1px 10px 5px 7px; text-align: left; } #blog_fields form { border: 0; margin: 0; padding: 0; } #blog_fields ul { list-style: none; margin: 0; padding: 0; } #blog_fields ul li { display: block; clear: both; margin: 0 0 7px 0; padding: 0; } #blog_fields ul li label { width: 70px; float: left; margin: 3px 0; } #blog_fields ul li input { float: right; width: 375px; padding: 0; margin: 3px; } #blog_fields ul li textarea { float: right; width: 375px; padding: 0; margin: 3px; } #blog_fields ul li label.blog_submit_label { width: 370px; float: left; } #blog_fields ul li input.blog_submit { float: right; width: 75px; } #blog_fields ul li input.blog_text { width: 375px; } #blog_fields ul li textarea.blog_summary { width: 375px; height: 150px; } #cite_form { background: #eee; border: 1px solid #999; display: none; position: absolute; width: 500px; z-index: 999; } #cite_title { float: left; margin: 5px; width: 60%; } #cite_close { float: right; margin: 5px; font-style: italic; } #cite_close a { color: #009; text-decoration: none; } #cite_close a:hover { color: #900; text-decoration: none; } #cite_form div.clear { clear: both; float: none; } #cite_fields { background: #fff; padding: 1px 10px 5px 7px; text-align: left; } #cite_fields form { border: 0; margin: 0; padding: 0; } #cite_fields ul { list-style: none; margin: 0; padding: 0; } #cite_fields ul li { display: block; clear: both; margin: 0 0 7px 0; padding: 0; } #cite_fields ul li label { width: 75px; float: left; margin: 3px 0; } #cite_fields ul li input { float: left; margin: 3px 0; } #cite_fields ul li div { float: right; width: 385px; padding: 0; margin: 3px 3px 10px 3px; } #cite_fields ul li div p { margin: 0; padding: 0; } #cite_fields ul li label.cite_submit_label { width: 395px; float: left; } #cite_fields ul li input.cite_style { float: left; width: 15px; } #cite_fields ul li input.cite_submit { float: right; width: 75px; } #cite_fields ul li div.citation { width: 385px; } #email_form { background: #eee; border: 1px solid #999; display: none; position: absolute; width: 300px; z-index: 999; } #email_title { float: left; margin: 5px; width: 60%; } #email_close { float: right; margin: 5px; font-style: italic; } #email_close a { color: #009; text-decoration: none; } #email_close a:hover { color: #900; text-decoration: none; } #email_form div.clear { clear: both; float: none; } #email_fields { background: #fff; padding: 1px 10px 5px 7px; text-align: left; } #email_fields form { border: 0; margin: 0; padding: 0; } #email_fields ul { list-style: none; margin: 0; padding: 0; } #email_fields ul li { display: block; clear: both; margin: 0 0 7px 0; padding: 0; } #email_fields ul li label { width: 95px; float: left; margin: 3px 0; } #email_fields ul li input { float: right; width: 175px; padding: 0; margin: 3px; } #email_fields ul li input.email_self { float: left; width: 15px; } #email_fields ul li input.email_submit { float: right; width: 75px; } #email_fields ul li input.email_text { width: 175px; } #feedback { width: 300px; } #feedback_form { border: 0; margin: 2px 0 0 0; padding: 0; } #feedback_form ul { list-style: none; margin: 0; padding: 0; } #feedback_form ul li { display: block; clear: both; margin: 0 0 7px 0; padding: 0; } #feedback_form ul li label { width: 75px; float: left; margin: 3px 0; } #feedback_form ul li input { float: right; width: 205px; padding: 0; margin: 3px; } #feedback_form ul li input.feedback_submit { float: right; width: 75px; } #feedback_form ul li input.feedback_text { width: 205px; } #feedback_form ul li label.feedback_submit_label { width: 190px; float: left; } #feedback_form ul li textarea { float: right; width: 205px; padding: 0; margin: 3px; } #feedback_form ul li textarea.feedback_comments { width: 205px; height: 100px; } #justin { margin: 5px 0; } #justin div { display: none; } ------------GRdmKkLcvs6qnZ1AQyG3wo Content-Disposition: inline; filename=thumbnailviewer.css Content-Type: text/css; charset=iso-8859-1; name=thumbnailviewer.css Content-Location: http://www.sciencedaily.com/styles/thumbnailviewer.css Content-Transfer-Encoding: 8bit #thumbBox { /*Outermost DIV for thumbnail viewer*/ position: absolute; left: 0; top: 0; width: auto; padding: 0; padding-bottom: 0; background: #fff; border: 1px solid #999; visibility: hidden; z-index: 1000; cursor: hand; cursor: pointer; } #thumbBox .headerbar { /*Header DIV of thumbbox that contains "close" link */ font: bold 13px Arial; font-style: italic; color: #000; padding: 0; text-align: right; z-index: 1001; } #thumbBox #thumbImage { /*DIV within thumbbox that holds the enlarged image */ background-color: #fff; } #thumbLoading { /*DIV for showing "loading" status while thumbbox is being generated*/ position: absolute; visibility: hidden; border: 1px solid #000; background-color: #fff; padding: 5px; z-index: 500; } ------------GRdmKkLcvs6qnZ1AQyG3wo Content-Disposition: inline; filename=functions8-new.js Content-Type: application/x-javascript; charset=iso-8859-1; name=functions8-new.js Content-Location: http://www.sciencedaily.com/scripts/functions8-new.js Content-Transfer-Encoding: Base64 ZnVuY3Rpb24gaW5pdCgpIHsKICAvLyBxdWl0IGlmIHRoaXMgZnVuY3Rpb24gaGFz IGFscmVhZHkgYmVlbiBjYWxsZWQKICBpZiAoYXJndW1lbnRzLmNhbGxlZS5k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W90ZWNoLmNhcmVlcmJ1aWxkZXIuY29t IiwgImVuZ2luZWVyaW5nLmNhcmVlcmJ1aWxkZXIuY29tIiwgImluZm9ybWF0aW9u dGVjaG5vbG9neS5jYXJlZXJidWlsZGVyLmNvbSIsICJ3d3cuY2FyZWVyYnVpbGRl ci5jb20iXTsKCXZhciBleGNsdWRlZG9tYWlucyA9IGV4Y2x1ZGVkb21haW5zLmpv aW4oInwiKTsKCXJleGNsdWRlZG9tYWlucyA9IG5ldyBSZWdFeHAoZXhjbHVkZWRv bWFpbnMsICJpIik7Cglmb3IgKGk9MDsgaTw9KGRvY3VtZW50LmxpbmtzLmxlbmd0 aC0xKTsgaSsrKSB7CgkJaWYgKGRvY3VtZW50LmxpbmtzW2ldLmhvc3RuYW1lLnNl YXJjaChyZXhjbHVkZWRvbWFpbnMpPT0tMSAmJiBkb2N1bWVudC5saW5rc1tpXS5o cmVmLmluZGV4T2YoImh0dHA6IikhPS0xICYmIGRvY3VtZW50LmxpbmtzW2ldLnJl bC5pbmRleE9mKCJ0aHVtYm5haWwiKT09LTEpIHsKCQkJZG9jdW1lbnQubGlua3Nb aV0udGFyZ2V0PSJfYmxhbmsiOwoJCX0KCQlpZiAoZG9jdW1lbnQubGlua3NbaV0u aHJlZi5pbmRleE9mKCIvZ290by5waHAiKSE9LTEpIHsKCQkJZG9jdW1lbnQubGlu a3NbaV0ub25jbGljaz1uZXcgRnVuY3Rpb24oInJlZGlyZWN0KHRoaXMuaHJlZik7 IHJldHVybiBmYWxzZTsiKTsKCQl9Cgl9Cn0pOwoK ------------GRdmKkLcvs6qnZ1AQyG3wo Content-Disposition: inline; filename=prototype.js Content-Type: application/x-javascript; charset=iso-8859-1; name=prototype.js Content-Location: http://www.sciencedaily.com/scripts/prototype.js Content-Transfer-Encoding: Base64 LyogIFByb3RvdHlwZSBKYXZhU2NyaXB0IGZyYW1ld29yaywgdmVyc2lvbiAxLjUu MS4xCiAqICAoYykgMjAwNS0yMDA3IFNhbSBTdGVwa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GNo KHR5cGUpIHsKICAgICAgY2FzZSAndW5kZWZpbmVkJzoKICAgICAgY2FzZSAnZnVu Y3Rpb24nOgogICAgICBjYXNlICd1bmtub3duJzogcmV0dXJuOwogICAgICBjYXNl ICdib29sZWFuJzogcmV0dXJuIG9iamVjdC50b1N0cmluZygpOwogICAgfQogICAg aWYgKG9iamVjdCA9PT0gbnVsbCkgcmV0dXJuICdudWxsJzsKICAgIGlmIChvYmpl Y3QudG9KU09OKSByZXR1cm4gb2JqZWN0LnRvSlNPTigpOwogICAgaWYgKG9iamVj dC5vd25lckRvY3VtZW50ID09PSBkb2N1bWVudCkgcmV0dXJuOwogICAgdmFyIHJl c3VsdHMgPSBbXTsKICAgIGZvciAodmFyIHByb3BlcnR5IGluIG9iamVjdCkgewog ICAgICB2YXIgdmFsdWUgPSBPYmplY3QudG9KU09OKG9iamVjdFtwcm9wZXJ0eV0p OwogICAgICBpZiAodmFsdWUgIT09IHVuZGVmaW5lZCkKICAgICAgICByZXN1bHRz LnB1c2gocHJvcGVydHkudG9KU09OKCkgKyAnOiAnICsgdmFsdWUpOwogICAgfQog ICAgcmV0dXJuICd7JyArIHJlc3VsdHMuam9pbignLCAnKSArICd9JzsKICB9LAoK ICBrZXlzOiBmdW5jdGlvbihvYmplY3QpIHsKICAgIHZhciBrZXlzID0gW107CiAg ICBmb3IgKHZhciBwcm9wZXJ0eSBpbiBvYmplY3QpCiAgICAgIGtleXMucHVzaChw cm9wZXJ0eSk7CiAgICByZXR1cm4ga2V5czsKICB9LAoKICB2YWx1ZXM6IGZ1bmN0 aW9uKG9iamVjdCkgewogICAgdmFyIHZhbHVlcyA9IFtdOwogICAgZm9yICh2YXIg cHJvcGVydHkgaW4gb2JqZWN0KQogICAgICB2YWx1ZXMucHVzaChvYmplY3RbcHJv cGVydHldKTsKICAgIHJldHVybiB2YWx1ZXM7CiAgfSwKCiAgY2xvbmU6IGZ1bmN0 aW9uKG9iamVjdCkgewogICAgcmV0dXJuIE9iamVjdC5leHR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kubWF0Y2goLyhbXj8jXSop KCMuKik/JC8pOwogICAgaWYgKCFtYXRjaCkgcmV0dXJuIHt9OwoKICAgIHJldHVy biBtYXRjaFsxXS5zcGxpdChzZXBhcmF0b3IgfHwgJyYnKS5pbmplY3Qoe30sIGZ1 bmN0aW9uKGhhc2gsIHBhaXIpIHsKICAgICAgaWYgKChwYWlyID0gcGFpci5zcGxp dCgnPScpKVswXSkgewogICAgICAgIHZhciBrZXkgPSBkZWNvZGVVUklDb21wb25l bnQocGFpci5zaGlmdCgpKTsKICAgICAgICB2YXIgdmFsdWUgPSBwYWlyLmxlbmd0 aCA+IDEgPyBwYWlyLmpvaW4oJz0nKSA6IHBhaXJbMF07CiAgICAgICAgaWYgKHZh bHVlICE9IHVuZGVmaW5lZCkgdmFsdWUgPSBkZWNvZGVVUklDb21wb25lbnQodmFs dWUpOwoKICAgICAgICBpZiAoa2V5IGluIGhhc2gpIHsKICAgICAgICAgIGlmICho YXNoW2tleV0uY29uc3RydWN0b3IgIT0gQXJyYXkpIGhhc2hba2V5XSA9IFtoYXNo W2tleV1dOwogICAgICAgICAgaGFzaFtrZXldLnB1c2godmFsdWUpOwogICAgICAg IH0KICAgICAgICBlbHNlIGhhc2hba2V5XSA9IHZhbHVlOwogICAgICB9CiAgICAg IHJldHVybiBoYXNoOwogICAgfSk7CiAgfSwKCiAgdG9BcnJheTogZnVuY3Rpb24o KSB7CiAgICByZXR1cm4gdGhpcy5zcGxpdCgnJyk7CiAgfSwKCiAgc3VjYzogZnVu Y3Rpb24oKSB7CiAgICByZXR1cm4gdGhpcy5zbGljZSgwLCB0aGlzLmxlbmd0aCAt IDEpICsKICAgICAgU3RyaW5nLmZyb21DaGFyQ29kZSh0aGlzLmNoYXJDb2RlQXQo dGhpcy5sZW5ndGggLSAxKSArIDEpOwogIH0sCgogIHRpbWVzOiBmdW5jdGlvbihj b3VudCkgewogICAgdmFyIHJlc3VsdCA9ICcnOwogICAgZm9yICh2YXIgaSA9IDA7 IGkgPCB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cn07CgpPYmplY3QuZXh0ZW5kKEhhc2gsIHsKICB0b1F1ZXJ5U3RyaW5nOiBm dW5jdGlvbihvYmopIHsKICAgIHZhciBwYXJ0cyA9IFtdOwogICAgcGFydHMuYWRk ID0gYXJndW1lbnRzLmNhbGxlZS5hZGRQYWlyOwoKICAgIHRoaXMucHJvdG90eXBl Ll9lYWNoLmNhbGwob2JqLCBmdW5jdGlvbihwYWlyKSB7CiAgICAgIGlmICghcGFp ci5rZXkpIHJldHVybjsKICAgICAgdmFyIHZhbHVlID0gcGFpci52YWx1ZTsKCiAg ICAgIGlmICh2YWx1ZSAmJiB0eXBlb2YgdmFsdWUgPT0gJ29iamVjdCcpIHsKICAg ICAgICBpZiAodmFsdWUuY29uc3RydWN0b3IgPT0gQXJyYXkpIHZhbHVlLmVhY2go ZnVuY3Rpb24odmFsdWUpIHsKICAgICAgICAgIHBhcnRzLmFkZChwYWlyLmtleSwg dmFsdWUpOwogICAgICAgIH0pOwogICAgICAgIHJldHVybjsKICAgICAgfQogICAg ICBwYXJ0cy5hZGQocGFpci5rZXksIHZhbHVlKTsKICAgIH0pOwoKICAgIHJldHVy biBwYXJ0cy5qb2luKCcmJyk7CiAgfSwKCiAgdG9KU09OOiBmdW5jdGlvbihvYmpl Y3QpIHsKICAgIHZhciByZXN1bHRzID0gW107CiAgICB0aGlzLnByb3RvdHlwZS5f ZWFjaC5jYWxsKG9iamVjdCwgZnVuY3Rpb24ocGFpcikgewogICAgICB2YXIgdmFs dWUgPSBPYmplY3QudG9KU09OKHBhaXIudmFsdWUpOwogICAgICBpZiAodmFsdWUg IT09IHVuZGVmaW5lZCkgcmVzdWx0cy5wdXNoKHBhaXIua2V5LnRvSlNPTigpICsg JzogJyArIHZhbHVlKTsKICAgIH0pOwogICAgcmV0dXJuICd7JyArIHJlc3VsdHMu am9pbignLCAnKSArICd9JzsKICB9Cn0pOwoKSGFzaC50b1F1ZXJ5U3RyaW5nLmFk ZFBhaXIgPSBmdW5jdGlvbihrZXks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ubWF0Y2hlci5w dXNoKCJyZXR1cm4gaC51bmlxdWUobik7XG59Iik7CiAgICBldmFsKHRoaXMubWF0 Y2hlci5qb2luKCdcbicpKTsKICAgIFNlbGVjdG9yLl9jYWNoZVt0aGlzLmV4cHJl c3Npb25dID0gdGhpcy5tYXRjaGVyOwogIH0sCgogIGNvbXBpbGVYUGF0aE1hdGNo ZXI6IGZ1bmN0aW9uKCkgewogICAgdmFyIGUgPSB0aGlzLmV4cHJlc3Npb24sIHBz ID0gU2VsZWN0b3IucGF0dGVybnMsCiAgICAgICAgeCA9IFNlbGVjdG9yLnhwYXRo LCBsZSwgIG07CgogICAgaWYgKFNlbGVjdG9yLl9jYWNoZVtlXSkgewogICAgICB0 aGlzLnhwYXRoID0gU2VsZWN0b3IuX2NhY2hlW2VdOyByZXR1cm47CiAgICB9Cgog ICAgdGhpcy5tYXRjaGVyID0gWycuLy8qJ107CiAgICB3aGlsZSAoZSAmJiBsZSAh PSBlICYmICgvXFMvKS50ZXN0KGUpKSB7CiAgICAgIGxlID0gZTsKICAgICAgZm9y ICh2YXIgaSBpbiBwcykgewogICAgICAgIGlmIChtID0gZS5tYXRjaChwc1tpXSkp IHsKICAgICAgICAgIHRoaXMubWF0Y2hlci5wdXNoKHR5cGVvZiB4W2ldID09ICdm dW5jdGlvbicgPyB4W2ldKG0pIDoKICAgICAgICAgICAgbmV3IFRlbXBsYXRlKHhb aV0pLmV2YWx1YXRlKG0pKTsKICAgICAgICAgIGUgPSBlLnJlcGxhY2UobVswXSwg JycpOwogICAgICAgICAgYnJlYWs7CiAgICAgICAgfQogICAgICB9CiAgICB9Cgog ICAgdGhpcy54cGF0aCA9IHRoaXMubWF0Y2hlci5qb2luKCcnKTsKICAgIFNlbGVj dG9yLl9jYWNoZVt0aGlzLmV4cHJlc3Npb25dID0gdGhpcy54cGF0aDsKICB9LAoK ICBmaW5kRWxlbWVudHM6IGZ1bmN0aW9uKHJvb3QpIHsKICAgIHJvb3QgPSByb290 IHx8IGRvY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0BpZD0nI3sxfSddIiwKICAgIGF0dHJQcmVz ZW5jZTogIltAI3sxfV0iLAogICAgYXR0cjogZnVuY3Rpb24obSkgewogICAgICBt WzNdID0gbVs1XSB8fCBtWzZdOwogICAgICByZXR1cm4gbmV3IFRlbXBsYXRlKFNl bGVjdG9yLnhwYXRoLm9wZXJhdG9yc1ttWzJdXSkuZXZhbHVhdGUobSk7CiAgICB9 LAogICAgcHNldWRvOiBmdW5jdGlvbihtKSB7CiAgICAgIHZhciBoID0gU2VsZWN0 b3IueHBhdGgucHNldWRvc1ttWzFdXTsKICAgICAgaWYgKCFoKSByZXR1cm4gJyc7 CiAgICAgIGlmICh0eXBlb2YgaCA9PT0gJ2Z1bmN0aW9uJykgcmV0dXJuIGgobSk7 CiAgICAgIHJldHVybiBuZXcgVGVtcGxhdGUoU2VsZWN0b3IueHBhdGgucHNldWRv c1ttWzFdXSkuZXZhbHVhdGUobSk7CiAgICB9LAogICAgb3BlcmF0b3JzOiB7CiAg ICAgICc9JzogICJbQCN7MX09JyN7M30nXSIsCiAgICAgICchPSc6ICJbQCN7MX0h PScjezN9J10iLAogICAgICAnXj0nOiAiW3N0YXJ0cy13aXRoKEAjezF9LCAnI3sz fScpXSIsCiAgICAgICckPSc6ICJbc3Vic3RyaW5nKEAjezF9LCAoc3RyaW5nLWxl bmd0aChAI3sxfSkgLSBzdHJpbmctbGVuZ3RoKCcjezN9JykgKyAxKSk9JyN7M30n XSIsCiAgICAgICcqPSc6ICJbY29udGFpbnMoQCN7MX0sICcjezN9JyldIiwKICAg ICAgJ349JzogIltjb250YWlucyhjb25jYXQoJyAnLCBAI3sxfSwgJyAnKSwgJyAj ezN9ICcpXSIsCiAgICAgICd8PSc6ICJbY29udGFpbnMoY29uY2F0KCctJywgQCN7 MX0sICctJyksICctI3szfS0nKV0iCiAgICB9LAogICAgcHNldWRvczogewogICAg ICAnZmlyc3QtY2hpbGQnOiAnW25vdChwcmVjZWRpbmctc2libGluZzo6KildJywK ICAgICAgJ2xhc3QtY2hpbGQnOiAgJ1tub3QoZm9sbG93aW5nLXNpYmxpbmc6Oiop XScsCiAgICAgICdvbmx5LWNoaWxkJzogICdbbm90KHByZWNlZGluZy1zaWJsaW5n OjoqIG9yIGZvbGxvd2luZy1zaWJsaW5nOjoqKV0nLAogICAgICAnZW1wdHknOiAg ICAgICAiW2NvdW50KCopID0gMCBhbmQgKGNvdW50KHRleHQoKSkgPSAwIG9yIHRy YW5zbGF0ZSh0ZXh0KCksICcgXHRcclxuJywgJycpID0gJycpXSIsCiAgICAgICdj aGVja2VkJzogICAgICJbQGNoZWNrZWRdIiwKICAgICAgJ2Rpc2FibGVkJzogICAg IltAZGlzYWJsZWRdIiwKICAgICAgJ2VuYWJsZWQnOiAgICAgIltub3QoQGRpc2Fi bGVkKV0iLAogICAgICAnbm90JzogZnVuY3Rpb24obSkgewogICAgICAgIHZhciBl ID0gbVs2XSwgcCA9IFNlbGVjdG9yLnBhdHRlcm5zLAogICAgICAgICAgICB4ID0g U2VsZWN0b3IueHBhdGgsIGxlLCBtLCB2OwoKICAgICAgICB2YXIgZXhjbHVzaW9u ID0gW107CiAgICAgICAgd2hpbGUgKGUgJiYgbGUgIT0gZSAmJiAoL1xTLykudGVz dChlKSkgewogICAgICAgICAgbGUgPSBlOwogICAgICAgICAgZm9yICh2YXIgaSBp biBwKSB7CiAgICAgICAgICAgIGlmIChtID0gZS5tYXRjaChwW2ldKSkgewogICAg ICAgICAgICAgIHYgPSB0eXBlb2YgeFtpXSA9PSAnZnVuY3Rpb24nID8geFtpXSht KSA6IG5ldyBUZW1wbGF0ZSh4W2ldKS5ldmFsdWF0ZShtKTsKICAgICAgICAgICAg ICBleGNsdXNpb24ucHVzaCgiKCIgKyB2LnN1YnN0cmluZygxLCB2Lmxlbmd0aCAt IDEpICsgIikiKTsKICAgICAgICAgICAgICBlID0gZS5yZXBsYWNlKG1bMF0sICcn KTsKICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgfQogICAgICAgICAg fQogICAgICAgIH0KICAgICAgICByZXR1cm4gIltub3QoIiArIGV4Y2x1c2lvbi5q b2luKCIgYW5kICIpICsgIildIjsKICAgICAgfSwKICAgICAgJ250aC1jaGlsZCc6 ICAgICAgZnVuY3Rpb24obSkgewogICAgICAgIHJldHVybiBTZWxlY3Rvci54cGF0 aC5wc2V1ZG9zLm50aCgiKGNvdW50KC4vcHJlY2VkaW5nLXNpYmxpbmc6OiopICsg MSkgIiwgbSk7CiAgICAgIH0sCiAgICAgICdudGgtbGFzdC1jaGlsZCc6IGZ1bmN0 aW9uKG0pIHsKICAgICAgICByZXR1cm4gU2VsZWN0b3IueHBhdGgucHNldWRvcy5u dGgoIihjb3VudCguL2ZvbGxvd2luZy1zaWJsaW5nOjoqKSArIDEpICIsIG0pOwog ICAgICB9LAogICAgICAnbnRoLW9mLXR5cGUnOiAgICBmdW5jdGlvbihtKSB7CiAg ICAgICAgcmV0dXJuIFNlbGVjdG9yLnhwYXRoLnBzZXVkb3MubnRoKCJwb3NpdGlv bigpICIsIG0pOwogICAgICB9LAogICAgICAnbnRoLWxhc3Qtb2YtdHlwZSc6IGZ1 bmN0aW9uKG0pIHsKICAgICAgICByZXR1cm4gU2VsZWN0b3IueHBhdGgucHNldWRv cy5udGgoIihsYXN0KCkgKyAxIC0gcG9zaXRpb24oKSkgIiwgbSk7CiAgICAgIH0s CiAgICAgICdmaXJzdC1vZi10eXBlJzogIGZ1bmN0aW9uKG0pIHsKICAgICAgICBt WzZdID0gIjEiOyByZXR1cm4gU2VsZWN0b3IueHBhdGgucHNldWRvc1snbnRoLW9m LXR5cGUnXShtKTsKICAgICAgfSwKICAgICAgJ2xhc3Qtb2YtdHlwZSc6ICAgZnVu Y3Rpb24obSkgewogICAgICAgIG1bNl0gPSAiMSI7IHJldHVybiBTZWxlY3Rvci54 cGF0aC5wc2V1ZG9zWydudGgtbGFzdC1vZi10eXBlJ10obSk7CiAgICAgIH0sCiAg ICAgICdvbmx5LW9mLXR5cGUnOiAgIGZ1bmN0aW9uKG0pIHsKICAgICAgICB2YXIg cCA9IFNlbGVjdG9yLnhwYXRoLnBzZXVkb3M7IHJldHVybiBwWydmaXJzdC1vZi10 eXBlJ10obSkgKyBwWydsYXN0LW9mLXR5cGUnXShtKTsKICAgICAgfSwKICAgICAg bnRoOiBmdW5jdGlvbihmcmFnbWVudCwgbSkgewogICAgICAgIHZhciBtbSwgZm9y bXVsYSA9IG1bNl0sIHByZWRpY2F0ZTsKICAgICAgICBpZiAoZm9ybXVsYSA9PSAn ZXZlbicpIGZvcm11bGEgPSAnMm4rMCc7CiAgICAgICAgaWYgKGZvcm11bGEgPT0g J29kZCcpICBmb3JtdWxhID0gJzJuKzEnOwogICAgICAgIGlmIChtbSA9IGZvcm11 bGEubWF0Y2goL14oXGQrKSQvKSkgLy8gZGlnaXQgb25seQogICAgICAgICAgcmV0 dXJuICdbJyArIGZyYWdtZW50ICsgIj0gIiArIG1tWzFdICsgJ10nOwogICAgICAg IGlmIChtbSA9IGZvcm11bGEubWF0Y2goL14oLT9cZCopP24oKFsrLV0pKFxkKykp Py8pKSB7IC8vIGFuK2IKICAgICAgICAgIGlmIChtbVsxXSA9PSAiLSIpIG1tWzFd ID0gLTE7CiAgICAgICAgICB2YXIgYSA9IG1tWzFdID8gTnVtYmVyKG1tWzFdKSA6 IDE7CiAgICAgICAgICB2YXIgYiA9IG1tWzJdID8gTnVtYmVyKG1tWzJdKSA6IDA7 CiAgICAgICAgICBwcmVkaWNhdGUgPSAiWygoI3tmcmFnbWVudH0gLSAje2J9KSBt b2QgI3thfSA9IDApIGFuZCAiICsKICAgICAgICAgICIoKCN7ZnJhZ21lbnR9IC0g I3tifSkgZGl2ICN7YX0gPj0gMCldIjsKICAgICAgICAgIHJldHVybiBuZXcgVGVt cGxhdGUocHJlZGljYXRlKS5ldmFsdWF0ZSh7CiAgICAgICAgICAgIGZyYWdtZW50 OiBmcmFnbWVudCwgYTogYSwgYjogYiB9KTsKICAgICAgICB9CiAgICAgIH0KICA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JzdAogICAgLy8gKGFuZCBkZXNjZW5kYW50IG5lZWRzIHRv IGJlIGxhc3QgY29tYmluYXRvcikKICAgIGxhdGVyU2libGluZzogL15ccyp+XHMq LywKICAgIGNoaWxkOiAgICAgICAgL15ccyo+XHMqLywKICAgIGFkamFjZW50OiAg ICAgL15ccypcK1xzKi8sCiAgICBkZXNjZW5kYW50OiAgIC9eXHMvLAoKICAgIC8v IHNlbGVjdG9ycyBmb2xsb3cKICAgIHRhZ05hbWU6ICAgICAgL15ccyooXCp8W1x3 XC1dKykoXGJ8JCk/LywKICAgIGlkOiAgICAgICAgICAgL14jKFtcd1wtXCpdKyko XGJ8JCkvLAogICAgY2xhc3NOYW1lOiAgICAvXlwuKFtcd1wtXCpdKykoXGJ8JCkv LAogICAgcHNldWRvOiAgICAgICAvXjooKGZpcnN0fGxhc3R8bnRofG50aC1sYXN0 fG9ubHkpKC1jaGlsZHwtb2YtdHlwZSl8ZW1wdHl8Y2hlY2tlZHwoZW58ZGlzKWFi bGVkfG5vdCkoXCgoLio/KVwpKT8oXGJ8JHxcc3woPz06KSkvLAogICAgYXR0clBy ZXNlbmNlOiAvXlxbKFtcd10rKVxdLywKICAgIGF0dHI6ICAgICAgICAgL1xbKCg/ Oltcdy1dKjopP1tcdy1dKylccyooPzooWyFeJCp+fF0/PSlccyooKFsnIl0pKFte XF1dKj8pXDR8KFteJyJdW15cXV0qPykpKT9cXS8KICB9LAoKICBoYW5kbGVyczog ewogICAgLy8gVVRJTElUWSBGVU5DVElPTlMKICAgIC8vIGpvaW5zIHR3byBjb2xs ZWN0aW9ucwogICAgY29uY2F0OiBmdW5jdGlvbihhLCBiKSB7CiAgICAgIGZvciAo dmFyIGkgPSAwLCBub2RlOyBub2RlID0gYltpXTsgaSsrKQogICAgICAgIGEucHVz aChub2RlKTsKICAgICAgcmV0dXJuIGE7CiAgICB9LAoKICAgIC8vIG1hcmtzIGFu IGFycmF5IG9mIG5vZGVzIGZvciBjb3VudGluZwogICAgbWFyazogZ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2Rl czsgbm9kZSA9IG5vZGVzW2ldOyBpKyspCiAgICAgICAgICBpZiAobm9kZS5ub2Rl VHlwZSA9PSAxICYmICghb2ZUeXBlIHx8IG5vZGUuX2NvdW50ZWQpKSBub2RlLm5v ZGVJbmRleCA9IGorKzsKICAgICAgfQogICAgfSwKCiAgICAvLyBmaWx0ZXJzIG91 dCBkdXBsaWNhdGVzIGFuZCBleHRlbmRzIGFsbCBub2RlcwogICAgdW5pcXVlOiBm dW5jdGlvbihub2RlcykgewogICAgICBpZiAobm9kZXMubGVuZ3RoID09IDApIHJl dHVybiBub2RlczsKICAgICAgdmFyIHJlc3VsdHMgPSBbXSwgbjsKICAgICAgZm9y ICh2YXIgaSA9IDAsIGwgPSBub2Rlcy5sZW5ndGg7IGkgPCBsOyBpKyspCiAgICAg ICAgaWYgKCEobiA9IG5vZGVzW2ldKS5fY291bnRlZCkgewogICAgICAgICAgbi5f Y291bnRlZCA9IHRydWU7CiAgICAgICAgICByZXN1bHRzLnB1c2goRWxlbWVudC5l eHRlbmQobikpOwogICAgICAgIH0KICAgICAgcmV0dXJuIFNlbGVjdG9yLmhhbmRs ZXJzLnVubWFyayhyZXN1bHRzKTsKICAgIH0sCgogICAgLy8gQ09NQklOQVRPUiBG VU5DVElPTlMKICAgIGRlc2NlbmRhbnQ6IGZ1bmN0aW9uKG5vZGVzKSB7CiAgICAg IHZhciBoID0gU2VsZWN0b3IuaGFuZGxlcnM7CiAgICAgIGZvciAodmFyIGkgPSAw LCByZXN1bHRzID0gW10sIG5vZGU7IG5vZGUgPSBub2Rlc1tpXTsgaSsrKQogICAg ICAgIGguY29uY2F0KHJlc3VsdHMsIG5vZGUuZ2V0RWxlbWVudHNCeVRhZ05hbWUo JyonKSk7CiAgICAgIHJldHVybiByZXN1bHRzOwogICAgfSwKCiAgICBjaGlsZDog ZnVuY3Rpb24obm9kZXMpIHsKICAgICAgdmFyIGggPSBTZWxlY3Rvci5oYW5kbGVy czsKICAgICAgZm9yICh2YXIgaS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CiAgICB9LAoKICAgIHBy ZXZpb3VzRWxlbWVudFNpYmxpbmc6IGZ1bmN0aW9uKG5vZGUpIHsKICAgICAgd2hp bGUgKG5vZGUgPSBub2RlLnByZXZpb3VzU2libGluZykKICAgICAgICBpZiAobm9k ZS5ub2RlVHlwZSA9PSAxKSByZXR1cm4gbm9kZTsKICAgICAgcmV0dXJuIG51bGw7 CiAgICB9LAoKICAgIC8vIFRPS0VOIEZVTkNUSU9OUwogICAgdGFnTmFtZTogZnVu Y3Rpb24obm9kZXMsIHJvb3QsIHRhZ05hbWUsIGNvbWJpbmF0b3IpIHsKICAgICAg dGFnTmFtZSA9IHRhZ05hbWUudG9VcHBlckNhc2UoKTsKICAgICAgdmFyIHJlc3Vs dHMgPSBbXSwgaCA9IFNlbGVjdG9yLmhhbmRsZXJzOwogICAgICBpZiAobm9kZXMp IHsKICAgICAgICBpZiAoY29tYmluYXRvcikgewogICAgICAgICAgLy8gZmFzdGxh bmUgZm9yIG9yZGluYXJ5IGRlc2NlbmRhbnQgY29tYmluYXRvcnMKICAgICAgICAg IGlmIChjb21iaW5hdG9yID09ICJkZXNjZW5kYW50IikgewogICAgICAgICAgICBm b3IgKHZhciBpID0gMCwgbm9kZTsgbm9kZSA9IG5vZGVzW2ldOyBpKyspCiAgICAg ICAgICAgICAgaC5jb25jYXQocmVzdWx0cywgbm9kZS5nZXRFbGVtZW50c0J5VGFn TmFtZSh0YWdOYW1lKSk7CiAgICAgICAgICAgIHJldHVybiByZXN1bHRzOwogICAg ICAgICAgfSBlbHNlIG5vZGVzID0gdGhpc1tjb21iaW5hdG9yXShub2Rlcyk7CiAg ICAgICAgICBpZiAodGFnTmFtZSA9PSAiKiIpIHJldHVybiBub2RlczsKICAgICAg ICB9CiAgICAgICAgZm9yICh2YXIgaSA9IDAsIG5vZGU7IG5vZGUgPSBub2Rlc1tp XTsgaSsrKQogICAgICAgICAgaWYgKG5vZGUudGFnTmFtZS50b1VwcGVyQ2FzZSgp ID09IHRhZ05hbWUpIHJlc3VsdHMucHVzaChub2RlKTsKICAgICAgICByZXR1cm4g cmVzdWx0czsKICAgICAgfSBlbHNlIHJldHVybiByb290LmdldEVsZW1lbnRzQnlU YWdOYW1lKHRhZ05hbWUpOwogICAgfSwKCiAgICBpZDogZnVuY3Rpb24obm9kZXMs IHJvb3QsIGlkLCBjb21iaW5hdG9yKSB7CiAgICAgIHZhciB0YXJnZXROb2RlID0g JChpZCksIGggPSBTZWxlY3Rvci5oYW5kbGVyczsKICAgICAgaWYgKCFub2RlcyAm JiByb290ID09IGRvY3VtZW50KSByZXR1cm4gdGFyZ2V0Tm9kZSA/IFt0YXJnZXRO b2RlXSA6IFtdOwogICAgICBpZiAobm9kZXMpIHsKICAgICAgICBpZiAoY29tYmlu YXRvcikgewogICAgICAgICAgaWYgKGNvbWJpbmF0b3IgPT0gJ2NoaWxkJykgewog ICAgICAgICAgICBmb3IgKHZhciBpID0gMCwgbm9kZTsgbm9kZSA9IG5vZGVzW2ld OyBpKyspCiAgICAgICAgICAgICAgaWYgKHRhcmdldE5vZGUucGFyZW50Tm9kZSA9 PSBub2RlKSByZXR1cm4gW3RhcmdldE5vZGVdOwogICAgICAgICAgfSBlbHNlIGlm IChjb21iaW5hdG9yID09ICdkZXNjZW5kYW50JykgewogICAgICAgICAgICBmb3Ig KHZhciBpID0gMCwgbm9kZTsgbm9kZSA9IG5vZGVzW2ldOyBpKyspCiAgICAgICAg ICAgICAgaWYgKEVsZW1lbnQuZGVzY2VuZGFudE9mKHRhcmdldE5vZGUsIG5vZGUp KSByZXR1cm4gW3RhcmdldE5vZGVdOwogICAgICAgICAgfSBlbHNlIGlmIChjb21i aW5hdG9yID09ICdhZGphY2VudCcpIHsKICAgICAgICAgICAgZm9yICh2YXIgaSA9 IDAsIG5vZGU7IG5vZGUgPSBub2Rlc1tpXTsgaSsrKQogICAgICAgICAgICAgIGlm IChTZWxlY3Rvci5oYW5kbGVycy5wcmV2aW91c0VsZW1lbnRTaWJsaW5nKHRhcmdl dE5vZGUpID09IG5vZGUpCiAgICAgICAgICAgICAgICByZXR1cm4gW3RhcmdldE5v ZGVdOwogICAgICAgICAgfSBlbHNlIG5vZGVzID0gaFtjb21iaW5hdG9yXShub2Rl cyk7CiAgICAgICAgfQogICAgICAgIGZvciAodmFyIGkgPSAwLCBub2RlOyBub2Rl ID0gbm9kZXNbaV07IGkrKykKICAgICAgICAgIGlmIChub2RlID09IHRhcmdldE5v ZGUpIHJldHVybiBbdGFyZ2V0Tm9kZV07CiAgICAgICAgcmV0dXJuIFtdOwogICAg ICB9CiAgICAgIHJldHVybiAodGFyZ2V0Tm9kZSAmJiBFbGVtZW50LmRlc2NlbmRh bnRPZih0YXJnZXROb2RlLCByb290KSkgPyBbdGFyZ2V0Tm9kZV0gOiBbXTsKICAg IH0sCgogICAgY2xhc3NOYW1lOiBmdW5jdGlvbihub2Rlcywgcm9vdCwgY2xhc3NO YW1lLCBjb21iaW5hdG9yKSB7CiAgICAgIGlmIChub2RlcyAmJiBjb21iaW5hdG9y KSBub2RlcyA9IHRoaXNbY29tYmluYXRvcl0obm9kZXMpOwogICAgICByZXR1cm4g U2VsZWN0b3IuaGFuZGxlcnMuYnlDbGFzc05hbWUobm9kZXMsIHJvb3QsIGNsYXNz TmFtZSk7CiAgICB9LAoKICAgIGJ5Q2xhc3NOYW1lOiBmdW5jdGlvbihub2Rlcywg cm9vdCwgY2xhc3NOYW1lKSB7CiAgICAgIGlmICghbm9kZXMpIG5vZGVzID0gU2Vs ZWN0b3IuaGFuZGxlcnMuZGVzY2VuZGFudChbcm9vdF0pOwogICAgICB2YXIgbmVl ZGxlID0gJyAnICsgY2xhc3NOYW1lICsgJyAnOwogICAgICBmb3IgKHZhciBpID0g MCwgcmVzdWx0cyA9IFtdLCBub2RlLCBub2RlQ2xhc3NOYW1lOyBub2RlID0gbm9k ZXNbaV07IGkrKykgewogICAgICAgIG5vZGVDbGFzc05hbWUgPSBub2RlLmNsYXNz TmFtZTsKICAgICAgICBpZiAobm9k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sKICAgIH0sCgogICAgcHNl dWRvOiBmdW5jdGlvbihub2RlcywgbmFtZSwgdmFsdWUsIHJvb3QsIGNvbWJpbmF0 b3IpIHsKICAgICAgaWYgKG5vZGVzICYmIGNvbWJpbmF0b3IpIG5vZGVzID0gdGhp c1tjb21iaW5hdG9yXShub2Rlcyk7CiAgICAgIGlmICghbm9kZXMpIG5vZGVzID0g cm9vdC5nZXRFbGVtZW50c0J5VGFnTmFtZSgiKiIpOwogICAgICByZXR1cm4gU2Vs ZWN0b3IucHNldWRvc1tuYW1lXShub2RlcywgdmFsdWUsIHJvb3QpOwogICAgfQog IH0sCgogIHBzZXVkb3M6IHsKICAgICdmaXJzdC1jaGlsZCc6IGZ1bmN0aW9uKG5v ZGVzLCB2YWx1ZSwgcm9vdCkgewogICAgICBmb3IgKHZhciBpID0gMCwgcmVzdWx0 cyA9IFtdLCBub2RlOyBub2RlID0gbm9kZXNbaV07IGkrKykgewogICAgICAgIGlm IChTZWxlY3Rvci5oYW5kbGVycy5wcmV2aW91c0VsZW1lbnRTaWJsaW5nKG5vZGUp KSBjb250aW51ZTsKICAgICAgICAgIHJlc3VsdHMucHVzaChub2RlKTsKICAgICAg fQogICAgICByZXR1cm4gcmVzdWx0czsKICAgIH0sCiAgICAnbGFzdC1jaGlsZCc6 IGZ1bmN0aW9uKG5vZGVzLCB2YWx1ZSwgcm9vdCkgewogICAgICBmb3IgKHZhciBp ID0gMCwgcmVzdWx0cyA9IFtdLCBub2RlOyBub2RlID0gbm9kZXNbaV07IGkrKykg ewogICAgICAgIGlmIChTZWxlY3Rvci5oYW5kbGVycy5uZXh0RWxlbWVudFNpYmxp bmcobm9kZSkpIGNvbnRpbnVlOwogICAgICAgICAgcmVzdWx0cy5wdXNoKG5vZGUp OwogICAgICB9CiAgICAgIHJldHVybiByZXN1bHRzOwogICAgfSwKICAgICdvbmx5 LWNoaWxkJzogZnVuY3Rpb24obm9kZXMsIHZhbHVlLCByb290KSB7CiAgICAgIHZh ciBoID0gU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ZXZlbicpIGZvcm11bGEgPSAnMm4rMCc7 CiAgICAgIGlmIChmb3JtdWxhID09ICdvZGQnKSAgZm9ybXVsYSA9ICcybisxJzsK ICAgICAgdmFyIGggPSBTZWxlY3Rvci5oYW5kbGVycywgcmVzdWx0cyA9IFtdLCBp bmRleGVkID0gW10sIG07CiAgICAgIGgubWFyayhub2Rlcyk7CiAgICAgIGZvciAo dmFyIGkgPSAwLCBub2RlOyBub2RlID0gbm9kZXNbaV07IGkrKykgewogICAgICAg IGlmICghbm9kZS5wYXJlbnROb2RlLl9jb3VudGVkKSB7CiAgICAgICAgICBoLmlu ZGV4KG5vZGUucGFyZW50Tm9kZSwgcmV2ZXJzZSwgb2ZUeXBlKTsKICAgICAgICAg IGluZGV4ZWQucHVzaChub2RlLnBhcmVudE5vZGUpOwogICAgICAgIH0KICAgICAg fQogICAgICBpZiAoZm9ybXVsYS5tYXRjaCgvXlxkKyQvKSkgeyAvLyBqdXN0IGEg bnVtYmVyCiAgICAgICAgZm9ybXVsYSA9IE51bWJlcihmb3JtdWxhKTsKICAgICAg ICBmb3IgKHZhciBpID0gMCwgbm9kZTsgbm9kZSA9IG5vZGVzW2ldOyBpKyspCiAg ICAgICAgICBpZiAobm9kZS5ub2RlSW5kZXggPT0gZm9ybXVsYSkgcmVzdWx0cy5w dXNoKG5vZGUpOwogICAgICB9IGVsc2UgaWYgKG0gPSBmb3JtdWxhLm1hdGNoKC9e KC0/XGQqKT9uKChbKy1dKShcZCspKT8vKSkgeyAvLyBhbitiCiAgICAgICAgaWYg KG1bMV0gPT0gIi0iKSBtWzFdID0gLTE7CiAgICAgICAgdmFyIGEgPSBtWzFdID8g TnVtYmVyKG1bMV0pIDogMTsKICAgICAgICB2YXIgYiA9IG1bMl0gPyBOdW1iZXIo bVsyXSkgOiAwOwogICAgICAgIHZhciBpbmRpY2VzID0gU2VsZWN0b3IucHNldWRv cy5nZXRJbmRpY2VzKGEsIGIsIG5vZGVzLmxlbmd0aCk7CiAgICAgICAgZm9yICh2 YXIgaSA9IDAsIG5vZGUsIGwgPSBpbmRpY2VzLmxlbmd0aDsgbm9kZSA9IG5vZGVz W2ldOyBpKyspIHsKICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgbDsgaisr KQogICAgICAgICAgICBpZiAobm9kZS5ub2RlSW5kZXggPT0gaW5kaWNlc1tqXSkg cmVzdWx0cy5wdXNoKG5vZGUpOwogICAgICAgIH0KICAgICAgfQogICAgICBoLnVu bWFyayhub2Rlcyk7CiAgICAgIGgudW5tYXJrKGluZGV4ZWQpOwogICAgICByZXR1 cm4gcmVzdWx0czsKICAgIH0sCgogICAgJ2VtcHR5JzogZnVuY3Rpb24obm9kZXMs IHZhbHVlLCByb290KSB7CiAgICAgIGZvciAodmFyIGkgPSAwLCByZXN1bHRzID0g W10sIG5vZGU7IG5vZGUgPSBub2Rlc1tpXTsgaSsrKSB7CiAgICAgICAgLy8gSUUg dHJlYXRzIGNvbW1lbnRzIGFzIGVsZW1lbnQgbm9kZXMKICAgICAgICBpZiAobm9k ZS50YWdOYW1lID09ICchJyB8fCAobm9kZS5maXJzdENoaWxkICYmICFub2RlLmlu bmVySFRNTC5tYXRjaCgvXlxzKiQvKSkpIGNvbnRpbnVlOwogICAgICAgIHJlc3Vs dHMucHVzaChub2RlKTsKICAgICAgfQogICAgICByZXR1cm4gcmVzdWx0czsKICAg IH0sCgogICAgJ25vdCc6IGZ1bmN0aW9uKG5vZGVzLCBzZWxlY3Rvciwgcm9vdCkg ewogICAgICB2YXIgaCA9IFNlbGVjdG9yLmhhbmRsZXJzLCBzZWxlY3RvclR5cGUs IG07CiAgICAgIHZhciBleGNsdXNpb25zID0gbmV3IFNlbGVjdG9yKHNlbGVjdG9y KS5maW5kRWxlbWVudHMocm9vdCk7CiAgICAgIGgubWFyayhleGNsdXNpb25zKTsK ICAgICAgZm9yICh2YXIgaSA9IDAsIHJlc3VsdHMgPSBbXSwgbm9kZTsgbm9kZSA9 IG5vZGVzW2ldOyBpKyspC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QgPSBmdW5jdGlvbihlbGVtZW50KSB7CiAgICB2 YXIgdmFsdWVUID0gMCwgdmFsdWVMID0gMDsKICAgIGRvIHsKICAgICAgdmFsdWVU ICs9IGVsZW1lbnQub2Zmc2V0VG9wICB8fCAwOwogICAgICB2YWx1ZUwgKz0gZWxl bWVudC5vZmZzZXRMZWZ0IHx8IDA7CiAgICAgIGlmIChlbGVtZW50Lm9mZnNldFBh cmVudCA9PSBkb2N1bWVudC5ib2R5KQogICAgICAgIGlmIChFbGVtZW50LmdldFN0 eWxlKGVsZW1lbnQsICdwb3NpdGlvbicpID09ICdhYnNvbHV0ZScpIGJyZWFrOwoK ICAgICAgZWxlbWVudCA9IGVsZW1lbnQub2Zmc2V0UGFyZW50OwogICAgfSB3aGls ZSAoZWxlbWVudCk7CgogICAgcmV0dXJuIFt2YWx1ZUwsIHZhbHVlVF07CiAgfQp9 CgpFbGVtZW50LmFkZE1ldGhvZHMoKTs= ------------GRdmKkLcvs6qnZ1AQyG3wo Content-Disposition: inline; filename=thumbnailviewer.js Content-Type: application/x-javascript; charset=iso-8859-1; name=thumbnailviewer.js Content-Location: http://www.sciencedaily.com/scripts/thumbnailviewer.js Content-Transfer-Encoding: Base64 Ly8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLQovLyBJbWFnZSBUaHVtYm5haWwgVmlld2Vy IFNjcmlwdC0gQnkgRHluYW1pYyBEcml2ZSwgYXZhaWxhYmxlIGF0OiBodHRwOi8v d3d3LmR5bmFtaWNkcml2ZS5jb20KLy8gTGFzdCB1cGRhdGVkOiBKYW4gMjJuZCwg MjAwNwovLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCgp2YXIgdGh1bWJuYWlsdmlld2Vy PXsKZW5hYmxlVGl0bGU6IG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9uKCl7aWYgKHRodW1ibmFpbHZpZXdlci50aHVtYkJveC5zdHls ZS52aXNpYmlsaXR5PT0idmlzaWJsZSIpIHRodW1ibmFpbHZpZXdlci5jZW50ZXJE aXYodGh1bWJuYWlsdmlld2VyLnRodW1iQm94KX0sICJyZXNpemUiKQoKCn0gLy9F TkQgaW5pdCgpIGZ1bmN0aW9uCgp9Cgp0aHVtYm5haWx2aWV3ZXIuY3JlYXRldGh1 bWJCb3goKSAvL091dHB1dCBIVE1MIGZvciB0aGUgaW1hZ2UgdGh1bWJuYWlsIHZp ZXdlcgp0aHVtYm5haWx2aWV3ZXIuZG90YXNrKHdpbmRvdywgZnVuY3Rpb24oKXt0 aHVtYm5haWx2aWV3ZXIuaW5pdCgpfSwgImxvYWQiKSAvL0luaXRpYWxpemUgc2Ny aXB0IG9uIHBhZ2UgbG9hZAp0aHVtYm5haWx2aWV3ZXIuZG90YXNrKHdpbmRvdywg ZnVuY3Rpb24oKXt0aHVtYm5haWx2aWV3ZXIuY2xlYW51cCgpfSwgInVubG9hZCIp ------------GRdmKkLcvs6qnZ1AQyG3wo Content-Disposition: inline; filename=logo.gif Content-Type: image/gif; name=logo.gif Content-Location: http://www.sciencedaily.com/images/logo.gif Content-Transfer-Encoding: Base64 R0lGODdh+gBVAPcAAAAAAB8fH5kAAJmZmR5cmWuUvHWbwHqfwzJroilknoSmx4ys y6YgIJazz6S91v7+/qMZGWKNt0p8rSNgmwgJCZ2405GvzbdLS2VlZXGYvjo6OkN3 qrNBQZwICDtxpq7F2lWEsoWFharB2F2JtUtLS9/f3/b29pOTk0B0p6WlpRAQELpT U58QEFpaWggBAZq10Hp6er3P4VCAr1iGs+/v78XFxRkZGaoqKrPI3GxsbLA6OhEB AXoAAMNra7lRUWaQuh0oMjhupImpyZUAALS0tLjL3yABAQUKD36ixefn56wxMQgQ GdTU1BchKioqKsXV5UJCQnR0dBEdKc3Nzb29vVBrhRlLenQAADEAALxbWyBblBgB ARAZIosAAIQBASkAAL9iYm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Aoo nfDTSjXNzwYM+MTAhDIUguIBDUhViAQaQkwhBAACeCDTBXFVgS0SSphQhVz91OCB PgMwoQUYmKgUBhNggIEGW2VdqAYYACAiCSJSUImEJKLIIYlryzBhAAymmKJSGl4F IIcaAGihBCZS0KCFZ6NI4tQQksjB2RZUCuAEGjDN4d4k5tSAhhJS6FQhDWogggRc S4AhhGRvpcFcKtIF+IFemaACA39VEJhSEkwIIYcSBsAYhnOJaPcBGHRVKNttsWUC gxNUBeCEGkR2FQAxUFbZDAAoWBgDMx7o9IQkqICjyxL/cjDDBCeKZSKKE4JWiYkS TsB3TgqmCHkAGgLQwASFQgj6VwBqSAEDs3tta2WHHxgVABNIoFYha7Gdc6VWmQiB 3ST+VSgFbtdVyF14ZwXAhgec6PaBL1N4wIZugS3D44VoaKHYvBeq9dZhAQiBWyZq +PLrjumGQu4kuHVbWCK+TDYAhU9oWFiaazYa9SS+pCIJ1B+gIgrNJYfjS6ZjzcFs W0/gFl7jVSqWdFu7RtztAVb2soYpAKhVBRNygJmJTqkwAY4W6G6rhu1xpdx0J6BQ WyEmriVi+27ZFQPepuA/+QGABg0zw7tawASFUMAEewKABohQLM3dClQLcZvk2KXB /+xNpXS40lXqAECF4MGLXQrhlcpGBQfaXe9ijUObGFDoKt+thAjXahewHPavHFRw ADVwYMMo0MMQMNBvRjtB4PA3qigUzliJ85/+ugesEIyPVZ0y3wmutTBu2SAHDaxB Cc0ygC8qRAUpMMEDUlDBKNDAci7rWRlV0qU01mBVAMDXA6YAQQ0wQY9yAwAJqnc0 NJarUjaAwwNMsMaVSLCBaHwAHDRXBisKLgk1sMEUKpiD7YXrASWQoUoySYEuKTIF LYDD0dhXBgoI7AF2VAgMkvDJhm0tlHg6lcNq8AAaBC8AVDBlr+iIPMpRAHMZAyS0 FvLLB3wLAJRcSMpWwjCHwRgMAFCYQjP9hwEgBnIKsPOjtGA1TnL+KSAAOw== ------------GRdmKkLcvs6qnZ1AQyG3wo Content-Disposition: inline; filename=share.png Content-Type: image/png; name=share.png Content-Location: http://www.sciencedaily.com/images/share.png Content-Transfer-Encoding: Base64 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK 6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAKDSURBVDjL jdFNTNJxHAZw69CWHjp16O2AZB3S1ovOObaI8NBYuuZAhqjIQkzJoSIZBmSCpVuK /sE/WimU6N9SDM0R66IHbabie1hrg0MK3Zo5a8vwidgym8w8PKffvp89e35RAKJ2 ipp7WDxvjltZ6jwCr5W2bpHHtqUnx+77877jsZxzlO3roAWXuw5ha1pl9MZdAW2i g8RyXyL8rnx8G6uH387AMnUMC2b6l10BJPdAfWDGhZVREuszT7D6hsTStBNDurO+ XQEZnEypx1a28XW2F8HFPqwtOBAYJlCde9EeEZCy4sTN4ksrRA4LZB57vZCfMElU yH4E7Ap86r+LwIAGIy03cDr/lDNJGR/zDyBiHGc3i1ODjUIWtqbdIIexVY86kwZ3 HijR/86GmqFqJGhPWs8oTkRvAgb+uZGHhVfRV3UNni41OhU8EDlstBSkwjKjhnmq Ag3uUtS6y9Dzvg0ljmKkFCaRm4CJT+/5OERtG4yqZMEwdQt1biV0EyW4PVEE1dsi iMk8eMn0/w9Wp+PCNK1CQ6iBYeommkIpH5Qhy5AF/6Mrf4G955tUJlXxtsHieeWQ 2LJxvVuAAkoASUcmLugZPqW0qsprEQjDx3sY3ZIMhXt1+DNw77kdmnYKSsKKx+Pf oTQtYX9KtzWG2Rod6aujaJwWHk8+uDawGITeA+SPA7nDQOYgwKcAYhQQajyIY9eQ EYE5feLPyV4jFC8CELkAkWMDQmoDPGsQaWYgzRjEU8vL8GARAV8T099bUwqBdgzS 14D4VaiBA8gZALJ/t6j1Qqu4Hx4sIvChoyDFWZ1RmcyzORJLJsDSzoUyD5Z6FsxK N+iXn/mM5ZLwYJGAX0F/sgCQt3xBAAAAAElFTkSuQmCC ------------GRdmKkLcvs6qnZ1AQyG3wo Content-Disposition: inline; filename=blog.png Content-Type: image/png; name=blog.png Content-Location: http://www.sciencedaily.com/images/blog.png Content-Transfer-Encoding: Base64 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK 6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAH8SURBVDjL jZPfS1NhGMdXf0VEQhDUhdCN4X0IYT8ghIJQM0KoC4vushZddLELKyRhQQkSFIKE GEkUCI2oxVhepG5zi1xbc0u3cDs7Z+ec/ezT+x62scmmHvhwDrzP93Pe57znsQE2 cR0SdAm6d+GwYL/M1LBVBV35fF4plUqVcrlMK8Q6TqdzYrukJuiW4Vwuh67rdbLZ LJlMhmQyaUnigVlC05f4+dbB0tQplp92DsnwPimQBaZpUigUrLtE0zQURSGVSqHF 37DhGkVZeQdagszKLJ7HvZtNAhmuIQWGYaCqKps/ZkivPqCwPs/Gp0cYvjnKUTe+ F9fMJoFoo96zfJZ9K+sLpP33qRhujPANtr7dJPhqmO/PBxX3+PljTYLtqImPpH13 qZge9LUrmLEB1FU7sZd9jJw5MljNthYk/KLnxdFqeAjzdz9Z/z3Ck2fRE36qx9pa kAjME1y4Lbb9GTMyTD52GUXsZO3ZadTkL6umrSD4ZZrAezvLH54Q915EjwywtXSH 8FQf+t+I9V12FLwe6wE1SmjyAi77Qb6Kt3rGe9H+hKzwrgLH9eMUPE4K3gm8jpPM jRwlHfNTLBbr7Cjo7znA2NVOXA/PsThzi2wyah1pI+0E/9rNQQsqMtM4CyfE36fL hb2ERa0mB7BR0CElexjnGnL0O2T2PyFunSz8jchwAAAAAElFTkSuQmCC ------------GRdmKkLcvs6qnZ1AQyG3wo Content-Disposition: inline; filename=cite.png Content-Type: image/png; name=cite.png Content-Location: http://www.sciencedaily.com/images/cite.png Content-Transfer-Encoding: Base64 iVBORw0KGgoAAAANSUhEUgAAAA0AAAALCAYAAACksgdhAAAABGdBTU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G3wo Content-Disposition: inline; filename=print.png Content-Type: image/png; name=print.png Content-Location: http://www.sciencedaily.com/images/print.png Content-Transfer-Encoding: Base64 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK 6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJtSURBVDjL jZPfS1NhGMfPXfh3OG/E/yBImNkqrYGCzAthh+WNgXihwQYb2CoYukGwsdRLoYUW QbRAhqzc2Q91IrrVhlhLqznL5Tyb23m3s317z1szBzM68Lk47/N9Pud5XjgcAK7O VfM7/a2piE87HalRoLVHStrp1VKvLVi7fE9wns/WaXi58UgoH4kl/CxIyOZ/cyRK SKRFmF/tw/B4p3jl7utLFwp6baHiySnBxheZUkHkM8HKrgSpUsVGWsaDN/tQG/1P LxT02EIlRbBJBZtfZaztlSF8JEgdFqBMdnh8im7LSqWpYHJysqXHFiS5AkGMfi12 UP0zRRm+D6fwxvPI0dWu3Q8QvV7f0iCgzQZKnl4WjqkgcVDDeyrYpqLoXoWtsbxT pLUyrlsFDA4O5vv7+w1MQBu7Z2dnEY1GcXsqjCwVJDM1JCixb1Vs0VXCdIoAXSVL BTcfhhEIBDA+Pg6NRtOtCLbpg0wmA7PZ/F8oWUEQMDAwsKsIiCzLUFhfX4coiv8k FAqhnh8bG6txFosFhBDG4uIiUqkUEzVDqc3Pz5/leZ4HZzKZkEgkGG63G8lkEn6/ vylKxuFwnOU7OzvBTUxMwOfzMex2O+LxOJaWlpoSi8VgtVrP8u3t7eDoHvB6vQyX ywV6Jwyj0YjR0VE2Zl9fH7q6uqBWq9lZPd/W1gZuZGSk6vF42IHSuPD8JZbfBpvy bOEFOjo6WHZubg6tra3gDAbDzNDQ0LZOpwPvCqNYIjg6IfhBOcxJSGdL2PtewKeM iKJUBu8MQ6VSKc1bFFPDv8C7ItXhJ2sYdv/lDmOVodR4Z6R6vucXuxIEyKz+W40A AAAASUVORK5CYII= ------------GRdmKkLcvs6qnZ1AQyG3wo Content-Disposition: inline; filename=email.png Content-Type: image/png; name=email.png Content-Location: http://www.sciencedaily.com/images/email.png Content-Transfer-Encoding: Base64 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK 6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAITSURBVBgZ pcHLThNhGIDh9/vn7/RApwc5VCmFWBPi1mvwAlx7BW69Afeu3bozcSE7E02ILjCR hRrds8AEbKVS2gIdSjvTmf+TYqLu+zyiqszDMCf75PnnnVwhuNcLpwsXk8Q4BYeS OsWpkqrinJI6JXVK6lSRdDq9PO+19vb37XK13Hj0YLMUTVVyWY//Cf8IVwQEGEeJ N47S1YdPo4npDpNmnDh5udOh1YsZRcph39EaONpnjs65oxsqvZEyTaHdj3n2psPp KDLBcuOOGUWpZDOG+q0S7751ObuYUisJGQ98T/Ct4Fuo5IX+MGZr95jKjRKLlSxX xFxOEmaaN4us1Upsf+1yGk5ZKhp8C74H5ZwwCGO2drssLZZo1ouIcs2MJikz1oPm apHlaoFXH1oMwphyTghyQj+MefG+RblcoLlaJG/5y4zGCTMikEwTctaxXq/w9kuX dm9Cuzfh9acujXqFwE8xmuBb/hCwl1GKAnGccDwIadQCfD9DZ5Dj494QA2w2qtQW 84wmMZ1eyFI1QBVQwV5GiaZOpdsPaSwH5HMZULi9UmB9pYAAouBQbMHHrgQcnQwZ V/KgTu1o8PMgipONu2t5KeaNiEkxgAiICDMCCFeEK5aNauAOfoXx8KR9ZOOLk8P7 j7er2WBhwWY9sdbDeIJnwBjBWBBAhGsCmiZxPD4/7Z98b/0QVWUehjkZ5vQb/Un5 e/DIsVsAAAAASUVORK5CYII= ------------GRdmKkLcvs6qnZ1AQyG3wo Content-Disposition: inline; filename=bookmark.png Content-Type: image/png; name=bookmark.png Content-Location: http://www.sciencedaily.com/images/bookmark.png Content-Transfer-Encoding: Base64 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK 6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAIASURBVDjL pVPPaxNREJ6Vt01caH4oWk1T0ZKlGIo9RG+BUsEK4kEP/Q8qPXnpqRdPBf8A8Wah hx7FQ0GF9FJ6UksqwfTSBDGyB5HkkphC9tfb7jfbtyQQTx142byZ75v5ZnZWC4KA LmICPy+2DkvKIX2f/POz83LxCL7nrz+WPNcll49DrhM9v7xdO9JW330DuXrrqkFS gig5iR2Cfv3t3gNxOnv5BwU+eZ5HuON5/PMPJZKJ+yKQfpW0S7TxdC6WJaWkyvff 1LDaFRAeLZj05MHsiPTS6hua0PUqtwC5sHq9zv9RYWl+nu5cETcnJ1M0M5WlWq3G sX6/T+VymRzHDluZiGYAAsw0TQahV8uyyGq1qFgskm0bHIO/1+sx1rFtchJhArwE yIQ1Gg2WD2A6nWawHQJVDIWgIJfLhQowTIeE9D0mKAU8qPC0220afsWFQoH93W6X 7yCDJ+DEBeBmsxnPIJVKxWQVUwry+XyUwBlKMKwA8jqdDhOVCqVAzQDVvXAXhOdG BFgymYwrGoZBmUyGjxCCdF0fSahaFdgoTHRxfTveMCXvWfkuE3Y+f40qhgT/nMit upzApdvT18bu+YeDQwY9Xl4aG9/d/URiMBhQq/dvZMeVghtT17lSZW9/rAKsvPa/ r9Fc2dw+Pe0/xI6kM9mT5vtXy+Nw2kU/5zOGRpvuMIu0YAAAAABJRU5ErkJggg== ------------GRdmKkLcvs6qnZ1AQyG3wo Content-Disposition: inline; filename=addthis_widget.js Content-Type: application/x-javascript; name=addthis_widget.js Content-Location: http://s7.addthis.com/js/250/addthis_widget.js Content-Transfer-Encoding: Base64 LyogKGMpIDIwMDgsIDIwMDkgQWRkIFRoaXMsIExMQyAqLwppZighd2luZG93Ll9h dGUpe3ZhciBfYXRkPSJ3d3cuYWRkdGhpcy5jb20vIixfYXRyPSIvL3M3L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mljZXM9ZnVuY3Rpb24oYSl7aWYod2luZG93 Ll9hdHcpe2EoYWRkdGhpc19vcHRpb25zLnNwbGl0KCIsIikpfWVsc2V7Zi5wbG8u cHVzaChbInByZWYiLGFdKTtfYXRlLmFsZygpO2lmKGYuZ3NzaCl7Zi5wbGQ9Zi5h anMoInN0YXRpYy9yMDcvbWVudTQ2LmpzIil9ZWxzZXtpZighZi5wbGQpe2YucGxk PTE7Zi5zdG8oIl9hdGUucGxkID0gX2F0ZS5hanMoJ3N0YXRpYy9yMDcvbWVudTQ2 LmpzJyk7IiwxMDApfX19fTtyZXR1cm4gaShmdW5jdGlvbihrLGEpe2tbYV09KG5l dyBjLl9RdWV1ZXIoYSkpLmNhbGw7cmV0dXJuIGt9LGcpfSkoKX0pOw== ------------GRdmKkLcvs6qnZ1AQyG3wo Content-Disposition: inline; filename=google-story2-rb.js Content-Type: application/x-javascript; charset=iso-8859-1; name=google-story2-rb.js Content-Location: http://www.sciencedaily.com/scripts/google-story2-rb.js Content-Transfer-Encoding: Base64 ZnVuY3Rpb24gd29yZHdyYXAgKHRleHQpIHsKCXJldHVybiB0ZXh0LnJlcGxhY2Uo LyhbQS1aXC9cLl17MX0pL2csIiYjODIwMzskMSIpOwp9CgpmdW5jdGlvbiBnb29n bGVfYWRfcmVxdWVzdF9kb25lKGdvb2dsZV9hZHMpIHsKCgl2YXIgZ29vZ2xlX251 bV9hZHMgPSBnb29nbGVfYWRzLmxlbmd0aDsKCWlmIChnb29nbGVfbnVtX2FkcyA8 PSAwKSByZXR1cm47CgkKCXZhciBmaXJzdEFkVW5pdCAJPSAnPGRpdiBzdHlsZT0i Zm9udC1zaXplOiAxMnB4OyBmb250LXdlaWdodDogYm9sZDsgcGFkZGluZzogMHB4 IDAgMnB4IDAiPjxhIGhyZWY9IicgKyBnb29nbGVfaW5mby5mZWVkYmFja191cmwg KyAnIiBjbGFzcz0iYmxhY2siPkFkcyBieSBHb29nbGU8L2E+PC9kaXY+PGhyIC8+ JzsKC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ArCgkJCQkJCQknaHJlZj0iJyArIGdvb2dsZV9hZHNbaV0u dXJsICsgJyIgY2xhc3M9ImJsdWUiPicgKwoJCQkJCQkJCgkJCQkJCQl3b3Jkd3Jh cChnb29nbGVfYWRzW2ldLnZpc2libGVfdXJsKSArICc8L2E+JzsJCgkJfQoKCQlm aXJzdEFkVW5pdAkJKz0gKGkgPCA0KSA/ICgnPGRpdj4nICsgaXRlbSArICc8L2Rp dj4nKSA6ICcnOwoJCXNlY29uZEFkVW5pdAkrPSAoaSA+IDMgJiYgaSA8IDgpID8g KCc8ZGl2PicgKyBpdGVtICsgJzwvZGl2PicpIDogJyc7CgkJCgl9CgoJdmFyIGJv dHRvbSA9ICc8ZGl2IGNsYXNzPSJjbGVhciI+PC9kaXY+JzsKCWRvY3VtZW50Lmdl dEVsZW1lbnRCeUlkKCJnb29nbGVwaG90byIpLmlubmVySFRNTCA9IGZpcnN0QWRV bml0ICsgYm90dG9tOwoJaWYgKGdvb2dsZV9hZHMubGVuZ3RoID4gNCkgewoJCWRv Y3VtZW50LmdldEVsZW1lbnRCeUlkKCJnb29nbGVyZWxhdGVkIikuaW5uZXJIVE1M ID0gc2Vjb25kQWRVbml0ICsgYm90dG9tOwoJfQp9Cgpnb29nbGVfYWRfY2xpZW50 ID0gInB1Yi0xNzg3NjcyNjU4NzU5MDc0IjsKZ29vZ2xlX2FkX291dHB1dCA9ICJq cyI7Cmdvb2dsZV9tYXhfbnVtX2FkcyA9ICI4IjsKZ29vZ2xlX2ZlZWRiYWNrID0g Im9uIjsKZ29vZ2xlX2FkX3JlZ2lvbiA9ICJ0ZXN0IjsKCg== ------------GRdmKkLcvs6qnZ1AQyG3wo Content-Disposition: inline; filename=show_ads.js Content-Type: text/javascript; charset=UTF-8; name=show_ads.js Content-Location: http://pagead2.googlesyndication.com/pagead/show_ads.js Content-Transfer-Encoding: Quoted-Printable (function(){var g=3Dtrue,h=3Dnull,j=3Dfalse,aa=3D(new Date).getTime(),k=3D= function(a){var b=3D(new Date).getTime()-aa;b=3D"&dtd=3D"+(b<1E3?b:"M");= return a+b};var l=3Dthis,ba=3Dfunction(a,b,c){a=3Da.split(".");c=3Dc||l;= !(a[0]in c)&&c.execScript&&c.execScript("var "+a[0]);for(var d;a.length&= &(d=3Da.shift());)if(!a.length&&b!=3D=3Dundefined)c[d]=3Db;else c=3Dc[d]= ?c[d]:(c[d]=3D{})},m=3Dfunction(a){var b=3Dtypeof a;if(b=3D=3D"object")i= f(a){if(a instanceof Array||!(a instanceof Object)&&Object.prototype.toS= tring.call(a)=3D=3D"[object Array]"||typeof a.length=3D=3D"number"&&type= of a.splice!=3D"undefined"&&typeof a.propertyIsEnumerable!=3D"undefined"= &&!a.propertyIsEnumerable("splice"))return"array"; if(!(a instanceof Object)&&(Object.prototype.toString.call(a)=3D=3D"[obj= ect Function]"||typeof a.call!=3D"undefined"&&typeof a.propertyIsEnumera= ble!=3D"undefined"&&!a.propertyIsEnumerable("call")))return"function"}el= se return"null";else if(b=3D=3D"function"&&typeof a.call=3D=3D"undefined= ")return"object";return b},o=3Dfunction(a){return m(a)=3D=3D"array"},ca=3D= function(a){var b=3Dm(a);return b=3D=3D"array"||b=3D=3D"object"&&typeof = a.length=3D=3D"number"},p=3Dfunction(a){return typeof a=3D=3D"string"},d= a=3Dfunction(a){a=3Dm(a);return a=3D=3D"object"|| a=3D=3D"array"||a=3D=3D"function"},ea=3Dfunction(a){var b=3Dm(a);if(b=3D= =3D"object"||b=3D=3D"array"){if(a.clone)return a.clone.call(a);b=3Db=3D=3D= "array"?[]:{};for(var c in a)b[c]=3Dea(a[c]);return b}return a},fa=3Dfun= ction(a,b){var c=3Db||l;if(arguments.length>2){var d=3DArray.prototype.s= lice.call(arguments,2);return function(){var e=3DArray.prototype.slice.c= all(arguments);Array.prototype.unshift.apply(e,d);return a.apply(c,e)}}e= lse return function(){return a.apply(c,arguments)}},ga=3DDate.now||funct= ion(){return+new Date},q=3Dfunction(a, b,c){ba(a,b,c)};var r=3Dfunction(a,b){a=3DparseFloat(a);return isNaN(a)|= |a>1||a<0?b:a},s=3Dfunction(a,b){if(a=3D=3D"true")return g;if(a=3D=3D"fa= lse")return j;return b},ha=3D/^([\w-]+\.)*([\w-]{2,})(\:[0-9]+)?$/,t=3Df= unction(a,b){if(!a)return b;return(a=3Da.match(ha))?a[0]:b};var ia=3Dfun= ction(){return t("","googleads.g.doubleclick.net")},ja=3Dfunction(){retu= rn t("","pagead2.googlesyndication.com")},u=3Dfunction(){return t("","pa= gead2.googlesyndication.com")};var v=3DArray.prototype,ka=3Dv.forEach?fu= nction(a,b,c){v.forEach.call(a,b,c)}:function(a,b,c){for(var d=3Da.lengt= h,e=3Dp(a)?a.split(""):a,f=3D0;f")!=3D-1)a=3Da.replace(qa,">");if(a.indexOf('"')!=3D-1)a=3D= a.replace(ra,""");return a}},oa=3D/&/g,pa=3D//g,ra=3D/\"= /g,sa=3D/[&<>\"]/,wa=3Dfunction(a){if(a.indexOf("&")!=3D-1)return"docume= nt"in l&&a.indexOf("<")=3D=3D-1?ua(a):va(a);return a},ua=3Dfunction(a){v= ar b=3D l.document.createElement("a");b.innerHTML=3Da;b.normalize&&b.normalize()= ;a=3Db.firstChild.nodeValue;b.innerHTML=3D"";return a},va=3Dfunction(a){= return a.replace(/&([^;]+);/g,function(b,c){switch(c){case "amp":return"= &";case "lt":return"<";case "gt":return">";case "quot":return'"';default= :if(c.charAt(0)=3D=3D"#"){c=3DNumber("0"+c.substr(1));if(!isNaN(c))retur= n String.fromCharCode(c)}return b}})},xa=3Dfunction(a,b){for(var c=3Db.l= ength,d=3D0;db)return 1;return 0= };ga();var z,A,B,C,D,za,Aa,Ba,Ca,Da=3Dfunction(){return l.navigator?l.na= vigator.userAgent:h},E=3Dfunction(){return l.navigator},Ea=3Dfunction(){= D=3DC=3DB=3DA=3Dz=3Dj;var a;if(a=3DDa()){var b=3DE();z=3Da.indexOf("Oper= a")=3D=3D0;A=3D!z&&a.indexOf("MSIE")!=3D-1;C=3D(B=3D!z&&a.indexOf("WebKi= t")!=3D-1)&&a.indexOf("Mobile")!=3D-1;D=3D!z&&!B&&b.product=3D=3D"Gecko"= }};Ea(); var H=3Dz,I=3DA,Fa=3DD,Ga=3DB,Ha=3DC,Ia=3Dfunction(){var a=3DE();return = a&&a.platform||""},Ja=3DIa(),Ka=3Dfunction(){za=3DJa.indexOf("Mac")!=3D-= 1;Aa=3DJa.indexOf("Win")!=3D-1;Ba=3DJa.indexOf("Linux")!=3D-1;Ca=3D!!E()= &&(E().appVersion||"").indexOf("X11")!=3D-1};Ka(); var La=3Dza,Ma=3DAa,Na=3DBa,Oa=3Dfunction(){var a=3D"",b;if(H&&l.opera){= a=3Dl.opera.version;a=3Dtypeof a=3D=3D"function"?a():a}else{if(Fa)b=3D/r= v\:([^\);]+)(\)|;)/;else if(I)b=3D/MSIE\s+([^\);]+)(\)|;)/;else if(Ga)b=3D= /WebKit\/(\S+)/;if(b)a=3D(a=3Db.exec(Da()))?a[1]:""}return a},Pa=3DOa(),= Qa=3D{},J=3Dfunction(a){return Qa[a]||(Qa[a]=3Dya(Pa,a)>=3D0)};var Ra=3D= function(a){return p(a)?document.getElementById(a):a},Sa=3DRa,Ua=3Dfunct= ion(a,b){na(b,function(c,d){if(d=3D=3D"style")a.style.cssText=3Dc;else i= f(d=3D=3D"class")a.className=3Dc;else if(d=3D=3D"for")a.htmlFor=3Dc;else= if(d in Ta)a.setAttribute(Ta[d],c);else a[d]=3Dc})},Ta=3D{cellpadding:"= cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",rowspan:"rowSpa= n",valign:"vAlign",height:"height",width:"width",usemap:"useMap",framebo= rder:"frameBorder",type:"type"},Va=3Dfunction(a){var b=3Da.document;if(G= a&&!J("500")&&!Ha){if(typeof a.innerHeight=3D=3D "undefined")a=3Dwindow;b=3Da.innerHeight;var c=3Da.document.documentElem= ent.scrollHeight;if(a=3D=3Da.top)if(c");c=3Dc.join("")}var e=3D a.createElement(c);if(d)if(p(d))e.className=3Dd;else Ua(e,d);if(b.length= >2){d=3Dfunction(i){if(i)e.appendChild(p(i)?a.createTextNode(i):i)};for(= c=3D2;c0)?ka(Ya(f= )?ma(f):f,d):d(f)}}return e},Za=3Dfunction(a,b){a.appendChild(b)},Ya=3Df= unction(a){if(a&&typeof a.length=3D=3D"number")if(da(a))return typeof a.= item=3D=3D"function"||typeof a.item=3D=3D"string";else if(m(a)=3D=3D"fun= ction")return typeof a.item=3D=3D"function";return j};var $a=3Ddocument,= K=3Dwindow;u();var L=3Dfunction(a,b){for(var c in a)Object.prototype.has= OwnProperty.call(a,c)&&b.call(h,a[c],c,a)},ab=3Dfunction(a){if(arguments= .length<2)return a.length;for(var b=3D1,c=3Darguments.length;b=3D0){a=3D3;for(= var b=3D1;b;)try{b=3Dnew ActiveXObject("ShockwaveFlash.ShockwaveFlash."+= (a+1));a++}catch(c){b=3Dh}return a.toString()}else if(db("msie")&&!windo= w.opera){b=3Dh;try{b=3Dnew ActiveXObject("ShockwaveFlash.ShockwaveFlash.= 7")}catch(d){a=3D 0;try{b=3Dnew ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");a=3D6;b.A= llowScriptAccess=3D"always"}catch(e){if(a=3D=3D6)return a.toString()}try= {b=3Dnew ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(f){}}if(b)= {a=3Db.GetVariable("$version").split(" ")[1];return a.replace(/,/g,".")}= }return"0"}function N(a){var b=3Da.google_ad_format;if(b)return b.indexO= f("_0ads")>0;return a.google_ad_output!=3D"html"&&a.google_num_radlinks>= 0}function O(a){return!!a&&a.indexOf("_sdo")!=3D-1} function P(a,b){if(!(Math.random()<1.0E-4)){var c=3DMath.random();if(c>2)+e&4294967295}= return b},jb=3Dfunction(a){if(a=3D=3Da.top)return 0;var b=3D[];b.push(do= cument.URL);a.name&&b.push(a.name);a=3Dg;a=3Dhb(!a);b.push(a.width.toStr= ing());b.push(a.height.toString());b=3Dib(b.join(""));return b>0?b:42949= 67296+b};var kb=3D{google_ad_channel:"channel",google_ad_host:"host",goo= gle_ad_host_channel:"h_ch",google_ad_host_tier_id:"ht_id",google_ad_sect= ion:"region",google_ad_type:"ad_type",google_adtest:"adtest",google_allo= w_expandable_ads:"ea",google_alternate_ad_url:"alternate_ad_url",google_= alternate_color:"alt_color",google_bid:"bid",google_city:"gcs",google_co= lor_bg:"color_bg",google_color_border:"color_border",google_color_line:"= color_line",google_color_link:"color_link",google_color_text:"color_text= ",google_color_url:"color_url", google_contents:"contents",google_country:"gl",google_cust_age:"cust_age= ",google_cust_ch:"cust_ch",google_cust_gender:"cust_gender",google_cust_= id:"cust_id",google_cust_interests:"cust_interests",google_cust_job:"cus= t_job",google_cust_l:"cust_l",google_cust_lh:"cust_lh",google_cust_u_url= :"cust_u_url",google_disable_video_autoplay:"disable_video_autoplay",goo= gle_ed:"ed",google_encoding:"oe",google_feedback:"feedback_link",google_= flash_version:"flash",google_font_face:"f",google_font_size:"fs",google_= hints:"hints", google_kw:"kw",google_kw_type:"kw_type",google_language:"hl",google_page= _url:"url",google_region:"gr",google_reuse_colors:"reuse_colors",google_= safe:"adsafe",google_tag_info:"gut",google_targeting:"targeting",google_= ui_features:"ui",google_ui_version:"uiv",google_video_doc_id:"video_doc_= id",google_video_product_type:"video_product_type"},lb=3D{google_ad_clie= nt:"client",google_ad_format:"format",google_ad_output:"output",google_a= d_callback:"callback",google_ad_height:"h",google_ad_override:"google_ad= _override", google_ad_slot:"slotname",google_ad_width:"w",google_ctr_threshold:"ctr_= t",google_image_size:"image_size",google_last_modified_time:"lmt",google= _max_num_ads:"num_ads",google_max_radlink_len:"max_radlink_len",google_n= um_radlinks:"num_radlinks",google_num_radlinks_per_unit:"num_radlinks_pe= r_unit",google_only_ads_with_video:"only_ads_with_video",google_rl_dest_= url:"rl_dest_url",google_rl_filtering:"rl_filtering",google_rl_mode:"rl_= mode",google_rt:"rt",google_skip:"skip"},mb=3D{google_only_pyv_ads:"pyv"= , google_with_pyv_ads:"withpyv"};function nb(a,b){try{return a.top.documen= t.URL=3D=3Db.URL}catch(c){}return j}function pb(a,b,c,d){c=3Dc||a.google= _ad_width;d=3Dd||a.google_ad_height;if(nb(a,b))return j;var e=3Db.docume= ntElement;if(c&&d){var f=3D1,i=3D1;if(a.innerHeight){f=3Da.innerWidth;i=3D= a.innerHeight}else if(e&&e.clientHeight){f=3De.clientWidth;i=3De.clientH= eight}else if(b.body){f=3Db.body.clientWidth;i=3Db.body.clientHeight}if(= i>2*d||f>2*c)return j}return g}function qb(a,b){L(b,function(c,d){a["goo= gle_"+d]=3Dc})} function rb(a,b){if(!b)return a.URL;return a.referrer}function sb(a,b){i= f(!b&&a.google_referrer_url=3D=3Dh)return"0";else if(b&&a.google_referre= r_url=3D=3Dh)return"1";else if(!b&&a.google_referrer_url!=3Dh)return"2";= else if(b&&a.google_referrer_url!=3Dh)return"3";return"4"}function tb(a,= b,c,d){a.page_url=3Drb(c,d);a.page_location=3Dh}function ub(a,b,c,d){a.p= age_url=3Db.google_page_url;a.page_location=3Drb(c,d)||"EMPTY"} function vb(a,b){var c=3D{},d=3Dpb(a,b,a.google_ad_width,a.google_ad_hei= ght);c.iframing=3Dsb(a,d);a.google_page_url?ub(c,a,b,d):tb(c,a,b,d);c.la= st_modified_time=3Db.URL=3D=3Dc.page_url?Date.parse(b.lastModified)/1E3:= h;c.referrer_url=3Dd?a.google_referrer_url:a.google_page_url&&a.google_r= eferrer_url?a.google_referrer_url:b.referrer;return c}function wb(a){var= b=3D{},c=3Da.URL.substring(a.URL.lastIndexOf("http"));b.iframing=3Dh;b.= page_url=3Dc;b.page_location=3Da.URL;b.last_modified_time=3Dh;b.referrer= _url=3Dc;return b} function xb(a,b){b=3Dyb(a,b);qb(a,b)}function yb(a,b){return a=3Da.googl= e_page_url=3D=3Dh&&zb[b.domain]?wb(b):vb(a,b)}var zb=3D{};zb["ad.yieldma= nager.com"]=3Dg;var Ab=3Dr("0.0001",0),Bb=3Dr("1",0.01),Cb=3Dr("0.01",0)= ,Db=3Dr("0.01",0),Eb=3Dr("0.008",0),Fb=3Dr("0.01",0),Gb=3Dr("0",0);var H= b=3Ds("false",j),Ib=3Ds("false",j),Jb=3Ds("false",j);var Kb=3Dfunction(a= ,b,c){b=3Dfa(b,l,a);a=3Dwindow.onerror;window.onerror=3Db;try{c()}catch(= d){c=3Dd.toString();var e=3D"";if(d.fileName)e=3Dd.fileName;var f=3D-1;i= f(d.lineNumber)f=3Dd.lineNumber;b=3Db(c,e,f);if(!b)throw d;}window.onerr= or=3Da};q("google_protectAndRun",Kb); var Mb=3Dfunction(a,b,c,d){if(Math.random()<0.01){var e=3D$a;a=3D["http:= //",ja(),"/pagead/gen_204","?id=3Djserror","&jscb=3D",Hb?1:0,"&jscd=3D",= Ib?1:0,"&context=3D",M(a),"&msg=3D",M(b),"&file=3D",M(c),"&line=3D",M(d.= toString()),"&url=3D",M(e.URL.substring(0,512)),"&ref=3D",M(e.referrer.s= ubstring(0,512))];a.push(Lb());cb(K,a.join(""))}return!Jb};q("google_han= dleError",Mb); var Ob=3Dfunction(a){Nb|=3Da},Nb=3D0,Lb=3Dfunction(){var a=3D["&client=3D= ",M(K.google_ad_client),"&format=3D",M(K.google_ad_format),"&slotname=3D= ",M(K.google_ad_slot),"&output=3D",M(K.google_ad_output),"&ad_type=3D",M= (K.google_ad_type)];return a.join("")};var Q=3D"",Rb=3Dfunction(){if(win= dow.google_ad_frameborder=3D=3Dh)window.google_ad_frameborder=3D0;if(win= dow.google_ad_output=3D=3Dh)window.google_ad_output=3D"html";if(O(window= .google_ad_format)){var a=3Dwindow.google_ad_format.match(/^(\d+)x(\d+)_= .*/);if(a){window.google_ad_width=3DparseInt(a[1],10);window.google_ad_h= eight=3DparseInt(a[2],10);window.google_ad_output=3D"html"}}window.googl= e_ad_format=3DPb(window.google_ad_format,window.google_ad_output,window.= google_ad_width,window.google_ad_height,window.google_ad_slot, !!window.google_override_format);Q=3Dwindow.google_ad_client||"";window.= google_ad_client=3DQb(window.google_ad_format,window.google_ad_client);x= b(window,document);if(window.google_num_slots_by_channel=3D=3Dh)window.g= oogle_num_slots_by_channel=3D{};if(window.google_viewed_host_channels=3D= =3Dh)window.google_viewed_host_channels=3D{};if(window.google_num_slots_= by_client=3D=3Dh)window.google_num_slots_by_client=3D{};if(window.google= _prev_ad_formats_by_region=3D=3Dh)window.google_prev_ad_formats_by_regio= n=3D{};if(window.google_prev_ad_slotnames_by_region=3D=3D h)window.google_prev_ad_slotnames_by_region=3D{};if(window.google_correl= ator=3D=3Dh)window.google_correlator=3D(new Date).getTime();if(window.go= ogle_adslot_loaded=3D=3Dh)window.google_adslot_loaded=3D{};if(window.goo= gle_adContentsBySlot=3D=3Dh)window.google_adContentsBySlot=3D{};if(windo= w.google_flash_version=3D=3Dh)window.google_flash_version=3Dfb();if(wind= ow.google_new_domain_checked=3D=3Dh)window.google_new_domain_checked=3D0= ;if(window.google_new_domain_enabled=3D=3Dh)window.google_new_domain_ena= bled=3D0;if(!window.google_num_ad_slots)window.google_num_ad_slots=3D 0;if(!window.google_num_0ad_slots)window.google_num_0ad_slots=3D0;if(!wi= ndow.google_num_sdo_slots)window.google_num_sdo_slots=3D0;window.google_= ad_section=3Dwindow.google_ad_section||window.google_ad_region||"";windo= w.google_country=3Dwindow.google_country||window.google_gl||"";a=3D(new = Date).getTime();if(o(window.google_color_bg))window.google_color_bg=3DR(= window.google_color_bg,a);if(o(window.google_color_text))window.google_c= olor_text=3DR(window.google_color_text,a);if(o(window.google_color_link)= )window.google_color_link=3D R(window.google_color_link,a);if(o(window.google_color_url))window.googl= e_color_url=3DR(window.google_color_url,a);if(o(window.google_color_bord= er))window.google_color_border=3DR(window.google_color_border,a);if(o(wi= ndow.google_color_line))window.google_color_line=3DR(window.google_color= _line,a)},Sb=3Dfunction(a){L(kb,function(b,c){a[c]=3Dh});L(lb,function(b= ,c){a[c]=3Dh});L(mb,function(b,c){a[c]=3Dh});a.google_container_id=3Dh;a= .google_eids=3Dh;a.google_page_location=3Dh;a.google_referrer_url=3Dh;a.= google_ad_region=3Dh; a.google_gl=3Dh},R=3Dfunction(a,b){Ob(2);return a[b%a.length]},Qb=3Dfunc= tion(a,b){if(!b)return"";b=3Db.toLowerCase();return b=3DO(a)?Tb(b):Ub(b)= },Ub=3Dfunction(a){if(a&&a.substring(0,3)!=3D"ca-")a=3D"ca-"+a;return a}= ,Tb=3Dfunction(a){if(a&&a.substring(0,7)!=3D"ca-aff-")a=3D"ca-aff-"+a;re= turn a},Pb=3Dfunction(a,b,c,d,e,f){if(!a&&b=3D=3D"html")a=3Dc+"x"+d;retu= rn a=3DVb(a,e,f)?a.toLowerCase():""},Vb=3Dfunction(a,b,c){if(!a)return j= ;if(!b)return g;return c};var S=3Ddocument,T=3Dnavigator,U=3Dwindow; function Wb(){var a=3DS.cookie,b=3DMath.round((new Date).getTime()/1E3),= c=3DU.google_analytics_domain_name;c=3Dtypeof c=3D=3D"undefined"?Xb("aut= o"):Xb(c);var d=3Da.indexOf("__utma=3D"+c+".")>-1,e=3Da.indexOf("__utmb=3D= "+c)>-1,f=3Da.indexOf("__utmc=3D"+c)>-1,i=3D{},n=3D!!U&&!!U.gaGlobal;if(= d){a=3Da.split("__utma=3D"+c+".")[1].split(";")[0].split(".");i.sid=3De&= &f?a[3]+"":n&&U.gaGlobal.sid?U.gaGlobal.sid:b+"";i.vid=3Da[0]+"."+a[1];i= .from_cookie=3Dg}else{i.sid=3Dn&&U.gaGlobal.sid?U.gaGlobal.sid:b+"";i.vi= d=3Dn&&U.gaGlobal.vid?U.gaGlobal.vid: (Math.round(Math.random()*2147483647)^Yb()&2147483647)+"."+b;i.from_cook= ie=3Dj}i.dh=3Dc;i.hid=3Dn&&U.gaGlobal.hid?U.gaGlobal.hid:Math.round(Math= .random()*2147483647);return U.gaGlobal=3Di} function Yb(){var a=3DS.cookie?S.cookie:"",b=3DU.history.length,c,d=3D[T= .appName,T.version,T.language?T.language:T.browserLanguage,T.platform,T.= userAgent,T.javaEnabled()?1:0].join("");if(U.screen)d+=3DU.screen.width+= "x"+U.screen.height+U.screen.colorDepth;else if(U.java){c=3Djava.awt.Too= lkit.getDefaultToolkit().getScreenSize();d+=3Dc.screen.width+"x"+c.scree= n.height}d+=3Da;d+=3DS.referrer?S.referrer:"";for(a=3Dd.length;b>0;)d+=3D= b--^a++;return Zb(d)} function Zb(a){var b=3D1,c=3D0,d;if(!(a=3D=3Dundefined||a=3D=3D"")){b=3D= 0;for(d=3Da.length-1;d>=3D0;d--){c=3Da.charCodeAt(d);b=3D(b<<6&268435455= )+c+(c<<14);c=3Db&266338304;b=3Dc!=3D0?b^c>>21:b}}return b}function Xb(a= ){if(!a||a=3D=3D""||a=3D=3D"none")return 1;if("auto"=3D=3Da){a=3DS.domai= n;if("www."=3D=3Da.substring(0,4))a=3Da.substring(4,a.length)}return Zb(= a.toLowerCase())};var V=3Dfunction(){this.defaultBucket=3D[];this.layers= =3D{};for(var a=3D0,b=3Darguments.length;a0&&a.length>0)return thi= s.defaultBucket.join(",")+","+a.join(",");return this.defaultBucket.join= (",")+a.join(",")};var bc=3D{google:1,googlegroups:1,gmail:1,googlemail:= 1,googleimages:1,googleprint:1};function cc(a){a=3Da.google_page_locatio= n||a.google_page_url;if(!a)return j;a=3Da.toString();if(a.indexOf("http:= //")=3D=3D0)a=3Da.substring(7,a.length);else if(a.indexOf("https://")=3D= =3D0)a=3Da.substring(8,a.length);var b=3Da.indexOf("/");if(b=3D=3D-1)b=3D= a.length;a=3Da.substring(0,b);a=3Da.split(".");b=3Dj;if(a.length>=3D3)b=3D= a[a.length-3]in bc;if(a.length>=3D2)b=3Db||a[a.length-2]in bc;return b} function dc(a,b,c){if(cc(a)){a.google_new_domain_checked=3D1;return j}if= (a.google_new_domain_checked=3D=3D0){var d=3DMath.random();if(d<=3Dc){c=3D= "http://"+ia()+"/pagead/test_domain.js";d=3D"script";b.write("<"+d+' src= =3D"'+c+'">");a.google_new_domain_checked=3D1;return g}}return j= }var ec=3Dfunction(a,b){if(!b)return j;if(b.a("1")=3D=3D"44901211")retur= n 0=3D=3Da%2;if(b.a("1")=3D=3D"44901215")return 0=3D=3DMath.floor(a/2)%2= ;if(b.a("1")=3D=3D"44901216")return 1=3D=3DMath.floor(a/2)%2;return j}; function fc(a,b,c){if(!cc(a)&&a.google_new_domain_enabled=3D=3D1)return = ec(b,c)?"http://"+t("","googleads2.g.doubleclick.net"):"http://"+ia();re= turn"http://"+ja()};var W=3Dfunction(a){this.A=3Da;this.i=3D[];this.h=3D= 0;this.b=3D[];this.t=3D0;this.c=3D[];this.r=3Dj;this.j=3Dthis.k=3D"";thi= s.q=3Dj};W.prototype.v=3Dfunction(a,b){var c=3Dthis.A[b],d=3Dthis.i;this= .A[b]=3Dfunction(e){if(e&&e.length>0){var f=3De.length>1?e[1].url:h;d.pu= sh([a,wa(e[0].url),f])}c(e)}};W.prototype.u=3Dfunction(){this.h++};W.pro= totype.w=3Dfunction(a){this.b.push(a)};var gc=3D"http://"+u()+"/pagead/o= sd.js";W.prototype.s=3Dfunction(){if(!this.r){bb(gc);this.r=3Dg}}; W.prototype.l=3Dfunction(a){if(this.h>0)for(var b=3Ddocument.getElements= ByTagName("iframe"),c=3Dthis.q?"google_ads_iframe_":"google_ads_frame",d= =3D0;d0)for(var c=3Ddoc= ument.getElementsByTagName("a"),d=3D0;d0= ){f=3Di;break}i=3Di.parentNode}a(f,b[e][0]);b.splice(e,1);break}};W.prot= otype.n=3Dfunction(a){for(var b=3D0;b0){= for(var d=3D0;d1)c=3Da[0];return xa(c,= "\"'")},nc=3D/[^\d]+$/,oc=3Dfunction(a){return(a=3Da.match(nc))&&a[0]||h= },pc=3D{cm:1,"in":1,mm:1,pc:1,pt:1},qc=3D{em:1,ex:1},rc=3Dfunction(a){va= r b=3Dkc(a,"fontSize"),c=3Doc(b);if(b&&"px"=3D=3Dc)return parseInt(b,10)= ;if(I)if(c in pc)return lc(a,b,"left", "pixelLeft");else if(a.parentNode&&a.parentNode.nodeType=3D=3D1&&c in qc= ){a=3Da.parentNode;c=3Dkc(a,"fontSize");return lc(a,b=3D=3Dc?"1em":b,"le= ft","pixelLeft")}c=3DXa("span",{style:"visibility:hidden;position:absolu= te;line-height:0;padding:0;margin:0;border:0;height:1em;"});Za(a,c);b=3D= c.offsetHeight;c&&c.parentNode&&c.parentNode.removeChild(c);return b};va= r sc,X=3D{};function tc(a){if(a=3D=3D1)return g;return!X[a]}function uc(= a,b){if(!(!a||a=3D=3D""))if(b=3D=3D1)if(X[b])X[b]+=3D","+a;else X[b]=3Da= ;else X[b]=3Da}function vc(){var a=3D[];L(X,function(b){a.push(b)});retu= rn a.join(",")}function wc(a,b){if(o(a))for(var c=3D0;c");a=3Ddc(a,b,Bb);(d=3Dd||a)&&db("msi= e")&&!window.opera?b.write("<"+c+' src=3D"http://'+u()+'/pagead/render_a= ds.js">"):b.write("<"+c+'>google_protectAndRun("ads_core.google_= render_ad", google_handleError, google_render_ad);")}function Z(= a){return a!=3Dh?'"'+a+'"':'""'} function Ac(a){var b=3D"google_unique_id";if(a[b])++a[b];else a[b]=3D1;r= eturn a[b]}var Bc=3Dfunction(a,b){var c=3Db.slice(-1),d=3Dc=3D=3D"?"||c=3D= =3D"#"?"":"&",e=3D[b];b=3Dfunction(f,i){if(f||f=3D=3D=3D0||f=3D=3D=3Dj){= if(typeof f=3D=3D"boolean")f=3Df?1:0;ab(e,d,i,"=3D",M(f));d=3D"&"}};L(a,= b);return e.join("")};function Cc(){var a=3DI&&J("6"),b=3DFa&&J("1.8.1")= ,c=3DGa&&J("525");if(Ma&&(a||b||c))return g;else if(La&&(c||b))return g;= else if(Na&&b)return g;return j} function zc(){return(typeof ExpandableAdSlotFactory=3D=3D"function"||typ= eof ExpandableAdSlotFactory=3D=3D"object")&&typeof ExpandableAdSlotFacto= ry.createIframe=3D=3D"function"}function yc(a,b){if(a.google_allow_expan= dable_ads=3D=3D=3Dj||!b.body||a.google_ad_output!=3D"html"||pb(a,b)||!Dc= (a)||isNaN(a.google_ad_height)||isNaN(a.google_ad_width)||!Cc())return j= ;return g}function Dc(a){var b=3Da.google_ad_format;if(O(b))return j;if(= N(a)&&b!=3D"468x15_0ads_al")return j;return g} function Ec(){var a;if(K.google_ad_output=3D=3D"html"&&!(N(K)||O(K.googl= e_ad_format))&&tc(0)){a=3D["6083035","6083034"];a=3DP(a,Gb);uc(a,0)}retu= rn a=3D=3D"6083035"}function Fc(a,b){if((a.google_unique_id||0)!=3D0||O(= a.google_ad_format))return"";var c=3D"";a=3DN(a);if(b=3D=3D"html"||a)c=3D= P(["36815001","36815002"],Cb);if(c=3D=3D""&&(b=3D=3D"js"||a))c=3DP(["368= 15003","36815004"],Db);if(c=3D=3D""&&(b=3D=3D"html"||b=3D=3D"js"))c=3DP(= ["36813005","36813006"],Eb);return c} function Gc(){var a=3Dic(),b=3Dwindow.google_enable_osd,c;if(b=3D=3D=3Dg= ){c=3D"36813006";Hc(c,a)}else if(b!=3D=3Dj&&tc(0)){c=3Da.getEid();if(c=3D= =3D"")(c=3DFc(window,window.google_ad_output))&&Hc(c,a);else if(c!=3D"36= 815001"&&c!=3D"36815002"&&c!=3D"36815003"&&c!=3D"36815004"&&c!=3D"368130= 05"&&c!=3D"36813006")c=3D""}if(c){uc(c,0);return c}return""} function Hc(a,b){var c=3Db.getOsdMode(),d=3D[];switch(a){case "36815004"= :c=3D1;d=3D["js"];break;case "36815002":c=3D1;d=3D["html"];break;case "3= 6813006":c=3D0;d=3D["html","js"];break}d.length>0&&b.setValidOutputTypes= (d);b.setupOsd(c,a,window.google_correlator)} function Ic(a,b,c,d){var e=3DAc(a);c=3DBc({ifi:e},c);c=3Dc.substring(0,1= 992);c=3Dc.replace(/%\w?$/,"");var f=3D"script";if((a.google_ad_output=3D= =3D"js"||a.google_ad_output=3D=3D"json_html")&&(a.google_ad_request_done= ||a.google_radlink_request_done))b.write("<"+f+' language=3D"JavaScript1= .1" src=3D'+Z(k(c))+">");else if(a.google_ad_output=3D=3D"html")= if(Y&&zc()){b=3Da.google_container_id||d||h;a["google_expandable_ad_slot= "+e]=3DExpandableAdSlotFactory.createIframe("google_ads_frame"+e,k(c),a.= google_ad_width,a.google_ad_height, b)}else{e=3D'