From: Subject: =?iso-8859-1?Q?Scienziati_di_Ventura:_Dall=92hockey_alle_ricerche_sull=92?= =?iso-8859-1?Q?energia_a_basso_costo?= Date: Thu, 11 Oct 2007 14:05:47 +0200 MIME-Version: 1.0 Content-Type: multipart/related; type="multipart/alternative"; boundary="----=_NextPart_000_0025_01C80C0F.D29B6060" X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 This is a multi-part message in MIME format. ------=_NextPart_000_0025_01C80C0F.D29B6060 Content-Type: text/css; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Location: http://www.blogger.com/widgets/3319451950-blogarchive.css #ArchiveList .toggle { CURSOR: pointer; FONT-FAMILY: Arial, sans-serif } #ArchiveList .toggle-open { LINE-HEIGHT: 0.6em; _font-size: 1.7em } #ArchiveList { TEXT-ALIGN: left } #ArchiveList A.post-count-link { TEXT-DECORATION: none } #ArchiveList A.post-count-link:link { TEXT-DECORATION: none } #ArchiveList A.post-count-link:visited { TEXT-DECORATION: none } #ArchiveList A.toggle { TEXT-DECORATION: none } #ArchiveList A.toggle:link { TEXT-DECORATION: none } #ArchiveList A.toggle:visited { TEXT-DECORATION: none } #ArchiveList A.toggle:hover { TEXT-DECORATION: none } .BlogArchive #ArchiveList UL LI { BORDER-TOP-WIDTH: 0px; LIST-STYLE: none none outside; PADDING-LEFT: = 15px; BORDER-LEFT-WIDTH: 0px; BACKGROUND: none transparent scroll repeat = 0% 0%; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: 0px; TEXT-INDENT: -15px; = BORDER-RIGHT-WIDTH: 0px } .BlogArchive #ArchiveList UL UL LI { PADDING-LEFT: 1.2em } .BlogArchive #ArchiveList UL { BORDER-TOP-WIDTH: 0px; PADDING-RIGHT: 0px; PADDING-LEFT: 0px; = BORDER-LEFT-WIDTH: 0px; LIST-STYLE-IMAGE: none; BORDER-BOTTOM-WIDTH: = 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; = LIST-STYLE-TYPE: none; BORDER-RIGHT-WIDTH: 0px } .BlogArchive #ArchiveList UL UL { MARGIN-TOP: 5px } .BlogArchive #ArchiveList UL.posts LI { PADDING-LEFT: 1.3em } #ArchiveList .collapsed UL { DISPLAY: none } ------=_NextPart_000_0025_01C80C0F.D29B6060 Content-Type: text/css; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Location: http://www.blogger.com/css/blog_controls.css .item-control { DISPLAY: none } .item-control A { TEXT-DECORATION: none! important } .item-action A { TEXT-DECORATION: none! important } .widget-item-control { FLOAT: right } .quick-edit-icon { PADDING-RIGHT: 9px; PADDING-LEFT: 9px; BACKGROUND: = url(/img/icon18_edit_allbkg.gif) no-repeat left 50%; PADDING-BOTTOM: = 9px; MARGIN: 0px 0px 0px 0.5em; PADDING-TOP: 9px } .widget-item-control .quick-edit-icon { BACKGROUND: url(/img/icon18_wrench_allbkg.gif) no-repeat left 50% } .delete-comment-icon { PADDING-RIGHT: 7px; PADDING-LEFT: 7px; BACKGROUND: = url(/img/icon_delete13.gif) no-repeat left 50%; PADDING-BOTTOM: 7px; = PADDING-TOP: 7px } .email-post-icon { PADDING-RIGHT: 9px; PADDING-LEFT: 9px; BACKGROUND: = url(/img/icon18_email.gif) no-repeat left 50%; PADDING-BOTTOM: 9px; = MARGIN: 0px 0px 0px 0.5em; PADDING-TOP: 9px } @media All =20 { .BLOG_mobile_video_class { DISPLAY: none } } @media Handheld =20 { .BLOG_mobile_video_class { DISPLAY: inline } .BLOG_video_class { DISPLAY: none } } ------=_NextPart_000_0025_01C80C0F.D29B6060 Content-Type: text/css; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Location: http://www.blogger.com/widgets/2791266615-blog.css .backlink-toggle-zippy { PADDING-RIGHT: 11px; BACKGROUND: = url(http://www.blogger.com/img/triangle.gif) no-repeat left center; = CURSOR: hand; MARGIN-RIGHT: 0.1em } .expanded-backlink .backlink-toggle-zippy { BACKGROUND-IMAGE: url(http://www.blogger.com/img/triangle_open.gif) } .collapsed-backlink .collapseable { DISPLAY: none } .status-msg-wrap { FONT-SIZE: 110%; MARGIN: 10px auto; WIDTH: 90%; POSITION: relative } .status-msg-border { BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FILTER: = alpha(opacity=3D40); BORDER-LEFT: #000000 1px solid; WIDTH: 100%; = BORDER-BOTTOM: #000000 1px solid; POSITION: relative; -moz-opacity: .40; = opacity: .40 } .status-msg-bg { Z-INDEX: 1; FILTER: alpha(opacity=3D30); WIDTH: 100%; POSITION: = relative; BACKGROUND-COLOR: #cccccc; -moz-opacity: .80; opacity: .80 } .status-msg-body { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; Z-INDEX: 4; PADDING-BOTTOM: = 0.3em; WIDTH: 100%; PADDING-TOP: 0.3em; POSITION: absolute; TEXT-ALIGN: = center } .status-msg-hidden { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; VISIBILITY: hidden; = PADDING-BOTTOM: 0.3em; PADDING-TOP: 0.3em } .status-msg-wrap A { PADDING-LEFT: 0.4em; TEXT-DECORATION: underline } ------=_NextPart_000_0025_01C80C0F.D29B6060 Content-Type: image/gif Content-Transfer-Encoding: base64 Content-Location: http://www.blogger.com/img/navbar/1/btn_search_this.gif R0lGODlhYAAPANUAAB9YjAlCeEN6rneq3VKIuxBKf0uBtWic0C5mmjVsoTxzpwhCeBhRhm+j1ghC d0J3q1mOwkJ4qxJLgD9ypDBikhJKgEN4rD5xozBiky9ikiVckRJKfSZdkSVdkRJJfSZdkj9xo2GV ySZfk36x5BFEd0J4rAlDeAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAAAAAALAAAAABgAA8AAAb/QA8G 9CgZj8ikcslsOp/Q54VCynQqpqx2y+16v+CweDyWcCgTyYLMbrvfbsmk5FjD7/i8eLF4RBwBWQkD IwkmIiOJIlkGIwZZiCMDhiYADY6HI1kji1kCiSMhmZuLiiaDhVuRIwJZIa2ChI+xIwRZDiZFJoEm AwgFBaNbByEHkJoKmiYNCiYMwpxc0dCLAqK9v8FaiCYIyq9avgwjAM7klVmBEQ+AWQMHnYginQWF I8HyBMYA99uc8tLi/YtmzR08LvmMmQAnDJwChVoCLChhIQAvSyMQZApxzZuJjJkODFjEzR/HaVqm ITpZ7RpGjSYb2FoIqyQ4a5HSmSjxwOIWxgiiSjIaEGLAI24GRPF7doxUwKYfW/681rReOYb8gh1o lqCBsEAlIkjMokAEBFvyRAQLQUAEgaCaxj070JakMpROqZnQF6zsWVWckl1t+6yBAG/PGAxQkExL n4p2khIIBoBjiKvlKle6ZsBQgbfNNC8st+VyFtGmOZaTrO20ZZhJQxgCABRmJaCzAjgI206P7995 Jl6QwAu48eNhHMihoKHCAoskokufTr269evTA2Dfzr379AofMGxAEyGK+fPo05ufkIFEEAA7 ------=_NextPart_000_0025_01C80C0F.D29B6060 Content-Type: text/css; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Location: http://www.blogger.com/v-css/navbar/1417053854-navbar.css #b-navbar { DISPLAY: block! important; Z-INDEX: 1; MIN-HEIGHT: 24px; LEFT: 0px; = MARGIN-BOTTOM: 10px; PADDING-BOTTOM: 4px; FONT: small "Trebuchet = MS",Verdana,Arial,Sans-serif; WIDTH: 100%; COLOR: #47a; BORDER-BOTTOM: = #024 1px solid; POSITION: absolute! important; TOP: 0px } .bt1 { FONT-SIZE: 1px; MARGIN: 0px 1px; LINE-HEIGHT: 1px; POSITION: relative; = HEIGHT: 1px } .bt2 { PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-SIZE: 83%; PADDING-BOTTOM: = 2px; PADDING-TOP: 2px; POSITION: relative } #b-next { PADDING-LEFT: 5px } #b-search-this { MARGIN: 0px; TEXT-TRANSFORM: uppercase; CURSOR: pointer; WHITE-SPACE: = nowrap; POSITION: relative; TEXT-DECORATION: none } #b-flag-this { PADDING-LEFT: 5px; MARGIN: 0px; TEXT-TRANSFORM: uppercase; CURSOR: = pointer; WHITE-SPACE: nowrap; POSITION: relative; TEXT-DECORATION: none } #b-navbar #b-logo { BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; LEFT: 5px; = BORDER-BOTTOM-WIDTH: 0px; POSITION: absolute! important; TOP: 0.15em; = BORDER-RIGHT-WIDTH: 0px } @media All =20 { #b-search { MARGIN: 0px 0px 0px 34px; HEIGHT: 1em; BACKGROUND-COLOR: #147 } #b-search TABLE { PADDING-RIGHT: 5px } #b-search TD { FONT-SIZE: 100%; LINE-HEIGHT: 0.8em } #b-more { FLOAT: right } #b-searchbtn { MARGIN-RIGHT: 5px } #b-more { FLOAT: right } #b-search TABLE { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FLOAT: left; PADDING-BOTTOM: = 2px; PADDING-TOP: 2px; _padding: 1px 2px 1px } #b-search A { LINE-HEIGHT: 1em; TEXT-DECORATION: none } #b-search A:hover { LINE-HEIGHT: 1em; TEXT-DECORATION: none } #b-search TD { LINE-HEIGHT: 0.8; PADDING-TOP: 2px } #b-search TD TD { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; = PADDING-TOP: 0px } #b-searchbtn { DISPLAY: block } } @media Handheld =20 { #b-search { DISPLAY: none! important } #b-more { DISPLAY: none! important } } .navbar-right { PADDING-RIGHT: 10px } TD.navbutton { PADDING-RIGHT: 5px; _padding-top: .3em } TD.navsearch { PADDING-LEFT: 5px } #b-query { VERTICAL-ALIGN: top; WIDTH: 12em; MARGIN-RIGHT: 0.25em } #b-query { FONT-SIZE: x-small! important } @media All =20 { BODY DIV.b-mobile { DISPLAY: none } #b-sms { DISPLAY: none! important } } @media Handheld =20 { BODY DIV.b-mobile { DISPLAY: block } #b-sms { PADDING-RIGHT: 7px; DISPLAY: block! important; PADDING-LEFT: 7px; = FONT-SIZE: 100%; PADDING-BOTTOM: 4px; MARGIN: 0px 0px 0px 100px; = LINE-HEIGHT: 1em; PADDING-TOP: 4px; TEXT-ALIGN: left } #b-sms A { LINE-HEIGHT: 1em; MARGIN-RIGHT: 0.5em; WHITE-SPACE: nowrap; = TEXT-DECORATION: none } #b-sms A:hover { COLOR: #fff; TEXT-DECORATION: underline } } @media All =20 { #flagi { PADDING-RIGHT: 1px; DISPLAY: none; PADDING-LEFT: 1px; Z-INDEX: 300; = PADDING-BOTTOM: 1px; PADDING-TOP: 1px; TOP: 7px; BACKGROUND-COLOR: #333 } #unflagi { PADDING-RIGHT: 1px; DISPLAY: none; PADDING-LEFT: 1px; Z-INDEX: 300; = PADDING-BOTTOM: 1px; PADDING-TOP: 1px; TOP: 7px; BACKGROUND-COLOR: #333 } } @media Handheld =20 { #flagi { DISPLAY: none! important } #unflagi { DISPLAY: none! important } } #flagi-body { PADDING-RIGHT: 3px; PADDING-LEFT: 3px; FONT-WEIGHT: bold; FONT-SIZE: = 10px; PADDING-BOTTOM: 3px; LINE-HEIGHT: 14px; PADDING-TOP: 3px; = FONT-FAMILY: "Trebuchet MS", Vedana, Arial, Sans-serif; = BACKGROUND-COLOR: #ffff99; TEXT-ALIGN: center } #flagi-body A { FONT-SIZE: 10px; COLOR: #3366cc; TEXT-DECORATION: none } #flagi-body A:hover { TEXT-DECORATION: underline } #unflagi-body { PADDING-RIGHT: 3px; PADDING-LEFT: 3px; FONT-WEIGHT: bold; FONT-SIZE: = 10px; PADDING-BOTTOM: 3px; LINE-HEIGHT: 14px; PADDING-TOP: 3px; = FONT-FAMILY: "Trebuchet MS", Vedana, Arial, Sans-serif; = BACKGROUND-COLOR: #ffff99; TEXT-ALIGN: center } #unflagi-body A { FONT-SIZE: 10px; COLOR: #3366cc; TEXT-DECORATION: none } #unflagi-body A:hover { TEXT-DECORATION: underline } ------=_NextPart_000_0025_01C80C0F.D29B6060 Content-Type: text/css; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Location: http://www.blogger.com/v-css/navbar/2433223533-1.css #b-navbar { COLOR: #47a; BORDER-BOTTOM: #024 1px solid; BACKGROUND-COLOR: #036 } #b-search TABLE { BACKGROUND: url(../../img/navbar/1/corner.gif) #147 no-repeat left = bottom } #b-query { BORDER-RIGHT: #47a 1px solid; BORDER-TOP: #47a 1px solid; BORDER-LEFT: = #47a 1px solid; BORDER-BOTTOM: #47a 1px solid } #b-search A { COLOR: #9cf } #b-search TD { COLOR: #fff } #b-search A:hover { COLOR: #fff } #b-sms A { COLOR: #9cf } #b-sms A:hover { COLOR: #fff } #navbar-logo { BACKGROUND-IMAGE: url(../../img/navbar/1/logobar.gif); WIDTH: 24px; = HEIGHT: 24px } #b-search-this { BACKGROUND: #114477 } .bt1 { BACKGROUND-COLOR: #4477aa } .bt2 { BORDER-RIGHT: #4477aa 1px solid; BORDER-LEFT: #4477aa 1px solid; COLOR: = #99ccff; BACKGROUND-COLOR: #114477 } DIV.bt2:hover { BACKGROUND-COLOR: #4477aa } #bt-flag { PADDING-LEFT: 8px; BACKGROUND: url(../../img/navbar/1/flag.gif) = no-repeat left 50% } ------=_NextPart_000_0025_01C80C0F.D29B6060 Content-Type: application/octet-stream Content-Transfer-Encoding: quoted-printable Content-Location: http://www.blogger.com/v-js/3625575137-cookies.common.js // Copyright 2005, Google Inc.=0A= // =0A= // Operations on cookies that are common across our pages.=0A= //=0A= // Original Author: Pal Takacsi-Nagy (pal@google.com)=0A= =0A= =0A= /**=0A= * Sets a Cookie with the given name and value.=0A= *=0A= * name Name of the cookie=0A= * value Value of the cookie=0A= * [expires] Expiration date of the cookie (default: end of current = session)=0A= * [path] Path where the cookie is valid (default: path of calling = document)=0A= * [domain] Domain where the cookie is valid=0A= * (default: domain of calling document)=0A= * [secure] Boolean value indicating if the cookie transmission = requires a=0A= * secure transmission=0A= */=0A= function setCookie(name, value, domain, expires, path, secure) {=0A= document.cookie =3D name + "=3D" + escape(value) +=0A= ((expires) ? "; expires=3D" + expires.toGMTString() : "") +=0A= ((path) ? "; path=3D" + path : "") +=0A= ((domain) ? "; domain=3D" + domain : "") +=0A= ((secure) ? "; secure" : "");=0A= }=0A= =0A= /**=0A= * Gets the value of the specified cookie.=0A= *=0A= * name Name of the desired cookie.=0A= *=0A= * Returns a string containing value of specified cookie,=0A= * or null if cookie does not exist.=0A= */=0A= function getCookie(name) {=0A= var dc =3D document.cookie;=0A= var prefix =3D name + "=3D";=0A= var begin =3D dc.indexOf("; " + prefix);=0A= =0A= if (begin =3D=3D -1) {=0A= begin =3D dc.indexOf(prefix);=0A= if (begin !=3D 0) return null;=0A= } else {=0A= begin +=3D 2;=0A= }=0A= =0A= var end =3D document.cookie.indexOf(";", begin);=0A= =0A= if (end =3D=3D -1) {=0A= end =3D dc.length;=0A= }=0A= =0A= return unescape(dc.substring(begin + prefix.length, end));=0A= }=0A= ------=_NextPart_000_0025_01C80C0F.D29B6060 Content-Type: application/octet-stream Content-Transfer-Encoding: quoted-printable Content-Location: http://www.blogger.com/v-app/scripts/1019856700-common.js // Copied from .../google3/javascript/common.js=0A= =0A= //-----------------------------------------------------------------------= -=0A= // This file contains common utilities and basic javascript = infrastructure.=0A= //=0A= // Notes:=0A= // * Press 'D' to toggle debug mode.=0A= //=0A= // Functions:=0A= //=0A= // - Assertions=0A= // DEPRECATED: Use assert.js=0A= // AssertTrue(): assert an expression. Throws an exception if false.=0A= // Fail(): Throws an exception. (Mark block of code that should be = unreachable)=0A= // AssertEquals(): assert that two values are equal.=0A= // AssertNumArgs(): assert number of arguments for the function=0A= // AssertType(): assert that a value has a particular type=0A= //=0A= // - Cookies=0A= // SetCookie(): Sets a cookie.=0A= // ExpireCookie(): Expires a cookie.=0A= // GetCookie(): Gets a cookie value.=0A= //=0A= // - Dynamic HTML/DOM utilities=0A= // MaybeGetElement(): get an element by its id=0A= // GetElement(): get an element by its id=0A= // GetParentNode(): Get the parent of an element=0A= // GetAttribute(): Get attribute value of a DOM node=0A= // SetInnerHTML(): set the inner HTML of a node=0A= // GetInnerHTML(): get the inner HTML of a node=0A= // ClearInnerHTML(): clear the inner HTML of a node=0A= // SetCssStyle(): Sets a CSS property of a node.=0A= // GetStyleProperty(): Get CSS property from a style attribute string=0A= // ShowElement(): Show/hide element by setting the "display" css = property.=0A= // ShowBlockElement(): Show/hide block element=0A= // SetButtonText(): Set the text of a button element.=0A= // AppendNewElement(): Create and append a html element to a parent node.=0A= // CreateDIV(): Create a DIV element and append to the document.=0A= // CreateIFRAME(): Create an IFRAME and append to the document.=0A= // HasClass(): check if element has a given class=0A= // AddClass(): add a class to an element=0A= // RemoveClass(): remove a class from an element=0A= //=0A= // - Window/Screen utiltiies=0A= // GetPageOffsetLeft(): get the X page offset of an element=0A= // GetPageOffsetTop(): get the Y page offset of an element=0A= // GetPageOffset(): get the X and Y page offsets of an element=0A= // GetPageOffsetRight() : get X page offset of the right side of an = element=0A= // GetPageOffsetRight() : get Y page offset of the bottom of an element=0A= // GetScrollTop(): get the vertical scrolling pos of a window.=0A= // GetScrollLeft(): get the horizontal scrolling pos of a window=0A= // IsScrollAtEnd(): check if window scrollbar has reached its maximum = offset=0A= // ScrollTo(): scroll window to a position=0A= // ScrollIntoView(): scroll window so that an element is in view.=0A= // GetWindowWidth(): get width of a window.=0A= // GetWindowHeight(): get height of a window=0A= // GetAvailScreenWidth(): get available screen width=0A= // GetAvailScreenHeight(): get available screen height=0A= // GetNiceWindowHeight(): get a nice height for a new browser window.=0A= // Open{External/Internal}Window(): open a separate window=0A= // CloseWindow(): close a window=0A= //=0A= // - DOM walking utilities=0A= // AnnotateTerms(): find terms in a node and decorate them with some tag=0A= // AnnotateText(): find terms in a text node and decorate them with some = tag=0A= //=0A= // - String utilties=0A= // HtmlEscape(): html escapes a string=0A= // HtmlUnescape(): remove html-escaping.=0A= // QuoteEscape(): escape " quotes.=0A= // CollapseWhitespace(): collapse multiple whitespace into one = whitespace.=0A= // Trim(): trim whitespace on ends of string=0A= // IsEmpty(): check if CollapseWhiteSpace(String) =3D=3D ""=0A= // IsLetterOrDigit(): check if a character is a letter or a digit=0A= // ConvertEOLToLF(): normalize the new-lines of a string.=0A= // HtmlEscapeInsertWbrs(): HtmlEscapes and inserts s (word break = tags)=0A= // after every n non-space chars and/or after or before certain = special chars=0A= //=0A= // - TextArea utilities=0A= // GetCursorPos(): finds the cursor position of a textfield=0A= // SetCursorPos(): sets the cursor position in a textfield=0A= //=0A= // - Array utilities=0A= // FindInArray(): do a linear search to find an element value.=0A= // DeleteArrayElement(): return a new array with a specific value = removed.=0A= // CloneObject(): clone an object, copying its values recursively.=0A= // CloneEvent(): clone an event; cannot use CloneObject because it=0A= // suffers from infinite recursion=0A= //=0A= // - Formatting utilities=0A= // PrintArray(): used to print/generate HTML by combining static text=0A= // and dynamic strings.=0A= // ImageHtml(): create html for an img tag=0A= // FormatJSLink(): formats a link that invokes js code when clicked.=0A= // MakeId3(): formats an id that has two id numbers, eg, foo_3_7=0A= //=0A= // - Miscellaneous=0A= // IsDefined(): returns true if argument is not undefined=0A= //-----------------------------------------------------------------------= -=0A= =0A= // browser detection=0A= var agent =3D navigator.userAgent.toLowerCase();=0A= var is_ie =3D (agent.indexOf('msie') !=3D -1);=0A= //var is_ie5 =3D (agent.indexOf('msie 5') !=3D -1 && document.all);=0A= var is_konqueror =3D (agent.indexOf('konqueror') !=3D -1);=0A= var is_safari =3D (agent.indexOf('safari') !=3D -1) || is_konqueror;=0A= var is_nav =3D !is_ie && !is_safari && (agent.indexOf('mozilla') !=3D = -1);=0A= var is_win =3D (agent.indexOf('win') !=3D -1);=0A= delete agent;=0A= =0A= =0A= var BACKSPACE_KEYCODE =3D 8;=0A= var COMMA_KEYCODE =3D 188; // ',' key=0A= var DEBUG_KEYCODE =3D 68; // 'D' key=0A= var DELETE_KEYCODE =3D 46;=0A= var DOWN_KEYCODE =3D 40; // DOWN arrow key=0A= var ENTER_KEYCODE =3D 13; // ENTER key=0A= var ESC_KEYCODE =3D 27; // ESC key=0A= var LEFT_KEYCODE =3D 37; // LEFT arrow key=0A= var RIGHT_KEYCODE =3D 39; // RIGHT arrow key=0A= var SPACE_KEYCODE =3D 32; // space bar=0A= var TAB_KEYCODE =3D 9; // TAB key=0A= var UP_KEYCODE =3D 38; // UP arrow key=0A= var SHIFT_KEYCODE =3D 16;=0A= =0A= // This is a "constant" but has different values depending on the browser=0A= var semicolon_keycode =3D (is_ie ? 186 : 59);=0A= =0A= var MAX_EMAIL_ADDRESS_LENGTH =3D 320; // 64 + '@' + 255=0A= var MAX_SIGNATURE_LENGTH =3D 1000; // 1000 chars of maximum = signature=0A= =0A= //-----------------------------------------------------------------------= -=0A= // Assertions=0A= // DEPRECATED: Use assert.js=0A= //-----------------------------------------------------------------------= -=0A= /**=0A= * DEPRECATED: Use assert.js=0A= */=0A= function raise(msg) {=0A= if (typeof Error !=3D 'undefined') {=0A= throw new Error(msg || 'Assertion Failed');=0A= } else {=0A= throw (msg);=0A= }=0A= }=0A= =0A= /**=0A= * DEPRECATED: Use assert.js=0A= *=0A= * Fail() is useful for marking logic paths that should=0A= * not be reached. For example, if you have a class that uses=0A= * ints for enums:=0A= *=0A= * MyClass.ENUM_FOO =3D 1;=0A= * MyClass.ENUM_BAR =3D 2;=0A= * MyClass.ENUM_BAZ =3D 3;=0A= *=0A= * And a switch statement elsewhere in your code that=0A= * has cases for each of these enums, then you can=0A= * "protect" your code as follows:=0A= *=0A= * switch(type) {=0A= * case MyClass.ENUM_FOO: doFooThing(); break;=0A= * case MyClass.ENUM_BAR: doBarThing(); break;=0A= * case MyClass.ENUM_BAZ: doBazThing(); break;=0A= * default:=0A= * Fail("No enum in MyClass with value: " + type);=0A= * }=0A= *=0A= * This way, if someone introduces a new value for this enum=0A= * without noticing this switch statement, then the code will=0A= * fail if the logic allows it to reach the switch with the=0A= * new value, alerting the developer that he should add a=0A= * case to the switch to handle the new value he has introduced.=0A= *=0A= * @param {string} opt_msg to display for failure=0A= * DEFAULT: "Assertion failed"=0A= */=0A= function Fail(opt_msg) {=0A= if (opt_msg =3D=3D=3D undefined) opt_msg =3D 'Assertion failed';=0A= if (IsDefined(DumpError)) DumpError(opt_msg + '\n');=0A= raise(opt_msg);=0A= }=0A= =0A= /**=0A= * DEPRECATED: Use assert.js=0A= *=0A= * Asserts that an expression is true (non-zero and non-null).=0A= *=0A= * Note that it is critical not to pass logic=0A= * with side-effects as the expression for AssertTrue=0A= * because if the assertions are removed by the=0A= * JSCompiler, then the expression will be removed=0A= * as well, in which case the side-effects will=0A= * be lost. So instead of this:=0A= *=0A= * AssertTrue( criticalComputation() );=0A= *=0A= * Do this:=0A= *=0A= * var result =3D criticalComputation();=0A= * AssertTrue(result);=0A= *=0A= * @param {anything} expression to evaluate=0A= * @param {string} opt_msg to display if the assertion fails=0A= *=0A= */=0A= function AssertTrue(expression, opt_msg) {=0A= if (!expression) {=0A= if (opt_msg =3D=3D=3D undefined) opt_msg =3D 'Assertion failed';=0A= Fail(opt_msg);=0A= }=0A= }=0A= =0A= /**=0A= * DEPRECATED: Use assert.js=0A= *=0A= * Asserts that two values are the same.=0A= *=0A= * @param {anything} val1=0A= * @param {anything} val2=0A= * @param {string} opt_msg to display if the assertion fails=0A= */=0A= function AssertEquals(val1, val2, opt_msg) {=0A= if (val1 !=3D val2) {=0A= if (opt_msg =3D=3D=3D undefined) {=0A= opt_msg =3D "AssertEquals failed: <" + val1 + "> !=3D <" + val2 + = ">";=0A= }=0A= Fail(opt_msg);=0A= }=0A= }=0A= =0A= /**=0A= * DEPRECATED: Use assert.js=0A= *=0A= * Asserts that a value is of the provided type.=0A= *=0A= * AssertType(6, Number);=0A= * AssertType("ijk", String);=0A= * AssertType([], Array);=0A= * AssertType({}, Object);=0A= * AssertType(ICAL_Date.now(), ICAL_Date);=0A= *=0A= * @param {anything} value=0A= * @param {constructor function} type=0A= * @param {string} opt_msg to display if the assertion fails=0A= */=0A= function AssertType(value, type, opt_msg) {=0A= // for backwards compatability only=0A= if (typeof value =3D=3D type) return;=0A= =0A= if (value || value =3D=3D "") {=0A= try {=0A= if (type =3D=3D AssertTypeMap[typeof value] || value instanceof = type) return;=0A= } catch (e) { /* failure, type was an illegal argument to instanceof = */ }=0A= }=0A= if (opt_msg =3D=3D=3D undefined) {=0A= if (typeof type =3D=3D 'function') {=0A= var match =3D type.toString().match(/^\s*function\s+([^\s\{]+)/);=0A= if (match) type =3D match[1];=0A= }=0A= opt_msg =3D "AssertType failed: <" + value + "> not typeof "+ type;=0A= }=0A= Fail(opt_msg);=0A= }=0A= =0A= var AssertTypeMap =3D {=0A= 'string' : String,=0A= 'number' : Number,=0A= 'boolean' : Boolean=0A= };=0A= =0A= /**=0A= * DEPRECATED: Use assert.js=0A= *=0A= * Asserts that the number of arguments to a=0A= * function is num. For example:=0A= *=0A= * function myFunc(one, two, three) [=0A= * AssertNumArgs(3);=0A= * ...=0A= * }=0A= *=0A= * myFunc(1, 2); // assertion fails!=0A= *=0A= * Note that AssertNumArgs does not take the function=0A= * as an argument; it is simply used in the context=0A= * of the function.=0A= *=0A= * @param {int} number of arguments expected=0A= * @param {string} opt_msg to display if the assertion fails=0A= */=0A= function AssertNumArgs(num, opt_msg) {=0A= var caller =3D AssertNumArgs.caller; // This is not supported in = safari 1.0=0A= if (caller && caller.arguments.length !=3D num) {=0A= if (opt_msg =3D=3D=3D undefined) {=0A= opt_msg =3D caller.name + ' expected ' + num + ' arguments '=0A= + ' but received ' + caller.arguments.length;=0A= }=0A= Fail(opt_msg);=0A= }=0A= }=0A= =0A= //-----------------------------------------------------------------------= -=0A= // Cookies=0A= //-----------------------------------------------------------------------= -=0A= var ILLEGAL_COOKIE_CHARS_RE =3D /[\s;]/=0A= /**=0A= * Sets a cookie.=0A= * The max_age can be -1 to set a session cookie. To expire cookies, use=0A= * ExpireCookie() instead.=0A= *=0A= * @param name The cookie name.=0A= * @param value The cookie value.=0A= * @param opt_max_age The max age in seconds (from now). Use -1 to set a=0A= * session cookie. If not provided, the default is -1 (i.e. set a = session=0A= * cookie).=0A= * @param opt_path The path of the cookie, or null to not specify a path=0A= * attribute (browser will use the full request path). If not = provided, the=0A= * default is '/' (i.e. path=3D/).=0A= * @param opt_domain The domain of the cookie, or null to not specify a = domain=0A= * attribute (brower will use the full request host name). If not = provided,=0A= * the default is null (i.e. let browser use full request host name).=0A= * @return Void.=0A= */=0A= function SetCookie(name, value, opt_max_age, opt_path, opt_domain) {=0A= =0A= value =3D '' + value;=0A= AssertTrue((typeof name =3D=3D 'string' &&=0A= typeof value =3D=3D 'string' &&=0A= !name.match(ILLEGAL_COOKIE_CHARS_RE) &&=0A= !value.match(ILLEGAL_COOKIE_CHARS_RE)),=0A= 'trying to set an invalid cookie');=0A= =0A= if (!IsDefined(opt_max_age)) opt_max_age =3D -1;=0A= if (!IsDefined(opt_path)) opt_path =3D '/';=0A= if (!IsDefined(opt_domain)) opt_domain =3D null;=0A= =0A= var domain_str =3D (opt_domain =3D=3D null) ? '' : ';domain=3D' + = opt_domain;=0A= var path_str =3D (opt_path =3D=3D null) ? '' : ';path=3D' + opt_path;=0A= =0A= var expires_str;=0A= =0A= // Case 1: Set a session cookie.=0A= if (opt_max_age < 0) {=0A= expires_str =3D '';=0A= =0A= // Case 2: Expire the cookie.=0A= // Note: We don't tell people about this option in the function doc = because=0A= // we prefer people to use ExpireCookie() to expire cookies.=0A= } else if (opt_max_age =3D=3D 0) {=0A= // Note: Don't use Jan 1, 1970 for date because NS 4.76 will try to = convert=0A= // it to local time, and if the local time is before Jan 1, 1970, = then the=0A= // browser will ignore the Expires attribute altogether.=0A= var pastDate =3D new Date(1970, 1 /*Feb*/, 1); // Feb 1, 1970=0A= expires_str =3D ';expires=3D' + pastDate.toUTCString();=0A= =0A= // Case 3: Set a persistent cookie.=0A= } else {=0A= var futureDate =3D new Date(Now() + opt_max_age * 1000);=0A= expires_str =3D ';expires=3D' + futureDate.toUTCString();=0A= }=0A= =0A= document.cookie =3D name + '=3D' + value + domain_str + path_str + = expires_str;=0A= }=0A= =0A= var EXPIRED_COOKIE_VALUE =3D 'EXPIRED';=0A= =0A= /**=0A= * Expires a cookie.=0A= *=0A= * @param name The cookie name.=0A= * @param opt_path The path of the cookie, or null to expire a cookie = set at=0A= * the full request path. If not provided, the default is '/' (i.e. = path=3D/).=0A= * @param opt_domain The domain of the cookie, or null to expire a = cookie set=0A= * at the full request host name. If not provided, the default is null = (i.e.=0A= * cookie at full request host name).=0A= * @return Void.=0A= */=0A= function ExpireCookie(name, opt_path, opt_domain) {=0A= SetCookie(name, EXPIRED_COOKIE_VALUE, 0, opt_path, opt_domain);=0A= }=0A= =0A= /** Returns the value for the first cookie with the given name=0A= * @param name : string=0A= * @return a string or the empty string if no cookie found.=0A= */=0A= function GetCookie(name) {=0A= var nameeq =3D name + "=3D";=0A= var cookie =3D String(document.cookie);=0A= for (var pos =3D -1; (pos =3D cookie.indexOf(nameeq, pos + 1)) >=3D = 0;) {=0A= var i =3D pos;=0A= // walk back along string skipping whitespace and looking for a ; = before=0A= // the name to make sure that we don't match cookies whose name = contains=0A= // the given name as a suffix.=0A= while (--i >=3D 0) {=0A= var ch =3D cookie.charAt(i);=0A= if (ch =3D=3D ';') {=0A= i =3D -1; // indicate success=0A= break;=0A= } else if (' \t'.indexOf(ch) < 0) {=0A= break;=0A= }=0A= }=0A= if (-1 =3D=3D=3D i) { // first cookie in the string or we found a ;=0A= var end =3D cookie.indexOf(';', pos);=0A= if (end < 0) { end =3D cookie.length; }=0A= return cookie.substring(pos + nameeq.length, end);=0A= }=0A= }=0A= return "";=0A= }=0A= =0A= =0A= //-----------------------------------------------------------------------= -=0A= // Time=0A= //-----------------------------------------------------------------------= -=0A= function Now() {=0A= return (new Date()).getTime();=0A= }=0A= =0A= //-----------------------------------------------------------------------= -=0A= // Dynamic HTML/DOM utilities=0A= //-----------------------------------------------------------------------= -=0A= // Gets a element by its id, may return null=0A= function MaybeGetElement(win, id) {=0A= return win.document.getElementById(id);=0A= }=0A= =0A= // Same as MaybeGetElement except that it throws an exception if it's = null=0A= function GetElement(win, id) {=0A= var el =3D win.document.getElementById(id);=0A= if (!el) {=0A= DumpError("Element " + id + " not found.");=0A= }=0A= return el;=0A= }=0A= =0A= // Gets elements by its id/name=0A= // IE treats getElementsByName as searching over ids, while Moz use = names.=0A= // so tags must have both id and name as the same string=0A= function GetElements(win, id) {=0A= return win.document.getElementsByName(id);=0A= }=0A= =0A= // Gets the parent of a html element.=0A= function GetParentNode(n) {=0A= try {=0A= return n.parentNode;=0A= } catch (e) {=0A= // n.parentNode may throw a permission-denied exception on mozilla=0A= // (e.g. on text element), ignore this exception.=0A= return n;=0A= }=0A= }=0A= =0A= function IsDescendant(parent, child) {=0A= do {=0A= if (parent =3D=3D=3D child) return true;=0A= child =3D GetParentNode(child);=0A= } while (child && child !=3D=3D document.body);=0A= return false;=0A= }=0A= =0A= // Get attribute value of a DOM node=0A= function GetAttribute(node, attribute) {=0A= if (!node.getAttribute) {=0A= return null;=0A= }=0A= var attr =3D node.getAttribute(attribute);=0A= if (is_ie && attribute =3D=3D "style") {=0A= return attr.value;=0A= } else {=0A= return attr;=0A= }=0A= }=0A= =0A= // Sets inner html of a html element=0A= function SetInnerHTML(win, id, html) {=0A= try {=0A= GetElement(win, id).innerHTML =3D html;=0A= } catch (ex) {=0A= DumpException(ex);=0A= }=0A= }=0A= =0A= // Gets inner-html of a html element=0A= function GetInnerHTML(win, id) {=0A= try {=0A= return GetElement(win, id).innerHTML;=0A= } catch (ex) {=0A= DumpException(ex);=0A= return "";=0A= }=0A= }=0A= =0A= // Clears inner html of a html element=0A= function ClearInnerHTML(win, id) {=0A= try {=0A= GetElement(win, id).innerHTML =3D "";=0A= } catch (ex) {=0A= DumpException(ex);=0A= }=0A= }=0A= =0A= // Sets a CSS style of an element=0A= function SetCssStyle(win, id, name, value) {=0A= try {=0A= var elem =3D GetElement(win, id);=0A= elem.style[name] =3D value;=0A= } catch (ex) {=0A= DumpException(ex);=0A= }=0A= }=0A= =0A= // Get CSS property from a style attribute string=0A= function GetStyleProperty(style, name) {=0A= var i =3D style.indexOf(name);=0A= if (i !=3D -1) {=0A= var j =3D style.indexOf(";", i);=0A= if (j =3D=3D -1) {=0A= j =3D style.length;=0A= }=0A= // the +1 below is for the colon following the attribute name=0A= return CollapseWhitespace(style.substring(i + name.length + 1, j));=0A= }=0A= return null;=0A= }=0A= =0A= // Show/hide an element.=0A= function ShowElement(el, show) {=0A= el.style.display =3D show ? "" : "none";=0A= }=0A= =0A= // Show/hide a block element.=0A= // ShowElement() doesn't work if object has an initial class with = display:none=0A= function ShowBlockElement(el, show) {=0A= el.style.display =3D show ? "block" : "none";=0A= }=0A= =0A= // Show/hide an inline element.=0A= // ShowElement() doesn't work when an element starts off display:none.=0A= function ShowInlineElement(el, show) {=0A= el.style.display =3D show ? "inline" : "none";=0A= }=0A= =0A= // Set the text of a button. This is to get around a bug in mozilla,=0A= // where we can't set the text of a button by setting innerHTML.=0A= function SetButtonText(button, text) {=0A= button.childNodes[0].nodeValue =3D text;=0A= }=0A= =0A= // Append a new HTML element to a HTML node.=0A= function AppendNewElement(win, parent, tag) {=0A= var e =3D win.document.createElement(tag);=0A= parent.appendChild(e);=0A= return e;=0A= }=0A= =0A= // Finds the child with the given ID, or null if there is node.=0A= // This does not search the children's children.=0A= function FindChildWithID(parent, id) {=0A= var el;=0A= for (el =3D parent.firstChild; el && el.id !=3D id; el =3D = el.nextSibling) {=0A= // skip=0A= }=0A= return el;=0A= }=0A= =0A= // Adds a disabled option to the given menu=0A= function AddMenuDisabledOption(win, menu, html) {=0A= var op =3D AppendNewElement(win, menu, 'OPTION');=0A= op.disabled =3D true;=0A= op.innerHTML =3D html;=0A= =0A= return op;=0A= }=0A= =0A= // Adds a option to the given menu=0A= function AddMenuOption(win, menu, value, html) {=0A= var op =3D AppendNewElement(win, menu, 'OPTION');=0A= op.value =3D value;=0A= op.innerHTML =3D html;=0A= =0A= return op;=0A= }=0A= =0A= // Create a new DIV (append it to the end of the document)=0A= function CreateDIV(win, id) {=0A= var div =3D MaybeGetElement(win, id);=0A= if (!div) {=0A= div =3D AppendNewElement(win, win.document.body, "div");=0A= div.id =3D id;=0A= }=0A= return div;=0A= }=0A= =0A= // Create a new IFRAME (append it to the end of the document)=0A= function CreateIFRAME(win, id, url) {=0A= var iframe =3D MaybeGetElement(win, id);=0A= if (!iframe) {=0A= // We cannot create an IFRAME directly (IE doesn't allow it), so we=0A= // create a DIV and then insert an IFRAME.=0A= // We also give the IFRAME a name (same as id)=0A= var div =3D AppendNewElement(win, win.document.body, "div");=0A= div.innerHTML =3D "";=0A= iframe =3D GetElement(win, id);=0A= }=0A= return iframe;=0A= }=0A= =0A= // Create a new TR containing the given td's=0A= function Tr(win, tds) {=0A= var tr =3D win.document.createElement("TR");=0A= for (var i =3D 0; i < tds.length; i++) {=0A= tr.appendChild(tds[i]);=0A= }=0A= return tr;=0A= }=0A= =0A= // Create a new TD, with an optional colspan=0A= function Td(win, opt_colspan) {=0A= var td =3D win.document.createElement("TD");=0A= if (opt_colspan) {=0A= td.colSpan =3D opt_colspan;=0A= }=0A= return td;=0A= }=0A= =0A= =0A= // Check if an element has a given class=0A= function HasClass(el, cl) {=0A= if (el =3D=3D null || el.className =3D=3D null) return false;=0A= var classes =3D el.className.split(" ");=0A= for (var i =3D 0; i < classes.length; i++) {=0A= if (classes[i] =3D=3D cl) {=0A= return true;=0A= }=0A= }=0A= return false;=0A= }=0A= =0A= // Add a class to element=0A= function AddClass(el, cl) {=0A= if (HasClass(el, cl)) return;=0A= el.className +=3D " " + cl;=0A= }=0A= =0A= // Remove a class from an element=0A= function RemoveClass(el, cl) {=0A= if (el.className =3D=3D null) return;=0A= var classes =3D el.className.split(" ");=0A= var result =3D [];=0A= var changed =3D false;=0A= for (var i =3D 0; i < classes.length; i++) {=0A= if (classes[i] !=3D cl) {=0A= if (classes[i]) { result.push(classes[i]); }=0A= } else {=0A= changed =3D true;=0A= }=0A= }=0A= if (changed) { el.className =3D result.join(" "); }=0A= }=0A= =0A= // Performs an in-order traversal of the tree rooted at the given node=0A= // (excluding the root node) and returns an array of nodes that match the=0A= // given selector. The selector must implement the method:=0A= //=0A= // boolean select(node);=0A= //=0A= // This method is a generalization of the DOM method = "getElementsByTagName"=0A= //=0A= function GetElementsBySelector(root, selector) {=0A= var nodes =3D [];=0A= for (var child =3D root.firstChild; child; child =3D = child.nextSibling) {=0A= AddElementBySelector_(child, selector, nodes);=0A= }=0A= return nodes;=0A= }=0A= =0A= // Recursive helper for GetElemnetsBySelector()=0A= function AddElementBySelector_(root, selector, nodes) {=0A= // First test the parent=0A= if (selector.select(root)) {=0A= nodes.push(root);=0A= }=0A= =0A= // Then recurse through the children=0A= for (var child =3D root.firstChild; child; child =3D = child.nextSibling) {=0A= AddElementBySelector_(child, selector, nodes);=0A= }=0A= }=0A= =0A= //-----------------------------------------------------------------------= -=0A= // Window/screen utilities=0A= // TODO: these should be renamed (e.g. GetWindowWidth to = GetWindowInnerWidth=0A= // and moved to geom.js)=0A= //-----------------------------------------------------------------------= -=0A= // Get page offset of an element=0A= function GetPageOffsetLeft(el) {=0A= var x =3D el.offsetLeft;=0A= if (el.offsetParent !=3D null)=0A= x +=3D GetPageOffsetLeft(el.offsetParent);=0A= return x;=0A= }=0A= =0A= // Get page offset of an element=0A= function GetPageOffsetTop(el) {=0A= var y =3D el.offsetTop;=0A= if (el.offsetParent !=3D null)=0A= y +=3D GetPageOffsetTop(el.offsetParent);=0A= return y;=0A= }=0A= =0A= // Get page offset of an element=0A= function GetPageOffset(el) {=0A= var x =3D el.offsetLeft;=0A= var y =3D el.offsetTop;=0A= if (el.offsetParent !=3D null) {=0A= var pos =3D GetPageOffset(el.offsetParent);=0A= x +=3D pos.x;=0A= y +=3D pos.y;=0A= }=0A= return {x: x, y: y};=0A= }=0A= =0A= function GetPageOffsetRight(el) {=0A= return GetPageOffsetLeft(el) + el.offsetWidth;=0A= }=0A= =0A= function GetPageOffsetBottom(el) {=0A= return GetPageOffsetTop(el) + el.offsetHeight;=0A= }=0A= =0A= // Get the y position scroll offset.=0A= function GetScrollTop(win) {=0A= // all except Explorer=0A= if ("pageYOffset" in win) {=0A= return win.pageYOffset;=0A= }=0A= // Explorer 6 Strict Mode=0A= else if ("documentElement" in win.document &&=0A= "scrollTop" in win.document.documentElement) {=0A= return win.document.documentElement.scrollTop;=0A= }=0A= // other Explorers=0A= else if ("scrollTop" in win.document.body) {=0A= return win.document.body.scrollTop;=0A= }=0A= =0A= return 0;=0A= }=0A= =0A= // Get the x position scroll offset.=0A= function GetScrollLeft(win) {=0A= // all except Explorer=0A= if ("pageXOffset" in win) {=0A= return win.pageXOffset;=0A= }=0A= // Explorer 6 Strict Mode=0A= else if ("documentElement" in win.document &&=0A= "scrollLeft" in win.document.documentElement) {=0A= return win.document.documentElement.scrollLeft;=0A= }=0A= // other Explorers=0A= else if ("scrollLeft" in win.document.body) {=0A= return win.document.body.scrollLeft;=0A= }=0A= =0A= return 0;=0A= }=0A= =0A= /**=0A= * Checks if window scrollbar has reached its maximum offset=0A= *=0A= * @param win a window object=0A= * @param opt_isHoriz true if horizontal bar, false if vertical=0A= */=0A= function IsScrollAtEnd(win, opt_isHoriz) {=0A= var total =3D=0A= (opt_isHoriz) ? document.body.offsetWidth : = document.body.offsetHeight;=0A= var inner =3D=0A= (opt_isHoriz) ? GetWindowWidth(win) : GetWindowHeight(win);=0A= var offset =3D=0A= (opt_isHoriz) ? GetScrollLeft(win) : GetScrollTop(win);=0A= =0A= return (inner + offset >=3D total || total < inner);=0A= }=0A= =0A= // Scroll window to pos=0A= // position: 0 =3D top, 0.5 =3D middle, 1 =3D bottom=0A= function ScrollTo(win, el, position) {=0A= var y =3D GetPageOffsetTop(el);=0A= y -=3D GetWindowHeight(win) * position;=0A= win.scrollTo(0, y);=0A= }=0A= =0A= // Scroll so that as far as possible the entire element is in view.=0A= var ALIGN_BOTTOM =3D 'b';=0A= var ALIGN_MIDDLE =3D 'm';=0A= var ALIGN_TOP =3D 't';=0A= function ScrollIntoView(win, el, alignment) {=0A= var el_top =3D GetPageOffsetTop(el);=0A= var el_bottom =3D el_top + el.offsetHeight;=0A= var win_top =3D GetScrollTop(win);=0A= var win_height =3D GetWindowHeight(win);=0A= var win_bottom =3D win_top + win_height;=0A= =0A= // Out of view?=0A= if (el_top < win_top ||=0A= el_bottom > win_bottom) {=0A= =0A= var scrollto_y;=0A= if (alignment =3D=3D ALIGN_BOTTOM) {=0A= scrollto_y =3D el_bottom - win_height + 5;=0A= } else if (alignment =3D=3D ALIGN_MIDDLE) {=0A= scrollto_y =3D (el_top + el_bottom) / 2 - win_height/2;=0A= } else {=0A= scrollto_y =3D el_top - 5; // ALIGN_TOP=0A= }=0A= =0A= Debug("Scrolling to " + scrollto_y);=0A= win.scrollTo(0, scrollto_y);=0A= }=0A= }=0A= =0A= function IsElementVisible(win, id) {=0A= var el =3D MaybeGetElement(win, id);=0A= if (el =3D=3D null) {=0A= return false;=0A= }=0A= var el_top =3D GetPageOffsetTop(el);=0A= var el_bottom =3D el_top + el.offsetHeight;=0A= var win_top =3D GetScrollTop(win);=0A= var win_bottom =3D win_top + GetWindowHeight(win);=0A= if (el_top >=3D win_top && el_bottom <=3D win_bottom) {=0A= return true;=0A= }=0A= return false;=0A= }=0A= =0A= function GetWindowWidth(win) {=0A= // all except Explorer=0A= if ("innerWidth" in win) {=0A= return win.innerWidth;=0A= }=0A= // Explorer 6 Strict Mode=0A= else if ("documentElement" in win.document &&=0A= "clientWidth" in win.document.documentElement) {=0A= return win.document.documentElement.clientWidth;=0A= }=0A= // other Explorers=0A= else if ("clientWidth" in win.document.body) {=0A= return win.document.body.clientWidth;=0A= }=0A= =0A= return 0;=0A= }=0A= =0A= function GetWindowHeight(win) {=0A= // all except Explorer=0A= if ("innerHeight" in win) {=0A= return win.innerHeight;=0A= }=0A= // Explorer 6 Strict Mode=0A= else if ("documentElement" in win.document &&=0A= "clientHeight" in win.document.documentElement) {=0A= return win.document.documentElement.clientHeight;=0A= }=0A= // other Explorers=0A= else if ("clientHeight" in win.document.body) {=0A= return win.document.body.clientHeight;=0A= }=0A= =0A= return 0;=0A= }=0A= =0A= function GetAvailScreenWidth(win) {=0A= return win.screen.availWidth;=0A= }=0A= =0A= function GetAvailScreenHeight(win) {=0A= return win.screen.availHeight;=0A= }=0A= =0A= // Returns a "nice" window height.=0A= // Use the screen height. (Or should we use the height of the current = window?)=0A= function GetNiceWindowHeight(win) {=0A= return Math.floor(0.8 * GetAvailScreenHeight(win));=0A= }=0A= =0A= // Used for horizontally centering a new window of the given width in the=0A= // available screen. Set the new window's distance from the left of the = screen=0A= // equal to this function's return value.=0A= // Params: width: the width of the new window=0A= // Returns: the distance from the left edge of the screen for the new = window to=0A= // be horizontally centered=0A= function GetCenteringLeft(win, width) {=0A= return (win.screen.availWidth - width) >> 1;=0A= }=0A= =0A= // Used for vertically centering a new window of the given height in the=0A= // available screen. Set the new window's distance from the top of the = screen=0A= // equal to this function's return value.=0A= // Params: height: the height of the new window=0A= // Returns: the distance from the top edge of the screen for the new = window to=0A= // be vertically aligned.=0A= function GetCenteringTop(win, height) {=0A= return (win.screen.availHeight - height) >> 1;=0A= }=0A= =0A= /*=0A= * Opens a child popup window that has no browser toolbar/decorations.=0A= * (Copied from caribou's common.js library with small modifications.)=0A= *=0A= * @param url the URL for the new window (Note: this will be = unique-ified)=0A= * @param opt_name the name of the new window=0A= * @param opt_width the width of the new window=0A= * @param opt_height the height of the new window=0A= * @param opt_center if true, the new window is centered in the = available screen=0A= * @param opt_hide_scrollbars if true, the window hides the scrollbars=0A= * @param opt_noresize if true, makes window unresizable=0A= * @param opt_blocked_msg message warning that the popup has been blocked=0A= * @return a reference to the new child window=0A= */=0A= function Popup(url, opt_name, opt_width, opt_height, opt_center,=0A= opt_hide_scrollbars, opt_noresize, opt_blocked_msg) {=0A= if (!opt_height) {=0A= opt_height =3D Math.floor(GetWindowHeight(window.top) * 0.8);=0A= }=0A= if (!opt_width) {=0A= opt_width =3D Math.min(GetAvailScreenWidth(window), opt_height);=0A= }=0A= =0A= var features =3D "resizable=3D" + (opt_noresize ? "no" : "yes") + "," +=0A= "scrollbars=3D" + (opt_hide_scrollbars ? "no" : "yes") = + "," +=0A= "width=3D" + opt_width + ",height=3D" + opt_height;=0A= if (opt_center) {=0A= features +=3D ",left=3D" + GetCenteringLeft(window, opt_width) + "," = +=0A= "top=3D" + GetCenteringTop(window, opt_height);=0A= }=0A= return OpenWindow(window, url, opt_name, features, opt_blocked_msg);=0A= }=0A= =0A= /*=0A= * Opens a new window. Returns the new window handle. Tries to open the = new=0A= * window using top.open() first. If that doesn't work, then tries = win.open().=0A= * If that still doesn't work, prints an alert.=0A= * (Copied from caribou's common.js library with small modifications.)=0A= *=0A= * @param win the parent window from which to open the new child window=0A= * @param url the URL for the new window (Note: this will be = unique-ified)=0A= * @param opt_name the name of the new window=0A= * @param opt_features the properties of the new window=0A= * @param opt_blocked_msg message warning that the popup has been blocked=0A= * @return a reference to the new child window=0A= */=0A= function OpenWindow(win, url, opt_name, opt_features, opt_blocked_msg) {=0A= var newwin =3D OpenWindowHelper(top, url, opt_name, opt_features);=0A= if (!newwin || newwin.closed || !newwin.focus) {=0A= newwin =3D OpenWindowHelper(win, url, opt_name, opt_features);=0A= }=0A= if (!newwin || newwin.closed || !newwin.focus) {=0A= if (opt_blocked_msg) alert(opt_blocked_msg);=0A= } else {=0A= // Make sure that the window has the focus=0A= newwin.focus();=0A= }=0A= return newwin;=0A= }=0A= =0A= /*=0A= * Helper for OpenWindow().=0A= * (Copied from caribou's common.js library with small modifications.)=0A= */=0A= function OpenWindowHelper(win, url, name, features) {=0A= var newwin;=0A= if (features) {=0A= newwin =3D win.open(url, name, features);=0A= } else if (name) {=0A= newwin =3D win.open(url, name);=0A= } else {=0A= newwin =3D win.open(url);=0A= }=0A= return newwin;=0A= }=0A= =0A= //-----------------------------------------------------------------------= -=0A= // DOM walking utilities=0A= //-----------------------------------------------------------------------= -=0A= =0A= function MaybeEscape(str, escape) {=0A= return escape ? HtmlEscape(str) : str;=0A= }=0A= =0A= =0A= //-----------------------------------------------------------------------= -=0A= // Window data=0A= //-----------------------------------------------------------------------= -=0A= // Gets an array, which can store data for the window. This data=0A= // is deleted when the window is unloaded.=0A= var windata =3D [];=0A= function GetWindowData(win) {=0A= var data =3D windata[win.name];=0A= if (!data) {=0A= windata[win.name] =3D data =3D [];=0A= }=0A= return data;=0A= }=0A= =0A= // Clear js data for a window.=0A= function ClearWindowData(win_name) {=0A= if (windata[win_name]) {=0A= windata[win_name] =3D null;=0A= }=0A= }=0A= =0A= //-----------------------------------------------------------------------= -=0A= // String utilities=0A= //-----------------------------------------------------------------------= -=0A= // Do html escaping=0A= var amp_re_ =3D /&/g;=0A= var lt_re_ =3D //g;=0A= =0A= // Convert text to HTML format. For efficiency, we just convert '&', = '<', '>'=0A= // characters.=0A= // Note: Javascript >=3D 1.3 supports lambda expression in the = replacement=0A= // argument. But it's slower on IE.=0A= // Note: we can also implement HtmlEscape by setting the value=0A= // of a textnode and then reading the 'innerHTML' value, but that=0A= // that turns out to be slower.=0A= // Params: str: String to be escaped.=0A= // Returns: The escaped string.=0A= function HtmlEscape(str) {=0A= if (!str) return "";=0A= return str.replace(amp_re_, "&").replace(lt_re_, "<").=0A= replace(gt_re_, ">").replace(quote_re_, """);=0A= }=0A= =0A= /** converts html entities to plain text. It covers the most common = named=0A= * entities and numeric entities.=0A= * It does not cover all named entities -- it covers = &{lt,gt,amp,quot,nbsp}; but=0A= * does not handle some of the more obscure ones like &{ndash,eacute};.=0A= */=0A= function HtmlUnescape(str) {=0A= if (!str) return "";=0A= return str.=0A= replace(/&#(\d+);/g,=0A= function (_, n) { return String.fromCharCode(parseInt(n, 10)); }).=0A= replace(/&#x([a-f0-9]+);/gi,=0A= function (_, n) { return String.fromCharCode(parseInt(n, 16)); }).=0A= replace(/&(\w+);/g, function (_, entity) {=0A= entity =3D entity.toLowerCase();=0A= return entity in HtmlUnescape.unesc ? HtmlUnescape.unesc[entity] : = '?';=0A= });=0A= }=0A= HtmlUnescape.unesc =3D { lt: '<', gt: '>', quot: '"', nbsp: ' ', amp: = '&' };=0A= =0A= // Replace multiple spaces with   to retain whitespace formatting=0A= // in addition to escaping '&', '<', and '>'.=0A= var dbsp_re_ =3D / /g;=0A= var ret_re_ =3D /\r/g;=0A= var nl_re_ =3D /\n/g;=0A= function HtmlWhitespaceEscape(str) {=0A= str =3D HtmlEscape(str);=0A= str =3D str.replace(dbsp_re_, "  ");=0A= str =3D str.replace(ret_re_, "");=0A= str =3D str.replace(nl_re_, "
");=0A= return str;=0A= }=0A= =0A= // Escape double quote '"' characters in addition to '&', '<', '>' so = that a=0A= // string can be included in an HTML tag attribute value within double = quotes.=0A= // Params: str: String to be escaped.=0A= // Returns: The escaped string.=0A= var quote_re_ =3D /\"/g;=0A= function QuoteEscape(str) {=0A= return HtmlEscape(str).replace(quote_re_, """);=0A= }=0A= =0A= var JS_SPECIAL_RE_ =3D /[\'\\\r\n\b\"<>&]/g;=0A= =0A= function JSEscOne_(s) {=0A= if (!JSEscOne_.js_escs_) {=0A= var escapes =3D {};=0A= escapes['\\'] =3D '\\\\';=0A= escapes['\''] =3D '\\047';=0A= escapes['\n'] =3D '\\n';=0A= escapes['\r'] =3D '\\r';=0A= escapes['\b'] =3D '\\b';=0A= escapes['\"'] =3D '\\042';=0A= escapes['<'] =3D '\\074';=0A= escapes['>'] =3D '\\076';=0A= escapes['&'] =3D '\\046';=0A= =0A= JSEscOne_.js_escs_ =3D escapes;=0A= }=0A= =0A= return JSEscOne_.js_escs_[s];=0A= }=0A= =0A= /** convert a string to a javascript string literal. This function has = the=0A= * property that the return value is also already html escaped, so the = output=0A= * can be embedded in an html handler attribute.=0A= */=0A= function ToJSString(s) {=0A= return "'" + s.toString().replace(JS_SPECIAL_RE_, JSEscOne_) + "'";=0A= }=0A= =0A= // converts multiple ws chars to a single space, and strips=0A= // leading and trailing ws=0A= var spc_re_ =3D /\s+/g;=0A= var beg_spc_re_ =3D /^ /;=0A= var end_spc_re_ =3D / $/;=0A= function CollapseWhitespace(str) {=0A= if (!str) return "";=0A= return str.replace(spc_re_, " ").replace(beg_spc_re_, "").=0A= replace(end_spc_re_, "");=0A= }=0A= =0A= var newline_re_ =3D /\r?\n/g;=0A= var spctab_re_ =3D /[ \t]+/g;=0A= var nbsp_re_ =3D /\xa0/g;=0A= function StripNewlines(str) {=0A= if (!str) return "";=0A= return str.replace(newline_re_, " ");=0A= }=0A= =0A= function CanonicalizeNewlines(str) {=0A= if (!str) return "";=0A= return str.replace(newline_re_, '\n');=0A= }=0A= =0A= function HtmlifyNewlines(str) {=0A= if (!str) return "";=0A= return str.replace(newline_re_, "
");=0A= }=0A= =0A= function NormalizeSpaces(str) {=0A= if (!str) return "";=0A= return str.replace(spctab_re_, " ").replace(nbsp_re_, " ");=0A= }=0A= =0A= // URL encodes the string.=0A= function UrlEncode(str) {=0A= return encodeURIComponent(str);=0A= }=0A= =0A= function Trim(str) {=0A= if (!str) return "";=0A= return str.replace(/^\s+/, "").replace(/\s+$/, "");=0A= }=0A= =0A= function EndsWith(str, suffix) {=0A= if (!str) return !suffix;=0A= return (str.lastIndexOf(suffix) =3D=3D (str.length - suffix.length));=0A= }=0A= =0A= // Check if a string is empty=0A= function IsEmpty(str) {=0A= return CollapseWhitespace(str) =3D=3D "";=0A= }=0A= =0A= // Check if a character is a letter=0A= function IsLetterOrDigit(ch) {=0A= return ((ch >=3D "a" && ch <=3D "z") ||=0A= (ch >=3D "A" && ch <=3D "Z") ||=0A= (ch >=3D '0' && ch <=3D '9'));=0A= }=0A= =0A= // Check if a character is a space character=0A= function IsSpace(ch) {=0A= return (" \t\r\n".indexOf(ch) >=3D 0);=0A= }=0A= =0A= // Converts any instances of "\r" or "\r\n" style EOLs into "\n" (Line = Feed),=0A= // and also trim the extra newlines and whitespaces at the end.=0A= var eol_re_ =3D /\r\n?/g;=0A= var trailingspc_re_ =3D /[\n\t ]+$/;=0A= function NormalizeText(str) {=0A= return str.replace(eol_re_, "\n").replace(trailingspc_re_, "");=0A= }=0A= =0A= // Inserts s (word break tag) after every n non-space chars and/or=0A= // after or before certain special chars. The input string should be = plain=0A= // text that has not yet been HTML-escaped.=0A= // Params:=0A= // str: The string to insert s into.=0A= // n: The maximum number of consecutive non-space characters to allow = before=0A= // adding a . To turn off this rule (i.e. if you only want to = add=0A= // breaks based on special characters), pass in the value -1.=0A= // chars_to_break_after: The list of special characters (concatenated = into a=0A= // string) after which a should be added, if there is no = natural=0A= // break at that point. To turn off this rule, pass in the empty = string.=0A= // chars_to_break_before: The list of special characters (concatenated = into a=0A= // string) before which a should be added, if there is no = natural=0A= // break at that point. To turn off this rule, pass in the empty = string.=0A= // Returns: The string str htmlescaped, and with s inserted = according to=0A= // the rules specified by the other arguments.=0A= function HtmlEscapeInsertWbrs(str, n, chars_to_break_after,=0A= chars_to_break_before) {=0A= AssertNumArgs(4);=0A= =0A= var out =3D '';=0A= var strpos =3D 0;=0A= var spc =3D 0;=0A= =0A= for (var i =3D 1; i < str.length; ++i) {=0A= var prev_char =3D str.charAt(i - 1);=0A= var next_char =3D str.charAt(i);=0A= if (IsSpace(next_char)) {=0A= spc =3D i;=0A= } else if (i - spc =3D=3D n ||=0A= chars_to_break_after.indexOf(prev_char) !=3D -1 ||=0A= chars_to_break_before.indexOf(next_char) !=3D -1) {=0A= out +=3D HtmlEscape(str.substring(strpos, i)) + '';=0A= strpos =3D i;=0A= spc =3D i;=0A= }=0A= }=0A= out +=3D HtmlEscape(str.substr(strpos));=0A= return out;=0A= }=0A= =0A= // Converts a string to its canonicalized label form.=0A= var illegal_chars_re_ =3D /[ \/(){}&|\\\"\000]/g;=0A= function CanonicalizeLabel(str, lowercase) {=0A= var uppercase =3D str.replace(illegal_chars_re_, '-');=0A= return lowercase ? uppercase.toLowerCase() : uppercase;=0A= }=0A= =0A= // Case-insensitive string comparator=0A= function CompareStringsIgnoreCase(s1, s2) {=0A= s1 =3D s1.toLowerCase();=0A= s2 =3D s2.toLowerCase();=0A= =0A= if (s1 < s2) {=0A= return -1;=0A= } else if (s1 =3D=3D s2) {=0A= return 0;=0A= } else {=0A= return 1;=0A= }=0A= }=0A= =0A= //-----------------------------------------------------------------------= -=0A= // TextArea utilities=0A= //-----------------------------------------------------------------------= -=0A= =0A= // Gets the cursor pos in a text area. Returns -1 if the cursor pos = cannot=0A= // be determined or if the cursor out of the textfield.=0A= function GetCursorPos(win, textfield) {=0A= try {=0A= if (IsDefined(textfield.selectionEnd)) {=0A= // Mozilla directly supports this=0A= return textfield.selectionEnd;=0A= =0A= } else if (win.document.selection && = win.document.selection.createRange) {=0A= // IE doesn't export an accessor for the endpoints of a selection.=0A= // Instead, it uses the TextRange object, which has an extremely = obtuse=0A= // API. Here's what seems to work:=0A= =0A= // (1) Obtain a textfield from the current selection (cursor)=0A= var tr =3D win.document.selection.createRange();=0A= =0A= // Check if the current selection is in the textfield=0A= if (tr.parentElement() !=3D textfield) {=0A= return -1;=0A= }=0A= =0A= // (2) Make a text range encompassing the textfield=0A= var tr2 =3D tr.duplicate();=0A= tr2.moveToElementText(textfield);=0A= =0A= // (3) Move the end of the copy to the beginning of the selection=0A= tr2.setEndPoint("EndToStart", tr);=0A= =0A= // (4) The span of the textrange copy is equivalent to the cursor = pos=0A= var cursor =3D tr2.text.length;=0A= =0A= // Finally, perform a sanity check to make sure the cursor is in = the=0A= // textfield. IE sometimes screws this up when the window is = activated=0A= if (cursor > textfield.value.length) {=0A= return -1;=0A= }=0A= return cursor;=0A= } else {=0A= Debug("Unable to get cursor position for: " + navigator.userAgent);=0A= =0A= // Just return the size of the textfield=0A= // TODO: Investigate how to get cursor pos in Safari!=0A= return textfield.value.length;=0A= }=0A= } catch (e) {=0A= DumpException(e, "Cannot get cursor pos");=0A= }=0A= =0A= return -1;=0A= }=0A= =0A= function SetCursorPos(win, textfield, pos) {=0A= if (IsDefined(textfield.selectionEnd) &&=0A= IsDefined(textfield.selectionStart)) {=0A= // Mozilla directly supports this=0A= textfield.selectionStart =3D pos;=0A= textfield.selectionEnd =3D pos;=0A= =0A= } else if (win.document.selection && textfield.createTextRange) {=0A= // IE has textranges. A textfield's textrange encompasses the=0A= // entire textfield's text by default=0A= var sel =3D textfield.createTextRange();=0A= =0A= sel.collapse(true);=0A= sel.move("character", pos);=0A= sel.select();=0A= }=0A= }=0A= =0A= //-----------------------------------------------------------------------= -=0A= // Array utilities=0A= //-----------------------------------------------------------------------= -=0A= // Find an item in an array, returns the key, or -1 if not found=0A= function FindInArray(array, x) {=0A= for (var i =3D 0; i < array.length; i++) {=0A= if (array[i] =3D=3D x) {=0A= return i;=0A= }=0A= }=0A= return -1;=0A= }=0A= =0A= // Inserts an item into an array, if it's not already in the array=0A= function InsertArray(array, x) {=0A= if (FindInArray(array, x) =3D=3D -1) {=0A= array[array.length] =3D x;=0A= }=0A= }=0A= =0A= // Delete an element from an array=0A= function DeleteArrayElement(array, x) {=0A= var i =3D 0;=0A= while (i < array.length && array[i] !=3D x)=0A= i++;=0A= array.splice(i, 1);=0A= }=0A= =0A= // Copies a flat array=0A= function CopyArray(array) {=0A= var copy =3D [];=0A= for (var i =3D 0; i < array.length; i++) {=0A= copy[i] =3D array[i];=0A= }=0A= return copy;=0A= }=0A= =0A= // Clone an object (recursively)=0A= function CloneObject(x) {=0A= if ((typeof x) =3D=3D "object") {=0A= var y =3D [];=0A= for (var i in x) {=0A= y[i] =3D CloneObject(x[i]);=0A= }=0A= return y;=0A= }=0A= return x;=0A= }=0A= =0A= /**=0A= * Clone an event; cannot use CloneObject(event)=0A= * because it suffers from infinite recursion.=0A= * Thus, only a subset of the event properties are=0A= * cloned -- if you need others, just add them=0A= * to this function (just don't remove any!)=0A= */=0A= function CloneEvent(ev) {=0A= var clone =3D {};=0A= clone.clientX =3D ev.clientX;=0A= clone.clientY =3D ev.clientY;=0A= clone.pageX =3D ev.pageX;=0A= clone.pageY =3D ev.pageY;=0A= clone.type =3D ev.type;=0A= clone.srcElement =3D ev.srcElement;=0A= clone.target =3D ev.target;=0A= clone.cancelBubble =3D ev.cancelBubble;=0A= clone.explicitOriginalTarget =3D ev.explicitOriginalTarget;=0A= // add more properties here=0A= =0A= return clone;=0A= }=0A= =0A= function GetEventTarget(/*Event*/ ev) {=0A= // Event is not a type in IE; IE uses Object for events=0A= // AssertType(ev, Event, 'arg passed to GetEventTarget not an Event');=0A= return ev.srcElement || ev.target;=0A= }=0A= =0A= /** cancels the event */=0A= // from http://www.quirksmode.org/js/events_order.html=0A= function CancelEvent(/*Event*/ ev) {=0A= if (is_ie) {=0A= ev.cancelBubble =3D true;=0A= } else if (ev.stopPropagation) {=0A= ev.stopPropagation();=0A= }=0A= }=0A= =0A= //-----------------------------------------------------------------------= -=0A= // Formatting utilities=0A= //-----------------------------------------------------------------------= -=0A= // A simple printf type function that takes in a template array, and a = data=0A= // array. e.g. PrintArray(["a",,"b",,"c"], ["x", "y"]) =3D> axbyc=0A= function PrintArray(array, data) {=0A= // Check that the argument count is correct.=0A= AssertEquals(array.length, data.length * 2 + 1);=0A= =0A= for (var i =3D 0, idx =3D 1; i < data.length; i++, idx +=3D 2) {=0A= array[idx] =3D data[i];=0A= }=0A= return array.join("");=0A= }=0A= =0A= function ImageHtml(url, attributes) {=0A= return "";=0A= }=0A= =0A= // Formats an object id that has two id numbers, eg, foo_3_7=0A= function MakeId3(idprefix, m, n) {=0A= return idprefix + m + "_" + n;=0A= }=0A= =0A= //-----------------------------------------------------------------------= -=0A= // Email address parsing=0A= //-----------------------------------------------------------------------= -=0A= // Parse an email address of the form "name"
into [name, = address]=0A= function ParseAddress(addr) {=0A= var name =3D "";=0A= var address =3D "";=0A= for (var i =3D 0; i < addr.length;) {=0A= var token =3D GetEmailToken(addr, i);=0A= if (token.charAt(0) =3D=3D '<') {=0A= var end =3D token.indexOf(">");=0A= address =3D token.substring(1, (end !=3D -1) ? end : token.length);=0A= } else if (address =3D=3D "") {=0A= name +=3D token;=0A= }=0A= i +=3D token.length;=0A= }=0A= =0A= // Check if it's a simple email address of the form "jlim@google.com"=0A= if (address =3D=3D "" && name.indexOf("@") !=3D -1) {=0A= address =3D name;=0A= name =3D "";=0A= }=0A= =0A= name =3D CollapseWhitespace(name);=0A= name =3D StripQuotes(name, "'");=0A= name =3D StripQuotes(name, "\"");=0A= address =3D CollapseWhitespace(address);=0A= return [name, address];=0A= }=0A= =0A= // Given an email address, get the address part=0A= function GetAddress(address) {=0A= return ParseAddress(address)[1];=0A= }=0A= =0A= // Get the username part of an email address=0A= function GetAddressUsername(address) {=0A= address =3D GetAddress(address);=0A= var at =3D address.indexOf("@");=0A= return (at =3D=3D -1) ? address : address.substr(0, at);=0A= }=0A= =0A= // Given an email address, get the personal part=0A= function GetPersonal(address) {=0A= return ParseAddress(address)[0];=0A= }=0A= =0A= // Given an address, get a short name=0A= function GetPersonalElseUsername(address) {=0A= var personal =3D GetPersonal(address);=0A= if (personal !=3D "") {=0A= return personal;=0A= } else {=0A= return GetAddressUsername(address);=0A= }=0A= }=0A= =0A= // Strip ' or " chars around a string=0A= function StripQuotes(str, quotechar) {=0A= var len =3D str.length;=0A= if (str.charAt(0) =3D=3D quotechar &&=0A= str.charAt(len - 1) =3D=3D quotechar) {=0A= return str.substring(1, len - 1);=0A= }=0A= return str;=0A= }=0A= =0A= // Convert a string containing list of email addresses into an array=0A= // of strings=0A= function EmailsToArray(str) {=0A= var result =3D [];=0A= var email =3D "";=0A= var token;=0A= =0A= for (var i =3D 0; i < str.length; ) {=0A= token =3D GetEmailToken(str, i);=0A= if (token =3D=3D ",") {=0A= AddEmailAddress(result, email);=0A= email =3D "";=0A= i++;=0A= continue;=0A= }=0A= email +=3D token;=0A= i +=3D token.length;=0A= }=0A= =0A= // Add last=0A= if (email !=3D"" || token =3D=3D ",") {=0A= AddEmailAddress(result, email);=0A= }=0A= return result;=0A= }=0A= =0A= // Get the next token from a position in an address string=0A= var openers_ =3D "\"<([";=0A= var closers_ =3D "\">)]";=0A= function GetEmailToken(str, pos) {=0A= var ch =3D str.charAt(pos);=0A= var p =3D openers_.indexOf(ch);=0A= if (p =3D=3D -1)=0A= return ch;=0A= var end_pos =3D str.indexOf(closers_.charAt(p), pos + 1);=0A= var token =3D (end_pos >=3D 0) ? str.substring(pos, end_pos + 1) :=0A= str.substr(pos);=0A= return token;=0A= }=0A= =0A= // Add an email address to the result array.=0A= function AddEmailAddress(result, email) {=0A= email =3D CleanEmailAddress(email);=0A= result[result.length] =3D email;=0A= }=0A= =0A= // Clean up email address:=0A= // - remove extra spaces=0A= // - Surround name with quotes if it contains special characters=0A= // to check if we need " quotes=0A= // Note: do not use /g in the regular expression, otherwise the=0A= // regular expression cannot be reusable.=0A= var specialchars_re_ =3D /[()<>@,;:\\\".\[\]]/;=0A= =0A= function CleanEmailAddress(str) {=0A= var name_address =3D ParseAddress(str);=0A= var name =3D name_address[0];=0A= var address =3D name_address[1];=0A= =0A= if (name.indexOf("\"") =3D=3D -1) { // If there's no "=0A= var quote_needed =3D specialchars_re_.test(name);=0A= if (quote_needed) {=0A= name =3D "\"" + name + "\"";=0A= }=0A= }=0A= =0A= if (name =3D=3D "")=0A= return address;=0A= else if (address =3D=3D "")=0A= return name;=0A= else=0A= return name + " <" + address + ">";=0A= }=0A= =0A= //-----------------------------------------------------------------------= -=0A= // Misc=0A= //-----------------------------------------------------------------------= -=0A= // Compare long hex strings=0A= function CompareID(a, b) {=0A= if (a.length !=3D b.length) {=0A= return (a.length - b.length);=0A= } else {=0A= return (a < b) ? -1 : (a > b) ? 1 : 0;=0A= }=0A= }=0A= =0A= // Check if a value is defined=0A= function IsDefined(value) {=0A= return (typeof value) !=3D 'undefined';=0A= }=0A= =0A= function GetKeyCode(event) {=0A= var code;=0A= if (event.keyCode) {=0A= code =3D event.keyCode;=0A= } else if (event.which) {=0A= code =3D event.which;=0A= }=0A= return code;=0A= }=0A= =0A= // define a forid function to fetch a DOM node by id.=0A= function forid_1(id) {=0A= return document.getElementById(id);=0A= }=0A= function forid_2(id) {=0A= return document.all[id];=0A= }=0A= =0A= /**=0A= * Fetch an HtmlElement by id.=0A= * DEPRECATED: use $ in dom.js=0A= */=0A= var forid =3D document.getElementById ? forid_1 : forid_2;=0A= =0A= =0A= =0A= function log(msg) {=0A= /* a top level window is its own parent. Use !=3D or else fails on IE = with=0A= * infinite loop.=0A= */=0A= try {=0A= if (window.parent !=3D window && window.parent.log) {=0A= window.parent.log(window.name + '::' + msg);=0A= return;=0A= }=0A= } catch (e) {=0A= // Error: uncaught exception: Permission denied to get property = Window.log=0A= }=0A= var logPane =3D forid('log');=0A= if (logPane) {=0A= var logText =3D '

' + new = Date() +=0A= '' + msg + '

';=0A= logPane.innerHTML =3D logText + logPane.innerHTML;=0A= } else {=0A= window.status =3D msg;=0A= }=0A= }=0A= ------=_NextPart_000_0025_01C80C0F.D29B6060 Content-Type: application/octet-stream Content-Transfer-Encoding: quoted-printable Content-Location: http://www.blogger.com/v-app/scripts/1118085881-dom.common.js =0A= // Commonly-used functions, reduced.=0A= =0A= function d(s) {return document.getElementById(s);}=0A= function dE(o,s) {return o.getElementsByTagName(s);}=0A= =0A= /**=0A= * toggleDisplay()=0A= *=0A= * Will toggle the display property of the style object for any=0A= * DOM element or object that supports style as a property.=0A= *=0A= * Warning: This'll wreak havoc if applied to elements. Those=0A= * babies got different types "table-row" | "block" dependant on =0A= * what browser's being used.=0A= *=0A= * Warning: Written in Texas. Yeehaw.=0A= *=0A= * Typical usage:=0A= * toggleDisplay(document.getElementById("foo"));=0A= */=0A= function toggleDisplay(o)=0A= { =0A= var display =3D getStyle(o, "display"); =0A= =0A= if (o.style)=0A= o.style.display =3D=0A= (display !=3D "none") ? "none" : getDisplayStyleByTagName(o);=0A= }=0A= =0A= =0A= function getDisplayStyleByTagName(o)=0A= {=0A= n =3D o.nodeName.toLowerCase(); =0A= return (=0A= n =3D=3D "span"=0A= || n =3D=3D "img"=0A= || n =3D=3D "a"=0A= ) ? "inline" : "block";=0A= }=0A= =0A= =0A= /**=0A= * hideElement()=0A= *=0A= * Hides an element from view.=0A= *=0A= * Typical usage:=0A= * hideElement(getElement("the-id-of-the-element"));=0A= */=0A= function hideElement(o)=0A= {=0A= if (o && o.style) o.style.display =3D "none";=0A= }=0A= =0A= =0A= =0A= /**=0A= * showElement()=0A= *=0A= * Shows an element that was hidden from view.=0A= *=0A= * Typical usage:=0A= * showElement(getElement("the-id-of-the-element"));=0A= */=0A= function showElement(o)=0A= {=0A= =0A= if (o && o.style) o.style.display =3D getDisplayStyleByTagName(o);=0A= }=0A= =0A= =0A= /**=0A= * getElement()=0A= *=0A= * Returns an element by its ID or shows an alert if it can't be found.=0A= *=0A= * Typical usage:=0A= * getElement("the-id-of-the-element");=0A= */=0A= function getElement(id) {=0A= var e =3D d(id);=0A= if (!e) {=0A= alert("Cannot get element: " + id);=0A= }=0A= return e;=0A= }=0A= =0A= /**=0A= * setInnerHTML()=0A= *=0A= * Sets the innerHTML of an element or shows an alert if can't be set.=0A= *=0A= * Typical usage:=0A= * setInnerHTML("the-id-of-the-element");=0A= */=0A= function setInnerHTML(id, html) {=0A= try {=0A= getElement(id).innerHTML =3D html;=0A= } catch (ex) {=0A= alert("Cannot set inner HTML: " + id);=0A= }=0A= }=0A= =0A= =0A= /**=0A= * setCssStyle()=0A= *=0A= * Sets the style of an element by its id or shows an alert if can't be = set.=0A= *=0A= * Typical usage:=0A= * setCssStyle("the-id-of-the-element", "display", "block");=0A= */=0A= function setCssStyle(id, name, value) {=0A= try {=0A= getElement(id).style[name] =3D value;=0A= } catch (ex) {=0A= alert("Cannot set style: " + id);=0A= }=0A= }=0A= =0A= =0A= /**=0A= * getStyle()=0A= *=0A= * Gets the computed style of any object.=0A= *=0A= * WARNING: Produces unexpected results in Safari. To achieve best =0A= * results, explicitly set the style property for that browser when the =0A= * element is rendered.=0A= *=0A= * Typical usage:=0A= * getStyle(object, "display");=0A= */=0A= function getStyle(el, style) {=0A= if (!document.getElementById || !el) return;=0A= =0A= if (document.defaultView=0A= && document.defaultView.getComputedStyle) {=0A= return document.defaultView.=0A= getComputedStyle(el, "").getPropertyValue(style);=0A= } =0A= else if (el.currentStyle) {=0A= return el.currentStyle[style];=0A= } =0A= else { =0A= return el.style.display;=0A= }=0A= }=0A= =0A= /**=0A= * getStyleAttribute()=0A= *=0A= * Returns the style attribute of the specified node.=0A= */=0A= function getStyleAttribute(node) {=0A= if (Detect.IE()) {=0A= return node.getAttribute('style').value;=0A= }else {=0A= return node.getAttribute('style');=0A= }=0A= }=0A= =0A= =0A= /*=0A= * showProps()=0A= *=0A= * Displays all the properties for a given element=0A= */=0A= function showProps(o) {=0A= s=3D""; for (p in o) {=0A= s+=3Dp+": "+o[p]+"\n
";=0A= }=0A= document.write(s);=0A= }=0A= =0A= =0A= =0A= function setIFrameEvent(iframe, eventName, func)=0A= {=0A= if (document.all) {=0A= eval('getIFrameDocument(iframe).on' + eventName + ' =3D func;');=0A= } else {=0A= iframe.contentWindow.addEventListener(eventName, func, true);=0A= }=0A= }=0A= =0A= function setIFrameBody(iframe, strStyle, innerHtml) =0A= {=0A= if (!innerHtml) innerHtml =3D '';=0A= if (innerHtml =3D=3D '' && Detect.IE()) {=0A= innerHtml =3D '
';=0A= }=0A= var doc =3D getIFrameDocument(iframe);=0A= doc.open();=0A= doc.write(''=0A= + innerHtml + '');=0A= doc.close();=0A= }=0A= =0A= =0A= function getIFrameDocument(iframe)=0A= {=0A= if (Detect.IE()) {=0A= return iframe.document;=0A= } else {=0A= return iframe.contentDocument;=0A= }=0A= }=0A= =0A= function getIFrame(strId)=0A= {=0A= if (Detect.IE()) {=0A= return document.frames[strId];=0A= } else {=0A= return document.getElementById(strId);=0A= }=0A= }=0A= =0A= =0A= function createElementandAppend(nodeName, strId, appendTo) {=0A= var el =3D document.createElement(nodeName);=0A= el.setAttribute("id", strId);=0A= if (appendTo) {=0A= appendTo.appendChild(el); =0A= } else {=0A= document.body.appendChild(el); =0A= }=0A= return el; =0A= }=0A= =0A= function createElementandInsertBefore(nodeName, strId, appendTo, = sibling) {=0A= var el =3D document.createElement(nodeName);=0A= el.setAttribute("id", strId);=0A= if (appendTo) {=0A= appendTo.insertBefore(el, sibling); =0A= } else {=0A= document.body.insertBefore(el, sibling); =0A= }=0A= return el; =0A= }=0A= =0A= =0A= /**=0A= * getXY()=0A= *=0A= * Returns the position of any element as an object.=0A= *=0A= * Typical usage:=0A= * var pos =3D getXY(object);=0A= * alert(pos.x + " " +pos.y);=0A= */=0A= function getXY(el) {=0A= var x =3D el.offsetLeft;=0A= var y =3D el.offsetTop;=0A= if (el.offsetParent !=3D null) {=0A= var pos =3D getXY(el.offsetParent);=0A= x +=3D pos.x;=0A= y +=3D pos.y;=0A= }=0A= return {x: x, y: y}=0A= }=0A= =0A= // The following 3 functions are taken from common.js=0A= function hasClass(el, cl) {=0A= if (el =3D=3D null || el.className =3D=3D null) return false;=0A= var classes =3D el.className.split(" ");=0A= for (var i =3D 0; i < classes.length; i++) {=0A= if (classes[i] =3D=3D cl) {=0A= return true;=0A= }=0A= }=0A= return false;=0A= }=0A= =0A= // Add a class to element=0A= function addClass(el, cl) {=0A= if (hasClass(el, cl)) return;=0A= el.className +=3D " " + cl;=0A= } =0A= =0A= // Remove a class from an element=0A= function removeClass(el, cl) {=0A= if (el.className =3D=3D null) return;=0A= var classes =3D el.className.split(" ");=0A= var result =3D [];=0A= var changed =3D false;=0A= for (var i =3D 0; i < classes.length; i++) {=0A= if (classes[i] !=3D cl) {=0A= if (classes[i]) { result.push(classes[i]); }=0A= } else {=0A= changed =3D true;=0A= } =0A= } =0A= if (changed) { el.className =3D result.join(" "); }=0A= } =0A= =0A= function toggleClass(el, cl) {=0A= if (hasClass(el, cl)) {=0A= removeClass(el, cl);=0A= } else {=0A= addClass(el, cl);=0A= }=0A= }=0A= =0A= =0A= /* Constants for node types, since IE doesn't support Node.TEXT_NODE */=0A= var TEXT_NODE =3D 3;=0A= var ELEMENT_NODE =3D 1;=0A= =0A= =0A= ------=_NextPart_000_0025_01C80C0F.D29B6060 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0038_01C80C0F.D2A26540" ------=_NextPart_001_0038_01C80C0F.D2A26540 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Location: http://scienziatidiventura.blogspot.com/2007/08/dallhockey-alle-ricerche-sullenergia.html =EF=BB=BF Scienziati di Ventura: Dall=E2=80=99hockey = alle ricerche sull=E2=80=99energia a basso costo
skip=20 to main | skip=20 to sidebar

STORIE DI CERVELLI=20 ERRANTI

luned=C3=AC 20 agosto 2007

Dall=E2=80=99hockey=20 alle ricerche sull=E2=80=99energia a basso costo

Michele Saba giocatore della grande Amsicora e punta di = diamante=20 degli studi avanzati sui nuovi materiali
Di Giacomo Mameli
La = Nuova=20 Sardegna, 20 agosto 2007, Pagina 6

Da campione nello sport = (ha=20 giocato come difensore nell=E2=80=99Amsicora del mito, la squadra = italiana pi=C3=B9 titolata=20 nell=E2=80=99hockey su prato) ad attaccante di punta della ricerca = scientifica, quella=20 che lo ha portato alla ribalta nelle pagine di riviste come = =E2=80=9CNature=E2=80=9D, =E2=80=9CScience=E2=80=9D=20 e =E2=80=9CPhysical Review=E2=80=9D.
Perch=C3=A9 lui, Michele Saba, = cagliaritano di 32 anni, con=20 dna fra il Logudoro di Ozieri e i graniti di Santa Teresa di Gallura, = oggi=20 lavora tra laser e glove boxes in una stanzetta a pochi metri dal = pendolo di=20 Foucault, biglietto da visita del dipartimento di Fisica della = cittadella=20 universitaria di Monserrato. =C3=88 qui anche nella settimana di = ferragosto in=20 compagnia di un ricercatore livornese, Francesco Quochi, di un laureando = oristanese in Scienza dei materiali (Andrea Cadeddu) e una dottoranda = polacca,=20 Agnieszka Gocalinska. Per capire che cosa avviene fra questi laboratori=20 occorrerebbe una cassetta di attrezzi scientifici difficile da reperire = al=20 supermarket. Ma basta far parlare questo giovane studioso finito tra gli = =E2=80=9CScienziati di ventura=E2=80=9D (editore Cuec) = di Andrea Mameli e Mauro=20 Scanu, nelle pagine di Nova del Sole 24 Ore che gi=C3=A0 se ne era = occupato due anni=20 fa (25 marzo 2005) con un=E2=80=99apertura a sette colonne e un titolo = che suonava cos=C3=AC:=20 =C2=ABAl Mit creo i laser del futuro=C2=BB.
Il soggetto era lui, = Michele Saba. E il Mit=20 - si sa - =C3=A8 il Massachusetts institute of technology di Boston dove = Saba ha=20 avuto come insegnanti il premio nobel per la Fisica Wolfgang Ketterle e = Dave=20 Pripchard, guru della fisica professore di altre cinque stelle insignite = ugualmente del nobel. Saba si =C3=A8 formato fra quelle pareti ma - alla = fin fine -=20 riporta tutto al campo di hockey dell=E2=80=99Amsicora quando era = pi=C3=B9 giovane. =C2=ABNello=20 sport devi vincere, devi puntare a conquistare le vette della = classifica.=20 Dobbiamo avere la stessa carica nella ricerca scientifica, puntare=20 all=E2=80=99eccellenza che dipende dal lavoro senza soste, dalla = passione, dalla=20 continuit=C3=A0 negli allenamenti da una parte, negli esperimenti = dall=E2=80=99altra. Per lo=20 studio devi seguire lo stesso metodo=C2=BB. Ed ecco un esempio che = calza: =C2=ABI=20 giocatori dell=E2=80=99Amsicora -i Raggio, i fratelli Giuliani, i = centrocampisti Medda -=20 sono nati attorno al rione dove c=E2=80=99=C3=A8 lo stadio, fra il = Quartiere del Sole e=20 Sant=E2=80=99Elia. Nella ricerca scientifica =C3=A8 troppo comodo = importare i cervelli dal di=20 l=C3=A0 delle Alpi. No, il vivaio dev=E2=80=99essere domestico, devi = lavorare con chi =C3=A8 nato=20 qui, farlo crescere, massacrarlo di allenamenti per gareggiare con le = eccellenze=20 del mondo=C2=BB.
Dopo i laser sulle sponde dell=E2=80=99Oceano = Atlantico =C3=A8 arrivata -=20 davanti al Golfo degli Angeli del Mediterraneo - = l=E2=80=99optoelettronica con materiali=20 innovativi. =C2=ABStudiamo coma assorbire la luce in maniera sempre = pi=C3=B9 rapida ed=20 efficiente con nuovi materiali=C2=BB. Siamo sostanzialmente nel campo = dei pannelli=20 solari. =C2=ABOggi costano troppo, =C3=A8 necessaria troppa energia per = fabbricarli. Ci=20 arrivano dalla California, dal Giappone, dalla Germania. Il nostro = obiettivo di=20 studio =C3=A8 come creare i pannelli solari con un costo monetario ed = energetico=20 molto ma molto pi=C3=B9 basso di quello attuale. Perch=C3=A9 = l=E2=80=99energia prodotta serve=20 appena per ripagare l=E2=80=99energia che =C3=A8 stata necessaria per la = loro fabbricazione.=20 =C3=88 il cane che si morde la coda. Ecco, noi qui a Cagliari studiamo = per trovare=20 materiali che abbiano un ritorno energetico immediato, =C3=A8 la sfida = del futuro. In=20 questo progetto abbiamo il sostegno delle autorit=C3=A0 regionali che = stanno=20 comprendendo - finalmente - che investimenti di questi tipo non possono = avere=20 una ricaduta domani mattina all=E2=80=99alba. La ricerca scientifica = =C3=A8 problema a lungo=20 termine=C2=BB.
E in una Sardegna, dal Limbara al Gennargentu, fino ai = monti del=20 Sulcis - invasa da pietre di basalto, di porfido, di calcare, di granito = - si=20 pu=C3=B2 utilizzare l=E2=80=99energia che = assorbono?
=C2=ABCertamente, l=E2=80=99energia termica del=20 sole sicuramente si pu=C3=B2 sfruttare, =C3=A8 una delle frontiere della = ricerca fisica e=20 ingegneristica dei nostri giorni. Tanto a Cagliari quanto a = Boston=C2=BB.
Non =C3=A8 da=20 tutti approdare al Mit a 28 anni. Occorre l=E2=80=99allenamento della = mente. Per Michele=20 Saba - nato nella clinica sant=E2=80=99Anna di Cagliari - scatta nelle = aule delle scuole=20 elementari della Madonna del Carmine con maestra Maria Puddu = (=E2=80=9Caffettuosa e=20 severa, ne avevo una grande devozione=E2=80=9D). Il padre, Franco, = ozierese, =C3=A8 un=20 ispettore forestale. La mamma, Francesca Becciu, =C3=A8 originaria di = Pattada ma=20 nasce a Santa Teresa. Finanziere anche il nonno materno, Gavino. Quello = paterno,=20 Andrea, allevatore di mucche al pascolo nelle tanche verso Buddus=C3=B2. = La famiglia=20 mette radici a Cagliari e Michele prosegue le scuole medie al collegio = della=20 Missione di piazza Garibaldi. Ginnasio e liceo classico al Dettori, = quello di=20 Antonio Gramsci. Maturit=C3=A0 con sessanta sessantesimi. Si iscrive in = Fisica e dopo=20 quattro anni (110 summa cum laude) =C3=A8 laureato. Tesi incomprensibile = per i comuni=20 mortali (cronisti in primo luogo) perch=C3=A9 si occupa delle = =E2=80=9Coscillazioni=20 eccitone-fotone in microcavit=C3=A0 a semiconduttore=E2=80=9D. Testo a = fronte, tra=20 virgolette, rigorosamente dettate da Saba: =C2=ABLa tesi tendeva a = dimostrare come=20 l=E2=80=99energia della luce pu=C3=B2 essere immagazzinata da un = dispositivo in maniera=20 reversibile=C2=BB. =C3=88 necessario approfondire e si comincia a capire = meglio:=20 =C2=ABPrendiamo il calore della carrozzeria di un=E2=80=99auto sotto il = sole. Quel calore=20 oggi va del tutto disperso. Noi studiamo il modo col quale pu=C3=B2 = essere=20 utilizzata=C2=BB. I suoi maestri sono due fra i docenti pi=C3=B9 = apprezzati delle facolt=C3=A0=20 scientifiche dell=E2=80=99ateneo cagliaritano, Giovanni Bongiovanni e = Andrea Mura.=20 =C2=ABLoro, oltre alle competenze fisiche, mi hanno fatto capire che il = mondo non=20 finisce sulla porta di casa=C2=BB. Ed ecco Michele Saba al Politecnico = di Losanna gi=C3=A0=20 prima della laurea. Ci torna a studi ultimati =C2=ABperch=C3=A9 stavo = cercando un=20 dottorato e lo trovo al Politecnico di Losanna. Ma non sono scappato: = no, avevo=20 necessit=C3=A0 di fare altre esperienze. Mi seguono i professori Jean = Louis Staehli e=20 Benolt Deveaud Pl=C3=A9dran. Ho avuto subito grande autonomia, potevo = coordinare un=20 gruppo di studio=C2=BB.
Immediati i confronti con Cagliari. = =C2=ABAnche da noi ci sono=20 laboratori buoni ma difficilmente un dottorando agisce per conto suo, = poi l=C3=AC=20 c=E2=80=99erano a disposizione pi=C3=B9 soldi. E qui capisco che la = ricerca sarebbe stata il=20 mio futuro=C2=BB. Rientra in Sardegna, sposa Valeria Axiana, di Sinnai = con origini di=20 San Vito nel Sarrabus, studentessa in Giurisprudenza. Mette casa a = Sinnai, in=20 periferia, verso Maracalagonis, nasce Leonardo (oggi ha quattro anni). A = febbraio del 2003 il grande salto per il Mit, (=C2=ABLosanna mi aveva = preparato nel=20 modo giusto=C2=BB), ed eccolo al Research Laboratory of Electronics, = pi=C3=B9 esattamente=20 al Center for ultracold atoms a =C2=ABstudiare le interazioni tra luce e = materia, ad=20 approfondire le affinit=C3=A0 di comportamento fra l=E2=80=99una e = l=E2=80=99altra=C2=BB. Seguono tre anni=20 di attivit=C3=A0 intensa. Ottimi collaboratori, autonomia finanziaria, = ottimo il=20 rapporto con i docenti. Ad Andrea Mameli e Mauro Scanu (gli autori di=20 =C2=ABScienziati di ventura, storie di cervelli erranti tra la = Sardegna e il=20 mondo=C2=BB) dice: =C2=ABTutti i giovani venivano incoraggiati = a prendere=20 iniziative e responsabilit=C3=A0, ogni contributo originale era salutato = con=20 entusiasmo. La leadership viene stabilita col merito e la capacit=C3=A0, = non con la=20 gerarchia o con l=E2=80=99anagrafe. Vivo insomma nel paradiso terrestre = dei=20 ricercatori=C2=BB. Non solo ricerca. Sport, gite, cinema e tanta = lettura: i=20 quotidiani italiani on line, il New York Times e Newsweek, divora i = testi di=20 Michael Crichton (Andromeda, Jurassic Park, Timeline) e del premio = Pulitzer=20 Jared Diamond, non si perde mai Stefano Benni. Ma, soprattutto, tanti = atomi,=20 tanta luce, fotonica come era in principio. Entusiasta del suo lavoro. = =C2=ABParliamo=20 di fibre ottiche. Quando invio una mail non faccio altro che spedire = luce=20 attraverso una fibra ottica. Il vantaggio della luce consiste nel fatto = che pu=C3=B2=20 trasportare una sequenza binaria di 1 e zero incomparabilmente pi=C3=B9 = grande=20 rispetto alla capacit=C3=A0 di un normale filo metallico=C2=BB. Spiega, = per far capire:=20 =C2=ABAnzich=C3=A9 utilizzare la materia per assorbire la luce usiamo la = luce per muovere=20 la materia sotto forma di atomi. L=E2=80=99obiettivo =C3=A8 quello di = fermare il moto termico=20 degli atomi utilizzando la forza esercitata dalla luce degli atomi = stessi=C2=BB. C=E2=80=99=C3=A8=20 da chiedersi, certo con umilt=C3=A0 e consapevolezza di ignoranza = scientifica, se=20 tutto ci=C3=B2 sar=C3=A0 utile all=E2=80=99uomo, a zia Teresa e = Francesca. Risposta cattedratica=20 ma decisamente chiara: =C2=ABCon queste nuove forme di materia a = temperature prossime=20 allo zero assoluto si possono costruire sensori inerziali estremamente = precisi=20 che possono essere utilizzati in esplorazioni spaziali, sottomarine, = geologiche.=20 Il Gps, il navigatore installato in molte auto, =C3=A8 collegato a un = satellite.=20 Anche gli aerei, le navi funzionano grazie a sistemi satellitari. = Pensiano poi=20 ai grandi progressi nella diagnostica medica. Tutto =C3=A8 fisica, tutto = =C3=A8 studio=20 degli atomi. Quindi una ecografia, una risonanza magnetica, il volo in = aereo o=20 la gita in nave sono utili anche a zia Teresa e Francesca. Tutta la = ricerca =C3=A8=20 indirizzata a favore dell=E2=80=99uomo=C2=BB.
Qual =C3=A8 lo stato = dell=E2=80=99arte, di questa=20 arte-fisica, in Sardegna? Michele Saba =C3=A8 abbastanza chiaro e netto: = =C2=ABCi sono=20 tanti buoni ricercatori e tanti bravi studenti con qualche struttura di = vera=20 eccellenza. =C3=88 un bel salto in avanti. Si tratta solo di sapere se = il bicchiere =C3=A8=20 mezzo pieno o mezzo vuoto. Io preferisco quest=E2=80=99ultima immagine = perch=C3=A9 mi stimola=20 a lavorare, a riempirlo, a far di pi=C3=B9. E in Sardegna non solo si = pu=C3=B2 ma si deve=20 fare di pi=C3=B9=C2=BB. Ma gli ostacoli non mancano: =C2=ABIo li = individuo nella piaga=20 autentica dell=E2=80=99inefficienza di qualsiasi istituzione pubblica e = ci=C3=B2 fa s=C3=AC che i=20 pochi denari a disposizione siano amministrati male e in forma = arbitraria. Ci=C3=B2=20 mette insieme alla sbarra gruppi dirigenti politici e burocratici. Non = ci sono=20 ancora - anche all=E2=80=99interno dell=E2=80=99universit=C3=A0 - = criteri comuni e concordati per la=20 redistribuzione delle risorse. Soprattutto - e ci=C3=B2 ci differenzia = molto dal=20 mondo scientifico pi=C3=B9 avanzato - manca una valutazione del = risultato conquistato=20 o del fallimento ottenuto. Ci=C3=B2 =C3=A8 semplicemente assurdo = perch=C3=A9 non si individua=20 il responsabile. A nessuno puoi contestare colpe o meriti perch=C3=A9 = manca un=20 responsabile vero e unico=C2=BB. Pessimista allora? =C2=ABNo. Sono = rientrato perch=C3=A9 qui=20 voglio lavorare, perch=C3=A9 sono tante le potenzialit=C3=A0 della = Sardegna: La nostra=20 ricerca sui pannelli solari pu=C3=B2 dare risultati utili, certi non = domani all=E2=80=99alba.=20 In questo noto un miglioramento: perch=C3=A9 la classe politica pi=C3=B9 = avveduta ha=20 capito che la ricerca non pu=C3=B2 avere ricaduta a breve ma a medio e = lungo termine.=20 Da altre parti i successi sono giunti. Perch=C3=A9 lo stesso non = pu=C3=B2 avvenire da=20 noi?=C2=BB. Non potreste ricavare energia dalla pietre che in Sardegna = abbondano, dal=20 Limbara al Gennargentu fino ai monti del Sulcis? =C2=ABCertamente. = L=E2=80=99energia termica=20 del sole sicuramente si pu=C3=B2 sfruttare. =C3=88 una delle frontiere = della ricerca=20 fisica e ingegneristica dei nostri giorni. Dovremmo avere una classe = dirigente=20 pi=C3=B9 motivata, in Consiglio regionale un solo ricercatore di = eccellenza non=20 basta, ce ne vorrebbero, dieci, venti e le cose cambierebbero in un=20 battibaleno=C2=BB.
Uscendo da questi laboratori di Fisica si pu=C3=B2 = anche concludere=20 con note positive: =C2=ABI cervelli sardi possono rientrare ma prima = devono aver=20 fatto all=E2=80=99estero esperienze importanti e non di un week-end. = Perch=C3=A9 parlare di=20 un ricercatore che torna dev=E2=80=99essere la norma non = l=E2=80=99eccezione. I giovani sono=20 oggi di buona qualit=C3=A0, vedo un trend positivo. La ricerca deve = essere davvero di=20 eccellenza. Ma occorrono i valutatori: sarebbe disastroso non mettere = tutti=20 sotto esame, incentivare i capaci, eliminare gli incapaci, i burocrati = della=20 ricerca che non fa muovere un passo in avanti alla Sardegna, = all=E2=80=99Italia=C2=BB. Parola=20 di Michele Saba, cagliaritano-logudorese rientrato dal Mit di Boston = alla=20 cittadella della Fisica di Monserrato. La sua ricetta =C3=A8 netta: = =C2=ABPremiare i=20 capaci, accumulare conoscenze e competenze=C2=BB.

0 commenti:

Post=20 pi=C3=B9 recente Post=20 pi=C3=B9 vecchio Home page

LINK

 =20

Archivio blog

  • =E2=96=BC 2007=20 (51)=20
    • =E2=96=BC = ottobre=20 (3)=20
      • Novantamila=20 sardi lontani dall'isola=20
      • La=20 fuga degli "scienziati di ventura"=20
      • 10=20 ottobre: presentazione a Cagliari
    • =E2=96=BA = settembre=20 (8)=20
      • Scienziati=20 di ventura a Iglesias: 6 ottobre.=20
      • 19=20 piccoli ricercatori sardi=20
      • Scienziati=20 di ventura al parco tecnologico=20
      • In=20 medicina la fuga =C3=A8 misurabile=20
      • Quanto=20 costa la fuga dei cervelli?=20
      • Emigrare=20 per studiare=20
      • Universit=C3=A0,=20 cos=C3=AC si perdono i fondi=20
      • Sardegna=20 matrigna per i giovani laureati
    • =E2=96=BA = agosto=20 (15)=20
      • AAA=20 Ricercatori lituani cercansi=20
      • International=20 Migration, Remittances and the Brain...=20
      • Fuga=20 dei cervelli al contrario ora l=C2=B4America teme ...=20
      • Storia=20 d'amore per la scienza e la ricerca=20
      • Dall=E2=80=99hockey=20 alle ricerche sull=E2=80=99energia a basso cos...=20
      • "Rosaria=20 Piga - Japan"=20
      • Ci=20 scrive Marco Atzori dal Texas=20
      • Fuga=20 di cervelli su Wikipedia=20
      • Israele=20 e le fughe di cervelli=20
      • Scarsa=20 competitivit=C3=A0 scientifica=20
      • Andrea=20 Cortis da Berkeley=20
      • Cervelli=20 di rientro (in Europa, Italia esclusa)=20
      • Testimoni=20 di ventura a La Maddalena.=20
      • Il=20 Governo propone un patto per rilanciare gli ate...=20
      • Scienziati=20 di ventura su Nova 24
    • =E2=96=BA = luglio=20 (18)=20
      • Scienziati=20 di ventura a La Maddalena: 3 agosto.=20
      • Scienziati=20 di ventura in insardegna.eu=20
      • Scienziati=20 di ventura, un dibattito aperto=20
      • Gian=20 Luigi Gessa e la fuga dei cervelli.=20
      • Diventare=20 ricercatrici: ci crede solo il 18% delle...=20
      • Inseguendo=20 le fughe di cervelli=20
      • Scienziati=20 erranti tra la Sardegna e il Mondo=20
      • Quei=20 Mozart sardi che non trovano un pianoforte......=20
      • Tanti=20 cervelli di ventura=20
      • Cervelli=20 in fuga: storie esemplari=20
      • Da=20 Dallas con affetto=20
      • Immagini=20 da Piazza Savoia=20
      • Presentazione=20 del 16 luglio 2007: un successo!=20
      • M.=20 Saba: "la vera misura sta nel rispetto e nell'a...=20
      • "Questo=20 libro mi ha cambiato l'umore" - R. Piga, K...=20
      • In=20 tema di ricerca e fughe di cervelli...=20
      • Scienziati=20 di ventura racconta venti storie...=20
      • Presentazione:=20 16 luglio.
    • =E2=96=BA = maggio=20 (5)=20
      • Dall'introduzione=20 di Andrea Mameli e Mauro Scanu=20
      • Dalla=20 postfazione di Augusto Palombini=20
      • Dalla=20 prefazione di Gian Luigi Gessa=20
      • Indice=20 del libro.=20
      • Scienziati=20 di Ventura... in arrivo!
 =20

Informazioni personali

 
------=_NextPart_001_0038_01C80C0F.D2A26540 Content-Type: application/octet-stream Content-Transfer-Encoding: quoted-printable Content-Location: http://www.blogger.com/navbar.g?targetBlogID=5703617014202221787&blogName=Scienziati+di+Ventura&publishMode=PUBLISH_MODE_BLOGSPOT&navbarType=BLUE&layoutType=LAYOUTS&homepageUrl=http%3A%2F%2Fscienziatidiventura.blogspot.com%2F&searchRoot=http%3A%2F%2Fscienziatidiventura.blogspot.com%2Fsearch =EF=BB=BF
Segnala a Blogger il contenuto inaccettabile su questa = pagina.
Hai contrassegnato questo blog come contenente contenuto inaccettabile.
Invia=20 come SMS
------=_NextPart_001_0038_01C80C0F.D2A26540-- ------=_NextPart_000_0025_01C80C0F.D29B6060 Content-Type: application/octet-stream Content-Transfer-Encoding: quoted-printable Content-Location: http://www.blogger.com/widgets/2927639132-widgets.js var = w__a=3Dthis;if(!Function.prototype.apply){Function.prototype.apply=3Dfunc= tion(a,b){var c=3D[],d,e;if(!a)a=3Dw__a;var f=3Db||[];for(var = g=3D0;g=3D0;c--){this[c+b]=3Dthis[c]}for(var = d=3D0;d0)b+=3D", ";var = d=3DString(a.arguments[c]);if(d.length>40){d=3Dd.substr(0,40)+"..."}b+=3D= d}b+=3D")\n";b+=3Dw_ea(a.caller);return b}catch(e){return"[Cannot get = stack trace]: "+e+"\n"}}var w_Ca;var w_w=3Dnull,w_1=3Dfalse;function = w_Aa(){if((w_w=3D=3Dnull||w_w.closed)&&!w_1){try{w_1=3Dtrue;w_w=3Dwindow.= open("","debug","width=3D700,height=3D500,toolbar=3Dno,resizable=3Dyes,sc= rollbars=3Dyes,left=3D16,top=3D16,screenx=3D16,screeny=3D16");w_w.blur();= w_w.document.open();w_1=3Dfalse;=0A= var a=3D"To turn off this debugging window,hit = 'D' inside the main caribou window, then close this = window.
";w_fa(a)}catch(b){}}}function = w_Ba(a,b){if(!w_ga){if(typeof = w_k!=3D"undefined"){w_k(w_la(a))}return}try{var c=3D(new = Date).getTime()-w_Ca,d=3D"["+c+"] = "+w_la(a).replace(/\n/g,"
")+"
";if(b=3D=3D1){d=3D"Error: = "+d+"";w_w.focus()}}catch(e){}w_fa(d)}function = w_fa(a){if(!w_ga){return}try{w_Aa();w_w.document.write(a);w_w.scrollTo(0,= 1000000)}catch(b){}}=0A= ;function w_S(a){if(a in w__){return w__[a]}return = w__[a]=3Dnavigator.userAgent.toLowerCase().indexOf(a)!=3D-1}var = w__=3D{};function w_ca(){return w_S("msie")&&!window.opera}function = w_4a(a){if(typeof Error!=3D"undefined"){throw new Error(a||"Assertion = Failed");}else{throw a;}}function = w_Ia(a){if(a=3D=3D=3Dundefined)a=3D"Assertion failed";if(typeof = w_U!=3D"undefined")w_U(a+"\n");w_4a(a)}function = w_R(a,b){if(!a){if(b=3D=3D=3Dundefined)b=3D"Assertion = failed";w_Ia(b)}}function = w_sa(a,b){a.style.display=3Db?"":"none"}function w_Oa(a,=0A= b){a.style.display=3Db?"block":"none"}function = w_Pa(a,b){a.style.display=3Db?"inline":"none"}function = w_l(a,b){if(a=3D=3Dnull||a.className=3D=3Dnull)return = false;if(a.className=3D=3Db){return true}var c=3Da.className.split(" = ");for(var d=3D0;d/g;function = w_la(a){if(!a)return"";return = a.replace(w_Va,"&").replace(w_2a,"<").replace(w_1a,">").replace= (w_3a,""")}var w_3a=3D/\"/g;function w_Xa(a){return = document.getElementById(a)}function w_Ya(a){return document.all[a]}var = w_Wa=3D=0A= document.getElementById?w_Xa:w_Ya;function = w_k(a){try{if(window.parent!=3Dwindow&&window.parent.log){window.parent.l= og(window.name+"::"+a);return}}catch(b){}var c=3Dw_Wa("log");if(c){var = d=3D"

"+new Date+""+a+"

";c.innerHTML=3Dd+c.innerHTML}else{window.= status=3Da}};function w_g(){}w_g.raise=3Dfunction(a){if(typeof = Error!=3D"undefined"){throw new Error(a||"Assertion Failed");}else{throw = a;}};w_g.fail=3Dfunction(a){if(a=3D=3D=3Dundefined)a=3D"Assertion = failed";if(!(w_U=3D=3D=3Dundefined))w_U(a+"\n");w_g.raise(a)};w_g.isTrue=3D= function(a,b){if(!a){if(b=3D=3D=3Dundefined)b=3D"Assertion = failed";w_g.fail(b)}};w_g.equals=3Dfunction(a,b,c){if(a!=3Db){if(c=3D=3D=3D= undefined){c=3D"AS_Assert.equals failed: <"+a+"> !=3D = <"+b+">"}w_g.fail(c)}};w_g.typeOf=3Dfunction(a,b,c){if(typeof = a=3D=3Db)return;if(a||a=3D=3D""){try{if(b=3D=3D=0A= w_g.TYPE_MAP[typeof a]||a instanceof = b){return}}catch(d){}}if(c=3D=3D=3Dundefined){if(typeof = b=3D=3D"function"){var = e=3Db.toString().match(/^\s*function\s+([^\s\{]+)/);if(e)b=3De[1]}c=3D"AS= _Assert.typeOf failed: <"+a+"> not typeof = "+b}w_g.fail(c)};w_g.TYPE_MAP=3D{string:String,number:Number,"boolean":Bo= olean};w_g.numArgs=3Dfunction(a,b){var = c=3Dw_g.numArgs.caller;if(c&&c.arguments.length!=3Da){if(b=3D=3D=3Dundefi= ned){b=3Dc.name+" expected "+a+" arguments but received = "+c.arguments.length}w_g.fail(b)}};var w_Z;function w_Sa(){var = a=3D["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsof= t.XMLHTTP"];if(typeof XMLHttpRequest=3D=3D"undefined"&&typeof = ActiveXObject!=3D"undefined"){for(var b=3D0;b"+c.stack);throw c;}};var = w_0a=3D0,w_aa=3D0;if("undefined"=3D=3Dtypeof = w_k){w_k=3Dfunction(){}}function w_ka(a){var = b=3D-1;try{b=3Da.status}catch(c){}return b}function w_Ja(a){var = b=3Dnull;try{b=3Da.statusText}catch(c){}return b}function = w_Ka(a,b,c,d){if(a.readyState=3D=3D4){try{var = e=3Dtrue;if(d){try{e=3D!(false=3D=3D=3Dd(a))}catch(f){w_k("Message = ("+b+") handling failed: "+f);throw f;}}var = g=3Dw_ka(a);if(200=3D=3D=3Dg){w_k("Message ("+b+") received after = "+((new Date).getTime()-c)+" ms");try{var h=3D(new = Date).getTime();if(e&&a.responseText.length){eval(a.responseText)}w_k("Me= ssage ("+=0A= b+") processing took "+((new Date).getTime()-h)+" = ms")}catch(f){w_k("Message ("+b+") processing failed: = "+f);alert(f+"\n"+f.stack+"\n\n"+a.responseText);throw f;}}else = if(204=3D=3Dg){w_k("Message ("+b+") received after "+((new = Date).getTime()-c)+" ms")}else{w_k("Message ("+b+") failed with response = "+g+" "+w_Ja(a)+" after "+((new Date).getTime()-c)+" = ms.")}}finally{--w_aa}}}function w_La(a,b,c){var d=3D"";if(b){var = e=3D"";for(var f=3D0;f=3D0;){l=3Dl.substring(0,m)+"= &"+l.substring(m+1)}w_k("Message ("+i+") sent: POST = "+l+".");++w_aa;w_Ta(j,a,d,n)};function = w_j(a,b,c,d,e,f){this.instanceId=3Da;this.sectionId=3Db;this.markups=3Dc;= if(d){this.rootElement=3Dd}if(e){this.data=3De}if(f){this.q=3Df;if(!w_j.I= sValidDisplayMode(f)){throw"bad display mode: = "+f;}}else{this.q=3Dw_j.DISPLAY_MODE_NONE}this.isNew=3Dfalse}w_j.IsValidD= isplayMode=3Dfunction(a){return = a=3D=3Dw_j.DISPLAY_MODE_SNIPPET||a=3D=3Dw_j.DISPLAY_MODE_FULL||a=3D=3Dw_j= .DISPLAY_MODE_LAYOUT||a=3D=3Dw_j.DISPLAY_MODE_NONE};w_j.DISPLAY_MODE_FULL= =3D"displayModeFull";w_j.DISPLAY_MODE_SNIPPET=3D"displayModeSnippet";w_j.= DISPLAY_MODE_LAYOUT=3D=0A= "displayModeLayout";w_j.DISPLAY_MODE_NONE=3D"displayModeNone";function = w_b(a){this.Jb=3Dtrue;this.ya=3Dnew = w_u(this);this.e=3Da;this.s=3Dnull}w_b.DATA_NAMESPACE_PREFIX=3D"data";w_b= .ACTION_NAMESPACE_PREFIX=3D"b";w_b.INTERPRET_ATTR_NAMESPACE_PREFIX=3D"exp= r";w_b.prototype.Da=3Dfunction(){var = a=3Dthis.e.rootElement;a.innerHTML=3D"";if(this.z()=3D=3Dw_j.DISPLAY_MODE= _LAYOUT){a.appendChild(this.L("layout"))}else{a.appendChild(this.L("main"= ))}return = a};w_b.prototype.ib=3Dfunction(a){this.s=3Da};w_b.prototype.j=3Dfunction(= ){return this.e};=0A= w_b.prototype.m=3Dfunction(a){return = document.getElementById(this.e.instanceId+"_"+a)};w_b.prototype.A=3Dfunct= ion(a){var b=3Dthis.m(a);if(!b){throw"did not find element for id = "+a;}return b};w_b.prototype.i=3Dfunction(){return = this.e.data};w_b.prototype.ia=3Dfunction(a){return = this.e.data=3Da};w_b.prototype.Va=3Dfunction(){return = this.e.isNew};w_b.prototype.hb=3Dfunction(a){return = this.e.isNew=3Da};w_b.prototype.L=3Dfunction(a,b){var = c=3Db;if(!c){c=3Dthis.i()}if(!c){c=3D{}}var d=3Dnew = w_i;d.w("widget",this.Ka());d.za(c);var e=3D=0A= this.Z(a,d,w_i.DEFAULT_DICTIONARY_KEY);return = this.Y(e,document)};w_b.prototype.Ka=3Dfunction(){var = a=3D{};a.type=3Dthis.s.d();a.instanceId=3Dthis.e.instanceId;a.sectionId=3D= this.e.sectionId;a.actionUrl=3Dw_.qa;var = b=3Dw_.sb+"&widgetType=3D"+this.s.d()+"&widgetId=3D"+this.e.instanceId+"&= action=3D"+w_.EDIT_WIDGET_ACTION;a.quickEditUrl=3Db;return = a};w_b.prototype.Z=3Dfunction(a,b,c){var = d=3Dthis.Pa(a);w_g.isTrue(d!=3Dnull,"Markup chunk not found for "+a);var = e=3Dd.varName?d.varName:"",f=3Db.i(c);w_g.isTrue(f!=3Dnull,"No data = found for call: "+=0A= c);b.w(e,f);var g=3Dthis.D(d.rootNode,b);b.fa(e);return = g};w_b.prototype.D=3Dfunction(a,b){w_g.isTrue(a!=3Dnull,"Null node");var = c=3Da;if(a.attributes){var d=3D[],e=3D[];for(var = f=3D0;f"+a.template+"\n",c=3D= this.Ya(b);a.parsedTemplate=3Dthis.C(c);return = a};w_b.ConfigureWidget=3Dfunction(a,b){if(!b){b=3D"config"}var = c=3Ddocument.forms[b].widgetId.value,d=3Ddocument.forms[b].widgetType.val= ue,e=3Dw_e.ProcessForm(document.forms[b],a);if(e.success){w_.SaveWidget(e= .values,c,d)}};function = w_(){}w_.Init=3Dfunction(a,b,c){w_.v=3D{};w_.sb=3Da;=0A= w_.qa=3Db;w_.Ub=3Dc;w_.ub=3Dnull;if(!w_.xa){w_.xa=3D{}}};w_.TrapClicks=3D= function(a){var = b;try{b=3Da.document.getElementsByTagName("A")}catch(c){return}for(var = d=3D0;d0&&a.substring(0,4)!=3D"h= ttp"){a=3D"http://"+a}return a};=0A= w_.GetFirstElementInElementWithClass=3Dfunction(a,b){if(w_l(a,b)){return = a}if(a){var c=3Da.childNodes.length;for(var d=3D0;db){return = LayoutsMessages.NUMBER_TOO_LARGE+" "+b}return undefined}};function = w_i(){this.k=3D=0A= [];for(var a in = w_.ub){this.k[this.k.length]=3Da}}w_i.DEFAULT_DICTIONARY_KEY=3D"";w_i.MAX= _DICTIONARY_DEPTH=3D50;w_i.SEPARATOR_CHAR=3D".";w_i.prototype.w=3Dfunctio= n(a,b){if(this.k.length>=3Dw_i.MAX_DICTIONARY_DEPTH){w_g.raise("Cannot = add another dictionary: = "+a)}if(a.indexOf(w_i.SEPARATOR_CHAR)>-1){w_g.raise("Cannot add = dictionary name containing '.': "+a)}var = c=3D{};c.name=3Da;c.data=3Db;this.k[this.k.length]=3Dc};w_i.prototype.fa=3D= function(a){var = b=3Dthis.k[this.k.length-1];if(b.name!=3Da){w_g.raise("Dictionary "+a+" = is not the last one, and can't be deleted: "+=0A= b.name)}this.k.splice(this.k.length-1,1)};w_i.prototype.J=3Dfunction(a){i= f(a=3D=3Dnull)a=3Dw_i.DEFAULT_DICTIONARY_KEY;for(var = b=3Dthis.k.length-1;b>=3D0;--b){if(this.k[b].name=3D=3Da){return = this.k[b].data}}return null};w_i.prototype.W=3Dfunction(){return = this.J(w_i.DEFAULT_DICTIONARY_KEY)};w_i.prototype.za=3Dfunction(a){this.w= (w_i.DEFAULT_DICTIONARY_KEY,a)};w_i.prototype.i=3Dfunction(a){var = b=3Dthis.J(a);if(b)return b;var = c=3Da.split(w_i.SEPARATOR_CHAR);if(c.length=3D=3D1){b=3Dthis.W();return = b[a]}b=3Dthis.J(c[0]);var d=3D0;if(b){d=3D=0A= 1}else{b=3Dthis.W()}for(var e=3Dd;e=3D500){if(b.responseText.length){document.body.innerHTM= L=3Db.responseText}else{alert(LayoutsMessages.SERVER_ERROR)}return = false}if(a){return a(b)}else{return true}}};function = w_M(a){this.a=3Da}w_M.WIDGET_TYPE_NAME=3D"AdSense";w_M.prototype.d=3Dfunc= tion(){return w_M.WIDGET_TYPE_NAME};w_M.prototype.b=3Dfunction(){return = this.a};w_M.prototype.c=3Dfunction(a,b){this.a.g(b)};var = _AdSenseView=3Dw_M;function = w_d(a){this.a=3Da;this.e=3Da.j()}w_d.WIDGET_TYPE_NAME=3D"BlogArchive";w_d= .POST_LIST_CLASS=3D"posts";w_d.INTERVAL_EXPANDED_VALUE=3D"expanded";w_d.I= NTERVAL_COLLAPSED_VALUE=3D"collapsed";w_d.LOADING_MSG=3D"loading...";w_d.= POST_COUNT_CLASS=3D"post-count";w_d.POST_COUNT_LINK_CLASS=3D"post-count-l= ink";w_d.MENU_ROOT_ID=3D"ArchiveMenu";w_d.TOGGLE_OPEN_CLASS=3D"toggle-ope= n";w_d.Ib=3D"▼ ";w_d.Kb=3D"► ";w_d.prototype.d=3Dfu= nction(){return = w_d.WIDGET_TYPE_NAME};w_d.prototype.b=3Dfunction(){return = this.a};w_d.prototype.f=3D=0A= function(){return = false};w_d.prototype.c=3Dfunction(a,b){if(a=3D=3D"configure"){this.a.g(b)= }else = if(a=3D=3D"getTitles"){this.nb(b)}else{this.widgetInfo.data=3Db;w_.Displa= yWidget(this)}};w_d.prototype.h=3Dfunction(){var = a=3D{};a.select=3Dfunction(i){return i&&w_l(i,"toggle")};var = b=3Dthis.a.m("ArchiveList");if(!b)return;var = c=3Dw_3(this.e.rootElement,a),d;if(c.length>0&&c[0].currentStyle){d=3Dc[0= ].parentNode.currentStyle.color}for(var e=3D0;e"+e.title+"";c.appendChild(f)}};w_d.prototype.La=3Df= unction(a){var b=3Dthis.e.rootElement.getElementsByTagName("A");for(var = c in b){var d=3Db[c];if(d.href=3D=3Da)return = d.parentNode}};w_d.prototype.Wa=3Dfunction(a){var = b=3Da.getElementsByTagName("UL");if(b.length>0&&!w_l(b[0],"posts")){retur= n}var = c=3Dthis.Na(a),d=3Da.getElementsByTagName("LI"),e=3Dd.length;return = e-1};w_f.prototype.aa=3Dfunction(a){a=3Da||window.ev= ent;var b=3Da.target||=0A= a.srcElement;this.a.p("nextposts",{path:b.href});return = false};w_f.prototype.Ba=3Dfunction(a){var = b=3D"";if(document.selection){b=3Ddocument.selection.createRange().text}e= lse if(window.getSelection){b=3Dwindow.getSelection()}else = if(document.getSelection){b=3Ddocument.getSelection()}window.open(a+"?t=3D= "+encodeURIComponent(b)+"&u=3D"+encodeURIComponent(window.location.href)+= "&n=3D"+encodeURIComponent(document.title),"bloggerForm","scrollbars=3Dno= ,width=3D475,height=3D300,top=3D175,left=3D75,status=3Dyes,resizable=3Dye= s");return false};=0A= var _BlogView=3Dw_f;function = w_v(a){this.a=3Da}w_v.WIDGET_TYPE_NAME=3D"CustomSearch";w_v.prototype.d=3D= function(){return = w_v.WIDGET_TYPE_NAME};w_v.prototype.b=3Dfunction(){return = this.a};w_v.prototype.f=3Dfunction(){return = false};w_v.prototype.c=3Dfunction(a,b){if(a=3D=3D"configure"){this.a.g(b)= }};w_v.prototype.h=3Dfunction(){if(!window._UDS_bootstrapped){var = a;if(window.location.host.match(/blogger\.com$/)){a=3D"ABQIAAAAVBJEtyJuLx= gUs8KlzeA1lRQpkWYODHKIJGlKH8M-8R98XOejsxRkHYkMWejKfPos1RBuAqHID9wA9Q"}els= e{a=3Dthis.a.i().key}w_$("http://www.google.com/uds/api?file=3Duds.js&v=3D= 1.0&source=3Duds-vbpe&key=3D"+=0A= a);w_Y(w_ua);window._UDS_bootstrapped=3Dtrue}var = b=3Ddocument.getElementById("uds-searchControl");if(!b){b=3Ddocument.crea= teElement("DIV");b.id=3D"uds-searchControl";var = c=3Ddocument.createElement("DIV");c.id=3D"uds-searchResults";b.appendChil= d(c);var = d=3Ddocument.createElement("DIV");d.id=3D"uds-searchClearResults";d.class= Name=3D"gsc-clear-button";d.innerHTML=3D" ";b.appendChild(d);var = e=3Ddocument.getElementById("main");if(!e){e=3Ddocument.getElementsByTagN= ame("body")[0]}e.insertBefore(b,e.firstChild)}var f=3Dthis.b();=0A= if(!w_9()){w_Y(w_da.bind(f))}else{window.setTimeout(w_da.bind(f),0)}};fun= ction w_da(){var a=3Dnew = GSearchControl,b=3Dthis.i();if(b.includeBlog){var c=3Dnew = GblogSearch;c.setUserDefinedLabel(b.thisBlogMsg);c.setSiteRestriction(b.b= logUrl);a.addSearcher(c)}if(b.includePostLinks){var d=3Dnew = GwebSearch;d.setUserDefinedLabel(b.linkedFromHereMsg);d.setSiteRestrictio= n({crefUrl:b.blogUrl+"cse.xml"});a.addSearcher(d)}var = e=3Db.linkLists;for(var f=3D0;fc){a.height=3DMath.round(c/a.= width*a.height);a.width=3Dc}a.style.visibility=3D"visible"};w_s.prototype= .c=3Dfunction(a,b){if(a=3D=3D"configure"){this.a.g(b)}};var = _ImageView=3Dw_s;var = w_5=3D"changeImageLink",w_Q=3D"imageChoiceTable",w_E=3D"imgUrlText",w_F=3D= "picDiv",w_4=3D"bufferImage",w_h=3Dnull,w_I,w_G,w_J,w_H,w_A,w_t,_SIV_sect= ionWidth;function = _SIV_setConfigurationOptions(){if(w_h=3D=3Dnull){w_e.SetError(w_E,WidgetM= essages.SIV_NO_IMAGE);return}var = a=3Ddocument.forms.config.widgetId.value,b=3D_SIV_createConfigurationOpti= ons(document.getElementById("title").value,document.getElementById("image= Caption").value);w_.SaveWidget(b,a,w_s.WIDGET_TYPE_NAME)}function = _SIV_createConfigurationOptions(a,=0A= b){var = c=3Ddocument.forms.config.securityToken.value;if(w_h=3D=3Dnull){return}va= r d=3Dw_h.src;d=3Dw_.MaybePrependHttp(d);var = e=3Dw_h.height,f=3Dw_h.width;if(w_G!=3D""&&w_t=3D=3D-1){w_t=3De}if(w_I!=3D= ""&&w_A=3D=3D-1){if(w_H_SIV_sectionWidth){e=3D=0A= (e*_SIV_sectionWidth/f).toFixed();f=3D_SIV_sectionWidth}}}else{if(w_I!=3D= ""){d=3Dw_I;f=3Dw_J;e=3Dw_A}}var = i=3D{sourceUrl:d,height:e,width:f,shrinkToFit:h,securityToken:c,uploadedP= hotoUrl:w_I,uploadedPhotoWidth:w_J,uploadedPhotoHeight:w_A,resizedPhotoUr= l:w_G,resizedPhotoWidth:w_H,resizedPhotoHeight:w_t,sectionWidth:_SIV_sect= ionWidth};if(a){i.title=3Da}if(b){i.caption=3Db}return i}function = _SIV_preloadImageFromWeb(){var = a=3Ddocument.getElementById(w_E),b=3Da.value;if(!b||b.length=3D=3D0||b=3D= =3D"http://"){return}if(b.substring(0,=0A= 4)!=3D"http"){b=3D"http://"+b}_SIV_startAnimation();_SIV_preLoadImage(b)}= var w_6,w_7;function _SIV_imgUrlTextOnKeyUp(a,b){var = c=3Da||window.event;if(c.keyCode=3D=3D9)return;document.getElementById("f= romWeb").checked=3D"true";if(w_7!=3Dnull){window.clearTimeout(w_7)}w_7=3D= window.setTimeout(function(){var = d=3Ddocument.getElementById(w_E).value;if(w_6!=3Dd.toLowerCase()){_SIV_pr= eloadImageFromWeb();w_6=3Dd.toLowerCase();_SIV_resetUploadedPhotoMetadata= ()}},1000)}function _SIV_startAnimation(){var = a=3Ddocument.getElementById("picImg");=0A= a.src=3D"img/icon_inprogress.gif";a.style.width=3D"200px";a.style.height=3D= "200px";document.getElementById(w_F).style.height=3Da.style.height;_SIV_m= akeVisible(w_F);_SIV_makeInvisible(w_Q)}function = _SIV_stopAnimation(){_SIV_makeInvisible(w_F);_SIV_makeVisible(w_Q);_SIV_m= akeInvisible(w_5)}function = _SIV_processUploadedImage(a,b,c,d){w_I=3Da;w_G=3Db;w_J=3Dc;w_H=3Dd;w_A=3D= -1;w_t=3D-1;_SIV_preLoadImage(b)}var w_8=3D0;function = _SIV_preLoadImage(a,b){if(typeof b=3D=3D"undefined")b=3Dtrue;var = c=3Ddocument.getElementById(w_4),d;if(b){d=3D=0A= c.onLoad}c.onload=3Dfunction(){_SIV_imgOnLoad(d)};c.onerror=3D_SIV_imgOnE= rror;c.src=3Da}function = _SIV_changeImage(a){_SIV_makeVisible(w_Q);_SIV_makeInvisible(w_F);a.style= .display=3D"none";document.getElementById(w_E).value=3D"http://";w_h=3Dnu= ll;var = b=3Ddocument.getElementById("uploadFrame").contentWindow;b.location.href=3D= b.location.href}function = _SIV_imgOnLoad(a){w_8=3D0;w_h=3Ddocument.getElementById(w_4);w_e.ClearErr= or(w_E);var = b=3Ddocument.getElementById("picImg");if(w_h.width<300&&w_h.height<300){b= .style.height=3D_SIV_px(w_h.height);=0A= b.style.width=3D_SIV_px(w_h.width)}else = if(w_h.height>w_h.width){b.style.height=3D_SIV_px(300);b.style.width=3D_S= IV_px(300*w_h.width/w_h.height)}else{b.style.width=3D_SIV_px(300);b.style= .height=3D_SIV_px(300*w_h.height/w_h.width)}b.margin=3D5;document.getElem= entById(w_F).style.height=3D_SIV_px(b.height);b.src=3Dw_h.src;_SIV_makeVi= sible(w_F);_SIV_makeInvisible(w_Q);_SIV_makeVisible(w_5);if(typeof = a=3D=3D"function"){a()}}function = _SIV_imgOnError(){if(w_8++<2){window.setTimeout(function(){_SIV_preLoadIm= age(document.getElementById(w_4).src,=0A= false)},2000);return}w_8=3D0;w_e.SetError(w_E,WidgetMessages.SIV_INVALID_= URL);_SIV_makeInvisible(w_F);_SIV_makeVisible(w_Q);_SIV_makeInvisible(w_5= )}function = _SIV_initializeWindow(a,b,c,d,e,f,g){w_I=3Da;w_J=3Db;w_A=3Dc;w_G=3Dd;w_H=3D= e;w_t=3Df;_SIV_sectionWidth=3Dg;var = h=3Ddocument.getElementById(w_E);if(h.value!=3D""){_SIV_preloadImageFromW= eb();w_6=3Dh.value;document.getElementById("title").focus()}}function = _SIV_initFrame(){var = a=3Ddocument.getElementById("uploadFrame");a.height=3Da.contentWindow.doc= ument.body.scrollHeight;=0A= a.allowTransparency=3Dtrue}function _SIV_px(a){return = Math.round(a)+"px"}function = _SIV_makeVisible(a){document.getElementById(a).style.display=3D"block"}fu= nction = _SIV_makeInvisible(a){document.getElementById(a).style.display=3D"none"}f= unction = _SIV_resetUploadedPhotoMetadata(){w_I=3D"";w_G=3D"";w_J=3D-1;w_H=3D-1;w_A= =3D-1;w_t=3D-1}function _SIV_hasLoadedImage(){return w_h}function = _SIV_fromPCTabHandler(a){var = b=3Da||window.event;if(b.keyCode=3D=3D9&&!b.shiftKey){w_ra(document.getEl= ementById("uploadFrame")).getElementById("imageFileName").focus();=0A= return false}return true}function _SIV_fromWebTabHandler(a){var = b=3Da||window.event;if(b.keyCode=3D=3D9&&b.shiftKey){w_ra(document.getEle= mentById("uploadFrame")).getElementById("imageFileName").focus();return = false}return true}function w_ra(a){var = b=3Da.contentWindow||a.contentDocument;if(b.document){b=3Db.document}retu= rn b};function = w_m(a){this.a=3Da;this.e=3Da.j()}w_m.WIDGET_TYPE_NAME=3D"Header";w_m.prot= otype.d=3Dfunction(){return = w_m.WIDGET_TYPE_NAME};w_m.prototype.f=3Dfunction(){return = false};w_m.prototype.b=3Dfunction(){return = this.a};w_m.prototype.c=3Dfunction(a,b){this.a.g(b)};w_m.FilterMap=3D{tit= le:w_e.GetRequiredStringFilter(),description:null,imagePlacement:null,use= Image:null,securityToken:null};w_m.ConfigureWidget=3Dfunction(){var = a;if(_SIV_hasLoadedImage()){a=3D_SIV_createConfigurationOptions()}var = b=3Ddocument.forms.config.widgetId.value,=0A= c=3Ddocument.forms.config.widgetType.value,d=3Dw_e.ProcessForm(document.f= orms.config,w_m.FilterMap);if(d.success){for(var e in = a){d.values[e]=3Da[e]}w_.SaveWidget(d.values,b,c);return = true}else{return = false}};w_m.hideImageOptions=3Dfunction(){document.getElementById("imageO= ptions").style.display=3D"none";return = false};w_m.showImageOptions=3Dfunction(){document.getElementById("imageOp= tions").style.display=3D"";return = false};w_m.removeImage=3Dfunction(a){_SIV_makeInvisible("imagePlacementTa= ble");_SIV_changeImage(a);=0A= _SIV_resetUploadedPhotoMetadata()};var = _HeaderView=3Dw_m;_HeaderView.prototype=3Dw_m.prototype;_HeaderView._Conf= igureWidget=3D_HeaderView.ConfigureWidget;_HeaderView._hideImageOptions=3D= _HeaderView.hideImageOptions;_HeaderView._showImageOptions=3D_HeaderView.= showImageOptions;_HeaderView._removeImage=3D_HeaderView.removeImage;funct= ion = w_p(a,b){this.a=3Da;this.e=3Da.j();this.Qb=3Db}w_p.prototype.b=3Dfunction= (){return this.a};w_p.prototype.d=3Dfunction(){return = this.Qb};w_p.prototype.c=3Dfunction(a,b){if(a=3D=3D"configure"){this.a.g(= b)}};w_p.ConfigureWidget=3Dfunction(a){setFormAndSubmit();var = b=3Ddocument.forms.stuffform.widgetId.value,c=3Ddocument.forms.stuffform.= securityToken.value,d=3Ddocument.getElementById("textarea"),e=3Ddocument.= getElementById("title"),f=3Dd.value;if(a=3D=3D"Text"){f=3Df.replace(/\n/g= ,"
")}var g=3D{content:f,title:e.value,securityToken:c};=0A= w_.SaveWidget(g,b,a)};function = w_X(a){w_p.call(this,a,"Text")}w_X.inherits(w_p);w_X.ConfigureWidget=3Dfu= nction(){w_p.ConfigureWidget("Text")};function = w_W(a){w_p.call(this,a,"HTML")}w_W.inherits(w_p);w_W.ConfigureWidget=3Dfu= nction(){w_p.ConfigureWidget("HTML")};var = _TextView=3Dw_X;_TextView.prototype=3Dw_X.prototype;_TextView._ConfigureW= idget=3D_TextView.ConfigureWidget;var = _HTMLView=3Dw_W;_HTMLView.prototype=3Dw_W.prototype;_HTMLView._ConfigureW= idget=3D_HTMLView.ConfigureWidget;function = w_$(a){document.write('