// ToolTip Fade zxcPart2 (28-11-2005)
// by Vic Phillips http://www.vicsjavascripts.org.uk


// Functional Code - NO NEED to Change

var zxcCnt=0;
var zxcMO,zxcMess,zxcTO,zxcLast;
var zxcCursor='pointer';
if (document.all){ zxcCursor='hand'; }
if (zxcDelay<5){ zxcDelay=5; }

function zxcToolTipFade(zxcmo,zxcmess,zxcx,zxcy,zxcd,zxcurl){
 clearTimeout(zxcTO);
 zxcmo=document.getElementById(zxcmo);
 if (zxcLast&&zxcLast!=zxcmo){ zxcFadeDo(zxcLast); }
 if (!zxcmo.mess){
  if (!zxcmess){ return }
  zxcmo.mess=document.getElementById(zxcmess).cloneNode(true);
  document.getElementsByTagName('BODY')[0].appendChild(zxcmo.mess);
  zxcmo.messS=zxcmo.mess.style;
  zxcmo.delay=zxcDelay;
  if (zxcd){ zxcmo.delay=zxcd; }
  if (zxcurl){ zxcmo.messS.cursor=zxcCursor; }
  zxcmo.mess.onmouseover=function(){ clearTimeout(zxcTO); }
  zxcmo.mess.onmouseout=function(){ zxcFadeDo(this.master); }
  zxcmo.mess.onclick=function(){ zxcToolTipLink(this.url); }
  zxcmo.mess.master=zxcmo;
  zxcmo.mess.url=zxcurl;
  zxcmo.messS.zIndex=zxcZIndex;
  zxcmo.mess.id='zxcTT'+zxcCnt;
  zxcOpacity(zxcmo.mess,50)
  zxcmo.obj=new zxcAddFade(zxcmo.mess);
  zxcmo.x=zxcx;
  zxcmo.y=zxcy;
 }
 zxcLast=zxcmo;
 zxcMO=zxcmo; zxcMess=zxcmess;
 clearTimeout(zxcmo.obj.to);
 if (zxcmess){
  zxcFadeDo(zxcMO,zxcMess);
  return;
 }
 zxcTO=setTimeout('zxcFadeDo(zxcMO)',zxcMO.delay);
}

function zxcFadeDo(zxcmo,zxcmess){
 if (zxcmess){
  zxcmo.messS.left=(zxcPos(zxcmo)[0]+zxcmo.x)+'px';
  zxcmo.messS.top=(zxcPos(zxcmo)[1]+zxcmo.y)+'px';
  zxcmo.obj.updown=false;
  zxcmo.obj.up();
  return;
 }
 zxcmo.obj.updown=true;
 zxcmo.obj.down();
}

function zxcAddFade(zxc){
 this.mobj=zxc;
 this.ref='updown'+zxcCnt;
 window[this.ref]=this;
 this.to=null;
 this.updown=false;
 this.cnt=0;
 this.delay=zxcFadeDelay;
 this.inc=zxcFadeInc;
 this.min=0;
 this.max=100;
 this.setTimeOut=function(zxcf,zxcd){
  this.to=setTimeout("window."+this.ref+"."+zxcf,zxcd);
 }
 this.up=function(){
  if(!this.updown){
   this.cnt+=this.inc;
   if(this.cnt<=this.max){
    this.mobj.style.visibility='visible';
    zxcOpacity(this.mobj,this.cnt)
    this.setTimeOut("up();",this.delay);
   }
   else {
    zxcOpacity(this.mobj,this.max)
     this.updown=true;
    }
   }
  }
 this.down=function(){
  if(this.updown){
   this.cnt-=this.inc;
   if(this.cnt>=this.min){
    zxcOpacity(this.mobj,this.cnt)
    this.setTimeOut("down();",this.delay);
   }
   else {
    zxcOpacity(this.mobj,this.min)
    this.mobj.style.visibility='hidden';
    this.updown=false;
   }
  }
 }
 zxcCnt++;
}

function zxcOpacity(obj,op) {
 if (obj.style.MozOpacity!=null){ obj.style.MozOpacity=(op/100)-.001; }
 else if (obj.style.opacity!=null){ obj.style.opacity=(op/100)-.001; }
 else if (obj.style.filter!=null){ obj.style.filter = 'alpha(opacity='+op+')';	}
 else if (obj.style.KHTMLOpacity!=null){ obj.style.KHTMLOpacity=(op/100)-.001; }
}

function zxcToolTipLink(zxcurl){
 if (zxcurl){
  window.top.location=zxcurl;
 }
}

function zxcPos(zxc){
 zxcx=zxc.offsetLeft;
 zxcy=zxc.offsetTop;
 while(zxc.offsetParent!=null){
  zxcp=zxc.offsetParent;
  zxcx+=zxcp.offsetLeft;
  zxcy+=zxcp.offsetTop;
  zxc=zxcp;
 }
 return [zxcx,zxcy];
}



