var nouns = "Aardvark,Angel,Animal,Ape,Apple,Armadillo,Baboon,Baby,Balls,Banana,Bat,Bear,Beaver,Bird,Biro,Boat,Book,Box,Brain,Bunny,Burglar,Butterfly,Cake,Camel,Cantaloupe,Car,Carpet,Carrot,Cat,Cherry,Chicken,Clam,Clock,Cloud,Coconut,Coffee Mug,Cow,Cucumber,Dalek,Date,Day,Devil,Dinosaur,Dog,Doll,Door,Doughnut,Dragon,Duck,Dwarf,Eagle,Egg,Elephant,Elf,Elvis,Enigma,Eyes,Face,Fairy,Farm,Farmer,Feet,Ferret,Fig,Finger,Fire,Fish,Flower,Fox,Frog,Game,Garden,Gargoyle,Geek,Gerbil,Giraffe,Gnome,Goblin,Grape,Grapefruit,Grass,Hamster,Head,Hippo,Hole,Horse,Igloo,Juice,Kitten,Kiwi,Knickers,Lamp-post,Leg,Lemon,Lion,Llama,Log,Mango,Mind,Missile,Mole,Mongoose,Monk,Monkey,Monster,Morning,Mouse,Mushroom,Nerd,Night,Nun,Nurse,Nuts,Orange,Otter,Owl,Panther,Pants,Party,Peach,Pear,Penguin,Person,Phonebox,Piercing,Pig,Pineapple,Planet,Plant,Play-thing,Pleasure,Plum,Porcupine,Pornstar,Potato,Priest,Puppy,Puzzle,Rabbit,Rainbow,Rat,Rhubarb,Ride,Ring,Robin,Rockstar,Rooster,Seed,Shadow,Sheep,Shoe,Shopkeeper,Skunk,Smile,Snail,Slug,Snake,Snowman,Spanner,Spatula,Spider,Spoon,Squirrel,Star,Stick,Stone,Sun,Table Lamp,Tangerine,Taxi,Teapot,Thief,Thing,Tiger,Time,Tomato,Tongue,Top,Tortoise,Toy,Traffic Light,Tree,Turtle,Umbrella,Vicar,Watermelon,Wind,Witch,Wolf,X-ray,Xylophone,Yawn,Year,Yuppie,Zebra,Zephyr,Zip";

var adjectives = "Red,Blue,Green,Black,Purple,Orange,White,Silver,Golden,Yellow,Pink,Little,Enormous";
adjectives = adjectives + ",Absent-Minded,Active,Adaptable,Adventurous,Aggressive,Ambitious,Angelic,Angry,Annoyed,Anxious,Apathetic,Arrogant,Assertive,Athletic";
adjectives = adjectives + ",Bad,Bad-Humoured,Baffled,Bashful,Beautiful,Bent,Boring,Bright,Brilliant,Busy";
adjectives = adjectives + ",Calm,Carefree,Careful,Careless,Cautious,Chaotic,Charming,Chatty,Cheap,Cheeky,Cheerful,Childish,Chocolate,Classy,Clear-Headed,Clever,Clockwork,Clueless,Clumsy,Cold,Complicated,Conceited,Confused,Conscientious,Conservative,Considerate,Constipated,Convenient,Cool,Courageous,Cowardly,Crazy,Creative,Crooked,Cross,Cultured,Curious,Cute";
adjectives = adjectives + ",Dangerous,Daring,Decent,Dedicated,De-flowered,Demented,Dependable,Depressed,Desperate,Determined,Detestable,Dirty,Discreet,Disgusting,Disobedient,Disorganised,Dogged,Dogmatic,Domestic,Dopey,Dozey,Dumb";
adjectives = adjectives + ",Easy-Going,Ebullient,Eclectic,Educated,Egotistical,Elegant,Embarrassed,Energetic,Enigmatic,Enlightened,Enthusiastic,Envious,Evil,Excited,Expensive,Exuberant";
adjectives = adjectives + ",Faithful,Famous,Fantastic,Fascinating,Fashionable,Fast,Faster than a speeding,Finicky,Firm,First-Class,Fit,Flexible,Flipped-Out,Foolhardy,Forgetful,Friendly,Fruity,Funky,Funny,Funny Old,Fussy";
adjectives = adjectives + ",Generous,Genial,Genuine,Gifted,Glum,Good,Good-Humoured,Good-Natured,Grateful,Great,Greedy,Gutsy";
adjectives = adjectives + ",Happy,Happy as a,Hard,Hard-Headed,Hard-Working,Haughty,Healthy,Heartless,Helpful,High-Spirited,Home-Loving,Honest,Horny,Hospitable,Humble,Humorous,Hung Like a,Hungry";
adjectives = adjectives + ",Idealistic,Ignorant,Ill-Humoured,Ill-Tempered,Imaginary,Impartial,Impulsive,Inconsequential,Inconsiderate,Independent,Indescribable,Indifferent,Indiscreet,Industrious,Inflexible,Innocent,Insane,Intellectual,Interesting,Intolerant,Irascible,Irresistible,Irritated";
adjectives = adjectives + ",Jealous";
adjectives = adjectives + ",Kind,Know-All,Laid-Back";
adjectives = adjectives + ",Lazy,Lethargic,Liberal,Likable,Lively,Lonely,Lonesome,Loopy,Loud,Loyal,Love,Lucky";
adjectives = adjectives + ",Mad,Magnificent,Mature,Mean,Melancholy,Merry,Messy,Miserable,Mistrustful,Modern,Modest,Moody,Mouldy,Musical";
adjectives = adjectives + ",Narrow-Minded,Natural,Naughty,Neat,Nervous,Nice,Ninja,Nitpicking,Normal";
adjectives = adjectives + ",Odd,Oddly-Shaped,Old-Fashioned,Open-Minded,Optimistic,Orderly,Outgoing";
adjectives = adjectives + ",Pampered,Partial,Passionate,Passive,Patient,Pensive,Perfect,Persevering,Persistent,Pessimistic,Phlegmatic,Placid,Plain,Pleasant,Polite,Poor,Popular,Practical,Pretty,Progressive,Proper,Proud,Puerile,Punctual,Purposeful,Puzzled";
adjectives = adjectives + ",Quarrelsome,Quiet";
adjectives = adjectives + ",Radical,Random,Reasonable,Rebellious,Reckless,Recreational,Refined,Reliable,Religious,Repulsive,Reserved,Responsible,Revolutionary,Rich,Romantic,Rotten,Rough";
adjectives = adjectives + ",Sad,Sane as a,Sarcastic,Satisfied,Saucy,Secure,Self-Centred,Self-Conscious,Selfish,Sensible,Sensitive,Sentimental,Serious,Shallow,Shiny,Shy,Silly,Simple,Sincere,Single-Minded,Skillful,Slack,Sleepy,Slimy,Slippery,Sloppy,Slow,Sluggish,Smart,Smug,Snobby,Sociable,Soft,Solid,Sour,Spellbinding,Spikey,Spiteful,Spoilt,Spontaneous,Stable,Sticky,Stingy,Strange,Strong,Stubborn,Stuck-Up,Studious,Stupid,Stylish,Successful,Super,Superficial,Superstitious,Sweet,Sympathetic";
adjectives = adjectives + ",Taciturn,Tactful,Tactless,Talented,Talkative,Terrific,Thankful,Thoughtful,Tidy,Tight,Timid,Toilet Seat,Tolerant,Touchy,Tricky,Trustworthy,Twisted,Typical";
adjectives = adjectives + ",Unbreakable,Unchanging,Uncommunicative,Uncompromising,Unconcerned,Unemotional,Unidentifiable,Unfriendly,Uninhibited,Unique,Unlucky,Unraveled,Unselfish,Unstable,Unusual,Unworried,Upbeat,Upset,Uptight";
adjectives = adjectives + ",Vain,Valued,Virtual";
adjectives = adjectives + ",Warm,Wary,Weak,Weird,Well-Balanced,Well-Behaved,Well-Dressed,Well-Informed,Well-Known,Well-Oiled,Wild,Witty,Wonderful";
adjectives = adjectives + ",Young,Yummy";
adjectives = adjectives + ",Zany";

function get_name()
	{
	var new_adj = random_word(adjectives);
	var new_noun = random_word(nouns);

	if ((new_noun.match(/^[AEIOU]/) != null) && (new_adj.match(/ a$/) != null))
		{new_adj = new_adj + 'n';}

	return (new_adj + ' ' + new_noun);
	}

function generate()
	{
	document.editform.nickname.value = get_name();
	window.status = 'Picked from ' + (nouns.length * adjectives.length) + ' posibilities (' + adjectives.length + 'x' + nouns.length + ')';
	}

function random_word(wordlist)
	{
	var words = new Array;

	words = wordlist.split(',');
	word_count = words.length;

	return words[parseInt(Math.random() * word_count)];
	}

function new_names()
	{
	for (i=0; i < 10; i++)
		{
		var newname = get_name();
		document.theform.namelist.options[i].value = newname;
		document.theform.namelist.options[i].text = newname;
		}
	window.status = 'Picked from ' + (nouns.length * adjectives.length) + ' posibilities (' + adjectives.length + 'x' + nouns.length + ')';
	}

function select_name()
	{
	if (window.opener)
		{
		if (document.theform.namelist.selectedIndex > -1)
			{
			window.opener.editform.nickname.value = document.theform.namelist.options[document.theform.namelist.selectedIndex].value;
			window.close();
			}
		else
			{alert('Select one first you ' + get_name() + '!');}
		}
	}

function generate_window()
	{
	myWindow = window.open("../html/names.htm","nicknames","resize=1,resizable=yes,toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=0,copyhistory=0,width=350,height=250,top=150,left=150");
	myWindow.focus();
	}

function uin_change()
	{
	if ((document.editform.uin.value > 0) && (document.editform.uin.value != document.editform.new_uin.value))
		{
		var answer=confirm("W A R N I N G !\nIf you change your ICQ number to one which is invalid, you will be deleted!\nAre you sure you want to change your ICQ number?");
		if (answer)
			{document.editform.old_uin.value = document.editform.uin.value;}
		else
			{document.editform.new_uin.value = document.editform.uin.value;}
		}
	}

function suspend_account()
	{
	disable = (document.editform.suspend.selectedIndex > 0);

	for (items=0; items < document.editform.length; items++)
		{
		if ((document.editform[items].name != 'suspend') && (document.editform[items].type != 'submit') && (document.editform[items].type != 'hidden'))
			{document.editform[items].disabled = disable;}
		}

	if ((document.editform.suspend_reason) && (document.getElementById))
		{
		var reason = document.editform.suspend_reason;
		var reasonDiv = document.getElementById('reason_div');
		if (document.editform.suspend.selectedIndex == 1)
			{
			reason.disabled = false;
			reasonDiv.style.display = 'block';
			}
		else
			{
			reason.disabled = true;
			reasonDiv.style.display = 'none';
			}
		}
	}

function check_nude()
	{
	if (document.editform.xrated.checked)
		{
		var answer=confirm("W A R N I N G !\nSOME nudity means NO genitals or sexual acts, as a guidleline, think of the Sun newspaper.\nDO NOT tick this box just to get more hits.\nDoes the image contain nudity?");
		if (answer == false)
			{document.editform.xrated.checked = false;}
		}
	}

function countme(max) 
	{
	if (document.editform.count)
		{
		max = max || getObj('maxlen').value;
		var msgString;

		if (document.getElementById('mce_editor_comments'))
			{msgString = document.getElementById('mce_editor_comments').contentWindow.document.body.innerHTML;}
		else
			{msgString = document.editform.comments.value;}

		msgString = msgString.replace(/http:\/\/v3.feesch.co.uk/ig,'');
		msgString = msgString.replace(/http:\/\/www.feesch.co.uk/ig,'');
		msgString = msgString.replace(/mce_[a-z]+=".+?"/ig,'');

		var msgLength = msgString.length;
		if (msgLength > max)
			{
			document.editform.comments.value = document.editform.comments.value.substr(0,max);
			msgLength = max;
			alert("Your comments have reached your limit of " + max + " characters.");
			}

		document.editform.count.value  = msgLength;
		document.editform.remain.value = max - msgLength;
		}
	} 

function OpenWin(filename,width,height)
	{
	myWindow = window.open("../html/" + filename + ".htm",filename,"resize=1,resizable=yes,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,copyhistory=0,width=" + width + ",height=" + height + ",top=5,left=5");
	myWindow.location = "../html/" + filename + ".htm";
	myWindow.focus();
	}

function OpenColors()
	{
	myWindow = window.open('../html/colours.htm','colours','resize=0,resizable=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,copyhistory=0,width=374,height=108,top=' + event.screenY + ',left=' + event.screenX);
	myWindow.location = '../html/colours.htm';
	myWindow.focus();
	}

function NoColor()
	{
	document.editform.bgcolor.value = '';
	document.getElementById('bgbut').style.background = '';

	if (getObj('mce_editor_comments'))
		{getObj('mce_editor_comments').style.backgroundColor = '';}
	}
function OpenFColors(e)
	{
	myWindow = window.open('../html/fcolor.htm','colours','resize=0,resizable=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,copyhistory=0,width=374,height=108,top=' + e.screenY + ',left=' + e.screenX);
	myWindow.location = '../html/fcolor.htm';
	myWindow.focus();
	}

function NoFColor()
	{
	document.getElementById('fgcolor').value = '';
	document.getElementById('fgbut').style.color = '';

	if (getObj('mce_editor_comments'))
		{getObj('mce_editor_comments').contentWindow.document.body.style.color = '';}
	}

function OpenBColors(e)
	{
	myWindow = window.open('../html/bcolor.htm','colours','resize=0,resizable=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,copyhistory=0,width=374,height=108,top=' + e.screenY + ',left=' + e.screenX);
	myWindow.location = '../html/bcolor.htm';
	myWindow.focus();
	}

function NoBColor()
	{
	document.getElementById('bgcolor').value = '';
	document.getElementById('bgbut').style.background = '';

	if (getObj('mce_editor_comments'))
		{getObj('mce_editor_comments').contentWindow.document.body.style.backgroundColor = '';}
	}

function validnum(field)
	{
	field.value = parseInt(field.value);
	if ((field.value == "NaN") || (field.value < 0))
		{field.value = "";}
	}

function inEnglish(row,title)
	{
	if (document.getElementById)
		{
		var tbl = document.getElementById('resultsTable');
		var tr = tbl.rows[row];
		var td;

		if (arguments.length == 1)
			{td = tr.cells[2];}
		else
			{td = (title == 1) ? tr.cells[0] : tr.cells[1];}

		var txt = new Array;
		txt['1st'] = 'first';
		txt['2nd'] = 'second';
		txt['3rd'] = 'third';
		txt['2nite'] = 'tonight';
		txt['afaik'] = 'as far as i know';
		txt['any1'] = 'anyone';
		txt['arnt'] = 'aren\'t';
		txt['atm'] = 'at the moment';
		txt['b4'] = 'before';
		txt['bac'] = 'back';
		txt['bfn'] = 'bye for now';
		txt['bk'] = 'back';
		txt['brb'] = 'be right back';
		txt['c'] = 'see';
		txt['cn'] = 'can';
		txt['cud'] = 'could';
		txt['cu'] = 'see you';
		txt['cul8r'] = 'see you later';
		txt['cz'] = 'because';
		txt['coz'] = 'because';
		txt['cuz'] = 'because';
		txt['gr8'] = 'great';
		txt['h8'] = 'hate';
		txt['howz'] = 'hows';
		txt['i'] = 'I';
		txt['id'] = 'I\'d';
		txt['il'] = 'I\'ll';
		txt['im'] = 'I\'m';
		txt['innit'] = 'isn\'t it';
		txt['iv'] = 'I\'ve';
		txt['l8'] = 'late';
		txt['l8r'] = 'later';
		txt['luv'] = 'love';
		txt['amke'] = 'make';
		txt['m8'] = 'mate';
		txt['n'] = 'and';
		txt['ne1'] = 'anyone';
		txt['np'] = 'no problem';
		txt['pmsl'] = 'peeing myself laughing';
		txt['r'] = 'are';
		txt['rotfl'] = 'rolls on the floor laughing';
		txt['rotflmao'] = 'rolls on the floor laughing my arse off';
		txt['lmao'] = 'laughs my arse off';
		txt['lmfao'] = 'laughs my fat arse off';
		txt['sed'] = 'said';
		txt['spose'] = 'suppose';
		txt['spk'] = 'speak';
		txt['taht'] = 'that';
		txt['tahn'] = 'than';
		txt['teh'] = 'the';
		txt['thanx'] = 'thanks';
		txt['txt'] = 'text';
		txt['u'] = 'you';
		txt['ur'] = 'your';
		txt['w8'] = 'wait';
		txt['arnt'] = 'aren\'t';
		txt['arent'] = 'aren\'t';
		txt['isnt'] = 'isn\'t';
		txt['wasnt'] = 'wasn\'t';
		txt['wont'] = 'won\'t';
		txt['theres'] = 'there\'s';
		txt['aint'] = 'isn\'t';
		txt['hes'] = 'he\'s';
		txt['hed'] = 'he\'d';
		txt['wat'] = 'what';
		txt['wot'] = 'what';
		txt['wud'] = 'would';
		txt['wuf'] = 'where are you from?';
		txt['yea'] = 'yeah';
		txt['ya'] = 'you';

		txt['faithfultiger'] = 'FatefulTodger';
		txt['birobabe'] = 'Biroboobs';
		txt['biro'] = 'Biroboobs';
		txt['happy fisherman'] = 'Smells Like a Fish';
		txt['hengist'] = 'Harem Master';
		txt['hengistrob'] = 'Harem Master';
		txt['puzzled fairy'] = 'Pizzled Furry';
		txt['Gaelflyn'] = 'Gaelflyn GreatTits';

		txt['lm'] = 'LizardMan the Sex God';
		txt['ft'] = 'FaithfulTiger';
		txt['hf'] = 'Happy Fisherman';
		txt['pf'] = 'Puzzled Fairy';
		txt['hr'] = 'Hengistrob';
		txt['hengy'] = 'Hengistrob';

		txt['i no'] = 'I know';
		txt['you no'] = 'you know';
		txt['he no'] = 'he know';
		txt['she no'] = 'she know';
		txt['they no'] = 'they know';
		txt['anyone no'] = 'anyone know';

		for (var w in txt)
			{td.innerHTML = td.innerHTML.replace(new RegExp('\\b'+w+'\\b','ig'),txt[w]);}

		td.innerHTML = td.innerHTML.replace(new RegExp('<wbr>','ig'),'');

		td.innerHTML = td.innerHTML.replace(new RegExp(',{2,}','ig'),'...');
		td.innerHTML = td.innerHTML.replace(new RegExp('\\.{3,}','ig'),'...');
		td.innerHTML = td.innerHTML.replace(new RegExp('\\!{2,}','ig'),'!!');
		td.innerHTML = td.innerHTML.replace(new RegExp('\\?{2,}','ig'),'??');


		td.innerHTML = td.innerHTML.replace(new RegExp('([a-z]{30})','ig'),'$1<wbr>');
		}
	}

function CheckSpell()
	{
	myWindow = window.open('/icq-spellcheck.pl',"speller","resize=1,resizable=yes,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,copyhistory=0,width=460,height=360,top=5,left=5");
	}

function OpenEditor()
	{
	myWindow = window.open("/html/htmledit.html?" + arguments[1],arguments[0],"resize=1,resizable=yes,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,copyhistory=0,width=460,height=420,top=5,left=5");
	myWindow.location = "/html/htmledit.html?" + arguments[1];
	myWindow.focus();
	}
