
//
// feedback form to appear within exhibits / pieces for people to contribute to interactive art, etc.
//

// hide the frigging address details for the form from frigging robots!
var nc_tn = "act";  nc_tn2 = "mycroft.cont";

var toname = (nc_tn2 + nc_tn);

var email_prompt = "Your email address";
var name_prompt = "Your first name";

		function check_email(address) {
			if ((address == "") || (address.indexOf ('@') == -1) || (address.indexOf ('.') == -1))
				return false;
			return true;
		} // function check_email
		
		function verify (aform) {
			if ((aform.TheirName.value=="") || (aform.TheirName.value==name_prompt)) {
				alert("Please let me know your first name - seems so impersonal, otherwise.");
				this.document.contact_form.TheirName.focus();
				return false;
			}
			if ((aform.TheirEmail.value=="")  || (aform.TheirEmail.value==email_prompt)) {
				alert("Please enter your email address! (used only to reply, we promise)");
				this.document.contact_form.TheirEmail.focus();
				return false;
			}
			if (!check_email(document.aform.TheirEmail.value)) {
				alert("Ack! Please use a regular email address in the form of:\n yourname@domain.ext");
				this.document.contact_form.TheirEmail.focus();
				return false  
			}
			if ((aform.EmailBody.value=="") || (aform.EmailBody.value=="Leave me your thoughts here...")) {
				alert("You really have nothing to say?\n(if so, please type it in the text box)");
				this.document.contact_form.EmailBody.focus();
				return false;
			}
		} // function verify
	
	
function send_feedback (msg) {
	document.write ('<FORM  name="contact_form" action="http://virtualfulfillmentarts.com/scgi-bin/FormMail.pl" method="post" onSubmit="return verify(this)">	');

	document.write (	'<INPUT type="hidden" value="http://backsideoflove.com/RL/feedback_thanks.html" name=redirect> ');
	document.write (	'<INPUT type="hidden" value="1" name=print_blank_fields> ');
	document.write (	'<INPUT type="hidden" value="' + nc_tn2 + nc_tn + '@backsideoflove.com" name=email> ');
	document.write (	'<INPUT type="hidden" value="(' + toname + ')" name=subject> ');
	document.write (	'<INPUT type="hidden" value="' + toname + '@backsideoflove.com" name=recipient>');

	document.write ('<TABLE width="1" border="1" bordercolor="#000066" bgcolor="#111111" align="center"><TR>');


	document.write ('<TD align="center" valign="middle" width="75%" height="1"> ');
	document.write (	'<TABLE width="1" border="0" align="center"><TR>');

	document.write (		'<TD class="instruction_style" align="center" valign="middle"  width="100%" height="1" colspan="2">');
	document.write (			'Comment on this!');
	document.write (		'</TD>');
	document.write (	'</TR>');
	document.write (	'<TR>');

	document.write (		'<TD align="center" valign="bottom" width="50%" height="1"> ');
	document.write (			'<span class="instruction_small_style">your first name:</span>');
	document.write (		'</TD>');
	document.write (		'<TD align="center" valign="bottom"  width="50%" height="1" >');
	document.write (			'<span class="instruction_small_style">your email (used only in-house - we <a href="http://backsideoflove.com/help/privacy.html" target="_blank">promise</a>:</span>');
	document.write (		'</TD>');
	document.write (	'</TR>');	
	
	document.write (	'<TR>');	
	document.write (		'<TD align="center" valign="middle" width="50%" height="1"> ');
	document.write (			'<INPUT  name="TheirName" value="' + name_prompt + '" onMouseover="window.status=\'Let us know your first name, please\'" onFocus="this.value=\'\'" size="25" tabindex="1" >');
	document.write (		'</TD>');
	document.write (		'<TD align="center" valign="middle"  width="50%" height="1" >');
	document.write (			'<INPUT size="25" name="TheirEmail" onFocus="this.value=\'\'" onMouseover="window.status=\'I need an email address to reply, of course...\'" value="' + email_prompt + '" tabindex="2">');
	document.write (		'</TD>');
	document.write (	'</TR>');	
	document.write (	'<TR>');	
	document.write (		'<TD align="center" valign="middle"  width="100%" height="1"  colspan="2">');
	document.write (			'<TEXTAREA name="EmailBody" rows="4" cols="50" tabindex="3" value="Leave me your thoughts here...">');
	document.write (			'</TEXTAREA>');
	document.write (		'</TD>');
	document.write (	'</TR>');	
	document.write (	'<TR>');	
	document.write (	'</TR>');	
	document.write (	'<TR>');	
	document.write (		'<TD align="center" valign="middle"  class="instruction_small_style" height="1"  colspan="2">');

	document.write (			'<TABLE width="1" height="1" border="0" align="center"><TR>');
	document.write (					'<TD class="instruction_small_style" align="right" valign="middle" height="1">');
	document.write (						'<input type="checkbox" name="OkayToPrintEmail" value="checkbox" tabindex="4" />');
	document.write (					'</TD>');
	document.write (					'<TD nowrap class="instruction_small_style" align="left" valign="middle" height="1">');
	document.write (						'if we print your feedback do you wish your email included?');
	document.write (					'</TD>');
	document.write (				'</TR>');
	document.write (			'</TABLE>');

	document.write (		'</TD>');
	document.write (	'</TR>');	
	document.write (		'<TD align="center" valign="middle"  width="100%" height="1" colspan="2">');
	document.write (			'<input TYPE="SUBMIT" VALUE="  send this off  " name="submit">');
	document.write (		'</TD>');
	document.write (	'</TR>');
	document.write (	'</TABLE>');
	document.write ('</TD>');
	document.write ('</TABLE>');
	
	document.write ('</FORM>');
						
} // send_contact_form

	
