this.whoamI="Chad Chamberlain\nSr.Web Programmer @ \nCBSNews.com\nE-mail:webmail@cbsnews.com\n";
this.update = "This script was last updated on: 05-06-2003 at 6:50pm";
this.comment = "";
var creator = whoamI+update+comment;
var ns4,ns6,ns7,ie4,ie5,ie5_5,ie,iex,ns,win,ie6,aol,opera,icab,omniWeb,linux,Mac,safari,da_text;
var pluginlist ="";
var nUser=navigator.userAgent.toLowerCase();
var bname = navigator.appName.toLowerCase();
var ver = navigator.appVersion;
var int_ver = parseInt(ver);
if (nUser.indexOf('linux')!=-1){linux = true;}
if (nUser.indexOf('konqueror')!=-1){linux = true;}
if (nUser.indexOf('omniWeb')!=-1){omniWeb = true;}
if (nUser.indexOf('opera')!=-1){opera = true;}
if (nUser.indexOf('icab')!=-1){icab = true;}
if (nUser.indexOf('aol')!=-1){aol = true;}
if (nUser.indexOf('mac')!=-1){Mac = true;}
if (nUser.indexOf('Safari/') >0) safari =1;
if (bname.indexOf("netscape") >= 0 && int_ver == 4) ns4 = true;/*netscape 4 +*/
if (nUser.indexOf("gecko/") != -1 && (nUser.indexOf("netscape/6")!=-1 || nUser.indexOf("netscape6/")!=-1)){ns6 = true;}/*netscape 6*/
if (nUser.indexOf("gecko/") != -1 && nUser.indexOf("netscape/7")!=-1){ns7 = true;}/*netscape 7*/
if (nUser.indexOf('compatible; msie 5.22; mac_powerpc')>0){iex=true}
if (nUser.indexOf('msie 4') >0){ie4 = 1;}/*internet explorer 4*/
if (nUser.indexOf('msie 5') >0){ie5 = 1;}/*internet explorer 5*/
if (nUser.indexOf('msie 5.5') >0){ie5_5 = 1;}/*internet explorer 5*/
if (nUser.indexOf('msie 6') >0){ie6 = 1;}/*internet explorer 6*/
var win = ((nUser.indexOf("win")!=-1) || (nUser.indexOf("32bit")!=-1));
var ie = (nUser.indexOf("msie") != -1);
/*templates for video player*/
var templ0="http://www.cbsnews.com/htdocs/videoplayer/newVid/framesource_old.html";
var templ1="http://www.cbsnews.com/htdocs/videoplayer/newVid/framesource2.html";//obj+"&title="+title;
var templ2="http://www.cbsnews.com/htdocs/videoplayer/newVid/framesource_help.html";
var templ4="http://www.cbsnews.com/htdocs/videoplayer/newVid/framesource_mediatype.html";
var templ5="http://www.cbsnews.com/htdocs/videoplayer/newVid/framesource_mediahelp.html";
var templ6="http://www.cbsnews.com/htdocs/videoplayer/newVid/framesource_mediahelp_windows.html";
var templ7="http://www.cbsnews.com/htdocs/videoplayer/newVid/framesource_mediahelp_real.html";
/*end template for video player*/
var RealMode=0;
var RealPlayer8=0;
var RealPlayerG2=0;
var WMPV70 = 0;/*Windows Media Player Version 7.0*/
if (navigator.userAgent.indexOf("MSIE")<0 )
{
numPlugins = navigator.plugins.length;
for (i = 0; i < numPlugins; i++)
{
plugin = navigator.plugins[i];
if (plugin.name.substring(0,10)=="RealPlayer")
{
RealMode=1;
}
}
}
document.write(' \n");
/*test to see if user has real or not*/
if ( RealPlayerG2 || RealPlayer8 ) /*|| RealPlayer7*/
{
/*alert();*/
isReal="yes";
}
else if ( Mac || linux || opera || RealMode )
{
isReal="yes";
}
/*else if (Mac || linux || opera)
{
isReal="yes";
}*/
else
{
isReal="no";
}
/*Windows Media Detection for Netscape and IE*/
//Detect ActiveX Architecture on Both IE and on Gecko
//Defer to plugin architecture for other browsers
function detectWMP()
{
var wmpInfo = {
installed: false,
scriptable: false,
type: null,
versionInfo: null
};
var wmp64 = "MediaPlayer.MediaPlayer.1";
var wmp7 = "WMPlayer.OCX.7";
if((window.ActiveXObject && navigator.userAgent.indexOf('Windows') != -1) || window.GeckoActiveXObject)
{
wmpInfo.type = "ActiveX";
var player = createActiveXObject(wmp7);
if(player)
{
wmpInfo.installed = true;
wmpInfo.scriptable = true;
wmpInfo.versionInfo = player.versionInfo;
return wmpInfo;
}
else
{
player = createActiveXObject(wmp64);
if(player)
{
wmpInfo.installed = true;
wmpInfo.scriptable = true;
wmpInfo.versionInfo = "6.4";
return wmpInfo;
}
else
{
wmpInfo.versionInfo = "none";
return wmpInfo;
}
}
}
else if(navigator.mimeTypes)
{
wmpInfo.type = "NetscapePlugin";
var player = navigator.mimeTypes['application/x-mplayer2'].enabledPlugin;
if(player)
{
wmpInfo.installed = true;
//wmpInfo.scriptable = false;
wmpInfo.versionInfo = "PluginVersion";
return wmpInfo;
}
return wmpInfo;
}
}
function createActiveXObject(id)
{
var error;
var control = null;
try
{
if (window.ActiveXObject)
{
control = new ActiveXObject(id);
}
else if (window.GeckoActiveXObject)
{
control = new GeckoActiveXObject(id);
}
}
catch (error)
{
;
}
return control;
}
/*******End Windows Media Detection for Netscape and IE*******/
/*Detect windows media player*/
function playerResults(){
var detectionResults = detectWMP();
if(!Mac){
if(detectionResults.installed)
{
if(detectionResults.versionInfo.indexOf("9")!=-1 || detectionResults.versionInfo.indexOf('PluginVersion')!=-1){return true}else{return false}
}
}
else
{
return true;
}
}
/*End detect windows media*/
/*alert(nUser+' '+int_ver);*/
var is_over = 0;
var divelement = new Array();
divelement[0] = 'popupDiv1';
function clearall(obj){
if(ns4){
for(i=0;i12)
{
the_hour = eval(the_hour - 12);
}
else if(the_hour == 0)
{
the_hour = eval(the_hour+12)
}
//alert(the_hour);
return the_hour;
}
function fixTime(the_time) {
if ((the_time <10) && (the_date.getHours()<=11))
{
the_time = "0" + the_time + "am";
}
else if ((the_time >=10) && (the_date.getHours()<=11))
{
the_time = the_time + "am";
}
else if ((the_time >=10) && (the_date.getHours() >= 12))
{
the_time = the_time + "pm";
}
else if ((the_time <10) && (the_date.getHours() >= 12))
{
the_time = "0" + the_time + "pm";
}
//alert(the_time);
return the_time;
}
function Time(){
document.write(the_currentTime);
}
function DateandTime(){
document.write(the_current_dateAndTime);
}
/*Update cac 2:15pm on 4-15-2002*/
/*call this function to scroll a window's x coordinate*/
var x = 0;
window.onerror=null
function ScrollRight(dist) {
if (x < 2000) {
scrollEnd = x + dist;
x = x + 8;
ScrollRight2();
}
}
function ScrollRight2() {
if (x < scrollEnd) {
window.scrollTo(x,0);
x = x + 8;
setTimeout('ScrollRight2()', 5);
} else {
x = scrollEnd;
}
}
function ScrollLeft(dist2) {
x = scrollEnd;
if (x > 0) {
scrollEnd = x - dist2;
x = x - 8;
ScrollLeft2();
}
}
function ScrollLeft2() {
if (x > scrollEnd) {
window.scrollTo(x,0);
x = x - 8;
setTimeout('ScrollLeft2()', 1);
} else {
x = scrollEnd;
}
}
/*Update cac 2:15pm on 4-18-2002*/
/*call this function to make this url your home page*/
var home;
var loc = document.location.href;
var instructions = "Drag this link " +loc + " onto your Home button to make this your Home Page."
function check(){
alert('To make CBSNews.com your home page:\n\n- Under "Edit" menu select "Preferences"\n- Inside "Navigator" form click on "Use Current Page"');
}
function makeHome(){
if(ie4||ie5||ie6){
home = document.write('');
home += document.write('Make Us Your Home Page');
}
else if(ns4||ns6||ns7)
{
home = document.write('Make Us Your Home Page');
//PopUp(\'framesource_instructions.html\',280,400,\'CBSNewsHome\');
}
else
{
home = document.write('Make Us Your Home Page');
}
return home;
}
/*Update cac 12:47pm on 4-19-2002*/
/*call this function to change email_summary edition time*/
function edition(){
var edition;
}
/*Update cac 11:13am on 10-14-2002*/
/*call this function to change email preferrences*/
function unsubCheck(fobj)
{
var email = fobj.mod_email; //alert(email.name);
var main_email = document.forms[0].email;
//alert(main_email.value);
if(email.value == '')
{
alert("please fill in your email address");//email.value = main_email.value;
email.focus();
return false;
}
document.location = "http://cgi.cbs.com/news/unsubscribe.pl?email="+email.value;
//alert(document.location);
}
/*Update cac 6:15pm on 10-23-2002*/
/*this will be our primary cookie function to be used to story all types of interesting stuff*/
var cookieString = document.cookie;
var today = new Date();
var cookieExpires = new Date(today.getTime() + 712 * 24 * 60 * 60 * 1000); // plus 30 day
var deletecookieExp = new Date(today.getTime() - 72 * 60 * 60 * 1000); //
var cookiePath = ";Path=/";
function getCookieValue(name) {
var index = cookieString.indexOf(name + "=");
if (index == -1) return null;
index = cookieString.indexOf("=", index) + 1;
var endstr = cookieString.indexOf(";", index);
if (endstr == -1) endstr = cookieString.length;
return unescape(cookieString.substring(index, endstr));
}
function deleteCookie(name)
{
value = escape(name);
document.cookie=name + "=null; expires=" + deletecookieExp.toGMTString();
cookieString = document.cookie;
}
function setCookie(cookieName, cookieValue)
{
if (cookieValue != null && cookieValue != "")
cookieValue = escape(cookieValue);
document.cookie=cookieName + "=" + cookieValue + "; expires=" + cookieExpires.toGMTString() + cookiePath;
cookieString = document.cookie;
}
/*This function does a simple image swap. takes 3 parameters an img and a element ID and type of image swapped*/
function imageExchange(locId,img,type)
{
if (ns4) {
eval('document.locId.'+type+'= img');
} else if (ie5||ie6||ns6||ns7) {
eval('document.getElementById(locId).'+type+' = img');
}else if(ie4){
'document.all.'+locId+'.'+type+'= img';
}
}
var is_over = 0;
var inlink = 0;
function linkpopUp(bgc,da_header,da_content,third) {
inlink = 1;
da_text = '
';
da_text += '
';
da_text += da_content+third;
da_text += '
';
/*alert("this is the head:\n"+da_header+ "this is the content: \n"+da_content+ " this is the third :\n" +third+ "this is the fourth:\n"+fourth);*/
/*if (ns4) {
document.layers['linkDiv'].visibility = "visible";
document.layers['linkDiv'].document.open();
document.layers['linkDiv'].document.writeln(da_text);
document.layers['linkDiv'].document.close();
} else */
if (ie6||ie5||ns6||ns7) {
linkDiv.style.visibility = "visible";
linkDiv.innerHTML = da_text;
}
}
function linkpopDown() {
inlink = 0;
/*if (document.layers) {
document.layers['linkDiv'].visibility = "hidden";
document.layers['linkDiv'].document.open();
document.layers['linkDiv'].document.writeln("");
document.layers['linkDiv'].document.close();
} else*/
if (ie6||ie5||ns6||ns7) {
linkDiv.style.visibility = "hidden";
//popupDiv.innerHTML = "";
}
}
function daMouseCapture(e) {
/*if (document.layers) { alert();*/
/*alert();*/
if((ie6||ie5||ns6||ns7) && (inlink != 0)){linkDiv.style.left = window.event.clientX + document.body.scrollLeft + 5; linkDiv.style.top = window.event.clientY + document.body.scrollTop-48;}
/*if(ns4){document.layers['linkDiv'].left = e.pageX -60; document.layers['linkDiv'].top = e.pageY - 53;}*/
}