var tlang=5;									// language to translate bottom text to
var maintext="The 'Reload Text' button loads the default text--which right now, is this message. ";	// default text for loading
maintext+="You can change the default to whatever you want by pasting or writing your ";
maintext+="own text here and then clicking on the 'Keep Text' button.  That way you don't ";
maintext+="have to repaste or rewrite it every time you want a new translation of the same text.";

    //	++++++++++++++++++	CONFIGURATION DATA  ABOVE		++++++++++++++++++
    //	++++++++++++++++++	TOP SECTION  BELOW			++++++++++++++++++


function site_trans()
    // operates submission button of top area
	{var url=document.getElementById("urlsite").value;
	tloc="translator.php?site=" + url.replace(/&/g,"~") + "&translation=" + document.getElementById("urllang").value;
	window.open(tloc,'transpage','scrollbars=yes,resizable=yes,toolbar=yes,directories=no,location=yes,menubar=yes,status=yes'); 
	return false; 
	}


    //	++++++++++++++++++	TOP SECTION  ABOVE			++++++++++++++++++
    //	++++++++++++++++++	BOTTOM SECTION  BELOW			++++++++++++++++++


function txt_trans()
    // transaltes bottom text based on current language and text in text area
	{txtin=document.getElementById("txt").value;
	if (txtin.length<2) 
    // if no text, yells at them, otherwises translates
		{var msg="\n\n\t\t\t\tNEWS FLASH, FUCKHEAD:\n\n\nNothing translated into ";
		msg+="another language is still nothing.  You need a fucking computer program ";
		msg+="to tell you that? Make sure there is text in here to translate, before hitting ";
		msg+="the 'Translate' button.\n\nHere's a follow up bulletin:  There's text in here ";
		msg+="now.  So, now you can try translating, dumbass.";
		document.getElementById("txt").value = msg;
		}
	else document.getElementById("txt").value = txt_translation(txtin);
	}
function txt_lang(n) {tlang=n;}
    // changes current language to translate to, to the one passed-n	

function txt_clear()	{document.getElementById("txt").value = "";}
    // clears out text area

function txt_load()	{document.getElementById("txt").value = maintext;}
    // loads saved text into text area

function txt_keep()
    // saves current text in text area if there is some
	{tmp=document.getElementById("txt").value;
	if (tmp.length<2) alert("There's No Text To Save Dipfuck.");
	else 
		{maintext=tmp;
		alert("Text Saved:\n\n" + maintext);
		}
	}
function txt_translation(ret)
    // translates s  based on transalation they want (tlang)
	{switch(tlang)
		{case 1:	ret=tochinese(ret);			break;
		case 2:	ret=totourette(ret, 0);		break;
		case 3:	ret=tocomedian(ret);		break;
		case 4:	ret=topiglatin(ret);			break;
		case 5:	ret=totourette(ret, 1);		break;
		}
	return ret;
	}
function tochinese(s)
    // takes string and converts into chinese
	{pre="Confuscious say, ";
	post=", in bed";
	ret="";
	newparagraph=1;
	for (var i=0; i<s.length; ++i)
    // goes through each character of string
		{ch=s.substring(i, i+1);
		if ((ch=='.') || (ch=='?') || (ch=='!')) 
    // if end of sentence adds 'in bed'
			{if (i==(s.length-1)) ret+=post + ch;
			else
				{nc=s.substring(i+1, i+2);
				if ((nc=='\n') || (nc=='\r') || (nc==' ')) ret+=post + ch;
				else ret+=ch;
				}
			}
		else if ((ch=='\r') || (ch=='\n')) 
    // if return lines are hit, marks it to add 'Confusious says' before next character 
			{ret+=ch;
			newparagraph=1;
			}				
		else if (ch=='<') 
    // if html is in it, marks it to ignore all text until closing tag
			{while ((ch!='>') && (i<(s.length-1))) 
				{ret+=ch;
				++i;
				ch=s.substring(i, i+1);
				}
			if (ch=='>') ret+=ch;
			}
		else 
    // if none of the above, adds character to return string
			{if (newparagraph==1)
    // if new paragraph, shows 'Confucious says' and lowercases next character
				{ret+=pre;
				ch=ch.toLowerCase();
				newparagraph=0;
				}
			ret+=ch;
			}		
		}	 
	return ret;
	}

function subpiglatinword(s)
    // takes a word and converts it to pig latin
	{fc=s.substring(0,1);
	caps=0;
	ret="";
	if (fc==fc.toUpperCase()) caps=1;
	fc=fc.toLowerCase();
	if ((fc=='a') || (fc=='e') || (fc=='i') || (fc=='o') || (fc=='u')) ret=s+"way";
    // starts with a vowel
	else if ((fc=='q') && ((s.substring(1,2)=='u') || (s.substring(1,2)=='U'))) 
    // starts with 'qu' 
		{ret=s.substring(2, 3);
		if (caps==1) ret=ret.toUpperCase();
		ret+=s.substring(3, s.length) + 'quay'; 	
		}
	else 
    // words begins with non- 'q' consonant
		{fv=-1;
		for (i=0; i<s.length; ++i) 
    // finds first instance of a vowel
			{fc=s.substring(i, i+1);
			if (((fc.toLowerCase()=='a') || (fc.toLowerCase()=='e') || (fc.toLowerCase()=='i') || (fc.toLowerCase()=='o') || (fc.toLowerCase()=='u')) && (fv<0)) fv=i;
			}
		if (fv<0) ret=s;
    // if no vowels, returns the word itself
		else
    // compiles all pieces of word based on when vowel is found
			{fc=s.substring(0,1);
			fc=fc.toLowerCase() + s.substring(1, fv) + 'ay';
			ret=s.substring(fv, fv+1);
			if (caps==1) ret=ret.toUpperCase();
			ret+=s.substring(fv+1, s.length) + fc;
			}
		}
	return ret;
	}
function isletter(c)
  // test to see if character is letter
	{var ret=0;
	var alpha="abcdefghijklmnopqrstuvwxyz";
	if (alpha.indexOf(c.toLowerCase())>=0) ret=1;
	return ret;
	}
function topiglatin(s)
    // handles pig latin translation, applies pig latin rules to all words	
	{ret="";
	i=0;
	while (i<s.length)
		{cc=s.substring(i, i+1);
		if (cc=='<')
    // if html tag is encountered, ignores until closing tag
			{ret+=cc;
			j=i;
			while ((cc!='>') && (j<s.length)) 
				{++j;
				cc=s.substring(j, j+1);
				ret+=cc;
				}
			}
		else if (isletter(cc)==1)
    // if finds beginning of word, finds end of it and submits it to be converted
			{j=i+1;
			cc=s.substring(j, j+1);
			while ((isletter(cc)==1) && (j<s.length))
				{++j;
				cc=s.substring(j, j+1);
				}
			ret+=subpiglatinword(s.substring(i,j));
			--j;
			}
		else 
    // if next character is not a letter, just spits it out
			{ret+=cc;
			j=i;
			}
		i=j+1;		
		}
	return ret;
	}
function subcomedian(n)
    // returns random hack phrase depending on location it will be inserted into 0-intro 1-body 2-closing
	{ret="";
	r=Math.round(Math.random()*12679);
	switch (n)
		{case 0:	i=r%3;		break;
		case 1:	i=r%19;		break;
		case 2:	i=(r%3) + 18;	break;
		}
	r=Math.round(Math.random()*7);
	if ((n>0) && (r==1))  i=18;
    // sets what hack phrase to return, weights 'whats up with that' to show up more	
	switch (i)
		{case 0: ret="But seriously folks..."; 							break;
		case 1: ret="Stop me if you have heard this one before..."; 					break;
		case 2: ret="So, I just broke up with my girlfriend...";					break;
    // above are intro lines
		case 3: ret="How about some applause for your servers?"; 				break;
		case 4: ret="There any pot smokers reading the page today? Where ya at, let me hear you?"; 	break;
		case 5: ret="Hey, you're a great audience, give yourselves some applause for reading this."; 	break;
		case 6: ret="Anyone want to read a top ten list?"; 					break;
		case 7: ret="Keep drinking folks, the more you drink the funnier this page gets."; 		break;
		case 8: ret="I love ya, but you all white folks be motherfucking craaazzzy."; 			break;
		case 9: ret="True story, I am not making this up, it actually happened."; 			break;
		case 10: ret="Ever wonder what it would be like if Arnold Schwarznegger was gay?";		break;
		case 11: ret="Now, I am not a racist, but I noticed something about black people..."; 		break;
		case 12: ret="Now, I am not sexist, but I noticed something about women...";			break;
		case 13: ret="Now, I am not homophobic, but I noticed something about gays..."; 		break;
		case 14: ret="Man, you just know they smoked pot on Scooby Doo. Am I right?"; 		break;
		case 15: ret="Tell me I am not the only one who notices this whacky stuff."; 			break;
		case 16: ret="Anybody here from Arkansas? Good, lets talk about those fuckers."; 		break;
		case 17: ret="You guys like impressions?"; 						break;
		case 18: ret="Whats up with that?"; 							break;
    // below are exit lines
		case 19: ret="Thanks, that's my time.  Peace I am out."; 					break;
		case 20: ret="I'll be here all week, try the Beef Wellington."; 					break;
		}
	return ret;
	}

function tocomedian(s)
    // takes string and converts into chinese
	{ret="";
	newparagraph=1;
	for (var i=0; i<s.length; ++i)
    // goes through each character of string
		{ch=s.substring(i, i+1);
		if ((ch=='.') || (ch=='?') || (ch=='!')) 
    // if end of sentence adds statement
			{if (i==(s.length-1)) ret+=ch + " " + subcomedian(2);
			else
				{nc=s.substring(i+1, i+2);
				if ((nc=='\n') || (nc=='\r') || (nc==' ')) 
					{showit=Math.round(Math.random()*3);
					ret+=ch;
					if (showit==1) ret+=" " + subcomedian(1);
					}
				else ret+=ch;
				}
			}
		else if ((ch=='\r') || (ch=='\n')) 
    // if return lines are hit, marks it to add 'Confusious says' before next character 
			{ret+=ch;
			newparagraph=1;
			}				
		else if (ch=='<') 
    // if html is in it, marks it to ignore all text until closing tag
			{while ((ch!='>') && (i<(s.length-1))) 
				{ret+=ch;
				++i;
				ch=s.substring(i, i+1);
				}
			if (ch=='>') ret+=ch;
			}
		else 
    // if none of the above, adds character to return string
			{if (newparagraph==1)
    // if new paragraph, shows 'Confucious says' and lowercases next character
				{ret+=subcomedian(0);
				newparagraph=0;
				}
			ret+=ch;
			}		
		}	
	return ret;
	}
function wordlist_dirtysuffix(sbase)
    // returns a suffix to add to a dirty word, takes that word to make sure it doesn't repeat it 
	{dsw=sbase;
	for (dsn=0; dsn<5; ++dsn) if (dsw==sbase) switch (Math.round(Math.random()*18) + dsn)
    // looks 5 times for a word until it finds one that doesn't match the root
		{case 0:	dsw="FUCK";			break;
		case 1:	dsw="WART";			break;
		case 2:	dsw="NUGGET";			break;
		case 3:	dsw="ASS";			break;
		case 4:	dsw="HOLE";			break;
		case 5:	dsw="FELCHER";			break;
		case 6:	dsw="EATER";			break;
		case 7:	dsw="SUCKER";			break;
		case 8:	dsw="FUCKER";			break;
		case 9:	dsw="BREATH";			break;
		case 10:	dsw="LICKER";			break;
		case 11:	dsw="FACE";			break;
		case 12:	dsw="BUTT";			break;
		case 13:	dsw="SLUT";			break;
		case 14:	dsw="SHIT";			break;
		case 15:	dsw="DICK";			break;
		case 16:	dsw="CUNT";			break;
		case 17: 	dsw="FAGGOT";			break;
		case 18:	dsw="PUSSY";			break;
		}
	return dsw;
	}
function wordlist_dirtyprefix(pbase)
    // returns a prefix to add to a dirty word, takes that word to make sure it doesn't repeat it 
	{dpq=pbase;
	for (dpn=0; dpn<5; ++dpn) if (dpq==pbase) switch (Math.round(Math.random()*13) + dpn)
    // looks 5 times for a word until it finds one that doesn't match the root
		{case 1:	dpq="SNATCH";			break;
		case 2:	dpq="FAGGOT";			break;
		case 3:	dpq="ASS";			break;
		case 4:	dpq="PUSSY";			break;
		case 5:	dpq="DICK";			break;
		case 6:	dpq="COCK";			break;
		case 7:	dpq="BITCH";			break;
		case 8:	dpq="BASTARD";			break;
		case 9:	dpq="CUNT";			break;
		case 10:	dpq="BUTT";			break;
		case 11:	dpq="SLUT";			break;
		case 12:	dpq="SHIT";			break;
		}
	return dpq;
	}

function wordlist_adjective()
    // returns random adjective
	{ret="NASTY";
	switch (Math.round(Math.random()*28))
		{case 1:	ret="WARTY";			break;
		case 2:	ret="FILTHY";			break;
		case 3:	ret="STUPID";			break;
		case 4:	ret="DUMB";			break;
		case 5:	ret="RETARDED";			break;
		case 6:	ret="SKANKY";			break;
		case 7:	ret="RAGGEDY";			break;
		case 8:	ret="TWO-BIT";			break;
		case 9:	ret="CHEAP";			break;
		case 10:	ret="GUTTER";			break;
		case 11:	ret="STRETCHED-OUT";		break;
		case 12:	ret="STRUNG-OUT";		break;
		case 13:	ret="WORTHLESS";			break;
		case 14:	ret="FAT";			break;
		case 15:	ret="DIRTY";			break;
		case 16: 	ret="FUCKING"; 			break;
		case 17: 	ret="SHITTING"; 			break;
		case 18: 	ret="SHITFIRE"; 			break;
		case 19: 	ret="FUCKING"; 			break;
		case 20: 	ret="JIZZNUTS"; 			break;
		case 21: 	ret="JACKOFF"; 			break;
		case 22: 	ret="DOUCHEBAG"; 		break;
		case 23: 	ret="BLOWJOB"; 			break;
		case 24: 	ret="DIARRHEA"; 			break;
		case 25: 	ret="SHIT-EATING"; 		break;
		case 26: 	ret="MOTHERFUCKER"; 		break;
		case 27: 	ret="MOTHERFUCKING"; 		break;
		}
	return ret;
	}
function wordlist_dirty()
    // randomly selects a dirty word, then decides if it needs a suffix or prefix, or both
	{w="FUCK";
	dw=Math.round(Math.random()*30);
	switch(dw)
		{case 1: 	w="SHIT"; 			break;
		case 2: 	w="FAGGOT"; 			break;
		case 3: 	w="SNATCH"; 			break;
		case 4: 	w="PUSSY"; 			break;
		case 5: 	w="DICK"; 			break;
		case 6: 	w="COCK"; 			break;
		case 7: 	w="BITCH"; 			break;
		case 8:	w="BASTARD"; 			break;
		case 9:	w="CUNT"; 			break;
		case 10: 	w="ASS"; 			break;
		case 11: 	w="FELCH"; 			break;
		case 12: 	w="FAGGOT"; 			break;
		case 13: 	w="WHORE"; 			break;
		case 14: 	w="SLUT"; 			break;
		case 15: 	w="CLIT"; 			break;
		case 16: 	w="TWAT"; 			break;
		case 17: 	w="PISS"; 			break;
		case 18: 	w="FART"; 			break;
		case 19: 	w="JIZZ";			break;
		case 20: 	w="PUKE"; 			break;
    // above can or cannot use prefix/suffix
    // below must use prefix/suffix
		case 21:	w="DOG"; 			break;
		case 22: 	w="WART"; 			break;
		case 23: 	w="NUGGET"; 			break;
		case 24: 	w="HOLE"; 			break;
		case 25: 	w="PIG"; 				break;
		case 26:	w="MONKEY";			break;
		}
	r2=Math.round(Math.random()*19884);
    // used to randomly determine suffix/prefix
	if (dw>20)
    // if needs suffix or prefix, sends for it 
  		{if ((r2%2)==1) w=wordlist_dirtyprefix(w) + w;
		else w+=wordlist_dirtysuffix(w);		
		}
	else if ((r2%10)==1) w=wordlist_dirtyprefix(w) + w + wordlist_dirtysuffix(w);
	else
		{if ((r2%9)==1) w=wordlist_dirtyprefix(w) + w;
		if ((r2%9)==2) w+=wordlist_dirtysuffix(w);
		}
	return w;
	}


function wordlist_racist()
    // randomly returns epithet  
	{ep="WHITETRASH";
	switch(Math.round(Math.random()*20))
		{case 1:	ep="JEW"; 			break;
		case 2: 	ep="NIGGER"; 			break;
		case 3: 	ep="SPIC"; 			break;
		case 4: 	ep="ESKIMO"; 			break;
		case 5: 	ep="CANUCK"; 			break;
		case 6: 	ep="KIKE"; 			break;
		case 7: 	ep="SPEARCHUCKER"; 		break;
		case 8: 	ep="WETBACK"; 			break;
		case 9: 	ep="CAMELJOCKEY"; 		break;
		case 10: 	ep="HEB"; 			break;
		case 11: 	epep="GOOK"; 			break;
		case 12: 	ep="CHINK"; 			break;
		case 13: 	ep="TOWELHEAD"; 		break;
		case 14: 	ep="SANDNIGGER"; 		break;
		case 15: 	ep="JIGABOO"; 			break;
		case 16: 	ep="CRACKER"; 			break;
		case 18: 	ep="DAYGO"; 			break;
		case 19: 	ep="SLANTEYED"; 			break;
		}
	r1=Math.round(Math.random()*19884);
    // randomly decides if it adds suffix or prefix to root word
	if ((r1%9)==1) ep=wordlist_dirtyprefix(ep) + ep;
	if ((r1%9)==2) ep+=wordlist_dirtysuffix(ep);
	return ep;
	}
function wordlist_nonesense()
    // randomly returns a nonesense word
	{ret="HAMSTER";
	switch(Math.round(Math.random()*30))
		{case 1: 	ret="TURNSTILE";			break;
		case 2: 	ret="Q*BERT";			break;
		case 3: 	ret="VELVEETA";			break;
		case 4: 	ret="PURPLE";			break;
		case 5:	ret="NAPOLEON";			break;
		case 6: 	ret="HUMMUS";			break;
		case 7: 	ret="RHINOCEROUS";		break;
		case 8: 	ret="TALLAHASEE";		break;
		case 9: 	ret="SACRAMENTO";		break;
		case 10: 	ret="XYLOPHONE";			break;
		case 11: 	ret="AARDVARK";			break;
		case 12: 	ret="TORONTO";			break;
		case 13: 	ret="OREGANO";			break;
		case 14: 	ret="LUXEMBOURG";		break;
		case 15: 	ret="JANUARY";			break;
		case 16: 	ret="THURSDAY";			break;
		case 17: 	ret="SPANDEX";			break;
		case 18: 	ret="ZAMBONI";			break;
		case 19: 	ret="PARSLEY";			break;
		case 20: 	ret="BICYCLE";			break;
		case 21: 	ret="REFRIGERATOR";		break;
		case 22: 	ret="LINOLEUM";			break;
		case 23: 	ret="FEBRUARY";			break;
		case 24: 	ret="OCTOBER";			break;
		case 25: 	ret="SPAGHETTI";			break;
		case 26: 	ret="STALACTITE";			break;
		case 27: 	ret="ESOPHAGUS";			break;
		case 28: 	ret="TRAPEZOID";			break;
		case 29: 	ret="TAPIACO";			break;
		}	
	return ret;
	}


function sub_dirtyburst()
    // compiles curse string, randomly calls all the word functions to compile it
	{a=Math.round(Math.random()*12008);
	b=Math.round(Math.random()*20108);
	blength=((a+b)%25) + 15;
	burst="";
	usednon=0;	
	while (burst.length<blength) 
    // keeps adding words until it is the minimum lengnth
		{if ((usednon==0) && (burst.length>4)) 
    // decides if to use a nonsense word, will never be first or last word in burst
			{if ((burst.length%7)==1)
				{if ((b%3)==1)
					{burst+=wordlist_nonesense() + " ";
					usednon=1;
					}
				}
			else if ((burst.length%7)==2)
				{if ((a%3)==1)
					{burst+=wordlist_nonesense() + " ";
					usednon=1;
					}
				}
			}	
		if ((a%6)==1) burst+=wordlist_adjective() + " ";	
    // randomly decides to put adjective in front of main curse word 
		if ((b%4)==1) burst+=wordlist_racist() + " ";
		else burst+=wordlist_dirty() + " ";
    // randomly decides if main word is racist or just dirty
		a=Math.round(Math.random()*(13*burst.length) + blength);
		b=Math.round(Math.random()*(blength*11) + burst.length);
    // resets random numbers
		}
	burst=burst.substring(0, burst.length-1);
	return burst;
	}
function wordlist_clean()
	{var ct="FREAKING";
	var i=Math.round(Math.random()*70);
	switch (i)
		{case 0:	ct="FRICKING"; 			break;		
		case 1: 	ct="FRIGGING"; 			break;
		case 2: 	ct="KISS MY GRITS"; 		break;
		case 3: 	ct="DARN IT TO HECK"; 		break;
		case 4: 	ct="JUDAS PRIEST"; 		break;
		case 5: 	ct="GOSH DARN IT"; 		break;		
		case 6: 	ct="GOLLY-GEE"; 			break;
		case 7: 	ct="CROCK-OF-POO"; 		break;
		case 8: 	ct="BULL-HONKEY"; 		break;
		case 9: 	ct="HOLY CRIMINY"; 		break;
		case 10: 	ct="HECK"; 			break;
		case 11: 	ct="BULLCRUD"; 			break;
		case 12: 	ct="MOFO"; 			break;
		case 13: 	ct="A-HOLE"; 			break;
		case 14: 	ct="B-HOLE"; 			break;
		case 15: 	ct="FREAKING-A"; 			break;
		case 16:	ct="DADGUM-IT"; 			break;
		case 17: 	ct="GOSH"; 			break;			
		case 18: 	ct="DARN"; 			break;
		case 19: 	ct="F-WORD"; 			break;
		case 20: 	ct="B-WORD"; 			break;
		case 21: 	ct="IMBECILE"; 			break;
		case 22: 	ct="IGNORAMUS"; 			break;
		case 23: 	ct="C-WORD"; 			break;
		case 24: 	ct="S.O.B."; 			break;
		case 25: 	ct="DIPWAD";			break;
		case 26: 	ct="SHINOLA"; 			break;
		case 27: 	ct="PATOOTIE"; 			break;
		case 28: 	ct="DOODIE"; 			break;		
		case 29: 	ct="DOO-DOO"; 			break;
		case 30: 	ct="BOOGER"; 			break;
		case 31: 	ct="SNOT"; 			break;
		case 32: 	ct="WEE-WEE"; 			break;
		case 33: 	ct="WEINER"; 			break;
		case 34: 	ct="BUM"; 			break;
		case 35: 	ct="CRUD"; 			break;
		case 36: 	ct="COOTIES";			break;
		case 37: 	ct="CA-CA"; 			break;
		case 38: 	ct="BARF"; 			break;
		case 39: 	ct="DERRIERE"; 			break;
		case 40: 	ct="TINKLE"; 			break;
		case 41: 	ct="RUMP"; 			break;
		case 42: 	ct="TALLYWHACKER"; 		break;
		case 43: 	ct="N-WORD"; 			break;
		case 44: 	ct="POOP"; 			break;
		case 45: 	ct="BALONEY"; 			break;
		case 46: 	ct="HOGWASH"; 			break;
		case 47: 	ct="POPPYCOCK"; 			break;
		case 47: 	ct="PEE-PEE"; 			break;
		case 48: 	ct="HOLEY MOLEY";		break;
		case 49:	ct="PASS GAS";			break;
		case 50:	ct="NOOKY";			break;
		case 51:	ct="WHOOPIE";			break;
		case 52:	ct="TUCKUS";			break;
		case 53:	ct="G.D. IT";			break;
		case 54:	ct="F-BOMB";			break;
		case 55:	ct="COLORED";			break;
		case 56:	ct="DARKIE";			break;
		case 57:	ct="ORIENTAL";			break;
		case 58:	ct="A-RAB";			break;
		case 59:	ct="JEW";				break;
		case 60:	ct="BOOBIE";			break;
		case 61:	ct="BREASTS";			break;
		case 62:	ct="STUPID";			break;	
		case 63:	ct="MEXICAN";			break;
		case 64:	ct="HEAVEN ALMIGHTY";		break;	
		case 65:	ct="H-E-DOUBLE HOCKEY STICKS";	break;
		case 66:	ct="M.F.";				break;
		case 67:	ct="NEGRO";			break;
		case 68:	ct="MULARKEY";			break;
		}
	return ct;
	}

function sub_cleanburst()
    // compiles curse string, randomly calls all the word functions to compile it
	{d=Math.round(Math.random()*20108);
	blength=(d%25) + 15;
	burst="";
	usednon=0;	
	while (burst.length<blength) 
    // keeps adding words until it is the minimum lengnth
		{if ((usednon==0) && (burst.length>10)) if (((d+burst.length)% 7)==1) 
    // decides if to use a nonsense word, will never be first or last word in burst
			{burst+=wordlist_nonesense() + " ";
			usednon=1;
			}
		burst+=wordlist_clean() + " ";
		}
	burst=burst.substring(0, burst.length-1);
	return burst;
	}

function totourette(s, dirty)
    // works through string it is passed to find instances to insert tourette bursts,
    // t determines type of words to use, 1=dirty, 0=clean; 
	{words=0;
	i=0;
	ret="";
	nburst=Math.round(Math.random()*9) + 6;
    // randomly determines how many real words get put between bursts
	while (i<s.length)
		{cc=s.substring(i, i+1);
		nc=s.substring(i+1, i+2);
		if (cc=='<')
    // if its html tag, lets all info through until tag closes 
			{ret+=cc;
			while ((cc!='>') && (i<s.length)) 
				{++i;
				cc=s.substring(i, i+1);
				ret+=cc;
				}
			}
		else if ((nc==' ') || (nc=='\n') || (nc=='\r'))
    // if next character is space or return line it looks to insert a burst
			{++words;
			if (words>=nburst)
    // if time to put one it, it does it and randomly resets when next burst should appear
				{if (isletter(cc)==1) 
					{ret+=cc + " ";
					if (dirty==0) ret+=sub_cleanburst();
					else ret+=sub_dirtyburst();
					}
				else 
					{ret+=" ";
					if (dirty==0) ret+=sub_cleanburst();
					else ret+=sub_dirtyburst();
					ret+=cc;
					}
				words=0;
				nburst=Math.round(Math.random()*9) + 6;
				}
			else ret+=cc;
			}
		else ret+=cc;

		++i;	
		}

	return ret;
	}

