//Home Cycle Slide
var b = document.getElementsByTagName('body')[0];
b.className+=b.className?' js':'js';

$(function() {
		
    $('#slides').cycle({
        fx:      'fade',
        timeout:  8000,
        prev:    '.prevNav',
        next:    '.nextNav',
        pager:   '#nav',
        cleartypeNoBg: true,
        pagerAnchorBuilder: pagerFactory
    });

    function pagerFactory(idx, slide) {
        var s = idx > 2 ? ' style="display:none"' : '';
        return '<li'+s+'><a href="#">'+(idx+1)+'</a></li>';
    };
    
});

//dropdown
sfHover = function() {
	var sfEls = document.getElementById("dropdown").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
		


//validacao 
$.metadata.setType("attr", "validate");

$(document).ready(function() {
	$("#ss-form").validate();
});

$(document).ready(function() {
	$("#ss-form").validate({meta: "validate"});
});


// valida News
function ValidaForm() {
	with(document.contato) {
		if(nome.value==" ") {
			alert("Informe o seu nome!")
			nome.value="";
			nome.focus();
			return false;
		}
		if(email.value==" ") {
			alert("informe o seu e-mail!")
			email.value="";
			email.focus();
			return false;
		}
		else {
			return true;
		}
	}
}



