// The actImage function (object) switches two certain images when a
// MouseOver event occurs. The pressing calls the certain link or action.
// Supported by all browsers. Really switches images only for browsers with
// support of images objects.

function _over() {eval(this.overS);}
function _out() {eval(this.outS);}

function actImage(name, baseSRC, overSRC, width, height, border, link, target, alt, status, onClick, onOver, onOut)
{
  var targetS = (target=="")?(""):(" target='"+target+"'");
  var linkS = (link=="")?("'javascript:;'"):("'"+link+"'"+targetS);
  var clickS = (onClick=="" || onClick==null)?(""):(" onClick='"+onClick+";return false;'");
  this.overS = (onOver=="" || onOver==null)?(""):(onOver+";");
  this.outS = (onOut=="" || onOut==null)?(""):(onOut+";");
  if (document.images && overSRC != "") {
    document[name+"_base"] = new Image(); document[name+"_base"].src = baseSRC;
    document[name+"_over"] = new Image(); document[name+"_over"].src = overSRC;
    this.overS += "document."+name+".src=document."+name+"_over.src;";
    this.outS += "document."+name+".src=document."+name+"_base.src;";
  }
  this.overS += (status=="")?(""):("self.status=\""+status+"\";");
  this.outS += (status=="")?(""):("self.status=\"\";");
  var mouseS = (this.overS=="")?(""):(" onmouseover='"+this.overS+"return true;'");
  mouseS += (this.outS=="")?(""):(" onmouseout='"+this.outS+"return true;'");
  var sizeS = (width=="" || height=="")?(""):(" width="+width+" height="+height);
  var borderS = (border=="")?(""):(" border="+border);
  var altS = (alt=="")?(""):(" alt=\""+alt+"\"");
  this.src = "<A name='h"+name+"' href="+linkS+clickS+mouseS+"><IMG name='"+name+"' src='"+baseSRC+"' "+sizeS+borderS+altS+"></A>";
  this.over = _over; 
  this.out = _out; 
  return this.src;
}

