function notBlank(a) {
//pergunta.pergunta, pergunta.resposta, categoria_id, nome
	if (a.value == ''){
		alert ('Este campo deve ser obrigatoriamente preenchido.');
		a.focus();
		return false;
	}
	return true;
}
function notChecked(a, count, msg) {
	for (x=0; x < count; x++) {
		if (a[x].checked == true) {
			return true;
		}
	}
//	alert(a);
	alert(msg);
	return false;
}
function notChecked2(a, begin, count, msg) {
	for (x=0, y=begin; x < count; x++, y++) {
		if (a.elements[y].checked == true) {
			return true;
		}
	}
	alert(msg);
	return false;
}

function vP01(a01, a02, a03, a04, a05, a06, a07, a08, a09, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, a21, a22, a23) {
	if (		 notChecked(a01, 3, 'Fill label name.') && notBlank(a02) && notBlank(a03) && notChecked(a04, 2, 'Fill gender.') && notBlank(a05) && notBlank(a06) && notChecked(a07, 2, 'Fill preferred mailing address') && notBlank(a08) && notBlank(a09) && notBlank(a10) && notBlank(a11) && notBlank(a12) && notBlank(a13) && notBlank(a14) && notBlank(a15) && notBlank(a16) && notBlank(a17) && notBlank(a18) && notBlank(a19) && notBlank(a20) && notBlank(a21) && notBlank(a22) && notBlank(a23)) {
		return true;
	}
	else {
		return false;
	}
}

function vP02(a01, a02, a03, a04, a05, a06, a07) {
	if (notChecked(a01, 5, 'Fill business environment') && notChecked2(a02, 5, 23, 'Fill your division industry type') && notChecked2(a02, 30, 5, 'Fill your industry classification') && notChecked2(a02, 70, 8, 'Fill why you are joining APICS') && notChecked2(a02, 80, 8, 'Fill membership involvement') && notChecked(a03, 2, 'Fill if your division is or is not involved in gov. contracting') && notChecked(a04, 17, 'Fill primary area of responsability') && notChecked(a05, 5, 'Fill your role in product acquisition') && notChecked(a06, 4, 'Fill your job title function') && notChecked(a07, 5, 'Fill how many employees are at your location')){
		return true;
	}
	return false;
}
