function carregaGaleria() {
	$('a.lightsGal').zoomimage({
		border: 20,
		centered: true,
		hideSource: true
	})
}

$(function() {
	// set opacity to nill on page load
	$("img.logo_patrocinio").css("opacity","1");
	// on mouse over
	$("img.logo_patrocinio").hover(function () {
		// animate opacity to full
		$(this).stop().animate({
			opacity: 0.7
		}, "fast");
	},
	// on mouse out
	function () {
		$(this).stop().animate({
			opacity: 1
		}, "fast");
	});
});

function ajax2(objOrigem,destino) {

		if((!objOrigem.href)) {
			url = objOrigem;
		}
		else
			if(objOrigem.href)
				url = objOrigem.href;
			else
				url = objOrigem.action;	if (url.indexOf('?') == -1)
	
	var toLoad = url+' '+'#'+destino;
	
	//$('#'+destino).toggle('slide',{direction: "left"},null,loadContent);
	$('#'+destino).fadeOut('slow',loadContent);


	$('#load').fadeIn('normal');
	window.location.hash = url
	
	function loadContent() {
		$('#'+destino).load(toLoad,'',showNewContent())
	}
	
	function showNewContent() {
		window.setTimeout(function() {
			$('#'+destino).fadeIn('slow',hideLoader);				   
			//$('#'+destino).toggle('slide',{direction: "right"},null,hideLoader());
		},700);		
	}
	
	
	function hideLoader() {
		$('#load').fadeOut('normal');
	}
	return false;
}

function validaForm() {
	// validate signup form on keyup and submit
	$("#formContact").validate({
		rules: {
			nome: "required",
			cidade: "required",
			empresa: "required",
			telefone: "required",
			assunto: "required",
			email: {
				required: true,
				email: true
			}
		},
		messages: {
			nome: "* O campo NOME é obrigatório.",
			cidade: "* O campo CIDADE é obrigatório.",
			empresa: "* O campo EMPRESA é obrigatório.",
			telefone: "* O campo TELEFONE é obrigatório.",
			email: "* E-MAIL inválido."
		}
	});
}

function validaForm() {
	// validate signup form on keyup and submit
	$("#formContact").validate({
		rules: {
			nome: "required",
			cidade: "required",
			empresa: "required",
			telefone: "required",
			assunto: "required",
			email: {
				required: true,
				email: true
			}
		},
		messages: {
			nome: "* O campo NOME é obrigatório.",
			cidade: "* O campo CIDADE é obrigatório.",
			empresa: "* O campo EMPRESA é obrigatório.",
			telefone: "* O campo TELEFONE é obrigatório.",
			email: "* E-MAIL inválido."
		}
	});
}
