var swear_words_arr=new Array(" fuck "," cunt "," bastard "," twat "," fanny "," dickhead "," testicle "," vagina "," knob "," arse "," buttock "," shag "," bollok "," bollock "," bolok "," fuc "," fuk "," bolllok "," boloc "," bolock "," twatt "," arrse "," kunt "," cunnt "," fany "," dyke "," lesbo "," poof "," homo "," hommo "," prick "," prik "," dick "," wank "," wanker "," fukk ", " tit "," prik "," boob "," fud "," fudd "," ringpiece "," ring "," boobs "," breasts "," breast "," fucks "," bollocks "," motherfucker "," mutherfucker "," motherfukker "," mutherfukker "," growler "," testicles "," vaginas "," scrotum "," shit "," shite "," turd "," faeces "," faecees "," rectum "," rectums "," ringer "," chutneyferret "," arsebandit "," arsebandits "," gaylord "," poofter "," fucking "," pissed "," piss "," fuckhead "," twathead "," arsehead "," dickhead "," dickheed "," wankhead "," carpetmuncher "," wankster "," fuckster "," fuckarooney "," fuckme "," anal "," annal "," minge "," muffdive "," muffdiver "," masturbates "," stroker "," stroking "," wrist "," chuff "," bugger "," bloody "," buggering "," fucking "," cum "," jizz "," spunk ");
var swear_alert_arr=new Array;
var swear_alert_count=0;

function reset_alert_count()
{
 swear_alert_count=0;
}

function validate_user_text()
{
 reset_alert_count();
 var compare_text=document.userfrm1.fldusername.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+=""+ swear_alert_arr[k-1];
 }
 if(swear_alert_count>0)
 {
  alert("Please select an alternative username,\n\nClick OK to return to the form and amend your entry.");
  document.userfrm1.fldusername.select();
 }
 else
 {
  //sndUserCheck(document.userfrm1.fldusername.value)
 }
}

