///////////////////////////////////////////////
//////////////////write forms//////////////////
///////////////////////////////////////////////


function firstform() {
	formvalue=1;
	maintext='<FORM '+domcheck+'"loginform">'+fontvalue+'<b><font color=gold><strong><i><big>Login:</big></i></strong></font></b></font><br><ul><table cellspacing=0 cellpadding=3 border=1  width='+available_width*0.3+' background='+image17.src+'><tr><td><table cellspacing=2 cellpadding=0 border=0 cols=2 width='+available_width*0.43+'><tr><td valign=middle  align=right>'+fontvalue+'<font color=white><b>'+((GetCookie('username')==null || usrname=="anonymous" || document.layers) ? 'Please enter your user name:&nbsp;&nbsp;':'Welcome back:&nbsp;&nbsp;')+'</td><td valign=top width=1>'+fontvalue+'<font color=black><input TYPE = "text" size="7" NAME = "boxone" class="'+thefontsize+'"></td></tr><tr><td valign=middle align=right>'+fontvalue+'<font color=white><b>Please enter your unique user ID:&nbsp;&nbsp;</td><td valign=top width=1> <input TYPE = "password"  size="7" NAME = "boxtwo" CLASS="'+thefontsize+'"></td></tr></table></td></tr></table></FORM>';
	formwriter('loginform');
}

function register() {
	ctable=false;
	formvalue=2;
	maintext='<FORM '+domcheck+'"secondform">'+fontvalue+'<b>Please register as a new user <sup>'+jlink+'=\'Click&nbsp;for&nbsp;help.\'; return true;" onclick="upperhelp(35); return false;">'+quezzie+'</a></sup></b></font><ul><table border=1 cellspacing=0 cellpadding=3 background='+image20.src+'><tr><td><table  border=0 cellspacing=2 cellpadding=0 cols=2 width='+available_width*0.43+'><tr><td align=right width='+available_width*0.25+'>'+fontvalue+'<font color=black><b>Please enter your user name: </td><td align=right><input TYPE = "text" size="7" NAME = "boxone" VALUE="" CLASS="'+thefontsize+'"></td></tr><tr><td align=right>'+fontvalue+'<font color=black><b>Please enter your unique user ID: </td><td align=right> <input TYPE = "password"  size="7" NAME = "boxtwo" value="" CLASS="'+thefontsize+'"></td></tr><tr><td align=right>'+fontvalue+'<font color=black><B>Please enter a <u>valid</u> email address: </td><td align=right> <input TYPE = "text"  size=17 NAME = "boxthree" CLASS="'+thefontsize+'"></td></tr></table></td></tr></table></FORM>';
	formwriter('secondform');
	fokus();
	if (quickchecker=="noname") {
		quickchecker='';
		secondform.boxone.value=wrongname;
		fokus();
		mainwriter(2);
}
	else
	if (quickchecker=="mailrequest") {mainwriter(8); quickchecker='';}
	else
	mainwriter(7);
	lowerhelp(16);
}

function update() {	
	ctable=false;
	formvalue=3;
	maintext='<FORM '+domcheck+'"updateform">'+fontvalue+'<b>Update '+usrname.substr(0,1).toUpperCase()+usrname.substr(1)+'\'s Personal Profile:</b></font><ul><table border=1 cellpadding=3 cellspacing=0 width='+available_width*0.3+' background='+image8.src+'><tr><td><table border=0 cellpadding=0 cellspacing=1 cols=2  width='+available_width*0.43+'><tr><td align=right>'+fontvalue+'<b>Please enter your old user ID: </td><td width=1><input TYPE = "PASSWORD"  size=7 NAME = "boxone" CLASS="'+thefontsize+'"></td></tr><tr><td align=right>'+fontvalue+'<b>Please enter your new unique user ID: </td><td width=1> <input TYPE = "password" NAME = "boxtwo"  size=7 CLASS="'+thefontsize+'"></td></tr><tr><td align=right>'+fontvalue+'<b>Please enter a <u>valid</u> email address: </td><td width=1> <input TYPE = "text"  size=17 NAME = "boxthree" CLASS="'+thefontsize+'"></td></tr></table></td></tr></table></FORM>';
	formwriter('updateform');
	mainwriter(11);
	resetter();
}

dum=0;

function sendmail() {	
if (alive&&!document.layers) {
hidecontrol();
	ctable=false;
	formvalue=19;
	maintext='<FORM '+domcheck+'"sendmailform">'+fontvalue+'<b>Send a message to Digsby Wyscher.</b></font><ul><table border=1 cellpadding=3 cellspacing=0 width='+available_width*0.3+' bgcolor=black><tr><td><table border=0 cellpadding=0 cellspacing=1 cols=2 bgcolor=darkred width='+available_width*0.43+'><tr><td align=right>'+fontvalue+'<font color=white><b>Please enter your name: </td><td width=1><input TYPE = "text"  size=17 NAME = "boxone" CLASS="'+thefontsize+'"></td></tr><tr><td align=right>'+fontvalue+'<font color=white><b>Please enter your return email address: </td><td width=1> <input TYPE = "text" NAME = "boxtwo"  size=17 CLASS="'+thefontsize+'"></td></tr><tr><td align=center colspan=2><textarea rows=5 cols=55 wrap="yes" NAME = "boxthree" CLASS="'+thefontsize+'" onfocus="this.select();">Please enter your message here.</textarea></td></tr></table><font size=-2 color=khaki>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Press return at any time to send your message, or '+jlink+'=\'Remove the form\';return false;" onclick="showcontrol();return true;"><font color=white>click here to return to the control centre.</a></td></tr></table></FORM>';
	formwriter('sendmailform');
	maintext='';lowerhelp();
	output1Lyr.visibility='hidden';
	popupLyr.visibility='hidden';
	fokus();
}
	else {window.location='mailto:webbank@sonik-systems.com?subject=a web bank query';}
}


function mailer() {
	formvalue=10;
	maintext='<FORM '+domcheck+'"mailform">'+fontvalue+'<b><font color=white><strong><i>Mail Requester:</i></strong></font></b></font><br><ul><table cellspacing=0 cellpadding=3 border=1  width='+available_width*0.3+' background='+image19.src+'><tr><td><table cellspacing=2 cellpadding=0 border=0 cols=2 width='+available_width*0.43+'><tr><td valign=middle  align=right>'+fontvalue+'<font color=black><b>My user name is:&nbsp;&nbsp;</td><td valign=top width=1>'+fontvalue+'<input TYPE = "text" size="7" NAME = "boxone" class="'+thefontsize+'" value='+FIELD1+'></td></tr><tr><td valign=middle align=right>'+fontvalue+'<b><font color=black>Please enter your returning email address:&nbsp;&nbsp;</td><td valign=top width=1> <input TYPE = "text"  size="17" NAME = "boxtwo" CLASS="'+thefontsize+'"></td></tr></table></td></tr></table></FORM>';
	formwriter('mailform');
	fokus();
	upperhelp(14);
	resetter();
}

function settings() {
	formvalue=4;
	maintext='<br><FORM '+domcheck+'"settingform"><ul><table border=0 cellpadding=0 cellspacing=1  cols=2 width='+available_width*0.38+'><tr><td width='+available_width*0.25+'>'+fontvalue+'Please enter a new background colour:</td><td>';

	if (document.layers) {
		maintext=maintext+'<input TYPE = "text"  size=20 CLASS="'+thefontsize+'" NAME = "colorinput" value="'+ (siscolour!=''? siscolour:'none') +'" onfocus=\'this.select()\'></td></tr><tr><td>'+fontvalue+'or a new font colour:</td><td><input TYPE = "text" NAME = "forecolorinput"  size=20 CLASS="'+thefontsize+'" value="'+ (sisforecolour!='' ? sisforecolour:'none') +'" onfocus=\'this.select()\'></td></tr><tr><td>'+fontvalue+'or a new \'link\' colour:</td><td><input TYPE = "text"  size=20 NAME = "linkcolorinput"  CLASS="'+thefontsize+'" value="'+ (sislinkcolour!='' ? sislinkcolour:'none') +'" onfocus=\'this.select()\'><input TYPE="hidden" NAME="fontinput" value="arial">';}
	else {
		maintext=maintext+'<select  CLASS="'+thefontsize+'" NAME="colorinput" onfocus=\'\'><option value='+ (siscolour!=''?siscolour:'none') +' selected>'+ (siscolour!='' ? siscolour:'none') +colouroption+'</select></td></tr><tr><td>'+fontvalue+'or a new font colour:</td><td><select NAME="forecolorinput" CLASS="'+thefontsize+'" onfocus=\'\'><option value='+ (sisforecolour!='' ? sisforecolour:'none') +' selected>'+ (sisforecolour!='' ? sisforecolour:'none') +colouroption+'</select></td></tr><tr><td>'+fontvalue+'or a new link colour:</td><td><select NAME="linkcolorinput" CLASS="'+thefontsize+'" onfocus=\'\'><option value='+ (sislinkcolour!='' ? sislinkcolour:'none') +' selected>'+ (sislinkcolour!='' ? sislinkcolour:'none') +colouroption+'</select></td></tr><tr><td>'+fontvalue+'or a different font face:</td><td><select NAME="fontinput" CLASS="'+thefontsize+'" onfocus=\'\'><option value='+ (sisfont!='' ? sisfont :'arial') +' selected>'+ (sisfont!='' ? sisfont :'arial') +' [present selection]'+fill+'arial\'>arial'+fill+'courier\'>courier'+fill+'garamond\'>garamond'+fill+'impact\'>impact'+fill+'tahoma\'>tahoma'+fill+'times\'>times'+fill+'verdana\'>verdana</select>';}
	maintext=maintext+'</td></tr></table></form>';
	formwriter('settingform');
	if (!ctable) {
		mainwriter(12); coloursettings();}
	else {
		controls(); coloursettings();lowerhelp(21); upperhelp(25);}
}


function referral() {	
	ctable=false;
	formvalue=12;
	maintext='<FORM '+domcheck+'"referform">'+fontvalue+'<br></font><ul><table border=1 cellpadding=3 cellspacing=0 width='+available_width*0.3+' background='+image30.src+'><tr><td><table border=0 cellpadding=0 cellspacing=2 cols=2  width='+available_width*0.43+'><tr><td align=right>'+fontvalue+'<font color=ivory><b>Please enter a name that your friend can recognise: </td><td width=1><input TYPE = "text"  size=12 NAME = "boxone" CLASS="'+thefontsize+'"></td></tr><tr><td align=right>'+fontvalue+'<font color=ivory><b>Please enter your friend\'s name: </td><td width=1> <input TYPE = "text" NAME = "boxtwo"  size=12 CLASS="'+thefontsize+'"></td></tr><tr><td align=right colspan=2>'+fontvalue+'<font color=ivory><b>Please enter their <u>valid</u> email address:  <input TYPE = "text"  size=25 NAME = "boxthree" CLASS="'+thefontsize+'"></td></tr></table></td></tr></table></FORM>';
	formwriter('referform');
	mainwriter(9);
	resetter();
}

function reminder() {	
	ctable=false;
	formvalue=14;
	maintext='<FORM '+domcheck+'"reminderform">'+fontvalue+'<br><ul><br><textarea rows=5 cols=55 wrap="yes" NAME = "boxone" CLASS="'+thefontsize+'">'+notabene+'</textarea><input TYPE = "hidden" NAME = "boxtwo" value="blank"></FORM>';
	formwriter('reminderform');
	fokus();
	mainwriter(99);
	lowerhelp(35);
}


filltype='';
dmension='';
bdborder='';
bdborderval=0;
bdwidth=0;
bdheight=0;
dimensionset=false;
bdposh='';
bdposv='';
backdropstring='';

function bdropform() {	
	ctable=false;
	formvalue=16;

if (filltype=='') {	backdropstring=bkdropimg;}
	maintext='<FORM '+domcheck+'"backdropform"><input TYPE = "hidden" NAME = "boxtwo" value="blank"><ul>'+fontvalue+'';
	if (document.layers) {maintext=maintext+'<br>';}
	if (filltype!='') {maintext=maintext+'<b>Image chosen: </b>'+bkdropimg;backdropstring=bkdropimg;}
	if (dmension=='default') {maintext=maintext+'<br><b>Default dimensions will be used.</b>';}
	if (dmension=='custom') {maintext=maintext+'<br><b>Custom dimensions: </b>';}
	if (bdwidth!==0){maintext=maintext+' width='+bdwidth+' px.';backdropstring=backdropstring+' width='+bdwidth;}
	if (bdheight!==0){maintext=maintext+' height='+bdheight+' px.';;backdropstring=backdropstring+' height= '+bdheight}
	if (bdborderval!=0&&bdborderval!=null) {maintext=maintext+'<br><b>Border size='+bdborderval;backdropstring=backdropstring+' border='+bdborderval;}
	if (bdborder=='no'||(bdborder=='yes'&&bdborderval==0)){maintext=maintext+'<br><b>No border selected.';backdropstring=backdropstring+' border=0';}
	if (bdposh!=''){maintext=maintext+'<br><b>Position: </b>'+ bdposh;backdropstring=backdropstring+' align='+bdposh;}
	if (filltype=='') {
		maintext=maintext+'<b>Please enter the URL address of the image you wish to use:</b><ul><input type="text" NAME = "boxone" CLASS="'+thefontsize+'" size=60 onfocus="this.select();" value='+(bkdropimg!=''?bkdropimg:'')+'><br><b>Then  select one of two background types: </b><br><TABLE cellpadding=0 cellspacing=0><TR><TD>'+fontvalue+'<input type="radio" onclick="bkdropimg=backdropform.boxone.value;filltype=\'full\';bdropform();" />'+fontvalue+jlink+'=\'single image\'; return true;" onclick="bkdropimg=backdropform.boxone.value;filltype=\'full\';bdropform();return false;">Single image</a> or </TD><TD><input type="radio" onclick="updatedyet=false;bkdropimg=backdropform.boxone.value;selfbackdrop(\'slice\');bdropform();" />'+fontvalue+jlink+'=\'tiled background\'; return true;" onclick="updatedyet=false;bkdropimg=backdropform.boxone.value;selfbackdrop(\'slice\');bdropform();">tiled, tessellated or sliced background?</a></TD></TR></TABLE>';}

	if (filltype=='full'&&dmension=='') {
		maintext=maintext+'<ul><b>Do you wish to use the image\'s original dimensions:<ul> <TABLE><TR><TD cellpadding=0 cellspacing=0>'+fontvalue+'<input type="radio" onclick="dmension=\'default\';bdropform();" />'+fontvalue+jlink+'=\'default dimensions\'; return true;" onclick="dmension=\'default\';bdropform();return false;"><b>Yes</b></a> or </TD><TD>'+fontvalue+'<b><input type="radio" onclick="dmension=\'custom\';bdropform();"/>'+fontvalue+jlink+'=\'custom dimensions\'; return true;" onclick="dmension=\'custom\';bdropform();return false;">No?</a></TD></TR></TABLE></ul>';}

	if (bdborder==''&&(dmension=='default'||dmension=='custom'&&(bdwidth!=0||bdheight!=0))) {
		maintext=maintext+'<ul><TABLE><TR><td>'+fontvalue+'<b>Do you require a border? <input type="radio" onclick="bdborder=\'yes\';bdropform();" />'+jlink+'=\'border?\'; return true;" onclick="bdborder=\'yes\';bdropform();return false;">Yes</a> or </TD><TD>'+fontvalue+'<b><input type="radio" onclick="bdborder=\'no\';bdropform();"/>'+jlink+'=\'no border\'; return true;" onclick="bdborder=\'no\';bdropform();return false;">No?</a></TD></TR></TABLE>';}

	if (dmension=='custom'&&bdborder==''&&bdwidth==0&&bdheight==0&&!dimensionset) {
		maintext=maintext+'<ul><input type="radio" onclick="bdwidth='+available_width+'; bdropform();" /><b> '+jlink+'=\'screen width?\'; return true;" onclick="bdwidth='+available_width+';bdropform();return false;">Fit to screen width?</a>&nbsp;[recommended]<br><input type="radio" onclick="bdheigth='+available_height+'; bdropform();" /><b> '+jlink+'=\'screen height?\'; return true;" onclick="bdheight='+available_height+';bdropform();return false;">Fit to screen height?</a><br><input type="radio" onclick="bdwidth='+available_width+'; bdheight='+available_height+';bdropform();" /> '+jlink+'=\'full screen?\'; return true;" onclick="bdwidth='+available_width+'; bdheight='+available_height+';bdropform();return false;">Fit to screen dimensions? [fullscreen] </a><br><input type="radio" onclick="dimensionset=true;bdropform();" /> '+jlink+'=\'full screen?\'; return true;" onclick="dimensionset=true;bdropform();return false;">Set your own dimensions?</a>';}

	if (dimensionset&&bdwidth==0&&bdheight==0) {
		maintext=maintext+'<ul><b>Select a screen width (height is scaled accordingly): <select name=bordersize onChange="bdwidth=backdropform.bordersize.value;bdropform();">';
			for (i=4;i<=160;i++) {maintext=maintext+'<option value='+i*10+'>'+i*10+'</option>';}
		maintext=maintext+'</select>';}

	if (bdborder=='yes'&&bdborderval==0){
		maintext=maintext+'<UL><b>Select a border size: <select name=bordersize onChange="bdborderval=backdropform.bordersize.value;bdropform();">';
			for (i=0;i<=100;i++) {maintext=maintext+'<option value='+i+'>'+i+'</option>';}
		maintext=maintext+'</select>';}

//if (bdposh==''&&((dmension=='default'&&(bdborder=='no'||bdborder=='yes'&&bdborderval!=0))|| dimensionset&&bdwidth!=0&&(bdborder=='no'||bdborder=='yes'&&bdborderval!=0))) {

	if (bdposh==''&&(bdborder=='no'||bdborder=='yes'&&bdborderval!=0)&&(dmension=='default'||bdheight!=0||(dimensionset&&(bdwidth!=0)))) {
		maintext=maintext+'<UL><b>'+fontvalue+'Now, select a position on the screen:<ul><input type="radio" onclick="bdposh=\'left\';bdropform();" /> '+jlink+'=\'to the left?\'; return true;" onclick="bdposh=\'left\';bdropform();return false;">over to the left</a><br><input type="radio" onclick="bdposh=\'center\';bdropform();" /> '+jlink+'=\'in the centre?\'; return true;" onclick="bdposh=\'center\';bdropform();return false;">in the centre? </a><br><input type="radio" onclick="bdposh=\'right\';bdropform();" /> '+jlink+'=\'to the right?\'; return true;" onclick="bdposh=\'right\';bdropform();return false;">to the right?</a></ul>';}
		else{
			if (filltype!='') {
				maintext=maintext+'<TABLE width='+available_width*0.3+' ><TR><td><CENTER>'+fontvalue+'<b>'+jlink+'=\'reset the form\';return true;" onclick="resetter();;return false;">Reset?</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + jlink + '=\'test the backdrop\';return true;" onclick="subform();return false;">Test?</a></b><br></TD></TR></TABLE>';}
	}

if (!updatedyet&&usrname!='anonymous') {maintext=maintext+'<TABLE width='+available_width*0.3+' ><TR><td><CENTER><table cellpadding=2 cellspacing=0 border=0><tr><td bgColor=#000045><center><b>'+fontvalue+jlink+'=\'update your settings\'; return true;" onclick="get_formcolours();textdestination=hidenfrmLyr; top10(6);return false;"><font color=red>You have modified your screen settings.<br><font color=white>To send the changes to the server, click here.</a></td></tr></table></td></tr></table>';}

	maintext=maintext+'</FORM>';
	formwriter('backdropform');

	if (filltype==''||!imagebank) {
		fokus();
		mainwriter(101); //changed from 12
		upperhelp(100);
		lowerhelp(32);
		if (!imagebank) {imagebank=true;}
	}
	else {buttoncontrol();}
}

function link_form() {	
	ctable=false;
	formvalue=8;
	maintext='<FORM '+domcheck+'"linksform">';

	if (!linksactive){
		maintext=maintext+fontvalue+'<b>To change your Links: </b><br><br></font><table border=0 cellpadding=2 width='+available_width*0.5+' cellspacing=0><tr><td>'+fontvalue+'<b>Select</b> the <b>Link Bay</B> you wish to change in the <b>Link Cache</b> by <b>clicking on it.</b> Make any changes to the link in the <B>Edit Link</b> field below, then <b>press '+jlink+'=\'submit\'; return true;" onclick="sub_linkform(); return false;">"submit?"</a> (or '+jlink+'=\'delete\'; return true;" onclick="defalt_link(); return false;">"delete?"</a></b>) and the Link Cache will update immediately.</td></tr><tr><td>'+fontvalue+((document.layers || document.all) ?'<br>' :'' )+'<B>Edit link:</b>&nbsp;&nbsp;&nbsp;&nbsp;'+(!document.layers&&!document.all ? '<INPUT TYPE="TEXT" class="'+thefontsize+'" SIZE="3" value="http://">':'<i>http://</i>')+' <input TYPE = "text"  size='+((document.layers) ? '25':'45')+' NAME = "newurl" onfocus=\'this.select()\' CLASS="'+thefontsize+'" value="[click on a Link Bay to populate this field]">  '+jlink+'=\'delete this link?\'; return true;" onclick="defalt_link(); return false;"><font class="lesser"><b>'+(document.layers ? '<font class="least">' : '')+'delete this link?</b>&nbsp;&nbsp;&nbsp;</font></a><br><input TYPE = "hidden" NAME = "urlnumber" value="0"></td></tr></table></FORM>';}
	else {
		if (linkcounter!=0) {maintext=fontvalue+'<b>Active Links.</b>'+maintext+'At present the links on the page are <b>"active".</b></font><ul>';}

		maintext=maintext+'<table border=0 cellspacing=5 cellpadding=5 width='+available_width*0.45+'><tr><td>'+fontvalue+'<b>Active links work similarly to normal HTML links.</b> Each opens a new browser window containing the website associated with that URL. Normal right click functionality has been disabled for the "active" links.</td></tr></table></FORM>';}
	formwriter('linksform');
	if (linkbank) {mainwriter(14);}
	else
	{controls(); buttoncontrol();}
	if (usrname!="anonymous") { upperhelp(21);} 
}


function linkform_opener() {
	if (linkcounter==0 && usrname!="anonymous") {linksactive=true;}
	linkstatus();
	textdestination=help1Lyr; top10(9); help1Lyr.visibility="visible";
}

function linkstatus() {
	if (linksactive) {clippit(13);linksactive=false;}
	else
	{clipout(13); linksactive=true; }
	link_form();
}



////////////////////////////////////////////
/////////////////////process forms//////////
////////////////////////////////////////////

function formwriter(val) {
	destination=theformHTML; 
	magiccontents();
	if (formvalue!=1) {theformLyr.visibility='visible';}
	formverifer(val);
}

function formverifer(val) { //DOM stuff for NS6+ unbelievable clunky - must rewrite
	if (document.all) {}
	else  
	if (document.layers) {val= eval('theformHTML.'+val);}
	else 
	if (document.getElementById) {val = eval(doc + val + htm);}
if (!document.all) {
if (formvalue==1) {loginform = val;}
if (formvalue==2) {secondform =val;}
if (formvalue==3) {updateform = val;}
if (formvalue==4) {settingform = val;}
if (formvalue==8) {linksform = val;}
if (formvalue==10) {mailform = val;}
if (formvalue==12) {referform = val;}
if (formvalue==14) {reminderform = val;}
if (formvalue==16) {backdropform = val;}
if (formvalue==19) {sendmailform = val;}
}
}

//function formfiller(formname, fieldname, fieldvalue){eval(formname+'.'+fieldname+'.value='+fieldvalue);}

function subform() {
if (formvalue==1) {submission('loginform'); return false;} // ! bug in ns6+ if single field form, return submits form twice
if (formvalue==2) {submission('secondform'); return false;}
if (formvalue==3) {submission('updateform'); return false;}
if (formvalue==4) {show_changes(); return false;}
if (formvalue==8) {sub_linkform(); return false;}
if (formvalue==10) {submission('mailform'); return false;}
if (formvalue==12) {submission('referform'); return false;}
if (formvalue==14) {testreminder=true;submission('reminderform'); return false;}
if (formvalue==16) {updatedyet=false;bkdropimg=backdropstring;selfbackdrop('full');bdropform();resetter();return false;}
if (formvalue==19) {submission('sendmailform'); return false;}
if (document.all&&formvalue==0) {f.submit();}
}


function submission(formname) {
	FIELD1 = eval(formname+'.boxone.value');
	FIELD2 = eval(formname+'.boxtwo.value');
	if (formvalue==2 || formvalue==3|| formvalue==12|| formvalue==19) {FIELD3 = eval(formname+'.boxthree.value');}

	if (formvalue==14||(FIELD1!= "" && FIELD2!="" && (formvalue==1||formvalue==10) )||(FIELD1!= "" && FIELD2!="" &&FIELD3!="" && formvalue!=1 && formvalue!=10) ) {

	if (FIELD1==FIELD2 &&formvalue==2) {lowerhelp(8);}
		else
	if (FIELD1==usrname &&formvalue==2) {lowerhelp(9);}
		else {
	FIELD2=FIELD2.toLowerCase();
	FIELD3=FIELD3.toLowerCase();
	if (formvalue!=14&&formvalue!=19) {
			FIELD1=FIELD1.toLowerCase();
			FIELD1= ignoreSpaces(FIELD1); 
				}
	FIELD2= ignoreSpaces(FIELD2); 

		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(FIELD3)&& formvalue!=1 || formvalue==1 || formvalue==14 || (formvalue==10||formvalue==19) && /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(FIELD2)){
			textdestination=hidenfrmLyr;
			if (formvalue==1) {top10(1);}
			if (formvalue==2) {top10(2);}
			if (formvalue==3) {top10(5);}
			if (formvalue==10) {top10(3);}
			if (formvalue==12) {top10(15);}
			if (formvalue==19) {top10(19);}
			if (formvalue==14) {
				if (testreminder) {
					testreminder=false;
					localreminder=true;notabene=FIELD1;mainwriter(1);} 
				else {top10(16);}
			}
		}
		else {
			lowerhelp(11);}
	}
}
		else {
if (formvalue==1 || formvalue==2) {lowerhelp(10);}
else
if (formvalue==3) {lowerhelp(12);}
else
if (formvalue==10) {lowerhelp(111);}
else
{
lowerhelp(121); // need to fill in fields');
}
}
}

function resetter() {
	helpLyr.visibility="hidden";
	if (formvalue==1) {var formname='loginform'; DelCookie('username'); firstform();}
	if (formvalue==2) {var formname='secondform'; lowerhelp(16);}
	if (formvalue==3) {var formname='updateform';}
	if (formvalue==10) {var formname='mailform';lowerhelp(24);}
	if (formvalue==12) {var formname='referform';lowerhelp(29);}
	if (formvalue==14) {
		 localreminder=true;notabene='default';reminder();}
	else
	if (formvalue==16) {
		filltype='';
		bdborderval=0;
		bdheight=0;
		bdwidth=0;
		bdposh='';
		bdposv='';
		bdborder='';
		dimensionset=false;
		dmension='';
		bdropform();} 

	else	{eval(formname+'.reset()');}
	fokus();
}

function fokus(){

		if (formvalue==1) {
			if ((document.layers&&GetCookie('username')==null) || usrname==null ||usrname=="anonymous" ) {
				loginform.boxone.focus();} 
			else {loginform.boxtwo.focus();}
			}
		if (formvalue==2) {
			if (quickchecker=="noname") {secondform.boxtwo.focus();} 
			else {secondform.boxone.focus();}
			}
		if (formvalue==3) {updateform.boxone.focus();}
		if (formvalue==8 && !linksactive) {linksform.newurl.focus();}
		if (formvalue==10) {mailform.boxtwo.focus();}
		if (formvalue==12) {referform.boxone.focus();}
		if (formvalue==14) {reminderform.boxone.focus();}
		if (formvalue==16) {backdropform.boxone.focus();}
		if (formvalue==19) {sendmailform.boxone.focus();}
}

