function FadeIn(img_id, sec) {
  var o = this;
  var el = document.getElementById(img_id);
  this.s = el.style;
  this.sname =
  'undefined' != typeof this.s['filter'] ?
  'filter' :
  'undefined' != typeof this.s['opacity'] ?
  'opacity' :
  'undefined' != typeof this.s['MozOpacity'] ?
  'MozOpacity' :
  'undefined' != typeof this.s['KhtmlOpacity'] ?
  'KhtmlOpacity' : '';
  this.is = 0;
  this.chk = (/filter/.test(this.sname));
  this.end = this.chk ? 100 : .99;
  this.inc = this.chk ? 1 : .01;
  this.intv = Math.round((sec * 1000) / 100);
  this.timer = null;
  this.set_opac = function(v) {
    if (this.sname) {
      this.s[this.sname] = (this.chk) 
			? 'alpha(opacity=' + v + ')' 
			: '' + v;
    }
  }
  this.fade_in = function() {
    this.timer = window.setInterval(
      function() {
        o.set_opac(o.is += o.inc);
        if (o.is >= o.end)
          window.clearInterval(o.timer);
      }, 
			this.intv);
  }
}

window.onunload = function() {
  window.clearInterval(x.timer);
  window.onload = null;
}

window.onload = function() {
  x = new FadeIn('vis', 1.5);
  x.fade_in();
}
