$(function(){
	$("#CotNot a").click( function(){
		$("#CotNot").find("a").css({ color: "#000", fontWeight: "normal" });
		$(this).css({ color: "#F00000", fontWeight: "bold" });
		$(".boxAbasCotNot").find(".bgrBottom").find("div").hide();
		$(this).parents("p").css("backgroundPosition",$(this).attr("coords"));
		$(".boxAbasCotNot").find(".bgrBottom").find("."+$(this).attr("title")).show();
	});

	$("#CotNot a[@title=cotacoes]").click();
	
	$(".boxQualNecessidade .btn").hover(function(){
		$(".necessidades").show();
	},function(){
		$(".necessidades").hide();
	});

	$(".necessidades").hover(function(){
		$(".necessidades").show();
	},function(){
		$(".necessidades").hide();
	});

	$(".menuConheca").hover(function(){
		$(this).children("div").show();
	},function(){
		$(this).children("div").hide();
	});

	$(".boxAbreFecha p.lnk a").toggle(function(){ 
	  $(this).parents("p").addClass("on");
	  $(this).parents(".boxAbreFecha").children("div").show();
	},function(){ 
	  $(this).parents("p").removeClass("on");  
	  $(this).parents(".boxAbreFecha").children("div").hide();
	});
	
});

/*function overSimulador(){
	$(".boxVejaSimuladores").show();
	$(".boxVejaSimuladores").focus();
}

function outSimulador(){
	$(".boxVejaSimuladores").hide();
	$(".boxVejaSimuladores").focus();
}*/

function menuOver(obj){
	$(obj).children("a").css({ fontWeight: "bold", color: "#F10F0F", textDecoration: "underline" });
	$(obj).children("div").css("left","144px");
	$(".colCont select").css("visibility","hidden");
}
function menuOut(obj){
	$(obj).children("a").css({ fontWeight: "normal", color: "#000", textDecoration: "none" });
	$(obj).children("div").css("left","-99999px");
	$(".colCont select").css("visibility","visible");
}

function popup(url,w,h,s){var oW=window.open(url,'popup','width='+w+',height='+h+',directories=0,location=0,menubar=0,resizable=1,scrollbars='+s+',status=0,toolbar=0,marginleft=0,margintop=0,left=0,top=0');}

function openSimulador(valor){
	if(valor != ""){
		if(valor.indexOf("popup") > -1)
			location.href = valor;
		else
		{
		    if (valor.indexOf("/simuladores/") > -1 || valor.indexOf("/fidelidade/") > -1 || valor.indexOf("/investimentos_api") > -1)
				location.href = valor;
			else
				window.open(valor);
		}
	}
}

function openBoxAbreFecha(id){
	$("#"+id).find("p.lnk").addClass("on");
	$("#"+id).find("div").show();
}

function addFav(strUrl, strTit) {
    var error = 'Por favor, clique em OK e então pressione CTRL + D para adicionar-nos!'
    //if (strUrl == '' || strTit == '') { strUrl = document.location.href; strTit = document.title; }
    //alert(strUrl + " - " + strTit)
    if (window.sidebar && window.sidebar.addPanel) { 
        window.sidebar.addPanel(strTit,strUrl,''); 
    }
    else if (window.external) { 
        window.external.AddFavorite(strUrl,strTit) 
    }
    else if (window.opera && window.print) { 
        alert(error) 
    }
    else { alert(error) }
} 

var nomesf = new Array();
nomesf[0] = "frm_top";
nomesf[1] = "conteudo";
nomesf[2] = "barraBottom";
var nframes = 3;
var endsite = "http://www.bradescoprime.com.br/";

try
{
	if (parent.frames.length > 0)
	{
		if (parent.frames.length != nframes)
		 {
		   //Quantidade de frames diferente do permitido.
		   top.location.href=endsite;
		 }	
		for(x=0;x<parent.frames.length;x++)
		 {
		  if (nomesf[x] != parent.frames[x].name)
		    {
			//Nome dos Frames
			top.location.href=endsite;
			}
		 }
	}
}
catch(e)
{
	  var detect = navigator.userAgent.toLowerCase();
	  if (detect.indexOf('mac') < 1)
	  {
	   //Catch caso carrege de um iframe
	   top.location.href=endsite;
	  }
}

// formatacao da tabela de resultado de premios dos cartões

$(document).ready(function(){

$('.tabSorteioResult tbody tr').each(function(){
    
    $(this).find('td:last').css('border-right','0px');
    
});
$('.tabSorteioResult tbody tr:even td').addClass('alt');

});