Choose the news and entertainment topics, sports, and " +
"stocks that you want to see here.
");
gEmbedTag.document.close();
gLinkTag.href = "wtv-partner:/custom-info-page";
}
// --------------------------------------------------------------------
// --------------------------------------------------------------------
function ResumeRotation()
{ gStale = 0;
RotateToNextTeaser(); }
// --------------------------------------------------------------------
// --------------------------------------------------------------------
function RotateToNextTeaser()
{ if (gStale == 0) { ++gCurrentIndex;
gCurrentIndex = gCurrentIndex % gNumCategories;
// If the next teaser is blacklisted, write out our standard sorry message
if (gTeaserBlacklisted[gCurrentIndex] == 1) { PostSorryMessage();
}
// Otherwise, point the embed to the proper URL
else { if (gNumCategories > 1) { gTimeoutHandle = setTimeout(Timeout, 40000);
}
if (gCategories[gCurrentIndex] == "Intro") { WriteEvergreenTeaser();
CustomEmbedLoaded();
gLinkTag.href = gLinkURL;
}
else { gEmbedTag.src = gEmbedURL + gCategories[gCurrentIndex];
// This code made the My WebTV page scroll automatically
// to the category that was showing when you hit the teaser.
// gLinkTag.href = gLinkURL + gCategories[gCurrentIndex];
}
}
}
}
// --------------------------------------------------------------------
// The HTML that this function writes out must be kept in synch with
// the framework in CustomCellEmbedded and the text in TeaserMessage.
// --------------------------------------------------------------------
function PostSorryMessage()
{ gEmbedTag.document.open();
gEmbedTag.document.write( "" +
"" +
"
" +
"
" +
"" + gCategories[gCurrentIndex] + "
" +
"
" + gCategories[gCurrentIndex] +
" information is temporarily unavailable.
");
gEmbedTag.document.close();
gLinkTag.href = "wtv-partner:/custom-info-page";
SetRotateTimer();
}
// --------------------------------------------------------------------
// This gets called if we fail to load a particular teaser after a
// timeout period. If we load it successfully, we cancel the timer
// timer so this doesn't get called.
// --------------------------------------------------------------------
function Timeout()
{ if (!navigator.networkOnline()) { RevertToGenericTeaser();
}
else { gTeaserBlacklisted[gCurrentIndex] = 1;
PostSorryMessage();
}
}
// --------------------------------------------------------------------
// --------------------------------------------------------------------
function SetRotateTimer()
{ var delay;
if (gCategories[gCurrentIndex] == "Weather")
delay = 8600;
else if (gCategories[gCurrentIndex] == "News")
delay = 7000;
else if (gCategories[gCurrentIndex] == "Stocks")
delay = 7000;
else if (gCategories[gCurrentIndex] == "Sports")
delay = 5000;
else if (gCategories[gCurrentIndex] == "Entertainment")
delay = 5000;
else if (gCategories[gCurrentIndex] == "Intro")
delay = 7000;
else
delay = 6000;
if (gNumCategories > 1)
gRotateTimerHandle = setTimeout(RotateToNextTeaser, delay);
}
// --------------------------------------------------------------------
// --------------------------------------------------------------------
function CustomEmbedLoaded()
{ var doc;
clearTimeout(gWeatherTimeout);
if (gStale == 0) { clearTimeout(gTimeoutHandle);
SetRotateTimer();
}
doc = document.customInfoEmbed.document;
if (gCategories[gCurrentIndex] == "Weather" && doc.weatherForm == nil) { setTimeout(CustomEmbedLoaded, 100);
return;
}
if (gCategories[gCurrentIndex] == "Weather" && typeof doc.weatherForm == "object") { doc.weatherForm.disp1a.value = doc.weatherForm.disp1.value;
doc.weatherForm.disp2a.value = doc.weatherForm.disp2.value;
gFirstWeatherIndex = 0;
gWeatherIndex = gFirstWeatherIndex;
gWeatherTimeout = setTimeout(RotateWeather, 2900);
}
}
// --------------------------------------------------------------------
// --------------------------------------------------------------------
function RotateWeather()
{ var doc;
var str1, str2;
doc = document.customInfoEmbed.document;
if (gCategories[gCurrentIndex] == "Weather" && doc.weatherForm != nil && typeof doc.weatherForm == "object") { ++gWeatherIndex;
if (gWeatherIndex > 2)
gWeatherIndex = gFirstWeatherIndex; if (gWeatherIndex == 1) { str1 = doc.weatherForm.disp1b.value;
str2 = doc.weatherForm.disp2b.value;
}
else if (gWeatherIndex == 2) { str1 = doc.weatherForm.disp1c.value;
str2 = doc.weatherForm.disp2c.value;
}
else { str1 = doc.weatherForm.disp1a.value;
str2 = doc.weatherForm.disp2a.value;
}
doc.weatherForm.disp1.value = str1;
doc.weatherForm.disp2.value = str2;
if (gWeatherIndex != 2 || gNumCategories == 1)
gWeatherTimeout = setTimeout(RotateWeather, 2900);
}
}
Home for Flog-Our-Mink