<!-- Hide Javascript from older browsers

// Browser versions
var isIE4 = false;
var isNN4 = false;
var isNN6 = false;
var isOpera = false;
var isOld = false;

var scrollPosition = 0;     // initial position of a fresh page load
var buttonDown = false;     // if mouse button down, equals true
var MAXHEIGHT = 600;        // clip height of scroll window
var SCROLL = 10;            // scroll 10 pixels at a time

// EXECUTION
setNavInfo();

// Do browser detection first

function setNavInfo() {

	app=navigator.appName;                 
	vers=navigator.appVersion;              
	//MSIE 4.0+ browsers
	if (app.indexOf("Microsoft")>=0 && vers.indexOf("4.")>=0)
		{isIE4 = true;}
	//Netscape 6.0+ browsers
	else if (app.indexOf("Netscape")>=0 && vers.indexOf("6.")>=0)
		{ isNN6 = true; }
	//Netscape 4.0+ browsers
	else if (app.indexOf("Netscape")>=0 && vers.indexOf("4.")>=0)
		{isNN4 = true; }
	//Opera 7.0+ browsers
	else if (app.indexOf("Opera")>=0 && vers.indexOf("4.")>=0)
		{isOpera = true;}
	//All other browsers
	else { isOld = true;}
}


// change the SRC attribute in NN4, IE4+, and NN6

function changeFrameSrc(frameID, sourceURL) {
	if (isNN4) {
	    eval("document." + frameID + ".src=" + sourceURL);
	} else if ((isIE4) || (isOpera)) {
	    eval(frameID + ".location.href=" + sourceURL);
	} else if (isNN6) {
	    var obj = document.getElementsByTagName('iframe');
	    obj[frameID].setAttribute("src", sourceURL);
	}
}


// scroll the contents of the frame in NN4 and IE4+ (not NN6) 8^(
// to scroll horizontally, use clip.left and clip.right in NN4 and
// scroll(horizontal, vertical) in IE4+

function scrollWin(frameID, scr) {
	if (isNN4) {
	    var obj = document.layers[frameID];
	    var pos = obj.clip.top - scr;
	    obj.clip.top=scr
	    obj.clip.bottom -= pos;
	    obj.top += pos;
	} else if ((isIE4) || (isOpera)) {
	    eval("window." + frameID + ".scroll(0," + scr+ ")");
	} else if (isNN6) {
	    // I am currently working on a technique to do this in NN6
	}
}


// if button is pressed down continually, repeatedly scroll

function scrollUp(frameID) {
	if (buttonDown) {
	    scrollPostition -= SCROLL;
	    if (scrollPostition >= 0) {
		scrollWin(frameID, scrollPostition);
		setTimeout("scrollUp()", 30);
	    } else {
		scrollPostition = 0;
		scrollWin(frameID, 0);
	    }
	}
}


// watch out for the bottom of the page

function scrollDown(frameID) {
	if (buttonDown) {
	    scrollPostition += SCROLL;
	    scrollHeight = getFrameHeight('myLayer', 'myIFrame') - MAXHEIGHT;
	    if (scrollHeight < 1) return;
	    if (scroll <= scrollHeight) {
		scrollWin(frameID, scrollPosition);
		setTimeout("scrollDown()", 30);
	    } else {
		scrollPostition = scrollHeight;
		scrollWin(frameID, scrollPosition);
	    }
	}
}


// every time a mouse button is pressed, check if it's over a button
// I haven't finished writing the routine for NN6 yet... 8^(

function mouseDown(evt) {

// in NN4 you must check every layer against the event X and Y

	if (isNN4) {
	    var testElem;
	    var xPos = evt.pageX;
	    var yPos = evt.pageY;

	    var elementName = null;
	    for (i = document.layers.length - 1; i >= 0; i--) {
		testElem = document.layers[i]
		if ((xPos > testElem.left) && 
		   (xPos < testElem.left + testElem.clip.width) && 
		   (yPos > testElem.top) && 
		   (yPos < testElem.top + testElem.clip.height)) {
		    elementName = testElem.id;
		    break;
		}
	    }
	    if (elementName == null) return true;
	} else if ((isIE4) || (isOpera)) {
	    // in IE4, you only have to ask which element triggered the event
	    elementName = event.srcElement.name;
	}
	if (elementName) {
	    if (elementName.indexOf('upbutton') != -1) {
		buttonDown = true;
		scrollUp(elementName);
		return false;
	    }
	    if (elementName.indexOf('downbutton') != -1) {
		buttonDown = true;
		scrollDown(elementName);
		return false;
	    }
	}
	return true;
}


// if the user releases the button, reset the flag

function mouseUp(evt) {
	buttonDown = false;
	return false;
}


// return the calculated height of the external HTML source

function getFrameHeight(frameID, frameName) {
	if (isNN4) {
	    return document.layers[frameID].document.height;
	} else if ((isIE4) || (isOpera)) {
	    obj = eval(frameID);
	    return obj.document.body.scrollHeight;
	} else if (isNN6) {
	    return window.frames[frameName].document.body.offsetHeight;
	}
}


// reset to top of document (onload)

function setScrollPosition(frameID) {
	scrollPosition = 0;
	//scrollWin(frameID, 0);
}


// NN4 requires that you set up event capturing first

if (isNN4) document.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP);

document.onmousedown=mouseDown;
document.onmouseup=mouseUp;

// End of hiding Javascript -->

