var nomesf = new Array();
nomesf[0] = "barra";
nomesf[1] = "conteudo";
nomesf[2] = "footer";
var nframes = 3;
var endsite = "http://www.bradescocelular.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;
	  }
}

function emprestimos(){
	window.open('/html/hotsite/emprestimo-celular/index.html','emprestimos', 'width=650,height=503,top=60,left=99,scrollbars=0,menubar=0,toolbar=0,statusbar=0,resizable=0');
	}

// Função Popup: <a href="arquivo.ext" onclick="popup(this.href,'360','535','1'); return false;"></a>
function popup(url,w,h,s) {
	var oW=window.open(url,'popup','width='+w+',height='+h+',directories=0,location=0,menubar=0,resizable=0,scrollbars='+s+',status=0,toolbar=0,marginleft=0,margintop=0,left='+(((screen.availWidth-w)/2)+-10)+',top='+(((screen.height-h)/2)+-10));
}

//Função para impressão
function imprimir(){
	popimpressao = window.open('', '_blank', 'width=751,height=450,left=0,top=0,scrollbars=yes,resizable=no,menubar=no,toolbar=no');

	with (popimpressao.document) {
		write('<html><head><title></title></head>');
		write('<link rel="stylesheet" href="../../css/default.css" type="text/css">');
		write('<link rel="stylesheet" href="../../css/print.css" type="text/css">');
		write('<body>');
		write(document.getElementById("impressao").innerHTML);
		write('</body></html>');
		close();
		}
        popimpressao.print();
}

function exibe(id){
	var doc = document.getElementById(id);
	var lnk = document.getElementById("li_"+id);
	doc.style.display = "block";
}
function esconde(id){
	var doc = document.getElementById(id);
	var lnk = document.getElementById("li_"+id);
	doc.style.display = "none";	
}
function exibe_a(id){
	var doc = document.getElementById(id);
	doc.style.display = "block";
}
function esconde_a(id){
	var doc = document.getElementById(id);	
	doc.style.display = "none";
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function campanha_gsm()
{
	window.open('/html/hotsite/gsm/gsm.htm','bradesco','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,width=706,height=460,top=10,left=10');
}	

function abreJanela(caminho,janela,parametros){
	MM_openBrWindow(caminho,janela,parametros);
	janelaNova.focus();
}

function MM_openBrWindow(theURL,winName,features) {
  janelaNova=window.open(theURL,winName,features);
}

MM_preloadImages('../../img/blt_menos.gif','../../img/blt_mais.gif');

function abrefecha(id){
	var d = document.getElementById("cont_"+id);
	var l = document.getElementById("lnk_"+id);

	if(d.style.display == "none"){
		l.className = "ttlOn";
		d.style.display = "block";
	}
	else{
		l.className= "ttlOff";
		d.style.display = "none";
	}

	location.href="#cont"+id;
}

ns = document.layers ? 1 : 0;
ie = document.all ? 1 : 0;
oldId = "Layer1";

function lyrVisual(id,estado)
{
	if (navigator.appName == "Netscape") {		
		opcao = (estado) ? "show" : "hide";			
		controle(id,'',opcao);		
	}
	else{
		opcao = (estado) ? "visible" : "hidden";
		parent.conteudo.document.all[oldId].style.visibility = "hidden";
		parent.conteudo.document.all[id].style.pixelTop = parent.conteudo.document.body.scrollTop;
		parent.conteudo.document.all[id].style.visibility = opcao;
		oldId = id.toString()
	}
}

function mOut(src,clrIn)
{
	if (!src.contains(event.toElement)) {
	  src.style.cursor = 'default';
	  src.bgColor = clrIn;
	}
}

function onMouseOut()
{
	parent.lyrVisual('Layer1',0)
}

var tempo;

// ######################################
function escrevebanner(){
	if(screen.width > 800)
	{
		document.write ('<div style="position:absolute; left:790px; z-index:1;" id="staticbuttons">');
		document.write (document.getElementById("bannerFloat").innerHTML);
		document.write ('<\/div>');
		document.write ("<scr"+"ipt src='/html/js/fcnBannerFlutuante.js' type='text/javascript'><\/scr"+"ipt>");
	}}
	
// A função abaixo verifica se está sendo utilizado o ipad
var navegador = false;
if (navigator.userAgent.toLowerCase().indexOf("ipad") != -1) {
	navegador = true;
}
else{
	navegador = false;
}
