<!--
// Abre Album de Fotos
function AbreAlbum(pagina,janela,w,h,scrolling) 
{
if (!scrolling) { scrolling='auto' }
   window.open(pagina,janela,'width='+w+',height='+h+',scrollbars='+scrolling+',toolbar=no,location=no,status=no,menubar=no,resizable=no,left=2,top=2')
}

// Abre Album de Fotos
function AbreEnquete(pagina,janela,w,h,scrolling) 
{
if (!scrolling) { scrolling='auto' }
   window.open(pagina,janela,'width='+w+',height='+h+',scrollbars='+scrolling+',toolbar=no,location=no,status=no,menubar=no,resizable=no,left=2,top=2')
}

// Abre Etiqueta
function AbreEtiqueta(pagina,janela,w,h,scrolling) 
{
if (!scrolling) { scrolling='auto' }
   window.open(pagina,janela,'width='+w+',height='+h+',scrollbars='+scrolling+',toolbar=no,location=no,status=no,menubar=yes,resizable=no,left=2,top=2')
}

// Abre Fotos Cardápio
function AbreCardapio(pagina,janela,w,h,scrolling) 
{
if (!scrolling) { scrolling='auto' }
   window.open(pagina,janela,'width='+w+',height='+h+',scrollbars='+scrolling+',toolbar=no,location=no,status=no,menubar=no,resizable=no,left=2,top=2')
}

// Abre Mapa
function AbreMapa(pagina,janela,w,h,scrolling) 
{
if (!scrolling) { scrolling='auto' }
   window.open(pagina,janela,'width='+w+',height='+h+',scrollbars='+scrolling+',toolbar=no,location=no,status=no,menubar=no,resizable=no,left=2,top=2')
}

// =========== VALIDAÇÃO =============================================
function CadastroTitulo(FormCadastroTitulo) {
		 if(FormCadastroTitulo.Titulo_1.value == ""){
		    alert("  O campo '' Titulo 1 '' é obrigatório!  ");
		    FormCadastroTitulo.Titulo_1.focus();
		 return false;
		 }
		 if(FormCadastroTitulo.Ativo.value == ""){
		    alert("  O campo '' Habilitar '' é obrigatório!  ");
		    FormCadastroTitulo.Ativo.focus();
		 return false;
		 }
	return true;
}


function CadastroSubTitulo(FormCadastroSubTitulo) {
		 if(FormCadastroSubTitulo.IdTitulo.value == ""){
		    alert("  Selecione um título para relacionar a este produto.  ");
		    FormCadastroSubTitulo.IdTitulo.focus();
		 return false;
		 }
		 if(FormCadastroSubTitulo.SubTitulo.value == ""){
		    alert("  O campo '' Produto '' é obrigatório!  ");
		    FormCadastroSubTitulo.SubTitulo.focus();
		 return false;
		 }
		 if(FormCadastroSubTitulo.Valor_1.value == ""){
		    alert("  O campo '' Preço 1 '' é obrigatório!  ");
		    FormCadastroSubTitulo.Valor_1.focus();
		 return false;
		 }
	return true;
}

function AtualizarSubTitulo(FormAtualizarSubTitulo) {
		 if(FormAtualizarSubTitulo.SubTitulo.value == ""){
		    alert("  O campo '' Produto '' é obrigatório!  ");
		    FormAtualizarSubTitulo.SubTitulo.focus();
		 return false;
		 }
		 if(FormAtualizarSubTitulo.Valor_1.value == ""){
		    alert("  O campo '' Preço 1 '' é obrigatório!  ");
		    FormAtualizarSubTitulo.Valor_1.focus();
		 return false;
		 }
	return true;
}


// =========== FORMATAÇÃO =============================================
// PERMITE DIGITAR SOMENTE NÚMEROS --------------------------
function SomenteNumeros(input){
if ((event.keyCode<48)||(event.keyCode>57))
     event.returnValue = false;
}


// FORMATA MOEDA --------------------------------------------------------
function Limpar(valor, validos) {
var result = "";
var aux;
for (var i=0; i < valor.length; i++) {
aux = validos.indexOf(valor.substring(i, i+1));
if (aux>=0) { result += aux; } } return result; 
}
function FormataMoeda(campo,tammax,teclapres) {
var tecla = teclapres.keyCode;
vr = Limpar(campo.value,"0123456789");
tam = vr.length;
if (tam < tammax && tecla != 8){ tam = vr.length + 1 ; }
if (tecla == 8 )
{ tam = tam - 1 ; }
if ( tecla == 8 || tecla >= 48 && tecla <= 57 || tecla >= 96 && tecla <= 105 )
{ dec=2
if ( tam <= dec )
{ campo.value = vr ; }
if ( (tam > dec) && (tam <= 5) ){
campo.value = vr.substr( 0, tam - 2 ) + "," + vr.substr( tam - dec, tam ) ; }
if ( (tam >= 6) && (tam <= 8) ){
campo.value = vr.substr( 0, tam - 5 ) + "." + vr.substr( tam - 5, 3 ) + "," + vr.substr( tam - dec, tam ) ; }
if ( (tam >= 9) && (tam <= 11) ){
campo.value = vr.substr( 0, tam - 8 ) + "." + vr.substr( tam - 8, 3 ) + "." + vr.substr( tam - 5, 3 ) + "," + vr.substr( tam - dec, tam ) ; }
if ( (tam >= 12) && (tam <= 14) ){
campo.value = vr.substr( 0, tam - 11 ) + "." + vr.substr( tam - 11, 3 ) + "." + vr.substr( tam - 8, 3 ) + "." + vr.substr( tam - 5, 3 ) + "," + vr.substr( tam - dec, tam ) ; }
if ( (tam >= 15) && (tam <= 17) ){
campo.value = vr.substr( 0, tam - 14 ) + "." + vr.substr( tam - 14, 3 ) + "." + vr.substr( tam - 11, 3 ) + "." + vr.substr( tam - 8, 3 ) + "." + vr.substr( tam - 5, 3 ) + "," + vr.substr( tam - 2, tam ) ; } } 
}

-->