$.swapImage(".swapImage");    
$.fn.cycle.defaults.timeout = 6000;
$(function() {
$('#s4').cycle({
    fx:      'fade',
	timeout:  13000,
    speedIn:  2000,
    speedOut: 500,
    easeIn:  'linear',
    easeOut: 'linear',
    delay:   -4000
});
});
//build menu with DIV ID="myslidemenu" on page:
droplinemenu.buildmenu("mydroplinemenu")

function VerificaCPF () {
if (vercpf(document.form.Cpf.value)) 
{document.formContato.submit();}else 
{errors="1";if (errors) alert('CPF NÃO VÁLIDO');
document.retorno = (errors == '');}}
function vercpf (cpf) 
{if (cpf.length != 11 || cpf == "00000000000" || cpf == "11111111111" || cpf == "22222222222" || cpf == "33333333333" || cpf == "44444444444" || cpf == "55555555555" || cpf == "66666666666" || cpf == "77777777777" || cpf == "88888888888" || cpf == "99999999999")
return false;
add = 0;
for (i=0; i < 9; i ++)
add += parseInt(cpf.charAt(i)) * (10 - i);
rev = 11 - (add % 11);
if (rev == 10 || rev == 11)
rev = 0;
if (rev != parseInt(cpf.charAt(9)))
return false;
add = 0;
for (i = 0; i < 10; i ++)
add += parseInt(cpf.charAt(i)) * (11 - i);
rev = 11 - (add % 11);
if (rev == 10 || rev == 11)
rev = 0;
if (rev != parseInt(cpf.charAt(10)))
return false;
//alert('O CPF INFORMADO É VÁLIDO.');
return true;}
function formLimpar(){
	form = document.formContato
	form.reset()
}
function formSubmit(){
	form = document.formContato
	erro = new Array
	err = false
	var eMail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
	if ((form.Cpf.value.length < 9) || vercpf(form.Cpf.value)==false) {
		erro[0] = "\n\rCPF"
		err = true
	}	
	if (form.Nome.value.length < 5){
		erro[1] = "\n\rNome"
		err = true
	}
	if ((form.Email.value.length < 5) && (!eMail.test(form.Email.value))){
		erro[2] = "\n\rE-mail"
		err = true
	}
	if ((form.Telefone.value.length < 5)){
		erro[3] = "\n\rTelefone"
		err = true
	}
	if ((form.Empresa.value.length < 5)){
		erro[4] = "\n\rEmpresa"
		err = true
	}

	if (!err){
		form.action = "mais_folder_add.asp"
		form.method = "POST"
		form.submit()
	}
	else{
		Alerta = 'Favor preencher corretamente os campos listados abaixo: \r'
		for (i=0;i<erro.length;i++){
			if (erro[i] != null){
				Alerta = Alerta + erro[i]
			}
		}
		alert(Alerta)
	}	
}

