function CheckAll(form){ form = document.dataform for (i = 6; i < form.elements.length; i++) // FIRST WORD IS SIX, OTHERS ARE BUTTONS INCLUDING PRINT // THIS WOULD CHANGE WITH MORE BUTTONS {form.elements[i].checked=true;}// found this with alert (i) } function CheckNone(form){ form = document.dataform for (i = 6; i < form.elements.length; i++) {form.elements[i].checked=false} } function getUniqueRandom () { form = document.dataform; var number = form.elements.length-1; var numberlist = new Array(); for (count = 0; count <= number; count++) { numberlist[count] = count; } this.randomlist = new Array(); for (count = numberlist.length-1; count > 0; count--) //SIX OF THE ELEMENTS ARE NOT CHECKBOXES { picked = Math.floor(Math.random()*count)+1; this.randomlist[count-1] = numberlist[picked]; numberlist[picked] = numberlist[count]; } return randomlist; } function CheckAnyTwenty(form){ CheckNone(form); getUniqueRandom(); //alert (randomlist); form = document.dataform; for (i = 0; i <20; i++){ var x=randomlist[i]; if (form.elements[x]){form.elements[x].checked=true;} }} function CheckTopTen(form){ form = document.dataform; CheckNone(form); for (i = 7; i < 18; i++) //// FIRST WORD IS SIX, OTHERS ARE BUTTONS INCLUDING PRINT //// THIS WOULD CHANGE WITH MORE BUTTONS { if (form.elements[i]){form.elements[i].checked=true;} } } //THIS IS GOOD ORIGINAL OK, JUST GETS US TOO MANY //function CheckAll(form){ //form = document.dataform //for (i = 6; i < form.elements.length; i++) //// FIRST WORD IS SIX, OTHERS ARE BUTTONS INCLUDING PRINT //// THIS WOULD CHANGE WITH MORE BUTTONS // {form.elements[i].checked=true;}// found this with alert (i) //} function CheckNone(form){ form = document.dataform for (i = 6; i < form.elements.length; i++) {form.elements[i].checked=false} } function display() { if (document.getSelection) { var str = document.getSelection(); } else if (document.selection && document.selection.createRange) { var range = document.selection.createRange(); var str = range.text; } else { var str = "Sorry, this is not possible with your browser."; } if (str !== ""){ if (CanTalk) SpeechPlugin.Speak(str); str=""; document.selection.empty(); }else {return false}; } if (window.document.Event) //<"+wd+"")} var is_done2 = form.example.value.indexOf(' -1) { form.example.value = form.example.value.replace(wd,bigwd) } form.example.value = form.example.value.replace('xxx',wd) // Now put back original form.example.value = form.example.value.replace(wd,""+wd+"") } } function preview () { alert ('Word:\t\t' + document.lexis.word.value +'\n\nExample:\t\t' + document.lexis.example.value +'\n\nClass:\t\t' + document.lexis.part_of_speech.value +'\n\nDefinition:\t' + document.lexis.definition.value +'\n\nName:\t\t' + document.lexis.student_name.value ) } function AreAnyChecked() { form = document.dataform var num=0 var holder="" for (i = 6; i < form.elements.length; i++) { if (form.elements[i].checked==true) {num++} } if (num<5) { // num checks + (3x2 buttons) if (num==1) {holder="item"} else {holder="items"} alert ("Only " + (num) +" "+ holder + " checked. \n\n Quiz needs five items minimum" ) //num=0 return false } } function AreAnyChecked_2() { form = document.dataform var num=0 var holder="" for (i = 0; i < form.elements.length; i++) { if (form.elements[i].checked==true) {num++} } if (num<5) { // num checks + (3x2 buttons) if (num==1) {holder="item"} else {holder="items"} alert ("Only " + (num) +" "+ holder + " checked. \n\n Quiz needs five items minimum" ) //num=0 return false } } function CheckAll_2(form){ //FOR QUIZ 2 form = document.dataform for (i = 0; i < form.elements.length; i++) {form.elements[i].checked=true;}// found this with alert (i) } function CheckNone_2(form){ form = document.dataform for (i = 0; i < form.elements.length; i++) {form.elements[i].checked=false} } // TRIAL: REPLACE WITH PHRASE CAPTURE //function sayit() { //var oSource = window.event.srcElement; //var parent=oSource.parentTextEdit; //if(parent!=null){ //var txtRnge=parent.createTextRange(); //txtRnge.moveToPoint(event.x, event.y); //txtRnge.collapse(); // txtRnge.expand("word"); //txtRnge.select(); //var s=txtRnge.text; ////alert(s); //if(s!=""){ //if (CanTalk) SpeechPlugin.Speak(s); //} //} //} function IsSpeechPluginInstalled() { if (navigator.appName == 'Netscape') { if (navigator.plugins["SpeechPlugin"]) return (1); else return (0); } else if (navigator.appName == "Microsoft Internet Explorer") { return CheckIEControl(); } } function EmbedIt() { document.write(' ') document.write(' ') } function searchVoice() { EnglishVoice=0 foundVoice=false; var CanTalk=IsSpeechPluginInstalled(); if (CanTalk) { var SpeechPlugin = document.SpeechPluginObj; document.write("This site talks!"); } else { document.write("Click to download SpeechPlugin"); } if(CanTalk) { var num=SpeechPlugin.GetNumOfVoices(); if(num > 1) { for(var i=1;i<=num;i++) { if(SpeechPlugin.GetVoiceLanguageID(i)==9) { EnglishVoice=i; if(SpeechPlugin.GetVoiceDescription(i)=='Mary') { foundVoice=true SpeechPlugin.SetVoice(i); // If the wanted voice was found, we make it be the active voice break; // if the wanted voice was found , there is no need to search any more } } } } if (foundVoice==false) { if (EnglishVoice>0) {SpeechPlugin.SetVoice(EnglishVoice);} else {alert("please download an English TTS engine")} } SpeechPlugin.Speak("the active voice is"+SpeechPlugin.GetVoiceDescription(SpeechPlugin.GetVoice())) document.write("
The active voice is :"+SpeechPlugin.GetVoiceDescription(SpeechPlugin.GetVoice())+"
") } }