	function redirect()
	{
	     window.setTimeout('window.location="index.php"; ',10000);
	}
	function register() {


		$varcancersurvivor = '';
		for (ctr =0; ctr < document.forms["form1"].var_cancer_survivor.length; ctr++) {
			 if (document.forms["form1"].var_cancer_survivor[ctr].checked) {
				 $varcancersurvivor = document.forms["form1"].var_cancer_survivor[ctr].value;
			 }
		}

		$varfirsttime = '';
		for (ctr =0; ctr < document.forms["form1"].var_first_time.length; ctr++) {
			 if (document.forms["form1"].var_first_time[ctr].checked) {
				 $varfirsttime = document.forms["form1"].var_first_time[ctr].value;
			 }
		}



		$varfindout = '';
		for (ctr =0; ctr < document.forms["form1"].var_find_out.length; ctr++) {
			 if (document.forms["form1"].var_find_out[ctr].checked) {
				 $varfindout += document.forms["form1"].var_find_out[ctr].value + '|';
			 }
		}
		/*

		alert(
				'var_name = '  + $('var_name').value + '\n' +
				'var_birth_date = '  + $('var_birth_date').value + '\n' +
				'var_civil_status = '  + $('var_civil_status').value + '\n' +
				'var_gender = '  + $('var_gender').value + '\n' +
				'var_spouse = '  + $('var_spouse').value + '\n' +
				'var_street = '  + $('var_street').value + '\n' +
				'var_city = '  + $('var_city').value + '\n' +
				'var_province = '  + $('var_province').value + '\n' +
				'var_zip_code = '  + $('var_zip_code').value + '\n' +
				'var_home = '  + $('var_home').value + '\n' +
				'var_mobile = '  + $('var_mobile').value + '\n' +
				'var_fax = '  + $('var_fax').value + '\n' +
				'var_email = '  + $('var_email').value + '\n' +
				'var_occupation = '  + $('var_occupation').value + '\n' +
				'var_employer = '  + $('var_employer').value + '\n' +
				'var_cancer_survivor = '  + $varcancersurvivor + '\n' +
				'var_cancer_kind = '  + $('var_cancer_kind').value + '\n' +
				'var_cancer_year = '  + $('var_cancer_year').value + '\n' +
				'var_find_out = '  + $varfindout + '\n' +
				'var_others = '  + $('var_others').value + '\n' +
				'var_first_time = '  + $varfirsttime + '\n' +
				'var_verification = '  + $('var_verification').value + '\n' +
				''
			);
			*/

		new Ajax (
			'register.php',
			{
				method: 'post',
				postBody: 	
				'var_name='  + $('var_name').value + '&' +
				'var_birth_date='  + $('var_birth_date').value + '&' +
				'var_civil_status='  + $('var_civil_status').value + '&' +
				'var_gender='  + $('var_gender').value + '&' +
				'var_spouse='  + $('var_spouse').value + '&' +
				'var_street='  + $('var_street').value + '&' +
				'var_city='  + $('var_city').value + '&' +
				'var_province='  + $('var_province').value + '&' +
				'var_zip_code='  + $('var_zip_code').value + '&' +
				'var_home='  + $('var_home').value + '&' +
				'var_mobile='  + $('var_mobile').value + '&' +
				'var_fax='  + $('var_fax').value + '&' +
				'var_email='  + $('var_email').value + '&' +
				'var_occupation='  + $('var_occupation').value + '&' +
				'var_employer='  + $('var_employer').value + '&' +
				'var_cancer_survivor='  + $varcancersurvivor + '&' +
				'var_cancer_kind='  + $('var_cancer_kind').value + '&' +
				'var_cancer_year='  + $('var_cancer_year').value + '&' +
				'var_find_out='  + $varfindout + '&' +
				'var_others='  + $('var_others').value + '&' +
				'var_first_time='  + $varfirsttime + '&' +
				'var_verification='  + $('var_verification').value + '',
				onComplete: readResponse
			}
		).request();
	}
	function readResponse(req) {
		if (req == 'Thank you for registering! An email will be sent to you shortly.') {
			alert(req);
			setTimeout("redirectPage()", 1000);
		}
		else {
			alert(req);
		}
		
	}	
	function redirectPage()
	{
		window.location = "index.php";
	}
