function menuLateral(id){
	situacao = document.getElementById('txt'+id).value;

	if(situacao ==0){
		for(i=1;i<=50;i++){
			if(!document.getElementById('div'+id+i)){
			}else{
				document.getElementById('div'+id+i).style.display = 'block'
				document.getElementById('principal'+id).style.background="url('"+geralContent+"images/layout/menu-bg-fecha.jpg') no-repeat";
				document.getElementById('txt'+id).value = 1;
			}
		}
	}else{
		for(i=1;i<=50;i++){
			if(!document.getElementById('div'+id+i)){
			}else{
				document.getElementById('div'+id+i).style.display = 'none'
				document.getElementById('principal'+id).style.background="url('"+geralContent+"images/layout/menu-bg-abre.jpg') no-repeat";
				document.getElementById('txt'+id).value = 0;
			}
		}
	}
}



function enviaFormulario(){
	formularioID = document.frmFormularios.hdFormularioID.value;
	totalCampos  = document.frmFormularios.elements.length;

	for(i=0;i<=totalCampos-1;i++){
		campo 		= document.frmFormularios.elements[i];
		nome 		= document.frmFormularios.elements[i].name;
		valorCampo	= document.frmFormularios.elements[i].value;
		tipoCampo 	= document.frmFormularios.elements[i].type ;
		if((tipoCampo != "radio")&&(tipoCampo != "hidden")){
			if(nome != ""){
				if(document.getElementById(nome+'V').value =='S'){
					if(valorCampo==''){
						alert('O '+nome.substring(0,1).toUpperCase()+nome.substring(1,100).replace('_',' ')+' deve ser preenchido!');
						campo.focus();
						return false;
					}
				}
			}
		}
	}
	document.frmFormularios.submit();
}


function cadastraNovoCliente(){
	formularioID = document.getElementById('hdFormularioID').value;
	totalCampos  = document.frmFormularios.elements.length;

	for(i=0;i<=totalCampos-1 ;i++){
		campo 		= document.frmFormularios.elements[i];
		nome 		= document.frmFormularios.elements[i].name;
		valorCampo	= document.frmFormularios.elements[i].value;
		tipoCampo 	= document.frmFormularios.elements[i].type ;


		tamanho = nome.length;
		nomeV = nome+"V";
//		if(nome.substring(tamanho-1, tamanho) == '_')
//			nomeV = nome.substring(0, tamanho-1)+"V";;
/*
		if((tipoCampo != "radio")&&(tipoCampo != "hidden")){
			if(nome != ""){
				if(document.getElementById(nomeV).value =='S'){
					if(valorCampo==''){
						alert('Os Campos com * devem ser preenchido!');
						campo.focus();
						return false;
					}
				}
			}
		}
*/
	}
	document.frmFormularios.submit();
}

