/*This A.P.I. (Alberto's Perfect Interface) for CBS.Com*/
/*Global var start*/
this.author = "Alberto F. Araya ";
this.UpDated = "08/22/2001@12:00am";
this.version = "CBS.Com A.P.I. ver 4.0 ";
this.whatIs = version+'and updated on '+ UpDated;
document.write('<meta name="Author" CONTENT='+this.author+'>\n <meta name="Creator" CONTENT='+this.author+this.whatIs+'>\n');
this.FDownload = 'http:\/\/www.macromedia.com\/shockwave\/download\/index.cgi?P1_Prod_Version=ShockwaveFlash';
this.FCodebase = 'http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=4,0,2,0';
this.ClassID = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';
var plugin = 0;
currOpen = "";
var newstemp=0;
var entTemp=0;
var all_loaded=false;/*for dhtml menu*/
/*Global var end*/
function checkBrowser()
{
	this.ie4=false;
	this.ie5=false;
	this.ie6=false
	this.ns4=false;
	this.ns6=false;
	this.mac=false;	
	this.pc=false;
	this.aol=false;
	this.dom=document.getElementById?this.dom=true:this.dom=false;
	this.bname=navigator.appName;
	this.ver=navigator.appVersion;
	this.int_ver=parseInt(this.ver);
	this.navUser=navigator.userAgent;
	this.navMime=navigator.mimeTypes;
	this.navPlugs=navigator.plugins;
	this.bname.indexOf("Netscape")>=0&&this.int_ver==4?(this.ns4=true):(this.ns4=false);
	this.navUser.toLowerCase().indexOf('aol')!=-1?(this.aol=true):(this.aol=false);
	this.ver.indexOf('Mac')!=-1?(this.mac=true):(this.pc=true);
	this.navUser.indexOf('MSIE 4')>0?(this.ie4=true):(this.ie4=false);
	this.navUser.indexOf('MSIE 5')>0?(this.ie5=true):(this.ie5=false);
	this.navUser.indexOf('MSIE 6')>0?(this.ie6=true):(this.ie6=false);
	this.navUser.indexOf("Netscape6")>0?(this.ns6=true):(this.ns6=false);
this.cbs=(this.ie5||this.ie4||this.ns4||this.ns6||this.ie6);
this.CbsDOM=(this.ie5||this.ns6||this.ie6);
this.CbsNDOM=(this.ie4||this.ns4);
return this;
}
cbs=new checkBrowser();
/*Flash detect for Netscape and IE*/
if((cbs.mac)&&(cbs.ns6)){plugin=0;}
else if(cbs.navMime&&cbs.navMime["application/x-shockwave-flash"]&&cbs.navMime["application/x-shockwave-flash"].enabledPlugin){if (cbs.navPlugs &&cbs.navPlugs["Shockwave Flash"]){plugin = 1;}}
else if(cbs.navUser &&cbs.navUser.indexOf("MSIE")>=0&&(cbs.navUser.indexOf("Windows 95")>=0||cbs.navUser.indexOf("Windows 98")>=0||cbs.navUser.indexOf("Windows NT")>=0)){
document.write('<SCRIPT LANGUAGE=VBScript\> \n on error resume next \n\n plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3")))\n');
document.write('if ( plugin <= 0 ) then plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")))\n');
document.write('if ( plugin <= 0 ) then plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))\n </SCRIPT\> \n');}
/*Flash display*/
function EmbedFlash(width,height,FlashSrc,ImageSrc,SendUrl,Alt_Id_Name,MapName,color,fVer,autostart)
{
var AFT,AIT;
FlashCode='';
message='You\'ve forgotten to Akamaize your FLASH FILE and / or the Default Image.\nPlease go back and Akamaize the file. The non Akamaized file is ';
if(FlashSrc==null && ImageSrc==null){return;}
if(!FlashSrc.indexOf("akamai.net")<0){alert(message+"Flash File: "+FlashSrc+"\nlocated on:"+location.href);return;}
if(!ImageSrc.indexOf("akamai.net")<0){alert(message+"Default Image: "+ImageSrc+"\nlocated on: "+location.href);return;}
AFT=(FlashSrc.indexOf("akamai.net")>0);AIT=(ImageSrc.indexOf("akamai.net")>0);
if(AFT==false){alert(message+"Flash File: "+FlashSrc+"\nlocated on:"+location.href);return;}
if(AIT==false){alert(message+"Default Image: "+ImageSrc+"\nlocated on: "+location.href);return;}
if(!fVer){fVer=3;}
if(!width || !height){width=20;height=20;}
if(!autostart){autostart=true;}
if(!Alt_Id_Name){file_ID="CBS";}else{file_ID=Alt_Id_Name;}
if(!color){color="";}
if(plugin)
{
FlashCode=('<OBJECT classid="'+this.ClassID+'" codebase="'+this.FCodebase+'" ID="'+file_ID+'" WIDTH="'+width+'" HEIGHT="'+height+'">\n');
FlashCode+=('<PARAM NAME=movie VALUE="'+FlashSrc+'"> <PARAM NAME="quality" VALUE="high">\n<PARAM NAME="menu" VALUE="false"> \n');
FlashCode+=('<PARAM NAME="AUTOSTART" VALUE="'+autostart+'">\n<PARAM NAME="bgcolor" VALUE="'+color+'">\n');
FlashCode+=('<EMBED menu=false swLiveConnect="FALSE" src="'+FlashSrc+'" quality=high width='+width+' height='+height+' type="application/x-shockwave-flash" pluginspage="'+this.FDownload+'" autostart="'+autostart+'" high bgcolor="'+color+'"></EMBED>\n</OBJECT>');}
else if((!plugin)&&(SendUrl==this.FDownload))
{FlashCode+=('<a href="'+SendUrl+'" target="_blank"><img src="'+ImageSrc+'" alt="'+file_ID+'" border="'+0+'" width="'+width+'" height="'+height+'"></a>');}
else if((!plugin)&&(SendUrl!=this.FDownload)&&(!MapName))
{FlashCode+=('<a href="'+SendUrl+'"><img src="'+ImageSrc+'" alt="'+file_ID+'" border="'+0+'" width="'+width+'" height="'+height+'"></a>');}
else if((!plugin)&&(MapName))
{FlashCode+=('<img src="'+ImageSrc+'" alt="'+file_ID+'" border="'+0+'" width="'+width+'" height="'+height+'" usemap="'+MapName+'">');}
else
{FlashCode=('<img src="'+ImageSrc+'" alt="'+file_ID+'" border="'+0+'" width="'+width+'" height="'+height+'">');}
document.write(FlashCode);}
function jump(url){location.href = url+'.shtml';}
function init()
{
if (cbs.ns4)
{
for (var i=0;i<document.layers.length;i++)
{
var thisObj = document.layers[i];
thisObj.captureEvents(Event.MOUSEOUT);
thisObj.onmouseout = hideit;
}
}
}
function hideit (e)
{
var layname = e.target.name;
var tar = e.target+"";
if(cbs.ie5||cbs.ie4){if(layname.indexOf('search')<0)return;}
if (tar.indexOf('navigation')>=0){hide(layname);}
else {routeEvent(e);}
}
function getObjStyle(objTree)
{
var objStrArr = objTree.split('.');
var objStr = objStrArr[objStrArr.length-1];
var strS = "";
if (cbs.ns4)
{
strS += "document.layers[objStrArr[0]]";
if (objStrArr.length > 1)
{
	for(var i=1; i<objStrArr.length; i++)
{strS+=".document.layers[objStrArr["+i+"]]";}
}
return(eval(strS));
}
else if(cbs.ie4){return(document.all[objStr].style);}
}
function show(strObj)
{
var thisObj = getObjStyle(strObj);
if(all_loaded==false){return;}
if(currOpen != ""){hide(currOpen);}
if(cbs.ie4){thisObj.visibility = "visible";}
if(cbs.ns4){thisObj.visibility = "show";}
if(cbs.CbsDOM){document.getElementById(strObj).style.visibility = "visible";}
currOpen=strObj;
}
function hide(strObj)
{
var thisObj = getObjStyle(strObj);
if (cbs.ie4){s
var thisDoc = document.all[strObj];
if (!(thisDoc.contains(window.event.toElement)))
{thisObj.visibility="hidden";}}
if (cbs.ns4){thisObj.visibility = "hide";}
if(cbs.CbsDOM){document.getElementById(strObj).style.visibility = "hidden";}
currOpen="";
}
/*Flip can be used with or with out layers*/
function flip(){if (document.images){var num_arg = arguments.length-1;var layername = "";var thisObj;if ((arguments.length%2) != 0){layername = arguments[num_arg];}for (var i=0; i<num_arg; i){var j = i+1;var imgname = arguments[i];var imgsrc = arguments[j];if (cbs.ns4 && layername){thisObj = getObjStyle(layername);thisObj.document.images[imgname].src = eval(imgsrc+'.src');}else{document.images[imgname].src = eval(imgsrc+'.src');}i+=2;}}}
function makeBox(arrName,n,layerName)
{
var words = arrName[n];
var copy = words;
if(layerName=='divText'&&cbs.ns4){document.layers['divCont'].document.layers['divText'].document.open();document.layers['divCont'].document.layers['divText'].document.write(copy);document.layers['divCont'].document.layers['divText'].document.close();return;}
if(layerName!='divText'&&cbs.mac&&cbs.ie4){document.all.content.innerHTML=copy;}
if(layerName=='divText'&&cbs.mac&&cbs.ie4){document.all.divText.innerHTML=copy;}
if(cbs.ns4)
{
document.layers[layerName].document.open();
document.layers[layerName].document.write(copy);
document.layers[layerName].document.close();
}
if(cbs.CbsDOM){document.getElementById(layerName).innerHTML = copy;}
if(cbs.ie4){'document.all.'+layerName+'.innerHTML'+'='+copy;}
}
function openWin(url,w,h,winName,scroll)
{if(winName==''){winName='CbsWindow';}if(scroll==''){scroll='yes';}/*edited by AFA popwin = */
window.open(url,winName,"height="+h+",width="+w+",status=0,scrollbars="+scroll+",location=0,menubar=0,resizable=0");}
/*Real Player*/
function PlayReal(file,url,media_title)
{
/*just for tonight 10-01-01*/
if(file.indexOf('*')){document.holder.RmLive.value="true";}else{document.holder.RmLive.value="false";}
/*just for tonight 10-01-01*/
document.holder.passedRM.value=file;document.holder.RmTitle.value=media_title;window.open(url,"LateShow","height=370,width=515,status=0,scrollbars=0,location=0,menubar=0,resizable=0")}
function todayDate(){
d = new Date();
day = d.getDate();
monthint = d.getMonth();
y = d.getYear();
y += (y < 1900) ? 1900 : 0;
allmonths = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
today = allmonths[monthint]+" "+day+", "+y;
document.write(today);}
/*resize fix for ns 4*/
if (cbs.ns4){winw = window.innerWidth;winh = window.innerHeight;window.onResize = reloadwin;}
function reloadwin(){if ((winw != window.innerWidth) || (winh != window.innerHeight)){var holder=location.href;holder=holder.split("#");location.href=holder[0];}}
/*created and added on 12/15/2000@1:33pm by Alberto Araya reedited on 9-19-01*/
var myArray = new Array();
myArray = document.location.href.split("/");
var title = myArray[3];
var sec = myArray[4];
if(sec == null || title == null){if((myArray[2]=='cbs.com')||(myArray[2]=='www.cbs.com')||(myArray[2]=='stager.cbsig.net')){title = "HomePage";sec = "HomePage";}}
function size_window(w,h){thisWin(title,sec,w,h);}
function thisWin(title,sec,w,h){switch(title){case 'daytime':if(sec==''){sec='DAYTIME';popwin = window.open("/info/user_services/fb_global_form.shtml",sec,"height="+h+",width="+w+",status=0,scrollbars=no,location=0,menubar=0,resizable=yes");}
else{popwin = window.open("/info/user_services/fb_global_form.shtml",sec,"height="+h+",width="+w+",status=0,scrollbars=no,location=0,menubar=0,resizable=yes");}
break;case 'primetime':popwin = window.open("/info/user_services/fb_global_form.shtml",sec,"height="+h+",width="+w+",status=0,scrollbars=no,location=0,menubar=0,resizable=yes");break;case 'latenight':if(myArray[4]=='lateshow'){popwin = window.open("/info/user_services/fb_global_form.shtml",sec,"height="+h+",width="+w+",status=0,scrollbars=no,location=0,menubar=0,resizable=yes");}else{popwin = window.open("/info/user_services/fb_global_form.shtml",sec,"height="+h+",width="+w+",status=0,scrollbars=no,location=0,menubar=0,resizable=yes");}break;case 'news':popwin = window.open("/info/user_services/fb_global_form.shtml",sec,"height="+h+",width="+w+",status=0,scrollbars=no,location=0,menubar=0,resizable=yes");break;
case 'cbsstore':popwin = window.open("/info/user_services/fb_global_form.shtml",title,"height="+h+",width="+w+",status=0,scrollbars=no,location=0,menubar=0,resizable=yes");break;
case 'info':popwin = window.open("/info/user_services/fb_global_form.shtml",sec,"height="+h+",width="+w+",status=0,scrollbars=no,location=0,menubar=0,resizable=yes");break;
default:/*from home page.*/popwin = window.open("/info/user_services/fb_global_form.shtml",sec,"height="+h+",width="+w+",status=0,scrollbars=no,location=0,menubar=0,resizable=yes");break;}}
/**created and added on 05/11/2001@10:20am by Alberto Araya*/
/*for news and entertament ticker*/
function Entrotate(speed)
{
if((blocks[0]=="null")||(blocks[0]=="")){return;}/*will kill prsess if no info from ent*/
if(entTemp>blocks.length-1){entTemp=0;}
if(!speed){speed=5000;}
if(cbs.ie4){document.all.entcontent.innerHTML=blocks[entTemp];}
if(cbs.CbsDOM){document.getElementById('entcontent').innerHTML = blocks[entTemp];}
else if(cbs.ns4){document.layers['entcontent'].document.open();document.layers['entcontent'].document.write(blocks[entTemp]);document.layers['entcontent'].document.close();}
setTimeout("Entrotate()",speed);
entTemp++;
//if((showinfo[0]=="null")||(showinfo[0]=="")){return;}/*will kill prsess if no info from ent*/
/*edit afa
var opentags='<font class="enttext">';
var closetags='</font>';
if(entTemp>showinfo.length-1){entTemp=0;}
if(!speed){speed=2500;}
var showLink ='<table><tr><td width="180"><a href="http:\/\/www.cbs.com" class="enttext"'+showHref[entTemp]+'>'+showinfo[entTemp]+'</a></td></tr></table>';
if(cbs.ie4){document.all.entcontent.innerHTML=opentags+showLink+closetags;}
if(cbs.CbsDOM){document.getElementById('entcontent').innerHTML = opentags+showLink+closetags;}
else if(cbs.ns4){document.layers['entcontent'].document.open();document.layers['entcontent'].document.write(opentags+showLink+closetags);document.layers['entcontent'].document.close();}
setTimeout("Entrotate()",speed);
entTemp++;*/
}
function Newsrotate(speed)
{
var opentagsn='<table width="150" cellspacing="0" cellpadding="0" border="0"><tr><td valign="top"><font class="newstext">';
var closetagsn='</font></td></tr></table>';
if((newsinfo[0]=="null")||(newsinfo[0]=="null")||(newsinfo[0]=="NULL")){return;}/*will kill prsess if no info from news*/
if(newstemp>newsinfo.length-1){newstemp=0;}
if(!speed){speed=3000;}opentagsn+newsLink+closetagsn
if((newsHref[0]=="$NoURL$")&&(newsinfo[0]=="$NoINFO$")){return;}/*will kill prsess because news has braking news*/
else{var newsLink="<a target=_blank href=http:\/\/"+newsHref[newstemp]+" class=\"newstext\">"+newsinfo[newstemp]+"</a>";}
if(cbs.ie4){document.all.newscontent.innerHTML=opentagsn+newsLink+closetagsn;}
if(cbs.CbsDOM){document.getElementById('newscontent').innerHTML = opentagsn+newsLink+closetagsn;}
else if(cbs.ns4){document.layers['newscontent'].document.open();document.layers['newscontent'].document.write(opentagsn+newsLink+closetagsn);document.layers['newscontent'].document.close();}
setTimeout("Newsrotate()",speed);
newstemp++;
}
function moveLayers(layer,PosX,PosY)
{
//if(!layer||!PosX||PosY){return;}
var Mleft=PosY+"px";
var Mtop=PosX+"px";
if((cbs.pc)||(cbs.mac))
{
if(cbs.ns4){Mleft=parseInt(Mleft);Mtop=parseInt(Mtop)+(0);eval("document.layers['"+layer+"'].left="+Mleft+";");eval("document.layers['"+layer+"'].top="+Mtop+";");}
else if(cbs.ie4){Mleft= parseInt(Mleft);Mtop= parseInt(Mtop)+(0);eval("document.all['"+layer+"'].style.left="+Mleft+";");eval("document.all['"+layer+"'].style.top="+Mtop+";");}
else{Mleft= parseInt(Mleft);Mtop= parseInt(Mtop)+(0);document.getElementById(layer).style.left=Mleft;document.getElementById(layer).style.top=Mtop;}
}}

/*part of old core need to removed asap*/
function vlaunch(file)
{if (navigator.appName == "Navigator" && navigator.appVersion.indexOf('3') >= 0){
if(confirm("We\'re sorry, the CBS video player requires a version 4 broswer\nClick ok to continue to our browser download page\n Hit cancel to return")) {
window.open('story_112201.html', '', '');}}
else {var nWin = "http://host194.cbs.teb.qwest.net/apps/video/pageOne.html?" + file;window.open(nWin, 'vviewer','width=340,height=550,scrollbars=no,resize=no,location=no,status=no');}}
function pop_up( address, winname, x, y, prefs, replace )
{IE4 = (document.all) ? 1 : 0; NS4 = (document.layers) ? 1 : 0; 
if (NS4) {/*adjustments for nn*/y = (y + 15); /*height*/x = (x - 1); /*width*/} 
if (IE4) { /*adjustments for ie*/ y = (y + 10); /*height*/x = (x - 1); /*width*/} 
attributes = "width=" + x + ",height=" + y + ",status=no,toolbar=no,scrollbars=no";winLaunch( address, winname, attributes, replace );}
/*kilborn site primetime interviews*/
function openAudio(clip){poppy = window.open('/Common/includes/pt_audio_interview_module.htm?' + clip, 'audio', 'width=340,height=130,scrollbars=0');}
function win_pop_up( address, winname, attributes, replace ){winLaunch( address, winname, attributes, replace );}
function winLaunch( address, winname, attributes, replace ){var whandle = window.open( address, winname, attributes, replace );whandle.focus();}
/*ad code on 10-08-01 @ 3:01pm I removed it AFA*/
/*function ad_random(sec,sz){var size = new Array ();size = sz.split("x");var now = new Date();randomnum = parseInt(now.getTime() + (Math.random()*100));var none=0;document.write('<a href="http://ad.doubleclick.net/jump/network.now.com/network;tile=5;sec='+sec+';sz='+sz+';ord='+randomnum+'?"><img src="http://ad.doubleclick.net/ad/network.now.com/network;tile=5;sec='+sec+';sz='+sz+';ord='+randomnum+'?" width='+size[0]+' height=' +size[1] + ' border=0 vspace=0 hspace=0></a>');}*/
/*ad code end*/
/*end of old core thast needs to be removed asap*/

