<!--
function doPost(formName, actionName)
{
    var hiddenControl = document.getElementById('action');
    var theForm = document.getElementById(formName);
    
    hiddenControl.value = actionName;
    theForm.submit();
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

<!--

//	USADO EM SELECTS ONCHANGE PARA IR PARA UMA PÁGINA E ENVIAR O VALOR SELECIONADO
function selGoTo(URL, OBJ)
{
	var VAL = OBJ.options[OBJ.selectedIndex].value;
	document.location = URL+'?UF='+VAL;	
}

/**********************************************************************************************************************************************************
	CADASTRO
**********************************************************************************************************************************************************/


/* ***************************************************************************** */


//	JS QUE ANALISA O FORM E VERIFICA SE OS CAMPOS COM title='Obrigatório' ESTÃO PREENCHIDOS	
function chkFields (NM_FORM)
{
	var DOC		= document.forms[NM_FORM];
	var LIST	= DOC.elements;
	var NOME, ID, TITLE, VAL;

	for (i=0; i<LIST.length; i++)
	{
		VAL 	= null;
		NOME	= LIST[i].name;
		ID		= LIST[i].id;
		TITLE	= LIST[i].title;
		if (LIST[i].type=="select-one")
		{
			VAL = LIST[i].options[LIST[i].selectedIndex].value;
		}
		else if (LIST[i].type=="select-multiple")
		{
			for( var c= 0; c < LIST[i].length; c++ )
				if (LIST[i][c].selected == true)
					VAL++;
		}
		else
		{
			VAL = LIST[i].value;
		}
		

		if (TITLE=="Required" && (VAL==""|| VAL==null || VAL==" " || VAL=="0" || VAL=="Select your country"))
		{
			alert('You must fill your '+ ID);
			LIST[i].focus();
			return false;
		} 
	}
};

//	VALIDAÇÃO SIMPLES, APENAS ANALISA OS CAMPOS OBRIGATÓRIOS
function cnfFormSimples (NM_FORM)
{
	var DOC		= document.forms[NM_FORM];
	var LIST	= DOC.elements;

	if(chkFields(NM_FORM) == false)
		return false;

	DOC.submit();
}

//-->
