//----------------------------------------------------------
// Copyright - Gallaware, Inc. 2000
// All rights reserved
// These JavaScript functions are copyrighted by Gallaware, Inc.
// They can not be used, copied, altered, edited, or included 
// with or within any software, or published or distributed without
// the expressed written consent of Gallaware, Inc.
//----------------------------------------------------------

// requires - imageutils.js

function textLinkEx(name, link, img1, img2, text, target, x_over, x_out) {
  var over_text = "";
  var out_text = "";

  switch (arguments.length)  {
    case 5:
      target = "";
    case 6:
      x_over = "";
    case 7:
      x_out = "";
  }
  
  document.write("<a href=\"", link, "\"");
  if (img1 != null && img1.length > 1 && img2 != null && img2.length > 1)  {
    over_text = "changeImage(" + name + ",\"" + img2 + "\")";
    out_text = "changeImage(" + name + ",\"" + img1 + "\")";

    preloadImage(img2);
  }

  if (x_over.length > 0)
    over_text += (";" + x_over);

  if (x_out.length > 0)
    out_text += (";" + x_out);

  if (over_text.length > 0)
    document.write(" onMouseover='" + over_text + "'");

  if (out_text.length > 0)
    document.write(" onMouseout='" + out_text + "'");
  
  if (target.length > 0)
    document.write(" target=\"", target, "\"");

  document.write(">", text, "</a>");
}

