
// Enter the words to be filtered in the line below:
var swear_words_arr=new Array("fuck","asshole","faggot","penis","vagina","cunt","nigger","masturbate","queer","dyke","sperm","jackoff","pussy");

var swear_alert_arr=new Array;
var swear_alert_count=0;
function reset_alert_count()
{
 swear_alert_count=0;
}
function validate_user_text()
{
returnValue = false;

 reset_alert_count();
 var compare_text=window.document.forms[0].CW_News_Comment.value;
 for(var i=0; i<swear_words_arr.length; i++)
 {
  for(var j=0; j<(compare_text.length); j++)
  {
   if(swear_words_arr[i]==compare_text.substring(j,(j+swear_words_arr[i].length)).toLowerCase())
   {
    swear_alert_arr[swear_alert_count]=compare_text.substring(j,(j+swear_words_arr[i].length));
    swear_alert_count++;
   }
  }
 }
 var alert_text="";
 for(var k=1; k<=swear_alert_count; k++)
 {
  alert_text+="\n" + "(" + k + ")  " + swear_alert_arr[k-1];
 }
 if(swear_alert_count>0)
 {
  alert("The form cannot be submitted.\nThe following illegal words were found:\n_______________________________\n" + alert_text + "\n_______________________________");
  window.document.forms[0].CW_News_Comment.select();
 }
 else
 {
  returnValue = true;
 }

return returnValue;
}

function select_area()
{
 window.document.forms[0].CW_News_Comment.select();
}

window.onload=reset_alert_count;


