			function atualiza(cidade) {
				if(cidade != "null") window.location = "cadastro.php?strCidadeEscolhida="+cidade
			}
			function alteraTipoBusca(tipo) {
				if(tipo != 'null'){
					document.getElementById('busca').innerHTML
						= (tipo == 'N')
						? '\
						<table cellpadding="4" cellspacing="0" border="0" width="100%" class="tabela_produtos" style="margin-top:0">\
							<tr bgcolor="#DDDDDD">\
								<td width="30%" align="right" nowrap="nowrap" valign="top" class="celula_extremidade_esq">CEP:</td>\
								<td width="70%" align="left" nowrap="nowrap" class="celula_extremidade_dir">\
									<input name="numCep" onfocus="exibeAjuda(this)" onblur="ocultaAjuda(this)" type="text" class="campos" style="width:80px"  maxlength="8" />\
									<div id="msg_numCep" class="aviso_cadastro" style="display:none"></div>\
									<div id="desc_numCep" class="descricao" style="display:none"></div>\
								</td>\
							</tr>\
							<tr bgcolor="#EEEEEE">\
								<td width="30%" align="right" nowrap="nowrap" valign="top" class="celula_extremidade_esq">N&uacute;mero:</td>\
								<td width="70%" align="left" nowrap="nowrap" class="celula_extremidade_dir">\
									<input name="numNumero" onfocus="exibeAjuda(this)" onblur="ocultaAjuda(this)" type="text" class="campos" style="width:80px" maxlength="5" />\
									<div id="msg_numNumero" class="aviso_cadastro" style="display:none"></div>\
									<div id="desc_numNumero" class="descricao" style="display:none"></div>\
								</td>\
							</tr>\
						</table>'
						: '\
						<table cellpadding="4" cellspacing="0" border="0" width="100%" class="tabela_produtos" style="margin-top:0">\
							<tr bgcolor="#DDDDDD">\
								<td width="30%" align="right" nowrap="nowrap" valign="top" class="celula_extremidade_esq">Logradouro:</td>\
								<td width="70%" align="left" nowrap="nowrap" class="celula_extremidade_dir">\
									<input name="strRua" onfocus="exibeAjuda(this)" onblur="ocultaAjuda(this)" type="text" class="campos" style="width:100px" maxlength="100" />\
									<div id="msg_strRua" class="aviso_cadastro" style="display:none"></div>\
									<div id="desc_strRua" class="descricao" style="display:none"></div>\
								</td>\
							</tr>\
							<tr bgcolor="#EEEEEE">\
								<td width="30%" align="right" nowrap="nowrap" valign="top" class="celula_extremidade_esq">Quadra:</td>\
								<td width="70%" align="left" nowrap="nowrap" class="celula_extremidade_dir">\
									<input name="strQuadra" onfocus="exibeAjuda(this)" onblur="ocultaAjuda(this)" type="text" class="campos" style="width:80px" maxlength="10" />\
									<div id="msg_strQuadra" class="aviso_cadastro" style="display:none"></div>\
									<div id="desc_strQuadra" class="descricao" style="display:none"></div>\
								</td>\
							</tr>\
							<tr bgcolor="#DDDDDD">\
								<td width="30%" align="right" nowrap="nowrap" valign="top" class="celula_extremidade_esq">Lote:</td>\
								<td width="70%" align="left" nowrap="nowrap" class="celula_extremidade_dir">\
									<input name="strLote" onfocus="exibeAjuda(this)" onblur="ocultaAjuda(this)" type="text" class="campos" style="width:80px" maxlength="10" />\
									<div id="msg_strLote" class="aviso_cadastro" style="display:none"></div>\
									<div id="desc_strLote" class="descricao" style="display:none"></div>\
								</td>\
							</tr>\
						</table>'
				}
			}


function vopenw() {
	tbar='location=no,status=yes,resizable=yes,scrollbars=yes,width=560,height=535';  
	sw =  window.open('http://aplicacao.trustsign.com.br/trustsign/gerarPopup.action?id=459&servico=14&url=http://www.deliveryhabibs.com.br','CRSN_Splash',tbar);      
	sw.focus();
}


function onlynumbers(){
	if (isNaN(document.getElementById('qtde').value)){   
        alert("Por favor, use apenas números para preencher o campo ");   
        document.getElementById('qtde').value='';  
        return false;   
    }   

	
	}

function add_item(valor){
	var qtd = valor;
	if (qtd==''){
	qtd = 0;
	}

	
	qtd = parseInt(qtd);
	qtd = (qtd + 1);
	document.getElementById('qtde').value = qtd;
	}
	
function excl_item(valor){
	var qtd = valor;
	if (qtd==''){
	qtd = 0;
	}

	qtd = parseInt(qtd);
	
	qtd = (qtd - 1);
	
	if(qtd < 0){
		qtd = 0;
		}
	
	document.getElementById('qtde').value = qtd;
	}

function troca_caixa(div_sumiu, div_apareceu){
	var div_sumiu		= document.getElementById(div_sumiu)
	var div_apareceu	= document.getElementById(div_apareceu)
	div_sumiu.style.display		= "none"
	div_apareceu.style.display	= "block"
}

function visualizar(string){
	if(document.getElementById(string).style.display == "block"){
		document.getElementById(string).style.display = "none"
	}
	else {
		document.getElementById(string).style.display = "block"
		if(string == "adicionar"){
			document.adicionar_form.qtde.focus()
		}
	}
}
	
function alteraQuantidade(id){
	div_atual = document.getElementById('qtd_prod'+id)
	if(div_atual.style.display == "none"){
		div_atual.style.display = "block"
		document.alteraqtd.qtde.focus()
	}
	else{
		div_atual.style.display = "none"
	}
	
}

function confirma_limpar(){
	if(confirm("Tem certeza de que você deseja limpar sua bandeja?")){
		window.location = "bandeja.php?do=limpar";
	}
}

function adicionar_endereco(val){
	switch(val){
		case 2: {
			document.getElementById('end_secundario').style.display = 'block'
			document.getElementById('adicionar_endereco').innerHTML = '<a href="#" onclick="javascript:adicionar_endereco(3)">Adicionar um terceiro endere&ccedil;o</a>'
			break;
		}
		case 3: {
			document.getElementById('end_terciario').style.display = 'block'
			document.getElementById('adicionar_endereco').style.display = 'none'
			break;
		}
	}
}

function acessar(url){
	window.location = url
}

function abre_bancos(){
	var cx_bancos = document.getElementById('lista_bancos')
	cx_bancos.style.display = 'block'
}

var ajuda = new Array()
ajuda['numCep']			= 'CEP do local de entrega. Digite apenas n&uacute;meros'
ajuda['numNumero']		= 'N&uacute;mero do local de entrega.'
ajuda['numCpf']			= 'N&uacute;mero de seu CPF. Digite apenas n&uacute;meros'
ajuda['numDdd']			= 'DDD de seu telefone.'
ajuda['numTelefone']	= 'N&uacute;mero de seu telefone.'
ajuda['numRamal_opc']	= 'Ramal de seu telefone (campo opcional).'
ajuda['strTipo']		= 'Tipo de seu telefone: residencial, comercial ou celular.'
ajuda['strMail']		= 'E-mail para que possamos contat&aacute;-lo.'
ajuda['strMail_conf']	= 'Confirma&ccedil;&atilde;o de seu e-mail.'
ajuda['strNome']		= 'Seu nome completo.'
ajuda['strSenha']		= 'Sua senha. S&atilde;o v&aacute;lidos apenas caracteres alfanum&eacute;ricos.'
ajuda['strSenha_conf']	= 'Confirma&ccedil;&atilde;o de sua senha.'
ajuda['numNascDia']		= 'Data de seu nascimento.'
ajuda['numNascMes']		= 'Data de seu nascimento.'
ajuda['numNascAno']		= 'Data de seu nascimento.'
ajuda['strComplemento']	= 'Complemento de seu endere&ccedil;o (casa, apartamento, bloco, etc).'
ajuda['strObs']			= 'Observa&ccedil;&otilde;es para seu pedido.'
ajuda['strRua']			= 'Logradouro de seu local de entrega.'
ajuda['strQuadra']		= 'Quadra de seu local de entrega.'
ajuda['strLote']		= 'Lote de seu local de entrega.'
function exibeAjuda(campo) {
	var nomecampo = campo.name
	var descricao = document.getElementById('desc_'+nomecampo)
	if(ajuda[nomecampo] && descricao) {
		descricao.style.display = 'block'
		descricao.innerHTML = ajuda[nomecampo]
	}
}

function ocultaAjuda(campo) {
	var nomecampo = campo.name
	var descricao = document.getElementById('desc_'+nomecampo)
	if(ajuda[nomecampo] && descricao) {
		descricao.style.display = 'none'
	}
}

function popup(){
	window.open("banner_app_iphone.php", "Iphone", "location=no, status=no, scrollbars=0, toolbar=no, resizable=0, width=600, height=350");
}
