function addProduto(prod1_cod){
	frm = document.getElementById("add"+prod1_cod);
	/*
	if (frm.prod1_qtd.value.length < 1){
		alert("Preencha a quantidade desejada.");
		frm.prod1_qtd.focus();
	} else { */
		frm.submit();
	//}
}

function inteiro(e){
	var tecla = (window.event)?event.keyCode:e.which;

    if((tecla > 47 && tecla < 58) || (tecla > 95 && tecla < 106) || tecla == 0){
		return (true);
	}
	else{
		if (tecla != 8){
			return (false);
		}
		else {
			return (true);
		}
	}
}

function paginaBusca(pag, view){
	urlBase = $('#frmPaginacao #urlBase').attr('value');
	url = urlBase+pag+"/"+view+"/";

	$('#frmPaginacao').attr('action',url);
	$('#frmPaginacao').submit();
}

function validaContato(frm){
	if (frm.nome.value.length < 1){
		alert("O campo 'nome' é obrigatório.");
		frm.nome.focus();
		return (false);
	}
	if (frm.email.value.length < 1){
		alert("O campo 'e-mail' é obrigatório.");
		frm.email.focus();
		return (false);
	}
	return (true);
}

function alterarQuantidade(root_path,vari1_cod){
    qtdPP = $('#qtd_pp'+vari1_cod).val();
    qtdP = $('#qtd_p'+vari1_cod).val();
    qtdM = $('#qtd_m'+vari1_cod).val();
    qtdG = $('#qtd_g'+vari1_cod).val();
    qtdG1 = $('#qtd_g1'+vari1_cod).val();
    document.location = root_path+"/orcamento/alteraProduto/"+vari1_cod+"/"+qtdPP+"/"+qtdP+"/"+qtdM+"/"+qtdG+"/"+qtdG1;
}

function atendimento(root_path) {
    window.open(root_path+"/msn/index/", "Parsa Equipamento", "status=no, width=500, height=500");
}

function rastreio_correios(rastreio) {
    window.open("http://websro.correios.com.br/sro_bin/txect01$.QueryList?P_LINGUA=001&P_TIPO=001&P_COD_UNI="+rastreio, "Parsa Equipamentos", "status=no, width=500, height=500");
}


function enviarBusca(){
    document.frmBusca.submit();
}

function enviarLogin(){
    frm = document.frmLogin;
    erro = 0;
/*
    if ((frm.nome.value.length < 1)){
        alert('Preencha seu nome.');
        frm.nome.focus();
        erro = 1;
    }
    if ((frm.email.value.length < 1) && (erro == 0)){
        alert('Preencha seu e-mail.');
        frm.senha.focus();
        erro = 1;
    }
*/
    if (erro == 0){
        frm.submit();
    }
}