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 moz1_5,ns4,ns6,ns7,ie4,ie5,ie5_5,ie,iex,ns,win,ie6,aol,opera,icab,omniWeb,linux,Mac,safari,firefox,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("firefox/")!=-1){firefox = true;}/*firefox*/
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("gecko/200") != -1 && int_ver == 5 && (nUser.indexOf("netscape/6")==-1 && nUser.indexOf("netscape/7")==-1)){moz1_5 = true;}/*mozilla 1.5 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 && nUser.indexOf('msie 5.5')==-1){ie5 = true;}/*internet explorer 5*/
if (nUser.indexOf('msie 5.5') >0){ie5_5 = true;}/*internet explorer 5*/
if (nUser.indexOf('msie 6') >0){ie6 = true;}/*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/small_player/cbsnews_videoplayer.shtml";//obj+"&title="+title;
var	templ2="http://www.cbsnews.com/htdocs/videoplayer/newVid/small_player/cbsnews_videoplayer_help.html";
var templ4="http://www.cbsnews.com/htdocs/videoplayer/newVid/small_player/cbsnews_videoplayer_settings.html";
var templ5="http://www.cbsnews.com/htdocs/videoplayer/newVid/small_player/cbsnews_videoplayer_help.html";
var templ6="http://www.cbsnews.com/htdocs/videoplayer/newVid/small_player/cbsnews_videoplayer_help_windows.html";
var templ7="http://www.cbsnews.com/htdocs/videoplayer/newVid/small_player/cbsnews_videoplayer_help_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('<SCRIPT LANGUAGE=VBScript\> \n');
        	document.write('on error resume next \n');
	        document.write('RealPlayerG2 = (NOT IsNull(CreateObject("rmocx.RealPlayer G2 Control")))\n');
        	//document.write('RealPlayer7 = (NOT IsNull(CreateObject("RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)")))\n');
	        document.write('RealPlayer8 = (NOT IsNull(CreateObject("RealVideo.RealVideo(tm) ActiveX Control (32-bit)")))\n');
        	document.write("</SCRIPT\> \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";
		numPlugins = navigator.plugins.length;
		for (i = 0; i < numPlugins; i++)
		{
		plugin = navigator.plugins[i];
			if (plugin.name.substring(0,10)=="Windows Media Player")
			{
				wmpInfo.installed = true;
				//wmpInfo.scriptable = false;
				wmpInfo.versionInfo = "PluginVersion";
				return wmpInfo;
			}
		}

		/*if(player)
		{	
			
			alert("if netscape and windows media");
			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)
		{
			/*alert("this is not mozilla");*/
			if(detectionResults.versionInfo.indexOf("9")!=-1 || detectionResults.versionInfo.indexOf("10")!=-1 || detectionResults.versionInfo.indexOf('PluginVersion')!=-1){return  true}
		}
		else if(detectionResults == "[object Object]")
		{
		return true;/*alert("detection Results :  "+detectionResults);*/
		}
	}
	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;i<divelement.length;i++){
				if(divelement[i] != obj){document.layers[divelement[i]].visibility = "hide"}
				}
		}else if(ie5||ie6||ns6||ns7||moz1_5||Mac){
			for(i=0;i<divelement.length;i++){
				if(divelement[i] != obj){document.getElementById(divelement[i]).style.visibility = "hidden";}
				}
		}/*else if(ie4){
			for(i=0;i<divelement.length;i++){
				if(divelement[i] != obj){alert();}else{'document.all.'+divelement[i]+'.style.visibility'+'="hidden"';}
			}
		}*/
	}
	function popUp(divobj) {
	if (ns4) {
	        document.layers[divobj].visibility="view";
			clearall(divobj);	
	} else if (ie5||ie6||ns6||ns7||moz1_5||Mac) {
			document.getElementById(divobj).style.visibility = "visible";
			clearall(divobj);			
	}else if(ie4){
			'document.all.'+divobj+'.style.visibility'+'="visible"';
	}
	
	}
	function popDown(divobj) {
	if (ns4) {
		document.layers[divobj].visibility="hide";
		//alert(document.layers[divobj].visibility);
	} else if (ie5||ie6||ns6||ns7||moz1_5||Mac) {
	    document.getElementById(divobj).style.visibility = "hidden";
	}else if(ie4){
		'document.all.'+divobj+'.style.visibility'+'="hidden"';
	}
	
	}
	
	function launch(pageTitle,w,h,address)
	{
		newWin = window.open("",pageTitle,'width='+w+',height='+h+',status=no,toolbar=no,scrollbars=no')
		newWin.location = address
	}
				
	function PopUp(url,w,h,winname) {
	if ((w == 540) && (h == 400)) {
		w = 740;
		h = 461;
	}
	var dim = eval('"width=' + w + ',height=' + h + '"');
	if(winname == null || winname==" ")
	{
		winname = "cbsnews";
	}
	Npop = window.open(url,winname,dim,'status=no,toolbar=no,scrollbars=no');
	}
	
	look_here=document.location.href;
	h=570;
	w=550;
	var loc='http://www.cbsnews.com/htdocs/feedback/fb_news_form.shtml';
	
	function OpenFeedBack()
	{
		if(look_here.indexOf('earlyshow') != -1)
			{
			var er=3465;
			popwin =window.open("http://www.cbsnews.com/htdocs/feedback/fb_news_form.shtml",er,"height="+h+",width="+w+",status=0 ,scrollbars=0 ,location=0 ,menubar=0 ,resizable=0");
			}
		else
			
			{
			popwin =window.open("http://www.cbsnews.com/htdocs/feedback/fb_news_form.shtml",secid ,"height="+h+",width="+w+",scrollbars=0 ,location=0 ,menubar=0 ,resizable=0");
			}
	}


/*this is to get the date and time*/			
var month = new Array('Jan.','Feb.','March','April','May','June','July','August','Sept.','Oct.','Nov.','Dec.');
var the_date = new Date();
var the_day = the_date.getDate();
var the_month = the_date.getMonth();
var the_year = the_date.getFullYear();
var the_minutes = fixTime(the_date.getMinutes());
var the_hour = fixhour(the_date.getHours());
/*alert(the_date.getMinutes()+" this is the hour"+the_date.getHours());*/
var the_current_dateAndTime = month[the_month]+" " +the_day +", " + the_year+" " + the_hour + ":" + the_minutes;
var the_currentTime = the_hour + ":" + the_minutes;
function fixhour(the_hour) {

	if (the_hour >12) 
	{
		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 checkUrl()
	{
		if(previous_url != story_url){document.location.href=story_url}
	}
	
 function makeHome(){
	 if(ie4||ie5||ie6){
		home  = document.write('<a href="javascript:history.go(0);" onClick="this.style.behavior=\'url(#default#homepage)\';this.setHomePage(loc); return false;" class="linksmall">');
		home += document.write('Make Us Your Home Page</a>');
	}
	else if(ns4||ns6||ns7)
	{
		home = document.write('<a href="javascript:history.go(0);" onclick="check(\'ns4\'); return false;" class="linksmall">Make Us Your Home Page</a>');
		//PopUp(\'framesource_instructions.html\',280,400,\'CBSNewsHome\');
	}
	else
	{
		home = document.write('<a href="javascript:history.go(0);" onclick="check(\"other\");" class="linksmall">Make Us Your Home Page</a>');
	}
	
	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 = '<table cellspacing=0 cellpadding=1 border=0 width=200><tr><td bgcolor="'+bgc+'">';
	da_text += '<table width=100% cellspacing=0 cellpadding=2 border=0 bgcolor=#DDDDDD><tr><td align=left><font class="bodysmall">';
	da_text += da_content+third;
	da_text += '</font></td></tr></table></td></tr></table>';
	
	/*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||firefox||safari) && (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;}*/
	}
	
	
	function sendCBSNews_HBX(pdfpage){
			
	 thisACCT = "DM52100714BB;DM530910EMZA"	  
  	 thisPN = "complete+report+"+pdfpage+"+-+201";
	
	 _hbSet("hb", thisACCT);
	_hbSet("vcon", 'national');
	_hbSet("n", thisPN);
	
	_hbSend();
	} 
	
	function gotoURL(obj){
		var url = obj.split("?");
		var isTaken = getCookieValue("usability_survey");
		var loc = obj.split("?url=");
		var newloc = "http://www.cbsnews.com"+loc[1];
		if(isTaken=='taken'){document.location.href=newloc;}
		else if(isTaken!="taken")
		{	if(cbsnews_ip.substring(0, 7)!="170.20."){document.location.href = "/htdocs/user_survey/story_usability_survey.html?"+url[1];}
			else{document.location.href=newloc;}
		}
	}
	