	window.focus();
	window.offscreenbuffering=true;
	theBrowserName = navigator.appName;
	theBrowserVersion = parseFloat(navigator.appVersion);

	if ((theBrowserName == "Netscape") && (theBrowserVersion >=3.0)) {
		theBrowser = "NS";
	}
	else if ((theBrowserName == "Microsoft Internet Explorer") && (theBrowserVersion >=3.0)) {
		theBrowser = "IE";
	}
	else {
		theBrowser = "";
		alert("For best results, you should be using Netscape 3, Microsoft Internet Explorer 3, or higher");
	}


	function winOpen (theMovie, theMovieName,theNSWidth,theNSHeight,theIEWidth,theIEHeight) {
		if (theBrowser == "NS") {
			paramString = "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,hotkeys=no,resizable=no,copyhistory=no,width=" + theNSWidth + ",height=" + theNSHeight + ",screenX=0,screenY=0";
			}
		else if (theBrowser == "IE") {
			paramString = "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,hotkeys=no,resizable=no,copyhistory=no,width=" + theIEWidth + ",height=" + theIEHeight + ",screenX=0,screenY=0";
		}
		window.open(theMovie,theMovieName,paramString);
		window.focus();
	}

	
	function shockDownLoad (theURL, theWindowName) {
		paramString = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,hotkeys=no,resizable=yes,copyhistory=no,width=600,height=450,screenX=0,screenY=0";
		shockwin = window.open(theURL,theWindowName,paramString);
		shockwin.focus();
	}


	function Finished() {
		setTimeout('StopMovie()',1000);
		setTimeout('CloseMe()',2000);
	}

	

	function TestScore(theScore) {
		//alert(theScore);
		//add database update later
	}


	function StopMovie(){
		if (theBrowser == "NS"){
                 	document.CurrentMovie.Stop();
		}
		if (theBrowser == "IE") {
			CurrentMovie.Stop();
		}
         }
	

	function CloseMe() {
		window.close();
	}


	function processclick(sitem) {
		myselecteditem = new String(sitem);
		if (myselecteditem.length == 1) {
			strprefix = new String("00");
			pagenum = strprefix.concat(myselecteditem);
		}
		else if (myselecteditem.length == 2) {
			strprefix = new String("0");
			pagenum = strprefix.concat(myselecteditem);
		}
		else if (myselecteditem.length == 3) {
			pagenum = myselecteditem;
		}
		
		checkloc = new String(window.location);
		if (checkloc.lastIndexOf("#") == (checkloc.length - 1)) {
			myloc = checkloc.slice(0,(checkloc.length - 1));
		}
		else {
			myloc = checkloc;
		}
		slashloc = myloc.lastIndexOf("/");
		pagenameprefix = myloc.slice((slashloc + 1),((myloc.length) - 7));
		pagenamesuffix = myloc.slice((slashloc + 11),myloc.length);
		pagename = (pagenameprefix.concat(pagenum)).concat(pagenamesuffix);
		window.location = pagename;
	}


	function winOpenHelp () {
		//paramString = "toolbar=no,location=no,directories=no,status=no,statusbar=no,menubar=no,scrollbars=yes,hotkeys=no,resizable=no,copyhistory=yes,width=500,height=400,screenX=0,screenY=0";
		//helpwin = window.open("../../pgcommon/lessonhelp.htm","Help",paramString);
		//helpwin.focus();
		paramString = "toolbar=no,location=no,directories=no,status=no,statusbar=no,menubar=no,scrollbars=no,hotkeys=no,resizable=no,copyhistory=yes,width=640,height=580,screenX=0,screenY=0";
		helpwin = window.open("../../pgcommon/lesshelp.htm","Help",paramString);
		helpwin.focus();
	}


	function winOpenGlossary (theGlossaryName) {
		paramString = "toolbar=no,location=no,directories=no,status=no,statusbar=no,menubar=no,scrollbars=yes,hotkeys=no,resizable=no,copyhistory=yes,width=500,height=400,screenX=0,screenY=0";
		glossarywin = window.open(theGlossaryName,"Glossary",paramString);
		glossarywin.focus();
	}


	function winOpenMain (theURL) {
		paramString = "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,hotkeys=no,resizable=no,copyhistory=yes,width=600,height=400,screenX=0,screenY=0";
		if (theBrowser == "NS") {
			mainwin = window.open(theURL,"Main",paramString);
			mainwin.focus();		}
		else if (theBrowser == "IE") {
			if (typeof(mainwin) != "undefined") {
				mainwin.close();
			}
			mainwin = window.open(theURL,"Main",paramString);
			mainwin.focus();		
		}
	}


	function verifypassword (theusername,thepassword,theURL) {
		if ((theusername == "whales") && (thepassword == "enter")) {
			window.location = theURL;
		}
		else {
			alert("Sorry, this user is not authorized!");
		}
	}


	function closeMain () {
		window.close();
	}


	function mouseOverMe(theSRC, theHREF, theFlashMovie) {
		document.images[theSRC].src = theHREF;
		if (theBrowser == "NS"){
			eval("document." + theFlashMovie + ".GotoFrame(1)");
			eval("document." + theFlashMovie + ".Play()");
		}

		if (theBrowser == "IE") {
			eval(theFlashMovie + ".GotoFrame(1)");
			eval(theFlashMovie + ".Play()");
		}		
	}

	
	function mouseOutImage(theSRC, theHREF) {
		document.images[theSRC].src = theHREF;
	}

	
	function winOpenLessonInfo (theLessonInfoName) {
		paramString = "toolbar=no,location=no,directories=no,status=no,statusbar=no,menubar=yes,scrollbars=yes,hotkeys=no,resizable=no,copyhistory=yes,width=620,height=495,screenX=0,screenY=0";
		lessoninfowin = window.open(theLessonInfoName,"LessonPlan",paramString);
		lessoninfowin.focus();
	}


	function preloadTitleBarButtons () {
		var titleBarButtons = new Array('../grcommon/but_back_.gif','../grcommon/but_start_.gif','../grcommon/but_forward_.gif','../grcommon/but_help_.gif','../grcommon/but_exit_.gif');
		preloadImages(titleBarButtons);
	}


	function preloadMenuBarButtons () {
		var menuBarButtons = new Array('../grcommon/but_start_.gif','../grcommon/but_help_.gif','../grcommon/but_exit_.gif','../grcommon/menu_top_.gif');
		preloadImages(menuBarButtons);
	}

	
	function preloadStartButtons () {
		var startButtons = new Array('../grcommon/start_menu_.gif','../grcommon/start_activity_.gif','../grcommon/start_test_.gif','../grcommon/start_info_.gif','../grcommon/start_exit_.gif');
		preloadImages(startButtons);
	}


	function preloadImages (myImagesArray) {
		for (i=0; i < myImagesArray.length; i++) {
   			var currentImage = new Image();
			currentImage.src = myImagesArray[i];
		}
	}

	
	function getCurrentPageName (myURL) {
		var myURLString = String(myURL);
		var firstChar = ((myURLString.lastIndexOf("/")) + 1);
		var lastChar = ((myURLString.length) - 4); // remove extension
		var pageName = myURLString.slice(firstChar,lastChar);
		
		return pageName;
	}

	
	function getLessonFile (currentPageName) {
		var lastChar = (currentPageName.lastIndexOf("_"));
		var lessonFile = currentPageName.slice(0,lastChar);
		
		return lessonFile;
	}


	function StartButton_DoFSCommand (command, arg) {
		if (command == "buttonaction") {
			var myPage = getCurrentPageName (window.location);
			var myLessonFile = getLessonFile (myPage);
			if (arg == "menu") {
				var newPage = myLessonFile + "_menu.htm";
				var windowCall = "window.location='" + newPage + "'";
				setTimeout(windowCall,1000);
			}
			if (arg == "instruction") {
				var newPage = "movies/" + myLessonFile + ".htm";
				var newPageName = myLessonFile;
				var windowCall = "winOpen('" + newPage + "','" + newPageName + "',640,480,640,480)";
				setTimeout(windowCall,1000);
			}
			if (arg == "activity") {
				var newPage = "movies/" + myLessonFile + "_a001.htm";
				var newPageName = myLessonFile + "_a001";
				var windowCall = "winOpen('" + newPage + "','" + newPageName + "',640,480,640,480)";
				setTimeout(windowCall,1000);
			}
			if (arg == "test") {
				var newPage = "movies/" + myLessonFile + "_t001.htm";
				var newPageName = myLessonFile + "_t001";
				var windowCall = "winOpen('" + newPage + "','" + newPageName + "',640,480,640,480)";
				setTimeout(windowCall,1000);
			}
			if (arg == "info") {
				var newPage = myLessonFile + "_lessoninfo.htm";
				var windowCall = "winOpenLessonInfo('" + newPage + "')"; 
				setTimeout(windowCall,1000);
			}
			if (arg == "exit") {
				window.close();
			}	
			if (arg == "start") {
			
			}		
		}
	}

	function LessonHelp_DoFSCommand (command, arg) {
		if (arg == "exit") {
			window.close();	
		}
	}