/* ERROR ALPHA SHOW INFO v1.0

  Copyright by
    Micha³ 'REGi' Rygielski 24.11.2007
    email: mrygielski@o2.pl
    gadu-gadu: 3072152

  Wykorzystywanie bez zgody autora zabronione!

*/

if (typeof ShowError == "undefined") var ShowErrorObject = new Object();

ShowErrorObject = function(DivName) {

	if (!document.getElementById) { return; }

	this.timer = new Timer(this);

        this.i=255;
        this.a_=1;
        this.b_=1;
        this.logic=1;

        this.id= DivName;

}

ShowErrorObject.prototype = {

  _opacity: function() {
     o=this.i;
     var obj = document.getElementById(this.id).style;
     obj.MozOpacity = (o / 100); // Mozilla i FireFox
     obj.KhtmlOpacity = (o / 100); // Safari < 1.2
     obj.opacity = (o / 100); // Safari 1.2, nowszy FireFox i Mozilla
     obj.filter = "alpha(opacity=" + o + ")"; // Internet Explorer
  },
  fadedown: function() {
    this.i-=2;
    this.timer.setTimeout("_opacity",3);
    if (this.i<0) {
      this.logic=1;
      this.i=0;
      this.timer.clearInterval(this.a_);
    }
  },
  FadeDown: function() {
    this.i=255;
    this.a_=this.timer.setInterval("fadedown",1);
//    this.timer.clearInterval(this.b_);
    return true;
  },
  hide_info: function() {
    this.FadeDown();
  },
  show_info: function(source) {
    if (this.logic) {
      this.logic=0;
      document.getElementById(this.id).innerHTML=source;
      document.getElementById(this.id).style.display='block';
      this._opacity(this.id, 255);
      this.i=255;

      this.timer.setTimeout("hide_info",500);
    }
  }

}

showerror1=new ShowErrorObject('IDinfo1');
showerror2=new ShowErrorObject('IDinfo2');
showerror3=new ShowErrorObject('IDinfo3');
showerror4=new ShowErrorObject('IDinfo4');
showerror5=new ShowErrorObject('IDinfo5');
