var lingREADER=new Object();lingREADER.count=0;lingREADER.onOff=true;lingREADER.fromID=-1;lingREADER.lastToID=-1;lingREADER.TAB_WEBSITE=0;lingREADER.TAB_TEXT=1;lingREADER.currentTab=-1;lingREADER.setTabSelected=function(F,B,A,E){var C=xGetElementById(F);var D=C.rows[0];if(A==E){showElement(B);D.cells[0].className="tabInnerLeftSelected";D.cells[1].className="tabInnerMiddleSelected padLeft10 padRight10 header12 nowrap";D.cells[2].className="tabInnerRightSelected"}else{D.cells[0].className="tabInnerLeftUnselected";D.cells[1].className="tabInnerMiddleUnselected padLeft10 padRight10 header12 nowrap brown";D.cells[2].className="tabInnerRightUnselected"}};lingREADER.selectTab=function(A){if(A!=lingREADER.currentTab){hideElement("tblWebSite");hideElement("tblText");lingREADER.setTabSelected("tblTabWebSite","tblWebSite",lingREADER.TAB_WEBSITE,A);lingREADER.setTabSelected("tblTabText","tblText",lingREADER.TAB_TEXT,A);switch(A){case lingREADER.TAB_WEBSITE:break;case lingREADER.TAB_TEXT:break}lingREADER.currentTab=A}};lingREADER.doInterval=function(){lingREADER.count=(lingREADER.count+1)%10;if(lingREADER.count==0){lingREADER.onOff=!lingREADER.onOff;lingREADER.count++}var A=document.getElementById("block"+lingREADER.count);if(A!=null){A.src=lingREADER.onOff?(Math.random()<0.075?"img/fuchsia.gif":"img/blue.gif"):"img/ffffff.gif"}else{lingREADER.count=0}};lingREADER.setText=function(){var A=trim(xGetElementById("txtText").value);xGetElementById("hdnUrl").value=A;if(A.length==0){alert(lingRESOURCES.write("Reader.alert_pasteText","Please paste a block of text into the box to the left!"));return false}};lingREADER.setUrl=function(){var A=trim(xGetElementById("txtUrl").value);xGetElementById("hdnUrl").value=A;if(A=="http://"){alert(lingRESOURCES.write("Reader.alert_enterUrl","Please enter a website address into the box to the left!"));return false}};lingREADER.doOnAnalyze=function(){var A=trim(xGetElementById("hdnUrl").value);if(A=="http://"||A.length==0){lingREADER.setUrl();A=trim(xGetElementById("hdnUrl").value)}if(A=="http://"||A.length==0){alert(lingRESOURCES.write("Reader.alert_enterTextOrUrl","You must enter either a website address or a block of text!"));return false}xGetElementById("lblUrl").innerHTML=strWS(A.length>200?A.substr(0,200)+"...":A);hideElement("divForm");showElement("divProgress");lingREADER.intervalID=setInterval(lingREADER.doInterval,100);return true};lingREADER.doDecode=function(C){var B=lingUTIL.getSelectValue("mnuFromLangID");var A=lingUTIL.getSelectValue("mnuToLangID");location.href="ReaderProgress.do?url="+encodeUTF8(C)+"&fromID="+B+"&toID="+A};lingREADER.doDecodeEnglish=function(C){var B=lingUTIL.getSelectValue("mnuFromLangID");var A=lingUTIL.getSelectValue("mnuToLangID");location.href="ReaderProgress.do?url="+encodeUTF8(C)+"&fromID="+B+"&toID="+A+"&english=true"};lingREADER.onload=function(){if(lingREADER.currentTab<0){lingREADER.selectTab(lingREADER.TAB_WEBSITE)}};lingREADER.unload=function(){if(lingREADER.intervalID){clearInterval(lingREADER.intervalID)}showElement("divForm");hideElement("divProgress")};lingREADER.onChangeToLang=function(){var A=parseInt(lingUTIL.getSelectValue("mnuToLangID"));xGetElementById("linksEnglishTitle").innerHTML=lingRESOURCES.write("Reader.allQuick","All Quick Links (with definitions shown in {0})",false,[lingLANG.print(A)])};lingREADER.onChangeFromLang=function(){var B=lingCOMMON.doOnChangeLanguage("mnuFromLangID",true);var A=parseInt(lingUTIL.getSelectValue("mnuToLangID"));if(xGetElementById("quick"+B)){showElement("quick"+B);showElement("trQuick");xGetElementById("tdUrl").innerHTML=lingRESOURCES.write("Reader.urlOr","OR, enter a(n) {0} website address:",false,[lingLANG.print(B)])}else{hideElement("trQuick");xGetElementById("tdUrl").innerHTML=lingRESOURCES.write("Reader.url","Enter a(n) {0} website address:",false,[lingLANG.print(B)])}xGetElementById("divText").innerHTML=lingRESOURCES.write("Reader.textOr","OR, paste {0} text into this box:",false,[lingLANG.print(B)]);if(B!=lingLANG.ENGLISH){lingREADER.lastToID=A;lingUTIL.setSelectValue("mnuToLangID",lingLANG.ENGLISH);A=lingLANG.ENGLISH}else{if(lingREADER.lastToID>=0){lingUTIL.setSelectValue("mnuToLangID",lingREADER.lastToID);A=lingREADER.lastToID}lingREADER.lastToID=-1}if(B>=0&&xGetElementById("quick"+lingREADER.fromID)){hideElement("quick"+lingREADER.fromID)}lingREADER.fromID=B;setVisibility("links",B!=lingLANG.ENGLISH);xGetElementById("linksEnglishTitle").innerHTML=lingRESOURCES.write("Reader.allQuick","All Quick Links (with definitions shown in {0})",false,[lingLANG.print(A)]);setVisibility("linksEnglish",B==lingLANG.ENGLISH);xGetElementById("txtText").className=lingLANG.getLanguage(B).isRtol?"text13 rtl":"text13 ltr"};