function ClickAccao(tipo){
var Obj=document.DADOS;
switch (tipo) {
	case "local":
		Obj.frm_localidade.disabled=true;
		Obj.frm_localidade.value="";
		break;
	case "proprio":
		Obj.frm_localidade.disabled=false;
		break;
	case "email":
		Obj.frm_hora.disabled=true;
		Obj.frm_hora.value="";
		formacontacto.innerHTML="Email";
		break;
	case "fax":
		Obj.frm_hora.disabled=true;
		Obj.frm_hora.value="";
		formacontacto.innerHTML="Fax";
		break;
	case "telefone":
		Obj.frm_hora.disabled=false;
		formacontacto.innerHTML="Telefone";
		break;
	case "telemovel":
		Obj.frm_hora.disabled=false;
		formacontacto.innerHTML="Telem&oacute;vel";
		break;
}
}

function ValidarServicos() {

	var Elemento; 
	var ElementoH;
	var i;
	var Obj=document.DADOS;

	Elemento = Obj.frm_empregados;
	ElementoH = Obj.EMPREGADOS;
	var condicao=false;	
	for (i=0; i<Elemento.length; i++) {
		if (Elemento[i].checked) { 
			condicao=true;
			ElementoH.value=Elemento[i].value;
		}
	}	
	if (condicao) {
		// OK
	}else{
		alert("Por favor preencha o campo COM OU SEM EMPREGADOS");
		return false;		
	}
		

	Elemento = Obj.frm_local;
	ElementoH = Obj.LOCAL;
	var condicao=false;	
	for (i=0; i<Elemento.length; i++) {
		if (Elemento[i].checked) { 
			condicao=true;
			ElementoH.value=Elemento[i].value;
		}
	}	
	if (condicao) {
		// OK
	}else{
		alert("Por favor preencha o campo NOSSO LOCAL OU DO PRÓPRIO");
		return false;		
	}

	
	Elemento = Obj.frm_localidade;
	ElementoH = Obj.LOCALIDADE;
	if (Obj.LOCAL.value=="do proprio") {
		if (isEmpty(Elemento.value)) {
			Elemento.focus();
			alert("Por favor preencha o campo LOCALIDADE");
			return false;		
		}else{
			ElementoH.value=Elemento.value;
		}
	}else{
		ElementoH.value = "Vazio";
	}


	Elemento = Obj.frm_pessoas;
	ElementoH = Obj.PESSOAS;
	if (isEmpty(Elemento.value)) {
		Elemento.focus();
		alert("Por favor preencha o campo NUMERO DE PESSOAS");
		return false;		
	}else{
			ElementoH.value=Elemento.value;
	}


	Elemento = Obj.frm_dataevento;
	ElementoH = Obj.DATAEVENTO;
	if (isEmpty(Elemento.value)) {
		Elemento.focus();
		alert("Por favor preencha o campo DATA DO EVENTO");
		return false;		
	}else{
			ElementoH.value=Elemento.value;
	}


	Elemento = Obj.frm_nome;
	ElementoH = Obj.NOME;
	if (isEmpty(Elemento.value)) {
		Elemento.focus();
		alert("Por favor preencha o campo O SEU NOME");
		return false;		
	}else{
			ElementoH.value=Elemento.value;
	}


	Elemento = Obj.frm_formacontacto;
	ElementoH = Obj.FORMACONTACTO;
	var condicao=false;	
	for (i=0; i<Elemento.length; i++) {
		if (Elemento[i].checked) { 
			condicao=true;
			ElementoH.value=Elemento[i].value;
		}
	}	
	if (condicao) {
		// OK
	}else{
		alert("Por favor preencha o campo FORMA DE CONTACTO");
		return false;		
	}


	Elemento = Obj.frm_formacontacto_descricao;
	ElementoH = Obj.FORMACONTACTO_DESCRICAO;
	if (Obj.FORMACONTACTO.value=="email") {
	    if (isEmail(Elemento.value)) {
			ElementoH.value = Elemento.value;
		} else {
			Elemento.focus();
			alert("O campo EMAIL não está correcto!\nPor favor corriga.");
			return false;
		}
	}else{
		var descricao = Obj.FORMACONTACTO.value;
		descricao = descricao.toUpperCase();
		if (isEmpty(Elemento.value)) {
			Elemento.focus();
			alert("Por favor preencha o campo FORMA DE CONTACTO " + descricao);
			return false;		
		}else{
			ElementoH.value=Elemento.value;
		}
	}



	Elemento = Obj.frm_hora;
	ElementoH = Obj.HORA;
	if ((Obj.FORMACONTACTO.value=="telefone")||(Obj.FORMACONTACTO.value=="telemovel")) {
		if (isEmpty(Elemento.value)) {
			ElementoH.value="Vazio";
		}else{
			ElementoH.value=Elemento.value;
		}
	}else{
		ElementoH.value="Vazio";
	}


	return true;

}
