FIELD1="";
illegal=false;
formpresent=false;
submitimg = new Image();
submitimg.src="submit.gif";

	if (!document.all && !document.layers) {domcheck='id=';}
	else {domcheck='name=';}


function clearform(){
	maintext='';
	destination=theformHTML; 
	magiccontents();
	formpresent=false;
}

function theform() {
	illegal=false;
	theformLyr.zIndex=400;
	maintext=maintext+'<br><br><FORM '+domcheck+'"entryform" onsubmit="subform(); return false;"><ul><font color=blue face=arial><b><i>Enter any name or a short message<br>in the field below:</i></b></font><table width='+available_width*0.7+' cellspacing=0 cellpadding=3 border=0 ><tr><td><table width='+available_width*0.7+' cellspacing=2 cellpadding=0 border=0 cols=2><tr><td valign=top align=center><blockquote><center><input TYPE = "text"  size="19" NAME = "entrytext"><br><input type=IMAGE src='+submitimg.src+' border=0></td><td><font color=maroon><i><b><strong>Some presets...</strong><ul><a href=# onclick="FIELD1=\'microsoft\'; testinput(); return false;">microsoft</a><br><a href=# onclick="FIELD1=\'mozilla\'; testinput(); return false;">mozilla</a><br><a href=# onclick="FIELD1=\'macintosh\'; testinput(); return false;">macintosh</a><br><a href=# onclick="FIELD1=\'rollsroyce\'; testinput(); return false;">rolls royce</a></b></i><ul><ul><font size=-1><a href=# onclick="showtext(20); return false;">clear this screen?</a></td></tr></table></td></tr></table></FORM>';
	formwriter();
}

function formwriter() {destination=theformHTML; magiccontents();formverify();}

function formverify() { 			//DOM stuff for NS6+
	if (document.all) {}
	else  
	if (document.layers) {entryform = eval('theformHTML.entryform');}
	else 
	if (document.getElementById) {entryform = eval(doc + 'entryform' + htm);}
	entryform.entrytext.focus();
	formpresent=true;
}

function subform() {

	FIELD1 = eval('entryform.entrytext.value');
	FIELD1=FIELD1.toLowerCase();
	FIELD1= ignoreSpaces(FIELD1); 
	testinput();
}

function testinput(){
	maintext='<i><font face=arial color=red>';
	if (FIELD1.length<1) {maintext=maintext+'Please enter something in the field!</font></font></i>';illegal=true; }
	else
	if (FIELD1.length<3) {maintext=maintext+'Sorry, but "<b>'+FIELD1+'</b>" is not long enough, please enter something longer (minimum of 3 characters).</font></font></i>';illegal=true; }
	else
	if (FIELD1.length>18) {maintext=maintext+'Sorry, but you have used too many characters (maximum of 18 permitted).</font></font></i>';illegal=true; }
	else {
		textarray = new Array();
		for(i = 0; i < FIELD1.length; i++) 	{
			textarray[i]= FIELD1.substr(i,1);
			if (textarray[i].charCodeAt(0) < 97 || textarray[i].charCodeAt(0) > 122) {
				maintext=maintext+'Sorry, but "<b>'+textarray[i]+'</b>" is an illegal character - please try again.</font></font></i>';
				illegal=true; 
				break;}
		} // eo for loop
	}

	if (illegal) {theform();}
	else
	{setupdivs1();}
}

function setupdivs1() {
	var directory='alphabet/';
	if (FIELD1=='microsoft') {directory='microsoft/';}
	if (FIELD1=='mozilla') {directory='mozilla/';}
	if (FIELD1=='macintosh') {directory='macintosh/';}
	if (FIELD1=='rollsroyce') {directory='rolls/';}
	wordnumber=FIELD1.length+1;	
	for (i= 1; i <wordnumber; i++) {
		maintext=maintext+'<DIV id="theclp'+i+'" STYLE="position: absolute; left: '+ (35+(((i-1)*20*thesize))) +'px; top: '+(available_height*0.45)+'px; clip: rect(0px '+(25*thesize) +'px '+(25*thesize) +'px 0px); z-index:301; visibility: visible; "><A HREF=# onmouseover="imgover('+i+'); window.status=\' '+i+'\'; return true;" onmouseout="imgout('+i+'); window.status=\'\'; return true;" onclick="imgclick(); return false;"><img src='+directory+'letter'+(textarray[i-1].charCodeAt(0)-96)+'.gif  width='+(75*thesize) +' height='+(25*thesize) +'  border=0></a></DIV>';}
	destination=mainHTML;
	magiccontents();

	if (document.layers) {doc = "mainHTML.";}               // briefly change DOM

	theclpLyr = new Array();
	clipbank = new Array();
	for (var i= 1; i <wordnumber; i++) {
		theclpLyr[i] = eval(doc + 'theclp' + i+ sty);
		redo_clips(i);
		clipout(i);
							}
	if (document.layers) {doc = "document.";}                  // change it back again
	clearform();
	showtext(20);

}

function ignoreSpaces(string) {
	var temp = "";
	string = '' + string;
	splitstring = string.split(" ");
	for(i = 0; i < splitstring.length; i++)
	temp += splitstring[i];
	return temp;
}


function entsub(e) { 
	if (document.all ){
		if (event.keyCode == 13) {
			if (formpresent) {subform();}
			else {decide();}
		return false;}
		}
	else 
		if ((document.layers)|| (document.getElementById)) {
			if (e.which == 13 && !formpresent) {
				decide();
				return false;}
		}
	else
	return true;
} 
