
	
	//Used to determine when the top navigation has been reset to the current page
	var TrackMouse = "N";

		/*
	Tabs Menu (mouseover)- By Dynamic Drive
	For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
	This credit MUST stay intact for use
	*/
	var submenu = new Array();

	function SetMenus() {
		if (submenu.length) return;

	//Set submenu contents. Expand as needed. For each content, make sure everything exists on ONE LINE. Otherwise, there will be JS errors.
/*
if (ShowBKF == "Y")
	submenu[0] = '<a href="' + BooksBookFair + '">Online Book Fair</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + BooksNewUsed + '">New & Used Textbooks</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + BooksClassics + '">Literary Classics</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + BooksSparkNotes + '">SparkNotes</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + BooksTestPrep + '">Test Prep</a>';
else
*/
	submenu[0] = '<a href="' + BooksNewUsed + '">New & Used Textbooks</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + BooksClassics + '">Literary Classics</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + BooksSparkNotes + '">SparkNotes</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + BooksTestPrep + '">Test Prep</a>';
//alert(submenu[0]);
	submenu[1] = '<a href="' + eContent + '"><i>e</i>Books</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + eProductsHMEStore + '">eBooks from Houghton-Mifflin</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + eProductsMCGStore + '">eBooks from McGraw Hill</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + eProductsTestAssessment + '">Test Assessment</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + eProductsTutoring + '">Tutoring</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + eProductsResearch + '">Research</a>';
//alert(submenu[1]);
	submenu[2] = '<a href="' + FreeResourcesBySubject + '">By Subject</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + FreeResourcesByState + '">By State</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + FreeResourcesGovernmental + '">Governmental</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + FreeResourcesLibraries + '">Libraries</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + FreeResourcesCareer + '">Career</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + FreeResourcesTestPrep + '">Test Prep</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + FreeResourcesReference + '">Reference</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + FreeResourcesNewspapers + '">Newspapers</a>';
//alert(submenu[2]);
	submenu[3] = '<a href="' + SpecialtyStoreSparkNotes + '">SparkNotes</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + SpecialtyStoreTestPrep + '">Test Prep</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + SpecialtyStoreClassics + '">Literary Classics</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + SpecialtyStoreSoftware + '">Software</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + SpecialtyStoreOnlineServices + '">Research/Tutoring</a>';
//alert(submenu[3]);
	submenu[4] = '<a href="">Links</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="">Books</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="">Study Aides</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="">Test Prep</a>';
//alert(submenu[4]);
	submenu[5] = '<a href="' + MembersLogin + '">My STUDYtactics Recommendations</a>';
//alert(submenu[5]);
	submenu[6] = '<a href="' + UpdateMyAccount + '">Update My Account</a>&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + TrackMyOrders + '">Track My Orders</a>';
	if (typeof(MyEContent) != 'undefined' && MyEContent.length)
		submenu[6] += '&nbsp;&nbsp;--&nbsp;&nbsp;<a href="' + MyEContent + '">My eContent</a>';
//alert(submenu[6]);
	submenu[7] = '';
//alert(submenu[7]);

	}

	function getMenuObj() {
		return document.getElementById ? document.getElementById("describe")
			: document.all ? document.all.describe
				: document.layers ? document.dep1.document.dep2 : "";
	}

	function showit(which)
	{
		var arrayindex;

		SetMenus();
		switch (which)
		{
			case "newusedbooks":
			case "B":
			case   "K":
				MM_swapImage('newusedbooks','',ImageLibrary + 'stbooks2tab.gif',1);
				arrayindex = 0;
				break;

			case "eproducts":
			case "E":
				MM_swapImage('eproducts','',ImageLibrary + 'steproducts2tab.gif',1);
				arrayindex = 1;
				break;

			case "freeresources":
			case "F":
				MM_swapImage('freeresources','',ImageLibrary + 'stfreeresources2tab.gif',1);
				arrayindex = 2;
				break;

			case "specialtystores":
			case "S":
				MM_swapImage('specialtystores','',ImageLibrary + 'stspecialtystores2tab.gif',1);
				arrayindex = 3;
				break;

			case "mystudyaides":
			case "M":
				MM_swapImage('mystudyaides','',ImageLibrary + 'stmystudyaides2tab.gif',1);
				arrayindex = 5;
				break;

			case "myaccount-tab":
			case "A":
				MM_swapImage('myaccount-tab','',ImageLibrary + 'stmyaccount2tab.gif',1);
				arrayindex = 6;
				break;

			default :
				arrayindex = 7;
		}

		thecontent = (arrayindex == -1)? "" : submenu[arrayindex]

		var menuobj = getMenuObj();
		if (document.getElementById || document.all)
			menuobj.innerHTML = thecontent
		else if (document.layers)
		{
			menuobj.document.write(thecontent)
			menuobj.document.close()
		}
		TrackMouse = "Y";
	}

	function contains_ns6(a, b)
	{
		while (b.parentNode)
			if ((b = b.parentNode) == a)
				return true;

		return false;
	}

	//Determines coordinates of the mouse to know when to reset the top navigation to the current page
	function trackmouse(e)
	{
		if (!e) var e = window.event;

		var xpos;
		var ypos;
		var text = "Coordinates";
		var switchedback;

		if (document.layers) 
		{
			xpos = e.pageX;
			ypos = e.pageY;
		} 
		else
		{
			xpos = e.clientX;
			ypos = e.clientY;
		}

		text +=  xpos + ',' + ypos;

		//Set Menu back to Current Page if above, below, left or right of all menus
		if (TrackMouse == "Y" && (ypos > (140) || ypos < 50 || xpos > 770)){
			switch (CurrentPage)
			{
				case "B":
				case  "K":
					PageName = 'newusedbooks';
					break;

				case "E":
					PageName = 'eproducts';
					break;

				case "F":
					PageName = 'freeresources';
					break;

				case "S":
					PageName = 'specialtystores';
					break;

				case "M":
					PageName = 'mystudyaides';
					break;

				case "A":
					PageName = 'myaccount-tab';
					break;

				default :
					PageName = '';
			}

			MM_swapImage(PageName,'',ImageLibrary + 'st' + PageName + '2tab.gif',1);
			showit(PageName);
			TrackMouse = "N";
		}
	}

	function checkMenu(){
		if (document.layers)
		{
			document.captureEvents(Event.MOUSEMOVE);
		}

		document.onmousemove = trackmouse;
	}

