/*
 <!-- C. Berger							  		  --> 
<!-- www.berger-beratung.de	  		  			  -->
<!-- 											  -->
<!-- Projekt : Salia A. Berger, Münster			  -->
<!-- 		   		  		 					  -->
<!-- 10.08.2004			  						  -->
<!-- HTML-Dok Allgemeine Funktionen JavaScript	  -->
 */
 
var RotateIdx = false ;
var SourceImgDir = "../../images" ;
var GlobalImg1 = "" ;
var GlobalImg2 = "" ;
var FadeBilderIn = true;
var FadeSize = 0;
var FadeGrow = 1;
var FadeInBit = true;
var FadeOutBit = false;
var FadeInOut = true;
var FadeInOutWait = 1500 ;
var ForwardPage = "" ;
var IntervalID = 0;
var GlobalI = 0;
var GlobalIdx = 0 ;
var GobalImgIdx=0;
var GlobalBlinkID = 0;  
var GlobalTmpVar1 = "";
var GlobalTmpVar2 = "";
  
 

   function LadeSeite(HTMLSeite,SeitenName)
     {
     Atr="dependent=yes,location=no,outerWidth=258,width=258,left=0,resizable=yes"
     win = window.open(HTMLSeite,SeitenName,Atr);
     }

  
 
  function Blinken()
   {
   
   if ( GlobalIdx == 0 )
     { 
	 self.document.fgColor = GlobalTmpVar1; 
	 GlobalIdx = 1;

	 }
   else
     { 
	 self.document.fgColor = GlobalTmpVar2 ; 
	 GlobalIdx = 0;	 
	 }

   }
 


function MyBlink(Farbe,Geschwind)
 {
 GlobalIdx=1;
 neuFC = "#cc3399";
 Zeit = 250;
 
 if (( Farbe != "" ) && ( Farbe != null))
    neuFC = Farbe;
  
if ((  Geschwind  != "" ) && ( Geschwind != null ))
   Zeit = Geschwind;
    
  aktiveFC= document.fgColor  ;
  GlobalTmpVar1 = aktiveFC;
  GlobalTmpVar2 = neuFC;   
  
    
 GlobalBlinkID = window.setInterval("Blinken()", Zeit);
 }



function MoveNowImg()
  {
  xpos=MovePoint.style.posLeft;
  MovePoint.style.posLeft = xpos + 8;
  if (GlobalIdx == GlobalI )
    window.clearInterval(IntervalID);
  GlobalI++;
  }


  

function MoveImg(Schritte,Idx)
  {
  GlobalI = 1;
  GlobalIdx = Schritte ;
  GobalImgIdx=Idx;
  
  IntervalID = window.setInterval("MoveNowImg()",1000);
  
  }


/*
 * Seite im Frame aufrufen
 */

function GoForward()
 {
 parent.BottomLeft.location.href = ForwardPage ;
 }



/*
 * automatische Weiterleitung 
 */
 
function AutoForward(Seite,Zeit)
  {
  // alert(Seite + " in " + Zeit)
  ForwardPage = Seite;
  WaitTime = Zeit * 1000 ;
  TimerID = window.setTimeout('GoForward()',WaitTime);
  }

/*
 * Bilder ausfaden
 */

function Fade_Bild_out(Art)
{

 if ( FadeBilderIn == false )
    {
    FadeSize=0;
    Art=0;
    FadeOutBit=false
    }
 else
    {
    if ( FadeOutBit == true )
       {
       if ( FadeGrow <= 0 )
	  FadeGrow=1;
       FadeOutBit = true;  
       FadeSize=FadeSize - FadeGrow ;
       }
    }

 
 if ((FadeSize>0) && (FadeInBit == false))
  {
  //alert(FadeSize)
  document.FadeBild.style.filter="Alpha(opacity="+FadeSize+", finishopacity=0, style="+Art+")";
  FadingTimerID = window.setTimeout('Fade_Bild_out()',1);
  }
 else
  {
  FadeOutBit = false;
  FadeInBit=true;
  document.FadeBild.style.filter="Alpha(opacity=0, finishopacity=0, style="+Art+")";
  }

 }
 



/*
 * Bilder einfaden 
 */

function Fade_Bild_in(Art)
{


 if ( FadeBilderIn == false )
    {
    FadeSize=100;
    Art=0;
    FadeInBit = false;
    }
 else
    {
    if ( FadeInBit == true )
       {
       if ( FadeGrow <= 0 )
	  FadeGrow=1;

       FadeInBit=true;
       FadeSize=FadeSize + FadeGrow ;
       }
    }


 if ((FadeSize<=100) && ( FadeInBit == true))
  {
  document.FadeBild.style.filter="Alpha(opacity="+FadeSize+", finishopacity=0, style="+Art+")";
  FadeInTimerID = window.setTimeout('Fade_Bild_in()',1);
  }
 else
  {
  FadeInBit = false ;
  FadeOutBit=true;
  document.FadeBild.style.filter="Alpha(opacity=100, finishopacity=0, style="+Art+")";
  if ( FadeInOut == true )
     {
     FadeSize = 100
     FadeOutTimerID = window.setTimeout('Fade_Bild_out()',FadeInOutWait);
    }
  }

 }
 
 
  
/*
 * wechseln von zwei Bildern 
 */ 
	
function SwitchImage()
  {
  if ( RotateIdx == true )
    {
    if ( FadeOutBit == false )
	  {
	  NeuesBild = SourceImgDir + "/" + GlobalImg2 ;
         document.picform.FadeBild.src = NeuesBild ;
  	  FadeSize=0;
	  Fade_Bild_in(0);
  	  RotateIdx=false;
	  }
	}
  else
    {
    if ( FadeOutBit == false )
	  {
	  NeuesBild = SourceImgDir + "/" + GlobalImg1 ;
         document.picform.FadeBild.src = NeuesBild ;
         RotateIdx=true ;
  	  FadeSize=0;
	  Fade_Bild_in(0);
	  }
	}
  }
  
 
 
function Rotate(Bild1,Bild2,Zeit)
  {
  GlobalImg1 = Bild1;
  GlobalImg2 = Bild2;
  Zeit=Zeit*1000;
  SwitchImage()
    
  TimerID = window.setInterval("SwitchImage()", Zeit);
  } 
  

  
function FadeSeiten()
  {
  FadeSeite.style.filter="blendTrans(duration=1)";
  Fadeseite.filters.blendTrans.apply();
  Fadeseite.style.visibility="visible";
  Fadeseite.filters.blendTrans.play();
  }


