// JavaScript Document
// Last update:  31-Jan-2005 14:54
var last_id = 0; 
function showSubmenu(id)
// Menu
{ 
  if (last_id!=0)
     { 
        document.getElementById(last_id).style.visibility = 'hidden'; 
     } 
  if (id!='none')
     { 
        document.getElementById(id).style.visibility = 'visible'; 
        last_id = id; 
     }
} 


function expnew(when,image)
// <script>expnew("2/2/2001","new.gif")</script>
{
  when = new Date(when)
  date = new Date()
  if (when.getTime() > date.getTime())
     {
      document.write("<img src="+image+">")
     }
}



function CurrentDateTime()
// Devolve Data e Hora locais
{
var now=new Date();
var newdate=new Date();
var newtimems=newdate.getTime();
newdate.setTime(newtimems);
return newdate.toLocaleString();
//<script>document.write(CurrentDateTime(this.form))</script>
}


function LastUpdatePage()
// Devolve Data da ultima actualização da página
{
// last Update
var m = document.lastModified;
var p = m.length-8;
return m.substring(3,5)+"/"+m.substring(0,2)+"/"+m.substring(10,6);
//<script> document.write(LastUpdatePage())</script>
}


function popOpen(url,name)
{
  // <a href="javascript:popOpen('html/bibliosoft_site.htm','nome')">Texto</a>
  var windowHandle = '';
  var attributes='toolbar=no,resizable=yes,scrollbars=yes,left=0,top=0,screenX=0,screenY=0,width=800,height=500';
  windowHandle = window.open(url,name,attributes);
}


function openNewWindow(url,name,w,h)
{
  // <a href="javascript:openWindow('html/bibliosoft_site.htm','nome',params)">Texto</a>
  var windowHandle = '';
  var attributes='toolbar=no,resizable=yes,scrollbars=yes,left=0,top=0,screenX=0,screenY=0,width='+w+',height='+h;
  windowHandle = window.open(url,name,'"'+attributes+'"');
}

 function addToFavorites()
 {
 var urlAddress = "http://www.hypergurl.com/lastupdate.html";
 var pageName = "last update to page javascript";

  if (window.external)
  {
   window.external.AddFavorite(urlAddress,pageName)
  }
  else
  { 
   alert("Sorry! Your browser doesn't support this function.");
  }
 }



function showDetails(divID)
{     
   var strShow
       strShow = divID+"Show";
   var strHide
       strHide = divID+"Hide";
   document.all[divID].style.display = "block";
   document.all[strShow].style.display = "none";
   document.all[strHide].style.display = "block";
}

function hideDetails(divID)
{
   var strShow
       strShow = divID+"Show";
   var strHide
       strHide = divID+"Hide";
   document.all[divID].style.display = "none";
   document.all[strShow].style.display = "block";
   document.all[strHide].style.display = "none";
}



// Copy 

var copytoclip=1
function HighlightAll(theField) 
{
  if(!document.code.select.value)
     {
     alert('Não há nada para copiar!');
     document.user.clickTAG.select();
    }else
 {
   var tempval=eval("document."+theField)
   tempval.focus()
   tempval.select()
   if (document.all&&copytoclip==1)
    {
     therange=tempval.createTextRange()
     therange.execCommand("Copy")
     window.status="O texto foi copiado para a zona de transferência do Windows"
     setTimeout("window.status=''",4800);
    }
}
}


// Ver 2

function hidehint(hintId)
{
  var thisHint = document.getElementById(hintId);
  thisHint.style.display = "none";
}


function showhint(hintId)
{
  var thisHint = document.getElementById(hintId);
  if(thisHint.style.display != "block"){thisHint.style.display = "block";}
  else{hidehint(hintId);}
}





// Menu principal
function mainMenu(main,html,images)
{ 

// Caminho da imagem do separador de opções
var sep_menu='<img border="0" align="absbottom" src="'+images+'sep_op.gif" width="4" height="12">';
var sep_op='<img border="0" src="'+images+'sep_op.gif" width="8" height="10">';

document.write('<table width="100%" border="0" cellpadding="0" cellspacing="0">');
document.write('     <tr>');
document.write('  <td width="5" height="32" valign="top"><img src="'+images+'gblnav_left.gif" width="5" height="32"></td>');
document.write('  <td valign="middle" class="menubg">');

// inicio - Opcoes principais do menu 
document.write('<a href="'+main+'default.htm"           class="glink" onmouseover="showSubmenu(&quot;none&quot;);"><img alt="Página principal" align="absbottom" border="0" src="'+images+'home.gif" width="16" height="16"></a>'+sep_menu);
document.write('<a href="'+html+'bibliosoft_missao.htm" class="glink" onmouseover="showSubmenu(&quot;bibliosoft&quot;);">BiblioSoft</a>'+sep_menu);
document.write('<a href="'+html+'produtos.htm"          class="glink" onmouseover="showSubmenu(&quot;produtos&quot;);">Produtos</a>'+sep_menu);
document.write('<a href="'+html+'formacao.htm"          class="glink" onmouseover="showSubmenu(&quot;formacao&quot;);">Formação</a>'+sep_menu);
document.write('<a href="'+html+'suporte.htm"           class="glink" onmouseover="showSubmenu(&quot;apoiotecnico&quot;);">Apoio Técnico</a>'+sep_menu);
document.write('<a href="'+html+'download.htm"          class="glink" onmouseover="showSubmenu(&quot;download&quot;);">Download</a>'+sep_menu);
document.write('<a href="'+html+'utilizadores.htm"      class="glink" onmouseover="showSubmenu(&quot;utilizadores&quot;);">Utilizadores</a>'+sep_menu);
document.write('<a href="'+html+'contactos.htm"         class="glink" onmouseover="showSubmenu(&quot;contactos&quot;);">Cont@ctos</a>');


// Ajuda
document.write('&nbsp;&nbsp;<input type="image" alt="Ajuda" align="absbottom" border="0" src="'+images+'help.gif" width="16" height="16" onclick="popOpen(&quot;'+html+'bibliosoft_ajuda.htm&quot;,&quot;ajuda&quot;);return false">');

// fim - Opcoes principais do menu 
document.write('  <td id="search" align="right" valign="middle" class="menubg">');
document.write('  <form name="searchform" method="get" action="http://www.google.pt/search?num=10&hl=pt-PT&btnG=Pesquisa+Google&as_epq=&as_oq=&as_eq=&lr=&as_ft=i&as_filetype=&as_qdr=all&as_occt=any&as_dt=i&" target=new>');
document.write('  <input name="as_q" type="text" size="17">');
document.write('  <input type="hidden" name="as_sitesearch" value="www.bibliosoft.pt">');
document.write('  <input type="image" alt="Pesquisar no site da Bibliosoft" align="absbottom" border="0" src="'+images+'search.gif" onclick="return true">');
document.write('   </td>');
document.write('   <td width="8" valign="top">');
document.write('     <img src="'+images+'glbnav_right.gif" width="5" height="32">');
document.write('   </td></tr>');
document.write('   </form>');
document.write('   <tr>');
document.write('     <td height="5" colspan="4" valign="top"><div id="bibliosoft" class="submenu">');
document.write('    <table width="100%" border="0" cellpadding="0" cellspacing="0">');
document.write(' <tr>');
document.write('   <td width="768" height="20" valign="middle"><img border="0" src="'+images+'db_arrow_r2_1.gif" alt="Seleccione uma opção" width="20" height="13"><a href="'+html+'bibliosoft_missao.htm">Quem Somos</a>'+sep_op+'<a href="'+html+'bibliosoft_admdocs.htm">Informação Administrativa</a>'+sep_op+'<a href="'+html+'bibliosoft_statis.htm">Dados estatísticos</a></td>');
document.write(' </tr>');
document.write('    </table>');
document.write('  </div>');
document.write('  <div id="produtos" class="submenu">');
document.write('    <table width="100%" border="0" cellpadding="0" cellspacing="0">');
document.write(' <tr>');
document.write('   <td width="768" height="20" valign="middle"><img border="0" src="'+images+'db_arrow_r2_1.gif" width="20" height="13"><a href="'+html+'produtos.htm">Resumo dos produtos</a>'+sep_op+'<a href="'+html+'produtos_intro.htm">BIBLIObase. O que é?</a>'+sep_op+'<a href="'+html+'produtos_precos.htm">Preços</a>'+sep_op+'<a href="'+html+'produtos_aquisicao.htm">Condições de aquisição</a>'+sep_op+'<a href="'+html+'produtos_garantia.htm">Garantia e manutenção</a></td>');
document.write(' </tr>');
document.write('    </table>');
document.write('  </div>');
document.write('  <div id="formacao" class="submenu">');
document.write('    <table width="100%" border="0" cellpadding="0" cellspacing="0">');
document.write(' <tr>');
document.write('   <td width="768" height="20" valign="middle"><img border="0" src="'+images+'db_arrow_r2_1.gif" width="20" height="13"><a href="'+html+'formacao_calendario.htm">Calendário</a>'+sep_op+'<a href="'+html+'formacao_precos.htm">Preços</a>'+sep_op+'<a href="'+html+'formacao_condicoes.htm">Condições de participação</a>'+sep_op+'<a href="'+html+'formacao_plano.htm">Planos de formação</a>'+sep_op+'<a href="'+html+'formacao_localizacao.htm">Localização</a>'+sep_op+'<a href="'+html+'formacao_sala.htm">Sala de Formação</a></td>');
document.write(' </tr>');
document.write('    </table>');
document.write('  </div>');
document.write('  <div id="apoiotecnico" class="submenu">');
document.write('    <table width="100%" border="0" cellpadding="0" cellspacing="0">');
document.write(' <tr>');
document.write('   <td width="768" height="20" valign="middle"><img border="0" src="'+images+'db_arrow_r2_1.gif" width="20" height="13"><a href="'+html+'suporte_dicas.htm">Dicas &amp; Truques</a>'+sep_op+'<a href="'+html+'suporte_faq.htm">Perguntas frequentes</a>'+sep_op+'<a href="'+html+'suporte_docs.htm">Manuais e documentos</a>'+sep_op+'<a href="'+html+'suporte_equipamento.htm">Equipamento</a>'+sep_op+'<a href="'+html+'suporte_tecnologias.htm">Tecnologias</a>'+sep_op+'<a href="'+html+'suporte_links.htm">Links recomendados</a></td>');
document.write(' </tr>');
document.write('    </table>');
document.write('  </div>');
document.write('  <div id="download" class="submenu">');
document.write('    <table width="100%" border="0" cellpadding="0" cellspacing="0">');
document.write(' <tr>');
document.write('   <td width="768" height="20" valign="middle"><img border="0" src="'+images+'db_arrow_r2_1.gif" width="20" height="13"><a href="'+html+'download.htm">Actualizações</a></td>');
document.write(' </tr>');
document.write('    </table>');
document.write('  </div>');
document.write('  <div id="utilizadores" class="submenu">');
document.write('    <table width="100%" border="0" cellpadding="0" cellspacing="0">');
document.write(' <tr>');
document.write('   <td width="768" height="20" valign="middle"><img border="0" src="'+images+'db_arrow_r2_1.gif" width="20" height="13"><a href="'+html+'utilizadores.htm">Os Utilizadores BIBLIObase</a>'+sep_op+'<a href="'+html+'utilizadores_referencia.htm">Destaques...</a>'+sep_op+'<a href="'+html+'utilizadores_portugal.htm">Portugal Continental</a>'+sep_op+'<a href="'+html+'utilizadores_portugal_acores.htm">Ilhas dos Açores</a>'+sep_op+'<a href="'+html+'utilizadores_portugal_madeira.htm">Ilhas da Madeira</a>'+sep_op+'<a href="'+html+'utilizadores_europa.htm">Europa</a>'+sep_op+'<a href="'+html+'utilizadores_america_sul.htm">América do Sul</a>'+sep_op+'<a href="'+html+'utilizadores_africa.htm">África</a>'+sep_op+'<a href="'+html+'utilizadores_asia.htm">Ásia</a></td>');
document.write(' </tr>');
document.write('    </table>');
document.write('  </div>');
document.write('  <div id="contactos" class="submenu">');
document.write('    <table width="100%" border="0" cellpadding="0" cellspacing="0">');
document.write(' <tr>');
document.write('   <td width="768" height="20" valign="middle"><img border="0" src="'+images+'db_arrow_r2_1.gif" width="20" height="13"><a href="'+html+'contactos.htm">Moradas & Telefones</a>'+sep_op+'<a href="'+html+'contactos_mail.htm">Pedido de informação</a></td>');
document.write(' </tr>');
document.write('    </table>');
document.write('  </div></td>');
document.write('   </tr>');
document.write('   <tr>');
document.write('     <td height="5" colspan="4" valign="top">&nbsp;</td>');
document.write('   </tr>');
document.write(' </table>');
} 



// Menu Lateral
function mainLateralMenu(main,html,images)
{ 
// <script language="javascript">mainLateralMenu('../','','../images/');</script>
document.write('<table border="0" width="100%" cellpadding="0">');
document.write(' <tr>');
document.write('   <td>');
document.write(' <p class="texto_op"><b class="texto_op"><img border="0" src="'+images+'box_arrow_g1_4.gif" width="20" height="13"><a href="'+html+'contactos.htm">Contactos</a></b></p>');
document.write('   </td>');
document.write(' </tr>');
document.write(' <tr>');
document.write('   <td>');
document.write(' <p class="texto2_pequeno"><img border="0" src="'+images+'cont_r_small.gif" width="35" height="20" align="left" hspace="2" vspace="2">Telefones, emails e moradas para contacto</td>');
document.write('   </tr>');
document.write('   <tr>');
document.write(' <td><hr></td>');
document.write('   </tr>');
document.write('   <tr>');
document.write(' <td>');
document.write('   <p class="texto_op"><b class="texto_op"><img border="0" src="'+images+'box_arrow_g1_4.gif" width="20" height="13"><a href="'+html+'utilizadores.htm">Utilizadores</a></b></p></td>');
document.write(' </tr>');
document.write(' <tr>');
document.write(' <td>');
document.write('   <p class="texto2_pequeno"><img border="0" src="'+images+'util_r_small.gif" width="35" height="20" align="left" hspace="2" vspace="2">Utilizadores dos produtos BIBLIObase</td>');
document.write(' </tr>');
document.write(' <tr>');
document.write('   <td><hr></td>');
document.write(' </tr>');
document.write(' <tr>');
document.write('   <td>');
document.write('     <p class="texto_op"><b class="texto_op"><img border="0" src="'+images+'box_arrow_g1_4.gif" width="20" height="13"><a href="'+html+'produtos.htm">Lista de Produtos</a></b></p>');
document.write('   </td>');
document.write(' </tr>');
document.write(' <tr>');
document.write('   <td>');
document.write('     <p class="texto2_pequeno"><img border="0" src="'+images+'prod_r_small.gif" width="35" height="20" align="left" hspace="2" vspace="2">Informação acerca dos produtos</td>');
document.write(' </tr>');
document.write(' <tr>');
document.write('    <td><hr></td>');
document.write(' </tr>');
document.write(' <tr>');
document.write('   <td>');
document.write('     <p class="texto_op"><b class="texto_op"><img border="0" src="'+images+'box_arrow_g1_4.gif" width="20" height="13"><a href="'+html+'suporte_dicas.htm">Dicas &amp; Truques</a></b></p>');
document.write('   </td>');
document.write(' </tr>');
document.write(' <tr>');
document.write('   <td>');
document.write('     <p class="texto2_pequeno"><img border="0" src="'+images+'dicas_r_small.gif" width="35" height="20" align="left" hspace="2" vspace="2">Sugestões úteis para explorar o BIBLIObase</td>');
document.write(' </tr>');
document.write(' <tr>');
document.write('   <td><hr></td>');
document.write(' </tr>');
document.write(' <tr>');
document.write('   <td>');
document.write('     <p class="texto_op"><b class="texto_op"><img border="0" src="'+images+'box_arrow_g1_4.gif" width="20" height="13"><a href="'+html+'download.htm">Actualizações</a></b></p></td>');
document.write(' </tr>');
document.write(' <tr>');
document.write('   <td>');
document.write('     <p class="texto2_pequeno"><img border="0" src="'+images+'upd_r_small.gif" width="35" height="20" align="left" hspace="2" vspace="2">Download das últimas actualizações</td>');
document.write(' </tr>');
document.write(' <tr>');
document.write('   <td><hr></td>');
document.write(' </tr>');
document.write(' <tr>');
document.write('   <td>');
document.write('     <p class="texto_op"><b class="texto_op"><img border="0" src="'+images+'box_arrow_g1_4.gif" width="20" height="13"><a href="http://www.salvato.com.br/" target="_balnk">Brasil</a> </b></p>');
document.write('   </td>');
document.write(' </tr>');
document.write(' <tr>');
document.write('   <td>');
document.write('     <p class="texto2_pequeno"><b class="texto_op"><img border="0" src="'+images+'flag_brasil.gif" width="35" height="20" align="left" hspace="2" vspace="2"></b>Distribuidor Oficial BIBLIObase</td>');
document.write(' </tr>');
document.write(' <tr>');
document.write('    <td><hr></td>');
document.write(' </tr>');
document.write(' </table>');
} 




// Menu principal
function bottomMsg(main,html,images)
{ 
document.write('<table width="768" border="0" cellpadding="0" cellspacing="0" align="center" height="1">');
document.write('  <tr>');
document.write('    <td height="1" valign="top">');
document.write('       <img border="0" src="'+images+'bibliosoft2.jpg" width="107" height="20">');
document.write('    </td>');
document.write('  </tr>');
document.write('  <tr>');
document.write('    <td height="1" valign="top">');
document.write('       <hr size="1" color="#C0C0C0">');
document.write('    </td>');
document.write('  </tr>');
document.write('  <tr>');
document.write('    <td valign="top">');
document.write('      <p class="texto2_pequeno"><b>©Copyright BIBLIOsoft, 1993-2008. Todos os direitos reservados.</b><br>');
document.write('      É expressamente proibida a reprodução na totalidade ou em parte, em qualquer tipo de suporte, sem prévia permissão por escrito da BIBLIOsoft, com exclusão da sua utilização para fins didáticos ou com o objectivo de promover e divulgar os bens e serviços da BIBLIOsoft<br>');
document.write('      Para mais informações consulte as <a href=javascript:popOpen("'+main+html+'bibliosoft_site.htm","condicoes")><b>Condições gerais de utilização do site da BIBLIOsoft</b></a><br>');
document.write('      <i>Última actualização desta página: <script>document.write(LastUpdatePage(this.form))</script></i>');
document.write('    </td>');
document.write('  </tr>');
document.write('</table>');
} 



// ------ Cookies ------

function GetCookie (name)
{  
 var arg = name + "=";  
 var alen = arg.length;  
 var clen = document.cookie.length;  
 var i = 0;  
 while (i < clen)
   {    
    var j = i + alen;    
    if (document.cookie.substring(i, j) == arg) return getCookieVal (j);    
    i = document.cookie.indexOf(" ", i) + 1;    
    if (i == 0) break;   
   }  
 return null;
}


function SetCookie(name, value)
{  
  var argv = SetCookie.arguments;  
  var argc = SetCookie.arguments.length;  
  var expires = (argc > 2) ? argv[2] : null;  
  var path = (argc > 3) ? argv[3] : null;  
  var domain = (argc > 4) ? argv[4] : null;  
  var secure = (argc > 5) ? argv[5] : false;  
  document.cookie = name + "=" + escape (value) + 
    ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
    ((path == null) ? "" : ("; path=" + path)) +  
    ((domain == null) ? "" : ("; domain=" + domain)) +    
    ((secure == true) ? "; secure" : "");
}

function DeleteCookie (name)
{  
  var exp = new Date();  
  exp.setTime (exp.getTime() - 1);  
  var cval = GetCookie (name);  
  document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}


function getCookieVal(offset)
{
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
  endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}


// Slide Shwo
/*
Definir na pagina 
NewImg = new Array
(
"../images/mapa02.jpg",
"../images/mapa03.jpg",
"../images/mapa04.jpg"
);
var ImgNum = 0;
var ImgLength = NewImg.length - 1;

//Time delay between Slides in milliseconds
var delay = 3000;
var lock = false;
var run;
*/

function chgImg(direction)
{
  if (document.images)
     {
      ImgNum = ImgNum + direction;
      if (ImgNum > ImgLength)
         {
          ImgNum = 0;
         }
      if (ImgNum < 0)
         {
         ImgNum = ImgLength;
         }
      document.slideshow.src = NewImg[ImgNum];
   }
}

function auto()
{
 if (lock == true)
   {
    lock = false;
    window.clearInterval(run);
   }
 else if (lock == false)
  {
   lock = true;
   run = setInterval("chgImg(1)", delay);
  }
}