// JavaScript Document
$(function(){
	$("[trocaidioma]").click(function(){
		$("#thefullfill").show();
		$("#thefullfill").fadeTo(1,0);
		$("#thefullfill").fadeTo(800,0.8);
		var thelink = window.location.toString();
		var dataString = 'idioma='+$(this).attr("trocaidioma")+'&link='+thelink.split("&").join("[e]");
		$.ajax({
			type: "POST",
			url: LocalURL+"ajax/trocaIdioma.php",
			timeout: 10000,
			data: dataString,
			success: function(data) {
				window.location.reload();
				/*$("body").html(data);
				$("#thefullfill").fadeTo(800,0,function(){$("#thefullfill").hide()});*/
			},
			error: function(data){
				window.location.reload();
				/*
				$("#thefullfill").fadeTo(800,0,function(){$("#thefullfill").hide()});
				jAlert("Problemas ao trocar idiomas, talvez sua conex&atilde;o com a internet esteja muito lenta","Erro");*/
			}
		});
	});
	if(window.location.toString() != LocalURL){
		$(".abreInfo").hover(function(){
			$(this).stop().animate({backgroundColor:"#325681"},600);
		},function(){
			if($(this).attr("class")=="abreInfo")$(this).stop().animate({backgroundColor:"#022e64"},600);
		});
	}
	$(".abreInfo").click(function(){
		clearTimerImagens($(this).attr("meuid"));
		$(".abreInfo img:visible").hide();
		$(this).children("img").show();
		var alvo = $(this).parent().children(".maisInfo");
			$(".maisInfo").slideUp(500);
			alvo.slideDown(500);
	});
});
