function PageScroller(contentFrameId) {
	this.contentFrameObject=window.frames[contentFrameId];
	this.currentXPos=0;
	this.targetXPos=0;
	this.interval=null;
}

PageScroller.prototype.setPosition=function (targetPosition) {
	window.clearInterval(this.interval);
	var animationObject=this;
	this.targetXPos=targetPosition;
	function animateScroll() {
		var stepDistance=(animationObject.targetXPos-animationObject.currentXPos)/3;
		if (Math.abs(stepDistance)>0.3) {
			animationObject.currentXPos+=stepDistance;
			animationObject.contentFrameObject.scrollTo(animationObject.currentXPos,0);
		} else {
			animationObject.currentXPos=animationObject.targetXPos;
			animationObject.contentFrameObject.scrollTo(animationObject.currentXPos,0);
			window.clearInterval(animationObject.interval);
		}
	}
	this.interval=window.setInterval(animateScroll,50);
}