function trim(sString) { while (sString.substring(0,1) == ' ') { sString = sString.substring(1, sString.length); } while (sString.substring(sString.length-1, sString.length) == ' ') { sString = sString.substring(0,sString.length-1); } return sString; } function checkFormCurr() { var d = document.form1; if(trim(d.nome.value)=='') { alert('Nome em branco!'); d.nome.select(); d.nome.focus(); return false; } if((d.sexo[0].checked==false)&&((d.sexo[1].checked==false))) { alert('Sexo em branco!'); d.sexo[0].checked=true; d.nome.focus(); return false; } if(trim(d.endereco.value)=='') { alert('Endereço em branco!'); d.endereco.select(); d.endereco.focus(); return false; } if(trim(d.cidade.value)=='') { alert('Cidade em branco!'); d.cidade.select(); d.cidade.focus(); return false; } if((trim(d.ddd.value)=='')||(trim(d.telefone.value)=='')) { alert('Telefone inválido!') d.ddd.select(); d.ddd.focus(); return false; } if((trim(d.dia.value)=='')||(trim(d.mes.value)=='')||(trim(d.ano.value)=='')) { alert('Data de nascimento inválida!'); d.dia.select(); d.dia.focus(); return false; } if(trim(d.idade.value)=='') { alert('Idade em branco!'); d.idade.select(); d.idade.focus(); return false; } if(trim(d.civil.value)=='') { alert('Estado civil em branco!'); d.civil.select(); d.civil.focus(); return false; } if(trim(d.escolaridade.value)=='') { alert('Escolaridade em branco!'); d.escolaridade.select(); d.escolaridade.focus(); return false; } document.forms[0].submit(); } function checkFormContato() { var d = document.form1; if(trim(d.Nome.value)=='') { alert('Nome em branco!'); d.nome.select(); d.nome.focus(); return false; } if(trim(d.Email.value)=='') { alert('E-mail em branco!'); d.email.select(); d.email.focus(); return false; } document.forms[0].submit(); } /* Funções para controle do iFrame */ var iframe_move_speed = 6; var iframe_move_update = 20; var obj_arg, iframe_obj, iframe_scroll_way, iframe_move_obj; /* Exemplo: onmouseover='iframe_move('nomeIframe','left|rigth|up|douwn')' onmouseout='iframe_move_stop()' */ function iframe_move(arg, way) { obj_arg = arg; iframe_obj = window.frames[obj_arg]; iframe_scroll_way = way; iframe_move_obj = window.setTimeout('iframe_move_action()', iframe_move_update); } function iframe_move_stop() { window.clearTimeout(iframe_move_obj); } function iframe_move_action() { if (iframe_scroll_way == "up") { x = 0; y = - iframe_move_speed; } if (iframe_scroll_way == "down") { x = 0; y = iframe_move_speed; } if (iframe_scroll_way == "left") { x = - iframe_move_speed; y = 0; } if (iframe_scroll_way == "right") { x = iframe_move_speed; y = 0; } iframe_obj.scrollBy(x, y); iframe_move(obj_arg, iframe_scroll_way); } /* Fim das funções do iFrame */