-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.js
More file actions
52 lines (44 loc) · 1.47 KB
/
Copy pathscripts.js
File metadata and controls
52 lines (44 loc) · 1.47 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
function swap( id ) {
var browser = navigator.appName;
if (browser == "Microsoft Internet Explorer") {
displayType = ( document.getElementById( id ).style.display == 'none' ) ? 'block' : 'none';
} else {
displayType = ( document.getElementById( id ).style.display == 'none' ) ? 'table-row' : 'none';
}
document.getElementById( id ).style.display = displayType;
id_titulo = id + '_link';
classe = ( document.getElementById( id_titulo ).className == 'abstract_inactive' ) ? 'abstract_active' : 'abstract_inactive';
document.getElementById( id_titulo ).className = classe;
}
function ValidaForm() {
if (document.contato.nome.value=='') {
alert('Preencha o nome!');
return (false);
}
if (!checkMail(document.contato.email.value)) {
alert('Preencha o e-mail corretamente!');
return (false);
}
if (document.contato.assunto.value=='') {
alert('Preencha o assunto!');
return (false);
}
if (document.contato.mensagem.value=='') {
alert('Digite uma mensagem!');
return (false);
}
if (document.contato.lang.value=='en') {
document.contato.action = "envia_email.php?lang=en";
} else {
document.contato.action = "envia_email.php?lang=br";
}
return (true);
}
function checkMail(email) {
var x = email;
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (filter.test(x))
return true;
else
return false;
}