		var filename = "";
		var browserHeight = 0, browserWidth = 0, flashHeight, flashWidth;
		var so;
		var percent = true;
		
		
		//Stat counter variables
		
		
		//The menu system is contained in two arrays.  The first array, 'menuTree,' is accessed by nosTree.htm.  menuTree is located in 
		//tree_nodes.js due to an issue with Internet Explorer.  It contains javascript links
		//that call parent.right (this file) to change the right frame to the desired item.  Because the menu system is implemented in javascript,
		//and the links it contains are javascript links, a parameter problem arises.  the links cannot contain quoted parameters (strings, for 		
		//example).As a result, the javascript links contain a function call to changeURL, which accepts an integer parameter.  This parameter is
		//used to access an array containing the neccessary string for the desired file.  changeURL then changes the flash video on the right 			
		//frame.  This array is called locationStrings.
		
		var locationStrings;
		
		initLocations();
		
		function initLocations()
		{
			locationStrings = new Array();

			// Visual C++ videos

			locationStrings[0] = "CPP/addingPanels.swf";
			locationStrings[1] = "CPP/adingObjects.swf";
			locationStrings[2] = "CPP/Debugging.swf";
			locationStrings[3] = "CPP/divideByZero.swf";
			locationStrings[4] = "CPP/HelloWorldCPP.swf";
			locationStrings[5] = "CPP/intVsRealCPP.swf";
			locationStrings[6] = "CPP/missingBracket.swf";
			locationStrings[7] = "CPP/missingSemicolon.swf";
			locationStrings[8] = "CPP/pictureBox.swf";
			locationStrings[9] = "CPP/RemovingEventHandlers.swf";
			locationStrings[10] = "CPP/walkthrough.swf";
			locationStrings[11] = "CPP/WindowLayoutDemo.swf";
			locationStrings[12] = "CPP/ch3pt1FormLoad.swf";
			locationStrings[13] = "CPP/ch3pt2Button.swf";
			locationStrings[14] = "CPP/ch4/calculate.swf";
			locationStrings[15] = "CPP/ch4/formLoad.swf";
			locationStrings[16] = "CPP/ch5/buttonEvents.swf";
			locationStrings[17] = "CPP/ch5/ClassInstanceVars.swf";
			locationStrings[18] = "CPP/ch5/design.swf";
			locationStrings[19] = "CPP/ch5/formLoad.swf";
			locationStrings[20] = "CPP/ch5/timerEvent1.swf";
			locationStrings[21] = "CPP/ch6/ch6Overview.swf";
			locationStrings[22] = "CPP/ch7/overview.swf";
			locationStrings[23] = "CPP/ch8/overview.swf";	
			locationStrings[24] = "CPP/ch9/overview.swf";
			locationStrings[25] = "CPP/ch10/code.swf";
			locationStrings[26] = "CPP/ch10/finished.swf";
			locationStrings[27] = "CPP/ch10/onYourOwn.swf";
			locationStrings[28] = "CPP/ch11/overview.swf";
			locationStrings[29] = "CPP/ch6/qualityControl.swf";
			locationStrings[30] = "CPP/intro/SettingUpVS.swf";
			
			//Visual Basic Videos
			
			locationStrings[100] = "VB/addingObjects.swf";
			locationStrings[101] = "VB/addingPanels.swf";
			locationStrings[102] = "VB/Debugging.swf";
			locationStrings[103] = "VB/divideByZero.swf";
			locationStrings[104] = "VB/HelloWorldVisualBasic.swf";
			locationStrings[105] = "VB/intVsRealDivision.swf";
			locationStrings[106] = "VB/networkStorage.swf";
			locationStrings[107] = "VB/pictureBox.swf";
			locationStrings[108] = "VB/RemovingEventHandlers.swf";
			locationStrings[109] = "VB/Saving.swf";
			locationStrings[110] = "VB/SettingWindowLayout.swf";
			locationStrings[111] = "VB/SyntaxError1.swf";
			locationStrings[112] = "VB/VSLabComputers.swf";
			locationStrings[113] = "VB/walkthrough.swf";
			locationStrings[114] = "VB/WindowLayout.swf";
			locationStrings[115] = "VB/ch5/overview.swf";
			locationStrings[116] = "VB/ch7/overview.swf";
			locationStrings[117] = "VB/ch5/CHUMP.swf";
			locationStrings[118] = "VB/ch3overview.swf";
			locationStrings[119] = "VB/VacationPlanner(ch4).swf";
			locationStrings[120] = "VB/FunctionPlotter.swf";
			locationStrings[121] = "VB/VerticalBarChart.swf";
			locationStrings[122] = "VB/FilmInventorySearch.swf";
			locationStrings[123] = "VB/RecursiveBranches.swf";
			locationStrings[124] = "VB/Walkthrough/WalkthroughVB_demo_skin.swf";
		}
	
		
		function alertSize() 
		{ //This function gets the size of the window
			  if( typeof( window.innerWidth ) == 'number' ) 
			  {
				//Non-IE
				browserWidth = window.innerWidth;
				browserHeight = window.innerHeight;
			  } 
			  else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
			  {
				//IE 6+ in 'standards compliant mode'
				browserWidth = document.documentElement.clientWidth;
				browserHeight = document.documentElement.clientHeight;
			  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
				//IE 4 compatible
				browserWidth = document.body.clientWidth;
				browserHeight = document.body.clientHeight;
			  }
		}

		function calcDimensions()
		{ //this function's purpose is to scale the flash video so that there is no scrolling
		
			//notes:  most, if not all of the flash files are 883px (wide) x 615px (high)
			//This function should limit the dimensions to be within 1/2 of the original dimensions to the original dimensions
			
			
			//determine if the size should be set by percent or by pixels
			
			//Percent allows the flash video to be resized in real time.  However, there are no limits as to how big or small the video can be
			if (percent == true)
			{
				flashHeight = "85%";
				flashWidth = "100%";
			}
			
			//Pixel based allows the video to be forced within a set of dimension limits.  However, the resizing does not take effect until the video is reloaded
			else
			{
				//if the available space is greater than needed
				if (browserHeight > 615 && browserWidth > 883)
				{
					flashHeight = 615;
					flashWidth = 883;
					
				}
				
				//if the browser height is enough, but the width is not
				else if (browserHeight > 615)
				{
					var multiplier = (browserWidth / 883);
					
					flashWidth = browserWidth;
					flashHeight = parseInt(browserHeight * multiplier);
				}
				
				//if the browser width is enough, but the height is not
				else if (browserWidth > 883)
				{
					var multiplier = (browserHeight / 615);
					
					flashHeight = browserHeight;
					flashWidth = parseInt(browserWidth * multiplier);
				}
				
				//if neither the browser height nor the width are enough
				else
				{
					var multW, multH;
					
					//determine the ratios of available dimensions vs flash dimensions
					multW = browserWidth / 883;
					multH = browserHeight / 615;
					
					//multiply flash dimensions by the smaller ratio
					if ( multW < multH)
					{
						flashHeight = parseInt(multW * 615);
						flashWidth = parseInt(multW * 883);
					}
					
					else
					{
						flashHeight = parseInt(multH * 615);
						flashWidth = parseInt(multH * 883);
					}
				}
				
				if (flashHeight < 307 || flashWidth < 441)
				{
					flashHeight = 307;
					flashWidth = 441;
				}
			}	
		}
		
		function modPercent()
		{
			percent = !percent;
			viewMode();
		}
		
		function sizeAlert()
		{//this function prints a message stating the width and height of the browser window
			window.alert( 'Width = ' + browserWidth );
			window.alert( 'Height = ' + browserHeight );
		}
		
		function modify()
		{//this function builds function call to SWFObject
			so = new SWFObject(filename, "Captivate1", flashWidth, flashHeight, "7", "#FFFFFF");
			so.addParam("movie", filename);
			so.write("flashcontent");
		}
		
		function open(swfFile)
		{	
			rewriteFlashContent("This video requires the latest version of flash to display properly.");
			filename = swfFile;
			alertSize();
			calcDimensions();
			modify();
		}
		
		function changeURL(index)
		{
			trackURL(locationStrings[index]);
			open(locationStrings[index]);
			writeTitle(getTitle(index));
			
		}
		
		function mainPage()
		{
			writeTitle("");
			var text = "<h2>Welcome to the <b>Visual C++</b> and <b>Visual Basic</b> Tutorial Page.</h2><h4>On the left side of the page is the menu system.  It is organized into 3 main catagories:<br/><br/><ul><li><b>Visual C++</b> contains all of the tutorials for CS-1511<br/><li><b>Visual Basic</b> contains all of the tutorials for CS-1121<br/><li><b>Other Links</b> contains various links to Dr. Allerts homepage, the UMD website, etc...</ul></h4><h2>About The Tutorials</h2><h4>The tutorials on this site are all flash animations.  If you cannot view any videos, you probably need to install the flash plugin.<br/><br/>These tutorials show projects being created in Visual Studio.  Most videos have a control bar at the bottom of the screen that allows you to pause, rewind, fastforward, etc. through the video to your liking.<br/><br/>The tutorials take up a lot of bandwidth.  If you have a slower internet connection, they may take a while to load. </h4>";
			
			rewriteFlashContent(text);
		}
		
		function about()
		{
		
			writeTitle("About This Page");
			var text = "<h1>About this Website</h1><br/><h4>This website was created for The University of Minnesota Duluth.<br/>It is designed to accompany two of Dr. Allert\'s classes: Computer Science 1 (CS1511)<br/>and Visual Basic (CS1121).<br/><br/>The Tutorials Were designed using Adobe Captivate 2.  The Videos are compatible with Adobe<br/>Flash Player 8 and later.<br/><br/>This website and accompanying tutorials were created by Scot Halverson<br/></h4>";
			rewriteFlashContent(text);
		}
		
		function viewMode()
		{
			writeTitle("Change The View Mode");
			var text = "<h1>This toggles the tutorial video display method.</h1><h4><br/><br/>There are two display methods:<br/><br/><b>By Percentage:</b> This is the default.  Videos display using a percentage of the browser window.  This means that if you resize the browser window, the video will change size as well.<br/><br/><b>By Hard Coded Value:</b> This displays videos using the dimensions they were created in.  That means that they will likely look a little better, but they may take up a larger area than the browser window.  If this is the case, scroll bars will be used.<br/><br/>Clicking the <b>Change View Mode</b> link toggles between the two methods.</h4>  <br/><br/><h1>Currently, videos will be displayed by <b>";
			
			if (percent)
			text = text + "Percent</b></h1>";
			else
			text = text + "Hard Coded Value</b></h1>";
			
			
			rewriteFlashContent(text);
		}
		
		function rewriteFlashContent(text)
		{
			document.getElementById('flashcontent').innerHTML = text;
		}
		
		function writeTitle(title)
		{
			document.getElementById('currentTitle').innerHTML = title;
		}
		
		function getTitle(index)
		{
			title = "";
			
			urlString = "javascript:changeURL(" + index + ")";
			
			for (a = 0; a < NTrees.Tree.Nodes.length - 1; a = a+1)
			{
				if (NTrees.Tree.Nodes[a].url == urlString)
					{return NTrees.Tree.Nodes[a].parentNode.text + " - " + NTrees.Tree.Nodes[a].text;}
			}
		}