function send_mail() {	

formwid=(available_width*0.38);
theformLyr.left=(parseInt(resultsLyr.left))+(available_width*0.49);
	formvalue=1;
	maintext='<FORM '+domcheck+'="sendmailform"><table border=1 cellpadding=2 cellspacing=0 width='+(formwid-18)+' bgcolor=chocolate><tr><td><table border=0 cellpadding=10 cellspacing=0 width='+(formwid-20)+' bgcolor=white><tr><td><table border=0 cellpadding=0 cellspacing=0 cols=3 bgcolor=goldenrod width='+(formwid-40)+'><tr><td valign=top><img src='+image5.src+'></td><td colspan=2 valign=top align=right><img src='+image6.src+'></td></tr><tr><td align=right>'+fontvalue+'<font color=white><b>What\'s your name? </td><td colspan=2 width=1><input TYPE = "text"  size=17 name = "boxone" CLASS="'+thefontsize+'"></td></tr><tr><td align=right>'+fontvalue+'<font color=white><b>What\'s your email address? </td><td colspan=2 width=1> <input TYPE = "text" name = "boxtwo"  size=17 CLASS="'+thefontsize+'"></td></tr><tr><td colspan=3><br><center><img src='+strip.src+' width='+(formwid-50)+' height=3></center></td></tr><tr><td align=center colspan=3><TEXTAREA rows=10 cols=45 wrap="yes" '+domcheck+'= "boxthree" CLASS="'+thefontsize+'" onfocus="this.select();">- Please enter your message or your request to contribute here -</textarea><br></td></tr><tr><td colspan=3><center><img src='+strip.src+' width='+(formwid-50)+' height=3></center><br></td></tr><td align=center>'+fontvalue+'<a href=# onclick="subform();return false;"><font color=white><b>Click <u>here</u> to<BR>send your message</b></font></a></td><td align=center>'+fontvalue+'<a href=# onclick="send_mail();return false;"><font color=white><b>Click <u>here</u> to<BR>reset the form</b></font></a></td><td width=20><br></td></tr><tr><td colspan=3><br></td></tr></table></td></tr></table></td></tr></table></FORM><blockquote><p align=right>'+fontvalue+'<font class="lesser"><font class="lesser" color=black><i><b>*** Disclaimer<br>Your personal information is your own private property.<br>No information gathered here will be ever used for either personal or financial gain, nor will it be used for advertising purposes. The information you submit to sonik-systems.com will not be knowingly or wittingly passed on to any third parties, under any circumstances.</b></i></font></font></p></blockquote>';

	formwriter('sendmailform');
}

function formwriter(val) {
	destination=theformHTML; 
	magiccontents();
	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) {sendmailform = val;}
	sendmailform.boxone.focus();
}

function subform() {submission('sendmailform'); return false;}

function submission(formname) {
	FIELD1 = eval(formname+'.boxone.value');
	FIELD2 = eval(formname+'.boxtwo.value');
	FIELD3 = eval(formname+'.boxthree.value');

	if (FIELD1!= "" && FIELD2!="" &&FIELD3!="") {

		FIELD2=FIELD2.toLowerCase();
		FIELD3=FIELD3.toLowerCase();
		FIELD2= ignoreSpaces(FIELD2); 

		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(FIELD2)){
			textdestination=hidenfrmLyr;
			top10(5);
		}
		else {
			showerror(1);
		}
	}
	else {
	showerror(2);
	}
}

function ignoreSpaces(string) {
	var temp = "";
	string = '' + string;
	splitstring = string.split(" ");
	for(i = 0; i < splitstring.length; i++)
	temp += splitstring[i];
	return temp;
}


function showerror(val) {

maintext='<table cellpadding=0 cellspacing=0 border=1 bgcolor=darkred><tr><TD><table cellpadding=0 cellspacing=0 cols=2 width='+available_width*0.4+' height='+available_height*0.2+' border=0><tr height=2.85><TD align=left valign=top width=100% height=2.85 bgcolor=red><font color=white><font face=arial>'+fontvalue+'<font class="lesser"><b>&nbsp;Error Message</b></font></font></font></font></td><td width=1 align=right height=2.85 bgcolor=red valign=center><a href=# onmouseout="window.status=\'\';return true;" onmouseover="window.status=\'close the window\';return true;" onclick="errorLyr.visibility=\'hidden\';return false;"><img src='+naimg.src+' border=0 align=top alt="close&nbsp;the&nbsp;window"></a></td></tr><tr><td colspan=2 bgcolor=#cccccc><center>'+fontvalue+'<font color=black>';

if (val==1) {maintext=maintext+'Sorry, your email address appears to be in the wrong format.<br>Please check it and try again.'}
if (val==2) {maintext=maintext+'You must complete all three fields before<br>you send the message.'}

//<input type=button size=20 value="ok" onclick="errorLyr.visibility=\'hidden\';return false;">
maintext=maintext+'<br><br><button onclick="errorLyr.visibility=\'hidden\';return false;" style="background-color: black;"> <font color="gold"><b>&nbsp;&nbsp;&nbsp;&nbsp;OK&nbsp;&nbsp;&nbsp;&nbsp;</b></font></button></td></tr></table></td></tr></table>';
destination=errorHTML;
magiccontents();
errorLyr.visibility='visible';
}
