/**
 *
 */

function confirmaReset()
{
    return confirm('Deseja realmente apagar TODOS os campos do formulário?');
}

function moveNext(campo)
{
    var conteudo = campo.value;

    if (conteudo.length == campo.maxLength) {
        next = campo.tabIndex;

        if (next < document.forms[0].elements.length) {
            document.forms[0].elements[next].focus();
		}
	}
}


function openWindow(url, width, height)
{
    window.open(url,"","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=" + width + ", height=" + height);
}


/**
 * Máscara para formatação de campos numéricos como CEP
 */
function MM_formatNumber(e, src, mask)
{
	if(window.event) { _TXT = e.keyCode; }
	else if(e.which) { _TXT = e.which; }
	
	if(_TXT > 47 && _TXT < 58) {
		var i = src.value.length; 
		var saida = mask.substring(0,1); 
		var texto = mask.substring(i);
		
		if (texto.substring(0,1) != saida) { 
			src.value += texto.substring(0,1);
		}
		
		return true;
	}
	else { 
		if (_TXT != 8) { 
			return false;
		}
		else { return true; }
    }
}

/**
 * Máscara para formatação de campos numéricos como CEP
 */
function MM_onlyNumbers(e, src, len, next)
{
	if(window.event) { _TXT = e.keyCode; }
	else if(e.which) { _TXT = e.which; }
	
	if(_TXT > 47 && _TXT < 58) {
		return true;
	}
	else { 
		return false;
    }
}
