// routines for scanning text boxes for dirty words
// this script must be in a separate file to avoid spiders finding the dirty words
function scanDirty() {
// array of dirty words to search for between blanks and punctuation, any case:
var nastyWords = new Array(109);
nastyWords[0] = "shit";
nastyWords[1] = "fuck";
nastyWords[2] = "piss";
nastyWords[3] = "screw";
nastyWords[4] = "boink";
nastyWords[5] = "fart";
nastyWords[6] = "asshole";
nastyWords[7] = "rectum";
nastyWords[8] = "cunt";
nastyWords[9] = "tit";
nastyWords[10] = "breast";
nastyWords[11] = "vagina";
nastyWords[12] = "suck";
nastyWords[13] = "penis";
nastyWords[14] = "pecker";
nastyWords[15] = "cum";
nastyWords[16] = "sperm";
nastyWords[17] = "jism";
nastyWords[18] = "jerkoff";
nastyWords[19] = "masturbate";
nastyWords[20] = "jerk-off";
nastyWords[21] = "jizm";
nastyWords[22] = "smegma";
nastyWords[23] = "boff";
nastyWords[24] = "pee";
nastyWords[25] = "butt";
nastyWords[26] = "ass";
nastyWords[27] = "pussy";
nastyWords[28] = "snatch";
nastyWords[29] = "bugger";
nastyWords[30] = "lick";
nastyWords[31] = "blowjob";
nastyWords[32] = "blow-job";
nastyWords[33] = "handjob";
nastyWords[34] = "hand-job";
nastyWords[35] = "rape";
nastyWords[36] = "kiss";
nastyWords[37] = "fondle";
nastyWords[38] = "dork";
nastyWords[39] = "balls";
nastyWords[40] = "testicles";
nastyWords[41] = "scrotum";
nastyWords[42] = "sodomy";
nastyWords[43] = "sodomize";
nastyWords[44] = "masturbation";
nastyWords[46] = "masturbating";
nastyWords[47] = "fellatio";
nastyWords[48] = "sex";
nastyWords[49] = "oral";
nastyWords[50] = "anal";
nastyWords[51] = "anally";
nastyWords[52] = "orally";
nastyWords[53] = "sexy";
nastyWords[54] = "sexiest";
nastyWords[55] = "sexyer";
nastyWords[56] = "sexy";
nastyWords[57] = "fucking";
nastyWords[58] = "fucker";
nastyWords[59] = "prick";
nastyWords[60] = "prik";
nastyWords[61] = "seks";
nastyWords[62] = "motherfucker";
nastyWords[63] = "fag";
nastyWords[64] = "fudgepacker";
nastyWords[65] = "nigger";
nastyWords[66] = "jewboy";
nastyWords[67] = "kike";
nastyWords[68] = "towelhead";
nastyWords[69] = "towel-head";
nastyWords[70] = "jap";
nastyWords[71] = "chink";
nastyWords[72] = "frog";
nastyWords[73] = "bazooms";
nastyWords[74] = "dickhead";
nastyWords[75] = "dick-head";
nastyWords[76] = "dickbreath";
nastyWords[77] = "dick-breath";
nastyWords[78] = "dickface";
nastyWords[79] = "dick-face";
nastyWords[80] = "cuntface";
nastyWords[81] = "cunt-face";
nastyWords[82] = "clitoris";
nastyWords[83] = "clit";
nastyWords[84] = "lips";
nastyWords[85] = "give me head";
nastyWords[86] = "horny";
nastyWords[87] = "hell";
nastyWords[88] = "damn";
nastyWords[89] = "give head";
nastyWords[90] = "gives head";
nastyWords[91] = "bitch";
nastyWords[92] = "dammit";
nastyWords[93] = "get laid";
nastyWords[94] = "damn";
nastyWords[95] = "damned";
nastyWords[96] = "dammed";
nastyWords[97] = "shitty";
nastyWords[98] = "smoke pot";
nastyWords[99] = "smoke hash";
nastyWords[100] = "shitass";
nastyWords[101] = "boobs";
nastyWords[102] = "titties";
nastyWords[103] = "t&a";
nastyWords[104] = "t & a";
nastyWords[105] = "t and a";
nastyWords[106] = "child porn";
nastyWords[107] = "kid porn";
nastyWords[108] = "kiddie porn";


// array of letter patterns to search for in any word, any case:
var nastyParts = new Array(39);
nastyParts[0] = "shit";
nastyParts[1] = "fuck";
nastyParts[2] = "boink";
nastyParts[3] = "rectum";
nastyParts[4] = "cunt";
nastyParts[5] = "vagina";
nastyParts[6] = "suck";
nastyParts[7] = "penis";
nastyParts[8] = "sperm";
nastyParts[9] = "jism";
nastyParts[10] = "jerkoff";
nastyParts[11] = "masturbat";
nastyParts[12] = "jerk-off";
nastyParts[13] = "jizm";
nastyParts[14] = "smegma";
nastyParts[15] = "boff";
nastyParts[16] = "bugger";
nastyParts[17] = "blowjob";
nastyParts[18] = "blow-job";
nastyParts[19] = "handjob";
nastyParts[20] = "hand-job";
nastyParts[21] = "fondle";
nastyParts[22] = "testicle";
nastyParts[23] = "scrotum";
nastyParts[24] = "sodom";
nastyParts[25] = "nigger";
nastyParts[26] = "fellatio";
nastyParts[27] = "kike";
nastyParts[28] = "motherfucker";
nastyParts[29] = "bastard";
nastyParts[30] = "nymphet";
nastyParts[31] = "porn";
nastyParts[32] = "naked";
nastyParts[33] = "<a";
nastyParts[34] = "href=";
nastyParts[35] = "www.";
nastyParts[36] = "http://";
nastyParts[37] = "http";
nastyParts[38] = "</a>";

// array of letter patterns to search for alone but case sensitive
var nastyCase = new Array(2);
nastyCase[0] = "dick";
nastyCase[0] = "DICK";

var regexp = new RegExp()  // empty regular expression object
var form = window.document.frmRequest;
var stringToCheck = " ";
var wordToMatch = " ";

// delete whole dirty words
for (j = 0; j < form.elements.length; j++) {
	
	if (form.elements[j].type == "text" || form.elements[j].type == "textarea") {
		stringToCheck = form.elements[j].value;
		for (i = 0; i < nastyWords.length; i++) {
			wordToMatch = nastyWords[i];
			regexp.compile("\\b" + wordToMatch + "\\b", "gi");//build up the reg exp
			stringToCheck = stringToCheck.replace(regexp, "");
		}
		// replace nastyParts here
		for (k = 0; k < nastyParts.length; k++) {
			wordToMatch = nastyParts[k];
			regexp.compile(wordToMatch, "gi");//build up the reg exp: any part of any word
			stringToCheck = stringToCheck.replace(regexp, "");
		}
		// replace case sensitive nastyWords here
		for (p = 0; p < nastyCase.length; p++) {
			wordToMatch = nastyCase[p];
			regexp.compile("\\b" + wordToMatch + "\\b", "g");//build up the reg exp, case sensitive
			stringToCheck = stringToCheck.replace(regexp, "");
		}
		form.elements[j].value = stringToCheck;
	}
} // end of looping through the form elements of type text.
//alert("form submitted");
//form.submit();
} // end of scanDirty();

