
		var b_submit=0;

		function check_acao(frm,acao) {
			frm.acao.value=acao;
			blup_submit();		
		}

		function check_item_unico(frm,acao) {
			if(checkbox_checker(frm) == 1) {
				frm.acao.value=acao;
				blup_submit();
			} else {
				alerta_submit("nehum item selecionado ou ","selecione apenas um item")
			}
		}

		function check_item_multi(frm,acao) {
			if(checkbox_checker(frm) > 0) {
				document.formulario.acao.value=acao;
				blup_submit();
			} else {
				alerta_submit("selecione um ou mais itens","");
			}
		}

		function checkbox_checker_img(frm)
		{
				var checkbox_choices = 0;
				if(!frm.elements['chk_list_img[]'])
					return 0;
				if(frm.elements['chk_list_img[]'].checked)
					return "1";
				for (counter = 0; counter < frm.elements['chk_list_img[]'].length; counter++)
				{
					if (frm.elements['chk_list_img[]'][counter].checked)
						{ checkbox_choices = checkbox_choices + 1; }
				}
				return (checkbox_choices);
		}
		
		function checkbox_checker(frm)
		{
				var checkbox_choices = 0;
				if(!frm.elements['chk_list[]'])
					return 0;
				if(frm.elements['chk_list[]'].checked)
						return "1";
				for (counter = 0; counter < frm.elements['chk_list[]'].length; counter++)
				{
						if (frm.elements['chk_list[]'][counter].checked)
								{ checkbox_choices = checkbox_choices + 1; }
				}
				return (checkbox_choices);
		}

		// faz o submit passando uma ancora para o sistema
		function blup_ancora(ancora) {
				document.formulario.action="blup.php#" + ancora;
				blup_submit();
		}
        // submit apresentando tela de troca
        function blup_submit() {
        		if(b_submit==0) {
        			b_submit=1;
	                showHideLayers("alerta",'','show');
					try {
						transfer(); // editor
					} catch (e) {}
					
    	            if (typeof document.formulario.onsubmit == "function")
        	            document.formulario.onsubmit();
            	    document.formulario.submit();
        		}         			
               	return false;
        }

        // submit apresentando tela de troca
        function alerta_submit(a,b) {
                 showHideLayers("alerta_texto",'','show');
                 document.alerta.alertatexto.value=a;
                 document.alerta.alertatexto2.value=b;
                 return false;
        }
        // submit apresentando tela de troca
        function ajuda() {
                 showHideLayers("alerta_ajuda",'','show','400','200');
                 return false;
        }
        function b_Check_tr(obj) {
                 var oTR = obj.parentNode.parentNode;
                 if(obj.checked) {
                    oTR.className = "tr_selected";
                 } else {
                   oTR.className = "tr_normal";
                 }
        }