// variaveis de ambiente
window.name = "PortalBolsa"
var isDHTML = false;
var isID = document.getElementById;
var isAll = document.all;
var isLayer = document.layers;

if (isID || isAll || (parseInt(navigator.appVersion) == 4 &&  navigator.appName.indexOf('Netscape') != -1) && isLayer) { isDHTML = true } 
document.onselectstart='return false'
var timestamp = new Date().getTime();

if(parent.frames.length!=0 && parent.window.location.match("/bolsademulher.com/"))
	window.top.location.href = "/"

var BMAd_polite_banner = "0";

_IJS();





function TextoMateria(acao) {
// Altera uma propriedade de um objeto

if (Estilo('TextoMateria').fontSize=='') Estilo('TextoMateria').fontSize = 12;
	switch (acao) {
    case '+': {
      Estilo('TextoMateria').fontSize = parseInt (Estilo ('TextoMateria').fontSize)+1;
      Estilo('TextoMateria').lineHeight = parseInt (Estilo ('TextoMateria').fontSize)/11;
    } break;

    case '-': {
      Estilo('TextoMateria').fontSize = parseInt (Estilo ('TextoMateria').fontSize)-1;
      Estilo('TextoMateria').lineHeight = parseInt (Estilo ('TextoMateria').fontSize)/11;
    } break;
    
    default: {
      Estilo('TextoMateria').fontSize = acao;
      Estilo('TextoMateria').lineHeight = 1.5;
    }
  }

}


var SeletorAntigo = 1;
var ZapId = '';
var TempoZap = 20*1000;
function TrocaCanal(ativo, zap) {
// Troca os canais da home
	clearTimeout(ZapId)
    
 	Estilo('Seletor_'+ativo).display = 'block';
 	Estilo('Texto_Sel_'+ativo).display = 'block';
 	Estilo('Seletor_'+SeletorAntigo).zIndex = 0;
 	Estilo('Seletor_'+ativo).zIndex = 1;
 	Estilo('Texto_Sel_'+SeletorAntigo).zIndex = 0;
 	Estilo('Texto_Sel_'+ativo).zIndex = 1;
  FadeIn('Seletor_'+ativo,60);
 	setTimeout("Estilo('Seletor_"+SeletorAntigo+"').display = 'none'",1000);
//  setTimeout("Estilo('Texto_Sel_"+SeletorAntigo+"').display = 'none'",1000);
//  Estilo('Seletor_'+SeletorAntigo).display = 'none'
  SeletorAntigo = ativo
  
 // if (zap == true)
  	ZapId = setTimeout('Zap('+(ativo+1)+')',TempoZap)
}


function afr(origem,url) {
	pAJAX(url);
 	FadeOut(origem,90,true);
} 

function getCookie(name) {
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    } else {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}

function setCookie(name, value, path)  {
	var today = new Date();
	var path_string = ';path=/';
	today.setTime( today.getTime() );
	expires = 7 * 60 * 60 * 24;

	var expires_date = new Date( today.getTime() + (expires) );
	if (path != null)
		path_string = ";path="+path;
	document.cookie = name + "=" +escape( value ) + ";expires=" + expires_date.toGMTString() + path_string;
}


function _cTexto(chave) {
		pAJAX(cfg_URL + "/materia/PegaTexto.php?vl="+chave,"<SCRIPT>");
}

var TimeoutEtc = false
function etcetera(i) {
	if (i%4 == 1) { Objeto("Metc").innerHTML = '.'; }; 
	if (i%4 == 2) { Objeto("Metc").innerHTML = '..'; }; 
	if (i%4 == 3) { Objeto("Metc").innerHTML = '...'; }; 
	if (i%4 == 0) { Objeto("Metc").innerHTML = '&nbsp;'; }; 
	i++;
  
  TimeoutEtc = setTimeout("etcetera("+i+")",200);
}


function _favoritar(obj) {
	var tipo = obj.substring(0,1);
  var id = obj.substring(1,obj.length);
  switch (tipo) {
  	case 'M': {
		  pAJAX(cfg_URL + '/AJAX/favorita.php?id_materia=' + id + '&tipo=' + tipo,'FavMateria');
    } break;
  	case 'F': {
		  pAJAX(cfg_URL + '/AJAX/favorita.php?id_forum=' + id + '&tipo=' + tipo,'FavForum');
    } break;
  }
}

function _denunciar(obj) {
	var tipo = obj.substring(0,1);
  var id = obj.substring(1,obj.length);
  switch (tipo) {
  	case 'F': {
		  pAJAX(cfg_URL + '/AJAX/denuncia.php?id_forum=' + id + '&tipo=' + tipo,'DenForum');
    } break;
  }
}

var renewtime = timestamp;
function _renew() {
	if (renewtime < time()-600000) { //10 minutos
		AJAX(cfg_URL + '/AJAX/live.php');
	  renewtime = time();
  }
}


function _addContato(obj,p) {
	
  var href = obj.href.split('/');
  var acao = 'adcionar';
	transparencia = _DinD();
  Estilo(transparencia).position = 'absolute';
  Estilo(transparencia).top = '0px';
  Estilo(transparencia).left = '0px';
  Estilo(transparencia).backgroundColor='#000';
/*  Estilo(transparencia).opacity = '.3'; 
  Estilo(transparencia).mozOpacity = '.3';
  Estilo(transparencia).khtmlOpacity = '.3';
  Estilo(transparencia).filter = 'Alpha(opacity=30)';
*/   
  Estilo(transparencia).height = (isAll ? document.body.scrollHeight : document.body.offsetHeight);
  Estilo(transparencia).width = '100%';
  Estilo(transparencia).zIndex = 100;
  FadeIn(transparencia,[0,50]);
  
	caixa = _DinD();
  Estilo(caixa).position = (isAll ? 'absolute' : 'fixed');
  Estilo(caixa).backgroundColor='#FFF';
  Estilo(caixa).height = 240;
  Estilo(caixa).width = '320';
  Estilo(caixa).top = document.body.clientHeight/2-parseInt(Estilo(caixa).height)/2 + (isAll ? document.body.scrollTop : 0 );
  Estilo(caixa).left = document.body.offsetWidth/2-parseInt(Estilo(caixa).width)/2;
  Estilo(caixa).zIndex = 101;
  Estilo(caixa).padding = '20px';
  Estilo(caixa).border = '3px solid #fd2e9e';
//  Objeto(caixa).className = 'BordaRedonda'
  Estilo(caixa).borderRadius = '2em';
  Estilo(caixa).MozBorderRadius = '2em';
  Estilo(caixa).KhtmlBorderRadius = '2em';
  Estilo(caixa).backgroundImage = 'url('+cfg_IMAGEM+'/layout/v2/fundo_caixa-resposta.jpg)';
  Estilo(caixa).backgroundRepeat = 'repeat-x';
  Estilo(caixa).backgroundPosition = '0 20';

  var avatar = Objeto(p).getElementsByTagName('A').item(0).innerHTML;
  var login = Objeto(p).getElementsByTagName('A').item(1).innerHTML;
 
  var fechar = "Elemento(\'BODY\').removeChild(Objeto(transparencia));Elemento(\'BODY\').removeChild(Objeto(caixa))";

	if (obj.innerHTML == 'adicione como favorito') {
	  var str = avatar + '<BR /><BR />&nbsp;&nbsp;<span class="TexCor2">Voc&ecirc; ir&aacute; adcionar '+login+' a sua lista de <B>favoritos</B>.</span><BR/><BR/><BR/><BR/>';
		str+= '<div style="padding-left:50px">Voc&ecirc; pode tamb&eacute;m pode adicionar '+login+' a sua lista de <em>amigos</em>.<BR/><BR/>';
		str+= '<input type="checkbox" name="amigo" value="S" id="famigo" style="padding-left:10px"> Adicionar como amigo<BR/><BR/><BR/>';
	} else {
	  var str = avatar + '<BR /><BR />&nbsp;&nbsp;<span class="TexCor2">'+login+' já está na sua lista de <B>favoritos</B>.</span><BR/><BR/><BR/><BR/>';
		str+= '<div style="padding-left:50px"><BR />Voc&ecirc; quer <B>remover</B> '+login+' da sua lista de favoritos?<BR/><BR/><BR /><BR />';
    acao = 'remover';
  }
	str+= '<BR/><input type=button value=ok class=BotaoBranco onClick="pAJAX(cfg_URL + \'/AJAX/favorita.php?pessoa='+href[3]+'&amigo='+(acao == 'adicionar' ? '\'+(Objeto(\'famigo\').checked==true ? Objeto(\'famigo\').value : \'\')+\'' : 'N')+'&tipo=FP\',\''+p.replace('r','c')+'\');'+fechar+'" /> <input type=button value=cancelar class=BotaoBranco onClick="'+fechar+'" /></div>';
  Objeto(caixa).innerHTML = str;
  
	return false;
}


function verimagem(img,destino,x,y) {
	
	transparencia = _DinD();
  Estilo(transparencia).position = 'absolute';
  Estilo(transparencia).top = '0px';
  Estilo(transparencia).left = '0px';
  Estilo(transparencia).backgroundColor='#000';
  Estilo(transparencia).height = (isAll ? document.body.scrollHeight : document.body.offsetHeight);
  Estilo(transparencia).width = '100%';
  Estilo(transparencia).zIndex = 100;
  FadeIn(transparencia,[0,50]);
  
	caixa = _DinD();
  var img_tmp = new Image();
  img_tmp = img; 
  Estilo(caixa).position = (isAll ? 'absolute' : 'fixed');
  Estilo(caixa).backgroundColor='#FEFEFE';
  Estilo(caixa).height = (y == 'null' ? img_tmp.height : y)+20;
  Estilo(caixa).width = (x == 'null' ? img_tmp.width : x)+20;
  Estilo(caixa).top = document.body.clientHeight/2-parseInt(Estilo(caixa).height)/2 + (isAll ? document.body.scrollTop : 0 );
  Estilo(caixa).left = document.body.offsetWidth/2-parseInt(Estilo(caixa).width)/2;
  Estilo(caixa).zIndex = 101;
  Estilo(caixa).padding = '20px';
  Estilo(caixa).border = '5px solid black';

 
  var str = "<a href='javascript:void(1)' onClick='Elemento(\"BODY\").removeChild(Objeto(transparencia));Elemento(\"BODY\").removeChild(Objeto(caixa))'><img src='"+ img +"' alt='Click para fechar' border=0 /></a>";

//			str+= '<BR/><input type=button value=fechar class=BotaoBranco onClick="'+fechar+'" /></div>';
  Objeto(caixa).innerHTML = str;
  
	return void(0);
}


var _rs = screen.width+'x'+screen.height;

var __ubmdata = '_rs='+_rs;
document.writeln('<script '+'src="'+ cfg_URL + '/__afericao.php?__ubmdata='+ __ubmdata + '"></'+'script>');






























































function _IJS() {
	document.writeln('<script '+'src="'+ cfg_URL + '/js/php2js.php"></'+'script>');
	document.writeln('<script '+'src="'+ cfg_URL_ESTATICO + '/js/adx.js"></'+'script>'); 
	document.writeln('<script '+'src="'+ cfg_URL_ESTATICO + '/js/calendario/calendario.js"></'+'script>');
	document.writeln('<script '+'src="'+ cfg_URL_ESTATICO + '/js/cadastro.js"></'+'script>');
	document.writeln('<script '+'src="'+ cfg_URL_ESTATICO + '/js/funcoes.js"></'+'script>');
	document.writeln('<script '+'src="'+ cfg_URL_ESTATICO + '/js/calculadora.js"></'+'script>');
	document.writeln('<script '+'src="'+ cfg_URL_ESTATICO + '/js/bbcode.js"></'+'script>');
	document.writeln('<script '+'src="'+ cfg_URL_ESTATICO + '/js/nicetitles.js"></'+'script>');
	document.writeln('<script '+'src="'+ cfg_URL_ESTATICO + '/js/mouse.js"></'+'script>');
//	document.writeln('<script '+'src="'+ cfg_URL + '/js/gadsense_auditor.js"></'+'script>');
	document.writeln('<script '+'src="'+ cfg_URL_ESTATICO + '/js/centralvideo.js"></'+'script>');
	if (isAll && parseInt(navigator.appVersion) < 7)
		document.writeln('<script '+'src="'+ cfg_URL_ESTATICO + '/js/pngfix.js"></'+'script>');
	document.writeln('<script '+'src="'+ cfg_URL_ESTATICO + '/js/menu.1.0.js"></'+'script>');
}


