function cjb(ender){
var cota=document.form_cotacao.ativo.value

	//alert (cota)
	window.open(ender,'meta','width=720,height=600,toolbar=no,scrollbars=1,status=0');
}
function docsMFI(doc,largur,altur){
	JanelaDocs = window.open('docsMFI/page.asp?ident='+doc,'Documents','width='+largur+',height='+altur+',menubar=no,location=no,resizable=no,scrollbars=no,status=no');
}

function chatt(){
	window.open('http://www.financialmarkets.com.br/chat2','ChatLive','');
}
//--------------------------------------------------------------------------------------------------------------------------------
    // Create global variables for browser type
    var isIE = new Boolean(false);
    var isNav = new Boolean(false);
    var unSupported = new Boolean(false);
    var layer = new String();
    var style = new String();

    // Determine if the browser is Internet Explorer, Navigator,
    // or other. Also, set the layer variable depending on the
    // type of access it needs.
    
function checkBrowser(){
      if(navigator.userAgent.indexOf("MSIE") != -1){
        isIE = true;
        layer = ".all";
        style = ".style";
      }else if(navigator.userAgent.indexOf("Nav") != -1){
        isNav = true;
        layer = ".layers";
        style = "";
      }else{
        unSupported = true;
      }
}
function Fechar(){
	//changeState('fr_banner','hidden')
}
function Limpar(){
changeState('layer1','hidden')
changeState('layer2','hidden')
changeState('layer3','hidden')
changeState('layer4','hidden')

	//for(u=10;u<20;u++){
		changeState('layer10','hidden')
	//}
}
//=================================================================================================
function Mostrar(vDiv){
	//for(u=10;u<20;u++){
		//changeState('layer'+u,'hidden')
	//}	
	//changeState('layer'+vDiv,'visible')
	changeState('layer10','visible')
	Navegar(vDiv);
}
//=================================================================================================

function Navegar(Num){
Num-=8;
	//frames['iframe1'].location.href="getFrame.asp";
	document.getElementById('iframe0').src="getFrame.asp?codigo="+Num;
	document.getElementById('nelogic').style.display = "none";
	//alert(Num);
}
//=================================================================================================
    function changeState(layerRef, state){
      checkBrowser()
      eval("document" + layer + "['" + layerRef + "']" + style + ".visibility = '" + state + "'");

    }
//=================================================================================================
  n=1;var bt=0;
function Carregar(){
	//checkBrowser()
	changeState('layer'+n,'visible')
	for(u=1;u<5;u++){
		if (u!=n){
			changeState('layer'+u,'hidden')
		}
	}
	//Tempo da Sequencia (Loop)
	CtrTime = setTimeout("Carregar()", 3000) 
	  n++;
	  if(n==5){n=1;}
	  //window.status=n;
	  if (bt==0){
	  		//document.all.bPetrus.value="          Petróleo         ";
	  		bt=1;
	  }else{
	  		//document.all.bPetrus.value="Mercado Internacional";
	  		bt=0;
	  }
	  //alert('oi');
}
//CtrTime = setTimeout('Carregar()', 2000);  //Desabilitado...

function OpenPetrus(){
    enderecoweb="http://www2.gcitrading.com/quotes/index.asp?SYMBOLS=DOWJONESINDEX|SP500INDEX|NASDAQCOMP|DAX30INDEX|FTSE100INDEX|EURUSD|USDJPY|GBPUSD|USDCHF|CRUDE|GOLD|&COLOR1=%23ffffff&COLOR2=%23EAEAEA&COLOR3=%23000000&COLOR4=%23FFCC00&COLOR5=%23CCCCCC&COLOR6=%23FF0000&COLOR7=%23000000&COLOR8=%230000FF&COLUMN1=on&COLUMN2=on&COLUMN3=on&COLUMN4=on&COLUMN5=on&COLUMN6=on&COLUMN7=on&COLUMN8=on&FONTSIZE=11&REFRESH=10";
    	JanelaNova = window.open(enderecoweb,"Petrus","width=476,height=162,menubar=no,location=no,resizable=no,scrollbars=no,status=no");
    }
function intra(){
    WindowObjectReference = window.open("https://homebrokerx.intra.com.br/Login.aspx?ReturnUrl=/Default.aspx","intraPage","width=790,height=400,menubar=no,location=no,resizable=yes,scrollbars=no,status=no");
	
}
    
// função que abre a pop up pesquisa cotação
function abrecot() {
  var codigo;
  var url;

  codigo = document.cotacao.codigo1.value;
  //Desabilitado porque a enfoque está fora do ar
  url = 'http://www.enfoque.com.br/modulos/codefinder/popup_cotacoes.asp?COD=' + codigo;
  window.open(url, "Enfoque", "width=250,height=540");   
}

function cLoad(){
	//setTimeout("changeState('fr_banner','visible')",10000);
	//changeState('fr_banner','visible')
}

function tv1(){
	document.getElementById('WindowsMediaPlayer3').className='bb';
	//document.getElementById('bloom').style.left=247;
	document.getElementById('bloom').innerHTML='';
	//document.getElementById('tv').style.display='block';
	window.open('bloom.html','meta','width=365,height=330,toolbar=no,scrollbars=0,status=1');
}

function tv(){
	document.getElementById('WindowsMediaPlayer3').className='aa';
	document.getElementById('bloom').style.left=17;
	document.getElementById('bloom').style.top=310;
	document.getElementById('tv').style.display='none';
}
