


		function ActivSpellClass() {
			this.init();	
		}

		ActivSpellClass.prototype = new Object();
		ActivSpellClass.prototype.init = function() {
			this.argsIndex = -1;
			this.fieldRefs = new Array();
			this.ignore = new Array();
			this.change = new Array();
			this.changeto = new Array();
			this.replacements = new Array();
		}
		
		ActivSpell = new ActivSpellClass();
		
		function nextField() {

		}

        function spell2( finishListener, fieldRefs )
        {
            ActivSpell.init();
            ActivSpell.fieldRefs = fieldRefs;

            //override nextField since registering onpropertychange fires itself
            nextField = function() {
                ActivSpell.argsIndex++;
                ActivSpell.replacements = new Array();
                if(ActivSpell.argsIndex < ActivSpell.fieldRefs.length) {

                    ActivSpellWin = window.open("/docroot/spellchecker/window.jsp?jsvar=" + ActivSpell.fieldRefs[ActivSpell.argsIndex], "ActivSpellWin", "height=300,width=500,status=no,toolbar=no,menubar=no,location=no");
                    } else {
                        spellCheckComplete();
                    }
            }

            //index ActivSpell.argsIndex
            ActivSpell.argsIndex++;

            //send the first field to spellcheck
            ActivSpellWin = window.open("/docroot/spellchecker/window.jsp?jsvar=" + ActivSpell.fieldRefs[0], "ActivSpellWin", "height=300,width=500,status=no,toolbar=no,menubar=no,location=no");
            ActivSpellWinFinishListener = finishListener;
        }

		function spell() 
		{	
			ActivSpell.init();
			ActivSpell.fieldRefs = arguments;
			
			//override nextField since registering onpropertychange fires itself
			nextField = function() {
				ActivSpell.argsIndex++;
				ActivSpell.replacements = new Array();
				if(ActivSpell.argsIndex < ActivSpell.fieldRefs.length) {
					
					ActivSpellWin = window.open("/docroot/spellchecker/window.jsp?jsvar=" + ActivSpell.fieldRefs[ActivSpell.argsIndex], "ActivSpellWin", "height=300,width=500,status=no,toolbar=no,menubar=no,location=no");
					} else {
						spellCheckComplete();
					}
			}
			
			//index ActivSpell.argsIndex
			ActivSpell.argsIndex++;
			
			//send the first field to spellcheck
			ActivSpellWin = window.open("/docroot/spellchecker/window.jsp?jsvar=" + ActivSpell.fieldRefs[0], "ActivSpellWin", "height=300,width=500,status=no,toolbar=no,menubar=no,location=no");
            ActivSpellWinFinishListener = null;
		}
		
		function spellCheckComplete() {
			alert("Rechtschreibprüfung abgeschlossen!");
			
			ActivSpell.argsIndex = -1;
			nextField = function() {}
			ActivSpellWin.close();
            if( ActivSpellWinFinishListener != null ) {
                ActivSpellWinFinishListener();
            }
		}
