var nomesf = new Array();
nomesf[0] = "frm_top";
nomesf[1] = "mid";
var nframes = 2;
var endsite = "http://www.bradesconikkei.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;
	  }
}

// JavaScript Document
function selecionarCSS(){
	estiloCerto=(document.getElementById)?'ie.css':((document.all)?'ie.css':'ns.css');
	correcaoPath=((document.location+'-').indexOf('/content')!=-1)?'../../':'';
	document.write('<link rel="stylesheet" href="'+correcaoPath+'css/'+estiloCerto+'" type="text/css">')
}
selecionarCSS();

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 glossario (arquivo){
	window.open(arquivo, 'popupwindow', 'top=0,left=0,width=605,height=500,scrollbars=yes,resizable=no,statusbar=yes'); 
}


function popup (arquivo,w,h){
	window.open(arquivo, 'popupwindow', 'top=0,left=0,width='+w+',height='+h+',scrollbars=no,resizable=no,statusbar=no'); 
}


function popup_v (arquivo){
	window.open(arquivo, 'popupwindow', 'top=0,left=0,width=650,height=500,scrollbars=yes,resizable=yes,statusbar=yes'); 
}

function home_broker(){
 openPopup('http://www.shopinvest.com.br/Home_Broker/default.aspx','TVHomeBroker',screen.width,screen.height,'top=0,left=0',true);
}

function openPopup(u,n,w,h,o,c)
{
 
var l=t=18;if(c)
{l=(screen.availWidth-w)/2;t=(screen.availHeight-h)/2;}
p=window.open(u,'pop_'+n,'left='+l+',top='+t+',width='+w+',height='+h+',scrollbars=1'+((o)?','+o:''));
 
}