/* ------------------------------------------------------------------------------ */
/* Copyright Sentido Virtual - http://www.sentidovirtual.com.br ----------------- */
/* contato@sentidovirtual.com.br ------------------------------------------------ */
/* ------------------------------------------------------------------------------ */



window.defaultStatus="High Vision - www.highvisionsys.com.br"



/* ------------------------------------------------------------------------------ */
/* Abre janela PopUp ------------------------------------------------------------ */
/* ------------------------------------------------------------------------------ */
function OpenUp(resenha, w, h)
{
	remote = window.open(resenha,'comentario','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,menubar=no,width='+ w + ',height='+ h + '')
}



/* ------------------------------------------------------------------------------ */
/* Verifica campo vazio em formulário ------------------------------------------- */
/* ------------------------------------------------------------------------------ */
function isFieldBlank(theField)
{
	inStr = theField.value;
	inLen = inStr.length;
	for(var i = 0; i < inLen; i++)
	{
		var ch = inStr.substring(i, i+1)
		if (ch != " ")
		return false;   
	}
	theField.Value = "";
	return true;
}



/* ------------------------------------------------------------------------------ */
/* restringe somente caracteres numéricos  -------------------------------------- */
/* ------------------------------------------------------------------------------ */
function key()
{
	theKey = event.keyCode;
	if ((theKey < 48) ||
	(theKey > 57))
	event.returnValue = false;
}



/* ------------------------------------------------------------------------------ */
/* função utilizada em formulário para aceitar somente entrada de números ------- */
/* ------------------------------------------------------------------------------ */
function soNumero(event)
{
	iKey = KeyStroke( event );
	if (!( ( iKey>47 && iKey<58 ) || iKey == 13 || iKey == 0 || iKey == 8 ) )
	{
		return false;
	}
	return true;
}

function KeyStroke( event )
{
	ikey = 0;
	if( event.which == undefined )
	{
		ikey = window.event.keyCode;
	}
	else
	{
		ikey = event.which;
	}
	return ikey;
}



/* ------------------------------------------------------------------------------ */
/* função utilizada para 'saltar' os campos quando o maxlength é atingido ------- */
/* ------------------------------------------------------------------------------ */
function DFchangeField(o,e) {
	if(window.event)key=window.event.keyCode;
	else if(e)key=e.which;
	else return true;
	if (key==9||key==2||key==16) return false;
	// Vai
	if(o.value.length==o.maxLength){
  		for(var i=0;i<o.form.length;i++){
			if(o.form[i]==o && o.form[i+1]){
	    		if (!o.form[i+1].disabled && o.form[i+1].type != "hidden" && o.form[i+1].style.display != "none") {
					o.form[i+1].focus();
					return true;
				}else{
					return false;
				}
	    	}
		}
	}
	// Volta
	if(o.value.length == 0 && key == 8){
  		for(var i=0;i<o.form.length;i++){
    		if(o.form[i]==o && o.form[i-1]){
				if (!o.form[i-1].disabled && o.form[i-1].type != "hidden" && o.form[i+1].style.display != "none") {
					setTimeout("document." + o.form.name + "[" + (i-1) +"].focus()",10);
    				o.form[i-1].value = o.form[i-1].value;
    				return;
    			}else{
					return;
				}
			}
		}
	}
}



/* ------------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------------ */
