
/*sofunction validaTrabalhe(){
	contato=document.form_fornecedor.nome_contato;
	mail=document.form_fornecedor.nome_mail;
	empresa=document.form_fornecedor.nome_empresa;
	telefone=document.form_fornecedor.nome_telefone;
	texto=document.form_fornecedor.nome_textarea;

	ok=true;
	if (contato.value == 0 && ok) {
		alert('Por favor, preencha o nome para contato');
		ok=false;
		contato.focus();
		}
	if (mail.value == 0 && ok) {
		alert('Por favor, preencha um email');
		ok=false;
		mail.focus();
		}
	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(mail.value))&& ok){ 
		alert('Por favor, preencha um email correto');
		ok=false;
		mail.focus();
		} 
	if (empresa.value == 0 && ok) {
		alert('Por favor, preencha o nome da empresa');
		ok=false;
		empresa.focus();
		}
	if (telefone.value == 0 && ok) {
		alert('Por favor, preencha o telefone');
		ok=false;
		telefone.focus();
		}	
	
	doDigits(telefone);
	if (texto.value == 0 && ok) {
		alert('Por favor, preencha uma mensagem');
		ok=false;
		texto.focus();
		}

	if(ok){
		ajaxGet('includes/act/act_contato_fornecedores.php?empresa='+empresa.value+'&telefone='+telefone.value+'&nome='+contato.value+'&mail='+mail.value+'&texto='+texto.value,document.getElementById("form_aviso"),true);
		/*
		contato.value="";
		mail.value="";
		telefone.value="";
		empresa.value="";
		texto.value="";
		
		}

	}
*/
//indicativo de div
var indicativoItem=0;
function tamanhoPizza(tamanho,indice){
		ajaxGet('includes/telentrega_sabores.php?tamanho='+tamanho.value+'&indice='+indice,document.getElementById("div_sabores"+indice),true);
		}
function adicionaItem(){
		displayer = document.getElementById("itemAdicionado"+indicativoItem);
		
		if(displayer){alert(displayer.id);
				displayer.style.display="block";
				}
		//verifica qual carrega
		if(indicativoItem==0){
			carrega="itemAdicionado";
			document.getElementById("itemAdicionado").style.display="block";
			}
		else{
			carrega="itemAdicionado"+indicativoItem;
			
			}
		// cria div
		elemento_retorno = document.getElementById("itemAdicionado");
		elemento_retorno.innerHTML +="<div  id='itemAdicionado"+indicativoItem+"'></div>";
		ajaxGet('includes/monta_pizza_conteudo.php?indicativoItem='+indicativoItem,document.getElementById(carrega),true);
		indicativoItem++;
		}
function cancelaPizza(indice){
		document.getElementById("itemAdicionado"+indice).style.display="none";
		}
function confirmaPizza(indice){
		tamanho=document.getElementById("tamanho"+indice).value;
		if(tamanho==1){
				idSabor1=document.getElementById("sabor"+indice+"a0");
				request="&sabor1="+idSabor1.value;
				}
		if(tamanho==2){
				idSabor1=document.getElementById("sabor"+indice+"a0");
				idSabor2=document.getElementById("sabor"+indice+"a1");
				request="&sabor1="+idSabor1.value+"&sabor2="+idSabor2.value;
				}
		if(tamanho==3){
				idSabor1=document.getElementById("sabor"+indice+"a0");
				idSabor2=document.getElementById("sabor"+indice+"a1");
				idSabor3=document.getElementById("sabor"+indice+"a2");
				request="&sabor1="+idSabor1.value+"&sabor2="+idSabor2.value+"&sabor3="+idSabor3.value;
				}
		//verifica se botou o sabor
		ok=true;
		if(idSabor1 && idSabor1.value==0){
				alert('Por favor preencha o sabor');
				idSabor1.focus();
				ok=false;
				}
		if(tamanho==2 && ok){
			if(idSabor2.value==0){
					alert('Por favor preencha todos os sabores');
					idSabor2.focus();
					ok=false;
					}
			}

		if(tamanho==3 && ok){
			if(idSabor3.value==0){
					alert('Por favor preencha todos os sabores');
					idSabor3.focus();
					ok=false;
					}
			}
		if(ok){
			ajaxGet('includes/monta_pizza_conteudo.php?indicativoItem='+indice+'&tamanho='+tamanho+request,document.getElementById(carrega),true);
			}
		}