// alert("Dia");

function diashowInit(strBilder,strPath,intTimeIE,intTimeOther)
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
{
// alert("initDia");

if(strBilder =="" || strPath   =="") { return false; }

// manuell Settings
initDia_timeIE      = (intTimeIE>0)?intTimeIE:7;
initDia_timeOther   = (intTimeOther>0)?intTimeOther:5;

// initSettings
initDia_browserAll  = document.all?1:0; // MSIE
initDia_ct          = 0; // welches Bild wird angezeigt
initDia_error       = 0;
initDia_pauseMSec   = initDia_browserAll?(initDia_timeIE*1000):(initDia_timeOther*1000); // hier anzahl der sekunden eingeben, die zwischen dem Bilderwechsel liegen ?IE:andere
initDia_nextMSec    = initDia_pauseMSec;
initDia_pathPics    = strPath; 
arrImagesDiashow    = strBilder.split(",") ;
cntImagesDiashow    = arrImagesDiashow.length;

if(cntImagesDiashow > 0)
{
    if(diashowPreLoad(arrImagesDiashow))
    {
    diashowRun();
    } // if
    else
    {
    return false;
    // alert("DIA-Show kann nicht gestartet werden");
    }
} // if

} //fct



function diashowPreLoad(arrImages)
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
{
    // alert("preLoadImagesDiashow");
    arrImagesDiashowObj = new Array();
    cntImagesDiashowObj = arrImages.length;    
    if(cntImagesDiashowObj < 1) return false;
    
    for(var ct=0;ct<cntImagesDiashowObj;ct++)
    {
    arrImagesDiashowObj[ct]      = new Image(); 
    arrImagesDiashowObj[ct].src  = initDia_pathPics + arrImages[ct];
    arrImagesDiashowObj[ct].name = "imageDiashow_" + ct;
    // alert(arrImagesDiashowObj[ct].src +" - "+  arrImagesDiashowObj[ct].width +" - "+ arrImagesDiashowObj[ct].height);
    }
    

    return true;
}




function diashowRun()
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
{
  if (initDia_ct >= cntImagesDiashow) initDia_ct = 0;
  
  if(arrImagesDiashowObj[initDia_ct].complete==true 
  && arrImagesDiashowObj[initDia_ct].height > 0)
  {
      // alert(arrImagesDiashow[zeigebild].src + " OK");  
      
      if(initDia_browserAll)
      {
        document.getElementById("imageDia").filters.blendTrans.Apply();
        document.getElementById("imageDia").src = arrImagesDiashowObj[initDia_ct].src;
        document.getElementById("imageDia").filters.blendTrans.Play();
      }
      else
      {
        document.getElementById("imageDia").src = arrImagesDiashowObj[initDia_ct].src;
      }
      
      initDia_ct++;
      initDia_nextMSec = initDia_pauseMSec;
  }
  else
  {
      // alert(arrImagesDiashow[zeigebild].src + " noch nicht geladen");
      initDia_ct++;
      initDia_nextMSec = 0;  
      initDia_error++;
  }
  
  
  
  if(initDia_error < 100)
  {
     window.setTimeout("diashowRun()",initDia_nextMSec);
  }
  else
  {
     return false;
  }

}