function imagelink_mouseover(img)
{
	img.style.border = '20px solid #666666';
	img.style.zIndex = 99;
}
function imagelink_mouseout(img)
{
	img.style.border = '10px solid #666666';
	img.style.zIndex = 10;
}

function floatinglinktext2(xpos, ypos, href, text1, text2)
{
  return floatinglinktext(xpos+1, ypos+1, href, text1, text2, '#000000') + floatinglinktext(xpos, ypos, href, text1, text2, '#FFFFFF'); 
}

function floatinglinktext(xpos, ypos, href, text1, text2, color)
{
  return '<span style="position: absolute; left:' + xpos + ';top:' + ypos + ';z-index: 12"><a style="font-family: Arial; font-size: 14pt; text-decoration: none; color:'+ color +';" href="' + href + '""><b>' + text1 + '</b>' + text2 + '</a></span>';
}

function image_and_link_text (txpos, typos, href, text1, text2, xpos, ypos, imageurl, imageheight)
{

  return '<a href="' + href + '">' + '<img src="' + imageurl + '" height="' + imageheight + '" class="imagelink" style="left: ' + xpos + '; top: ' + ypos + '; z-index: 10" onmouseover="imagelink_mouseover(this)" onmouseout="imagelink_mouseout(this)"></a>' +
     floatinglinktext2 (txpos, typos, href, text1, text2);
}

function just_image (xpos, ypos, imageurl, imageheight)
{
  return '<img src="' + imageurl + '" height="' + imageheight + '" class="imagenolink" style="left: ' + xpos + '; top: ' + ypos + '; z-index: 10" >';
}

function load_image_links(table)
{

	var result = "";
	for (i = 0; i < table.length; i += 9)
	{
	   if (table[i+2] == "")
	    result += just_image (table [i], table [i+1], table [i+7], table [i+8]);
	   else
 	    result += image_and_link_text(table [i], table [i+1], table [i+2], table [i+3], table [i+4], table [i+5], table [i+6], table [i+7], table [i+8]);
	}
	return result;

}

function apply_table_styles(from)
{
  var images = document.all.tags("IMG");
  var newhtml = "";
  var maxh = new Number(0);
  var theid = from.id;
  for (i = 0; i < images.length; i++)
  {
	 var node = images[i];
     var oparent = node.parentNode;
     var ograndparent = oparent.parentNode;
	 if (ograndparent.id == theid)
	 {
	    var x = node.style.left;
	    var y = node.style.top;
	    var h = node.style.height;
	    var h1 = new Number(h.substring(0, h.length-2));
	    var text = node.alt;
	    var src = node.src;
	    var href = oparent.href;
	    var tl = text.length;
        var text1 = text.substring(0, 2);
        var text2 = text.substring(2, tl);
        var tx = new Number(x.substring(0, x.length-2)); 
        var ty = new Number(y.substring(0, y.length-2));
        var tx1 = tx + 10;
        var ty1 = ty - 1;
        if (tl > 3 && text.charAt(tl-3) == '&')
        {
          text2 = text2.substring(0, text2.length - 3);
          var posy = text.charAt(tl-2);
          var posx = text.charAt(tl-1);
          if (posy == 'b')
          {
            if (text2.indexOf("<br") == -1)
              ty1 = ty + h1 - 2;
            else
              ty1 = ty + h1 - 25;
          }
          if (posx == 'r')
            tx1 = tx + h1/2;
        }
        
	    if (h1 + ty > maxh)
	       maxh = h1 + ty;
         
        newhtml  += image_and_link_text (tx1, ty1, href, text1, text2, tx, ty, src, h);
	 }
  }
  from.innerHTML=newhtml;
  var origh = new Number(from.style.height.substring(0, from.style.height.length-2)); 
  if (maxh + 40 > origh)
     from.style.height = maxh + 40;
}
