// JavaScript Document
function change(id, newClass) {
	identity=document.getElementById(id);
	identity.className=newClass;
}

function get_radio_value(targ){
	for (var i=0; i < targ.length; i++)
	{
		if (targ[i].checked)
		{
			return(targ[i].value);
		}
	}
}

function test_cont(targ, type){
	var email = /^[^@]+@[^@.]+\.[^@]*\w\w$/;
	var phone = /^\+?[0-9 ()-]+[0-9]$/;
	var nmbr = /[0-9]/;
	if(type=='name' && targ.value.length<3 || type=='email' && !email.test(targ.value) || type=='phone' && !phone.test(targ.value) || type=='number' && !nmbr.test(targ.value) || type=='null' && targ.value.length<1){
		targ.className='conf_input_alert';
		error=true;
	}else{
		targ.className='conf_input';
	}
}
function club_volastic(){
	error=false;
	test_cont(document.form.card_num, 'name');
	test_cont(document.form.name, 'name');
	test_cont(document.form.company, 'name');
	test_cont(document.form.company_position, 'name');
	test_cont(document.form.company_web, 'name');
	test_cont(document.form.address, 'name');
	test_cont(document.form.phone, 'phone');
	test_cont(document.form.email, 'email');
	if(error === true){
		alert('please correct the fields in yellow');
		return false;
	}
	return true;
}

