document.write('<style>')
document.write('<!--')
document.write('#ssm2 A {color:black; text-decoration:none; font-size:12; font-family:arial unicode MS;}')
document.write('#ssm2 A:hover {	color:red; }')
document.write('-->')
document.write('</style>')

var NS
IE=document.all;
NS=document.layers;

hdrFontFamily="arial unicode MS";
hdrFontSize="2";
hdrFontColor="white";
hdrBGColor="#666666";
hdrFontColor="black";
hdrBGColor="white";
hdrRowHeight="25";

linkFontFamily="arial unicode MS";
linkFontSize="2";
linkBGColor="white";
linkOverBGColor="#CCCCCC";
linkTarget="_top";
linkRowHeight="20";
linkSubLeft="30";
linkSubRowHeight="15";

YOffset=160;
tmpsrcindex=0;
tmplastrowindex=0;
tmpSmZoom=0.1;
staticYOffset=5;
menuBGColor="red";
menuCellSpacing="0";
menuIsStatic="yes";
menuHeader="TALA Research group"
menuWidth=250; // Must be a multiple of 10!
staticMode="advanced"

barBGColor="#000080";
barTitleWidth=10
barFontFamily="arial unicode MS";
barFontSize="2";
barFontColor="white";
barText="TALA menu";

function moveOut() {
  if (window.cancel) {cancel="";}
  if (window.moving2) {
    clearTimeout(moving2);
    moving2="";
  }
  if ((IE && ssm2.style.pixelLeft<0)||(NS && document.ssm2.left<0)) {
    if (IE) {ssm2.style.pixelLeft += (10%menuWidth);}
    if (NS) {document.ssm2.left += (10%menuWidth);}
    moving1 = setTimeout('moveOut()', 5)}
  else {clearTimeout(moving1)}
};

function moveBack() {
  cancel = moveBack2()
}
function moveBack2() {
    moving2 = setTimeout('moveBack1()', 800)
}
function moveBack1() {
  if (window.moving1) {clearTimeout(moving1)}
  if ((IE && ssm2.style.pixelLeft>(-menuWidth))||(NS && document.ssm2.left>(-150))) {
    if (IE) {ssm2.style.pixelLeft -= (10%menuWidth);}
    if (NS) {document.ssm2.left -= (10%menuWidth);}
    moving2 = setTimeout('moveBack1()', 5)}
  else {
    clearTimeout(moving2)
    if (tmpsrcindex > 0) {document.all(tmpsrcindex).style.display="none"}}
};

lastY = 0;
function makeStatic(mode) {
  if (IE) {winY = document.body.scrollTop;var NM=ssm2.style}
  if (NS) {winY = window.pageYOffset;var NM=document.ssm2}
  if (mode=="smooth") {
    if ((IE||NS) && winY!=lastY) {
      smooth = .2 * (winY - lastY);
      if(smooth > 0) smooth = Math.ceil(smooth);
      else smooth = Math.floor(smooth);
      if (IE) NM.pixelTop+=smooth;
      if (NS) NM.top+=smooth;
      lastY = lastY+smooth;
    }
    setTimeout('makeStatic("smooth")', 1)
  }
  else if (mode=="advanced") {
    if ((IE||NS) && winY>YOffset-staticYOffset) {
      if (IE) {NM.pixelTop=winY+staticYOffset}
      if (NS) {NM.top=winY+staticYOffset}
    }
    else {
     if (IE) {NM.pixelTop=YOffset}
     if (NS) {NM.top=YOffset-7}
    }
    setTimeout('makeStatic("advanced")', 1)
  }
}

function init() {
  if (IE) {
    ssm2.style.pixelLeft = -menuWidth;
    ssm2.style.visibility = "visible"
  }
  else if (NS) {
    document.ssm2.left = -menuWidth;
    document.ssm2.visibility = "show"
  }
  else {
    alert('Choose either the "smooth" or "advanced" static modes!')
  }
}

function showsubmenu() {

  tdsrc=event.srcElement
  if (event.srcElement.tagName=="A") {tdsrc=event.srcElement.parentElement.parentElement}
  if (event.srcElement.tagName=="IMG") {tdsrc=event.srcElement.parentElement}

  if (tmplastrowindex > 0) {document.all(tmplastrowindex).bgColor=linkBGColor}
  if (tmpsrcindex > 0) {document.all(tmpsrcindex).style.display="none"}

  if (tdsrc.id.substring(0,1) == "m") {tdsrc.bgColor=linkOverBGColor}
  tmpsrc=document.all('s'+tdsrc.id)
  if (tmpsrc != null) {
      tmpsrc.style.display = ""
      tmpsrc.style.pixelTop = tdsrc.offsetTop 
      tmpsrc.style.pixelLeft = (tdsrc.offsetLeft + menuWidth)- 4
      tmpsrcindex=tmpsrc.sourceIndex
      if (tmplastrowindex != tdsrc.sourceIndex) {
        tmpSmZoom = 0.1
        zoomsubmenu()
      }
  }
  if (tdsrc.id.substring(0,1) == "m") {tmplastrowindex=tdsrc.sourceIndex}
}

function zoomsubmenu() {
  zoomsrc=document.all(tmpsrcindex)
  if (tmpSmZoom <= 0.9) {
    zoomsrc.children(0).style.display='none'
    zoomsrc.style.width = zoomsrc.children(0).clientWidth * tmpSmZoom
    zoomsrc.style.height = zoomsrc.children(0).clientHeight * tmpSmZoom
    tmpSmZoom += 0.1
    setTimeout("zoomsubmenu()",15)}
  else {
    zoomsrc.children(0).style.display=''
    zoomsrc.style.width = zoomsrc.children(0).clientWidth + 2
    zoomsrc.style.height = zoomsrc.children(0).clientHeight+ 2
  }
}

function nolink() { 
}
