function count_words(textbox, limit, strict) {
var textbox_target = document.getElementById(textbox + '_COUNT');

var textcolor = "#009900";
var limittext = "";
if (limit > 0) { limittext = "/"+limit; }

var y=$F(textbox);
var r = 0;
a=y.replace(/\s/g,' ');
a=a.split(' ');
for (z=0; z<a.length; z++) {if (a[z].length > 0) r++;}

if (limit > 0 && (r > limit + 10 || r < limit - 10) && strict) { textcolor = "#FF0000"; }
if (limit > 0 && (r < limit) && !strict) { textcolor = "#FF0000"; }

if (textcolor == "#FF0000") { fontweight = "bold"; } else { fontweight = "normal"; }

textbox_target.innerHTML="<span class='fineprint' style='font-weight: "+fontweight+"; color:"+textcolor+"'>"+r+limittext+" words</span>";
} // end function
