// Pages using these functions will also need the Utils.js library

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; 
  }
}

var START_DELAY = 1000;
var loopingScroller;

function LoopingScroller(frameDivId, scrollerDivId, scrollInterval) {
	this.theScrollingElement = MM_findObj(scrollerDivId);
	this.theFrameElement = MM_findObj(frameDivId);
	this.theScrollingElement.onmouseover = LoopingScroller_pause;
	this.theScrollingElement.onmouseout = LoopingScroller_resume;
	this.objectStyle = this.theScrollingElement.style;
	this.scrollPos = 0;
	this.scrollingLayerHeight = this.theScrollingElement.offsetHeight;
	this.frameHeight = this.theFrameElement.offsetHeight;
	this.scrollInterval = scrollInterval;
	this.move = LoopingScroller_move;
	loopingScroller = this;
	setTimeout("loopingScroller.move()", START_DELAY);
}

function LoopingScroller_move() {
	this.frameHeight = this.theFrameElement.offsetHeight;
	this.scrollingLayerHeight = this.theScrollingElement.offsetHeight;
	if (!loopingScroller.myPause){
		var nextScroll = this.scrollInterval;
		this.scrollPos -= 1;
		this.objectStyle.top = this.scrollPos;
		if (this.scrollPos < -this.scrollingLayerHeight) {
			this.scrollPos = this.frameHeight;
		}
	}
	setTimeout("loopingScroller.move()", nextScroll);
}

function LoopingScroller_pause() {
	loopingScroller.myPause = true;
}

function LoopingScroller_resume() {
	loopingScroller.myPause = false;
}

var loopingScroller2;

function LoopingScroller2(frameDivId, scrollerDivId, scrollInterval) {
	this.theScrollingElement = MM_findObj(scrollerDivId);
	this.theFrameElement = MM_findObj(frameDivId);
	this.theScrollingElement.onmouseover = LoopingScroller2_pause;
	this.theScrollingElement.onmouseout = LoopingScroller2_resume;
	this.objectStyle = this.theScrollingElement.style;
	this.scrollPos = 0;
	this.scrollingLayerHeight = this.theScrollingElement.offsetHeight;
	this.frameHeight = this.theFrameElement.offsetHeight;
	this.scrollInterval = scrollInterval;
	this.move = LoopingScroller2_move;
	loopingScroller2 = this;
	setTimeout("loopingScroller2.move()", START_DELAY);
}

function LoopingScroller2_move() {
	this.frameHeight = this.theFrameElement.offsetHeight;
	this.scrollingLayerHeight = this.theScrollingElement.offsetHeight;
	if (!loopingScroller2.myPause){
		var nextScroll = this.scrollInterval;
		this.scrollPos -= 1;
		this.objectStyle.top = this.scrollPos;
		if (this.scrollPos < -this.scrollingLayerHeight) {
			this.scrollPos = this.frameHeight;
		}
	}
	setTimeout("loopingScroller2.move()", nextScroll);
}

function LoopingScroller2_pause() {
	loopingScroller2.myPause = true;
}

function LoopingScroller2_resume() {
	loopingScroller2.myPause = false;
}
