function chkpass(pas1, pas2){
	if(pas1==pas2){
		return false;
	}
	else{
		alert('Senhas não conferem!'); 
		return true;
	}
}

function chkcampos(formulario, obrigatorios, grupos){
	var i;
	var incompleto = null;
	var elemento;
	var a;
	var checado;
	obrigatorios=obrigatorios.split(',');
	for(i=0;i<obrigatorios.length;i++){
		elemento=formulario.elements[obrigatorios[i]];
		if(elemento.type=="text" || elemento.type=="textarea" || elemento.type=="select-one" || elemento.type=="password") {
			elemento.style.backgroundColor="#FFFFFF";
			if(elemento.value == ''){
			incompleto=elemento;
			incompleto.style.backgroundColor="#E2FFEB";
			}
		}
		else if(elemento.length){
			checado=false;
			for(a=0;a<elemento.length;a++){
				elemento[a].style.width="12px";
				elemento[a].style.height="12px";
				if(elemento[a].checked){
					checado=true;
				}
			}
			if(!checado){
				for(a=0;a<elemento.length;a++){
					incompleto=elemento[a];
					incompleto.style.width="20px";
					incompleto.style.height="20px";
				}
			}
		}
	}
	if(grupos){
		grupos=grupos.split(';');
		var teste;
		for(i=0;i<grupos.length;i++){
			elemento=grupos[i].split(',');
			if(formulario.elements[elemento[0]].type=="text"){
				checado=false;
				for(a=0;a<elemento.length;a++){
					formulario.elements[elemento[a]].style.backgroundColor="#FFFFFF";
					if(elemento[a].value){
						checado=true;
					}
				}
				if(!checado){
					for(a=0;a<elemento.length;a++){
						formulario.elements[elemento[a]].style.backgroundColor="#E2FFEB";
						incompleto=formulario.elements[elemento[a]];
					}
				}
			}
			else if(formulario.elements[elemento[0]].type=="checkbox"){
				checado=false;
				for(a=0;a<elemento.length;a++){
					formulario.elements[elemento[a]].style.width="12px";
					formulario.elements[elemento[a]].style.height="12px";
					if(formulario.elements[elemento[a]].checked){
						checado=true;
					}
				}
				if(!checado){
					for(a=0;a<elemento.length;a++){
						formulario.elements[elemento[a]].style.width="20px";
						formulario.elements[elemento[a]].style.height="20px";
						incompleto=formulario.elements[elemento[a]];
					}
				}
			}
			else if(formulario.elements[elemento[0]][0].type=="hidden"){
				checado=false;
				for(a=0;a<elemento.length;a++){
					formulario.elements[elemento[a]][1].style.width="12px";
					formulario.elements[elemento[a]][1].style.height="12px";
					if(formulario.elements[elemento[a]][1].checked){
						checado=true;
					}
				}
				if(!checado){
					for(a=0;a<elemento.length;a++){
						formulario.elements[elemento[a]][1].style.width="20px";
						formulario.elements[elemento[a]][1].style.height="20px";
						incompleto=formulario.elements[elemento[a]][1];
					}
				}
			}
		}
	}
	if(incompleto != null){
		alert('Opa! Alguns campos não foram preenchidos. Favor preencha os campos em destaque. Obrigado!');
		return true;
	}
	else{
		return false;
	}
}