function consiste() {
if (document.busca.q.value == "") {
	alert('forneça o texto para a busca.');
	document.busca.q.focus;
	return false;
	}
else
{
var q=document.busca.q.value

	q = escape(q);

	q = q.replace(/^\+/,'');
	if ( typeof( q ) != 'undefined' ) {
      q = q.replace(/\+/g,'%2B');
   }
	endereco = "/si/busca/busca.htm?q="+q;
	var esq=screen.width-770
	var buscawin = window.open(endereco,'bc','scrollbars=yes,resizable=yes,top=0,left='+esq+',width=770,height=480');
	buscawin.focus();
	}
	
}

function cV(id, value) {
var div = document.getElementById(id);
if (value == true) {
		div.style.display = "block";
		}
	else {
		div.style.display = "none";
		}
}
   	
function cVin(id, value) {
var div = document.getElementById(id);
if (value == true) {
		div.style.display = "inline";
		}
	else {
		div.style.display = "none";
		}
}

function not(URL,ot) {

var alt = parent.parent.parent.parent.frames[0].alturaJan;
var lrg = parent.parent.parent.parent.frames[0].larguraJan;
var esq=screen.width-lrg;
var j = window.open(URL,"_blank",'scrollbars=yes,resizable=yes,top=0,left='+esq+',width='+lrg+',height='+alt) 
//var j = window.open(URL,'ot','scrollbars=yes,resizable=yes,top=0,left='+esq+',width='+lrg+',height='+alt) 
if (window.top.frames.length > 0) window.top.frames[0].janjanOpenedRefer.push(j);
j.focus();
}

function notrec(URL) {
var alt = parent.parent.parent.parent.frames[0].alturaJan;
var lrg = 520
var esq=screen.width-lrg;
var j = window.open(URL,'ot','scrollbars=yes,resizable=yes,top=0,left='+esq+',width='+lrg+',height='+alt) 
if (window.top.frames.length > 0) window.top.frames[0].janjanOpenedRefer.push(j);
j.focus();
}
var words = '';
function notb(URL) {
if (words=="entrevistas") {
		ad = URL+"?a=a";
		var esq=screen.width-500;
var j = window.open(ad,'ot','scrollbars=yes,resizable=yes,top=0,left='+esq+',width=500,height=500') 
j.focus();
} 
	else {
		ad = URL+"?b=b";
re = /http:\/\/([\w\.]+)(.+)/;
str = re.exec(ad);
var esq=screen.width-parent.frames[0].larguraJanb;
var j = window.open(str[2],'ot','scrollbars=yes,resizable=yes,top=0,left='+esq+',width='+parent.frames[0].larguraJanb+',height='+parent.frames[0].alturaJanb) 
if (window.top.opener.frames.length > 0) window.top.opener.janjanOpenedRefer.push(j);
j.focus();}
}

function ofb(URL,nome) {
var esq=screen.width-770;
var bp = window.open(URL,'ofw'+nome,'scrollbars=yes,resizable=yes,top=0,left='+esq+',width=770,height=480')
//if (window.top.opener && window.top.opener.frames.length > 0) window.top.opener.janjanOpenedRefer.push(j);
if (window.top.frames.length && window.top.frames[0].janjanOpenedRefer != undefined) window.top.frames[0].janjanOpenedRefer.push(bp);
bp.focus();
}

function oft(URL,nome) {
var esq=screen.width-800;
var bp = window.open(URL,'oft'+nome,'scrollbars=yes,resizable=yes,top=0,left='+esq+',width=800,height=585')
//if (window.top.opener && window.top.opener.janjanOpenedRefer) window.top.opener.janjanOpenedRefer.push(j);
if (window.top.frames.length && window.top.frames[0].janjanOpenedRefer != undefined) window.top.frames[0].janjanOpenedRefer.push(bp);
bp.focus();
}


function oftf(URL,nome,h) {
var esq=screen.width-420;
var bpf = window.open(URL,nome,"scrollbars=yes,location=no,directories=no,status=yes,menubar=no,resizable=no,toolbar=no,top=0,left="+esq+",width=415,height=" +h );
//if (window.top.opener && window.top.opener.janjanOpenedRefer) window.top.opener.janjanOpenedRefer.push(j);
if (window.top.frames.length && window.top.frames[0].janjanOpenedRefer != undefined) window.top.frames[0].janjanOpenedRefer.push(bpf);
bpf.focus();
}

function oftfw(URL,nome,w,h) {
var esq=screen.width-w;
var bpf = window.open(URL,nome,"scrollbars=yes,location=no,directories=no,status=yes,menubar=no,resizable=no,toolbar=no,top=0,left="+esq+",width="+w+",height=" +h );
//if (window.top.opener && window.top.opener.janjanOpenedRefer) window.top.opener.janjanOpenedRefer.push(j);
if (window.top.frames.length && window.top.frames[0].janjanOpenedRefer != undefined) window.top.frames[0].janjanOpenedRefer.push(bpf);
bpf.focus();
}

function of(URL,nome) {
var esq=screen.width-770;
var bp = window.open(URL,'ofw'+nome,'scrollbars=yes,resizable=yes,top=0,left='+esq+',width=770,height=480')
//if (window.top.frames.length > 0) window.top.frames[0].janjanOpenedRefer.push(bp);
// alterado pois estava dando erro no link 'Tudo sobre a busca'
if (window.top.frames.length && window.top.frames[0].janjanOpenedRefer != undefined) window.top.frames[0].janjanOpenedRefer.push(bp);
bp.focus();
}

function ofb(URL,nome) {
var esq=screen.width-770;
var bp = window.open(URL,'ofw'+nome,'scrollbars=yes,resizable=yes,top=0,left='+esq+',width=770,height=520')
//if (window.top.frames.length > 0) window.top.frames[0].janjanOpenedRefer.push(bp);
// alterado pois estava dando erro no link 'Tudo sobre a busca'
if (window.top.frames.length && window.top.frames[0].janjanOpenedRefer != undefined) window.top.frames[0].janjanOpenedRefer.push(bp);
bp.focus();
}

function cot(URL) {
var esq=screen.width-500;
var j = window.open(URL,'ot','scrollbars=yes,resizable=yes,top=0,left='+esq+',width=500,height=300') 
if (window.top.frames.length > 0) window.top.frames[0].janjanOpenedRefer.push(j);
j.focus();
}

function cotd(URL) {
var esq=screen.width-500;
var jd = window.open(URL,'otd','scrollbars=yes,resizable=yes,top=0,left='+esq+',width=500,height=300') 
jd.focus();
}

function cotw(URL) {
var esq=screen.width-575;
var j = window.open(URL,'ot','scrollbars=yes,resizable=yes,top=0,left='+esq+',width=580,height=310') 
if (window.top.frames.length > 0) window.top.frames[0].janjanOpenedRefer.push(j);
j.focus();
}

function portw(URL) {
var winfo = window.top.frames[0].winInfo;
for (var i in winfo) if (!winfo[i].closed) winfo[i].close();
var esq=screen.width-575;
var j = window.open(URL,'otpf','scrollbars=yes,resizable=yes,top=0,left='+esq+',width=602,height=336') 
window.top.frames[0].portfOpenedRefer = j;
j.focus();
}

function fechaportw() {
for (var i in winfo) if (!winfo[i].closed) winfo[i].close();
window.parent.close();
}

function winback(URL) {
  if (top.opener && !top.opener.closed) top.opener.location.href = URL;
  parent.close();
}

function ofw(URL) {
var esq=screen.width-365;
var bp = window.open(URL,'ofw','scrollbars=no,resizable=no,top=0,left='+esq+',width=365,height=375')
if (window.top.frames.length > 0) window.top.frames[0].janjanOpenedRefer.push(bp);
bp.focus();
}

function cotfr(URL) {
//parent.frames[1].frames[0].frames[0].frames[1].location.reload(URL)
parent.not00cot.notcoti.notcot.cot.location.href = URL
}

function engtut(URL) {
var esq=screen.width-573;
var tut = window.open(URL,'entu','scrollbars=no,resizable=no,top=0,left='+esq+',width=573,height=317') 
if (window.top.frames.length > 0) window.top.frames[0].janjanOpenedRefer.push(tut);
tut.focus();
}

function fale(URL) {
var esq=screen.width-773;
var fal = window.open(URL,'falec','scrollbars=yes,resizable=yes,top=0,left='+esq+',width=773,height=442')
if (window.top.frames.length > 0) window.top.frames[0].janjanOpenedRefer.push(fal); 
fal.focus();
}

function serv(URL) {
var esq=screen.width-450;
var ser = window.open(URL,'servicos','scrollbars=no,resizable=no,top=0,left='+esq+',width=450,height=470') 
if (window.top.frames.length > 0) window.opener.top.frames[0].janjanOpenedRefer.push(ser); 
ser.focus();
}

function servs(URL) {
var esq=screen.width-470;
var ser = window.open(URL,'servicos','scrollbars=yes,resizable=no,top=0,left='+esq+',width=470,height=420')
if (window.top.frames.length > 0) window.opener.top.frames[0].janjanOpenedRefer.push(ser);  
ser.focus();
}

function servc(URL) {
var esq=screen.width-700;
var ser = window.open(URL,'servicos','scrollbars=yes,resizable=no,top=0,left='+esq+',width=700,height=420')
if (window.top.frames.length > 0) window.opener.top.frames[0].janjanOpenedRefer.push(ser);  
ser.focus();
}

function winfale() {
var esq=screen.width-790;
var nomearq = "/si/servicos/fale.htm?urlc="+document.location;
var windowvar = window.open(nomearq,'winfc','scrollbars=yes,location=no,directories=no,status=yes,menubar=no,resizable=no,toolbar=no,top=0,left='+esq+',width=790,height=442');
if (window.top.frames.length > 0) window.top.frames[0].janjanOpenedRefer.push(windowvar);
windowvar.focus();
}

function estudos() {
var esq=screen.width-800;
var nomearq = "/estudos/";
var windowvar = window.open(nomearq,'winest','scrollbars=yes,location=no,directories=no,status=yes,menubar=no,resizable=no,toolbar=no,top=0,left='+esq+',width=800,height=492');
if (window.top.frames.length > 0) window.top.frames[0].janjanOpenedRefer.push(windowvar); 
windowvar.focus();
}

function oesp() {
var woesp = window.open('http://www.guiasoesp.com.br/','oesp');
woesp.focus();
}

window.defaultStatus = "";
function winfalee() {
var esq=screen.width-790;
var nomearq = "/si/servicos/pfe.htm?urlc="+document.location;
var windowvar = window.open(nomearq,'winfc','scrollbars=yes,location=no,directories=no,status=yes,menubar=no,resizable=no,toolbar=no,top=0,left='+esq+',width=790,height=442');
if (window.top.frames.length > 0) window.top.frames[0].janjanOpenedRefer.push(windowvar); 
windowvar.focus();
}

function j(param,w,h,nome) {
var esq=screen.width-w;
var nomearq = param;
var windowvar = window.open(nomearq,nome,"scrollbars=yes,location=no,directories=no,status=yes,menubar=no,resizable=no,toolbar=no,top=0,left="+esq+",width="+ w + ",height=" +h );
if (window.top.frames.length > 0) window.top.frames[0].janjanOpenedRefer.push(windowvar); 
windowvar.focus();
}

function indart(){
r=document.location.toString().split("materias");
document.location=r[0];
}

function logout() {
	// fecha portfolio se tiver destacado
	var pfwin = window.top.frames[0].portfOpenedRefer;
	if (pfwin != null && !pfwin.closed) pfwin.close();
	//
	var fqArr = window.top.frames[0].fastqOpenedRefer;
	for (var i = 0; i < fqArr.length; i++) {
		if (fqArr[i] != null && !fqArr[i].closed) fqArr[i].close();
	}
	
	var janArr = window.top.frames[0].janjanOpenedRefer;
	for (var i = 0; i < janArr.length; i++) {
		if (janArr[i] != null && !janArr[i].closed) janArr[i].close();
	}
	
	
	// vai para pagina de logout
	window.top.location.href= '/si/servicos/login/logout.php';
}


function wfor(param,w,h,nome) {
   var windowvar = window.open('/si/analisesecenarios/parceiros/fortuna/index.frm','wfor',"scrollbars=yes,location=no,directories=no,status=no,menubar=no,resizable=yes,toolbar=no,top=30,left=30,width=725,height=495");
}


//	window.top.status = "-*"+fqArr.length+"*-";
