
var delay = 150
var timerId
var maxCount = 0
var currCount = 1

function scrollMsg() {
	// set the maximum number of times to scroll message
	if (maxCount == 0) {
		maxCount = 4 * msg.length
	}
	window.status = msg
	// keep track of characters scrolled
	currCount++
	// shift first character to end of message
	msg = msg.substring(1, msg.length) + msg.substring(0, 1)
	// test for maximum character count
	if (currCount >= maxCount) {
		timerId = 0					// zero the timer
		window.status = "" 		// clear the status bar
		return						// break out of the function
	}	else {
			// recursive call to this function
			timerId = setTimeout("scrollMsg()", delay)
	}
}


