function initMapView() {
	
	mapScroller.load();
	
	mapThumb = document.getElementById('mapThumb');
	Drag.init(mapThumb, null, 15, 213, 324, 324);
	
	mapThumbTravel = mapThumb.maxX - mapThumb.minX;
	mapScrollRatio = mapScroller.scrollW / mapThumbTravel;
	
	mapThumb.onDrag = function(x, y) {
		mapScroller.jumpTo(Math.round((x - mapThumb.minX) * mapScrollRatio), null);			
	}
	
	setMapThumb(mapScroller.scrollLeft, mapScroller.scrollTop);

}

function initInfoView() {
	
	infoScroller.load();
	
	infoThumb = document.getElementById('infoThumb');
	Drag.init(infoThumb, null, 419, 419, 37, 109);
	
	infoThumbTravel = infoThumb.maxY - infoThumb.minY;
	infoScrollRatio = infoScroller.scrollH / infoThumbTravel;
	
	infoThumb.onDrag = function(x, y) {
		infoScroller.jumpTo(null, Math.round((y - infoThumb.minY) * infoScrollRatio));			
	}
	
	setInfoThumb(infoScroller.scrollLeft, infoScroller.scrollTop);
	
	if (infoScroller.scrollH > 0) {
		MM_showHideLayers('InfoScrollbar','','show');
	} else {
		MM_showHideLayers('InfoScrollbar','','hide');
	}

}

function initNodeView() {
	
	nodeScroller.load();
	
	nodeThumb = document.getElementById('nodeThumb');
	Drag.init(nodeThumb, null, 419, 419, 37, 109);
	
	nodeThumbTravel = nodeThumb.maxY - nodeThumb.minY;
	nodeScrollRatio = nodeScroller.scrollH / nodeThumbTravel;
	
	nodeThumb.onDrag = function(x, y) {
		nodeScroller.jumpTo(null, Math.round((y - nodeThumb.minY) * nodeScrollRatio));			
	}
	
	setNodeThumb(nodeScroller.scrollLeft, nodeScroller.scrollTop);
	
	if (nodeScroller.scrollH > 0) {
		MM_showHideLayers('NodeScrollbar','','show');
	} else {
		MM_showHideLayers('NodeScrollbar','','hide');
	}

}

function initHelpView() {
	
	helpScroller.load();
	
	helpThumb = document.getElementById('helpThumb');
	Drag.init(helpThumb, null, 227, 227, 15, 310);
	
	helpThumbTravel = helpThumb.maxY - helpThumb.minY;
	helpScrollRatio = helpScroller.scrollH / helpThumbTravel;
	
	helpThumb.onDrag = function(x, y) {
		helpScroller.jumpTo(null, Math.round((y - helpThumb.minY) * helpScrollRatio));			
	}
	
	setHelpThumb(helpScroller.scrollLeft, helpScroller.scrollTop);
	
	if (helpScroller.scrollH > 0) {
		MM_showHideLayers('HelpScrollbar','','show');
	} else {
		MM_showHideLayers('HelpScrollbar','','hide');
	}

}

function setHelpThumb(scrollLeft, scrollTop) {

	var y;
	
	if (helpScrollRatio > 0) {
		y = 15 + Math.round(scrollTop / helpScrollRatio);
	} else {
		y = 0;
	}

	if (helpThumb.style.pixelTop) {
		helpThumb.style.pixelTop = y;
	} else {
		helpThumb.style.top = y + 'px';
	}

}

function helpTrackClick(e) {

	if (e) {
	
		if (e.offsetY) {
			y = Math.round((e.offsetY - 7) * helpScrollRatio)
		} else if (e.layerY) {
			y = Math.round((e.layerY - 7) * helpScrollRatio)
		}
		
		helpScroller.jumpTo(null, y);
		setHelpThumb(helpScroller.scrollLeft, helpScroller.scrollTop);
	
	}

}

function setMapThumb(scrollLeft, scrollTop) {

	var x;
	
	if (mapScrollRatio > 0) {
		x = 15 + Math.round(scrollLeft / mapScrollRatio);
	} else {
		x = 0;
	}

	if (mapThumb.style.pixelLeft) {
		mapThumb.style.pixelLeft = x;
	} else {
		mapThumb.style.left = x + 'px';
	}

}

function mapTrackClick(e) {

	if (e) {
	
		if (e.offsetX) {
			x = Math.round((e.offsetX - 7) * mapScrollRatio)
		} else if (e.layerX) {
			x = Math.round((e.layerX - 7) * mapScrollRatio)
		}
		
		mapScroller.jumpTo(x, null);
		setMapThumb(mapScroller.scrollLeft, mapScroller.scrollTop);		
	
	}

}

function setInfoThumb(scrollLeft, scrollTop) {

	var y;
	
	if (infoScrollRatio > 0) {
		y = 37 + Math.round(scrollTop / infoScrollRatio);
	} else {
		y = 0;
	}

	if (infoThumb.style.pixelTop) {
		infoThumb.style.pixelTop = y;
	} else {
		infoThumb.style.top = y + 'px';
	}
	
}

function infoTrackClick(e) {

	if (e) {
	
		if (e.offsetY) {
			y = Math.round((e.offsetY - 7) * infoScrollRatio)
		} else if (e.layerY) {
			y = Math.round((e.layerY - 7) * infoScrollRatio) - 7
		}
		
		infoScroller.jumpTo(null, y);
		setInfoThumb(infoScroller.scrollLeft, infoScroller.scrollTop);		
	
	}

}

function setNodeThumb(scrollLeft, scrollTop) {

	var y;
	
	if (nodeScrollRatio > 0) {
		y = 37 + Math.round(scrollTop / nodeScrollRatio);
	} else {
		y = 0;
	}

	if (nodeThumb.style.pixelTop) {
		nodeThumb.style.pixelTop = y;
	} else {
		nodeThumb.style.top = y + 'px';
	}

}

function nodeTrackClick(e) {

	if (e) {
	
		if (e.offsetY) {
			y = Math.round((e.offsetY - 7) * nodeScrollRatio)
		} else if (e.layerY) {
			y = Math.round((e.layerY - 7) * nodeScrollRatio)
		}
		
		nodeScroller.jumpTo(null, y);
		setNodeThumb(nodeScroller.scrollLeft, nodeScroller.scrollTop);		
	
	}

}

