functionAddWord(){vare=htmlEntities(document.getElementById("word").value).trim(),t=htmlEntities(document.getElementById("pronunciation").value).trim(),n=htmlEntities(document.getElementById("partOfSpeech").value).trim(),i=htmlEntities(document.getElementById("simpleDefinition").value).trim(),r=htmlEntities(document.getElementById("longDefinition").value),o=htmlEntities(document.getElementById("editIndex").value),a=document.getElementById("errorMessage"),c="",s=document.getElementById("updateConflict");if(""==e||""==i&&""==r)""==e?(c+="Word cannot be blank",c+=""==i&&""==r?" and you need at least one definition.":"."):""==i&&""==r&&(c+="You need at least one definition.");else{vard=currentDictionary.settings.allowDuplicates?-1:WordIndex(e);if(""!=o)WordAtIndexWasChanged(o,e,t,n,i,r)?(document.getElementById("editWordButtonArea").style.display="none",DisableForm(),s.style.display="block",s.innerHTML="<span id='updateConflictMessage'>Do you really want to change the word \""+currentDictionary.words[parseInt(o)].name+'" to what you have set above?</span>',s.innerHTML+='<button type="button" id="updateConfirmButton" onclick="UpdateWord('+o+", '"+htmlEntities(e)+"', '"+htmlEntities(t)+"', '"+htmlEntities(n)+"', '"+htmlEntities(i)+"', '"+htmlEntities(r)+"'); return false;\">Yes, Update it</button>",s.innerHTML+='<button type="button" id="updateCancelButton" onclick="CloseUpdateConflictArea(\'editWordButtonArea\'); return false;">No, Leave it</button>'):(c='No change has been made to "'+e+'"',currentDictionary.words[parseInt(o)].name!=e&&(c+=". (Your dictionary is currently set to ignore case.)"));elseif(d>=0)if(WordAtIndexWasChanged(d,e,t,n,i,r)){document.getElementById("newWordButtonArea").style.display="none",DisableForm(),s.style.display="block";varl="<span id='updateConflictMessage'>\""+e+'" is already in the dictionary';l+=currentDictionary.words[d].name!=e?' as "'+currentDictionary.words[d].name+'", and your dictionary is set to ignore case.':".",l+="<br>Do you want to update it to what you have set above?</span>",l+='<button type="button" id="updateConfirmButton" onclick="UpdateWord('+d+", '"+htmlEntities(e)+"', '"+htmlEntities(t)+"', '"+htmlEntities(n)+"', '"+htmlEntities(i)+"', '"+htmlEntities(r)+"'); return false;\">Yes, Update it</button>",l+=' <button type="button" id="updateCancelButton" onclick="CloseUpdateConflictArea(\'newWordButtonArea\'); return false;">No, Leave it</button>',s.innerHTML=l}elsec='"'+e+'" is already in the dictionary exactly as it is written above',currentDictionary.words[d].name!=e&&(c+=". (Your dictionary is currently set to ignore case.)");elsecurrentDictionary.words.push({name:e,pronunciation:t,partOfSpeech:n,simpleDefinition:i,longDefinition:r,wordId:currentDictionary.nextWordId++}),FocusAfterAddingNewWord(),NewWordNotification(e),SaveAndUpdateDictionary(!1);a.innerHTML=""}a.innerHTML=c}functionEditWord(e){SaveScroll(),wordFormIsLocked()&&window.scroll(0,0),ClearForm(),document.getElementById("editIndex").value=e.toString(),document.getElementById("word").value=htmlEntitiesParse(currentDictionary.words[e].name),document.getElementById("pronunciation").value=htmlEntitiesParse(currentDictionary.words[e].pronunciation),document.getElementById("partOfSpeech").value=htmlEntitiesParse(currentDictionary.words[e].partOfSpeech),document.getElementById("simpleDefinition").value=htmlEntitiesParse(currentDictionary.words[e].simpleDefinition),document.getElementById("longDefinition").value=htmlEntitiesParse(currentDictionary.words[e].longDefinition),document.getElementById("newWordButtonArea").style.display="none",document.getElementById("editWordButtonArea").style.display="block"}functionUpdateWord(e,t,n,i,r,o){currentDictionary.words[e].name=t,currentDictionary.words[e].pronunciation=n,currentDictionary.words[e].partOfSpeech=i,currentDictionary.words[e].simpleDefinition=r,currentDictionary.wor