function $$$(el){
	return document.getElementById(el);	
}

// lisOferta.php
function buscaproduto(){
	var form = document.getElementById("busca_interna");
	var coddepartamento = form.coddepartamento.value;
	var codcadcidade = form.codcadcidade.value;
	var q = form.q.value
	
	var url = "lisOferta.php?coddepartamento="+coddepartamento+"&codcadcidade="+codcadcidade+"&q="+q;
	GTR_AjaxClick(url, 'conteudo');
}

// Home
function buscaprodutoHome(){
	var form = document.getElementById("busca_interna_home");
	var q = form.q.value
	
	var url = "lisOferta.php?q="+q;
	GTR_AjaxClick(url, 'conteudo');
}


// cadlistaCompra.php
function tooglePainel(indice){
	var fechado = ($$$("titulo_"+indice).className=="tit_categoria_ativo") ? true: false;
	if (fechado){
		$$$("titulo_"+indice).className = "tit_categoria";
		$$$("Painel_"+indice).className = "conteudo_categoria_ativo";
	}else{
		$$$("titulo_"+indice).className = "tit_categoria_ativo";
		$$$("Painel_"+indice).className = "conteudo_categoria";
	}
}

function desmarcaProduto(indice, checa){
	var colecao = document.getElementsByName("ckbGrupo_"+indice+"[]");
	for (var i = 0; i< colecao.length;i++){
		colecao[i].checked = checa;
	}
}

function validaCesta(){
	var form = document.getElementById("cadListaCompra");
	var colecao = form.elements;
	var sel = false;
	var el;
	for (var i = 0; i < colecao.length; i++){
		el = colecao[i];
		if (el.type == "checkbox"){
			if (el.checked){
				sel = true;
				break;
			}
		}
	}
	return sel;
}