function write_taxonomy_styles(itemcount,basex,basey,itemheight) {
 document.write('<style>');
 document.write('#taxonomyBase {');
 document.write('position : absolute;');
 document.write('left : ' + basex + ';');
 document.write('top : ' + basey + ';');
 document.write('}');
 for (var i=1;i<=itemcount;i++){
  ypos=basey+((i-1)*itemheight)+16;
  document.write('#term' + i + ' {');
  document.write('position : absolute;');
  document.write('left : ' + (basex+10) + ';');
  document.write('top : ' + ypos + ';');
  //document.write('height : ' + itemheight + ';');
  document.write('overflow : hidden;');
  document.write('visibility : hidden;');
  //document.write('filter : alpha(opacity=90);');
  document.write('}');
 }
 document.write('</style>');
}

function write_taxonomy_span(itemnum,imgPath) {
 document.write('<span id="term' + itemnum + '">');
 document.write('<table cellspacing=0 cellpadding=0 border=0>');
 document.write('<tr>');
 document.write('<td bgcolor="#2C4F2C"><img src="'+ imgPath +'images/spacer.gif" width=1 height=1></td>');
 document.write('<td bgcolor="#2C4F2C"><img src="'+ imgPath +'images/spacer.gif" width=187 height=1></td>');
 document.write('<td bgcolor="#2C4F2C"><img src="'+ imgPath +'images/spacer.gif" width=12 height=1></td>');
 document.write('<td bgcolor="#2C4F2C"><img src="'+ imgPath +'images/spacer.gif" width=1 height=1></td>');
 document.write('</tr>');
 var a=write_taxonomy_span.arguments;
 for(i=2; i<a.length; i=i+2) {
  document.write('<tr>');
  document.write('<td bgcolor="#2C4F2C"><img src="'+ imgPath +'images/spacer.gif" width=1 height=18></td>');
  document.write('<td class="taxonomyPopup">&nbsp;&nbsp;<a href="' + a[i+1] + '" class="taxonomyPopup">' + a[i] + '</a></td>');
  document.write('<td class="taxonomyPopup"><a href="' + a[i+1] + '" class="taxonomyPopup"><img src="'+ imgPath +'images/nav_button.gif" border=0></a></td>');
  document.write('<td bgcolor="#2C4F2C"><img src="'+ imgPath +'images/spacer.gif" width=1 height=1></td>');
  document.write('</tr>');
 }
 document.write('<tr><td bgcolor="#2C4F2C" colspan=4><img src="'+ imgPath +'images/spacer.gif" width=1 height=1></td></tr>');
 document.write('</table>');
 document.write('</span>'); 
}

function write_taxonomy_button(itemnum,name,URL,itemcount,imgPath) {
 document.write('<table cellspacing=0 cellpadding=0 border=0>');
 document.write('<tr><td bgcolor="#CAD7CA"><img src="'+ imgPath +'images/spacer.gif" width=1 height=1></td><td bgcolor="#CCCCCC"><img src="'+ imgPath +'images/spacer.gif" width=187 height=1></td><td bgcolor="#CCCCCC"><img src="'+ imgPath +'images/spacer.gif" width=12 height=1></td><td bgcolor="#003300"><img src="'+ imgPath +'images/spacer.gif" width=1 height=1></td></tr>');
 document.write('<tr><td bgcolor="#999999"><img src="'+ imgPath +'images/spacer.gif" width=1 height=18></td><td class="taxonomy">&nbsp;&nbsp;<a href="' + URL + '" onmouseout="popup_taxonomy(0);" onmouseover="popup_taxonomy(' + itemnum + ',' + itemcount + ');">' + name + '</a></td><td class="taxonomy"><a href="' + URL + '" onmouseout="popup_taxonomy(0);" onmouseover="popup_taxonomy(' + itemnum + ',' + itemcount + ');"><img src="'+ imgPath +'images/nav_button.gif" border=0></a></td><td bgcolor="#003300"><img src="'+ imgPath +'images/spacer.gif" width=1 height=1></td></tr>');
 document.write('<tr><td bgcolor="#003300" colspan=4><img src="'+ imgPath +'images/spacer.gif" width=1 height=1></td></tr>');
 document.write('<tr><td colspan=4><img src="'+ imgPath +'images/spacer.gif" width=1 height=3></td></tr>'); 
 document.write('</table>'); 
}

function popup_taxonomy(itemnum,itemcount) {
 for (var i=1;i<=itemcount;i++) {
  var test_layer=getLayer('term' + i);
  if (test_layer!=null) {
   setVis('term' + i, 'hidden');
  }
 }
 if (itemnum!=0) {
  var test_layer=getLayer('term' + itemnum);
  if (test_layer!=null) {
   setVis('term' + itemnum, 'visible');
  } 
 }
}
