// tira o bug de background em links no IE - inicio
function ieFlickerFix(){
try {
document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}
}
// tira o bug de background em links no IE - fim


// Banner dia įgua
$(document).ready(function() {
		$('.btPopBannerFecha').click(function() {
		$('.popBanner').hide();
	});
});


//Enquete Lateral
$(function(){
	$('#jqBtnEnqueteLat').click(function(){
		var pai = $(this).parent();
		var arrData = "";
		pai.find('input').each(function(i){
			if($(this).attr('checked'))
			{
				arrData += $(this).val()+"@";
			}
		});
		
		if(arrData.length > 0)
		{
			$.post('home/flash_xml_enquete.aspx',{voto:arrData});	
			enqueteLateralOk();
		}
		return false;
	});	
	
	$('#jqBtnEnqueteMid').click(function(){
		var pai = $(this).parent().parent();
		var arrData = "";
		pai.find('input').each(function(i){
			if($(this).attr('checked'))
			{
				arrData += $(this).val()+"@";
			}
		});
		
		if(arrData.length > 0)
		{
			$.post('home/flash_xml_enquete.aspx',{voto:arrData});	
			enqueteCentroOk();
		}
		return false;
	});	
});

function enqueteLateralOk(){
	var pai = $('#jqBtnEnqueteLat').parent();
	var div = $('#MostraEnqueteHome').parent();
	//div.style.display="";
	pai.find('input').fadeOut();
	$('#jqBtnEnqueteLat').fadeOut("normal",function(){
		pai.find('.barEnquete').fadeIn();											
	});
}

function enqueteCentroOk(){
	var pai = $('#jqBtnEnqueteMid').parent().parent();
	pai.find('input').fadeOut();
	$('#jqBtnEnqueteMid').fadeOut("normal",function(){
		pai.find('.barEnquete').css('display','block');
	});
}

$(function(){
	$('.fotoFrameBg').mouseover(function(){
		$(this).parent().find('div.fotoFrameCredito').stop(true);
		$(this).parent().find('div.fotoFrameCredito').animate({opacity:.5},1);
		$(this).parent().find('div.fotoFrameCredito').animate({bottom:'0'},300);
	});
	$('.fotoFrameBg').mouseout(function(){
		$(this).parent().find('div.fotoFrameCredito').stop(true);
		$(this).parent().find('div.fotoFrameCredito').animate({bottom:'-30px'},300);
	});	   
});



/*Flashs*/
$(function(){
	$('.jqTitFlashBranco').each(function(i){
		var txt = $(this).text();
		$(this).empty();
		$(this).append('<div id="jqFlTitBranco_'+i+'"></div>');
		swfobject.embedSWF(STATIC_URL + "swf/titulosBranco.swf", "jqFlTitBranco_"+i, 192, 29, '10.0.0', null, {titulo:txt}, {wmode:'transparent',menu:'false'}, null, null);
	});	   
});

/*Estatisticas*/
$(function(){
	$('.linkEstatistica').click(function(){
		var varRegistro = $(this).attr('rel');
		$.get('gisele_grava_estatisticas.asp',{idRegistro:varRegistro});
		return true;
	});
});