<!--


			////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			//
			// 	DHTML Content Scroller
			// 	Author: Steve McDonald for Citrus Internet
			//
			// 	Supported Browsers:
			// 		- IE 5+
			// 		- NS 6+
			// 		- Opera 7+
			//
			//	Instructions:
			//		- Scrollable content area and draggable scrollbar must be contained within parent elements that have their overflow attribute set to hidden
			//		- Scrollable content areas must include their IDs in the array arrScrollContentID as is below
			//		- Draggable scrollbars must use an ID made from the ID of the content area they will scroll plus the axis to scroll, x or y
			//		- Scrollable content areas must have a width defined for horizontal scrolling to work in browsers other than IE.
			//		- Scrollbars, their containers and scroll buttons must be contained within an element using the class name as 
			//		  defined with the string var value of strClassScrollBarEnabled, in order to be disabled using the class
			// 		  name as defined with the string var value of strClassScrollBarEnabled, as is below
			//		- The body onload event must call the init() function
			//		- Scrollbar buttons must use these functions on these events, where 'contentID' is the scrollable content area's ID, intSpeed defines 
			//		  positive direction and intSpeed * -1 defines negative direction, ie up and down or left and right, and 'y' defines a vertical axis (x for horizontal)
			//			onmousedown = return scrollStart('contentID', intSpeed * -1, 'y'); 
			//			onmouseup = return scrollStop('contentID');
			//			onmouseout = return scrollStop('contentID');
			//		- Draggable scrollbars must use this function on the following events
			//			onmousedown = return dragStart(event, this);
			//			onmouseup = return dragStop(this);
			//		- Scrollbar container areas must use these functions on these events, where 'contentID' is the scrollable content area's ID, and 'y' defines
			//		  a vertical axis (x for horizontal)
			//			onmousedown = return scrollClick(event, 'contentID', 'y')
			//			onmousewheel="scrollWheel('contentID', 'y');"
			//		- Actual content areas must use this function on this event where 'contentID' is the scrollable content area's ID
			//			onmousewheel="scrollWheel('content');"
			//		- To avoid problems with dragging and text being selected, it's advisable to apply the unselectable="on" attribute/value to all elements concerned
			//
			// 	Disclaimer: This script will work approx 98% the way you'd expect it to. Certain variables
			//	such as browser, os, ram and page layout may cause minor peculiarities!
			//
			////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			

			////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			//
			// 	Edit this to set the scrolling speed for directional buttons. 1 is v. slow 10 is v. fast.
			//
				var intSpeed = 5;
			//
			////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


			////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			//
			// 	This boolean defines whether scrollbars are dynamically resized according to the scrollable distance of the area they scroll 
			//
				var blnResizeScrollbars = true;
			//
			////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


			////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			//
			// 	These classnames represent enabled and disabled states of elements
			//	containing scrollbar/button controls for content scrolling
			//
				var strClassScrollBarEnabled = 'scrollbarenabled';
				var strClassScrollBarDisabled = 'scrollbardisabled';
			//
			////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


			////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			//
			// 	This array contains all the IDs of content elements that use scrolling
			//
				var arrScrollContentID = new Array('content');
			//
			////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


			////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			//
			// 	Don't edit anything below here
			//
			////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			

			var intPosX = intPosY = 0; // store mouse position
			var intScrollIndex = 0; // interval index for holding mousedown on scroll buttons
			var strActiveAxis = strActiveElementID = ''; // store current axis and element
			var blnDrag = false; // store dragging state
			

			function scrollOne(strElementID, intMove) { // moves an element
				var oElem = document.getElementById(strElementID); // get element to scroll
				with (oElem) {
					// if horizontal scrolling and element has room to scroll within its bounds, calculated for both elements smaller than their bounds and elements larger than their bounds, set left pos
					if (strActiveAxis == 'x' && (((parentNode.offsetWidth > offsetWidth && intMove > 0 && parseInt(style.left) < parentNode.offsetWidth - offsetWidth) || (parentNode.offsetWidth > offsetWidth && intMove < 0 && parseInt(style.left) >= 0)) || ((parentNode.offsetWidth < offsetWidth && intMove < 0 && parseInt(style.left) > parentNode.offsetWidth - offsetWidth) || (parentNode.offsetWidth < offsetWidth && intMove > 0 && parseInt(style.left) <= 0)))) {
						style.left = parseInt(style.left) + intMove;
					// same for vertical
					} else if (strActiveAxis == 'y' && (((parentNode.offsetHeight > offsetHeight && intMove > 0 && parseInt(style.top) < parentNode.offsetHeight - offsetHeight) || (parentNode.offsetHeight > offsetHeight && intMove < 0 && parseInt(style.top) >= 0)) || ((parentNode.offsetHeight < offsetHeight && intMove < 0 && parseInt(style.top) > parentNode.offsetHeight - offsetHeight) || (parentNode.offsetHeight < offsetHeight && intMove > 0 && parseInt(style.top) <= 0)))) {
						style.top = parseInt(style.top) + intMove;
					}
				}
			}


			function scrollBoth(intMove) { // moves content proportionally to scrollbar movement

				var oCont = document.getElementById(strActiveElementID); // get content element
				var oBar = document.getElementById(strActiveElementID + strActiveAxis); // get scrollbar element

				setElement(oCont); // set defaults for content
				setElement(oBar); // set defaults for scrollbar

				// if there is movement and content is scrollable
				if (intMove != 0 && ((strActiveAxis == 'x' && oCont.offsetWidth > oCont.parentNode.offsetWidth) || (strActiveAxis == 'y' && oCont.offsetHeight > oCont.parentNode.offsetHeight))) {

					var strSizeProp = strActiveAxis == 'x' ? 'Width' : 'Height'; // determine size property to dynamically use
					var strPosProp = strActiveAxis == 'x' ? 'left' : 'top'; // determine position property to dynamically use
					// determine content area left to scroll for active axis
					var intContToScroll = intMove > 0 ? eval('oCont.offset' + strSizeProp + ' + parseInt(oCont.style.' + strPosProp + ') - oCont.parentNode.offset' + strSizeProp) : eval('parseInt(oCont.style.' + strPosProp + ')');
					// determine scrollbar area left to scroll for active axis
					var intBarToScroll = intMove > 0 ? eval('oBar.parentNode.offset' + strSizeProp + ' - parseInt(oBar.style.' + strPosProp + ') - oBar.offset' + strSizeProp) : eval('parseInt(oBar.style.' + strPosProp + ')');
					intMove = intMove > 0 ? intBarToScroll < intMove ? intBarToScroll : intMove : intBarToScroll < intMove * -1 ? intBarToScroll * -1 : intMove;

					scrollOne(strActiveElementID + strActiveAxis, intMove); // move the scrollbar

					// determine distance to move content as proportional to distance scrollbar moved
					intMove = intMove > 0 ? intMove * -1 : intMove;
					intMove = intBarToScroll == 0 ? 0 : intContToScroll * intMove / intBarToScroll;
					intMove = intMove > 0 ? intMove > intContToScroll * -1 ? intContToScroll * -1 : intMove : intMove * -1 > intContToScroll ? intContToScroll * -1 : intMove;
					
					scrollOne(strActiveElementID, intMove); // move content
					
				}

				return intMove;

			}
			

			function setElement(oElem) { // default properties reqd for element movement
				if (oElem) {
					with (oElem) {
						style.position = 'relative';
						// only set position if not already set
						style.left = style.left ? style.left : 0;
						style.top = style.top ? style.top : 0;
					}
				}
			}


			function scrollStart(strElementID, intMove, strAxis) { // starts continual scrolling for mousedown on scroll buttons
				strActiveAxis = strAxis; // set axis to scroll
				strActiveElementID = strElementID; // set content element to scroll
				intScrollIndex = setInterval('scrollBoth(' + intMove + ')', 1); // start scrolling
				return false;
			}


			function scrollStop() { // stops continual scrolling for mouseup on scrollbar buttons
				clearInterval(intScrollIndex); // stop scrolling
				strActiveAxis = strActiveElementID = '' // empty axis and element vars
				return false;
			}
			

			function scrollClick(oEvent, strElementID, strAxis) { // scrolls bar and content based on click of scrollbar area

				strActiveAxis = strAxis; // set axis to scroll
				strActiveElementID = strElementID; // set content element to scroll

				var oBar = document.getElementById(strActiveElementID + strActiveAxis); // get scrollbar element
				setElement(oBar); // set defaults for scrollbar

				var strSizeProp = strActiveAxis == 'x' ? 'Width' : 'Height'; // determine size property to dynamically use
				var strPosProp = strActiveAxis == 'x' ? 'left' : 'top'; // determine position property to dynamically use
				var strEventPosProp = (eval('oEvent.offset' + strActiveAxis.toUpperCase()) ? 'offset' : 'layer') + strActiveAxis.toUpperCase(); // determine event position property to dynamically use
				var intMove = eval('oEvent.' + strEventPosProp + ' - parseInt(oBar.style.' + strPosProp + ') - (oBar.offset' + strSizeProp + ' / 2)')

				scrollBoth(intMove);

				strActiveAxis = strActiveElementID = '' // empty axis and element vars
				return false;

			}
			

			function scrollWheel(strElementID, strAxis) { // handles scrollwheel
				if (window.event.wheelDelta) {
					strActiveAxis = arguments.length > 1 ? strAxis : 'y'; // set axis to scroll
					strActiveElementID = strElementID; // set content element to scroll
					if (scrollBoth(window.event.wheelDelta * -1) == 0 && arguments.length == 1) { // couldn't scroll, try other axis
						strActiveAxis = strActiveAxis == 'y' ? 'x' : 'y';
						scrollBoth(window.event.wheelDelta * -1);
					}
					strActiveAxis = strActiveElementID = '' // empty axis and element vars
				}
				return false;
			}


			function dragStart(oEvent, oBar) { // enables dragging on mousedown of scrollbars
				with (oBar) {
					strActiveAxis = getAttribute('id').substr(getAttribute('id').length - 1) // set axis to scroll
					strActiveElementID = getAttribute('id').substr(0, getAttribute('id').length - 1); // set content area to scroll
				}
				if (oEvent) {
					oEvent.cancelBubble = true; //disable scrollClick
				}
				blnDrag = true; // enable dragging
			}

			
			function dragStop() { // disables dragging on scrollbar mouseup
				blnDrag = false; // disable dragging
				strActiveAxis = strActiveElementID = ''; // empty axis and element vars
				return false;
			}


			function dragOne(oMozEvent) { // global mousemove handler to enable dragging
				var oEvent = oMozEvent ? oMozEvent : window.event; // capture browser event
				with (oEvent) {
					if (blnDrag) { // if dragging enabled
						if (window.event && window.event.button == 0) { // ensure mouse is actually down, ie only
							scrollStop(); // if dragging enabled yet mouse is up, mouseup has not been captured, simulate it
						} else {
							scrollBoth(strActiveAxis == 'x' ? clientX - intPosX : clientY - intPosY); // drag scrollbar and content
						}
					}
					// set mouse pos
					intPosX = clientX; 
					intPosY = clientY;
				}
			}


			function disableScrollBar(strScrollBarID) { // disables a scrollbar
				var oElem, blnFound;
				if (oElem = document.getElementById(strScrollBarID)) { // get scrollbar
					blnFound = false;
					while (!blnFound) { // move up through dom until scrollbar container found, or body is reached
						if (oElem.className == strClassScrollBarEnabled) { // is this element the scrollbar container
							oElem.className = strClassScrollBarDisabled; // set class to disabled classname
							blnFound = true;
						} else if (oElem.tagName.toLowerCase() == 'body') { // if body found then assume there's no scrollbar container and end loop
							blnFound = true;
						} else {
							oElem = oElem.parentNode; // move up dom
						}
					}
				}
			}
			

			function resizeScrollBar(strElementID, strAxis) { // resizes a scrollbar based on distance of scrollable area it scrolls
				var strSizeProp, oBar, oCont = document.getElementById(strElementID); // get content element
				if (oBar = document.getElementById(strElementID + strAxis)) { // get scrollbar element
					strSizeProp = strAxis == 'x' ? 'Width' : 'Height';
					eval('oBar.style.' + strSizeProp.toLowerCase() + ' = oBar.parentNode.offset' + strSizeProp + ' * oCont.parentNode.offset' + strSizeProp + ' / oCont.offset' + strSizeProp);
					if (document.focuser) {
						document.focuser.focuser.focus(); document.focuser.focuser.blur();
					}
				}
			}
			

			function setNodeAttribute(oNode, strAttribName, strAttribValue) { // sets a node's attribute value and recursively applies the same to its child nodes
				oNode.setAttribute(strAttribName, strAttribValue) // set the attribute value
				for (var i = 0; i < oNode.childNodes.length; i++) { // loop through the child nodes
					if (oNode.childNodes[i].nodeType == 1 && oNode.childNodes[i].nodeName != 'INPUT' && oNode.childNodes[i].nodeName != 'TEXTAREA') { // ensure child is an element and not editable
						setNodeAttribute(oNode.childNodes[i], strAttribName, strAttribValue); // apply to child
					}
				}
			}


			function init() { // initialiser for document load

				var oCont;
				document.onmousemove = dragOne; // enable global mousemove handler
				document.onmouseup = dragStop; // not reqd but will work towards catching mouseups with dragging that aren't caught

				// go through scrollable content areas and disabled their scrollbar containers if scrolling not required
				for (var i = 0; i < arrScrollContentID.length; i++) {
					if (oCont = document.getElementById(arrScrollContentID[i])) { // content element found

						if (oCont.offsetWidth <= oCont.parentNode.offsetWidth) { // horizontal scrolling not required
							disableScrollBar(arrScrollContentID[i] + 'x'); // disable horizontal scrollbar
						} else if (blnResizeScrollbars) { // scrollbar resizing enabled
							resizeScrollBar(arrScrollContentID[i], 'x'); // resize scrollbar
						}

						if (oCont.offsetHeight <= oCont.parentNode.offsetHeight) { // vertical scrolling not required
							disableScrollBar(arrScrollContentID[i] + 'y'); // disable vertical scrollbar
						} else if (blnResizeScrollbars) { // scrollbar resizing enabled
							resizeScrollBar(arrScrollContentID[i], 'y'); // resize scrollbar
						}
						
					}
				}

				// apply unselectable to all html elements
				setNodeAttribute(document.getElementsByTagName('body')[0], 'unselectable', 'on');

			}


			//-->