/**************************************************************************
OPACITY SCRIPT V-2.0

NOTES: MAKE SURE THE SCRIPT SECTION TO CREATE addFadeObject(s) APPEAR IN THE
       HTML PAGE *AFTER* THE ELEMENTS ARE DEFINED OR ERRORS WILL RESULT. IT WORKS
       BEST IF YOU DEFINE ALL YOUR ELEMENTS AND THEN ADD ALL YOUR addFadeObject(s)
       IN ONE SET OF JAVASCRIPT TAGS.
****************************************************************************/

var w3c=(document.getElementById)?true:false;
var ns4=(document.layers)?true:false;
var ie4=(document.all && !w3c)?true:false;
var ie5=(document.all && w3c)?true:false;
var ns6=(w3c && navigator.appName.indexOf("Netscape")>=0)?true:false;
var idlist=new Array();

function addFadeObject(el,starto,endo,step,timePerStep){
if(!ns4){
var idx=idlist.length;
idlist[idx]=(ie4)? document.all[el]:document.getElementById(el);
idlist[idx].idx=idx;
idlist[idx].starto=starto;
idlist[idx].endo=endo;
idlist[idx].step=step;
idlist[idx].timePerStep=timePerStep;
idlist[idx].T=0;
idlist[idx].Ostep=0;
idlist[idx].Ocount=0;
if(ie4||ie5)idlist[idx].style.filter="alpha(opacity="+starto+")";
if(ns6)idlist[idx].style.MozOpacity=starto/100;
idlist[idx].onmouseover=function(){
  clearInterval(this.T);
  this.Ocount=this.starto;
  this.Ostep=(this.starto<this.endo)?this.step:-this.step;
  this.T=setInterval('adjop('+idx+')', this.timePerStep);
  }
idlist[idx].onmouseout=function(){
  clearInterval(this.T);
  this.Ocount=this.endo;
  this.Ostep=(this.starto<this.endo)?-this.step:this.step;
  this.T=setInterval('adjop('+idx+')', this.timePerStep);
  }
}}

function adjop(n){
var el=idlist[n];
if(ie4||ie5)el.style.filter="alpha(opacity="+el.Ocount+")";
if(ns6)el.style.MozOpacity=el.Ocount/100;
el.Ocount+=el.Ostep;
if( ((el.starto<el.endo)&&((el.Ocount<el.starto)||(el.Ocount>el.endo))) || ((el.starto>el.endo)&&((el.Ocount>el.starto)||(el.Ocount<el.endo)))  )clearInterval(el.T);
}
