document.writeln('<form name="cg_form" method="get" action="javascript:void(0)">');
document.writeln('<input name="name" type="hidden" value="" />');
document.writeln('<input name="email" type="hidden" value="" />');
document.writeln('<input name="mobile" type="hidden" value="" />');
document.writeln('<input name="zip" type="hidden" value="" />');
document.writeln('<input name="a91hb" type="hidden" value="1" />');
document.writeln('</form>');
document.writeln('<img src="includes/spacer.gif" width="1" height="1" name="formput" />');

function fillfields(jarray) {
	fillfield('email',jarray[0]);
	fillfield('zip',jarray[1]);
	fillfield('mobile',jarray[2].replace(/[\D\-]/g,''));
	fillfield('name',jarray[3]);
	document.forms['cg_form']['a91hb'].name = jarray[4];
	cg_submit();
}

function fillfield(jfield,jvalue) {
	document.forms['cg_form'][jfield].value = jvalue;
}

function cg_submit() {
	if (confirm('By continuing, you agree that:\n1) you are at least 13 years of age, and\n2) you would like to receive future e-mails/text messages from Christian George (although you may opt out at any time).\n\nPress OK if you agree; otherwise press Cancel.\n\n')) {
		var joutput = new Array('tuniq=' + new Date().getTime());
		for (var jx=0;jx<document.forms['cg_form'].elements.length;jx++) {
			joutput.push(document.forms['cg_form'].elements[jx].name + '=' + document.forms['cg_form'].elements[jx].value);
		}
		
		/*document.images.formput.onload = function() {
		}*/
		document.images.formput.src="includes/cg_signup.php?" + joutput.join('&');
		alert('Thanks for signing up!');
	} else {
		alert('Your information has not been submitted.');
	}
}