<!--
function form_check(f)
{
	inputs=[];
	inputs['first_name']=["Please provide your first name.",2];
	inputs['last_name']=["Please provide your last name.",2];
	inputs['phone1_p1']=["Sorry, your phone's area code appears to be invalid. Please check the number and try again.",3,/[2-9]{1}[0-8]{1}[0-9]{1}/g];
	inputs['phone1_p2']=["Sorry, your phone's prefix appears to be invalid. Please check the number and try again.",3,/[2-9]{1}[0-9]{2}/g];
	inputs['phone1_p3']=["Sorry, your phone's suffix appears to be invalid. Please check the number and try again.",4,/[0-9]{4}/g];
	inputs['street']=["Please provide you street address."];
	inputs['city']=["Please provide you city."];
	inputs['state']=["Please provide you state."],2;
	inputs['email']=["Please provide a valid email address.",1,/^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,6}|[0-9]{1,3})(\]?)$/];
	inputs['zip']=["Please provide your zip code.",5];
	var inp=$$('input',f);
	for(j in inp){
		if(typeof(inp[j]) == "object"){
			var fail=0;
			var i=inp[j];
			if(inputs[i.id]){
				if((inputs[i.id][1] && empty(i,inputs[i.id][1])) || empty(i)){
					fail=1;
				}
				if(inputs[i.id][2]){
					var filter=inputs[i.id][2];
					var res=filter.test(i.value).toString();
					void(filter.test(i.value)+'_'+res);
					if(res==='false')fail=1;
				}
				if(fail){
					alert(inputs[i.id][0]);
					i.focus();
					return false;
				}
			}
		}
	}

	if(window.document.getElementById('dyes') && !window.document.getElementById('dyes').checked && !window.document.getElementById('dno').checked){
		alert('Are you struggling with credit card debt?');
		window.document.getElementById('dyes').focus();
		return false;
	}

	if(window.fc_under){
		window.fc_under.close();
	}

	if(typeof page_loading == "function")page_loading(1);

	return true;
}
//-->

