/***********************************************
 Gradual Highlight image script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
 This notice MUST stay intact for legal use
 Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code

 Angepasst und erweitert Dez.2007 Oliver Dammer webatolidade:
   objekt       welches Objekt
   ops          Start-Opacity
   ope          End-Opacity
   dur          Dauer der Blende in msec
   n            Anzahl Änderungen während 'dur'
***********************************************/

var i1=0
var i2=0

function slowhigh(objekt1, ops1, ope1, dur1, n1, objekt2, ops2, ope2, dur2, n2) {
   if (objekt1 != null) {
      obj1=objekt1
      obj2=objekt2
      oe1=ope1
      oe2=ope2
      os1=ops1
      os2=ops2
      nmax1=n1
      nmax2=n2
      msec1=dur1/nmax1
      msec2=dur2/nmax2
      step1=(ope1 - ops1)/nmax1
      step2=(ope2 - ops2)/nmax2
      art=objekt1.filters? "fil" : typeof objekt1.style.MozOpacity=="string"? "moz" : typeof objekt1.style.opacity=="string"? "opa" : ""
      fixwert(obj1, os1)
      fixwert(obj2, os2)
      if (os1 != oe1) highlighting1=setInterval("blende1(obj1,step1,oe1)",msec1)
      if (os2 != oe2) highlighting2=setInterval("blende2(obj2,step2,oe2)",msec2)
   }
}

function fixwert(obj, wert) {
   switch (art) {
     case "fil":
       obj.filters.alpha.opacity=wert;
       break;
     case "moz":
       obj.style.MozOpacity=wert/100;
       break;
     case "opa":
       obj.style.opacity=wert/100;
       break;
  }
}

function blende1(cur1,s1,e1) {
   i1++;
   if (i1<=nmax1) {
      switch (art) {
        case "fil":
          cur1.filters.alpha.opacity+=s1;
          break;
        case "moz":
          cur1.style.MozOpacity=Math.min(parseFloat(cur1.style.MozOpacity)+s1/100, 1);
          break;
        case "opa":
          cur1.style.opacity=Math.min(parseFloat(cur1.style.opacity)+s1/100, 1);
          break;
        default:
          i1=nmax1;
          fixwert(cur1, e1);
          break;
      }
   }
   else {
      fixwert(cur1, e1);
      clearInterval(highlighting1);
   }
}

function blende2(cur2,s2,e2) {
   i2++;
   if (i2<=nmax2) {
      switch (art) {
        case "fil":
          cur2.filters.alpha.opacity+=s2;
          break;
        case "moz":
          cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+s2/100, 1);
          break;
        case "opa":
          cur2.style.opacity=Math.min(parseFloat(cur2.style.opacity)+s2/100, 1);
          break;
        default:
          i2=nmax2;
          fixwert(cur2, e2);
          break;
      }
   }
   else {
      fixwert(cur2, e2);
      clearInterval(highlighting2);
   }
}
