<!--
        /* Param field: text input or textarea element object
           Param output: id of div to place output
           Param max: maximum number of words allowed in field */
        function wordCounter(field, output, max){
            var words = field.value.split(' ').length;
            var repl_html = "(You have used " + words + " of " + max + " words.)";
            if(document.getElementById){
                var outp = document.getElementById(output);
                if(outp){
                    if(outp.childNodes[0])
                        outp.childNodes[0].nodeValue=repl_html;
                    else if (outp.value)
                        outp.value=repl_html;
                    else
                        outp.innerHTML=repl_html;
                }
            }
            if(words > max)
                field.value = field.value.substring(0, field.value.length-1);
        }

//-->