function setMenu(id)
{ document.getElementById(id).style.color = '#666666';
  document.getElementById('a'+id).style.color = '#FF6600';
  fixType();
}

function fixType()
{ x = findPos(document.getElementById('superContainer'));
  y = document.getElementById('typeContainer');
  y.style.left = (Number(x[0])-103)+'px';
  y.style.top = '30px';
  y.style.visibility = 'visible';
}

function setLang(lan)
{ document.cookie = 'sicol_site_lang='+lan+'; path=/; '+
                    'expires=Wed, 31-Dec-2020 23:12:40 GMT; '+
                    'domain=fiocruz.br';

  if (lan == 'pt') { lan = '2' } else { lan = '1' }
  document.cookie = 'sicol_catalog_lang='+lan+'; path=/; '+
                    'expires=Wed, 31-Dec-2020 23:12:40 GMT; '+
                    'domain=fiocruz.br';

  top.window.location.reload();

}

function SendMail(u,d)
{ e = 'mailto:' + u + '@' + d;
  document.location = e;
}

function MailTo(u,d,t,c)
{ if (t == '') { t = u + '@' + d }
  if (c != '') { c = 'class="' + c + '" ' }
  document.write('<a ' + c + 'href="javascript:SendMail(' + "'" +
  u + "','" + d + "')" + '">' + t + '</a>');
}

function staffStart()
{ document.write('<blockquote><table>') }

function staff(code,name,func,espec,photo)
{ espec = espec.replace(/\|/g,'&#149;');
  func  = func .replace(/\|/g,'&#149;');
  document.write('<tr valign="top"><td>');
  if (code != '')
  { document.write('<a href="http://lattes.cnpq.br/'+code+'" target="lattes"><img src="imgs/lattes.gif"></a>') }
  document.write('</td><td><strong>'+name+'</strong>');
  if (func != '') { document.write(', '+func) }
  document.write('<br/>');
  if (espec != '') { document.write(espec+'<br/>') }
  document.write('<br/></td>');
  if (photo && photo != '') { document.write('<td><img src="imgs/'+photo+'" width="60px" height="80px"/></td>') } else { document.write('<td></td>') }
  document.write('</tr>');
}

function staffTitle(title)
{ document.write('<tr valign="top"><td></td><td><b>'+title+'</b><br/><br/></td></tr>') }

function staffStop()
{ document.write('</table></blockquote>') }

function findPos(obj)
{ var curleft = curtop = 0;
  if (obj.offsetParent)
  { do { curleft += obj.offsetLeft;
         curtop += obj.offsetTop;
       } while (obj = obj.offsetParent);
  }
  return [curleft,curtop];
}

onresize=fixType;

