
var isInternetExplorer = false; // MS IE (5.x, 6)
var isNSNavigator = false; // Netscape Navigator (4.x)
var isNS67M = false; // (Netscape 6 & 7, Mozilla)
var mySpringerElement;

if (document.all)
{
  isInternetExplorer = true;
  mySpringerElement = document["all"]["mySpringer"];
}
else if (document.layers)
{
  isNSNavigator = true;
  mySpringerElement = document["layers"]["mySpringer"];
}
else if (document.getElementById)
{
  isNS67M = true;
  mySpringerElement = document.getElementById("mySpringer");
}


var oSpringer = {
	topMargin	: 25,
	callRate	: 40,
	slideTime	: 1200,
	maxDiff		: document.all ? document.body.clientHeight : window.innerHeight,
	isIE		: document.all ? true : false,
	springerDiv	: mySpringerElement
}

window.setInterval("oSpringer.main( )", oSpringer.callRate)

oSpringer.main = function( )
{
  if(isInternetExplorer)
  {
    this.currentY  = this.springerDiv.style.pixelTop;
    this.scrollTop = document.body.scrollTop;
  }
  else if(isNSNavigator)
  {
    this.currentY  = this.springerDiv.top;
    this.scrollTop = window.pageYOffset;
  }
  else if(isNS67M)
  {
    this.currentY  = this.springerDiv.style.top;
    this.scrollTop = window.pageYOffset;
  }

  var newTargetY = this.scrollTop + this.topMargin;

  if( this.currentY != newTargetY )
  {
    if ( newTargetY != this.targetY )
    {
      this.targetY = newTargetY;
      this.slideInit();
    }

    this.slide();
  }
}

oSpringer.slideInit = function( )
{
  var now = new Date();

  this.A		= this.targetY - this.currentY;
  this.B		= Math.PI / ( 2 * this.slideTime );
  this.C		= now.getTime();

  if (Math.abs(this.A) > this.maxDiff)
  {
    this.D = this.A > 0 ? this.targetY - this.maxDiff : this.targetY + this.maxDiff;
    this.A = this.A > 0 ? this.maxDiff : -this.maxDiff;
  }
  else
  {
    this.D = this.currentY
  }
}

oSpringer.slide = function( )
{
	var now	= new Date( )
	var newY	= this.A * Math.sin( this.B * ( now.getTime( ) - this.C ) ) + this.D
	newY		= Math.round( newY )

	if (( this.A > 0 && newY > this.currentY ) ||
		( this.A < 0 && newY < this.currentY )) {

			if ( this.isIE )this.springerDiv.style.pixelTop = newY
			else			this.springerDiv.top = newY
	}
}

oSpringer.setImage = function( filename )
{
  NewImage = new Image();
  NewImage.src = filename;
  this.springerDiv.document.derSpringer.src = NewImage.src;
}

function setSpringerImage( filename )
{
  if( isInternetExplorer )
  {
    oSpringer.setImage(filename);
  }
  else
  {
    filename=escape(filename);
    parent.frames["fileList"].document.mySpringer.document.open();
    parent.frames["fileList"].document.mySpringer.document.write('<img src="' + filename + '" border="0" width="128px" name="derSpringer">');
    parent.frames["fileList"].document.mySpringer.document.close();
  }
}
function setSpringerImageNetscape( filename )
{
   filename=escape(filename);
   parent.frames["fileList"].document.mySpringer.document.open();
   parent.frames["fileList"].document.mySpringer.document.write('<img src="file:///' + filename + '" border="0" width="128px" name="derSpringer">');
   parent.frames["fileList"].document.mySpringer.document.close();
}

function setSpringerImageNetscapeMac( filename )
{
   filename=escape(filename);
   parent.frames["fileList"].document.mySpringer.document.open();
   parent.frames["fileList"].document.mySpringer.document.write('<img src="file://' + filename + '" border="0" width="128px" name="derSpringer">');
   parent.frames["fileList"].document.mySpringer.document.close();
}

function setSpringerImageGeckoEngine( filename )
{
  NewImage = new Image();
  NewImage.src = filename;
  parent.frames["fileList"].document.images["derSpringer"].src = NewImage.src;
}

