var bitShowNutritionNewsArchives = 0;
arrPageSet = new Array(
'66278F7B-851A-466C-B8E3-D47CF02B420C','What You Can Learn From Serious Losers',
'B818C3A2-C7DB-4959-8243-25445021FD18','Lunchbox Makeovers',
'','',
'','',
'FF470511-EDF0-4135-9035-DFA08F4A0FEF','Flavorful Solutions to a Low-Salt Diet',
'','',
'','',
'','',
'8D45745C-47E0-4B0A-8A69-EC4DFC1D586C','Fruit Juices and Smoothies',
'','',
'','',
'9610CDF2-3E7A-4C95-9965-CDA2AE0E1C0C','Do You Need a Multivitamin / Mineral Supplement?',
'','',
'','',
'','',
'FEFF78C9-D2BC-47E4-9D24-A8850066FFFF','Nutrition and Cancer Prevention',
'','',
'0BC2FC5F-880F-4AC2-A5C0-F4456117E1E5','Questions, Questions, Questions Part 2',
'','',
'66B086C2-1A79-43CB-9948-5409B06EFB1A','Questions, Questions, Questions Part 1',
'','',
'','',
'2D19F6BB-073C-47E7-AA12-09C9398AB66C','Eating Disorders: Who\'s at Risk? - What to Do',
'','',
'','',
'','',
'740C02E0-7B1C-4CA9-ADFC-BF56B0CE4FEC','Ready Yourself for Recovery: Tips for Pre- and Post-Op Nutrition',
'','',
'','',
'0E482825-07FB-4F14-9FEB-979A23ADE340','The Healthy Pantry',
'','',
'','',
'','',
'','',
'2997AA4E-96BA-4F5B-8F07-BCF85BF2BA4A','How to Keep Your New Year\’s Resolutions',
'E00D9807-EC20-4898-8F39-02FD08044038','7 Healthy Foods for the Holidays',
'','',
'55DBD99A-76F3-485E-B16C-0A9D11A7561A','Great Holiday Party Tips',
'D8BCA60A-4C8B-4556-B0E8-B3EF62032FD1','Holiday Help for People with Diabetes',
'','',
'735AE6C6-496B-4CA4-BEB0-496B1B9F10BE','How to Quit Smoking without Gaining Weight',
'','',
'8EC28CFB-3F82-400B-957A-0E518F6F5028','Answers to Frequently Asked Questions',
'2AC443CB-A8EC-4CE9-987D-5FC8A819042C','Cooking Solo',
'8AB32733-38F1-42A4-B0A7-46B68EAE17D9','Nutrition and Oral Health',
'3DA171B4-CAB6-4B00-9BA9-68725EF5B62B','Using Healthy Cooking Techniques',
'70292A3D-DD64-4D00-9144-18AAE4C8C62D','Money-Saving Tips',
'','',
'4E03FC45-9CCC-4F7D-B863-C627C69C3CB6','Helping the Overweight Child',
'0FCAB385-543C-4323-A561-A32D0CFE4438','Banishing the Mid-Afternoon Slump',
'00C6279F-7361-4B30-8270-A4799CEA1E29','Are You Sandwich Savvy?',
'D6B18194-420A-4490-9316-D71792995B85','Nutrition Quackery',
'2E9C260A-5185-4F94-92D9-AC30AF5AA306','Eating Habits During Difficult Times',
'6585CB7F-4D89-4D31-AC0B-A7D96B889944','Scoring 100 in "College Dining 101"',
'BB88136B-E44A-46FF-ABE0-66FA52B44743','Pizza and Pasta for People on the Move',
'5A747A37-B5A2-4D36-8449-6DC73CE49BD7','A Healthy Plan for Gaining Weight',
'09596C27-3431-4BE4-9736-C513337DD359','25 Ways to Cut 100 or More Calories',
'22FD0058-F55A-49C2-A36B-F2C1DA32A87E','Taste Tips for Using Dried Herbs',
'C4516C8C-388F-4BEC-B30F-572737B790F2','Food Safety and Power Outages',
'2FCA6F38-97A1-471E-ADDA-B4AAD0B98955','Great Grilling',
'17F14AB2-39FE-41E0-BCB4-DE7052714F5F','Folate Facts',
'7E41256F-31A4-47E4-B17C-04B47C63536D','Portion Distortion Revisited',
'5514D675-08D7-4D7E-AD41-8C320ABC19D9','Portion Distortion',
'8342ACBF-51BB-424B-A370-58D2D8C265F5','The Scoop on Ice Cream',
'F0E3E57D-66E2-4E2D-9943-0CA1713B8504','Home Food Safety - It\'s in Your Hands',
'56906FC4-C20F-4812-B136-89540730778F','Making the most of Family Mealtimes',
'EA4C309E-44C8-11D5-A2EE-00508B117452','Food Myths and Truths Quiz',
'C179EE47-3E73-11D5-81FF-00508B116BA6','Slimming Habits',
'7AEF7320-3A78-11D5-81FF-00508B116BA6','20 Everyday Ways to Get Moving',
'004F7A20-3294-11D5-81FF-00508B116BA6','The Wonders of Chocolate',
'FCC1B0AA-2E8D-11D5-81FF-00508B116BA6','Feeling Taxed About Eating Right?',
'7DDFC1C0-2D23-11D5-A2ED-00508B117452','Rating the Weight-loss Websites',
'942F6A2F-2624-11D5-81FE-00508B116BA6','Are You Getting Enough Iron?',
'F4693764-2219-11D5-81FA-00508B1249D5','Who is a Registered Dietitian?',
'8F46CE6D-1A1E-11D5-A2E9-00508B62BE1F','Food and Fitness',
'70F29C35-14C5-11D5-A2E9-00508B62BE1F','Diet and Health Megatrends (Part 2)',
'3689A576-0F58-11D5-A2E9-00508B62BE1F','Diet and Health Megatrends (Part 1)',
'8F46CFFA-1A1E-11D5-A2E9-00508B62BE1F','31 Days of Smart Snacks',
'321118B7-1D54-11D5-81FA-00508B1249D5','Heart Healthy Eating',
'0F3A280E-0388-11D5-A2E9-00508B62BE1F','Sweet Talk',
'F33702D6-F847-11D4-A2E9-00508B62BE1F','Phytochemicals',
'E914C88D-F1D6-11D4-81F7-00508B1249D5','How About a Souper Bowl Party',
'8F46CFF3-1A1E-11D5-A2E9-00508B62BE1F','Feeding the Teen Machine',
'641CDC51-E5E5-11D4-81F5-00508B1249D5','10 Tips for Putting Health Eating into Practice',
'AECB51A6-E27A-11D4-A2E7-00508B62BE1F','Losing Holiday Pounds',
'8F46CF8E-1A1E-11D5-A2E9-00508B62BE1F','Healthy Resolutions for the New Millenium',
'8F46CF94-1A1E-11D5-A2E9-00508B62BE1F','Give the Gift of Good Food',
'8F46CFA0-1A1E-11D5-A2E9-00508B62BE1F','Healthy Holiday Eating (Part 2)',
'CB6F40A3-068C-11D5-A2E9-00508B62BE1F','Healthy Holiday Eating (Part 1)',
'94770860-CCBE-11D4-81F5-00508B1249D5','Season\'s Eating at the Mall',
'689ED072-C4AF-11D4-81F5-00508B1249D5','What to Eat When You\'re Under the Gun',
'C006654C-B6BE-11D4-81F5-00508B1249D5','Let\'s Talk Turkey',
'C006529D-B6BE-11D4-81F5-00508B1249D5','FAQ\'s About Diabetes',
'2A9FFEF2-AF2E-11D4-81F4-00508B1249D5','How Sweet It Is',
'2A9FF3BA-AF2E-11D4-81F4-00508B1249D5','Healthy Halloween Treats',
'0AEFA1A7-9FB5-11D4-81F3-00508B1249D5','Food for Hungry Tummies',
'0AEF8D20-9FB5-11D4-81F3-00508B1249D5','Pregnancy: A Meal Ticket for Two',
'B10DA489-9731-11D4-81F3-00508B1249D5','Faster Than A Speeding Burger',
'B10D8C6D-9731-11D4-81F3-00508B1249D5','Grandma Called it "Roughage"',
'82CB085E-8E7E-11D4-81F3-00508B1249D5','Bone Up On Calcium'
);
var dateFirstPageDate = new Date('September 23, 2000');
var dateToday = new Date();
var dateTeaserToDisplay;
var intIntervalDays = 7;
var intGracePeriodDays = 9;
var strArchivePageGuid = 'EA4C2319-44C8-11D5-A2EE-00508B117452';
if ( bitShowNutritionNewsArchives == 1 ) {
fnDisplayArchives()
}
else {
dateTeaserToDisplay = dateToday;
if ( ! fnDateIsThere(dateTeaserToDisplay) && fnDateIsThere(dateTeaserToDisplay.valueOf() - (intGracePeriodDays * 24 * 60 * 60 * 1000)) ) {
// -- Allow most recent content to display through the grace period...
while ( ! fnDateIsThere(dateTeaserToDisplay) ) {
dateTeaserToDisplay = new Date( dateTeaserToDisplay.valueOf() - (intIntervalDays * 24 * 60 * 60 * 1000) );
}
}
if ( ! fnDateIsThere(dateTeaserToDisplay) ) {
// -- Jump to the first year of content...
dateTeaserToDisplay = new Date( dateFirstPageDate.valueOf() + (dateTeaserToDisplay.valueOf() - dateFirstPageDate.valueOf()) % (365 * 24 * 60 * 60 * 1000) );
}
while ( ! fnDateIsThere(dateTeaserToDisplay) ) {
// -- Move forward incrementally to skip empty weeks in the first year of content...
dateTeaserToDisplay = new Date( dateTeaserToDisplay.valueOf() + (intIntervalDays * 24 * 60 * 60 * 1000) );
}
fnDisplayTeaser(fnDateToIndex(dateTeaserToDisplay))
}
function fnDateIsThere(dateInput) { return (fnDateToIndex(dateInput) >= 0) && (fnGetIndexGuid(fnDateToIndex(dateInput)) != ''); }
function fnDateToIndex(dateInput) {
var intOutput = Math.ceil( (arrPageSet.length / 2) - ((dateInput.valueOf() - dateFirstPageDate.valueOf()) / (intIntervalDays * 24 * 60 * 60 * 1000)) - 1 );
return intOutput; }
function fnIndexToDate(intInput) {
var dateOutput = new Date( dateFirstPageDate.valueOf() + (arrPageSet.length / 2 - (intInput + 1)) * intIntervalDays * 24 * 60 * 60 * 1000 );
return dateOutput; }
function fnGetIndexGuid(intInput) { return arrPageSet[intInput * 2 + 0]; }
function fnGetIndexTitle(intInput) { return arrPageSet[intInput * 2 + 1]; }
function fnDisplayArchives() {
var intI;
var intTemp;
document.writeln('Weekly Nutrition News - Archived Articles
');
document.writeln(' by Mary Beth Campbell, MSRD
');
document.writeln('
');
for (intI = 0; intI < arrPageSet.length / 2; intI++) {
dateThisPageDate = new Date(fnIndexToDate(intI));
var strMon = String(dateThisPageDate.getMonth() + 1);
strMon = (strMon.length == 1) ? ('0' + strMon) : (strMon);
var strDate = String(dateThisPageDate.getDate());
strDate = (strDate.length == 1) ? ('0' + strDate) : (strDate);
if (fnGetIndexGuid(intI) != '') { // -- Weed out weeks with no corresponding article
document.writeln('' + strMon + '-' + strDate + '-' + dateThisPageDate.getFullYear() + ' - ' + fnGetIndexTitle(intI) + '
');
}
}
}
function fnDisplayTeaser(intOffset) {
document.writeln('
');
document.writeln('
');
document.writeln('Weekly Nutrition News:
');
document.writeln('' + fnGetIndexTitle(intOffset) + '
');
document.writeln(' Check here each week for a different article on healthy eating. Or, search through our archived articles to find the nutrition information you need now.
');
}
function fnModifyNNewsLinks (strNNewsHost, strNNewsTarget) {
var
intCurDocLink,
intCurNNewsLink,
strNNewsLinkPrefix = 'http://' + strNNewsHost + '/',
strNNewsLinkSansGuid = 'CustomPage.asp?guidCustomContentID=';
//alert( 'document.links.length: ' + document.links.length + '\n' + 'arrPageSet.length: ' + arrPageSet.length );
for ( intCurDocLink = 0 ; intCurDocLink < document.links.length ; intCurDocLink++ ) {
//alert(fnHrefPathAndSearch(document.links[intCurDocLink].href));
for ( intCurNNewsLink = 0 ; intCurNNewsLink < arrPageSet.length ; intCurNNewsLink += 2 ) if ( fnHrefPathAndSearch(document.links[intCurDocLink].href) == strNNewsLinkSansGuid + arrPageSet[intCurNNewsLink] ) {
//alert(arrPageSet[intCurNNewsLink]);
document.links[intCurDocLink].href = strNNewsLinkPrefix + strNNewsLinkSansGuid + arrPageSet[intCurNNewsLink];
document.links[intCurDocLink].target = strNNewsTarget;
}
if ( fnHrefPathAndSearch(document.links[intCurDocLink].href) == strNNewsLinkSansGuid + strArchivePageGuid ) {
//alert(strArchivePageGuid);
document.links[intCurDocLink].href = strNNewsLinkPrefix + strNNewsLinkSansGuid + strArchivePageGuid;
document.links[intCurDocLink].target = strNNewsTarget;
}
}
}
function fnHrefPathAndSearch (strHref) {
return strHref.substring(strHref.lastIndexOf('/', ( (strHref.indexOf('?') != -1) ? strHref.indexOf('?') : strHref.length )) + 1)
}