var GOOGIE_CUR_LANG=null;
var GOOGIE_DEFAULT_LANG="en";
function GoogieSpell(_1,_2){
var _3;
var _4;
_3=getCookie("language");
if(_3!=null){
GOOGIE_CUR_LANG=_3;
}else{
GOOGIE_CUR_LANG=GOOGIE_DEFAULT_LANG;
}
this.img_dir=_1;
this.server_url=_2;
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 fn=function(e){
var _7=AJS.getEventElm(e);
if(_7.googie_action_btn!="1"&&this.isLangWindowShown()){
this.hideLangWindow();
}
if(_7.googie_action_btn!="1"&&this.isErrorWindowShown()){
this.hideErrorWindow();
}
};
AJS.AEV(document,"click",AJS.$b(fn,this));
}
GoogieSpell.prototype.decorateTextarea=function(id){
if(typeof (id)=="string"){
this.text_area=AJS.$(id);
}else{
this.text_area=id;
}
var _9,r_height;
if(this.text_area!=null){
if(!AJS.isDefined(this.spell_container)&&this.decoration){
var _a=AJS.TABLE();
var _b=AJS.TBODY();
var tr=AJS.TR();
if(AJS.isDefined(this.force_width)){
_9=this.force_width;
}else{
_9=this.text_area.offsetWidth+"px";
}
if(AJS.isDefined(this.force_height)){
r_height=this.force_height;
}else{
r_height="";
}
var _d=AJS.TD();
this.spell_container=_d;
tr.appendChild(_d);
_b.appendChild(tr);
_a.appendChild(_b);
AJS.insertBefore(_a,this.text_area);
AJS.setHeight(_a,_d,r_height);
AJS.setWidth(_a,_d,_9);
_d.style.textAlign="right";
}
this.checkSpellingState();
}else{
if(this.report_ta_not_found){
alert("Text area not found");
}
}
};
GoogieSpell.prototype.setSpellContainer=function(_e){
this.spell_container=AJS.$(_e);
};
GoogieSpell.prototype.setLanguages=function(_f){
this.lang_to_word=_f;
this.langlist_codes=AJS.keys(_f);
};
GoogieSpell.prototype.setForceWidthHeight=function(_10,_11){
this.force_width=_10;
this.force_height=_11;
};
GoogieSpell.prototype.setDecoration=function(_12){
this.decoration=_12;
};
GoogieSpell.prototype.dontUseCloseButtons=function(){
this.use_close_btn=false;
};
GoogieSpell.prototype.appendNewMenuItem=function(_13,_14,_15){
this.extra_menu_items.push([_13,_14,_15]);
};
GoogieSpell.prototype.appendCustomMenuBuilder=function(_16,_17){
this.custom_menu_builder.push([_16,_17]);
};
GoogieSpell.prototype.setFocus=function(){
try{
this.focus_link_b.focus();
this.focus_link_t.focus();
return true;
}
catch(e){
return false;
}
};
GoogieSpell.prototype.setStateChanged=function(_18){
this.state=_18;
if(this.spelling_state_observer!=null&&this.report_state_change){
this.spelling_state_observer(_18,this);
}
};
GoogieSpell.prototype.setReportStateChange=function(_19){
this.report_state_change=_19;
};
GoogieSpell.prototype.getGoogleUrl=function(){
return this.server_url+GOOGIE_CUR_LANG;
};
GoogieSpell.escapeSepcial=function(val){
return val.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
};
GoogieSpell.createXMLReq=function(_1b){
return "<?xml version=\"1.0\" encoding=\"utf-8\" ?><spellrequest textalreadyclipped=\"0\" ignoredups=\"0\" ignoredigits=\"1\" ignoreallcaps=\"1\"><text>"+_1b+"</text></spellrequest>";
};
GoogieSpell.prototype.spellCheck=function(_1c){
var me=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.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.orginal_text=this.text_area.value;
if(this.text_area.value==""||_1c){
if(!me.custom_no_spelling_error){
me.flashNoSpellingErrorState();
}else{
me.custom_no_spelling_error(me);
}
me.removeIndicator();
return;
}
var d=AJS.getRequest(this.getGoogleUrl());
var _1f=function(_20){
var _21=_20;
me.results=me.parseResult(_21);
if(_21.match(/<c.*>/)!=null){
me.showErrorsInIframe();
me.resumeEditingState();
}else{
if(!me.custom_no_spelling_error){
me.flashNoSpellingErrorState();
}else{
me.custom_no_spelling_error(me);
}
}
me.removeIndicator();
};
d.addCallback(_1f);
_1f=null;
var _22=function(_23,req){
if(me.custom_ajax_error){
me.custom_ajax_error(req);
}else{
alert("An error was encountered on the server. Please try again later.");
}
if(me.main_controller){
AJS.removeElement(me.spell_span);
me.removeIndicator();
}
me.checkSpellingState();
};
d.addErrback(_22);
_22=null;
var _25=GoogieSpell.escapeSepcial(this.orginal_text);
d.sendReq(GoogieSpell.createXMLReq(_25));
};
GoogieSpell.prototype.parseResult=function(_26){
var _27=/\w+="(\d+|true)"/g;
var _28=/\t/g;
var _29=_26.match(/<c[^>]*>[^<]*<\/c>/g);
var _2a=new Array();
if(_29==null){
return _2a;
}
for(var i=0;i<_29.length;i++){
var _2c=new Array();
this.errorFound();
_2c["attrs"]=new Array();
var _2d=_29[i].match(_27);
for(var j=0;j<_2d.length;j++){
var _2f=_2d[j].split(/=/);
var val=_2f[1].replace(/"/g,"");
if(val!="true"){
_2c["attrs"][_2f[0]]=parseInt(val);
}else{
_2c["attrs"][_2f[0]]=val;
}
}
_2c["suggestions"]=new Array();
var _31=_29[i].replace(/<[^>]*>/g,"");
var _32=_31.split(_28);
for(var k=0;k<_32.length;k++){
if(_32[k]!=""){
_2c["suggestions"].push(_32[k]);
}
}
_2a.push(_2c);
}
return _2a;
};
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(e){
}
};
GoogieSpell.prototype.updateOrginalText=function(_34,_35,_36,id){
var _38=this.orginal_text.substring(0,_34);
var _39=this.orginal_text.substring(_34+_35.length);
this.orginal_text=_38+_36+_39;
this.text_area.value=this.orginal_text;
var _3a=_36.length-_35.length;
for(var j=0;j<this.results.length;j++){
if(j!=id&&j>id){
this.results[j]["attrs"]["o"]+=_3a;
}
}
};
GoogieSpell.prototype.saveOldValue=function(elm,_3d){
elm.is_changed=true;
elm.old_value=_3d;
};
GoogieSpell.prototype.createListSeparator=function(){
var _3e=AJS.TD(" ");
_3e.googie_action_btn="1";
_3e.style.cursor="default";
_3e.style.fontSize="3px";
_3e.style.borderTop="1px solid #ccc";
_3e.style.paddingTop="3px";
return AJS.TR(_3e);
};
GoogieSpell.prototype.correctError=function(id,elm,_41,_42){
var _43=elm.innerHTML;
var _44=_41.innerHTML;
var _45=this.results[id]["attrs"]["o"];
if(_42){
var _46=elm.previousSibling.innerHTML;
elm.previousSibling.innerHTML=_46.slice(0,_46.length-1);
_43=" "+_43;
_45--;
}
this.hideErrorWindow();
this.updateOrginalText(_45,_43,_44,id);
elm.innerHTML=_44;
elm.style.color="green";
elm.is_corrected=true;
this.results[id]["attrs"]["l"]=_44.length;
if(!AJS.isDefined(elm.old_value)){
this.saveOldValue(elm,_43);
}
this.errorFixed();
};
GoogieSpell.prototype.showErrorWindow=function(elm,id){
if(this.show_menu_observer){
this.show_menu_observer(this);
}
var me=this;
var _4a=AJS.absolutePosition(elm);
_4a.y-=this.edit_layer.scrollTop;
this.error_window.style.visibility="visible";
AJS.setTop(this.error_window,(_4a.y+20));
AJS.setLeft(this.error_window,(_4a.x));
this.error_window.innerHTML="";
var _4b=AJS.TABLE({"class":"googie_list"});
_4b.googie_action_btn="1";
var _4c=AJS.TBODY();
var _4d=false;
if(this.custom_menu_builder!=[]){
for(var k=0;k<this.custom_menu_builder.length;k++){
var eb=this.custom_menu_builder[k];
if(eb[0]((this.results[id]))){
_4d=eb[1](this,_4c,elm);
break;
}
}
}
if(!_4d){
var _50=this.results[id]["suggestions"];
var _51=this.results[id]["attrs"]["o"];
var len=this.results[id]["attrs"]["l"];
if(_50.length==0){
var row=AJS.TR();
var _54=AJS.TD({"style":"cursor: default;"});
var _55=AJS.SPAN();
_55.innerHTML=this.lang_no_suggestions;
AJS.ACN(_54,AJS.TN(_55.innerHTML));
_54.googie_action_btn="1";
row.appendChild(_54);
_4c.appendChild(row);
}
for(i=0;i<_50.length;i++){
var row=AJS.TR();
var _54=AJS.TD();
var _55=AJS.SPAN();
_55.innerHTML=_50[i];
_54.appendChild(AJS.TN(_55.innerHTML));
var fn=function(e){
var _58=AJS.getEventElm(e);
this.correctError(id,elm,_58);
};
AJS.AEV(_54,"click",AJS.$b(fn,this));
_54.onmouseover=GoogieSpell.item_onmouseover;
_54.onmouseout=GoogieSpell.item_onmouseout;
row.appendChild(_54);
_4c.appendChild(row);
}
if(elm.is_changed&&elm.innerHTML!=elm.old_value){
var _59=elm.old_value;
var _5a=AJS.TR();
var _5b=AJS.TD();
_5b.onmouseover=GoogieSpell.item_onmouseover;
_5b.onmouseout=GoogieSpell.item_onmouseout;
var _5c=AJS.SPAN({"class":"googie_list_revert"});
_5c.innerHTML=this.lang_revert+" "+_59;
_5b.appendChild(_5c);
var fn=function(e){
this.updateOrginalText(_51,elm.innerHTML,_59,id);
elm.is_corrected=true;
elm.style.color="#b91414";
elm.innerHTML=_59;
this.hideErrorWindow();
};
AJS.AEV(_5b,"click",AJS.$b(fn,this));
_5a.appendChild(_5b);
_4c.appendChild(_5a);
}
var _5e=AJS.TR();
var _5f=AJS.TD({"style":"cursor: default"});
var _60=AJS.INPUT({"style":"width: 120px; margin:0; padding:0","value":elm.innerHTML});
_60.googie_action_btn="1";
var _61=function(){
if(_60.value!=""){
if(!AJS.isDefined(elm.old_value)){
this.saveOldValue(elm,elm.innerHTML);
}
this.updateOrginalText(_51,elm.innerHTML,_60.value,id);
elm.style.color="green";
elm.is_corrected=true;
elm.innerHTML=_60.value;
this.hideErrorWindow();
}
return false;
};
_61=AJS.$b(_61,this);
var _62=AJS.IMG({"src":this.img_dir+"ok.gif","style":"width: 32px; height: 16px; margin-left: 2px; margin-right: 2px; cursor: pointer;"});
var _63=AJS.FORM({"style":"margin: 0; padding: 0; cursor: default;"},_60,_62);
_63.googie_action_btn="1";
_5f.googie_action_btn="1";
AJS.AEV(_63,"submit",_61);
AJS.AEV(_62,"click",_61);
_5f.appendChild(_63);
_5e.appendChild(_5f);
_4c.appendChild(_5e);
if(this.extra_menu_items.length>0){
AJS.ACN(_4c,this.createListSeparator());
}
var _64=function(i){
if(i<me.extra_menu_items.length){
var _66=me.extra_menu_items[i];
if(!_66[2]||_66[2](elm,me)){
var _67=AJS.TR();
var _68=AJS.TD(_66[0]);
_68.onmouseover=GoogieSpell.item_onmouseover;
_68.onmouseout=GoogieSpell.item_onmouseout;
var fn=function(){
return _66[1](elm,me);
};
AJS.AEV(_68,"click",fn);
AJS.ACN(_67,_68);
AJS.ACN(_4c,_67);
}
_64(i+1);
}
};
_64(0);
_64=null;
if(this.use_close_btn){
AJS.ACN(_4c,this.createCloseButton(this.hideErrorWindow));
}
}
_4b.appendChild(_4c);
this.error_window.appendChild(_4b);
if(AJS.isIe()&&!this.error_window_iframe){
var _6a=AJS.IFRAME({"style":"position: absolute; z-index: 0;"});
AJS.ACN(AJS.getBody(),_6a);
this.error_window_iframe=_6a;
}
if(AJS.isIe()){
var _6a=this.error_window_iframe;
AJS.setTop(_6a,this.error_window.offsetTop);
AJS.setLeft(_6a,this.error_window.offsetLeft);
AJS.setWidth(_6a,this.error_window.offsetWidth);
AJS.setHeight(_6a,this.error_window.offsetHeight);
_6a.style.visibility="visible";
}
var _6b=this.createFocusLink("link");
_4c.appendChild(AJS.TR(AJS.TD({"style":"text-align: right; font-size: 1px; height: 1px; margin: 0; padding: 0;"},_6b)));
_6b.focus();
};
GoogieSpell.prototype.createEditLayer=function(_6c,_6d){
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,(_6c-8));
if(AJS.nodeName(this.text_area)!="input"||this.text_area.value==""){
this.edit_layer.style.overflow="auto";
AJS.setHeight(this.edit_layer,(_6d-6));
}else{
this.edit_layer.style.overflow="hidden";
}
if(this.edit_layer_dbl_click){
var me=this;
var fn=function(e){
if(AJS.getEventElm(e).className!="googie_link"&&!me.isErrorWindowShown()){
me.resumeEditing();
var fn1=function(){
me.text_area.focus();
fn1=null;
};
AJS.callLater(fn1,10);
}
return false;
};
this.edit_layer.ondblclick=fn;
fn=null;
}
};
GoogieSpell.prototype.resumeEditing=function(){
this.setStateChanged("spell_check");
this.switch_lan_pic.style.display="inline";
this.el_scroll_top=this.edit_layer.scrollTop;
this.hideErrorWindow();
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(e){
}
AJS.showElement(this.text_area);
if(this.main_controller){
this.spell_span.className="googie_no_style";
}
this.text_area.scrollTop=this.el_scroll_top;
elm.onmouseout=null;
this.checkSpellingState(false);
};
GoogieSpell.prototype.createErrorLink=function(_72,id){
var elm=AJS.SPAN({"class":"googie_link"});
var me=this;
var d=function(e){
me.showErrorWindow(elm,id);
d=null;
return false;
};
AJS.AEV(elm,"click",d);
elm.googie_action_btn="1";
elm.g_id=id;
elm.is_corrected=false;
elm.oncontextmenu=d;
elm.innerHTML=_72;
return elm;
};
GoogieSpell.createPart=function(_78){
if(_78==" "){
return AJS.TN(" ");
}
var _79=AJS.SPAN();
var _7a=true;
var _7b=(navigator.userAgent.toLowerCase().indexOf("safari")!=-1);
var _7c=AJS.SPAN();
_78=GoogieSpell.escapeSepcial(_78);
_78=_78.replace(/\n/g,"<br>");
_78=_78.replace(/  /g," &nbsp;");
_78=_78.replace(/^ /g,"&nbsp;");
_78=_78.replace(/ $/g,"&nbsp;");
_7c.innerHTML=_78;
return _7c;
};
GoogieSpell.prototype.showErrorsInIframe=function(){
var _7d=AJS.DIV();
_7d.style.textAlign="left";
var _7e=0;
var _7f=this.results;
if(_7f.length>0){
for(var i=0;i<_7f.length;i++){
var _81=_7f[i]["attrs"]["o"];
var len=_7f[i]["attrs"]["l"];
var _83=this.orginal_text.substring(_7e,_81);
var _84=GoogieSpell.createPart(_83);
_7d.appendChild(_84);
_7e+=_81-_7e;
var _85=this.createErrorLink(this.orginal_text.substr(_81,len),i);
this.error_links.push(_85);
_7d.appendChild(_85);
_7e+=len;
}
var _86=this.orginal_text.substr(_7e,this.orginal_text.length);
var _87=GoogieSpell.createPart(_86);
_7d.appendChild(_87);
}else{
_7d.innerHTML=this.orginal_text;
}
var me=this;
if(this.custom_item_evaulator){
AJS.map(this.error_links,function(elm){
me.custom_item_evaulator(me,elm);
});
}
AJS.ACN(this.edit_layer,_7d);
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 _8a=AJS.TABLE({"class":"googie_list"});
AJS.setWidth(_8a,"100%");
var _8b=AJS.TBODY();
this.lang_elms=new Array();
for(i=0;i<this.langlist_codes.length;i++){
var row=AJS.TR();
var _8d=AJS.TD();
_8d.googieId=this.langlist_codes[i];
this.lang_elms.push(_8d);
var _8e=AJS.SPAN();
_8e.innerHTML=this.lang_to_word[this.langlist_codes[i]];
_8d.appendChild(AJS.TN(_8e.innerHTML));
var fn=function(e){
var elm=AJS.getEventElm(e);
this.deHighlightCurSel();
this.setCurrentLanguage(elm.googieId);
if(this.lang_state_observer!=null){
this.lang_state_observer();
}
this.highlightCurSel();
this.hideLangWindow();
};
AJS.AEV(_8d,"click",AJS.$b(fn,this));
_8d.onmouseover=function(e){
var _93=AJS.getEventElm(e);
if(_93.className!="googie_list_selected"){
_93.className="googie_list_onhover";
}
};
_8d.onmouseout=function(e){
var _95=AJS.getEventElm(e);
if(_95.className!="googie_list_selected"){
_95.className="googie_list_onout";
}
};
row.appendChild(_8d);
_8b.appendChild(row);
}
if(this.use_close_btn){
_8b.appendChild(this.createCloseButton(this.hideLangWindow));
}
this.highlightCurSel();
_8a.appendChild(_8b);
this.language_window.appendChild(_8a);
};
GoogieSpell.prototype.setCurrentLanguage=function(_96){
GOOGIE_CUR_LANG=_96;
var now=new Date();
now.setTime(now.getTime()+365*24*60*60*1000);
setCookie("language",_96,now);
};
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(e){
}
};
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 i=0;i<this.lang_elms.length;i++){
if(this.lang_elms[i].googieId==GOOGIE_CUR_LANG){
this.lang_elms[i].className="googie_list_selected";
this.lang_cur_elm=this.lang_elms[i];
}else{
this.lang_elms[i].className="googie_list_onout";
}
}
};
GoogieSpell.prototype.showLangWindow=function(elm,_9a,_9b){
if(this.show_menu_observer){
this.show_menu_observer(this);
}
if(!AJS.isDefined(_9a)){
_9a=20;
}
if(!AJS.isDefined(_9b)){
_9b=100;
}
this.createLangWindow();
AJS.getBody().appendChild(this.language_window);
var _9c=AJS.absolutePosition(elm);
AJS.showElement(this.language_window);
AJS.setTop(this.language_window,(_9c.y+_9a));
AJS.setLeft(this.language_window,(_9c.x+_9b-this.language_window.offsetWidth));
this.highlightCurSel();
this.language_window.style.visibility="visible";
};
GoogieSpell.prototype.createChangeLangPic=function(){
var img=AJS.IMG({"src":this.img_dir+"change_lang.gif","alt":"Change language"});
img.googie_action_btn="1";
var _9e=AJS.SPAN({"class":"googie_lang_3d_on","style":"padding-left: 6px;"},img);
var fn=function(e){
var elm=AJS.getEventElm(e);
if(AJS.nodeName(elm)=="img"){
elm=elm.parentNode;
}
if(elm.className=="googie_lang_3d_click"){
elm.className="googie_lang_3d_on";
this.hideLangWindow();
}else{
elm.className="googie_lang_3d_click";
this.showLangWindow(_9e);
}
};
AJS.AEV(_9e,"click",AJS.$b(fn,this));
return _9e;
};
GoogieSpell.prototype.createSpellDiv=function(){
var _a2=AJS.SPAN({"class":"googie_check_spelling_link"});
_a2.innerHTML=this.lang_chck_spell;
var _a3=null;
if(this.show_spell_img){
_a3=AJS.IMG({"src":this.img_dir+"spellc.gif"});
}
return AJS.SPAN(_a3," ",_a2);
};
GoogieSpell.prototype.flashNoSpellingErrorState=function(_a4){
var _a5;
if(_a4){
var fn=function(){
_a4();
this.checkSpellingState();
};
_a5=fn;
}else{
_a5=this.checkSpellingState;
}
this.setStateChanged("no_error_found");
if(this.main_controller){
AJS.hideElement(this.switch_lan_pic);
var _a7=AJS.IMG({"src":this.img_dir+"blank.gif","style":"height: 16px; width: 1px;"});
var rsm=AJS.SPAN();
rsm.innerHTML=this.lang_no_error_found;
AJS.RCN(this.spell_span,AJS.SPAN(_a7,rsm));
this.spell_span.className="googie_check_spelling_ok";
this.spell_span.style.textDecoration="none";
this.spell_span.style.cursor="default";
AJS.callLater(AJS.$b(_a5,this),1200,[false]);
}
};
GoogieSpell.prototype.resumeEditingState=function(){
this.setStateChanged("resume_editing");
if(this.main_controller){
AJS.hideElement(this.switch_lan_pic);
var _a9=AJS.IMG({"src":this.img_dir+"blank.gif","style":"height: 16px; width: 1px;"});
var rsm=AJS.SPAN();
rsm.innerHTML=this.lang_rsm_edt;
AJS.RCN(this.spell_span,AJS.SPAN(_a9,rsm));
var fn=function(e){
this.resumeEditing();
};
AJS.AEV(this.spell_span,"click",AJS.$b(fn,this),true);
this.spell_span.className="googie_resume_editing";
}
try{
this.edit_layer.scrollTop=this.ta_scroll_top;
}
catch(e){
}
};
GoogieSpell.prototype.checkSpellingState=function(_ad){
if(!AJS.isDefined(_ad)||_ad){
this.setStateChanged("spell_check");
}
if(this.show_change_lang_pic){
this.switch_lan_pic=this.createChangeLangPic();
}else{
this.switch_lan_pic=AJS.SPAN();
}
var _ae=this.createSpellDiv();
var fn=function(){
this.spellCheck();
};
if(this.custom_spellcheck_starter){
_ae.onclick=this.custom_spellcheck_starter;
}else{
AJS.AEV(_ae,"click",AJS.$b(fn,this),true);
}
this.spell_span=_ae;
if(this.main_controller){
if(this.change_lang_pic_placement=="left"){
AJS.RCN(this.spell_container,_ae," ",this.switch_lan_pic);
}else{
AJS.RCN(this.spell_container,this.switch_lan_pic," ",_ae);
}
}
};
GoogieSpell.item_onmouseover=function(e){
var elm=AJS.getEventElm(e);
if(elm.className!="googie_list_revert"&&elm.className!="googie_list_close"){
elm.className="googie_list_onhover";
}else{
elm.parentNode.className="googie_list_onhover";
}
};
GoogieSpell.item_onmouseout=function(e){
var elm=AJS.getEventElm(e);
if(elm.className!="googie_list_revert"&&elm.className!="googie_list_close"){
elm.className="googie_list_onout";
}else{
elm.parentNode.className="googie_list_onout";
}
};
GoogieSpell.prototype.createCloseButton=function(_b4){
return this.createButton(this.lang_close,"googie_list_close",AJS.$b(_b4,this));
};
GoogieSpell.prototype.createButton=function(_b5,_b6,_b7){
var _b8=AJS.TR();
var btn=AJS.TD();
btn.onmouseover=GoogieSpell.item_onmouseover;
btn.onmouseout=GoogieSpell.item_onmouseout;
var _ba;
if(_b6!=""){
_ba=AJS.SPAN({"class":_b6});
_ba.innerHTML=_b5;
}else{
_ba=AJS.TN(_b5);
}
btn.appendChild(_ba);
AJS.AEV(btn,"click",_b7);
_b8.appendChild(btn);
return _b8;
};
GoogieSpell.prototype.removeIndicator=function(elm){
try{
AJS.removeElement(this.indicator);
}
catch(e){
}
};
GoogieSpell.prototype.appendIndicator=function(elm){
var img=AJS.IMG({"src":this.img_dir+"indicator.gif","style":"margin-right: 5px;"});
AJS.setWidth(img,16);
AJS.setHeight(img,16);
this.indicator=img;
img.style.textDecoration="none";
try{
AJS.insertBefore(img,elm);
}
catch(e){
}
};
GoogieSpell.prototype.createFocusLink=function(_be){
return AJS.A({"href":"javascript:;",name:_be});
};
