function formtCep(e,src,mask) {
if(window.event) { _TXT = e.keyCode; }
else if(e.which) { _TXT = e.which; }
if(_TXT > 47 && _TXT < 58) {
 var i = src.value.length; var saida = mask.substring(0,1); var texto = mask.substring(i)
 if (texto.substring(0,1) != saida) { src.value += texto.substring(0,1); }
    return true; } else { if (_TXT != 8) { return false; }
 else { return true; }
}
}

function formtCpf(e,src,mask) {
if(window.event) { _TXT = e.keyCode; }
else if(e.which) { _TXT = e.which; }
if(_TXT > 47 && _TXT < 58) {
 var i = src.value.length; var saida = mask.substring(0,1); var texto = mask.substring(i)
 if (texto.substring(0,1) != saida) { src.value += texto.substring(0,1); }
    return true; } else { if (_TXT != 11) { return false; }
 else { return true; }
}
}

function formtRg(e,src,mask) {
if(window.event) { _TXT = e.keyCode; }
else if(e.which) { _TXT = e.which; }
if(_TXT > 47 && _TXT < 58) {
 var i = src.value.length; var saida = mask.substring(0,1); var texto = mask.substring(i)
 if (texto.substring(0,1) != saida) { src.value += texto.substring(0,1); }
    return true; } else { if (_TXT != 11) { return false; }
 else { return true; }
}
}

function formtTel(e,src,mask) {
if(window.event) { _TXT = e.keyCode; }
else if(e.which) { _TXT = e.which; }
if(_TXT > 47 && _TXT < 58) {
 var i = src.value.length; var saida = mask.substring(0,1); var texto = mask.substring(i)
 if (texto.substring(0,1) != saida) { src.value += texto.substring(0,1); }
    return true; } else { if (_TXT != 8) { return false; }
 else { return true; }
}
}

function verifica_campo(){
	if (document.frmCadastrar.resposta.value=="") {
		alert("O campo resposta é obrigatório!")
		document.frmCadastrar.resposta.focus()
		return false
	}
	if (document.frmCadastrar.nome.value=="") {
		alert("O campo nome é obrigatório!")
		document.frmCadastrar.nome.focus()
		return false
		}
	if (document.frmCadastrar.endereco.value=="") {
		alert("O campo endereço é obrigatório!")
		document.frmCadastrar.endereco.focus()
		return false
	}
	if (document.frmCadastrar.cidade.value=="") {
		alert("O campo cidade é obrigatório!")
		document.frmCadastrar.cidade.focus()
		return false
	}
	if (document.frmCadastrar.uf.value=="") {
		alert("O campo UF é obrigatório!")
		document.frmCadastrar.uf.focus()
		return false
	}
	if (document.frmCadastrar.email.value=="") {
		alert("O campo e-mail é obrigatório!")
		document.frmCadastrar.email.focus()
		return false
	}
	if (document.frmCadastrar.cep.value=="") {
		alert("O campo cep é obrigatório!")
		document.frmCadastrar.cep.focus()
		return false
	}
	if (document.frmCadastrar.cpf.value=="") {
		alert("O campo cpf é obrigatório!")
		document.frmCadastrar.cpf.focus()
		return false
	}
	if (document.frmCadastrar.rg.value=="") {
		alert("O campo rg é obrigatório!")
		document.frmCadastrar.rg.focus()
		return false
	}
}


function escolher_pizza()
{
	  pizza = document.getElementById("tipo_pizza").value;
      box_pizza = document.getElementById("mostraPizza");

	  box_pizza.innerHTML = escolhe_tipo(pizza);

}


function escolhe_tipo(tipo){
		
		switch(tipo){
				case "0":
					retorno = "Escolha um tipo de Pizza!";
					break;
 				case "1":
					retorno = "<span style='color:#FF0000;'>Escolha apenas 1 sabor</span>";
					retorno = retorno + "<input name='rd1' type='radio' id='rd1' value='Camarao' /> Camarão<br />";
					retorno = retorno + "<input name='rd1' type='radio' id='rd1' value='QuatroQueijos' /> Quatro Queijos<br />";
					retorno = retorno + "<input name='rd1' type='radio' id='rd1' value='Portuguesa' /> Portuguesa<br />";
					retorno = retorno + "<input name='rd1' type='radio' id='rd1' value='FrangoCatupiri' /> Frango com Catupiri<br />";
					retorno = retorno + "<input name='rd1' type='radio' id='rd1' value='Calabreza' /> Calabreza<br />";
					retorno = retorno + "<input name='rd1' type='radio' id='rd1' value='Portuguesa' /> Portuguesa<br />";
					retorno = retorno + "<input name='rd1' type='radio' id='rd1' value='CarneSeca' /> Carne Seca<br />";
					retorno = retorno + "<input name='rd1' type='radio' id='rd1' value='Mussarela' /> Mussarela<br />";
					break;
				case "2":
					retorno = "<span style='color:#FF0000;'>Escolha apenas 2 sabores</span>";
					retorno = retorno + "<input name='ck1' type='checkbox' id='ck1' value='Camarao' /> Camarão<br />";
					retorno = retorno + "<input name='ck2' type='checkbox' id='ck2' value='Quatro Queijos' /> Quatro Queijos<br />";
					retorno = retorno + "<input name='ck3' type='checkbox' id='ck3' value='Portuguesa' /> Portuguesa<br />";
					retorno = retorno + "<input name='ck4' type='checkbox' id='ck4' value='Frango com Catupiri' /> Frango com Catupiri<br />";
					retorno = retorno + "<input name='ck5' type='checkbox' id='ck5' value='Calabreza' /> Calabreza<br />";
					
					retorno = retorno + "<input name='ck6' type='checkbox' id='ck7' value='Carne Seca' /> Carne Seca<br />";
					retorno = retorno + "<input name='ck7' type='checkbox' id='ck8' value='Mussarela' /> Mussarela<br />";
 					break;
			}
			return retorno
		}
