function abre_visita() {
    wnd=window.open('swf/visitaguiada.htm','wndVG','width=643,height=440,toolbars=no,scrollbars=no');
}

function abre_contactos(){
  //top.location.href = "/contactos.jsp";
  top.location.href = "ND.jsp";
	return;
}

function abre_visita(){
    wnd=window.open('swf/visitaguiada.htm','wndVG','width=797,height=531,toolbars=no,scrollbars=no');
}

function home_page(){
  top.corpo.location = "corpo_homepage.jsp";
	return;
}

function abre_oquee(){
  top.location.href = "que_intro.jsp";
	return;
}

function abre_subscrever(){
  //top.location.href = "https://www.infopedia.pt/subscrever/subscrever1.jsp";
  top.location.href = "http://www.infopedia.pt/subscrever/subscrever0.jsp";
	return;
}

function abre_subscrever_dlp(){
  top.location.href = "https://www.infopedia.pt/subscrever_dlp/subscrever1.jsp";
	return;
}

/*
function abre_contactos(){
  self.location.href = "ND.jsp";
	return;
}
*/

function testabrowser(versao)
{
	browser=navigator.appVersion;
	agent = navigator.userAgent;
	if (navigator.appName == "Microsoft Internet Explorer" && browser.indexOf(versao +".")>-1 && !(agent.indexOf("Opera")>-1))
	{
		return true;
	}else{
		return false;
	}
}


function abre_popup(url) {
	var p;
  //alert(1);
	p = window.open(url,"E1","height=" + (screen.availHeight-25) + ",width=" +(screen.availWidth) +",hotkeys=no,left=0,top=0,scrollbars=auto,status=yes,location=no,left=center,top=center,resizable=yes");
	//p = window.open(url,"e0","hotkeys=no,left=0,top=0,scrollbars=auto,status=yes,location=no,resizable=yes");
  //alert(12);
  p.moveTo(0,0);
  //alert(12);
  p.resizeTo(screen.availWidth,screen.availHeight);
  //alert(12);
  if(testabrowser("6")){
    var daddy = window.self;
    daddy.opener = window.self;
    daddy.close();
  }
  else{
    //alert(12);
    window.location.replace("Logo.jsp");
  }
  //p.focus();
}

function abre_infopedia() {
  //abre_login("login_iframe.jsp?url=E1.jsp");

  /*if(is.b!="other"){
    top.location = "LoginEfectuado.jsp?url=E1.jsp";
  }
  else{
    top.location = "LoginEfectuado.jsp?url=E1.jsp&other=sim";
  }*/
  if(is.b!="other"){
    top.location = "E1.jsp?t=1";
  }
  else{
    top.location = "E1.jsp?t=1&other=sim";
  }
}

function abre_dicionarios() {
  //abre_login("login_iframe.jsp?url=E2.jsp&dicionarios=sim");

  /*if(is.b!="other"){
    top.location = "LoginEfectuado.jsp?url=E2.jsp&dicionarios=sim";
  }
  else{
    top.location = "LoginEfectuado.jsp?url=E2.jsp&dicionarios=sim&other=sim";
  }*/
  if(is.b!="other"){
    top.location = "E2.jsp?t=2";
  }
  else{
    top.location = "E2.jsp?t=2";
  }
}

function abre_dicionarios_raiz() {
  //abre_login("login_iframe.jsp?url=E2.jsp&dicionarios=sim");

  /*if(is.b!="other"){
    top.location = "../LoginEfectuado.jsp?url=E2.jsp&dicionarios=sim";
  }
  else{
    top.location = "../LoginEfectuado.jsp?url=E2.jsp&dicionarios=sim&other=sim";
  }*/
  if(is.b!="other"){
    top.location = "../E2.jsp?t=2";
  }
  else{
    top.location = "../E2.jsp?t=2";
  }
}

function abre_dlp(pesq) {
  /*if(is.b!="other"){
    top.location = "LoginEfectuado.jsp?url=E2.jsp?dicionarios=sim||||op=Definicao||||Entrada=" + pesq;
  }
  else{
    top.location = "LoginEfectuado.jsp?url=E2.jsp?dicionarios=sim||||other=sim||||op=Definicao||||Entrada=" + pesq;
  }*/
  if(is.b!="other"){
    top.location = "E2.jsp?t=2&z=1&op=Definicao&Entrada=" + pesq;
  }
  else{
    top.location = "E2.jsp?t=2&z=1&other=sim&op=Definicao&Entrada=" + pesq;
  }
}

function abre_banco() {
  //abre_login("login_iframe.jsp?url=E3.jsp");
  /*if(is.b!="other"){
    top.location = "LoginEfectuado.jsp?url=E3.jsp";
  }
  else{
    top.location = "LoginEfectuado.jsp?url=E3.jsp&other=sim";
  }*/
  if(is.b!="other"){
    top.location = "E3.jsp?t=3";
  }
  else{
    top.location = "E3.jsp?t=3&other=sim";
  }
}

function abre_atlas() {
  //abre_login("login_iframe.jsp?url=E4.jsp");
  /*if(is.b!="other"){
    top.location = "LoginEfectuado.jsp?url=E4.jsp";
  }
  else{
    top.location = "LoginEfectuado.jsp?url=E4.jsp&other=sim";
  }*/
  if(is.b!="other"){
    top.location = "E4.jsp?t=4";
  }
  else{
    top.location = "E4.jsp?t=4&other=sim";
  }
}

function abre_login(url){
		var left,top,top1;
		var wit=275;
		var hei=320;
    if(is.b!="other"){   
      var meio=(document.body.clientWidth - 775)/2;
      left =e0topo.GetVariable("_xmouse")-0 + meio;
      if((left+wit)>document.body.clientWidth) {
         left=left - wit;
      }
      top=e0topo.GetVariable("_ymouse") -0 + 10;
      if((top + hei)>document.body.clientHeight) {
        top1=top - hei;
        if((top - hei)<0) {
          top=10;
        }
        else{
          top=top1;
        }
      }
      document.all['anotacaoTextFrame'].src=url;
      document.all['anotacao'].style.left=left;
      document.all['anotacao'].style.top=top;
      document.all['anotacao'].style.visibility = 'visible';
    }
    else{ //netscape
      //alert(123);
      var otherparam="other=sim";
      var urlother="";
      if(url.indexOf('?') == -1) {//não tem parametros
        urlother= url + "?" + otherparam;
      }
      else {// ja tem parametros
        urlother= url + "&" + otherparam;
      }
      window.open(urlother,'anotacao','resizable=no,status=no,menubar=no,width=' + wit + ',height=' + (hei+20));
    }
}


/*function abre_login_destaquetematico(url){
		var left,top,top1;
		var wit=275;
		var hei=320;
    if(is.b!="other"){   
      var meio=(document.body.clientWidth - 775)/2;
      left =Moviedest.GetVariable("_xmouse")-0 + meio;
      if((left+wit)>document.body.clientWidth) {
         left=left - wit;
      }
      top=Moviedest.GetVariable("_ymouse") -0 + 10;
      if((top + hei)>document.body.clientHeight) {
        top1=top - hei;
        if((top - hei)<0) {
          top=10;
        }
        else{
          top=top1;
        }
      }
      document.all['anotacaoTextFrame'].src=url;
      document.all['anotacao'].style.left=left;
      document.all['anotacao'].style.top=top;
      document.all['anotacao'].style.visibility = 'visible';
    }
    else{ //netscape
      //alert(123);
      var otherparam="other=sim";
      var urlother="";
      if(url.indexOf('?') == -1) {//não tem parametros
        urlother= url + "?" + otherparam;
      }
      else {// ja tem parametros
        urlother= url + "&" + otherparam;
      }
      window.open(urlother,'anotacao','resizable=no,status=no,menubar=no,width=' + wit + ',height=' + (hei+20));
    }
    
}*/

function abre_login_destaquetematico(url){
  if(is.b!="other"){
    top.location = url;
  }
  else{
    top.location = url + "&other=sim";
  }
}

function abre_download(){ 
  top.location.href = "que_ferramentas.jsp";
	return;
}


function abre_introducao(){ 
  window.parent.infocorpo.location.href = "que_intro.jsp";
	return;
}

function abre_faqs(){ 
  window.parent.infocorpo.location.href = "que_faqs.jsp";
	return;
}

function abre_tarifarios(){ 
  window.parent.infocorpo.location.href = "que_tarifa.jsp";
	return;
}

function abre_termos(){ 
  window.parent.infocorpo.location.href = "que_termos.jsp";
	return;
}

function abre_politica(){ 
  window.parent.infocorpo.location.href = "que_politica.jsp";
	return;
}

function abre_ferramentas(){ 
  window.parent.infocorpo.location.href = "que_ferramentas.jsp";
	return;
}

function abre_infoclique(){ 
  window.parent.infocorpo.location.href = "que_infoclique.jsp";
	return;
}

function abre_newsletters(){ 
  window.parent.infocorpo.location.href = "que_arquivonewsletters.jsp";
	return;
}


function retroceder(){ 
  history.back(-1);
	return;
}

function avancar(){ 
  history.forward(1);
	return;
}

    function copiar() 
	{
		if (document.getElementById('divartigo'))
		{
			document.getElementById("divimpressao").innerHTML=document.getElementById("divartigo").innerHTML;
			copyTo(document.getElementById("divimpressao"));
		}
    }
	


    function imprimir() 
	{
        self.focus();
        self.print();
    }


function ajuda()
{
 if (typeof window.parent.corpo.corpo_down != "undefined") {
    if (typeof window.parent.corpo.corpo_down.ajuda != "undefined") {
       window.parent.corpo.corpo_down.ajuda();
    }
  }
  else {
      if (typeof window.parent.corpo!= "undefined") {
          if (typeof window.parent.corpo.ajuda != "undefined") {
           window.parent.corpo.ajuda();
          }
      }
  }
}
 

function enviar(){ 
if(typeof window.parent.corpo.corpo_down!= "undefined"){
  //caso dos artigos
  if(typeof window.parent.corpo.corpo_down.enviar !="undefined"){
    window.parent.corpo.corpo_down.mostra_popup("EnviarArtigo_iframe.jsp?id="+window.parent.corpo.corpo_down.enviar,270);
  }
  //caso dos dicionarios  
  if(typeof window.parent.corpo.corpo_down.enviar_dicionario !="undefined"){
    window.parent.corpo.corpo_down.mostra_popup("EnviarArtigo_iframe.jsp?dic=" + window.parent.corpo.corpo_down.enviar_dicionario,270);
  }

}
	return;
}

function historico(){
if(typeof window.parent.corpo.corpo_down!= "undefined"){
  if(typeof window.parent.corpo.corpo_down.mostra_popup !="undefined"){
    window.parent.corpo.corpo_down.mostra_popup("historico_iframe.jsp?listagem=sim",510);
  } 
}
else {
  if (typeof window.parent.corpo!= "undefined") {
    if(typeof window.parent.corpo.mostra_popup!="undefined"){
      window.parent.corpo.mostra_popup("historico_iframe.jsp?listagem=sim",510);
    }
  }
}
	return;
}

function arquivo(){ 
if(typeof window.parent.corpo.corpo_down!= "undefined"){
  if(typeof window.parent.corpo.corpo_down.mostra_popup !="undefined"){
    window.parent.corpo.corpo_down.mostra_popup("arquivo_iframe.jsp?listagem=sim",350);
  }
}
else {
  if (typeof window.parent.corpo!= "undefined") {
    if(typeof window.parent.corpo.mostra_popup!="undefined"){
      window.parent.corpo.mostra_popup("arquivo_iframe.jsp?listagem=sim",350);
    }
  }
}
  return;
}

function anotacao(){ 
if(typeof window.parent.corpo.corpo_down!= "undefined"){
  if(typeof window.parent.corpo.corpo_down.mostra_popup !="undefined"){
    window.parent.corpo.corpo_down.mostra_popup("anotacao_iframe.jsp?listagem=sim",430);
  }
}
else {
  if (typeof window.parent.corpo!= "undefined") {
    if(typeof window.parent.corpo.mostra_popup!="undefined"){
      window.parent.corpo.mostra_popup("anotacao_iframe.jsp?listagem=sim",430);
    }
  }
}
	return;
}

//POPUP DE AVISO
function aviso(url){ 
if(typeof window.parent.corpo.corpo_down!= "undefined"){
  if(typeof window.parent.corpo.corpo_down.mostra_popup !="undefined"){
    window.parent.corpo.corpo_down.mostra_popup(url,230);
  }
}
else {
  if (typeof window.parent.corpo!= "undefined") {
    if(typeof window.parent.corpo.mostra_popup!="undefined"){
      window.parent.corpo.mostra_popup(url,230);
    }
  }
}
	return;
}


function gestaoconta(){ 
  window.parent.corpo.location.href = "gestaoconta/gestao_conta.jsp"
  window.parent.corpo.focus();
	return;
}

function sair(){ 
  top.location.href="LogOut.jsp";
  //top.close();
  //alert(top.window.onunload);
  //top.window.onunload="void";
  //alert(parent.onunload);
  //top.location.href="LogOut.jsp";
	return;
}

function logout_forcado(){ 
  //win=window.open('LogOut.jsp','logout','height=100,width=240,scrollbars=no,status=no,location=no,left=center,top=center');
  top.location.href="LogOut.jsp";
  //top.close();
	return;
}

function esconde(){
 	return;    
}