function userPost($text, $touser){	if($text.indexOf("@") != -1){		$textSplited = $text.split("@");		$texto = "<a href='http://twitter.com/"+$touser+"' title='"+$touser+"'>"+ $textSplited[0] +"</a>@"+ $touser;	}		return $texto;}var page = 1;/* Início - Funções para o efeito das abas */function hideAll(){	$("#lancelance").hide();	$("#ficha").hide();	$("#estatisticas").hide();	$(".campo1").hide();	$(".campo2").hide();}		function activeClass(idativo){	$("#aba01").removeClass("ativo");	$("#aba02").removeClass("ativo");	$("#aba03").removeClass("ativo");	$(idativo).addClass("ativo");}function slideAjustaTamanho(altura){	$("#con").animate({ 		height: altura+"px"	}, "normal" );}function efeitoAbas(idbloco,idaba){	hideAll();	$(idbloco).fadeIn(velFade, function(){		alturaCon = $(idbloco).height();		slideAjustaTamanho(alturaCon);	});	$(".campo1").fadeIn(velFade);	$(".campo2").fadeIn(velFade);	activeClass(idaba);}function efeitoAbasSFade(idbloco,idaba){	alturaCon = $(idbloco).height();	slideAjustaTamanho(alturaCon);}function setCampeonato(value){	window.location = '?campeonato='+value;}function verificaPublicidade(){	/*var div = document.getElementById("ofer");	var val = div.innerHTML.indexOf("empty.gif");	if(val != -1){		div.style.display = "none";	}*/	/*var val2 = div.innerHTML.indexOf("selo_88x31_teste")	if(val2 != -1){		div.style.display = "none";	}*/}function atualizaListaDeJogos(campeonato){	$.ajax({		type: "GET",		url: "backend/atualizaListaJogos.php?campeonato="+campeonato,		success: function(data) {			if(data != ''){				$("#content").html(data);			}		}	 }); /*close $.ajax*/}function atualizaJogosHeader(){	$.ajax({		type: "GET",		url: "backend/atualizarJogosHeader.php",		success: function(data) {			if(data == 0){				atualizaJogosHeaderView();			}else{				$("#listaTempoReal").html(data);				efeitoLanceaLance();			}		}	 }); /*close $.ajax*/}function atualizaJogosHeaderView(){	$.ajax({		type: "GET",		url: "backend/atualizaHeaderJogos.php",		success: function(data) {			$("#head").html(Trim(data));			efeitoLanceaLance();		}	 }); /*close $.ajax*/}function verificaHeader(){	var h = $("#head").html();	if(h == ""){		atualizaJogosHeaderView();	}else{		atualizaJogosHeader();	}}		function Trim(str){return str.replace(/^\s+|\s+$/g,"");}function efeitoLanceaLance(){	/* Início - Inicializa itens para efeito do Lance a Lance do Header */	quantidadeJogos = $("ul#listaTempoReal li").length;	for(i=0;i<quantidadeJogos;i++){		$("ul#listaTempoReal li")[i].id = "tr-"+i;		leftPosition = 673*i;		$("#"+$("ul#listaTempoReal li")[i].id+"").css("left",leftPosition+"px");	}	$("ul#listaTempoReal li").css({'display' : 'block'});	/* Fim - Inicializa itens para efeito do Lance a Lance do Header */}function navegacaoJogos(acao){	leftPrimeiroElemento = $("#"+$("ul#listaTempoReal li")[0].id+"").css("left");	leftUltimoElemento = $("#"+$("ul#listaTempoReal li")[quantidadeJogos-1].id+"").css("left");			for(i=0;i<quantidadeJogos;i++){		leftPosition = $("#"+$("ul#listaTempoReal li")[i].id+"").css("left");		leftPosition = leftPosition.replace("px","");				if(acao == "voltar" && leftPrimeiroElemento != "0px"){			leftPosition = parseInt(leftPosition)+673;		}else if(acao == "avancar" && leftUltimoElemento != "0px"){			leftPosition = parseInt(leftPosition)-673;		}						if(leftPosition%673 == 0){			$("#"+$("ul#listaTempoReal li")[i].id+"").animate({ 				left: leftPosition+"px"			}, "normal", "swing" );		}	}	setaVoltar(leftPosition);	setaAvancar(leftPosition);}		function setaVoltar(elemento){	tot = $("ul#listaTempoReal li").length;	tot = (tot - 1)*673;	if(elemento == tot){		if($('.voltar').hasClass("selected")){			$('.voltar').removeClass("selected");		}	}else{		$('.voltar').addClass("selected");	}}		function setaAvancar(elemento){	tot = $("ul#listaTempoReal li").length;	if(tot > 1){		if(elemento == 0){			if($('.avancar').hasClass("selected")){				$('.avancar').removeClass("selected");			}		}else{			$('.avancar').addClass("selected");		}	}}		function validaSetaAvancarInicio(){	tot = $("ul#listaTempoReal li").length;	if(tot > 1){		$('.avancar').addClass("selected");	}}/*Arquibancada virtual*/function fecharOverlay(){				$('#network_pop').fadeOut('fast', function(){		$("#overlay").animate({ 			opacity:0		}, 200, "swing", function(){			$("#overlay").css({'display' : 'none'});		});	});}function entrarTorcida(tipoTorcida){	if(uidRede==0){		/*alturaTela = document.getElementById("geral").clientHeight;		larguraTela = document.getElementById("geral").clientWidth;*/		alturaTela = $("body").height();		larguraTela = $("body").width();		$("#overlay").height(alturaTela-214);		$("#overlay").width(larguraTela);		$("#overlay").css({'display' : 'block'});		$("#overlay").animate({ 			opacity:0.85		}, 200, "swing", function(){			$("#network_pop").fadeIn("fast");		} );	}else{		var jogo_id = $('#jogo_id').val();		var rede_social_id = $('#rede_social_id').val();		var uid_redesocial = $('#uid_redesocial').val();		var img_profile = $('#img_profile').val();		var name_profile = $('#name_profile').val();		var username_profile = $('#username_profile').val();		if(tipoTorcida == 1){			torcidaTroca = 2;		}else{			torcidaTroca = 1;		}				$.ajax({		type: "POST",		url: 'backend/entrarTorcida.php',		data: '&tipoTorcida=' + tipoTorcida + '&jogo_id=' + jogo_id + '&rede_social_id=' + rede_social_id + '&uid_redesocial=' + uid_redesocial + '&img_profile=' + img_profile + '&name_profile=' + name_profile + '&username_profile=' + username_profile,		success: function(data) {			$('#torcidaLocal').html(data);			$('#btArquibancada'+tipoTorcida).html('<a class="bt sairtorcida" title="Sair desta torcida" onclick="sairTorcida('+tipoTorcida+');">Sair desta torcida</a>');			$('#btArquibancada'+torcidaTroca).html('<a class="bt entrartorcida" title="Entrar nesta torcida" onclick="entrarTorcida('+torcidaTroca+');">Entrar nesta torcida</a>');						if(tipoTorcida == 1){				user01 = uid_redesocial;				user02 = 0;			}else if(tipoTorcida == 2){				user01 = 0;				user02 = uid_redesocial;			}						var cont = $("#torcida-"+tipoTorcida).html();			var cont2 = cont.split(" ");			var res = parseInt(cont2[0]) + 1;			if(res > 1){				torc = " torcedores";			}else{				torc = " torcedor";			}							$("#torcida-"+tipoTorcida).html(res + torc);						atualizarTorcida(1,user01,rede_social_id,1,1);			atualizarTorcida(2,user02,rede_social_id,1,1);			AtualizaQtdeTorcida1(1);			AtualizaQtdeTorcida2(1);		}	 }); /*close $.ajax*/	}}function sairTorcida(tipoTorcida){	var jogo_id = $('#jogo_id').val();	var uid_redesocial = $('#uid_redesocial').val();	var rede_social_id = $('#rede_social_id').val();	$.ajax({		type: "POST",		url: 'backend/sairTorcida.php',		data: '&tipoTorcida=' + tipoTorcida + '&jogo_id=' + jogo_id + '&uid_redesocial=' + uid_redesocial+ '&rede_social_id=' + rede_social_id,		success: function(data) {			$('#torcidaLocal').html(data);			$('#btArquibancada'+tipoTorcida).html('<a class="bt entrartorcida" title="Entrar nesta torcida" onclick="entrarTorcida('+tipoTorcida+');">Entrar nesta torcida</a>');			atualizarTorcida(tipoTorcida, 0, 0,1,1);			var cont = $("#torcida-"+tipoTorcida).html();			var cont2 = cont.split(" ");			if(cont2[0] == 0){				res = 0;				torc = " torcedor";			}else{				var res = parseInt(cont2[0]) - 1;				if(res > 1){					torc = " torcedores";				}else{					torc = " torcedor";				}			}						$("#torcida-"+tipoTorcida).html(res + torc);						AtualizaQtdeTorcida1(1);			AtualizaQtdeTorcida2(1);			/*uid_redesocial = 0;			user = 0;*/		}	 }); /*close $.ajax*/}function verificaUserTorcida(tipoTorcida, idJogo, uid_redesocial,del){/*Verifica de qual torcida o usuário está participando para atualizar os botões Entrar e Sair das torcidas*/	if(uidRede==0){			}else{		$.ajax({			type: "POST",			url: 'backend/verificaUserTorcida.php',			data: '&tipoTorcida=' + tipoTorcida + '&jogo_id=' + idJogo + '&uid_redesocial=' + uid_redesocial,			success: function(data) {				$('#btArquibancada'+tipoTorcida).html(data);			}		 }); /*close $.ajax*/	}}function atualizarTorcida(torcida, usr, redesocial,pagina,del){	$.ajax({		url: 'backend/listaUsersOnArquibancada.php',		type: 'GET',		data: 'jogo_id='+theGame+'&torcida='+torcida+'&usr='+usr+'&redesocial='+redesocial+'&pagina='+pagina+'&del='+del,				success: function(data) {			$('#lista_torcida'+torcida).html(data);			FB.XFBML.Host.parseDomTree();		}	 }); /*close $.ajax*/}/*Fim arquibancada Virtual*//*Placar*/function updatePlacar(){	$.ajax({		type: "GET",		url: "backend/placar.php?jogo="+theGame+"&ts="+new Date().getTime(),		success: function(data) {			$('#lancelance').html(data);		}	 }); /*close $.ajax*/}function updatePlacarGol(){	$.ajax({		type: "GET",		url: "backend/placar-gol.php?jogo="+theGame+"&ts="+new Date().getTime(),		success: function(data) {			$('#placarr').html(data);			if (validaTempo() == 1){				//if(data.search("Finalizado") > -1){				if(data.search("Partida encerrada") > -1){					campeoesDoPeQuente();					//theTime = "Finalizado";					theTime = "Partida encerrada";				}			}		}	 }); /*close $.ajax*/}function updateTimeLine(){	$.ajax({		type: "GET",		url: "backend/placar-timeline.php?jogo="+theGame+"&ts="+new Date().getTime()+"&etapa="+tempoEtapa,		success: function(data) {			if(data !=0){				$('#minutoaminuto').html(data);				efeitoAbasSFade(aba_ativa,'#aba01');			}		}	 }); /*close $.ajax*/}/*Fim Placar*/function abaAtiva(idAba){	aba_ativa = idAba;}	function setTempo(tempo){	tempoEtapa = tempo;	updateTimeLine();	updateEtapas();}function postar(){	var jogo_id = $('#jogo_id').val();	var rede_social_id = $('#rede_social_id').val();	var uid_redesocial = $('#uid_redesocial').val();	var img_profile = $('#img_profile').val();	var name_profile = $('#name_profile').val();	var username_profile = $('#username_profile').val();	var comment = $('#status').val();		var check = $('#ck:checked').length;		$.ajax({		url: 'backend/inserirComentario.php',		type: 'POST',		data: 'jogo_id=' + jogo_id + '&rede_social_id=' + rede_social_id + '&uid_redesocial=' + uid_redesocial + '&status=' + comment + '&img_profile=' + img_profile + '&name_profile=' + name_profile + '&username_profile=' + username_profile,				success: function(result){				if(rede_social_id == 3){					if(check == 1){						publish(comment);					}				}								do_tweet();				$('#status').val('');				$('#charCount').removeClass('flag');				$('#charCount').text('140');				//Get the latest comment in database				//getLatestComment();				var qtdLi = $('#commentList li').length;				if(qtdLi > 10){					$('#commentList li:last').remove();				}				//setCookie("postou",1,);		}	});	return false;}function postarBolao(){	var jogo_id = $('#jogo_id').val();	var rede_social_id = $('#rede_social_id').val();	var uid_redesocial = $('#uid_redesocial').val();	var img_profile = $('#img_profile').val();	var name_profile = $('#name_profile').val();	var username_profile = $('#username_profile').val();	var time1 = time[0];	var time2 = time[1];	var placar1 = $('#bolaoresultado1').val();;	var placar2 = $('#bolaoresultado2').val();;	var comment = "Meu palpite no #pequente #"+time1+" "+placar1+" x "+placar2+" #"+time2;		if(!isNaN(placar1)){		if(!isNaN(placar2)){			$.ajax({				url: 'backend/inserirPalpite.php',				type: 'POST',				data: 'jogo_id=' + jogo_id +						'&rede_social_id=' + rede_social_id +						'&uid_redesocial=' + uid_redesocial +						'&status=' + comment +						'&img_profile=' + img_profile +						'&name_profile=' + name_profile +						'&username_profile=' + username_profile +						'&time1=' + time1 +						'&time2=' + time2 +						'&placar1=' + placar1 +						'&placar2=' + placar2,								success: function(result){						$("#conts").html("<div class=\"paraparticipar\">Seu palpite foi enviado com sucesso! no final do jogo veja o resultado.</div>");								if(rede_social_id == 3){							publish(comment);						}else{							tweet_no_check(comment);					}				}			});		}	}	return false;}function setCookie(c_name,value,expiredays){	var exdate=new Date();	exdate.setDate(exdate.getDate()+expiredays);	document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : "; expires="+exdate.toGMTString());}function getLatestComment(){	var timestamp = $('#commentList li:first').attr('id');		if(!timestamp){		timestamp = 0;	}	$.ajax({			url: 'backend/getLatestComment.php',			type: 'GET',			data: 'timestamp='+timestamp+"&jogo_id="+theGame,						success: function(result){				if(result.indexOf("error!")==-1){//If has no errors					if(result.indexOf("semcomentario")== -1){ //If has one comment						//Insert into commentlist the comment						$('.semcomentario').remove();//Remove a linha de Sem comentário						$('#commentList').prepend(result).fadeIn('slow');						//$('#commentList').html(result);						FB.XFBML.Host.parseDomTree()					}				}else{					var msgError = result.replace(/error!/,""); 				}			}		});	setTimeout("set5()",5000);}function getMoreComments(){	var timestamp = $('#commentList li:last').attr('id');	$.ajax({			url: 'backend/getMoreComments.php',			type: 'GET',			data: 'timestamp='+timestamp+"&jogo_id="+theGame,						success: function(result){				if(result.indexOf("error!")==-1){//If has no errors					if(result.indexOf("semcomentario")== -1){ //If has one comment						//Insert into commentlist the comment						$('#commentList').append(result).fadeIn('slow');						FB.XFBML.Host.parseDomTree()					}				}else{					var msgError = result.replace(/error!/,""); 				}			}		});}function updateEtapas(){	$.ajax({		type: "GET",		url: "backend/placar-timeline-tempos.php?jogo="+theGame+"&ts="+new Date().getTime()+"&etapa="+tempoEtapa,		success: function(data) {			if(data !=0){				$('#etapas').html(data);				efeitoAbasSFade(aba_ativa,'#aba01');			}			updateTimeLine();		}	 }); /*close $.ajax*/}		function getLatestNarracao(){	if($('#lancenarrado ul li').length > 0){		var timestamp = $('#lancenarrado ul li:last').attr('class').split(" ");		$.ajax({				type: "GET",				url: "backend/narracao.php?jogo="+theGame+"&tm="+timestamp[0]+"&etapa="+tempoEtapa+"&ts="+new Date().getTime(),				success: function(data) {					if(data != ''){						$('#lancenarrado ul').append(data);						if(data.search("\">gol</span>") > -1){							//alert("gol");							mostrarIntervencao();						}						exibeLastNarracao($('#lancenarrado ul li:last'));						updateEtapas();					}				}		}); /*close $.ajax*/	}}function removeActivated(){	$.each($('#lancenarrado ul li'), function(){		if ($(this).hasClass("activated")){			$(this).removeClass("activated");		}	});}function exibenarracao(id){	removeActivated();	$('#'+id).addClass("activated");	efeitoAbasSFade('#lancelance','#aba01');	lastN = 0;}function exibeLastNarracao(arg){	if(lastN == 1){		removeActivated();		$(arg).addClass("activated");		if(abas == 1){			efeitoAbasSFade('#lancelance','#aba01');		}	}else{		last = $('#lancenarrado ul li:last');		if ($(last).hasClass("activated")){			lastN = 1;			exibeLastNarracao(last);		}	}}function do_tweet(){	var $tweet = $('#status').val();	if ($('#checktwitter').is(':checked')){		$.post(window.location.href, { status: $tweet } );	}	$('#status').val('');	return false;}function do_tweet_auto(){	var $tweet = $('#mensagem_auto').val();	$.post(window.location.href, { status: $tweet } );	return false;}function tweet_no_check(msg){	var $tweet = msg;	$.post(window.location.href, { status: $tweet } );	return false;}//Pega Cook//**/function getCookie(c_name){	if (document.cookie.length>0){		c_start=document.cookie.indexOf(c_name + "=");		if (c_start!=-1){ 			c_start=c_start + c_name.length+1;			c_end=document.cookie.indexOf(";",c_start);			if (c_end==-1) c_end=document.cookie.length;				return unescape(document.cookie.substring(c_start,c_end));		}	}	return ""}/*Seta Cookie*/function setCookie(c_name,value,expiredays){	var exdate=new Date();	exdate.setDate(exdate.getDate()+expiredays);	document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : "; expires="+exdate.toGMTString());}				//Envia mensagem ao logar no Facebookfunction fbOnLoginSend(){	$template_data = {"time1":time[0],"time2":time[1],"time1_placar":time_gols[0],"time2_placar":time_gols[1], "jogo":theGame , "images":[{"src":time_escudo[0], "href":"http://www.ig.com"}, {"src":"http://images.ig.com.br/placarus/vs3.jpg", "href":"http://www.ig.com.br"}, {"src": time_escudo[1], "href":"http://www.ig.com.br"}]};	facebook_publish_feed_story("");}function publish($comentario){	$template_data = {"time1":time[0],"time2":time[1],"time1_placar":time_gols[0],"time2_placar":time_gols[1], "jogo":theGame , "images":[{"src":time_escudo[0], "href":"http://www.ig.com"}, {"src":"http://images.ig.com.br/placarus/vs3.jpg", "href":"http://www.ig.com.br"}, {"src": time_escudo[1], "href":"http://www.ig.com.br"}]};	var user_message_prompt = "O que você está achando do Jogo?"; 	facebook_publish_feed_story($comentario);}function facebook_prompt_permission(permission) {	FB.ensureInit(function() {		FB.Connect.showPermissionDialog(permission);	});}function facebook_publish_feed_story(message) {	var attachment = {'name':'Estou acompanhando o jogo '+time[0]+' '+time_gols[0]+' x '+time_gols[1]+' '+time[1]+'','caption':'Acompanhe também esse e outros jogos no Placar iG:','description':'http://app.esporte.ig.com.br/temporeal/index.php?jogo='+theGame+'','href':'http://app.esporte.ig.com.br/temporeal/index.php?jogo='+theGame+'','media':[{'type':'image','src':time_escudo[0],'href':'http://www.ig.com.br'},{'type':'image','src':'http://images.ig.com.br/placarus/vs5.jpg','href':'http://www.ig.com.br'},{'type':'image','src':time_escudo[1],'href':'http://www.ig.com.br'}]}; 	var actionLinks = [{ "text": "Acompanhe também:", "href": "http://app.esporte.ig.com.br/temporeal/index.php?jogo="+theGame}];	FB.Connect.streamPublish(message, attachment,actionLinks)}function update_user_box(fbtorcida) {	fecharOverlay();	var clogin = document.getElementById("comentelogin");	var user_box = document.getElementById("network");	var uid = FB.Facebook.apiClient.get_session().uid;	uidRede = uid;	var fql = 'SELECT name, pic_square_with_logo, profile_url FROM user WHERE uid=' + uid;	FB.Facebook.apiClient			.fql_query(					fql,					function(result) {						prof_url = result[0].profile_url;						prof_name = result[0].name;						pic_square = result[0].pic_square_with_logo;						user_box.innerHTML = "<div class=\"perfil\">"								+ "<a href=\""								+ prof_url								+ "\" class=\"foto\" target=\"_blank\"><img src=\""								+ pic_square								+ "\" /></a>"								+ "<p><a href=\""								+ prof_url								+ "\" class=\"user\" target=\"_blank\"><strong>"								+ prof_name								+ "</strong></a> <small>via</small> <span>Facebook</span><br /> <a href=\"javascript:FB.Connect.logout();logoutfacebook();\" title=\"logout\" class=\"logout\">(x) sair</a></p>"								+ "<div class=\"topcomment\"></div>"								+ "<form action=\"backend/inserirComentario.php\" method=\"post\" onsubmit=\"return postar();\">"								+ "	<fieldset>"								+ "		<input type='hidden' name='facebook-request' value='true' />"								+ "		<input type=\"hidden\" name=\"jogo_id\" id=\"jogo_id\" value=\""								+ theGame								+ "\" />"								+ "		<input type=\"hidden\" name=\"rede_social_id\" id=\"rede_social_id\" value=\"3\" />"								+ "		<input type=\"hidden\" name=\"uid_redesocial\" value=\""								+ uid								+ "\" id=\"uid_redesocial\" />"								+ "		<input type=\"hidden\" name=\"img_profile\" value=\""+pic_square+"\" id=\"img_profile\" />"								+ "		<input type=\"hidden\" name=\"name_profile\" value=\""+prof_name+"\" id=\"name_profile\" />"								+ "		<input type=\"hidden\" name=\"username_profile\" value=\""+prof_url+"\"  id=\"username_profile\" />"								+ "		<textarea rows=\"2\" autocomplete=\"off\" name=\"status\" id=\"status\"></textarea>"								+ "		<div class=\"bottom\"></div>"								+ "		<input type=\"checkbox\" id=\"ck\" class=\"check\" checked=\"checked\" /><label>Compartilhar este post no Facebook</label>"								+ "		<input type=\"submit\" name=\"submit\" id=\"submit\" class=\"enviar\" value=\"\" onclick=\"prependPost('FACEBOOK');\" />"								+ "	</fieldset>" + "</form>" + "</div>";						clogin.innerHTML = "";												if((fbtorcida > 0) && (fbtorcida < 3)){							entrarTorcida(fbtorcida);						}					});	FB.XFBML.Host.parseDomTree();	sentFB = getCookie('sentFB' + theGame);	if (sentFB != null && sentFB != "") {	} else {		fbOnLoginSend();		setCookie('sentFB' + theGame, theGame, 365);	}	VerificaSeTorcida(3, uid);	//verificaUserTorcida(1, theGame, uidRede);	//verificaUserTorcida(2, theGame, uidRede);		var tt = validaTempo();	if(tt == 0){		$.ajax({			type: "GET",			url: 'backend/verificaSePalpite.php',			data: 'jogo_id='+theGame+'&uid_redesocial=' + uidRede + '&rede_social_id=3',			success: function(data) {				resp = data;				if(resp == "0"){					$(".bolao").css("display","block");					$(".paraparticipar").css("display","none");				}else if(resp == "1"){					$(".bolao").css("display","none");					$(".paraparticipar").css("display","none");					$("#conts").html("<div class=\"paraparticipar\">Seu palpite foi enviado com sucesso! no final do jogo veja o resultado.</div>");				}			}		}); /*close $.ajax*/}}		function logoutfacebook(){		uidRede = 0;		$('#btArquibancada1').html('<a class="bt entrartorcida" title="Entrar nesta torcida" onclick="entrarTorcida(1);">Entrar nesta torcida</a>');		$('#btArquibancada2').html('<a class="bt entrartorcida" title="Entrar nesta torcida" onclick="entrarTorcida(2);">Entrar nesta torcida</a>');		var user_box = document.getElementById("network");		var clogin = document.getElementById("comentelogin");		user_box.innerHTML = 			"<ul class=\"redes\">"			+"	<li><fb:login-button onlogin=\"update_user_box();\"></fb:login-button></li>"			+"	<li><a href=\"lib/twitterApi.php?jogo="+theGame+"\" title=\"logar no twitter\" class=\"twitter\">Twitter</a></li>"			+"</ul>";		clogin.innerHTML = "Comente usando o login da sua rede favorita";		FB.XFBML.Host.parseDomTree();}/*Verifica se o usuario logado esta em alguma torcida*/function VerificaSeTorcida(rede_social_id, uid_redesocial){	$.ajax({		type: "GET",		url: 'backend/torcidaVerifica.php',		data: 'jogo_id='+theGame+'&uid_redesocial=' + uid_redesocial + '&redesocial='+rede_social_id,		success: function(data) {			resp = data;			if(resp > 0){				//atualizarTorcida(resp, uid_redesocial, rede_social_id,0);				atualizarTorcida(resp, uid_redesocial, rede_social_id,1,1);				$('#btArquibancada'+resp).html("<a class='bt sairtorcida' title='Sair desta torcida' onclick='sairTorcida("+data+");'>Entrar nesta torcida</a>");				//$('#btArquibancada'+resp).html(data);				usr = uid_redesocial;			}		}	 }); /*close $.ajax*/	redesoc = rede_social_id;}		function AtualizaQtdeTorcida1(del){	$.ajax({		type: "POST",		url: 'backend/torcidaQuantidade.php',		data: 'jogo_id='+theGame+'&tipoTorcida=1&del='+del,		success: function(data) {			$('#torcida-1').html(data);		}	 }); /*close $.ajax*/}function AtualizaQtdeTorcida2(del){	$.ajax({		type: "POST",		url: 'backend/torcidaQuantidade.php',		data: 'jogo_id='+theGame+'&tipoTorcida=2&del='+del,		success: function(data) {			$('#torcida-2').html(data);		}	 }); /*close $.ajax*/}		function prependPost(via){	img_profile = $("#img_profile").val();	name_profile = $("#name_profile").val();	status = $("#status").val();	username_profile = $("#username_profile").val();		var liPost = "";		liPost = '<li>';	liPost +=	'<a target="_blank" class="foto" title="'+name_profile+'" href="http://twitter.com/'+username_profile+'">';	liPost +=		'<img alt="'+name_profile+'" src="'+img_profile+'">';	liPost +=	'</a>';	liPost +=	'<p>';	liPost +=		'<a target="_blank" title="'+name_profile+'" href="http://twitter.com/'+username_profile+'"><strong>'+name_profile+'</strong></a>';	liPost +=		' '+status+'<br><cite><span>via <i class="via">'+via+'</i></span><small>  1 minuto atrás</small></cite>';	liPost +=	'</p>';	liPost +='</li>';	$('#commentList').prepend(liPost).fadeIn('slow');}function set30(){	AtualizaQtdeTorcida1();	AtualizaQtdeTorcida2();	atualizarTorcida(1, usr, redesoc, paginat1,1);	atualizarTorcida(2, usr, redesoc, paginat2,1);	setTimeout("set30()",30000);}function set60(){	getLatestNarracao();	updatePlacarGol();	//setTimeout("set60()",60000);	setTimeout("set60()",45000);}function set5(){	//getLatestComment();	setTimeout("getLatestComment()",5000);}function AtualizaQtdeTorcida1(){	$.ajax({		type: "POST",		url: 'backend/torcidaQuantidade.php',		data: 'jogo_id='+theGame+'&tipoTorcida=1',		success: function(data) {			$('#torcida-1').html(data);		}	 }); //close $.ajax}function AtualizaQtdeTorcida2(){	$.ajax({		type: "POST",		url: 'backend/torcidaQuantidade.php',		data: 'jogo_id='+theGame+'&tipoTorcida=2',		success: function(data) {			$('#torcida-2').html(data);		}	 }); //close $.ajax}function validaTempo(){	switch (theTime) {		case "1º tempo":			ret = 1;			break;		case "2º tempo":			ret = 1;			break;		case "Intervalo":			ret = 1;			break;		case "Prorrogação":			ret = 1;			break;		case "Pênaltis":			ret = 1;			break;		//case "Finalizado":		case "Partida encerrada":			ret = 2;			break;		default:			ret = 0;			break;	}		return ret;}//Pe quentevar paginaCampeoes = 1;function exibeVencedoresPorPagina(pagina,elemento){	$(".vencedoresdopequente").css("display","none");	$("#exibindo"+pagina).css("display","block");	$(".itmnavegacao li a").removeClass('selected');	$(elemento).addClass('selected');	paginaCampeoes = pagina;}function avancaPaginaVencedores(){	if(paginaCampeoes != $(".vencedoresdopequente").length){		next = parseInt(paginaCampeoes)+1;		$(".vencedoresdopequente").css("display","none");		$("#exibindo"+next).css("display","block");		$(".itmnavegacao li a").removeClass('selected');		$("#paginaexibida"+next+" a").addClass('selected');		paginaCampeoes = next;	}	}function voltaPaginaVencedores(){	if(paginaCampeoes != 1){		prev = parseInt(paginaCampeoes)-1;		$(".vencedoresdopequente").css("display","none");		$("#exibindo"+prev).css("display","block");		$(".itmnavegacao li a").removeClass('selected');		$("#paginaexibida"+prev+" a").addClass('selected');		paginaCampeoes = prev;	}}function campeoesDoPeQuente(){	$.ajax({		type: "GET",		url: "backend/vencedores-pe-quente.php?jogo="+theGame+"&ts="+new Date().getTime(),		success: function(data) {			$('#conts').html(data);		}	 }); /*close $.ajax*/}function acampeonatos(){	$.ajax({		type: "GET",		url: "cache/campeonatos.php",		success: function(data) {					}	 }); /*close $.ajax*/}function getTheGame(){	$.ajax({		type: "GET",		url: "cache/theGame.php?jogo="+theGame+"&ts="+new Date().getTime(),		success: function(data) {					}	 }); /*close $.ajax*/}
