mbMgr){this.thumbMgr.RestoreThumbnails();}}
this.changeWord=function(index)
{var newText="";var word=document.getElementById("word");var cur=this.corrections[index];newText+=this.text.substr(0,cur.b);newText+=word.value;newText+=this.text.substr(cur.b+cur.l,this.text.length-(cur.b+cur.l));this.adjustOffsets(word.value.length-cur.l,index+1);this.text=newText;}
this.adjustOffsets=function(delta,start)
{for(i=start;i<this.corrections.length;i++){this.corrections[i].b+=delta;}}
this.getStyles=function()
{var html="";var styles=document.getElementsByTagName("STYLE");for(var i=0;i<styles.length;i++){html+="<style>"+styles[i].innerHTML+"</style>";}
return html;}}
var SpellController={UIStrings:{NO_SUGGESTIONS:"No Suggestions",NO_MORE_MISSPELLINGS:"No more misspellings",NO_MISSPELLINGS:"No misspellings found",SPELL_DISABLED:"Spelling disabled, click Resume to continue",CHANGE_LABEL:"Change to:",SUGG_LABEL:"Suggestions:",CHANGE_BTN:"Change",IGNORE_BTN:"Ignore",CLOSE_BTN:"Close",RESUME_BTN:"Resume",CHANGE_ONE_ITEM:"Change this word",CHANGE_ALL_ITEM:"Change all occurrences",IGNORE_ONE_ITEM:"Ignore this word",IGNORE_ALL_ITEM:"Ignore all occurrences"},oldHeight:null,setString:function(id,str)
{this.UIStrings[id]=str;},getString:function(id)
{var result=this.UIStrings[id];if(result==null){return id;}
return result;},addController:function(container)
{if(typeof container=="string"){container=document.getElementById(container);}
var html="";html+='<div id="spellbox" class="clearfix">';html+='<div id="btnbox" class="first">';html+='<div id="spellmsg" style="display:none"></div>';html+='<div id="correction"><label for="word">'+this.getString("CHANGE_LABEL")+'&nbsp;</label><input id="word" onkeypress="speller.onKeyPressWord(event)" /></div>';html+='<button id="changeButton" class="hasdefaultstate" type="button" value="Change" onclick="changeClick(event)">'+this.getString("CHANGE_BTN")+'</button>';html+='<button id="ignoreButton" class="hasdefaultstate" type="button" value="Ignore" onclick="ignoreClick(event)">'+this.getString("IGNORE_BTN")+'</button>';html+='<button id="doneButton" type="button" value="Close" onclick="spellDone(spellbox)">'+this.getString("CLOSE_BTN")+'</button>';html+='</div>';html+='<div id="slbox">';html+='<label id="sugglabel" for="suggestions">'+this.getString("SUGG_LABEL")+'&nbsp;</label>';html+='<select id="suggestions" size="4" onchange="SpellController.onChangeSuggestions()"></select>';html+='</div>';html+='</div>';html+='<div id="changemenu" class="buttonmenu" container="'+container.id+'">';html+='<strong>Change Options</strong>';html+='<ul>';html+='<li value="0">'+this.getString("CHANGE_ONE_ITEM")+'</li>';html+='<li value="1">'+this.getString("CHANGE_ALL_ITEM")+'</li>';html+='</ul>';html+='</div>';html+='<div id="ignoremenu" class="buttonmenu" container="'+container.id+'">';html+='<strong>Change Options</strong>';html+='<ul>';html+='<li value="0">'+this.getString("IGNORE_ONE_ITEM")+'</li>';html+='<li value="1">'+this.getString("IGNORE_ALL_ITEM")+'</li>';html+='</ul>';html+='</div>';container.innerHTML=html;var oChangeMenu=MenuButton('changeButton',changeClick,'changemenu',changeMenuClick);var oSkipMenu=MenuButton('ignoreButton',ignoreClick,'ignoremenu',ignoreMenuClick);},showController:function(editBox)
{var spellBox=document.getElementById("spellbox");if(spellBox==null){SpellController.addController("spellcontrol");spellBox=document.getElementById("spellbox");}
if(spellBox!=null){spellBox.style.display="block";if(typeof editBox!="undefined"&&editBox!=null){if(this.oldHeight==null){this.oldHeight=editBox.clientHeight;this.editBox=editBox;editBox.style.height=editBox.clientHeight-spellBox.offsetHeight+"px";}
if(editBox.tagName=="TEXTAREA"){this.setBoxWidth(editBox,spellBox);}}
this.hideMessage();disableItem("changeButton",false);disableItem("ignoreButton",false);disableItem("doneButton",false);disableItem("word",false);disableItem("suggestions",false);}},setBoxWidth:function(editBox,spellBox)
{if(spellBox.getAttribute("width_set")!=null){return;}
var width=editBox.offsetWidth;spellBox.style.width=width+"px";var delta=spellBox.offsetWidth-width;if(delta!=0){width-=delta;spellBox.style.width=width+"px";}
var btnbox=document.getElementById("btnbox");var slbox=document.getElementById("slbox");if(btnbox!=null&&slbox!=null){var delta=(width-(btnbox.offsetWidth+slbox.offsetWidth))/2;var word=
