var myPosition = 0; 

function getWinHeight() {
if (document.all) {
	return document.body.clientHeight
	}
else if (window.innerHeight) {
	return window.innerHeight
	}
else {
	return 500;
	}
}

var scrollDir = 1;
var timerId = null;
var timerRunning = false;

var timeInt = 100; // time between steps in milliseconds
var stepSize = 6;  // amount moved each step in pixels


function docScroll() {
var winHeight = getWinHeight();
var myHeight = totalHeight - winHeight;
	if (myPosition < myHeight) {myPosition += (stepSize * scrollDir);}
	else {scrollDir = scrollDir * -1; myPosition += (stepSize * scrollDir);}
	if (myPosition == 0) {scrollDir = scrollDir * -1;  myPosition += (stepSize * scrollDir);}
window.scrollTo(0,myPosition);
timerID = setTimeout('docScroll()',timeInt);
timerRunning = true;
}

function stopScroll() {
if (timerRunning) {clearTimeout(timerID)}
timerRunning = false;
}

function startScroll() {
docScroll();
}


/* for page containing IFRAME - sets IFRAME height as larger of page content or window height */

function getBodyHeight() {
if (document.all) {
	if (document.body.scrollHeight > document.body.clientHeight) { 
		return document.body.scrollHeight
		}
	else { return document.body.clientHeight }
	}
else if (window.innerHeight) {
	return window.innerHeight
	}
else {
	return 500;
	}
}

function popUp(newURL,w,h) {
  var remote = open(newURL, 'zoom', 'width=' + w + ',height=' + h + ',directories=0,location=0,menubar=1,status=0,toolbar=0,resizable=1,scrollbars=0,left=0,top=0,X=0,Y=0');
}

function handleResize() {
	if (document.all || document.getElementById) location.reload()
}