if (document.all){
	document.images['rightBarXLocPic'].getRealTop = getRealTop
	rightBarYLoc = document.images['rightBarXLocPic'].getRealTop()  
	document.images['rightBarXLocPic'].getRealLeft = getRealLeft
	rightBarXLoc = document.images['rightBarXLocPic'].getRealLeft()	
	document.images['bottomPic'].getRealTop = getRealTop
	bottomYLoc = document.images['bottomPic'].getRealTop() 
	windowHeight = document.body.offsetHeight-4	
}
else if (document.getElementById){
	document.images['rightBarXLocPic'].getRealTop = getRealTop
	rightBarYLoc = document.images['rightBarXLocPic'].getRealTop()  
	document.images['rightBarXLocPic'].getRealLeft = getRealLeft
	rightBarXLoc = document.images['rightBarXLocPic'].getRealLeft()	
	document.images['bottomPic'].getRealTop = getRealTop
	bottomYLoc = document.images['bottomPic'].getRealTop() 			
	windowHeight = window.innerHeight	
}
else if(document.layers){
	rightBarYLoc = document.images['rightBarXLocPic'].y
	rightBarXLoc = eval(document.images['rightBarXLocPic'].x) - 9
	bottomYLoc = document.images['bottomPic'].y
	windowH = window.innerHeight-4
}

var oChaser = {
	topMargin	: rightBarYLoc,
	callRate	: 10,
	slideTime	: 1200,
	maxDiff		: document.all ? document.body.clientHeight : window.innerHeight,
	isIE		: document.all ? true : false,
	isNS		: document.layers ? true : false,
	chaserDiv	: document.all ? eval("document.all['storabar']") : document.getElementById ? eval("document.getElementById('storabar')") : eval("document.layers['storabar']")
}

// Arrange to have the main loop called as often as possible, 
// but not more often than every 35 milliseconds.
// Even though some OS's can acheive better than that, there's no real reason to
// overload them if its not going to improve the animation quality very much.
// I tested, and better than 35ms doesn't do very much visually.
window.setInterval("oChaser.main( )", oChaser.callRate)


// Main loop. Updates targetY, and decides whether to start
// the animation over again, continue an existing animation,
// or do nothing at all.
k=0
oChaser.main = function( )
{
	if (document.all){
		document.images['rightBarXLocPic'].getRealLeft = getRealLeft
		rightBarXLoc = document.images['rightBarXLocPic'].getRealLeft()	
	}
	else if (document.getElementById){
		document.images['rightBarXLocPic'].getRealLeft = getRealLeft
		rightBarXLoc = document.images['rightBarXLocPic'].getRealLeft()	
	}
	else if(document.layers){
		rightBarXLoc = eval(document.images['rightBarXLocPic'].x) - 7
	}
	this.currentX	= this.isIE ? this.chaserDiv.style.pixelLeft : this.isNS ? this.chaserDiv.left : this.chaserDiv.style.left.substring(0,this.chaserDiv.style.left.length-2)
	if (this.currentX !=rightBarXLoc){
		this.slide();
	}
	
	this.currentY	= this.isIE ? this.chaserDiv.style.pixelTop : this.isNS ? this.chaserDiv.top : this.chaserDiv.style.top.substring(0,this.chaserDiv.style.top.length-2)
	this.scrollTop	= this.isIE ? document.body.scrollTop : window.pageYOffset
	if (this.scrollTop < this.topMargin) var newTargetY	= this.topMargin
	else if (this.currentY >= (bottomYLoc-438)) newTargetY = this.CurrentY
	else  var newTargetY	= this.scrollTop
	if ( this.currentY != newTargetY ) {
		if ( newTargetY != this.targetY ) {
			this.targetY = newTargetY
			this.slideInit( )

		}

		this.slide( )
		
	}
	
}



// .slideInit( ). Initializes the slide animation. Sets properties
// of the oChaser object that will represent the various paramaters
// for the sine wave function.
oChaser.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
	}
}



// .slide( ). Moves the oChaser one frame. Its rate decreases and
// is defined by a sine wave.
oChaser.slide = function( )
{


	newX = rightBarXLoc
	var now	= new Date()
	var tempSin = Math.sin(this.B*(now.getTime()-this.C))
	if (!this.isIE && !this.isNS){
		if(tempSin>=1){
			tempSin = 0.99999999999
		}
		if(tempSin<=-1){
			tempSin = -0.99999999999
		}
	}
	var newY	= eval(eval(eval(this.A) * eval(tempSin)) + eval(this.D))
	newY		= Math.round( newY )
	if (( this.A > 0 && newY > this.currentY ) ||
		( this.A < 0 && newY < this.currentY )) {
			if ( this.isIE )this.chaserDiv.style.pixelTop = newY
			else if (this.isNS)	this.chaserDiv.top = newY
			else this.chaserDiv.style.top = newY
	}
	if ( this.isIE )this.chaserDiv.style.pixelLeft = newX
	else if (this.isNS)	this.chaserDiv.left = newX
	else this.chaserDiv.style.left = newX
}
