if(typeof(LiveSpellInstance)=="undefined"){function LiveSpellInstance($setup){livespell.spellingProviders.push(this);this.Fields="ALL";this.IgnoreAllCaps=true;this.IgnoreNumeric=true;this.CaseSensitive=true;this.CheckGrammar=true;this.Language="English (International), Deutsch";this.MultiDictionary=false;this.UserInterfaceLanguage="de";this.CSSTheme="classic";this.SettingsFile="default-settings";this.ServerModel="";this.Delay=888;this.WindowMode="modal";this.Strict=true;this.ShowSummaryScreen=true;this.ShowMeanings=true;this.FormToSubmit="";this.MeaningProvider="http://www.thefreedictionary.com/{word}";this.UndoLimit=20;this.HiddenButtons="";this.CustomOpener=null;this.CustomOpenerClose=null;this.RightClickOnly=livespell.test.iPhone()?false:true;this.ShowLangInContextMenu=true;this.BypassAuthentication=false;this.UserSpellingInitiated=false;this.UserSpellingComplete=false;this.AddWordsToDictionary="USER";this.SetUserInterfaceLanguage=function(l){this.UserInterfaceLanguage=l;livespell.lang.load(l)} this.isUniPacked=false;this.isNetSpell=false;this.FieldType=function(id){var oField=document.getElementById(id);var TYPE=oField.nodeName.toUpperCase();if(TYPE=="INPUT"||TYPE=="TEXTAREA"){return"value"} if(TYPE=="IFRAME"){return"iframe"} return"innerHTML";} this.docUpdate=function(docs){var fieldIds=this.arrCleanFields();this.onUpdateFields(fieldIds);for(var i=0;i" Modalbox.show(HTMLIframe,{title:livespell.lang.fetch(this.id(),"WIN_TITLE"),overlayDuration:0.2,slideDownDuration:0.2,slideUpDuration:0.2});var f=this var fn=function(){f["onDialogOpen"]()};setTimeout(fn,189) return} if(livespell.test.BuggyAjaxInFireFox()){Dheight=325;}else if(livespell.test.IE6()){Dheight=333;} if(wm=="modal"&&window.showModalDialog&&canmodal){window.showModalDialog(this.url(),window,"center:1;dialogheight:"+Dheight+"px;dialogwidth:"+Dwidth+"px;resizable:0;scrollbars:0;scroll:0;location:0");}else if(wm=="modeless"&&window.showModelessDialog&&canmodal){window.showModelessDialog(this.url(),window,"center:1;dialogheight:"+Dheight+"px;dialogwidth:"+Dwidth+"px;resizable:0;scrollbars:0;scroll:0;location:0");}else{window.open(this.url(),"spelldialog","width="+Dwidth+",height="+Dheight+",scrollbars=no,resizable=no;centerscreen=yes;location=no;tolbar=no;menubar=no",false);}} this.url=function(){var strout=livespell.installPath+"dialog.html";strout+="?instance="+this.id();return strout;} this.m_ayt=[];this.m_ayt_timeout=null;this.m_AYTAjaxInervalHandler=function(){var fieldIds=this.m_ayt;if(!fieldIds.length){return;};for(var i=0;i15&&ch8r<32)||(ch8r>32&&ch8r<41))&&(ch8r!=127)){return;} var me=event.srcElement?event.srcElement:this;clearTimeout(livespell.cache.checkTimeoutUni) livespell.cache.checkTimeoutUni=setTimeout(function(){JavaScriptSpellCheck.LiveValidateMech(me)},567)} this.LiveValidateMech4Proxy=function(oField,result){var MessageHolder=oField.MessageHolder;if(typeof(MessageHolder)=="string"){MessageHolder=document.getElementById(MessageHolder);} if(!MessageHolder||!MessageHolder.id){return false;} MessageHolder.style.display=result?"none":"inherit";oField.isValidated=result;} this.LiveValidateMech=function(oField){var o=this.createInstance(oField);setTimeout(function(){o.AjaxValidateFields();},1);o.onValidate=function(Fields,result){var oneField=Fields.split(",")[0];var oField=document.getElementById(oneField);var MessageHolder=oField.MessageHolder;if(typeof(MessageHolder)=="string"){MessageHolder=document.getElementById(MessageHolder);} if(!MessageHolder||!MessageHolder.id){return false;} MessageHolder.style.display=result?"none":"inherit";oField.isValidated=result;delete o}} this.vhcounter=0;this.findcounter=0;;this.findf=function(Fields,PassedArgs){if(!Fields){return"ALL"} var inputs=[];var outputs=[];if(!PassedArgs){inputs=[];inputs[0]=Fields;}else{inputs=PassedArgs} for(var i=0;i0){oObject=byName[0]}}}} if(oObject){if(!oObject.id){oObject.id="jsspellcheck__element__"+(this.findcounter);this.findcounter++;} outputs.push(oObject.id)}}} return outputs.join(",")} this.manageAjaxInstance=function(){var o=this.ajaxinstance;o.Language=this.DefaultDictionary;o.UserInterfaceLanguage=this.UserInterfaceTranslation;o.IgnoreAllCaps=this.IgnoreAllCaps;o.IgnoreNumeric=this.IgnoreNumbers;o.IgnoreAllCaps=this.IgnoreAllCaps;o.CSSTheme=this.Theme;o.WindowMode=this.PopUpStyle;o.FormToSubmit=this.SubmitFormById;o.ShowSummaryScreen=this.ShowStatisticsScreen;o.ShowMeanings=this.ShowThesaurus;o.ServerModel=this.ServerModel;return o;} this.createInstance=function(Fields,PassedArgs){var o=new LiveSpellInstance();o.isUniPacked=this.isUniPacked;o.Language=this.DefaultDictionary;o.UserInterfaceLanguage=this.UserInterfaceTranslation;Fields=this.findf(Fields,PassedArgs) o.Fields=this.ManageFields(Fields);o.IgnoreAllCaps=this.IgnoreAllCaps;o.IgnoreNumeric=this.IgnoreNumbers;o.WindowMode=this.PopUpStyle;o.CSSTheme=this.Theme;o.FormToSubmit=this.SubmitFormById;o.ShowSummaryScreen=this.ShowStatisticsScreen;o.ShowMeanings=this.ShowThesaurus;o.AddWordsToDictionary=this.AddWordsToDictionary;o.ShowMeanings=this.ShowThesaurus;o.ShowLangInContextMenu=this.ShowLanguagesInContextMenu;o.ServerModel=this.ServerModel;o.CaseSensitive=this.CaseSensitive;o.CheckGrammar=this.CheckGrammar;return o;}}} if(typeof(JavaScriptSpellCheck)=="undefined"||!JavaScriptSpellCheck){var JavaScriptSpellCheck=new JavaScriptSpellCheckObj() var $Spelling=JavaScriptSpellCheck;var $spelling=JavaScriptSpellCheck} if(typeof(livespell)=="undefined"){livespell={isactiveX:false,degradeToIframe:true,rubberRingServerModel:"",callerspan:null,liveProxys:[],installPath:"",spellingProviders:[],addedJsFiles:[],maxURI:999,onLoadDelay:50,getElementsByClass:function(className){var thanksto="KorRedDevil";var hasClassName=new RegExp("(?:^|\\s)"+className+"(?:$|\\s)");var allElements=document.getElementsByTagName("*");var results=[];var element;for(var i=0;(element=allElements[i])!=null;i++){var elementClass=element.className;if(elementClass&&elementClass.indexOf(className)!=-1&&hasClassName.test(elementClass))results.push(element);} return results;},setrubberRingServerModel:function(){if(!(livespell.spellingProviders[0]&&livespell.spellingProviders[0].isUniPacked)){return false;} var mode="" if(this.testSyncRequest(livespell.installPath+"core/Default.aspx")){mode="aspx";}else if(this.testSyncRequest(livespell.installPath+"core/Default.ashx")){mode="asp.net";}else if(this.testSyncRequest(livespell.installPath+"core/index.php")){mode="php";}else if(this.testSyncRequest(livespell.installPath+"core/default.asp")){mode="asp";}else{if(typeof(window['LIVESPELL_DEBUG_MODE'])!="undefined"){livespell.ajax.debug("SpellCheck Cannot Connect to a Server!",false)}else{throw("SpellCheck Cannot Connect to a Server!");} return;} livespell.ajax.debug("

Spell Check Server Mode Detected & Changed to "+mode.toUpperCase()+"

",false) livespell.rubberRingServerModel=mode;return mode;},setUniServerModel:this.setrubberRingServerModel,ajaxClient:function(sync){var xhr=false;try{xhr=new XMLHttpRequest();if(xhr){return xhr}}catch(e){} if(livespell.degradeToIframe&&!sync){return false} try{xhr=new ActiveXObject('Microsoft.XMLHTTP');if(xhr){livespell.isactiveX=true;return xhr}}catch(e2){try{xhr=new ActiveXObject('Msxml2.XMLHTTP');if(xhr){livespell.isactiveX=true;return xhr}}catch(e3){return false;}} return false;},testSyncRequest:function(posturl){var hasajax=false;var xhr=livespell.ajaxClient(true);if(posturl.indexOf("html")>-1){xhr.open("GET",posturl,false);xhr.send();}else{var params="test=true" xhr.open("GET",posturl+"?"+params,false);xhr.send();} if(xhr.status==200){if(typeof(window['LIVESPELL_DEBUG_MODE'])!="undefined"){livespell.ajax.debug("SERVER ERROR:"+xhr.responseText,false)} return xhr.responseText.toLowerCase().replace(/^\s\s*/,'').replace(/\s\s*$/,'')=="no command";} if(typeof(window['LIVESPELL_DEBUG_MODE'])!="undefined"){livespell.ajax.debug("SERVER CANNOT WORK:"+xhr.responseText,false)} return false},addJs:function(js){if(livespell.addedJsFiles[js]==true){return} livespell.addedJsFiles[js]=true var Scr=document.createElement('SCRIPT');Scr.src=js;Scr.type='text/javascript';document.getElementsByTagName('HEAD')[0].appendChild(Scr);},inlineblock:function(){var webkit=livespell.test.webkit();if(webkit){return"block";} return window.getComputedStyle?"inline-block":"inline";},heartbeat:function(){var id;var DesiredActive=new Array();for(var p=0;p0){if(myFrame.contentWindow){oDoc=myFrame.contentWindow.frames[0].document}else if(myFrame.contentDocument){oDoc=myFrame.frames[0].contentDocument;}else{return null;} return oDoc;} if(myFrame.contentWindow){oDoc=myFrame.contentWindow.document;}else if(myFrame.contentDocument){oDoc=myFrame.contentDocument;}else{return null;} return oDoc;return null;},getIframeDocument:function(myFrame){var oDoc,oBody;var isEditable;try{if(myFrame.contentWindow){oDoc=myFrame.contentWindow.document;}else if(myFrame.contentDocument){oDoc=myFrame.contentDocument;}else{return null} if(myFrame.src=='javascript:""'){return oDoc} oHTML=oDoc.getElementsByTagName("html")[0];try{isEditable=oHTML.contentEditable==="true"||oHTML.contentEditable===true||oHTML.designMode=='on'||oHTML.designMode=='On'||oHTML.designMode=='ON'||oHTML.designMode===true||oHTML.designMode==="true"||oHTML.contentEditable===true||oHTML.designMode=='on'||oHTML.designMode===true||oHTML.designMode==="true";if(isEditable){return oDoc}}catch(e){} oBody=oDoc.body;isEditable=oBody.contentEditable==="true"||oBody.contentEditable===true||oBody.designMode=='on'||oBody.designMode=='On'||oBody.designMode=='ON'||oBody.designMode===true||oBody.designMode==="true"||oDoc.contentEditable===true||oDoc.designMode=='on'||oDoc.designMode===true||oDoc.designMode==="true";if(isEditable){return oDoc} var ofsrc=myFrame.src;myFrame=myFrame.contentWindow?myFrame.contentWindow:myFrame;if(myFrame.frames.length){var oSubDoc;for(var i=0;i0){return oBody} isEditable=oBody.spellcheck==="false"||oBody.spellcheck===false||oBody.contentEditable==="true"||oBody.contentEditable===true||oBody.designMode=='on'||oBody.designMode=='On'||oBody.designMode=='ON'||oBody.designMode===true||oBody.designMode==="true"||oDoc.contentEditable===true||oDoc.designMode=='on'||oDoc.designMode===true||oDoc.designMode==="true";if(isEditable){return oSubDoc}} isEditable=oBody.spellcheck==="false"||oBody.spellcheck===false;if(isEditable){return oDoc}}}catch(e){} return null;},lang:{fetch:function(providerID,index){var lang=livespell.spellingProviders[providerID].UserInterfaceLanguage;try{return this[lang][this[index]];}catch(e){try{return this["en"][this[index]];}catch(e){return index;}}},load:function(lang){var idname="__livespell__translations__"+lang;var fileref=E$(idname) if(fileref){}else{fileref=document.createElement("script");fileref.setAttribute("id",idname);fileref.id=idname;fileref.setAttribute("type","text/javascript");fileref.setAttribute("src",livespell.installPath+"translations/"+lang+".js");document.getElementsByTagName("head")[0].appendChild(fileref);}},BTN_ADD_TO_DICT:0,BTN_AUTO_CORECT:1,BTN_CANCEL:2,BTN_CHANGE:3,BTN_CHANGE_ALL:4,BTN_CLEAR_EDIT:5,BTN_CLOSE:6,BTN_IGNORE_ALL:7,BTN_IGNORE_ONCE:8,BTN_OK:9,BTN_OPTIONS:10,BTN_RESET:11,BTN_UNDO:12,DONESCREEN_EDITS:13,DONESCREEN_FIELDS:14,DONESCREEN_MESSAGE:15,DONESCREEN_WORDS:16,LABEL_LANGAUGE:17,LABEL_SUGGESTIONS:18,LANGUAGE_MULTIPLE:19,LANGUAGE_MULTIPLE_INSTRUCTIONS:20,LOOKUP_MEANING:21,MENU_APPLY:22,MENU_CANCEL:23,MENU_DELETEBANNED:24,MENU_DELETEREPEATED:25,MENU_IGNORE:26,MENU_IGNOREALL:27,MENU_LANGUAGES:28,MENU_LEARN:29,MENU_NOSUGGESTIONS:30,OPT_CASE_SENSITIVE:31,OPT_ENTRIES:32,OPT_IGNORE_CAPS:33,OPT_IGNORE_NUMERIC:34,OPT_PERSONAL_AUTO_CURRECT:35,OPT_PERSONAL_DICT:36,OPT_SENTENCE_AWARE:37,REASON_BANNED:38,REASON_CASE:39,REASON_ENFORCED:40,REASON_GRAMMAR:41,REASON_REPEATED:42,REASON_SPELLING:43,SUGGESTIONS_DELETE_REPEATED:44,SUGGESTIONS_NONE:45,USRBTN_SPELL_CHECK:46,WIN_TITLE:47},constants:{_IFRAME:"livespell___ajax_frame",_AJAXFORM:"livespell___ajax_form"},ajax:{renderIframe:function(postURL){if(E$(livespell.constants._IFRAME)){return;} var n=document.createElement("span");n.innerHTML="" document.body.appendChild(n);},resend:function(){if(livespell.isactiveX==true&&livespell.test.IE()){livespell.degradeToIframe=true;} livespell.ajax.send(livespell.cache.ajaxrequest.cmd,livespell.cache.ajaxrequest.args,livespell.cache.ajaxrequest.lan,livespell.cache.ajaxrequest.note,livespell.cache.ajaxrequest.sender);},send:function(cmd,args,lan,note,sender){livespell.cache.ajaxrequest={};livespell.cache.ajaxrequest.cmd=cmd;livespell.cache.ajaxrequest.args=args;livespell.cache.ajaxrequest.lan=lan;livespell.cache.ajaxrequest.note=note;livespell.cache.ajaxrequest.sender=sender;var oSender=livespell.spellingProviders[sender];var serverModel=oSender.ServerModel.toLowerCase() if(livespell.rubberRingServerModel!==""){serverModel=livespell.rubberRingServerModel} var posturl=livespell.installPath+"core/" if(serverModel==="asp.net"){posturl+="default.ashx"}else if(serverModel==="aspx"){posturl+="Default.aspx"}else if(serverModel==="asp"){posturl+="default.asp"}else if(serverModel==="php"){posturl+="index.php"}else if(serverModel==="auto"||serverModel===""){posturl+=""}else if(serverModel!==""){posturl+="index."+serverModel}else{throw('livespell::SeverModel not recognized: '+serverModel)} var settingsfile=livespell.spellingProviders[sender].SettingsFile;var hasajax=false;var xhr=false;if(!(oSender.BypassAuthentication&&livespell.test.IE())){xhr=livespell.ajaxClient(false);} if(xhr){hasajax=true};try{args=encodeURIComponent(args);}catch(e){args=escape(args);} try{lan=encodeURIComponent(lan);}catch(e){lan=escape(lan);} try{settingsfile=encodeURIComponent(settingsfile);}catch(e){settingsfile=escape(settingsfile);} try{note=encodeURIComponent(note);}catch(e){note=escape(note);} try{sender=encodeURIComponent(sender);}catch(e){sender=escape(sender);} var params='';params+="note="+(note);params+="&command="+(cmd);params+="&args="+(args);params+="&lan="+(lan);params+="&sender="+(sender);params+="&settingsfile="+(settingsfile);if(hasajax){var liveSpellAjaxCallbackhandler=function(){if(xhr.readyState==4){if(xhr.status==200){livespell.ajax.pickup(xhr.responseText,false);}else{if(livespell.rubberRingServerModel!=livespell.setrubberRingServerModel()){livespell.ajax.resend()} if(typeof(window['LIVESPELL_DEBUG_MODE'])!="undefined"){try{if(xhr.responseText.length){livespell.ajax.debug("SERVER ERROR:"+xhr.responseText,false)}else{livespell.ajax.debug("SERVER ERROR - Please view this page in a browser other than IE for full details",false)}}catch(e){livespell.ajax.debug("SERVER ERROR",false)}}}}};if(livespell.test.BuggyAjaxInFireFox()){xhr.onload=xhr.onerror=xhr.onabort=liveSpellAjaxCallbackhandler;}else{xhr.onreadystatechange=liveSpellAjaxCallbackhandler;} xhr.open("GET",posturl+"?"+params,true);var warning="must be async for performance issues";xhr.send();livespell.ajax.debug("URL:"+posturl+"
GET:"+params,true)}else{var e;livespell.ajax.renderIframe(posturl);params+="&script=true" livespell.ajax.debug("URL:"+posturl+"
GET (IFRAME):"+params,true) var theframe=E$(livespell.constants._IFRAME) try{var framehref=(theframe.contentWindow.location.href) if(framehref.indexOf("about:blank")<0){posturl=framehref.split("?")[0];} theframe.contentWindow.location.replace(posturl+"?"+params)}catch(e){theframe.src=posturl+"?"+params}}},send_sync:function(cmd,args,lan,note,sender){livespell.cache.ajaxrequest={};livespell.cache.ajaxrequest.cmd=cmd;livespell.cache.ajaxrequest.args=args;livespell.cache.ajaxrequest.lan=lan;livespell.cache.ajaxrequest.note=note;livespell.cache.ajaxrequest.sender=sender;var oSender=livespell.spellingProviders[sender];var serverModel=oSender.ServerModel.toLowerCase() if(serverModel==="auto"&&livespell.rubberRingServerModel!==""){serverModel=livespell.rubberRingServerModel} var posturl=livespell.installPath+"core/" if(serverModel==="asp.net"){posturl+="default.ashx"}else if(serverModel==="aspx"){posturl+="Default.aspx"}else if(serverModel==="asp"){posturl+="default.asp"}else if(serverModel==="php"){posturl+="index.php"}else if(serverModel==="auto"||serverModel===""){posturl+=""}else if(serverModel!==""){posturl+="index."+serverModel}else{throw('livespell::SeverModel not recognized: '+serverModel)} var settingsfile=livespell.spellingProviders[sender].SettingsFile;var hasajax=false;var xhr=livespell.ajaxClient(true);if(!xhr){livespell.ajax.debug("SYNC REQUEST ERROR: No HTMLHTTP object or ActiveX",false);return null;};var params='';try{args=encodeURIComponent(args);}catch(e){args=escape(args);} params+="note="+escape(note);params+="&command="+cmd;params+="&args="+(args);params+="&lan="+escape(lan);params+="&sender="+escape(sender);params+="&settingsfile="+escape(settingsfile);xhr.open("GET",posturl+"?"+params,false);xhr.send();livespell.ajax.debug("REMOTE-CALL:"+posturl+"
GET:"+params,true);if(xhr.status==200){return livespell.ajax.pickup(xhr.responseText,true);}else{livespell.setrubberRingServerModel();if(typeof(window['LIVESPELL_DEBUG_MODE'])!="undefined"){try{if(xhr.responseText.length){livespell.ajax.debug("SERVER ERROR:"+xhr.responseText,false)}else{livespell.ajax.debug("SERVER ERROR - Please view this page in a browser other than IE for full details",false)}}catch(e){livespell.ajax.debug("SERVER ERROR",false)} this.send_sync(cmd,args,lan,note,sender)}} return null},pickupIframe:function(strHTML){strHTML=strHTML.split("Spell checker debug console

please email back for comprehensive support


";document.body.appendChild(o);} o=document.getElementById('LIVESPELL_DEBUG_MODE_CONSOLE');o.innerHTML="
"+o.innerHTML+msg+"
";}},needsInstantSuggestion:false,pickup:function(strHTML,binInstant){this.debug((strHTML),false);if(strHTML.indexOf(livespell.str.chr(5))===-1){setTimeout(livespell.ajax.resend,5000);return;} strHTML=strHTML.replace(/ /g,' ').replace(/&/g,'&').replace(/'/g,"'");var arrResult=(strHTML).split(livespell.str.chr(5));var command=arrResult[0];var vSender=Number(arrResult[1]);var oSender=livespell.spellingProviders[vSender] var vLang=oSender.Language var i,j,k,t,r,newSuggestions,sug_each_word,Suggestions;if(!livespell.cache.suggestions[vLang]){livespell.cache.suggestions[vLang]=[];} if(!livespell.cache.spell[vLang]){livespell.cache.spell[vLang]=[];} if(!livespell.cache.reason[vLang]){livespell.cache.reason[vLang]=[];} if(command==="CTXSPELL"){t=arrResult[2].split("");r=arrResult[3].split("");for(i=0;i-1){alert(myMessage)}}else if(command==="APIDYM"){var Suggestion=arrResult[3] var Origional=arrResult[2] oSender.onDidYouMean(Suggestion,Origional);}else if(command==="APIVALIDATE"){var doSuggest=arrResult[4].length>0;Suggestions=arrResult[4].split(livespell.str.chr(1));t=arrResult[2].split("");r=arrResult[3].split(livespell.str.chr(1));var outInput=arrResult[4].split(livespell.str.chr(1));var isValid=arrResult[5]=="T" var outSpellingOk=[];var outReason=[];for(i=0;i0;Suggestions=arrResult[4].split(livespell.str.chr(1));t=arrResult[2].split("");r=arrResult[3].split(livespell.str.chr(1));var outInput=arrResult[5].split(livespell.str.chr(1));var outSpellingOk=[];var outSuggestions=[];var outReason=[];for(i=0;i1||command==="APISPELLARRAY"){if(binInstant){if(livespell.ajax.needsInstantSuggestion){return outSuggestions} return outSpellingOk} oSender.onSpellCheck(outInput,outSpellingOk,outReason,outSuggestions);}else{if(binInstant){if(livespell.ajax.needsInstantSuggestion){return outSuggestions};return outSpellingOk[0]} oSender.onSpellCheck(outInput[0],outSpellingOk[0],outReason[0],outSuggestions[0]);}}}},cache:{ignore:[],spell:[],reason:[],wordlist:[],suglist:[],langs:[],suggestions:[],suggestionrequest:null,checkTimeout:null,checkTimeoutUni:null,ajaxrequest:[]},test:{HTML:function(str){if(str.indexOf("<")>-1&&str.indexOf(">")>-1){return true;} if(str.indexOf("&")==0&&str.indexOf(";")==str.length-1){return true;} return false;},IE:function(){return(navigator.appVersion.indexOf("MSIE")>-1||navigator.userAgent.indexOf("Trident/5")>-1)},IE5:function(){return(navigator.appVersion.indexOf("MSIE 5.")>-1)},IE6:function(){return(navigator.appVersion.indexOf("MSIE 6.")>-1)},IE7:function(){return(navigator.appVersion.indexOf("MSIE 7.")>-1)},IE8:function(){return(navigator.appVersion.indexOf("MSIE 8.")>-1)},IE9:function(){if((navigator.userAgent.indexOf("MSIE 9.")>-1)&&!(arguments.caller)){return true;} return false;},IEold:function(){return(livespell.test.IE()&&(livespell.test.IE5()||livespell.test.IE6()||livespell.test.IE7()));},webkit:function(){return/webkit/.test(navigator.userAgent.toLowerCase())},chrome:function(){return/chrome/.test(navigator.userAgent.toLowerCase())},Safari:function(){return/safari/.test(navigator.userAgent.toLowerCase())},FireFox:function(){return/firefox/.test(navigator.userAgent.toLowerCase())},BuggyAjaxInFireFox:function(){var FF3=(/firefox\/3./.test(navigator.userAgent.toLowerCase()));var GK=(/gecko/.test(navigator.userAgent.toLowerCase()));var WIN=(/windows/.test(navigator.userAgent.toLowerCase()));return((FF3||GK)&&(WIN));},MAC:function(){if(navigator.platform&&(navigator.platform.toUpperCase().indexOf("MAC")>-1)){return true;} return false;},iPhone:function(){if((navigator.userAgent.match(/iPhone/i))||(navigator.userAgent.match(/iPod/i))||(navigator.userAgent.match(/iPad/i))){return true;} return false;},isword:function(str){if(str=="length"){return false;} return(/^([\w'`�\x81-\xFF]+)$$/i).test(str);},ALLCAPS:function(str){return str===str.toUpperCase();},eos:function(str){return((//gi).test(str)||(/[!?��.][\s\S]*$$/).test(str))&&!((/[.]{3}/).test(str));},browserNoAYT:function(){return!livespell.test.browserValid()},num:function(str){return(/[.0-9\*\#\@\/\%\$\&\+\=]/).test(str);},lcFirst:function(str){var f=str.substr(0,1);if((/[.0-9\*\#\@\/'`\%\$\&\+\=]/).test(f)){return false};return f==f.toLowerCase();},spelling:function(word,Lang){if(livespell.cache.ignore[word.toLowerCase()]&&livespell.cache.ignore[word.toLowerCase()]===true){return true};if(!livespell.cache.spell[Lang]){livespell.cache.spell[Lang]=[]} var res=(livespell.cache.spell[Lang][word]);if(res&&typeof(res)=="function"){res=true};return res;},fullyCached:function(word,lang,makeSuggestions){var wordSpellCheck=this.spelling(word,lang);var result=wordSpellCheck===true||wordSpellCheck===false;if(wordSpellCheck!==true){result=result&&livespell.cache.reason[lang]&&typeof(livespell.cache.reason[lang][word])!=="undefined" if(makeSuggestions){result=result&&livespell.cache.suggestions[lang]&&typeof(livespell.cache.suggestions[lang][word])!=="undefined"}} return result;},browserValid:function(){return(document.designMode||document.contentEditable)&&!(document.opera)&&!/opera/.test(navigator.userAgent.toLowerCase())}},str:{getCase:function(word){if(word.toUpperCase()===word){return 2;} if(livespell.str.toCaps(word)===word){return 1;} return 0;},stripSpans:function(strinput){if(!strinput){return""} strinput=strinput.replace((/(\<\/span[^>]*\>)/gi),"");return strinput.replace((/(\]*\>)/gi),"");},stripAnchors:function(strinput){if(!strinput){return""} strinput=strinput.replace((/(\<\/a[^>]*\>)/gi),"");return strinput.replace((/(\]*\>)/gi),"");},stripDirty:function(strinput){if(!strinput){return""} strinput=strinput.replace((/(\<\/h[^>]*\>)/gi),"");strinput=strinput.replace((/(\]*\>)/gi),"");strinput=strinput.replace((/(\<\/form[^>]*\>)/gi),"");strinput=strinput.replace((/(\]*\>)/gi),"");strinput=strinput.replace((/(\<\/div[^>]*\>)/gi),"");strinput=strinput.replace((/(\]*\>)/gi),"");strinput=strinput.replace((/(\<\/t[^>]*\>)/gi),"");strinput=strinput.replace((/(\]*\>)/gi),"");strinput=strinput.replace((/(\<\/img[^>]*\>)/gi),"");return strinput.replace((/(\]*\>)/gi),"");},stripNonSpaceTags:function(strinput,oinput){if(!strinput){return""} if(strinput.indexOf('o:p')>-1||strinput.indexOf('/g),"");strinput=strinput.replace((/<!--[\s\S.\n]*?-->/g),"");return strinput;},HTMLEnc:function(s){if(s==undefined){return""} s=(s.replace(/&/g,'&').replace(//g,'>'));s=s.replace(/\n/g,"
");s=s.replace(/[ ][ ]/gi,"  ");s=s.replace(/[ ][ ]/gi,"  ");return s;},HTMLEncSimple:function(s){s=(s.replace(/&/g,'&').replace(//g,'>'));return s;},HTMLEncSafeWhite:function(s){s=(s.replace(/&/g,'&').replace(//g,'>'));s=s.replace(/\n/g,"
");s=s.replace(/[ ][ ]/gi,"  ");s=s.replace(/[ ][ ]/gi,"  ");return s;},HTMLDec:function(s){s=s=s.replace(/\ \;/gi," ");s=(s.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'));return s;},HTMLDecAndStripFormatting:function(s){if(!livespell.test.IE()){s=s.replace((/\r/gi),"
");} s=s.replace((/$/i),"");s=s.replace(/

<\/div>/gi,"
") s=s.replace(/
/gi,"
") s=s.replace((/<\/p>/gi),"
");s=s.replace((/<\/p>/gi),"
");s=s.replace((/$/i),"");s=s.replace((//gi),"\n");s=s.replace((/\x0A\x0D\x0A/gi),"\n");s=this.stripTags(s);s=s.replace(/\ /gi," ");s=(s.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'));return s;},spliceXHTML:function(str,pos,add){var arrStr=str.split('');var inHTML=false;var out="";var j=0;for(var i=0;i"&&inHTML){inHTML=false;}} return out;},spliceSpans:function(str,pos,add){if(str+""==""){return""} var arrStr=str.split('');var inHTML=false;var out="";var j=0;for(var i=0;i"&&inHTML){inHTML=false;}} return out;},toCase:function($$str,$$C,$$bcapitalize){switch($$C){case 2:$$str=$$str.toUpperCase();break;case 1:$$str=$$str.substr(0,1).toUpperCase()+$$str.substr(1);break;} if($$bcapitalize){$$str=$$str.substr(0,1).toUpperCase()+$$str.substr(1);} return $$str;},tokenize:function(strdoc){var pattern=(/((\<\;[\/\?]?[a-zA-Z][^\&]*\>)|(\<[\/\?]?[a-z][^\>]*\>)|(\<\;[\/\?]?[a-z][.]*\>)|(\&\;[a-zA-Z0-9]{1,6}\;)|(\&[a-zA-Z0-9]{1,6}\;)|([a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4})|(<[\/\?]?\w+[^>]*>)|([a-zA-Z]{2,5}:\/\/[^\s]*)|(www\.[^\s]+[\.][a-zA-Z-]{2,4})|([^\s\<\>]+[\.][a-zA-Z-]{2,4}[\s\n])|([\w���\x81-\xFF]{2,}[\w'`���\x81-\xFF]*[\w���\x81-\xFF])|([\w]+))/gi);var arrdocobj=strdoc.replace(pattern,this.chr(1)+"$1"+this.chr(1)).replace(/\x01\x01/g,this.chr(1)).split(this.chr(1));var arrdoc=[];for(var i=0;i>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64){output=output+String.fromCharCode(chr2);} if(enc4!=64){output=output+String.fromCharCode(chr3);}} output=this.utf8_decode(output);return output;},utf8_decode:function(utftext){var string="";var i=0;var c=c1=c2=0;while(i191)&&(c<224)){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;}else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}} return string;}},userDict:{forget:function(){var current_cookie=livespell.cookie.get("SPELL_DICT_USER");if(!current_cookie.length){return;} var arrPersonalWords=current_cookie.split(livespell.str.chr(1));for(var i=0;i1){cookie_value=unescape(a_temp_cookie[1].replace(/^\s+|\s+$$/g,''));} if(!cookie_value){return"";} return cookie_value;} a_temp_cookie=null;cookie_name='';} if(!b_cookie_found){return"";}},set:function(name,value,expires,path,domain,secure){var today=new Date();today.setTime(today.getTime());if(expires){expires=expires*1000*60*60*24;} var expires_date;if(value==""){expires_date=new Date(today.getTime());}else{expires_date=new Date(today.getTime()+(expires));} var strcookie=name+"="+escape(value);if(expires){strcookie+=";expires="+expires_date.toGMTString();} document.cookie=strcookie;},setLocal:function(name,value){this.set(name,value,999,"",document.domain,false);}},events:{add:function(obj,event,callback,capture){if(obj.addEventListener){try{obj.addEventListener(event,callback,false);}catch(e){}}else if(obj.attachEvent){obj.detachEvent("on"+event,callback);obj.attachEvent("on"+event,callback);}}},array:{safepush:function(arr,value){for(var i=0;i>>0;for(var i=0;i>>0;} this.length=n;return n;};} if(!Array.pop&&!Array.prototype.pop){Array.prototype.pop=function(){var n=this.length>>>0,value;if(n){value=this[--n];delete this[n];} this.length=n;return value;};} if(!Array.shift&&!Array.prototype.shift){Array.prototype.shift=function(){firstElement=this[0];Array.prototype.reverse.call(this);this.length=Math.max(this.length-1,0);Array.prototype.reverse.call(this);return firstElement;}} E$=function(id){return document.getElementById(id);} livespell.insitu={settings:{Delay:888},provider:function(id){return livespell.spellingProviders[id];},initiated:false,_FIELDSUFFIX:"___livespell_proxy",_CONTEXTMENU:"livespell___contextmenu",updateBaseDelay:function(id){var id2=id;var n=function(){livespell.insitu.updateBase(id2);} setTimeout(n,1)},updateBase:function(id){var thevalue=livespell.str.HTMLDecAndStripFormatting(livespell.insitu.getProxy(id));var theproxy=livespell.insitu.proxyDOM(id);if(thevalue==" "){thevalue=""} E$(id).value=thevalue;if(theproxy){if(typeof(theproxy.value)=="undefined"||theproxy.livespell_value_setter){theproxy.livespell_value_setter=true;theproxy.value=thevalue;}}},proxyDOM:function(id){return E$(id+this._FIELDSUFFIX);},tabber:"    ",getProxy:function(id){var doc=livespell.insitu.proxyDOM(id).innerHTML;if(livespell.test.IE()&&!livespell.test.IE9()){while(doc.indexOf(this.tabber)>-1){doc=doc.replace(this.tabber,"\t")}} doc=livespell.str.stripNonSpaceTags(doc,livespell.insitu.proxyDOM(id)) return doc;},setProxy:function(id,val){try{if(livespell.insitu.proxyDOM(id).innerHTML===val){return}}catch(e){return;} try{livespell.insitu.proxyDOM(id).innerHTML=val;}catch(e){return;} try{if(!(window.getComputedStyle)){livespell.insitu.proxyDOM(id).innerHTML=livespell.insitu.proxyDOM(id).innerHTML;}}catch(e){return;} livespell.context.validate(id)},hasChanged:function(id,providerId){var val=livespell.str.HTMLDecAndStripFormatting(this.getProxy(id));if(val===E$(id).value){return false;} var x,TA,TB;x=val TA=TB=0;for(i=0;i32&&v<123){TA+=v}} x=E$(id).value;for(i=0;i32&&v<123){TB+=v}} var res=(TA!=TB);return res;},safeUpdateProxy:function(id,providerId){if(!livespell.insitu.proxyDOM(id)){return false} if(!livespell.insitu.proxyDOM(id).hasFocus){if(livespell.insitu.hasChanged(id,providerId)){this.updateProxy(id,E$(id).value);this.checkNow(id,providerId)}}},updateProxy:function(id){var value=E$(id).value value=livespell.str.HTMLEncSimple(value);value=value.replace(/\n/g,"
");this.setProxy(id,value);},setProxyAndMaintainCaret:function(id,val){var e;if(livespell.insitu.proxyDOM(id).innerHTML===val){return} if(val===""){return;} var dmilit='\uFEFF';liveField=livespell.insitu.proxyDOM(id);try{if(window.getSelection){range=window.getSelection().getRangeAt(0);range.insertNode(tNode=document.createTextNode(dmilit));}else{range=document.selection.createRange();range.pasteHTML(dmilit);}}catch(e){} text=liveField.innerHTML;text=livespell.str.stripSpans(text);text=livespell.str.stripAnchors(text);pos=text.indexOf(dmilit)-1;caretNode=document.getElementById("livespell_cursor_hack__"+id) if(caretNode&&caretNode.parentNode){caretNode.parentNode.removeChild(caretNode);} caretNode=document.createElement("span");caretNode.id="livespell_cursor_hack__"+id;plainNode=document.createElement("span");plainNode.appendChild(caretNode);caretNodeHTML=plainNode.innerHTML;plainNode.removeChild(caretNode);delete plainNode;delete caretNode;if(window.getSelection){window.getSelection().removeAllRanges();} text=livespell.str.spliceSpans(val,pos,caretNodeHTML);liveField.innerHTML=text;if(!(window.getComputedStyle)){liveField.innerHTML=liveField.innerHTML;} if(livespell.test.IE9()){selection=window.getSelection();selection.removeAllRanges();caretNode=document.getElementById("livespell_cursor_hack__"+id);if(caretNode){range.selectNode(caretNode);range.deleteContents();selection.addRange(range)}}else if(window.getSelection){selection=window.getSelection();selection.removeAllRanges();range=document.createRange();caretNode=document.getElementById("livespell_cursor_hack__"+id);if(caretNode){range.selectNode(caretNode);selection.addRange(range);range.collapse(false);liveField.focus();caretNode.parentNode.removeChild(caretNode);}}else{var range=document.selection.createRange();var caretNode=document.getElementById("livespell_cursor_hack__"+id) var id2=id;var n=function(){try{range.moveToElementText(caretNode);range.select();caretNode.parentNode.removeChild(caretNode);livespell.context.validate(id2)}catch(e){}} setTimeout(n,1)}},findLiveChildrenInDOMElement:function(element){var uid;var LiveOffspring=[];if(element.id){uid=element.id if(document.getElementById(uid+"_designEditor")){var oFTA=(document.getElementById(uid+"_designEditor"));if(oFTA.nodeName.toLowerCase()=="iframe"){LiveOffspring.push(oFTA.id) return LiveOffspring;}}}else{uid="xx"} InnerFrames=element.getElementsByTagName("iframe");for(var i=0;i0){n.maxLength=t.maxLength;}}catch(e){} try{n.setAttribute("class","livespell_textarea "+t.className);}catch(e){} try{n.setAttribute("style",t.getAttribute("style"));}catch(e){} n.style.display="none";stylesToCopy=["font-size","line-height","font-family","width","height","padding-left","padding-top","margin-left","margin-top","padding-right","padding-bottom","margin-right","margin-bottom","font-weight","font-style","color","text-transform","text-decoration","line-height","text-align","vertical-align","direction","background-color","background-image","background-repeat","background-position","background-attachment"];stylesToSet=["fontSize","lineHeight","fontFamily","width","height","paddingLeft","paddingTop","marginLeft","marginTop","paddingRight","paddingBottom","marginRight","marginBottom","fontWeight","fontStyle","color","textTransform","textDecoration","lineHeight","textAlign","verticalAlign","direction","backgroundColor","backgroundImage","backgroundRepeat","backgroundPosition","backgroundAttachment"];if(window.getComputedStyle){var compStyle=window.getComputedStyle(t,null);for(i=0;i-1){styleval=t.attributes["width"].value;} if(t.style.width&&t.style.width.indexOf('%')>-1){styleval=t.style.width;}} if(attr=="height"){if(t.attributes["height"]&&t.attributes["height"].value.indexOf('%')>-1){styleval=t.attributes["height"].value;} if(t.style.height&&t.style.height.indexOf('%')>-1){styleval=t.style.height;}} if(attr=="margin-left"&&styleval.indexOf("px")){styleval=(Number(styleval.split("px")[0])+1)+"px";} if(styleval){n.style[attr2]=styleval;}}}else if(t.currentStyle){n.style.overflowY="scroll";for(i=0;i-1){styleval=t.attributes["width"].value;} if(t.style.width&&t.style.width.indexOf('%')>-1){styleval=t.style.width;}} if(attr=="height"){try{if(t.offsetHeight){n.style.height=t.offsetHeight;}}catch(e){} if(t.attributes["height"]&&t.attributes["height"].value.indexOf('%')>-1){styleval=t.attributes["height"].value;} if(t.style.height&&t.style.height.indexOf('%')>-1){styleval=t.style.height;}} styleval=styleval+"";if(!styleval.toUpperCase){}else if(styleval.toUpperCase()!="AUTO"&&styleval.toUpperCase()!="INHERIT"){n.style[attr]=styleval;}}catch(e){}}} stylesToCopy=["cursor","font-size","line-height","font-family","font-weight","font-style","color","text-transform","text-decoration","line-height","text-align","vertical-align","direction"];stylesToSet=["cursor","fontSize","lineHeight","fontFamily","fontWeight","fontStyle","color","textTransform","textDecoration","lineHeight","textAlign","verticalAlign","direction"];mycss="";csstext="#"+n.id+" p , #+"+n.id+" span {";for(i=0;i1&&this.provider(providerID).CheckGrammar&&token.toUpperCase()===tokens[i-2].toUpperCase()&&token.toUpperCase()!=token.toLowerCase()){show_error=true;reason="R";} if(this.provider(providerID).CaseSensitive&&this.provider(providerID).CheckGrammar&&tokens_startsentence[i]&&livespell.test.lcFirst(token)){if(strDoc.indexOf(".")>0||strDoc.indexOf("!")>0||strDoc.indexOf("?")>0||strDoc.length>50){show_error=true;reason="G";}}} if(show_error){var wiggleClass="livespell_redwiggle";if(reason==="R"||reason==="G"){wiggleClass="livespell_greenwiggle";} if(!livespell.test.iPhone()){tokens[i]=""+(token)+"";}else{tokens[i]=""+(token)+"";}}else{tokens[i]=(token);}} text=tokens.join('');if(livespell.insitu.proxyDOM(id).hasFocus||livespell.context.isOpen()){this.setProxyAndMaintainCaret(id,text);}else{this.setProxy(id,text)}}}},init:function(){if(livespell.insitu.initiated)return;livespell.insitu.initiated=true;livespell.context.renderShell() livespell.context.renderCss();livespell.events.add(window.document,"mousedown",livespell.context.hideIfNotinUse,false);livespell.events.add(window.document,"keydown",livespell.context.hide,false);livespell.userDict.load();livespell.context.hide();},allTextAreas:function(){var AF=[];oTAreas=document.getElementsByTagName("textarea") for(var i=0;i=maxChars){try{if(!event){event=window.event;}}catch(e){} var ch8r=event.keyCode;var hasRange=false;var txt='';try{if(window.getSelection){txt=window.getSelection();}else if(document.getSelection){txt=document.getSelection();}else if(document.selection){txt=document.selection.createRange().text;}}catch(e){} if(txt+""!=""){hasRange=true;} if(hasRange||(ch8r==8||ch8r==46||((ch8r>15&&ch8r<32)||(ch8r>32&&ch8r<41))&&(ch8r!=127))){}else{try{if(!event){event=window.event;}}catch(e){} if(event.preventDefault){event.preventDefault();} event.returnValue=false;return false}} event.returnValue=true;return true},strictMaxChars:function(obj){if(obj.value.length>obj.maxLength){obj.setValue(obj.value.substring(0,obj.maxLength))}},keyhandler:function(event){var returnfalse=false;try{if(!event){event=window.event;}}catch(e){} var ch8r=event.keyCode;if(ch8r>15&&ch8r<31){return;} livespell.insitu.ignoreAtCursor();var me=event.srcElement?event.srcElement:this;me.unChanged=false;me.hasFocus=true;if(me.autocheck){var base_field_id=me.id.split(livespell.insitu._FIELDSUFFIX)[0];livespell.context.validate(base_field_id) var ProviderId=Number(me.autocheckProvider);var oProvider=livespell.spellingProviders[ProviderId];clearTimeout(livespell.cache.checkTimeout) livespell.cache.checkTimeout=setTimeout(function(){livespell.insitu.checkNow(base_field_id,ProviderId)},oProvider.Delay)} if(returnfalse){return false};},ignoreAtCursor:function(){var target try{if(window.getSelection){target=window.getSelection().focusNode.parentNode;}else if(document.selection){target=document.selection.createRange().parentElement();}}catch(e){} if(target&&target.nodeName.toUpperCase()==="SPAN"){target.className="";target.onmousedown=null;}},disableclick:function(event,providerID){var prov=livespell.spellingProviders[providerID];if(prov&&prov.RightClickOnly&&event.button!=2){return true;} if(event.preventDefault){event.preventDefault();}else{event.returnValue=false;} return false},MacCommandKeyDown:false,typoclick:function(event,oparent,ospan,reason,providerID){var prov=livespell.spellingProviders[providerID];if(prov&&prov.RightClickOnly&&(event.button!=2)){return true;} if(event.preventDefault){event.preventDefault();}else{event.returnValue=false;} livespell.context.caller=ospan;livespell.context.callerParent=oparent;var parent;var p_walker=ospan;while(!parent){if(p_walker.nodeName.toUpperCase()==="DIV"&&(p_walker.id+"").indexOf(livespell.insitu._FIELDSUFFIX)>-1){parent=p_walker;}else{p_walker=p_walker.parentNode;}} var id=parent.id.split(this._FIELDSUFFIX)[0];if(!id.length){return false;} var token=livespell.str.stripTags(ospan.innerHTML);var posx=0;var posy=0;if(!event){event=window.event;} if(event.pageX||event.pageY){posx=event.pageX;posy=event.pageY;}else if(event.clientX||event.clientY){posx=event.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;posy=event.clientY+document.body.scrollTop+document.documentElement.scrollTop;} posx+=2;posy+=2;if(livespell.test.IE()){posx+=3;posy+=3;} livespell.context.DOM().className="livespell_contextmenu" livespell.context.DOM().style.position="absolute";livespell.context.DOM().style.top=posy+"px";livespell.context.DOM().style.left=posx+"px";livespell.context.providerID=providerID;livespell.context.suggest(id,token,reason,ospan);return false;}} livespell.context={mouseoverme:false,caller:null,callerParent:null,keysTrapped:false,providerID:null,mackeydown:function(event){try{if(!event){event=window.event;}}catch(e){} if(event.keyCode&&event.keyCode==224){livespell.insitu.MacCommandKeyDown=true;} return false;},mackeyup:function(){if(livespell.context.MacCommandKeyDown){livespell.insitu.MacCommandKeyDown=false};return false;},validate:function(base_field_id){var oF=document.getElementById(base_field_id);if(!oF||!oF.MessageHolder){return};var proxy=livespell.insitu.proxyDOM(base_field_id);if(!proxy){return} var wiggles=proxy.getElementsByTagName('SPAN');var isValid=true;if(proxy.innerHTML.indexOf("livespell_")>-1)for(var i=0;i0){isValid=false;}}} $Spelling.LiveValidateMech4Proxy(oF,isValid)},currentWord:function(){return livespell.context.caller.innerHTML;},provider:function(){return livespell.spellingProviders[this.providerID]},isOpen:function(){if(E$(livespell.insitu._CONTEXTMENU)&&E$(livespell.insitu._CONTEXTMENU).style.display!="none"){return true} return false;},DOM:function(){return E$(livespell.insitu._CONTEXTMENU);},langInSelection:false,hideIfNotinUse:function(){if(livespell.context.DOM().style.display!="none"){if(!livespell.context.mouseoverme&!livespell.context.langInSelection){livespell.context.hide();}}},hide:function(){if(livespell.context.DOM().style.display!="none"){livespell.context.DOM().style.display="none"}},notifyBaseFieldOnChange:function(base_field_id){var oBase=E$(base_field_id);if(oBase["onchange"]){try{oBase["onchange"]()}catch(e){}} var event="change";var element=oBase;try{if(document.createEventObject){var evt=document.createEventObject();element.fireEvent('on'+event,evt)}else{var evt=document.createEvent("HTMLEvents");evt.initEvent(event,true,true);element.dispatchEvent(evt);}}catch(e){}},change:function(word){this.provider().onChangeWord(this.currentWord(),word);var b=this.base_field_id();try{basefield.insertBefore(document.createTextNode(word),livespell.context.caller);basefield.removeChild(livespell.context.caller);}catch(e){livespell.context.caller.innerHTML=word;livespell.context.caller.onMouseUp=function(){};livespell.context.caller.onMouseDown=function(){};livespell.context.caller.className=" ";} this.hide();livespell.context.validate(b) livespell.insitu.updateBase(b);livespell.context.notifyBaseFieldOnChange(b) try{E$(b+livespell.insitu._FIELDSUFFIX).focus()}catch(e){}},ignore:function(){this.provider().onIgnore(this.currentWord());var p=livespell.context.caller;var b=this.base_field_id();var basefield=livespell.context.caller.parentNode?livespell.context.caller.parentNode:document.getElementById(b)+livespell.insitu._FIELDSUFFIX;livespell.cache.ignore[this.currentWord().toLowerCase()]=true;try{basefield.insertBefore(document.createTextNode(this.currentWord()),livespell.context.caller);basefield.removeChild(livespell.context.caller);}catch(e){livespell.context.caller.onMouseUp=function(){};livespell.context.caller.onMouseDown=function(){};livespell.context.caller.className=" ";} livespell.context.validate(b) this.hide();try{E$(b+livespell.insitu._FIELDSUFFIX).focus()}catch(e){}},del:function(){var b=this.base_field_id();var p=livespell.context.caller;var pp=p.parentNode;pp.removeChild(p);this.hide();livespell.insitu.updateBase(b);livespell.context.validate(b) livespell.context.notifyBaseFieldOnChange(b) try{E$(b+livespell.insitu._FIELDSUFFIX).focus()}catch(e){}},ignoreAll:function(){var b=this.base_field_id();this.provider().onIgnoreAll(this.currentWord());livespell.cache.ignore[this.currentWord().toLowerCase()]=true;try{E$(b+livespell.insitu._FIELDSUFFIX).focus()}catch(e){} livespell.insitu.renderProxy(this.base_field_id(),this.providerID);try{E$(b+livespell.insitu._FIELDSUFFIX).focus()}catch(e){} livespell.context.validate(b) this.hide();},addPersonal:function(){var b=this.base_field_id();if(this.provider().AddWordsToDictionary=="SERVER"){livespell.ajax.send("SAVEWORD",this.currentWord(),0,0,this.providerID);} this.provider().onLearnWord(this.currentWord());word=this.currentWord().toLowerCase();livespell.userDict.add(word) try{E$(b+livespell.insitu._FIELDSUFFIX).focus()}catch(e){} livespell.insitu.renderProxy(this.base_field_id(),this.providerID);try{E$(b+livespell.insitu._FIELDSUFFIX).focus()}catch(e){} livespell.context.validate(b) this.hide();},changeLanguage:function(strLang){if(this.provider().Language==strLang){return} if(window.getSelection){var sel=window.getSelection() try{sel.collapseToEnd();}catch(e){}} this.provider().Language=strLang;this.provider().onChangeLanguage(strLang);var tProv=this.provider();var fn=function(){tProv.CheckInSitu();} setTimeout(fn,100) this.hide();},showMultiLang:function(){E$('livepell__multilanguage').style.display="block";var livelangs=livespell.insitu.provider(this.providerID).Language.split(",");for(var i=0;i-1){parent=p_walker;}else{p_walker=p_walker.parentNode;}} return parent.id.split(livespell.insitu._FIELDSUFFIX)[0];},showMenu:function(id,word,reason,providerID){this.providerID=providerID;this.DOM().style.display="block";var j;var action="REPLACE";var suggs=livespell.cache.suggestions[livespell.spellingProviders[providerID].Language][word];switch(reason){case"B":suggs=[];suggs[0]=livespell.lang.fetch(providerID,"MENU_DELETEBANNED");action="DELETE";break;case"R":suggs=[];suggs[0]=livespell.lang.fetch(providerID,"MENU_DELETEREPEATED");action="DELETE";break;case"G":if(!suggs.length){suggs[0]=word;} for(j=0;j'+suggs[j]+'';break;case"IGNORE":menuHTML+='
  • '+suggs[j]+'
  • ';break;case"REG":if(livespell.spellingProviders[providerID].isUniPacked){menuHTML+='
  • '+suggs[j]+'
  • ';}else if(livespell.spellingProviders[providerID].ServerModel.toLowerCase()=="asp.net"||livespell.spellingProviders[providerID].ServerModel.toLowerCase()=="aspx"){menuHTML+='
  • '+"ASPNetSpell Trial"+'
  • ';suggs=[""];}else if(livespell.spellingProviders[providerID].ServerModel.toLowerCase()=="asp"){menuHTML+='
  • '+"ASPSpellCheck Trial"+'
  • ';suggs=[""];}else{menuHTML+='
  • '+"PHPSpellCheck Trial"+'
  • ';suggs=[""];} break;case"DELETE":menuHTML+='
  • '+suggs[j]+'
  • ';break;}} menuHTML+='

  • ';if(!this.buttonIsHidden("menuIgnore",providerID)){menuHTML+='
  • '+livespell.lang.fetch(providerID,"MENU_IGNORE")+'
  • ';} if(!this.buttonIsHidden("menuIgnoreAll",providerID)){menuHTML+='
  • '+livespell.lang.fetch(providerID,"MENU_IGNOREALL")+'
  • ';} if((!this.buttonIsHidden("menuAddToDict",providerID))&&livespell.spellingProviders[providerID].AddWordsToDictionary!="NONE"){menuHTML+='
  • '+livespell.lang.fetch(providerID,"MENU_LEARN")+'
  • ';} if(livespell.spellingProviders[providerID].ShowLangInContextMenu){menuHTML+='

  • ';var doMultipleDict=false if(livespell.MultipleDictionaries==true&&livespell.MultipleDictionaries){doMultipleDict=true} if(livespell.spellingProviders[providerID].Language.indexOf(",")>0){doMultipleDict=true} if(!doMultipleDict){menuHTML+='
  • ';if(true){menuHTML+='';}else{menuHTML+="
  • "+livespell.lang.fetch(providerID,"MENU_LANGUAGES")+"
  • ";menuHTML+='';}} menuHTML+='
    ';this.DOM().innerHTML=menuHTML;try{this.boundMenuToScreen();}catch(e){}},boundMenuToScreen:function(){var oscreen=this.DimViewport();var ws=oscreen.width;var hs=oscreen.height;var px=parseInt(this.DOM().style.left.toString().replace("px",""));var py=parseInt(this.DOM().style.top.toString().replace("px",""));scrollx=document.body.scrollLeft+document.documentElement.scrollLeft;scrolly=document.body.scrollTop+document.documentElement.scrollTop;var dmenu=this.DimMenu();var wm=dmenu.width;var hm=dmenu.height;if((hm+py-scrolly)>hs){var gy=hs-hm+scrolly-3;if(gy<0){gy=0} this.DOM().style.top=gy+"px";} if((wm+px-scrollx)>ws){var gx=ws-wm+scrollx-3;if(gx<0){gx=0} this.DOM().style.left=gx+"px";}},DimViewport:function(){var w=0 var h=0;if(typeof(window.innerWidth)=='number'){w=window.innerWidth;h=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){w=document.documentElement.clientWidth;h=document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){w=document.body.clientWidth;h=document.body.clientHeight;} var o=[];o.width=w;o.height=h;return o;},DimMenu:function(){var o=this.DOM() var w=0 var h=0;if(typeof(o.innerWidth)=='number'){w=o.innerWidth;h=o.innerHeight;}else if(o.clientWidth||o.clientHeight){w=o.clientWidth;h=o.clientHeight;} var o=[];o.width=w;o.height=h;return o;},suggest:function(id,word,reason,caller){var Lang=[livespell.spellingProviders[this.providerID].Language] livespell.cache.suggestionrequest={};if(livespell.cache.suggestions[Lang]&&livespell.cache.suggestions[Lang][word]){return livespell.context.showMenu(id,word,reason,this.providerID);} livespell.cache.suggestionrequest.id=id;livespell.cache.suggestionrequest.word=word;livespell.cache.suggestionrequest.reason=reason;livespell.cache.suggestionrequest.providerID=this.providerID;livespell.ajax.send("CTXSUGGEST",word,Lang,livespell.cache.langs.length?"":"ADDLANGS",this.providerID);}} function setup___livespell(){var tags=document.getElementsByTagName('script');var foundTag=null;for(var i=tags.length-1;i>=0&&!foundTag;i--){var thisTag=tags[i];try{if(thisTag.getAttribute("src").toLowerCase().indexOf("include.js")>-1&&(thisTag.getAttribute("src").toLowerCase().indexOf("aspnetspell")>-1||thisTag.getAttribute("src").toLowerCase().indexOf("spellcheck/")>-1)){foundTag=thisTag;}}catch(e){}} for(var i=tags.length-1;i>=0&&!foundTag;i--){var thisTag=tags[i];try{if(thisTag.getAttribute("src").toLowerCase().indexOf("include.js")>-1){foundTag=thisTag;}}catch(e){}} if(!foundTag){foundTag=tags[tags.length-1];;} if(typeof(window['livespell___installPath'])!="undefined"){path=livespell___installPath}else{try{var path=foundTag.getAttribute("src").replace(/[\/]?include\.js/ig,"")+"/";}catch(e){alert("SpellCheck include.js file not found:\n\n Try setting livespell___installPath = '/MySpellCheckIncludePath/'; in your documet header.")};} path=path.split("?")[0] if(path.substring(path.length-1)!=="/"){path+="/";} if(path=="/"){path=""} if(path!="/"&&path!=""&&path&&!livespell.installPath){livespell.installPath=path;livespell.lang.load("en");}else{livespell.lang.load("en");} var inJS=(livespell.installPath.toLowerCase().indexOf("javascriptspellcheck")>-1||(document.location.href+"").toLowerCase().indexOf("javascriptspellcheck")>-1) if(inJS){var fn=function(){livespell.context.renderCss($Spelling.Theme);} livespell.events.add(window,"load",fn,false);} if(livespell.test.IE5()||livespell.test.IE6()||livespell.test.IE7()||livespell.test.IE8()){setInterval(livespell.heartbeat,800)}else{setInterval(livespell.heartbeat,300)} if(!window.getComputedStyle){document.write("\nsub document_oncontextmenu() \n on error resume next \ndim Oelement \n Set Oelement = window.event.srcElement \n IF( (Oelement.className="livespell_redwiggle" OR Oelement.className="livespell_greenwiggle")) THEN \n window.event.returnValue = false \n window.event.cancelBubble = true\n END IF \n end sub\n ");} if(livespell.test.MAC()){livespell.events.add(document,"keydown",livespell.context.mackeydown,false) livespell.events.add(document,"keyup",livespell.context.mackeyup,false)}} function livespell___FF__clickmanager(e){if(e.which&&e.which==3){var t=(e.originalTarget);try{if(t&&t.className&&(t.className=="livespell_redwiggle"||t.className=="livespell_greenwiggle")){e.preventDefault();}}catch(e){} try{t=(e.target);if(t&&t.className&&(t.className=="livespell_redwiggle"||t.className=="livespell_greenwiggle")){e.preventDefault();}}catch(e){}}} if(document.addEventListener&&navigator&&navigator.userAgent.toUpperCase().indexOf("WINDOWS")>0){if(document.addEventListener){document.addEventListener('click',livespell___FF__clickmanager,true);}} setup___livespell();} if(typeof(jQuery)!="undefined"){(function($){$.fn.binSpellCheckFields=function(options){var options=$.extend(livespell$defaults,options);livespell$set(options);var fields=[] this.each(function(){fields[fields.length]=this;});return $Spelling.BinSpellCheckFields(fields);};$.fn.spellAsYouType=function(options){var options=$.extend(livespell$defaults,options);livespell$set(options);var fields=[] this.each(function(){fields[fields.length]=this;});return $Spelling.SpellCheckAsYouType(fields);};$.fn.spellCheckInDialog=function(options){var options=$.extend(livespell$defaults,options);livespell$set(options);var fields=[] this.each(function(){fields[fields.length]=this;});return $Spelling.SpellCheckInWindow(fields);};var livespell$set=function(options){var map=livespell$defaults_map;var alt=livespell$defaults_alt;for(var i=0;i