function showNavTab(tabId,tabNo){var tabCollection=document.getElementById(tabId);tabCollection.className='Tab'+tabNo+'Visible';}
var setupFeaturedBoxes=function(){var buttons={previous:{enabled:'images/feature_left.gif',hover:'images/feature_left_blue.gif'},next:{enabled:'images/feature_right.gif',hover:'images/feature_right_blue.gif'}};var featuredContentWidth=190;var featuredContentScrollPrefs={speed:800,axis:'x'};jQuery('.featuredBox').each(function(i){var featuredBox=jQuery(this);featuredBox
.find('.scrollArrow')
.filter('.next')
.hover(function(){jQuery(this)
.attr('src',buttons.next.hover)
.css('cursor','pointer');},function(){jQuery(this)
.attr('src',buttons.next.enabled)
.css('cursor','default');})
.click(function(){featuredBox.find('.featuredContent').scrollTo('+='+featuredContentWidth+'px',featuredContentScrollPrefs);return false;})
.end()
.filter('.prev')
.hover(function(){jQuery(this)
.attr('src',buttons.previous.hover)
.css('cursor','pointer');},function(){jQuery(this)
.attr('src',buttons.previous.enabled)
.css('cursor','default');})
.click(function(){featuredBox.find('.featuredContent').scrollTo('-='+featuredContentWidth+'px',featuredContentScrollPrefs);return false;});});jQuery('.featuredBox .featuredContent .featuredDisplayDiv').each(function(i){jQuery(this).css('width',(featuredContentWidth*jQuery(this).find('ul li').size())+'px');});};var updateLatestNewsTimestamp=function(){var now=new Date().getTime();var SECOND=1000;var MINUTE=60*SECOND;var HOUR=60*MINUTE;var DAY=24*HOUR;var latestTime=0;jQuery("#section_latestnews .HeadlineList li").each(function(i){if(jQuery(this).attr("time")){var time=new Number(jQuery(this).attr("time"));var date=new Date(time);if(time&&time>latestTime){latestTime=time;}}});if(latestTime){var timestampString='';var diff=now-latestTime;if(diff>0&&diff<(30*MINUTE)){var hours=Math.floor(diff/HOUR);var minutes=Math.floor(diff%HOUR/MINUTE);var seconds=Math.floor(diff%HOUR%MINUTE/SECOND);if(diff<MINUTE){timestampString=("Last Updated "+seconds+" "+(seconds==1?"second":"seconds")+" ago");}else if(diff<HOUR){timestampString=("Last Updated "+minutes+" "+(minutes==1?"minute":"minutes")+" ago");}else if(diff<DAY){timestampString=("Last Updated "+hours+" "+(hours==1?"hour":"hours")+" ago");}}
jQuery("#section_latestnews .lastPublished").html(timestampString);}};function linkBG(target)
{var targetDiv=document.getElementById(target);if(typeof targetDiv!='undefined'){var elementLI=targetDiv.getElementsByTagName('li');for(var i=0;i<elementLI.length;i++)
{elementLI[i].onmouseover=function(){this.className=" over";}
elementLI[i].onmouseout=function(){this.className=" out";}}}}
function loadStoryVideo(videoArray)
{if(typeof videoArray!='undefined'){var so=new SWFObject("MediaControls.swf","customcontrols","218","48",8,"#FFFFFF",true);so.addParam("allowscriptAccess","always");so.addVariable("FLASHVAR_eventHandler","CNNPlayer.getActivePlayer().handleEvent");//
so.addVariable("FLASHVAR_layout","SCRUBBER_ABOVE");so.write("controlsDiv");var config=new StandAloneVideoConfiguration();config.videoArray=new Array();config.videoArray=videoArray;config.vidString="standalone";config.vidContext="standalone";config.slateSize=new Array(218,123);config.videoDivId='videoContainer';config.playStartSlate=true;config.advanceNextAutomatically=true;config.loadSynchUnit=true;config.controlsHandler=defaultControlsHandler;config.runNextUpSlate=true;config.updateContentHandler=defaultUpdateContentHandler;config.writeContent=defaultWriteContent;config.overrideAdResources=defaultOverrideAdResources;config.bootErrorHandler=defaultBootErrorHandler;config.errorSlateHandler=defaultErrorSlateHandler;config.endSlateHandler=defaultEndSlateHandler;config.startSlateHandler=defaultStartSlateHandler;CNNPlaylistManager.getInstance('saplaylist').SALoadVideo(config);}}
function _showCurrLink(){var widgetLinks=[];widgetLinks=document.getElementById('cnnSpStoryLinks').getElementsByTagName('li');for(var i=0,len=widgetLinks.length;i<len;i++){var theLinks=[];theLinks=widgetLinks[i].getElementsByTagName('a');if(theLinks[0].href.match(location.pathname)){theLinks[0].removeAttribute("href");theLinks[0].style.color='#000';}}}
if(document.getElementById('cnnSpStoryLinks')){_showCurrLink();}
