    cooldown=false;
    pos=0;
    max=7;
    leftgrey=true;
    rightgrey=false;
    function moveleft(){
       if(pos>0){
       if (!cooldown){
        pos--;
        if(pos==0) {
          document.getElementById('leftid').src='images/leftg.gif';
          leftgrey=true;
        }
        if(pos==(max-1)){
           document.getElementById('rightid').src='images/right.gif';
           rightgrey=false;
         }
        cooldown=true;      
        new ypChaser("scrollwow", 0, 1000, 0, 0,-169,true,true);
        setTimeout('cooldown=false',1000);
      }
    }
    }
    function overmousel(n){
      if (!leftgrey){
        n==1 ? document.getElementById('leftid').src='images/lefth.gif': document.getElementById('leftid').src='images/left.gif' ;
      }
    }
    function overmouser(n){
      if (!rightgrey){
        n==1 ? document.getElementById('rightid').src='images/righth.gif': document.getElementById('rightid').src='images/right.gif' ;
      }
    }
    function moveright(){
     if(pos<max){
      if (!cooldown){
        pos++;
        if(pos==max) {
          document.getElementById('rightid').src='images/rightg.gif';
          rightgrey=true;
        }
        if(pos==1) {
          document.getElementById('leftid').src='images/left.gif';
          leftgrey=false;
        }
        cooldown=true;      
        new ypChaser("scrollwow", 0, 1000, 0, 0,169,true,true);
        setTimeout('cooldown=false',1000);
      }
    }
    }

//=========================
// ypChaser class definition
//===========================================================
// sLayerId   : the ID attribute from the chaser div element
// iTopOffset : the amount of space the chaser will maintain 
//              from the top of the page
// iSlideTime : the amount of time the chaser should take to
//              perform the slide animation.
// iCeiling   : optional parameter which specifies a space
//              at the top of the document which the chaser
//              will not animate over.
// iFloor     : optional parameter which specifies a space
//              at the bottom of the document which the 
//              chaser will not animate over.
//
//
// Note:
// the floor feature does not yet work under Opera, as there
// is no way under Opera's DOM to query the pixel height
// of a document. If the floor feature is used in an Opera
// browser, it will be ignored - but otherwise the script
// will function.
//===========================================================
function ypChaser(sLayerId, iTopOffset, iSlideTime, iCeiling, iFloor, iCurrentY, iHorizont, iForward) {
	this.chaserDiv = null
	this.layerId   = sLayerId
	this.topOffset = iTopOffset
	this.slideTime = iSlideTime
	this.ceiling   = iCeiling
	this.floor     = iFloor
	this.currentY  = iCurrentY
	this.horizont  = iHorizont
	this.forward = iForward
	ypChaser.registry[ypChaser.registry.length] = this
}



ypChaser.isIE = window.clientInformation ? true : false
ypChaser.isN4 = document.layers ? true : false
ypChaser.isN6	= navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 5
ypChaser.isO5 = navigator.userAgent.indexOf("Opera") != -1 && parseInt(navigator.appVersion) >= 4
ypChaser.registry = new Array( )
ypChaser.callRate = 10

window.setInterval("ypChaser.timer( )", ypChaser.callRate)



// this is the main loop of the program. To avoid having multiple timers
// running concurrently (CPU-intensive) this goes through ypChaser.registry[ ]
// and calls the .main( ) method of each instance of ypChaser in turn.
ypChaser.timer = function() {
	for (var i = 0; chObj = this.registry[i]; i++) {
		if (!chObj.chaserDiv) chObj.attemptLoad()
		if (chObj.chaserDiv)  chObj.main()
	}
}


// attempts to find the target layer.
// sets the chaserDiv property of the parent object to
// found layer, or null if none is found.
ypChaser.prototype.attemptLoad = function() {
	var chDiv = null

	if (ypChaser.isN6 || ypChaser.isO5)	chDiv = document.getElementById(this.layerId)
	else if (ypChaser.isIE)			chDiv = document.all[this.layerId]
	else if (ypChaser.isN4)			chDiv = document.layers[this.layerId]

	if (chDiv && chDiv != null) {
		this.chaserDiv = chDiv
	}
}
	


// Main function. gets called very often by ypChaser.timer().
// Updates targetY, and decides whether to start
// the animation over again, continue an existing animation,
// or do nothing at all.
ypChaser.prototype.main = function( )
{
	this.currentY	= this.currentY
	var scrollTop	= ypChaser.getWindowScroll() 
	var newTargetY	= this.topOffset
	var floor		= ypChaser.getDocumentHeight() - this.floor

	newTargetY = this.ceiling
	if (!ypChaser.isO5) newTargetY = Math.min(newTargetY, floor)

	if ( this.currentY != newTargetY ) {

		if ( newTargetY != this.targetY ) {
			this.targetY = newTargetY
			this.slideInit( )
	
		}

		this.slide( )
		
	}
}


// .slideInit( ). Initializes the slide animation.
ypChaser.prototype.slideInit = function( )
{
	this.A		= (this.targetY - this.currentY) / this.slideTime / this.slideTime
	this.startT	= (new Date()).getTime()
	this.startP	= this.getCurrentY()
	this.D		= this.targetY;
}


// .slide( ). Moves the Chaser one frame. Its rate decreases and
// is defined by a sine wave.
ypChaser.prototype.slide = function( )
{
	var elapsed	= (new Date()).getTime() - this.startT
	if (elapsed < this.slideTime) {
	 if (this.forward){
		this.moveTo(this.D - (Math.round(Math.pow(this.slideTime - elapsed, 2) * this.A)) + this.startP - this.currentY)
    } else{
    this.moveTo(this.D - (Math.round(Math.pow(this.slideTime - elapsed, 2) * this.A)) + this.startP)
    }
	}
}


ypChaser.prototype.moveTo = function(ny) {
	if(this.horizont){
      if (ypChaser.isN4)	this.chaserDiv.left = ny
	    else				this.chaserDiv.style.left = ny + "px"
	}else{
      if (ypChaser.isN4)	this.chaserDiv.top = ny
	    else				this.chaserDiv.style.top = ny + "px"
  }
}
	
ypChaser.prototype.getCurrentY = function() {
	if(this.horizont){
      var n = ypChaser.isN4 ? this.chaserDiv.left : parseInt(this.chaserDiv.style.left)
    	return isNaN(n) ? 0 : n
  }else{
      var n = ypChaser.isN4 ? this.chaserDiv.top : parseInt(this.chaserDiv.style.top)
    	return isNaN(n) ? 0 : n
  }
}

ypChaser.getWindowScroll = function() {
	if (ypChaser.isIE)	return document.body.scrollTop
	else				return window.pageYOffset
}

ypChaser.getDocumentHeight = function() {
	if (ypChaser.isO5)		return 0 // opera can't retreive this property.
	else if (ypChaser.isIE)	return Math.max(document.body.scrollHeight, document.body.offsetHeight)
	else					return window.document.height
}

