	
	//	-------------------------------------------------
	//	These scripts manage the cookie that tracks  
	//	the account focus.
	//	-------------------------------------------------

	function createFocusCookie()
	// This function is currently used in the banner, and 
	// it creates the account-focus cookie when first 
	// entering the demo site.  For testing convenience, 
	// the cookie can be re-created/re-set by explicitly 
	// refreshing the banner frame.
	{
	    var the_account = "account1";
	    var the_cookie = "wm_javascript=" + escape("accountfocus:" + the_account);
	    document.cookie = the_cookie;
	}
	
	function changeFocusCookie(newfocus)
	// This function gets called by all links 
	// that leave a page-with-focus.  While not 
	// needed for forward navigation from these
	// links, this extra step ensures that the 
	// focus cookie is set properly in the case 
	// that the user backed into the current 
	// page with a different focus.
	{
	    var the_account = newfocus;
	    var the_cookie = "wm_javascript=" + escape("accountfocus:" + the_account);
	    document.cookie = the_cookie;
	}
	
	function navigateFromOverviewList()
	// This function is used by the account-focus 
	// drop-down list that appears on the Account 
	// Overview pages.
	{
		// Find out what account is selected
		var choice1 = document.accountfocus.accountlist.options[0].selected;
		var choice2 = document.accountfocus.accountlist.options[1].selected;
		var choice3 = document.accountfocus.accountlist.options[2].selected;
		var choice4 = document.accountfocus.accountlist.options[3].selected;
		// Change the focus-cookie to reflect the selection, 
		// and then navigate accordingly.
		if (choice1 == true) 
		{
			changeFocusCookie("account1");
			parent.main.window.location="account_overview_1.html";
			return;
		}
		if (choice2 == true) 
		{
			changeFocusCookie("account2");
			parent.main.window.location="account_overview_2.html";
			return;
		}
		if (choice3 == true) 
		{
			changeFocusCookie("account3");
			parent.main.window.location="account_overview_3.html";
			return;
		}
		if (choice4 == true) 
		{
			changeFocusCookie("account4");
			parent.main.window.location="account_overview_4.html";
			return;
		}
	}
	
	function navigateFromActivityList()
	// This function is used by the account-focus 
	// drop-down list that appears on the Transactions 
	// by Date pages.
	{
		// Find out what account is selected
		var choice1 = document.accountfocus.accountlist.options[0].selected;
		var choice2 = document.accountfocus.accountlist.options[1].selected;
		var choice3 = document.accountfocus.accountlist.options[2].selected;
		var choice4 = document.accountfocus.accountlist.options[3].selected;
		// Change the focus-cookie to reflect the selection, 
		// and then navigate accordingly.
		if (choice1 == true) 
		{
			changeFocusCookie("account1");
			parent.main.window.location="transactions_by_date_1.html";
			return;
		}
		if (choice2 == true) 
		{
			changeFocusCookie("account2");
			parent.main.window.location="transactions_by_date_2.html";
			return;
		}
		if (choice3 == true) 
		{
			changeFocusCookie("account3");
			parent.main.window.location="page_not_available.html";
			return;
		}
		if (choice4 == true) 
		{
			changeFocusCookie("account4");
			parent.main.window.location="page_not_available.html";
			return;
		}
	}
	
	//	-------------------------------------------------
	//	These scripts are cookie-related scripts that I  
	//	no longer use but I haven't deleted yet in case 
	//	I need them. 
	//	-------------------------------------------------
	
	function readFocusCookie()
	// This script isn't currently used.  It is useful 
	// for debugging.
	{
		var the_cookie = document.cookie;
		var the_cookie = unescape(the_cookie);
		var broken_cookie = the_cookie.split(":");
		var the_account = broken_cookie[1];
		alert("The current account focus is: " + the_account);
	}
	
	function navigateToAcctMenuWithFocus()
	// This script isn't currently used.  YES IT IS!
	{
		// Set a default choice in case cookies are disabled.
		var the_account = "account1";
		// Read the focus cookie.
		if (document.cookie)  {
			var the_cookie = document.cookie;
			var the_cookie = unescape(the_cookie);
			var broken_cookie = the_cookie.split(":");
			the_account = broken_cookie[1];
		}
		// Then navigate accordingly
		if (the_account == "account1")
		{parent.main.window.location="account_overview_1.html";}
		if (the_account == "account2")
		{parent.main.window.location="account_overview_2.html";}
		if (the_account == "account3")
		{parent.main.window.location="account_overview_3.html";}
		if (the_account == "account4")
		{parent.main.window.location="account_overview_4.html";}
		return;
	}
	
	function navigateToActivityWithFocus()
	// This script isn't currently used.
	{
		// Read the focus cookie
		var the_cookie = document.cookie;
		var the_cookie = unescape(the_cookie);
		var broken_cookie = the_cookie.split(":");
		var the_account = broken_cookie[1];
		// Then navigate accordingly
		if (the_account == "account1")
		{parent.main.window.location="transactions_by_date_1.html";}
		if (the_account == "account2")
		{parent.main.window.location="transactions_by_date_2.html";}
		if (the_account == "account3")
		{parent.main.window.location="page_not_available.html";}
		if (the_account == "account4")
		{parent.main.window.location="page_not_available.html";}
		return;
	}
	
	function navigateToTransferWithFromFocus()
	{
		// This script isn't currently used.
		var the_cookie = document.cookie;
		var the_cookie = unescape(the_cookie);
		var broken_cookie = the_cookie.split(":");
		var the_account = broken_cookie[1];
		// Then navigate accordingly
		if (the_account == "account1")
		{parent.main.window.location="transfer_funds_enter_1.html";}
		if (the_account == "account2")
		{parent.main.window.location="page_not_available.html";}
		if (the_account == "account3")
		{parent.main.window.location="page_not_available.html";}
		// This last line is not needed because, in the demo 
		// account4 is a line of credit and can't be transferred to.
		if (the_account == "account4")
		{parent.main.window.location="page_not_available.html";}
		return;
	}
	
	//	-------------------------------------------------
	//	These scripts let me have a lot of dead links  
	//	point to the same "not available" page, without 
	//	having the first visit change the link highlighting
	//	for all. 
	//	-------------------------------------------------
	function notavailable()
	{
		// parent.main.window.location="page_not_available.html";
		parent.window.location="page_not_available.html";
	}
		
	function notavailableoutside()
	{
	window.open("page_not_available_outside.html", "window_2","toolbar,scrollbars,resizable,width=500,height=325");
	}
	
	// Not used.  Had been called by the onload event in the BODY tag.
	function gotodesiredlink()
	{
	var desiredlink = document.links[13];
  		if (desiredlink.focus)
    	desiredlink.focus();
	}