﻿var GOOGIE_CUR_LANG=null;var GOOGIE_DEFAULT_LANG="en";function GoogieSpell(C,A){var E;var D;E=getCookie("language");if(E!=null){GOOGIE_CUR_LANG=E}else{GOOGIE_CUR_LANG=GOOGIE_DEFAULT_LANG}this.img_dir=C;this.server_url=A;this.org_lang_to_word={da:"Dansk",de:"Deutsch",en:"English",es:"Espa&#241;ol",fr:"Fran&#231;ais",it:"Italiano",nl:"Nederlands",pl:"Polski",pt:"Portugu&#234;s",fi:"Suomi",sv:"Svenska"};this.lang_to_word=this.org_lang_to_word;this.langlist_codes=AJS.keys(this.lang_to_word);this.show_change_lang_pic=true;this.change_lang_pic_placement="left";this.report_state_change=true;this.ta_scroll_top=0;this.el_scroll_top=0;this.lang_chck_spell="Check spelling";this.lang_revert="Revert to";this.lang_close="Close";this.lang_rsm_edt="Resume editing";this.lang_no_error_found="No spelling errors found";this.lang_no_suggestions="No suggestions";this.show_spell_img=true;this.decoration=true;this.use_close_btn=true;this.edit_layer_dbl_click=true;this.report_ta_not_found=true;this.custom_ajax_error=null;this.custom_no_spelling_error=null;this.custom_menu_builder=[];this.custom_item_evaulator=null;this.extra_menu_items=[];this.custom_spellcheck_starter=null;this.main_controller=true;this.lang_state_observer=null;this.spelling_state_observer=null;this.show_menu_observer=null;this.all_errors_fixed_observer=null;this.use_focus=false;this.focus_link_t=null;this.focus_link_b=null;this.cnt_errors=0;this.cnt_errors_fixed=0;var B=function(F){var G=AJS.getEventElm(F);if(G.googie_action_btn!="1"&&this.isLangWindowShown()){this.hideLangWindow()}if(G.googie_action_btn!="1"&&this.isErrorWindowShown()){this.hideErrorWindow()}};AJS.AEV(document,"click",AJS.$b(B,this))}GoogieSpell.prototype.decorateTextarea=function(G){if(typeof (G)=="string"){this.text_area=AJS.$(G)}else{this.text_area=G}var B,D;if(this.text_area!=null){if(!AJS.isDefined(this.spell_container)&&this.decoration){var C=AJS.TABLE();var A=AJS.TBODY();var F=AJS.TR();if(AJS.isDefined(this.force_width)){B=this.force_width}else{B=this.text_area.offsetWidth+"px"}if(AJS.isDefined(this.force_height)){D=this.force_height}else{D=""}var E=AJS.TD();this.spell_container=E;F.appendChild(E);A.appendChild(F);C.appendChild(A);AJS.insertBefore(C,this.text_area);AJS.setHeight(C,E,D);AJS.setWidth(C,E,B);E.style.textAlign="right"}this.checkSpellingState()}else{if(this.report_ta_not_found){alert("Text area not found")}}};GoogieSpell.prototype.setSpellContainer=function(A){this.spell_container=AJS.$(A)};GoogieSpell.prototype.setLanguages=function(A){this.lang_to_word=A;this.langlist_codes=AJS.keys(A)};GoogieSpell.prototype.setForceWidthHeight=function(B,A){this.force_width=B;this.force_height=A};GoogieSpell.prototype.setDecoration=function(A){this.decoration=A};GoogieSpell.prototype.dontUseCloseButtons=function(){this.use_close_btn=false};GoogieSpell.prototype.appendNewMenuItem=function(B,C,A){this.extra_menu_items.push([B,C,A])};GoogieSpell.prototype.appendCustomMenuBuilder=function(eval,builder){this.custom_menu_builder.push([eval,builder])};GoogieSpell.prototype.setFocus=function(){try{this.focus_link_b.focus();this.focus_link_t.focus();this.focus_link_t.blur();return true}catch(A){return false}};GoogieSpell.prototype.getValue=function(A){return A.value};GoogieSpell.prototype.setValue=function(A,B){A.value=B};GoogieSpell.prototype.getWysiwyg=function(A){return false};GoogieSpell.prototype.setStateChanged=function(A){this.state=A;if(this.spelling_state_observer!=null&&this.report_state_change){this.spelling_state_observer(A,this)}};GoogieSpell.prototype.setReportStateChange=function(A){this.report_state_change=A};GoogieSpell.prototype.getGoogleUrl=function(){return this.server_url+GOOGIE_CUR_LANG};GoogieSpell.escapeSpecial=function(A){return A.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")};GoogieSpell.createXMLReq=function(A){return'<?xml version="1.0" encoding="utf-8" ?><spellrequest textalreadyclipped="0" ignoredups="0" ignoredigits="1" ignoreallcaps="1"><text>'+A+"</text></spellrequest>"};GoogieSpell.prototype.spellCheck=function(G){var C=this;this.cnt_errors_fixed=0;this.cnt_errors=0;this.setStateChanged("checking_spell");if(this.main_controller){this.appendIndicator(this.spell_span)}this.error_links=[];this.ta_scroll_top=this.text_area.scrollTop;try{this.hideLangWindow()}catch(E){}this.ignore=G;if(this.getValue(this.text_area)==""||G){if(!C.custom_no_spelling_error){C.flashNoSpellingErrorState()}else{C.custom_no_spelling_error(C)}C.removeIndicator();return }this.createEditLayer(this.text_area.offsetWidth,this.text_area.offsetHeight);this.createErrorWindow();AJS.getBody().appendChild(this.error_window);try{netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead")}catch(E){}if(this.main_controller){this.spell_span.onclick=null}this.original_text=this.getValue(this.text_area);var F=AJS.getRequest(this.getGoogleUrl());var A=function(H){var I=H;C.results=C.parseResult(I);if(I.match(/<c.*>/)!=null){C.showErrorsInIframe();C.resumeEditingState()}else{if(!C.custom_no_spelling_error){C.flashNoSpellingErrorState()}else{C.custom_no_spelling_error(C)}}C.removeIndicator()};F.addCallback(A);A=null;var D=function(H,I){if(C.custom_ajax_error){C.custom_ajax_error(I)}else{alert("An error was encountered on the server. Please try again later.")}if(C.main_controller){AJS.removeElement(C.spell_span);C.removeIndicator()}C.checkSpellingState()};F.addErrback(D);D=null;var B=GoogieSpell.escapeSpecial(this.original_text);F.sendReq(GoogieSpell.createXMLReq(B,this))};GoogieSpell.prototype.parseResult=function(J){var D=/\w+="(\d+|true)"/g;var G=/\t/g;var A=J.match(/<c[^>]*>[^<]*<\/c>/g);var H=new Array();if(A==null){return H}for(var I=0;I<A.length;I++){var N=new Array();this.errorFound();N.attrs=new Array();var M=A[I].match(D);for(var F=0;F<M.length;F++){var L=M[F].split(/=/);var C=L[1].replace(/"/g,"");if(C!="true"){N.attrs[L[0]]=parseInt(C)}else{N.attrs[L[0]]=C}}N.suggestions=new Array();var K=A[I].replace(/<[^>]*>/g,"");var B=K.split(G);for(var E=0;E<B.length;E++){if(B[E]!=""){N.suggestions.push(B[E])}}H.push(N)}return H};GoogieSpell.prototype.errorFixed=function(){this.cnt_errors_fixed++;if(this.all_errors_fixed_observer){if(this.cnt_errors_fixed==this.cnt_errors){this.hideErrorWindow();this.all_errors_fixed_observer()}}};GoogieSpell.prototype.errorFound=function(){this.cnt_errors++};GoogieSpell.prototype.createErrorWindow=function(){this.error_window=AJS.DIV();this.error_window.className="googie_window";this.error_window.googie_action_btn="1"};GoogieSpell.prototype.isErrorWindowShown=function(){return this.error_window!=null&&this.error_window.style.visibility=="visible"};GoogieSpell.prototype.hideErrorWindow=function(){try{this.error_window.style.visibility="hidden";if(this.error_window_iframe){this.error_window_iframe.style.visibility="hidden"}}catch(A){}};GoogieSpell.prototype.updateoriginalText=function(G,A,E,H){var D=this.original_text.substring(0,G);var C=this.original_text.substring(G+A.length);this.original_text=D+E+C;this.setValue(this.text_area,this.original_text);var F=E.length-A.length;for(var B=0;B<this.results.length;B++){if(B!=H&&B>H){this.results[B]["attrs"]["o"]+=F}}};GoogieSpell.prototype.saveOldValue=function(B,A){B.is_changed=true;B.old_value=A};GoogieSpell.prototype.createListSeparator=function(){var A=AJS.TD(" ");A.googie_action_btn="1";A.style.cursor="default";A.style.fontSize="3px";A.style.borderTop="1px solid #ccc";A.style.paddingTop="3px";return AJS.TR(A)};GoogieSpell.prototype.correctError=function(A,E,D,C){var F=E.innerHTML;var H=D.innerHTML;var B=this.results[A]["attrs"]["o"];if(C&&!this.getWysiwyg(this.text_area)){var I=E.previousSibling.innerHTML;E.previousSibling.innerHTML=I.slice(0,I.length-1);F=" "+F;B--}this.hideErrorWindow();this.updateoriginalText(B,F,H,A);E.innerHTML=H;E.style.color="green";var G=!E.is_corrected;E.is_corrected=true;this.results[A]["attrs"]["l"]=H.length;if(!AJS.isDefined(E.old_value)){this.saveOldValue(E,F)}if(G){this.errorFixed()}};GoogieSpell.prototype.showErrorWindow=function(L,R){if(this.show_menu_observer){this.show_menu_observer(this)}var b=this;this.edit_layer.offsetParent.appendChild(this.error_window);var B=AJS.absolutePosition(L,true);B.y-=this.edit_layer.scrollTop;this.error_window.style.visibility="visible";AJS.setTop(this.error_window,(B.y+20));AJS.setLeft(this.error_window,(B.x));this.error_window.innerHTML="";var V=AJS.TABLE({"class":"googie_list"});V.googie_action_btn="1";var W=AJS.TBODY();var I=false;if(this.custom_menu_builder!=[]){for(var T=0;T<this.custom_menu_builder.length;T++){var H=this.custom_menu_builder[T];if(H[0]((this.results[R]))){I=H[1](this,W,L);break}}}if(!I){var Q=this.results[R]["suggestions"];var G=this.results[R]["attrs"]["o"];var U=this.results[R]["attrs"]["l"];if(Q.length==0){var K=AJS.TR();var X=AJS.TD({style:"cursor: default;"});var c=AJS.SPAN();c.innerHTML=this.lang_no_suggestions;AJS.ACN(X,AJS.TN(c.innerHTML));X.googie_action_btn="1";K.appendChild(X);W.appendChild(K)}for(i=0;i<Q.length;i++){var K=AJS.TR();var X=AJS.TD();var c=AJS.SPAN();c.innerHTML=Q[i];X.appendChild(AJS.TN(c.innerHTML));var P=function(d){var f=AJS.getEventElm(d);this.correctError(R,L,f)};AJS.AEV(X,"click",AJS.$b(P,this));X.onmouseover=GoogieSpell.item_onmouseover;X.onmouseout=GoogieSpell.item_onmouseout;K.appendChild(X);W.appendChild(K)}if(L.is_changed&&L.innerHTML!=L.old_value){var C=L.old_value;var E=AJS.TR();var A=AJS.TD();A.onmouseover=GoogieSpell.item_onmouseover;A.onmouseout=GoogieSpell.item_onmouseout;var J=AJS.SPAN({"class":"googie_list_revert"});J.innerHTML=this.lang_revert+" "+C;A.appendChild(J);var P=function(d){this.updateoriginalText(G,L.innerHTML,C,R);L.is_corrected=true;L.style.color="#b91414";L.innerHTML=C;this.hideErrorWindow();this.cnt_errors_fixed--};AJS.AEV(A,"click",AJS.$b(P,this));E.appendChild(A);W.appendChild(E)}var Z=AJS.TR();var S=AJS.TD({style:"cursor: default"});var a=AJS.INPUT({style:"width: 120px; margin:0; padding:0",value:L.innerHTML});a.googie_action_btn="1";var F=function(){if(a.value!=""){if(!AJS.isDefined(L.old_value)){this.saveOldValue(L,L.innerHTML)}this.updateoriginalText(G,L.innerHTML,a.value,R);L.style.color="green";var d=!L.is_corrected;L.is_corrected=true;L.innerHTML=a.value;this.hideErrorWindow();if(d){this.errorFixed()}}return false};F=AJS.$b(F,this);var O=AJS.IMG({src:this.img_dir+"ok.gif",style:"width: 32px; height: 16px; margin-left: 2px; margin-right: 2px; cursor: pointer;"});var D=AJS.FORM({style:"margin: 0; padding: 0; cursor: default;"},a,O);D.googie_action_btn="1";S.googie_action_btn="1";AJS.AEV(D,"submit",F);AJS.AEV(O,"click",F);S.appendChild(D);Z.appendChild(S);W.appendChild(Z);if(this.extra_menu_items.length>0){AJS.ACN(W,this.createListSeparator())}var Y=function(f){if(f<b.extra_menu_items.length){var e=b.extra_menu_items[f];if(!e[2]||e[2](L,b)){var d=AJS.TR();var h=AJS.TD(e[0]);h.onmouseover=GoogieSpell.item_onmouseover;h.onmouseout=GoogieSpell.item_onmouseout;var g=function(){return e[1](L,b)};AJS.AEV(h,"click",g);AJS.ACN(d,h);AJS.ACN(W,d)}Y(f+1)}};Y(0);Y=null;if(this.use_close_btn){AJS.ACN(W,this.createCloseButton(this.hideErrorWindow))}}V.appendChild(W);this.error_window.appendChild(V);if(AJS.isIe()&&!this.error_window_iframe){var N=AJS.IFRAME({style:"position: absolute; z-index: 0;"});AJS.ACN(AJS.getBody(),N);this.error_window_iframe=N}if(AJS.isIe()){var N=this.error_window_iframe;this.error_window.offsetParent.appendChild(N);AJS.setTop(N,this.error_window.offsetTop);AJS.setLeft(N,this.error_window.offsetLeft);AJS.setWidth(N,this.error_window.offsetWidth);AJS.setHeight(N,this.error_window.offsetHeight);N.style.visibility="visible"}var M=this.createFocusLink("link");W.appendChild(AJS.TR(AJS.TD({style:"text-align: right; font-size: 1px; height: 1px; margin: 0; padding: 0;"},M)));M.focus()};GoogieSpell.prototype.createEditLayer=function(C,A){this.edit_layer=AJS.DIV({"class":"googie_edit_layer"});this.edit_layer.className=this.text_area.className;this.edit_layer.style.border="1px solid #999";this.edit_layer.style.backgroundColor="#f7f7f7";this.edit_layer.style.padding="3px";this.edit_layer.style.margin="0px";AJS.setWidth(this.edit_layer,(C-8));if(AJS.nodeName(this.text_area)!="input"||this.getValue(this.text_area)==""){this.edit_layer.style.overflow="auto";AJS.setHeight(this.edit_layer,(A-6))}else{this.edit_layer.style.overflow="hidden"}if(this.edit_layer_dbl_click){var D=this;var B=function(F){if(AJS.getEventElm(F).className!="googie_link"&&!D.isErrorWindowShown()){D.resumeEditing();var E=function(){D.text_area.focus();E=null};AJS.callLater(E,10)}return false};this.edit_layer.ondblclick=B;B=null}};GoogieSpell.prototype.resumeEditing=function(){this.setStateChanged("spell_check");this.switch_lan_pic.style.display="inline";if(this.edit_layer){this.el_scroll_top=this.edit_layer.scrollTop}this.hideErrorWindow();if(this.main_controller){this.spell_span.className="googie_no_style"}if(!this.ignore){try{this.edit_layer.parentNode.removeChild(this.edit_layer);if(this.use_focus){AJS.removeElement(this.focus_link_t);AJS.removeElement(this.focus_link_b)}}catch(A){}AJS.showElement(this.text_area);if(this.el_scroll_top!=undefined){this.text_area.scrollTop=this.el_scroll_top}}this.checkSpellingState(false)};GoogieSpell.prototype.createErrorLink=function(C,E){var D=AJS.SPAN({"class":"googie_link"});var A=this;var B=function(F){A.showErrorWindow(D,E);B=null;return false};AJS.AEV(D,"click",B);D.googie_action_btn="1";D.g_id=E;D.is_corrected=false;D.oncontextmenu=B;D.innerHTML=C;return D};GoogieSpell.createPart=function(E){if(E==" "){return AJS.TN(" ")}var A=AJS.SPAN();var C=true;var D=(navigator.userAgent.toLowerCase().indexOf("safari")!=-1);var B=AJS.SPAN();E=GoogieSpell.escapeSpecial(E);E=E.replace(/\n/g,"<br>");E=E.replace(/    /g," &nbsp;");E=E.replace(/^ /g,"&nbsp;");E=E.replace(/ $/g,"&nbsp;");B.innerHTML=E;return B};GoogieSpell.prototype.showErrorsInIframe=function(){var F=AJS.DIV();F.style.textAlign="left";var A=0;var J=this.results;if(J.length>0){var P="";var Q=[];for(var K=0;K<J.length;K++){var I=J[K]["attrs"]["o"];var M=J[K]["attrs"]["l"];var D=this.original_text.substring(A,I);if(!this.getWysiwyg(this.text_area)){var E=GoogieSpell.createPart(D);F.appendChild(E)}else{P+=D}A+=I-A;var B=this.createErrorLink(this.original_text.substr(I,M),K);Q.push(B);if(!this.getWysiwyg(this.text_area)){F.appendChild(B)}else{P+="&nbsp;<span id='googieSpellErrorLink' style='z-index: "+Q.length+"'></span>&nbsp;"}A+=M}var L=this.original_text.substr(A,this.original_text.length);if(!this.getWysiwyg(this.text_area)){var C=GoogieSpell.createPart(L);F.appendChild(C);this.error_links=Q}else{P+=L;F.innerHTML=P;var G=F.getElementsByTagName("span");for(var K=0;K<G.length;K++){if(G[K].id=="googieSpellErrorLink"){var O=Q[G[K].style.zIndex-1];this.error_links.push(O);G[K].parentNode.replaceChild(O,G[K])}}this.cnt_errors=this.error_links.length;var H=F.getElementsByTagName("script");for(var K=0;K<H.length;K++){H[K].parentNode.removeChild(H[K])}}}else{F.innerHTML=this.original_text}var N=this;if(this.custom_item_evaulator){AJS.map(this.error_links,function(R){N.custom_item_evaulator(N,R)})}AJS.ACN(this.edit_layer,F);this.text_area_bottom=this.text_area.offsetTop+this.text_area.offsetHeight;AJS.hideElement(this.text_area);AJS.insertBefore(this.edit_layer,this.text_area);if(this.use_focus){this.focus_link_t=this.createFocusLink("focus_t");this.focus_link_b=this.createFocusLink("focus_b");AJS.insertBefore(this.focus_link_t,this.edit_layer);AJS.insertAfter(this.focus_link_b,this.edit_layer)}this.edit_layer.scrollTop=this.ta_scroll_top};GoogieSpell.prototype.createLangWindow=function(){this.language_window=AJS.DIV({"class":"googie_window"});AJS.setWidth(this.language_window,100);this.language_window.googie_action_btn="1";var D=AJS.TABLE({"class":"googie_list"});AJS.setWidth(D,"100%");var E=AJS.TBODY();this.lang_elms=new Array();for(i=0;i<this.langlist_codes.length;i++){var F=AJS.TR();var C=AJS.TD();C.googieId=this.langlist_codes[i];this.lang_elms.push(C);var A=AJS.SPAN();A.innerHTML=this.lang_to_word[this.langlist_codes[i]];C.appendChild(AJS.TN(A.innerHTML));var B=function(G){var H=AJS.getEventElm(G);this.deHighlightCurSel();this.setCurrentLanguage(H.googieId);if(this.lang_state_observer!=null){this.lang_state_observer()}this.highlightCurSel();this.hideLangWindow()};AJS.AEV(C,"click",AJS.$b(B,this));C.onmouseover=function(H){var G=AJS.getEventElm(H);if(G.className!="googie_list_selected"){G.className="googie_list_onhover"}};C.onmouseout=function(H){var G=AJS.getEventElm(H);if(G.className!="googie_list_selected"){G.className="googie_list_onout"}};F.appendChild(C);E.appendChild(F)}if(this.use_close_btn){E.appendChild(this.createCloseButton(this.hideLangWindow))}this.highlightCurSel();D.appendChild(E);this.language_window.appendChild(D)};GoogieSpell.prototype.setCurrentLanguage=function(B){GOOGIE_CUR_LANG=B;var A=new Date();A.setTime(A.getTime()+365*24*60*60*1000);setCookie("language",B,A)};GoogieSpell.prototype.isLangWindowShown=function(){return this.language_window!=null&&this.language_window.style.visibility=="visible"};GoogieSpell.prototype.hideLangWindow=function(){try{this.language_window.style.visibility="hidden";this.switch_lan_pic.className="googie_lang_3d_on"}catch(A){}};GoogieSpell.prototype.deHighlightCurSel=function(){this.lang_cur_elm.className="googie_list_onout"};GoogieSpell.prototype.highlightCurSel=function(){if(GOOGIE_CUR_LANG==null){GOOGIE_CUR_LANG=GOOGIE_DEFAULT_LANG}for(var A=0;A<this.lang_elms.length;A++){if(this.lang_elms[A].googieId==GOOGIE_CUR_LANG){this.lang_elms[A].className="googie_list_selected";this.lang_cur_elm=this.lang_elms[A]}else{this.lang_elms[A].className="googie_list_onout"}}};GoogieSpell.prototype.showLangWindow=function(D,A,B){if(this.show_menu_observer){this.show_menu_observer(this)}if(!AJS.isDefined(A)){A=20}if(!AJS.isDefined(B)){B=100}this.createLangWindow();AJS.getBody().appendChild(this.language_window);var C=AJS.absolutePosition(D);AJS.showElement(this.language_window);AJS.setTop(this.language_window,(C.y+A));AJS.setLeft(this.language_window,(C.x+B-this.language_window.offsetWidth));this.highlightCurSel();this.language_window.style.visibility="visible"};GoogieSpell.prototype.createChangeLangPic=function(){var A=AJS.IMG({src:this.img_dir+"change_lang.gif",alt:"Change language"});A.googie_action_btn="1";var C=AJS.SPAN({"class":"googie_lang_3d_on",style:"padding-left: 6px;"},A);var B=function(D){var E=AJS.getEventElm(D);if(AJS.nodeName(E)=="img"){E=E.parentNode}if(E.className=="googie_lang_3d_click"){E.className="googie_lang_3d_on";this.hideLangWindow()}else{E.className="googie_lang_3d_click";this.showLangWindow(C)}};AJS.AEV(C,"click",AJS.$b(B,this));return C};GoogieSpell.prototype.createSpellDiv=function(){var A=AJS.SPAN({"class":"googie_check_spelling_link"});A.innerHTML=this.lang_chck_spell;var B=null;if(this.show_spell_img){B=AJS.IMG({src:this.img_dir+"spellc.gif"})}return AJS.SPAN(B," ",A)};GoogieSpell.prototype.flashNoSpellingErrorState=function(A){var E;if(A){var C=function(){A();this.checkSpellingState()};E=C}else{E=this.checkSpellingState}this.setStateChanged("no_error_found");if(this.main_controller){AJS.hideElement(this.switch_lan_pic);var D=AJS.IMG({src:this.img_dir+"blank.gif",style:"height: 16px; width: 1px;"});var B=AJS.SPAN();B.innerHTML=this.lang_no_error_found;AJS.RCN(this.spell_span,AJS.SPAN(D,B));this.spell_span.className="googie_check_spelling_ok";this.spell_span.style.textDecoration="none";this.spell_span.style.cursor="default";AJS.callLater(AJS.$b(E,this),1200,[false])}};GoogieSpell.prototype.resumeEditingState=function(){this.setStateChanged("resume_editing");if(this.main_controller){AJS.hideElement(this.switch_lan_pic);var D=AJS.IMG({src:this.img_dir+"blank.gif",style:"height: 16px; width: 1px;"});var B=AJS.SPAN();B.innerHTML=this.lang_rsm_edt;AJS.RCN(this.spell_span,AJS.SPAN(D,B));var A=function(E){this.resumeEditing()};this.spell_span.onclick=AJS.$b(A,this);this.spell_span.className="googie_resume_editing"}try{this.edit_layer.scrollTop=this.ta_scroll_top}catch(C){}};GoogieSpell.prototype.checkSpellingState=function(C){if(!AJS.isDefined(C)||C){this.setStateChanged("spell_check")}if(this.show_change_lang_pic){this.switch_lan_pic=this.createChangeLangPic()}else{this.switch_lan_pic=AJS.SPAN()}var A=this.createSpellDiv();var B=function(){this.spellCheck()};if(this.custom_spellcheck_starter){A.onclick=this.custom_spellcheck_starter}else{A.onclick=AJS.$b(B,this)}this.spell_span=A;if(this.main_controller){if(this.change_lang_pic_placement=="left"){AJS.RCN(this.spell_container,A," ",this.switch_lan_pic)}else{AJS.RCN(this.spell_container,this.switch_lan_pic," ",A)}}};GoogieSpell.item_onmouseover=function(A){var B=AJS.getEventElm(A);if(B.className!="googie_list_revert"&&B.className!="googie_list_close"){B.className="googie_list_onhover"}else{B.parentNode.className="googie_list_onhover"}};GoogieSpell.item_onmouseout=function(A){var B=AJS.getEventElm(A);if(B.className!="googie_list_revert"&&B.className!="googie_list_close"){B.className="googie_list_onout"}else{B.parentNode.className="googie_list_onout"}};GoogieSpell.prototype.createCloseButton=function(A){return this.createButton(this.lang_close,"googie_list_close",AJS.$b(A,this))};GoogieSpell.prototype.createButton=function(B,D,F){var E=AJS.TR();var C=AJS.TD();C.onmouseover=GoogieSpell.item_onmouseover;C.onmouseout=GoogieSpell.item_onmouseout;var A;if(D!=""){A=AJS.SPAN({"class":D});A.innerHTML=B}else{A=AJS.TN(B)}C.appendChild(A);AJS.AEV(C,"click",F);E.appendChild(C);return E};GoogieSpell.prototype.removeIndicator=function(B){try{AJS.removeElement(this.indicator)}catch(A){}};GoogieSpell.prototype.appendIndicator=function(C){var A=AJS.IMG({src:this.img_dir+"indicator.gif",style:"margin-right: 5px;"});AJS.setWidth(A,16);AJS.setHeight(A,16);this.indicator=A;A.style.textDecoration="none";try{AJS.insertBefore(A,C)}catch(B){}};GoogieSpell.prototype.createFocusLink=function(A){return AJS.A({href:"javascript:;",name:A})};
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();