var SELECTED_COLOR = "#C6332D";var NORMAL_COLOR = "#666";var prgsMtr = {	maxwidth : 100,	minwidth : 10,	maxcount : 3,	current : 0};prgsMtr.segwidth = (prgsMtr.maxwidth - prgsMtr.minwidth) / prgsMtr.maxcount;function load() {	prgsMtr.current ++;	try {		var mtr = new make("progressmeter");		var newW = prgsMtr.current * prgsMtr.segwidth + prgsMtr.minwidth;		mtr.setW(Math.min(newW, prgsMtr.maxwidth));	} catch (e) {		return;	}};var imgsldr;function initSldr() {	try {		var ldr = new make("loader");		ldr.setCSS('display', 'none');		imgsldr = new make("imgcontent");		imgsldr.setCSS('display', 'block');		imgmnu = new make("imgmenu");		imgmnu.setCSS('display', 'block');				imgsldr.x = 0;		img = new Array();		img[1] = new make("img1");		img[2] = new make("img2");		img[3] = new make("img3");						imgsldr.jumpTo = function(num) {			try {				//alert("num: " + num + " x:" + img[num].x + " y:" + img[num].y);				imgsldr.timeSlide(0-img[num].x, 0, 1000, -1);					for(var x = 1; x < 4; x++) {						var lnk_el = new make("imglnk" + x);						if(x == num) {							lnk_el.setCSS('color', SELECTED_COLOR);						} else {							lnk_el.setCSS('color', NORMAL_COLOR);						}					}			} catch (e) {				return;			}		};	} catch (e) {		return;	}};// Thank you 13thparallel.org and youngpup.net !// modified script so that other scrolling methods besides dragging were possible. // All functions move the scroller widget which then governs the amount of content scroll// AT - 2004.01.14 - Added clickScroll to support clicking on the scroll track//We wrap all the code in an object so that it doesn't interfere with any other codevar scroller = {  init : function() {	try {			scroller.doc = new make("textcontent");		scroller.docH = scroller.doc.getH();		scroller.cont = new make("textcontainer");			scroller.contH = scroller.cont.getH();				if(scroller.docH <= scroller.contH) return; // dont need scroller		scroller.scrollBar = new make("scrollbar");			scroller.scrollArea = new make("scrollarea");			scroller.scrollAreaH = scroller.scrollArea.getH();		scroller.widget = new make("scroller");		    			//calculate height of scroller and resize the scroller div		    	//(however, we make sure that it isn't to small for long pages)    			scroller.scrollH = (scroller.contH * scroller.scrollAreaH) / scroller.docH;    			if(scroller.scrollH < 15) scroller.scrollH = 15;   		 	scroller.widget.setH(Math.round(scroller.scrollH));   	     			//what is the effective scroll distance once the scoller's height has been taken into account			scroller.scrollDist = Math.round(scroller.scrollAreaH-scroller.scrollH);   	    			//make the scroller div draggable			Drag.init(scroller.widget.elm,null,0,0,-1,scroller.scrollDist); //dom-drag from youngpup.net   			scroller.doc.moveTo(null, 0); // set y to 0			if (window.event) document.onmousewheel = function() {				scroller.scrollBy(event.wheelDelta / -30);				return false;			};			//add ondrag function    			scroller.widget.elm.onDrag = function (x,y) {   				scroller.scroll();    			};    			//add click function to track    			scroller.scrollArea.elm.onclick = scroller.clickScroll;    			scroller.scrollArea.setCSS('cursor', 'pointer');    			    			scroller.scrollBar.show();    		} catch (e) {    			return;    		}  },   scrollTo : function (y) {	var mv = scroller.checkDist(y);  	scroller.widget.moveTo(null, mv);	scroller.scroll();  },   scrollBy : function (y) {	var scrollY = parseInt(scroller.widget.css.top);	var mv = scroller.checkDist(scrollY + y);	  	scroller.widget.moveTo(null, mv);	scroller.scroll();  },  speed : 10,  dir : 0,  time : 30,  start : function(dir) {  	scroller.dir = dir;	document.onmouseup = scroller.stop;	scroller.scrollCont(dir);  },	   stop : function() {	scroller.dir = 0;  },	  scrollCont : function() {  	var scrollY = parseInt(scroller.widget.css.top);	if(!scrollY) scrollY = 0;  	var mv = 0;  	if(scroller.dir > 0) {  		// scroll forward (down)  		mv = scroller.checkDist(scrollY - scroller.speed);  	} else if(scroller.dir < 0) {  		// scroll back (up)		mv = scroller.checkDist(scrollY + scroller.speed);	}	if(!scroller.dir == 0) {	  	scroller.widget.moveTo(null, mv);		scroller.scroll();	  	setTimeout("scroller.scrollCont()",scroller.time);	}  },  scroll : function() {	var scrollY = parseInt(scroller.widget.css.top);	var docY = Math.round(0 - (scrollY * (scroller.docH - scroller.contH) / scroller.scrollDist));	scroller.doc.moveTo(0, docY);	scroller.onScroll(scrollY);  },  onScroll : function(y) {  	// can be overridden for event linking  },    checkDist : function(y) {  	// make sure the scroller widget doesn't get moved to a spot outside of the track  	m = Math.max(0, y);	m = Math.min(m, scroller.scrollDist);	return m;  },  	getMouseY : function(e) {		if (typeof e == 'undefined') e = window.event;		return e.clientY ? e.clientY : e.pageY;	},		clickScroll : function(e) {		var mY = scroller.getMouseY(e);		var top = scroller.widget.getPageY();		var bot = top + scroller.widget.getH();		if((mY >= top) && (mY <= bot)) {			// Clicked within the scroll widget area ignore			return;		} else {			// if clicked below bring the bottom of the scroll widget to Y, 			//	if above the top of the scroll widget.						scroller.scrollBy(mY - ((mY > bot) ? bot : top));		}	}};function scrollToStoryY(id) {	story = new make(id);	if(story != null) {		var docY = parseInt(story.y);      	var scrollY = Math.round(0 - (docY * (scroller.scrollDist / (scroller.contH - scroller.docH))));      	// need to slide doc too      	scroller.widget.onMove = function(x, y) {			scroller.scroll();		};				// reset onmove event		scroller.widget.onSlideEnd = function(x, y) {			scroller.widget.onMove = new Function();		};				//start the slide  	  	scroller.widget.timeSlide(0, scrollY, 500, -1);	}};function doPMAnim(id) {	try{		var projMnuAnim = new make("projmnuanim");		var l = new make(id);		if(l != null) {						var o = projMnuAnim;			//o.onSlideEnd = function(X, y) {			//	o.show();				//};			//projMnuAnim.timeSlide(l.getPageX() + doPMAnim.MODX , l.getPageY() + doPMAnim.MODY, 100, -1);			projMnuAnim.moveTo(l.getPageX() + doPMAnim.MODX , l.getPageY() + doPMAnim.MODY);			projMnuAnim.show();			// in case project list 'worm' exists on a page with a scroller, this will ensure the 'worm'			// stays with the project name when scrolled			if(scroller) {				scroller.onScroll = function(y) {					o.hide();				};			}		}	} catch (e) {		return;	}};doPMAnim.MODX = -12;doPMAnim.MODY = 3;function init() {	try {		scroller.init();		initSldr();		if(scrollToStory) scrollToStoryY(storyID);	} catch (e) {		return;	}};FastInit.addOnLoad(init);