// JavaScript Document

// Date functions
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Original:  Andy Angrick/Mike Barone -->
<!-- Web Site:  http://www.cgiscript.net/datetoday.htm -->
<!-- Begin

// Calculate four digit year.
function fourdigits(number)	{
	return (number < 1000) ? number + 1900 : number;
							}
function TodaysDate() {
// Get today's current date.
var now = new Date();

// Array list of days.
var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');

// Array list of months.
var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');

// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

// Join it all together
today =  days[now.getDay()] + ", " +
              months[now.getMonth()] + " " +
               date + ", " +
                (fourdigits(now.getYear())) ;

// Print out the data.
document.write("" +today);
}
//  End -->

/************************* OTHER FUNCTIONS ****************************/

// other date functions
function numDate()
{
	var now = new Date();
	var day = now.getDate();
	var month = (now.getMonth() + 1);
	var year = now.getYear();

	if (day<10)
		day = "0" + day;
	if (month<10)
		month = "0" + month;
	if (year < 1000) year += 1900;

	document.write(month + "/" + day + "/" + year);
}

function DaysAgo(numDays)
{
	var now = new Date();

	var setDateBack = numDays;		// 1 day is yesterday, 2 days is day before yesterday, etc.
	var setTimeBack = now.setTime(now.getTime() - setDateBack * 24 * 60 * 60 * 1000);		//sets time back number of days

	var day = now.getDate();
	var month = (now.getMonth() + 1);
	var year = now.getYear();

	if (day<10)
		day = "0" + day;
	if (month<10)
		month = "0" + month;
	if (year < 1000) year += 1900;

	document.write(month + "/" + day + "/" + year);
}

function DaysFromNow(numDays)
{
	var now = new Date();

	var setDateAhead = numDays;		// 1 day is tomorrow, 2 days is day after tomorrow, etc.
	var setTimeAhead = now.setTime(now.getTime() + setDateAhead * 24 * 60 * 60 * 1000);		//sets time ahead number of days

	var day = now.getDate();
	var month = (now.getMonth() + 1);
	var year = now.getYear();

	if (day<10)
		day = "0" + day;
	if (month<10)
		month = "0" + month;

	document.write(month + "/" + day + "/" + year);
}

/************************* OTHER FUNCTIONS ****************************/

/*************************** TOC structure ***************************/

// TOC start
function writeTOCStart()
{
	// write actual TOC
	document.write("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"tocBg\">");
}
// one TOC item
function writeOneTOCItem(itemName, itemID, itemLink)
{
	document.write("<tr> <td><a id=\"" + itemID + "\" href=\"" + itemLink + "\" class=\"toc3\"><img src=\"../images/b1.gif\" width=\"16\" height=\"8\" border=\"0\" class=\"tocImage\"><ul class=\"tocItem\"><li>" + itemName + "</li></ul></a></td> </tr>");
}

// one TOC header
function writeOneTOCHeader(headerName)
{
	document.write("<tr> <td class=\"tocheader3\">" + headerName + "</td> </tr>");
	document.write("<tr> <td height=\"5\"></td> </tr>");
}

// one TOC spacer row
function writeTOCSpacerRow()
{
	document.write("<tr> <td height=\"5\"></td> </tr>");
}

// TOC end
function writeTOCEnd()
{
	document.write("</table>");

	// write filler spacer row with TOC background color, for bottom of page under TOC
	document.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" height=\"300\" class=\"tocBg\">");
		document.write("<tr> <td width=\"100%\" height=\"100%\" class=\"tocBg\">&nbsp;</td> </tr>");
	document.write("</table>");
}

/*************************** TOC list ***************************/

// Help TOC
function write_Help_TOC()
{
	writeTOCStart();

		writeOneTOCHeader("Getting Started Online");
		writeOneTOCItem("Using NetBenefits",                        "tocUsingTheSite",        "help_using_the_site.htm");
		writeOneTOCItem("Setting Up and Changing Your PIN",         "tocPIN",                 "#");
		writeOneTOCItem("Site Access and Login",                    "tocSiteAccess",          "#");
		writeOneTOCItem("Your NetBenefits Profile",                 "tocYourNBProfile",       "#");
		writeOneTOCItem("Technical Assistance",                     "tocTechnicalAssistance", "#");

		writeTOCSpacerRow();

		writeOneTOCHeader("Managing Your Benefits");

		writeOneTOCItem("Managing Your Retirement Plans",           "tocManagingYourRetirementPlans",    "#");
		if (parent.parent.context.context_hi == true)
			writeOneTOCItem("Managing Your Health &amp; Insurance", "tocManagingYourHealthAndInsurance", "#");
		if (parent.parent.context.context_pay == true)
			writeOneTOCItem("Managing Your Pay",                    "tocManagingYourPay",                "#");

		writeTOCSpacerRow();

		writeOneTOCHeader("Quick Reference");
		writeOneTOCItem("Frequently Asked Questions",               "tocFAQ",      "#");
		writeOneTOCItem("Glossary",                                 "tocGlossary", "#");
		writeOneTOCItem("Site Map",                                 "tocSiteMap",  "#");

	writeTOCEnd();
}

// ACBS TOC
function write_ACBS_TOC()
{
	writeTOCStart();

		/* writeOneTOCItem("Overview",                 "tocOverview",          "acbs_2002_overview.htm");
		writeOneTOCItem("Savings &amp; Retirement", "tocSavingsRetirement", "acbs_2002_savings_retirement.htm");
		writeOneTOCItem("Health &amp; Insurance",   "tocHealthInsurance",   "#");
		writeOneTOCItem("Pay",                      "tocPay",               "acbs_2002_pay.htm");
		writeOneTOCItem("Other Benefits",           "tocOtherBenefits",     "#"); */

		writeOneTOCItem("Pay",                    "tocPay",               "acbs_pay.htm");
		writeOneTOCItem("Stock Plans",            "tocStockPlans",        "acbs_stock.htm");
		writeOneTOCItem("Retirement Savings",     "tocRetirementSavings", "acbs_retirement.htm");
		writeOneTOCItem("Pension",                "tocPension",           "acbs_pension.htm");
		writeOneTOCItem("Health &amp; Insurance", "tocHealthInsurance",   "acbs_health.htm");
		writeOneTOCItem("Other Benefits",         "tocOtherBenefits",     "acbs_other.htm");

	writeTOCEnd();
}

// Savings & Retirment, Analyze, TOC
function write_SRAnalyze_TOC()
{
	writeTOCStart();

		writeOneTOCItem("Overview",                   "tocAnalysisPlanningOverview", "analysis_planning_overview.htm");
		writeOneTOCItem("Portfolio Analysis",         "tocPortfolioAnalysis",        "your_portfolio.htm");
		writeOneTOCItem("Goal Planning",              "tocGoalPlanning",             "#");
		writeOneTOCItem("Retirement Check-up",        "tocRetirementCheckUp",        "#");
		writeOneTOCItem("Retirement Income Planning", "tocRetirementIncomePlanning", "../retirement_planner_new/landing.html");
		writeOneTOCItem("Calculators",                "tocCalculators",              "#");

	writeTOCEnd();
}

// Savings & Retirment, Learn, TOC
function write_SRLearn_TOC()
{
	writeTOCStart();

		writeOneTOCHeader("Investing");
		writeOneTOCItem("The Basics",              "tocTheBasics",            "learn_the_basics.htm");
		writeOneTOCItem("Getting Started",         "tocGettingStarted",       "learn_getting_started.htm");
		writeOneTOCItem("Learning More",           "tocLearningMore",         "learn_learning_more.htm");
		writeOneTOCItem("Advanced Topics",         "tocAdvancedTopics",       "learn_advanced_topics.htm");
		writeOneTOCItem("Understanding Markets",   "tocUnderstandingMarkets", "#");

		writeTOCSpacerRow();

		writeOneTOCHeader("Retirement");
		writeOneTOCItem("Saving for Retirement",   "tocSavingForRetirement", "learn_saving_for_retirement.htm");
		writeOneTOCItem("Nearing Retirement",      "tocNearingRetirement",   "learn_nearing_retirement.htm");
		writeOneTOCItem("Living in Retirement",    "tocLivingInRetirement",  "learn_living_in_retirement.htm");
		writeOneTOCItem("Pension Plans",           "tocPensionPlans",        "#");
		writeOneTOCItem("Social Security",         "tocSocialSecurity",      "#");

		writeTOCSpacerRow();

		writeOneTOCHeader("About 401(k)s");
		writeOneTOCItem("401(k) Contributions",    "tocContributions",       "learn_401k_contributions.htm");
		writeOneTOCItem("Changing Jobs",           "tocChangingJobs",        "learn_changing_jobs.htm");
		writeOneTOCItem("Loans &amp; Withdrawals", "tocLoansAndWithdrawals", "learn_loans_and_withdrawals.htm");
		writeOneTOCItem("Retiring",                "tocRetiring",            "learn_retiring.htm");

		writeTOCSpacerRow();

		writeOneTOCHeader("Personal Finance");
		writeOneTOCItem("Debt &amp; Credit",       "tocDebtAndCredit",       "learn_debt_and_credit.htm");
		writeOneTOCItem("Estate Planning",         "tocEstatePlanning",      "learn_estate_planning.htm");
		writeOneTOCItem("Family &amp; Insurance",  "tocFamilyAndInsurance",  "learn_family_and_insurance.htm");
		writeOneTOCItem("Housing",                 "tocHousing",             "learn_housing.htm");
		writeOneTOCItem("Taxes",                   "tocTaxes",               "#");

	writeTOCEnd();
}

// Savings & Retirement, DC accounts, TOC
function write_SRDC_TOC()
{
	writeTOCStart();

		writeOneTOCHeader("View");
		writeOneTOCItem("Balances",                                "tocBalances",                     "your_401k.htm");
		writeOneTOCItem("Positions",                               "tocPositions",                    "positions.htm");
		writeOneTOCItem("Past Contributions",                      "tocPastContributions",            "past_contributions.htm");
		writeOneTOCItem("History",                                 "tocHistory",                      "history.htm");
		writeOneTOCItem("Printable Statement",                     "tocPrintableStatement",           "printable_statement.htm");

		writeTOCSpacerRow();

		writeOneTOCHeader("Act");
		// writeOneTOCItem("Research Your Investment Options",        "tocAllInvestmentOptions",         "all_investment_options.htm");
		writeOneTOCItem("Research Your Investment Options",        "tocAllInvestmentOptions",         "research.html");
		writeOneTOCItem("Change Your Investments",                 "tocChangeYourMonthlyInvestments", "change_your_investments.htm");
		writeOneTOCItem("Get a Loan or Withdrawal",                "tocTakeMoneyOut",                 "take_money_out.htm");
		writeOneTOCItem("Get Plan Details, Updates and Documents", "tocDocuments",                    "get_plan_documents.htm");

	writeTOCEnd();
}

// Savings & Retirement, DB accounts, TOC
function write_SRDB_TOC()
{
	writeTOCStart();

		writeOneTOCHeader("View");
		writeOneTOCItem("Pension Summary",                       "tocPensionSummary",                    "pension_summary.htm");
		writeOneTOCItem("Your Earnings History",                 "tocYourEarningsHistory",               "#");
		writeOneTOCItem("Your Eligibility Dates for Retirement", "tocYourEligibilityDatesForRetirement", "#");

		writeTOCSpacerRow();

		writeOneTOCHeader("Act");
		writeOneTOCItem("Estimate a Pension Payment",            "tocEstimateAPensionPayment",           "#");
		writeOneTOCItem("Request a Payment",                     "tocRequestAPayment",                   "#");
		writeOneTOCItem("Apply to Retire",                       "tocApplyToRetire",                     "#");
		writeOneTOCItem("Get Pension Forms",                     "tocGetPensionForms",                   "#");

	writeTOCEnd();
}

// Health & Insurance, Analyze, TOC
function write_HIAnalyze_TOC()
{
	writeTOCStart();

		writeOneTOCItem("Overview",                                 "tocOverview",                   "analyze_and_plan_health_insurance.htm");
		writeOneTOCItem("Compare plan coverage details",            "tocComparePlanCoverageDetails", "#");
		writeOneTOCItem("See how life events change your benefits", "tocViewBenefitsGuide",          "#");
		writeOneTOCItem("Healthcare in Retirement",                 "tocHealthCareInRetirement",     "#");
		writeOneTOCItem("Taking Advantage of Reimbursement Plans",  "tocReimbursements",             "#");

	writeTOCEnd();
}

// Health & Insurance, Learn, TOC
function write_HILearn_TOC()
{
	writeTOCStart();

		writeOneTOCItem("Overview",                 "tocOverview",         "healthcare_reference.htm");
		writeOneTOCItem("Health Management Center", "tocMayoClinic",       "mayo_clinic.htm");
		writeOneTOCItem("Reference Library",        "tocReferenceLibrary", "reference_library.htm");

	writeTOCEnd();
}

// Health & Insurance, HI plans, TOC
function write_HIPlan_TOC()
{
	writeTOCStart();

		writeOneTOCHeader("View");
		writeOneTOCItem("Your Medical Benefit",                     "tocYourCurrentMedicalCoverage", "your_medical_insurance.htm");
		writeOneTOCItem("Facts About Your Plan",                    "tocYourPrescriptionCoverage",   "#");

		writeTOCSpacerRow();

		writeOneTOCHeader("Act");
		writeOneTOCItem("Change Your Enrollment / Add a Dependent", "tocAddOrRemoveDependent",       "#");
		writeOneTOCItem("Find a Doctor or Hospital",                "tocFindADoctor",                "#");
		writeOneTOCItem("Get Claims Forms",                         "tocGetClaimsForms",             "#");
		writeOneTOCItem("Print a Temp ID Card",                     "tocPlanDocuments",              "#");

	writeTOCEnd();
}

// Pay TOC
function write_Pay_TOC()
{
	writeTOCStart();

		writeOneTOCHeader("View");
		writeOneTOCItem("Pay Summary",                     "tocSummary",                    "pay.htm");
		writeOneTOCItem("Paycheck History",                "tocPaycheckHistory",            "paycheck_history.htm");

		writeTOCSpacerRow();

		writeOneTOCHeader("Analyze");
		writeOneTOCItem("Take Home Pay Calculator",        "tocTakeHomePayCalculator",      "#");

		writeTOCSpacerRow();

		writeOneTOCHeader("Act");
		writeOneTOCItem("Set Up or Change Direct Deposit", "tocSetUpOrChangeDirectDeposit", "#");
		writeOneTOCItem("Change Tax Withholding",          "tocChangeTaxWithholding",       "#");

	writeTOCEnd();
}

// Your Profile TOC
function write_YourProfile_TOC()
{
	writeTOCStart();

		// writeOneTOCItem("Overview",           "tocOverview",          "your_profile_overview.htm");
		writeOneTOCItem("About You",          "tocPersonal",          "your_profile.htm");
		writeOneTOCItem("Address/Email",      "tocAddressEmail",      "profile_address_email.htm");
		writeOneTOCItem("Beneficiaries",      "tocBeneficiaries",     "profile_beneficiaries.htm");
		writeOneTOCItem("Dependents",         "tocDependents",        "profile_dependents.htm");
		writeOneTOCItem("Emergency Contacts", "tocEmergencyContacts", "profile_emergency.htm");
		writeOneTOCItem("Life Events",        "tocLifeEvents",        "profile_life_events.htm");
		writeOneTOCItem("Login/PIN",          "tocLoginPIN",          "profile_login_pin.htm");
		writeOneTOCItem("Preferences",        "tocPreferences",       "profile_preferences.htm");

	writeTOCEnd();
}

/************************* OTHER FUNCTIONS ****************************/

// QuickLink MENU
function getQuickLinkDropDownOption()
{
if (document.QuickLinksForm.QuickLinks.options[document.QuickLinksForm.QuickLinks.selectedIndex].value)
	document.location = document.QuickLinksForm.QuickLinks.options[document.QuickLinksForm.QuickLinks.selectedIndex].value;
}

function writeQuickLinkMenu()
{
document.write("<form name=\"QuickLinksForm\">");

document.write("<select name=\"QuickLinks\" class=\"dropDown\" onChange=\"javascript:getQuickLinkDropDownOption()\">");
document.write("<option>Choose a link</option>");

document.write("<option>------------------</option>");
document.write("<option>Savings &amp; Retirement</option>");
document.write("<option value=\"positions.htm\">&nbsp;&nbsp;Positions</option>");
document.write("<option value=\"history.htm\">&nbsp;&nbsp;History</option>");
document.write("<option value=\"buy_sell_funds.htm\" selected>&nbsp;&nbsp;Make an Exchange</option>");
document.write("<option value=\"research.html\">&nbsp;&nbsp;Research Your Investments</option>");
document.write("<option value=\"analysis_planning_overview.htm\">&nbsp;&nbsp;Analyze Savings &amp; Retirement</option>");
document.write("<option>&nbsp;&nbsp;Financial articles/workshops</option>");

if (parent.parent.context.context_hi)
{
document.write("<option>------------------</option>");
document.write("<option>Health &amp; Insurance</option>");
document.write("<option value=\"your_medical_insurance.htm\">&nbsp;&nbsp;Your Medical Coverage</option>");
document.write("<option>&nbsp;&nbsp;Add or Remove a Dependent</option>");
//  value=\"add_remove_dependent.htm\"
document.write("<option>&nbsp;&nbsp;Find a doctor or dentist</option>");
document.write("<option>&nbsp;&nbsp;Analyze your healthcare needs</option>");
document.write("<option>&nbsp;&nbsp;Healthy living resources</option>");
}

if (parent.parent.context.context_pay)
{
document.write("<option>------------------</option>");
document.write("<option>Pay</option>");
document.write("<option value=\"pay_with_latest.htm\">&nbsp;&nbsp;View latest paycheck</option>");
document.write("<option>&nbsp;&nbsp;Change tax withholding</option>");
}

if (parent.parent.context.context_yp)
{
document.write("<option>------------------</option>");
document.write("<option>Your Profile</option>");
document.write("<option value=\"profile_frame.html?address\">&nbsp;&nbsp;Change your address</option>");
document.write("<option value=\"profile_frame.html?beneficiaries\">&nbsp;&nbsp;Change your beneficiaries</option>");
}

document.write("<option>------------------</option>");
document.write("<option>...edit this list</option>");

document.write("</select>");

document.write("</form>");
}

// What to do MENU
function getToDoDropDownOption()
{
if (document.whatToDoWhenForm.whatToDoWhen.options[document.whatToDoWhenForm.whatToDoWhen.selectedIndex].value)
	document.location = document.whatToDoWhenForm.whatToDoWhen.options[document.whatToDoWhenForm.whatToDoWhen.selectedIndex].value;
}

function writeToDoMenu()
{
document.write("<form name=\"whatToDoWhenForm\">");

document.write("<select name=\"whatToDoWhen\" class=\"dropDown\" onchange=\"javascript:getToDoDropDownOption()\">");
// document.write("<option>What to do when...</option>");
document.write("<option>&nbsp;&nbsp;Buying/selling a home</option>");
document.write("<option>&nbsp;&nbsp;Changing jobs</option>");
document.write("<option>&nbsp;&nbsp;Getting married</option>");
document.write("<option value=\"having_a_child.htm\">&nbsp;&nbsp;Having a child</option>");
document.write("<option>&nbsp;&nbsp;Leaving employment</option>");
document.write("<option>&nbsp;&nbsp;Moving</option>");
document.write("<option value=\"../retirement_planner_new/landing.html\">&nbsp;&nbsp;Retiring</option>");
document.write("<option>&nbsp;&nbsp;Dependent loses eligibility</option>");
document.write("<option>&nbsp;&nbsp;...more life situations</option>");
document.write("</select>");

document.write("</form>");
}

// Analyze MENU
function getAnalyzeDropDownOption()
{
if (document.AnalyzeForm.Analyze.options[document.AnalyzeForm.Analyze.selectedIndex].value)
	document.location = document.AnalyzeForm.Analyze.options[document.AnalyzeForm.Analyze.selectedIndex].value;
}

function writeAnalyzeMenu()
{
document.write("<form name=\"AnalyzeForm\">");

document.write("<select name=\"Analyze\" class=\"dropDown\" onChange=\"javascript:getAnalyzeDropDownOption()\">");
document.write("<option>Analyze...</option>");
document.write("<option value=\"your_portfolio.htm\">Current portfolio</option>");
document.write("<option>Impact of different contributions</option>");
document.write("<option value=\"../retirement_planner_new/landing.html\">Retirement income needs</option>");
document.write("<option>Healthcare in retirement</option>");
document.write("</select>");

document.write("</form>");
}

/************************* OTHER FUNCTIONS ****************************/

// General function
function noLink()
{
// do nothing
}

// write the footer on every page - if the format changes drastically, other code will have to be added or removed.
function writeFooterTable()
{
	var now = new Date;
	var y = now.getYear();
	if (y < 1000) 
		y += 1900;
	var copyright = "Copyright &copy; 1996-" + y + " FMR Corp. All rights reserved.";

	document.write("<table cellspacing=0 cellpadding=0 border=0 width=\"100%\">");

		document.write("<tr>");
			document.write("<td colspan=2 class=\"footnote\">");
				document.write("Questions? Contact the <span class=\"footnoteSubHeader\">" + companyName + " Service Center at 1-800-555-1212</span>");
				document.write("<hr class=\"footnoteLine\">");
			document.write("</td>");
		document.write("</tr>");

		document.write("<tr>");
			document.write("<td class=\"footnoteNavLinks\"><a href=\"home.htm\">Home</a>&nbsp;|&nbsp;<a href=\"javascript:openContactUs();\">Contact Us</a>&nbsp;|&nbsp;<a href=\"javascript:openHelp();\">Help</a>&nbsp;|&nbsp;<a href=\"javascript:noLink()\">Logout</a></td>");
			// document.write("<td rowspan=3 align=right valign=top><img src=\"../images/fidelitylogweb.gif\" alt=\"Fidelity Investments logo\" border=\"0\" hspace=\"0\" vspace=\"0\"></td>");
			// document.write("<td rowspan=3 align=right valign=top><img src=\"../images/fidelity_logo_color.gif\" alt=\"Fidelity Investments logo\" border=\"0\" hspace=\"0\" vspace=\"0\"></td>");
			document.write("<td rowspan=3 align=right valign=top><img src=\"../images/fidelity_logo_grey.gif\" alt=\"Fidelity Investments logo\" border=\"0\" hspace=\"0\" vspace=\"0\"></td>");
		document.write("</tr>");

		document.write("<tr>");
			document.write("<td height=4></td>");
		document.write("</tr>");

		document.write("<tr>");
			document.write("<td class=\"footnote\">" + copyright + "&nbsp;&nbsp;<a href=\"javascript:noLink()\">Terms of Use</a></td>");
		document.write("</tr>");

		document.write("<tr>");
			document.write("<td colspan=2 height=8></td>");
		document.write("</tr>");

	document.write("</table>");
	
}

// Open Contact Us window
function openContactUs()
{
contactUsWindow=window.open("contact_us.htm","contactUsWindow","height=420,width=422,resizable=no,scrollbars=yes,top=250,left=450");
contactUsWindow.focus();
}

// Open Contact Us window from Portfolio Summary
function openContactUs2()
{
contactUsWindow=window.open("../../../html/contact_us.htm","contactUsWindow","height=420,width=422,resizable=no,scrollbars=yes,top=250,left=450");
contactUsWindow.focus();
}

// Open Help page
function openHelp()
{
top.mainframeset.content.location="help_using_the_site.htm";
}

// Open Help page from Portfolio Summary
function openHelp2()
{
top.mainframeset.content.location="../../../html/help_using_the_site.htm";
}

// Open Who To Call window
function openWhoToCall()
{
whoToCallWindow=window.open("who_to_call.htm","whoToCallWindow","height=420,width=422,resizable=no,scrollbars=yes,top=250,left=450");
whoToCallWindow.focus();
}

// Functions from netRewards

var isNav, isIE
var coll = ""
var styleObj = ""


if (parseInt(navigator.appVersion) >= 4) {
	if (navigator.appName == "Netscape") {
		isNav = true
	} else {
		isIE = true
		coll = "all."
		styleObj = ".style"
	}
}


// Utility function to position an element at a specific x,y location
function shiftTo(obj, x, y) {
	var theObj = getObject(obj);
	if (isNav) {
		theObj.moveTo(x,y)
	} else {
		theObj.pixelLeft = x
		theObj.pixelTop = y
	}
}

// convert obj name string to a object ref
// return false if object seems to not exist
function getObject(obj)
	{
	var theObj;
	if (typeof obj == "string")
		{
		if (eval("self.document." + coll + obj))
			{
		theObj = eval ("document." + coll + obj + styleObj);
		}
	else
		{
			return false;
			}	
		}
	else
		{
		if(!theObj)
			{
			return false;
			}
		theObj = obj
		}	
	return theObj
	}

// get the working windows content area height
function windowHeight()
	{
	if (isNav)
		{
		return window.innerHeight;
		}
	else
		{
		return document.body.clientHeight;
		}	
	}		
	
	
// get the working windows content area width
function windowWidth()
	{
	if (isNav)
		{
		return window.innerWidth;
		}
	else
		{
		return document.body.clientWidth;
		}	
	}	
	
// get a specified objects width
function objectWidth(obj)
	{
	
	var theObj = getObject(obj);
	
	if (isNav)
		{
		return theObj.clip.width;
		}
	else
		{
		// note: not sure why this applies to this prop and not others.
		// but ie wants this obj ref eval's first... hey, it works
		var x = eval(obj); 
		return x.clientWidth;
		}
	}

// get a specified objects height !!! note this can vary in result for NN 4
function objectHeight(obj)
	{
	var theObj = getObject(obj);
	if (isNav)
		{
		return theObj.clip.height;
		}
	else
		{
		var x = eval(obj);
		return x.clientHeight;
		}
	}
	
	

	
// set object to visible
function show(obj)
	{
	var theObj = getObject(obj);
	theObj.visibility = "visible";
	}

// set object to hidden
function hide(obj)
	{
	var theObj = getObject(obj);
	theObj.visibility = "hidden";
	}
	
// set bg color of an object
function setBGColor(obj, color)
	{
	
	var theObj = getObject(obj);

	if (isNav)
		{
		theObj.bgColor = color;
		}
	else
		{
		theObj.backgroundColor = color;
		}
	
	}	

	
// return the amount of Y offset from a scroll (mParnham)
function getOffsetY()
	{
	if (isNav)
		{
		return self.pageYOffset;
		}
	else
		{
		return self.document.body.scrollTop;
		}
	}
	
// return the amount of X offset from a scroll (mParnham, 10/1999)
function getOffsetX()
	{
	if (isNav)
		{
		return self.pageXOffset;
		}
	else
		{
		return self.document.body.scrollLeft;
		}
	}
	
// return an objects X location in pixels (mParnham 10/1999)
function getObjectX(obj)
	{

	var theObj = getObject(obj);
	
	if (isNav)
		{
		return theObj.pageX; // was using left - mp
		}
	else
		{
		return theObj.pixelLeft
		}	
	}
	
// return an objects Y location in pixels (mParnham 10/1999)
function getObjectY(obj)
	{
	var theObj = getObject(obj);
	
	if (isNav)
		{
		return theObj.pageY; // was using top - mp
		}
	else
		{
		return theObj.pixelTop;
		}	
	}
// toolTipOn and toolTipOff	- code taken from H&I enrollment worksheet page
// !!!!  note tipString may not have any line breaks or returns
var mouseX;
var mouseY;

document.onmousemove = recordCoords

function recordCoords(e)
	{
		mouseX = window.event.clientX;
		mouseY = window.event.clientY;
	}	

function toolTipOn(tipString)
	{

	if (tipString != "")// don't show if null string is passed
		{
		
		var imageWrapperStart = "<img src=\"../images/netrewards_";
		var imageWrapperEnd = "_rollover.gif\" alt=\"\" border=\"0\" vspace=\"0\" hspace=\"0\">";

		// next write the tool-tip content
		document.all.toolTipTag.innerHTML = imageWrapperStart + tipString + imageWrapperEnd;
		
		// figure out if we use mouse xy or a requested xy from args
		var initXPos = mouseX;
		var initYPos = mouseY;

		// next, position the tooltip to around the mouse
		shiftTo('toolTipTag',initXPos+5+getOffsetX(),initYPos-5+getOffsetY());
			
		// then show the tag
		show('toolTipTag');
		
		}
	}

function toolTipOff(theItem)
	{
	hide('toolTipTag');
	}	

// Functions from RETIREMENT PLANNING (health & insurance)
function Connect(mypage) {	

	var winl = (screen.width - 300) / 2;
	var wint = (screen.height - 185) / 2;
	
	win = window.open(mypage, 'ConnectWindow', 'height=185,width=300,top=wint,left=winl')
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function SaveNow(mypage)
{
	var winl = (screen.width - 300) / 2;
	var wint = (screen.height - 140) / 2;
	
	win = window.open(mypage, 'SaveWindow', 'height=140,width=300,top=wint,left=winl')
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function openOptions(whichPage)
{
	var pageToLoad = "options.html?" + whichPage;
	optionsWin = window.open(pageToLoad,"optionsWin","width=250,height=250,top=80,left=80,scrollbars=no,resizable=no,toolbar=no,location=no,menubar=no");
	optionsWin.focus;
}

// Functions from health & insurance landing page
function healthCalc()
{
	window.open('../healthcare_calc/intro.html','calc','width=600,height=600,menubar=1,resizable=1,scrollbars=1,status=0,toolbar=0');
}

function openExult()
{
exultWindow=window.open("http://www.exult.net/","exultWindow","height=500,width=800,resizable=yes,scrollbars=yes,top=80,left=80");
exultWindow.focus();
}

// Functions from pay tab
function openLastPaycheck()
{
lastPaycheckWindow=window.open("last_paycheck.htm","lastPaycheckWindow","height=450,width=744,resizable=no,scrollbars=yes,top=100,left=100");
lastPaycheckWindow.focus();
}

// Functions from Your Profile
function openLifeCare()
{
lifecareWindow=window.open("../html/lifecare.html","lifecareWindow","height=450,width=735,resizable=yes,scrollbars=yes,top=80,left=80");
lifecareWindow.focus();
}

// Funtion to open current benefits on the preview event results page (view current benefits link)
// Open Contact Us window
function openCurrentBenefits()
{
currentBenefits=window.open("results_allPop.html","currentBenefits","height=420,width=600,resizable=yes,scrollbars=yes,top=100,left=20");
currentBenefits.focus();
}

function getEnrollIconToOverViewpage()
{
 document.write("<a href=\"javascript:openWindow('https://netbenefits.401k.com/NBLogin/?option=HealthAndInsurance');\"><img src=\"images/199760_LastChanceToEnrollicon.gif\" border=\"0\"></a>")
}

function writeOverviewPageCommonContent()
{
 document.write("<b><i>Its time to complete your 2006 Flex enrollment &mdash; your once &ndash; a &ndash; year opportunity to review your 2006 benefit options and contributions.</i></b> <p>To access the Flex enrollment Web site, simply click the icon on the right. There you will find all of the information you need to make your benefit elections for 2006.</p>")
}

function writeHourlyOverviewPageContent()
{
 document.write("You can access and manage your GM benefits in one easy location\!  It\'s never been easier to obtain information, enroll in, or make changes to your GM benefits.  Simply click on the program you are interested in and follow the prompts\!")
}

function writeOverviewPageContentForAS_RS()
{
 document.write("You can access and manage your GM benefits in one easy location\!  It\'s never been easier to obtain information, enroll in, or make changes to your GM benefits.  Simply click on the program you are interested in and follow the prompts\!")
}

function putEnrollImage()
{
document.write("<a  href=\"https://netbenefits.fidelity.com/NBLogin/?option=HealthAndInsurance\"><img src=\"images/LastChance11_22_06.gif\" align=\"center\" alt=\"Enroll Logo\" border=\"#FFFFFF\" ></a>")

}
// write the CommonGM footer on every page - if the format changes drastically, other code will have to be added or removed.
function writeCommonGMFooterTable()
{
	document.write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"764\">");
	document.write("<tr><td height=\"8\" class=\"secondaryBackgroundColor\">&nbsp;</td></tr>");
	document.write("</table>");

	document.write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"764\" class=\"navTopBg\">");
	document.write("<tr>");
	document.write("<td height=\"46\" width=\"70%\">&nbsp;&nbsp;<img src=\"images/bottom_image.gif\"></td>");
	document.write("<td align=\"right\" class=\"pageFooter\">Site hosted by Fidelity Investments&nbsp; <br>&copy; 1996-2009 FMR LLC.&nbsp;&nbsp;<br>All rights reserved.&nbsp;&nbsp;</td>");
	document.write("<tr>");
	document.write("</table>");

}