$(document).ready(function(){

	//Internet explorer bug com Curvy corners
	$("#main-menu .listaDepartamentos").css("padding","12px 17px 16px");
	
	//Box content do tamanho do sidebar
	if($("#sidebar").length > 0)
	{
		var sidebarHeight = $("#sidebar").height();
		$("#content").css("min-height", sidebarHeight - 40);
	}
    //lightbox		
	$("a[rel^='prettyPhoto']").prettyPhoto({
		theme: 'light_rounded'
	});
	
	
});


function verificaCpf(vcpf) 
{
	
	var condicao = true;
	var cpf = vcpf.replace(/\./gi,"").replace("-","");
	
	
	if (cpf.length != 11 || cpf == "00000000000" || cpf == "11111111111" || cpf == "22222222222" || cpf == "33333333333" || cpf == "44444444444" || cpf == "55555555555" || cpf == "66666666666" || cpf == "77777777777" || cpf == "88888888888" || cpf == "99999999999")
	condicao = 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)))
		condicao = 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)))
		condicao = false;
	
	if(!condicao)
	{
		alert('O CPF informado é inválido.');
	}
	return condicao;
}

