cacic.js
3.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
var ie4 = (document.all) ? true : false;
var ns4 = (document.layers) ? true : false;
var ns6 = (document.getElementById && !document.all) ? true : false;
function SetaClassDigitacao(obj)
{
obj.style.backgroundColor='#CCCCCC';
}
function SetaClassNormal(obj)
{
obj.style.backgroundColor='#FFFFFF';
}
function preparaEnvio()
{// Percorrerei os forms e encontrarei os campos NOME e SENHA para criptografia... (Anderson Peterle - 04/09/2006)
for (i=0;i<window.document.forms.length;i++)
for (j=0;j<window.document.forms[i].elements.length;j++)
if ((window.document.forms[i].elements[j].name == 'frm_nm_usuario_acesso' ||
window.document.forms[i].elements[j].name == 'frm_te_senha') &&
(window.document.forms[i].elements[j].type == 'text' ||
window.document.forms[i].elements[j].type == 'password') &&
window.document.forms[i].elements[j].value != '')
// Codificação dos campos NOME e SENHA para submissão pelo método POST
window.document.forms[i].elements[j].value = encode64(window.document.forms[i].elements[j].value);
}
function SetaCampo(p_campo)
{
for (i=0;i<window.document.forms.length;i++)
{
for (j=0;j<window.document.forms[i].elements.length;j++)
{
if (window.document.forms[i].elements[j].name == p_campo) window.document.forms[i].elements[j].focus();
}
}
return true;
}
function Ajuda(p_campo_destino,p_frase)
{
var formulario = window.document.forms[0];
formulario[p_campo_destino].value = p_frase;
return true;
}
function Confirma(p_pergunta)
{
if (confirm(p_pergunta))
{
return true;
}
return false;
}
function MostraLayer(strLayerName)
{
if (ie4)
document.all[strLayerName].style.visibility = "visible";
else if (ns4)
document.layers[strLayerName].visibility = "show";
else if (ns6)
document.getElementById([strLayerName]).style.display = "block";
}
function EscondeLayer(strLayerName)
{
if (ie4)
{
document.all[strLayerName].style.visibility = "hidden";
}
else if (ns4)
{
document.layers[strLayerName].visibility = "hide";
}
else if (ns6)
{
document.getElementById([strLayerName]).style.display = "none";
}
}
function EscreveNaLayer(strLayerName,strText)
{
if (ie4)
{
document.all[strLayerName].innerHTML = strText;
}
else if (ns4)
{
document[strLayerName].document.write(strText);
document[strLayerName].document.close();
}
else if (ns6)
{
over = document.getElementById([strLayerName]);
range = document.createRange();
range.setStartBefore(over);
domfrag = range.createContextualFragment(strText);
while (over.hasChildNodes())
{
over.removeChild(over.lastChild);
}
over.appendChild(domfrag);
}
}
function Trim(Dado)
{
var sDado, Result, i, f;
Result = "";
sDado = Dado.toString();
if (sDado.length > 0)
{
for (i=0; i < sDado.length; i++)
{
if (sDado.charAt(i) != " ")
break;
}
if (i < sDado.length)
{
for (f=sDado.length-1; f >= 0; f --)
{
if (sDado.charAt(f) != " ")
break;
}
Result = sDado.substring(i, f+1);
}
}
return Result;
}