//document.domain="spinnex.com.br";
function ver(id)
{/*
	var div = document.createElement("div");
	div.innerHTML = "<div class='load-ipo'><img src='/images/ajax-loader.gif' /> <span >Carregando...</span></div>";
	document.body.insertBefore(div, document.body.firstChild); 
	window.setTimeout(function()
	{  */
	try
	{
		var eHreserva = (arguments.length > 0 ) ? arguments[1] : false ;
		var url  = "detalhe-oferta-publica.asp?IdOferta="; 
		if(eHreserva == true)
		{
			url = "reserva-oferta-publica.asp?idOferta=";
		}
		window.location.href = url + id;
	
	}catch(e)
	{
		window.location.reload(true);
	}	
	//},100);
}	


var  visibleSubMenu;
if(typeof menuPadrao == 'undefined')
  menuPadrao = 9;
var timeoutMenu = null;

function recuperaMenuAtivo(id)
{
  var novoId = id.replace("sb", "mn");
  //alert([id, novoId]);
  return novoId;
}
function subMenuOn(id) {
  if(timeoutMenu!=null)
  {
    clearTimeout(timeoutMenu);
    timeoutMenu=null;
  }

  if(visibleSubMenu!=null)
  {
    var el = document.getElementById(visibleSubMenu);
    if(el != null)
      el.style.display = 'none';
    el = document.getElementById(recuperaMenuAtivo(visibleSubMenu));
    if(el != null)
      el.className =  el.className.replace(" mainMenuActive", "");
  }
  el = document.getElementById(id);
  if(el!= null) 
    el.style.display='block';
  var el = document.getElementById(recuperaMenuAtivo(id));
  if(el!=null)
    el.className += ' mainMenuActive';
  visibleSubMenu = id;
  
  //alert([el.id, el.className]);
}
function subMenuOff(id) {
  
  if (id) {
    timeoutMenu = setTimeout("subMenuOn('sb" + menuPadrao + "');", 500);
  } else {
    subMenuOn("sb" + menuPadrao);
  }
}

onload = subMenuOff;
function subOn(id){
	if (timeoutMenu != null) {
		clearTimeout(timeoutMenu);
		timeoutMenu = null;
	}
}
function popup(url) {
    sealWin = window.open(url,"win",'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=360,height=312,left=25,top=20');
}

function abrehb(){

vlogin = document.formLogin.CodCliente.value;
//window.location.href = "/login.asp?CodCliente="+ vlogin + "&AcessoExterno=S";
window.location.href = "/login.asp?urlcliente=/formularios/login.asp?CodCliente="+vlogin+"&AcessoExterno=S";

//window.open("http://homebroker.topbroker.com.br/FormLogin.aspx?CodCliente="+ vlogin + "&AcessoExterno=S","",'top=0,left=0,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,width=790,height=425');        
return false;
}


function keypressed(){ 
    if(event.keyCode=='13'){
        //document.forms["formLogout"].submit();
		abrehb();
    } 
}

/*function ChangeTab(on,off) {
	on.style.display='inline';
	off.style.display='none';
}

var ultMenu = new Array();
var ultNivel = null;
function NavegaMenuLateral(o,n,filhos,url) {
	if (filhos==0) {
		window.location.href=url;
		return;
	}
	if (ultMenu[n]!=null) {
		temp = ultMenu[n];
		for(i=n;i<ultMenu.length;i++) {
			ultMenu[i] = null;
		}
		NavegaMenuLateral(temp,n);
	}
	var itens = document.getElementById(o.id + 'a');
	if (itens!=null) {
		var bln = (itens.style.display=='block');
		itens.style.display = (bln) ? 'none' : 'block';
		o.className = (bln) ? 'n'+n : 'n'+n+'s';
		ultMenu[n] = o; 
		
	}
}

function PosicionaMenuLateral(inicial) {
	if (inicial=='') return;
	var id, nivel; 
	var o = document.getElementById('mi_'+inicial);
	if (o!=null) {
		if (o.parentNode.id=="") {
			ultMenu[1] = o; 
		}
		while(o.parentNode.id!="") {
			id = o.parentNode.id.substring(3, o.parentNode.id.length-1);
			nivel = o.parentNode.className.substr(1,1);
			NavegaMenuLateral(document.getElementById('mi_'+id),nivel,1,'');
			o = o.parentNode;
		}
		o = document.getElementById('mi_'+inicial); if (o!=null) o.className += 's';
		o = document.getElementById('mi_'+inicial+'a'); if (o!=null) o.style.display = 'block';
	}
}

function Mouseover(o) {
	o.style.cursor = 'hand';
}

function CaixaPaginada(a, pgSize, divName, metodoPagina, metodoItem) {
	var item = '', html = '', pg = 1, itemCount = 0;
	var pgCount = parseInt(a.length/pgSize) + ((a.length%pgSize>0)?1:0);
	var t = document.getElementById(divName);
	var MontaPagina = eval(metodoPagina);
	var MontaItem = eval(metodoItem);
	for (i=0; i<a.length; i++) {
		item += MontaItem(a[i]);
		if (++itemCount == pgSize) {
			html += MontaPagina(item,pg++,pgCount,divName);
			itemCount = 0; 
			item = '';
		}
	}
	if (itemCount>0) {
		html += MontaPagina(item,pg,pgCount,divName);
	}
	t.innerHTML = html;
}
function Paginacao(pg,div) {
	for (var x=pg-1;x<=pg+1;x++) {
		var p = document.getElementById(div+x);
		if (p!=null) p.style.display = ((x==pg)?'inline':'none');
	}
}
function LinksPaginacao(pg,pgCount,divName) {
	if (pgCount<=1) return '';
	var ante = (pg>1) ? '<a href="javascript:Paginacao('+(pg-1)+',\''+divName+'Pg\');"><img class="imgpaginacao" src="/images/anterior.gif"  vspace="3" alt="Anterior" />Anterior</a>' : ' ';
	var prox = (pg<pgCount) ? '<a href="javascript:Paginacao('+(pg+1)+',\''+divName+'Pg\');">Pr�xima<img class="imgpaginacao" src="/images/proximo.gif"   vspace="3" alt"Pr�xima" /></a>' : ' ';
	return '<div class="paginacao"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td width="40%">'+ante+'</td><td align="center">'+pg+'/'+pgCount+'</td><td align="right" width="40%">'+prox+'</td></tr></table></div>';
}

var idItemMenuPrincipalSelecionado = '';

function MeusLinks() {
	window.open("/meuslinks.asp", "meuslinks", "width=213,height=300").focus();
}

function ConfigMeusLinks() {
	window.open("/meuslinks.asp", "meuslinks", "width=240,height=300").focus();
}

*/

var termoSelecionado = 158;
function ExibeFaq(t) {
	if (termoSelecionado!=null&&termoSelecionado!=t) 
	{
		var termooff = document.getElementById("termo"+termoSelecionado);
		var defoff = document.getElementById("definicao"+termoSelecionado);
		//var imgoff = document.getElementById("imgtermo"+termoSelecionado);
        //alert(defoff.id + " TÔ NO IF " + termoSelecionado);
        
        defoff.style.display =  'none';
		//imgoff.src = '/images/bullet_mais.gif';
		termooff.className = 'termooff';
	}
    
	var termoon = document.getElementById("termo"+t);
	var defon = document.getElementById("definicao"+t);
	//var imgon = document.getElementById("imgtermo"+t);
	
	//alert(defon.id+ " - " + termoSelecionado);
	
	defon.style.display = '';
	
	//defon.style.display = (termoon.className=='termooff') ? 'block' : 'none';
	
//	imgon.src = (termoon.className=='termooff')? '/images/bullet_menos.gif' : '/images/bullet_mais.gif';
	termoon.className = (termoon.className=='termooff')? 'termoon' : 'termooff';

	termoSelecionado = t;
	//alert(termoSelecionado);
}



	function validarNewsletter()
	{
		nome = document.getElementById('name');
		email = document.getElementById('email');
		if (nome.value == "")
		{
			document.getElementById('warning').style.display = 'block';
			return false;
		}
		else
		{
			if (email.value == "") {
				document.getElementById('warning').style.display = 'block';;
				return false;
			}
			else
			{
				var reEmail1 = /^[\w!#$%&'*+\/=?^`{|}~-]+(\.[\w!#$%&'*+\/=?^`{|}~-]+)*@(([\w-]+\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/;
				if (reEmail1.test(email.value))
				{
					document.getElementById('warning').style.display = 'none';
					return true;
				}
				else
				{
					document.getElementById('warning').style.display = 'block';
					return false;
				}
			}
		}
	}
	


	