
var videoCatController=function()
{var catID=0;function setCatID(n){catID=n;}
var doc="";var i=0;var tmpI=null;var slotCount=$$("#summaryList0 .summaryBlock").length;var ajaxUpdate=false;function setI(n){i=n;}
function setTmpI(n){tmpI=n;}
function setSlotCount(n){slotCount=n;}
function setAjaxUpdate(b){ajaxUpdate=b;}
function dhtml(newList)
{$("section_AllCatVids").insertBefore(newList,$("summaryList_"+catID));var origSlotCount=10;if(origSlotCount>slotCount)
{var diff=origSlotCount-slotCount;var divs=$("summaryList_"+i).getElementsByTagName("div");while(diff>0)
{try{$("summaryList_"+i).removeChild(divs[divs.length-3]);}catch(err){}
diff--;}}
$("summaryList_"+tmpI).hide();new Effect.Opacity("summaryList_"+i,{from:1,to:1,duration:0});$("summaryList_"+i).show();setAjaxUpdate(false);}
function parseDoc()
{var videos=doc.getElementsByTagName("video");var newList=$("summaryList_"+catID).cloneNode(true);newList.innerHTML='<div class="clearFloat"></div>';var lastDiv=newList.getElementsByTagName("div")[newList.getElementsByTagName("div").length-1];var difference=10;for(var x=0;x<difference;x++)
{var newBlock=document.createElement("div");newBlock.className="summaryBlock";newBlock.innerHTML='<a href=""><img class="img02paddingL" align="left" height="49" width="88" border="0" alt="" src=""></a><div class="cnnHeadline"><a href=""><img border="0" alt="PLAY" class="vicon" height="15" width="30" src="http://i.cdn.turner.com/money/.element/img/2.0/buttons/video/play.enabled.gif"></a><a href="">&nbsp;</a><span class="cnnDuration">00:00</span><span class="cnnDateStamp">&nbsp;</span></div><p class="cnnBlurbTxt">&nbsp;</p>';newList.insertBefore(newBlock,lastDiv);}
var images=newList.getElementsByTagName("img");var desc=newList.getElementsByTagName("p");var dur=newList.getElementsByTagName("span");var title=newList.getElementsByTagName("a");setSlotCount(10);if(videos.length<slotCount){setSlotCount(videos.length);}
var todaysDate=new Date();todaysDate=todaysDate.getTime();for(var c=0;c<slotCount;c++)
{var url="/"+videos[c].getElementsByTagName("id")[0].firstChild.nodeValue;try{images[c*2].setAttribute("src",videos[c].getElementsByTagName("thumbnail_url")[0].firstChild.nodeValue.replace(/124x70/,'88x49'));}catch(e){}
try{title[c*3+2].firstChild.nodeValue=videos[c].getElementsByTagName("headline")[0].firstChild.nodeValue;}catch(e){}
try{title[c*3].setAttribute("href",url);}catch(e){}
try{title[c*3+1].setAttribute("href",url);}catch(e){}
try{title[c*3+2].setAttribute("href",url);}catch(e){}
try{dur[c*2].innerHTML='('+videos[c].getElementsByTagName("duration")[0].firstChild.nodeValue+')';}catch(e){}
try
{var timestamp=videos[c].getElementsByTagName("timestamp")[0].firstChild.nodeValue;var theDate=new Date(timestamp*1000);var publishDate=theDate.getTime();if(((todaysDate-publishDate)/86400000)>1)
{var d=theDate.toLocaleDateString().split(",");d=d[1].substring(1).split(" ");if(d[1].indexOf('0')==0)d[1]=d[1].substring(1);dur[c*2+1].innerHTML=d[0].substring(0,3)+" "+d[1];}
else
{var t=theDate.toLocaleTimeString().split(":");var t2=t[2].split(" ");dur[c*2+1].innerHTML=t[0]+":"+t[1]+t2[1].toLowerCase();}}
catch(e){}
try{desc[c].innerHTML=videos[c].getElementsByTagName("description")[0].firstChild.nodeValue;}catch(e){}}
newList.setAttribute("id","summaryList_"+i);dhtml(newList);}
function setAjaxResponse(event)
{var location='/.element/ssi/auto/4.0/video/xml/'+i.replace(/_/,"/")+'.xml';new Ajax.Request(location,{method:'get',onSuccess:function(response){doc=Try.these(function(){return new DOMParser().parseFromString(response.responseText,'text/xml');},function(){var xmldom=new ActiveXObject('Microsoft.XMLDOM');xmldom.loadXML(response.responseText);return xmldom;});parseDoc();},onFailure:function(){new Effect.Opacity("summaryList_"+tmpI,{from:1,to:1,duration:0});setI(tmpI);setAjaxUpdate(false);},onException:function(req,ex){}});return this;}
function control(event)
{if(ajaxUpdate==true)return;try
{if($(Event.element(event).id).parentNode.getAttribute("id")!=null&&$(Event.element(event).id).parentNode.getAttribute("id")!='')
{var newClass=Event.element(event).parentNode.getAttribute("id").substring(8);}
else
{var newClass=Event.element(event).parentNode.parentNode.parentNode.getAttribute("id").substring(8);}
$('section_vidsByCat').className='cnnvnav_'+newClass;}catch(e){}
try
{$$('#section_vidsByCat .cnnSelected').each(function(value,index){value.className='';});Event.element(event).className="cnnSelected";}catch(e){}
try
{if($("summaryList_"+Event.element(event).id)!=null)
{$("summaryList_"+i).hide();setI(Event.element(event).id);new Effect.Opacity("summaryList_"+i,{from:1,to:1,duration:0});$('catHeading').innerHTML="All "+$(i).innerHTML+" Videos";$("summaryList_"+i).show();}
else
{setAjaxUpdate(true);setTmpI(i);new Effect.Opacity("summaryList_"+i,{from:.5,to:.5,duration:0});setI(Event.element(event).id);setAjaxResponse(event);}
if(i.indexOf('branding')>-1)
{$('catHeading').innerHTML=Event.element(event).innerHTML+" Videos";$$('#section_AllCatVids .moreStoriesLink')[0].innerHTML='<a href="'+Event.element(event).getAttribute("href")+'"> See All Episodes of '+Event.element(event).innerHTML;}
else
{$('catHeading').innerHTML="All "+Event.element(event).innerHTML+" Videos";$$('#section_AllCatVids .moreStoriesLink')[0].innerHTML='<a href="'+Event.element(event).getAttribute("href")+'"> See All '+Event.element(event).innerHTML+' Videos';}}
catch(e){}
return false;}
this.init=function()
{setCatID(100);setI(100);var newID='summaryList_100';$('summaryList0').setAttribute("id",newID);$$('#section_vidsByCat a').each(function(value,index){if(index!=0)
Event.observe(value,'click',function(event){control(event);Event.stop(event);});}.bind(this));};return this;}
try
{if($('section_vidsByCat')){var videoCats=new videoCatController().init();}}
catch(e){}

var popularVidsController=function()
{var currentIndex=0;var slider=null;var pageItems=[];var pageHeight=0;var tmpPageHeight=0;var mainRowHeight=0;var loaded=0;var processing=0;function setPageHeight(n){pageHeight=n;}
function setTmpPageHeight(n){tmpPageHeight=n;}
function setCurrentIndex(n){currentIndex=n;}
function setMainRowHeight(n){mainRowHeight=n;}
function setProcessing(n){processing=n;}
function setPages()
{var subIndex=0;setTmpPageHeight(0);pageItems=new Array();$$('#section_moreVids li').each(function(obj,i)
{$('section_moreVids').getElementsByTagName('li')[i].style.display="block";setTmpPageHeight(tmpPageHeight+$$('#section_moreVids li')[i].getHeight());if(parseInt(tmpPageHeight)>=parseInt(pageHeight))
{pageItems.push({index1:subIndex,index2:i-1});subIndex=i;setTmpPageHeight($$('#section_moreVids li')[i].getHeight());}
$('section_moreVids').getElementsByTagName('li')[i].style.display="none";});pageItems.push({index1:subIndex,index2:$$('#section_moreVids li').length-1});return pageItems.length;}
function equalizeHeights(tall,short1,margin,short2)
{var offset=0;if(typeof(margin)!="undefined"){offset=margin;}
if(typeof(short2)!="undefined"){offset+=$(short2).getHeight();}
$(short1).style.height=$(tall).getHeight()-offset+"px";}
function popularDHTML()
{if((currentIndex>=0)&&(currentIndex<pageItems.length))
{$('section_moreVids').getElementsByTagName('ul')[0].style.display="none";$$('#section_moreVids li').each(function(obj,i)
{if((i>=pageItems[currentIndex].index1)&&(i<=pageItems[currentIndex].index2)){$('section_moreVids').getElementsByTagName('li')[i].style.display="block";}
else{$('section_moreVids').getElementsByTagName('li')[i].style.display="none";}
Effect.Appear($('section_moreVids').getElementsByTagName('ul')[0],{delay:0,duration:.1});});}}
function wheel(event)
{var delta=0;if(!event)event=window.event;if(event.wheelDelta)
{delta=event.wheelDelta/120;if(window.opera)delta=-delta;}
else if(event.detail)
{delta=-event.detail/3;}
if((delta<0)&&(currentIndex!=(pageItems.length-1))){handle(-1);}
else if((delta>0)&&(currentIndex!=0)){handle(1);}
if(event.preventDefault)event.preventDefault();event.returnValue=false;}
function handle(delta){slider.setValueBy(-delta);}
this.setHeight=function()
{setMainRowHeight($('cnnVidPanel').getHeight());return this;};this.init=function()
{var diff=mainRowHeight-$('cnnVidPanel').getHeight();if(((loaded==0)||(diff>1)||(diff<-1))&&(processing==0))
{setCurrentIndex(0);setProcessing(1);setMainRowHeight($('cnnVidPanel').getHeight());loaded++;if(ie)
{}
else
{}
setPageHeight($('cnnCtrls_prog').getHeight()+56);setPages();$('cnnCtrls_progHandle').style.height=$('cnnCtrls_prog').getHeight()/pageItems.length+"px";popularDHTML();var values=new Array();for(var i=0;i<pageItems.length;i++)
{values.push(i);}
slider=new Control.Slider('cnnCtrls_progHandle','cnnCtrls_progbar',{axis:'vertical',range:$R(0,pageItems.length-1),values:values,onSlide:function(v){try{}catch(err){}},onChange:function(v){try{setCurrentIndex(v);popularDHTML();}catch(err){}}});Event.observe('section_moreVids','DOMMouseScroll',wheel);try{Event.stopObserving('section_moreVids','mousewheel',wheel);}catch(e){}
Event.observe('section_moreVids','mousewheel',wheel);$('cnnCtrls_up').onclick=function(){if(currentIndex!=0)handle(1);};$('cnnCtrls_down').onclick=function(){if(currentIndex!=(pageItems.length-1))handle(-1);};setProcessing(0);}
return this;};return this;}
var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS";},searchString:function(data)
{for(var i=0;i<data.length;i++){var dataString=data[i].string;var dataProp=data[i].prop;this.versionSearchString=data[i].versionSearch||data[i].identity;if(dataString){if(dataString.indexOf(data[i].subString)!=-1)
return data[i].identity;}
else if(dataProp)
return data[i].identity;}},searchVersion:function(dataString)
{var index=dataString.indexOf(this.versionSearchString);if(index==-1)return;return parseFloat(dataString.substring(index+this.versionSearchString.length+1));},dataBrowser:[{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};BrowserDetect.init();var ie=BrowserDetect.browser=='Explorer';try
{if($('section_moreVids'))
{var popularVids=new popularVidsController().setHeight();}}
catch(e){}

var cnnBVPAdSections={"news":"cnnmoney.com_businessnews_archive","business":"cnnmoney.com_businessnews_archive","business2":"cnnmoney.com_businessnews_archive","markets":"cnnmoney.com_marketsandstocks_archive","luxury":"cnnmoney.com_luxury_archive","pf":"cnnmoney.com_personalfinance_archive","moneymag":"cnnmoney.com_personalfinance_archive","fsb":"cnnmoney.com_smallbusiness_archive","smallbusiness":"cnnmoney.com_smallbusiness_archive","technology":"cnnmoney.com_technology_archive","fortune_news":"fortune.com_businessnews_archive","fortune_business":"fortune.com_businessnews_archive","fortune_markets":"fortune.com_marketsandstocks_archive","fortune_pf":"fortune.com_personalfinance_archive","fortune_smallbusiness":"fortune.com_smallbusiness_archive","fortune_technology":"fortune.com_technology_archive","fortune_fortune":"fortune.com_technology_archive","btw":"cnnmoney.com_businessnews_btw_archive","b.t.w.":"cnnmoney.com_businessnews_btw_archive","cnnmoneyreports":"cnnmoney.com_businessnews_cnnmoneyreports_archive","thebuzz":"cnnmoney.com_businessnews_thebuzz_archive","corneroffice":"cnnmoney.com_businessnews_clevel_corneroffice_archive","detroit":"cnnmoney.com_businessnews_jobsandeconomy_detroitproject_archive","gas":"cnnmoney.com_businessnews_jobsandeconomy_energy_archive","cnnmoneynow":"cnnmoney.com_marketsandstocks_cnnmoneynow_archive","strategysessions":"cnnmoney.com_marketsandstocks_strategysessions_archive","moneytips":"cnnmoney.com_personalfinance_moneytips_archive","asktheexpert":"cnnmoney.com_retirement_asktheexpert_archive","revell":"cnnmoney.com_retirement_rulesofretirement_archive","innovationnation":"cnnmoney.com_smallbusiness_innovationnation_archive","smallglobal":"cnnmoney.com_smallbusiness_smallandglobal_archive","smallbiztips":"cnnmoney.com_smallbusiness_smallbiztips_archive","fsbmakeover":"cnnmoney.com_smallbusiness_smallbusinessmakeover_archive","techtalk":"cnnmoney.com_technology_techtalk_archive","toptips":"cnnmoney.com_personalfinance_fivetips_archive","consciouscapitalism":"cnnmoney.com_businessnews_clevel_consciouscapitalism_archive","visionaries":"cnnmoney.com_businessnews_visionaries_archive","bestadvice":"fortune.com_businessnews_bestadvice_archive","bestplacelive_2010":"cnnmoney.com_personalfinance_bestplacestolive_archive","bestplacelive_2009":"cnnmoney.com_personalfinance_bestplacestolive_archive","bestplacelive_2008":"cnnmoney.com_personalfinance_bestplacestolive_archive","bestplacelive_2007":"cnnmoney.com_personalfinance_bestplacestolive_archive","bing":"fortune.com_businessnews_stanleybing_archive","csuite":"fortune.com_clevel_csuitestrategies_archive","globalforum":"fortune.com_worldbiz_globalforum_archive","streetlife":"fortune.com_marketsandstocks_streetlife_archive","brainstormtech":"fortune.com_technology_brainstorm_archive","disruptors":"fortune.com_technology_disruptors_archive","techmate":"fortune.com_technology_techmate_archive","techtransformation":"fortune.com_technology_techtransformation_archive"};var cnnStoryAdSections={"markets":"cnnmoney.com_marketsandstocks_t1","news/economy":"cnnmoney.com_businessnews_jobsandeconomy_t1","news":"cnnmoney.com_businessnews_t1","pf":"cnnmoney.com_personalfinance_t1","real_estate":"cnnmoney.com_realestate_t1","retirement":"cnnmoney.com_retirement_t1","smallbusiness":"cnnmoney.com_smallbusiness_t1","technology":"cnnmoney.com_technology_t1","fortune_news":"fortune.com_businessnews_t1","fortune_pf":"fortune.com_personalfinance_t1","fortune_smallbusiness":"fortune.com_smallbusiness_t1","fortune_technology":"fortune.com_technology_t1","fortune_lifestyle":"fortune.com_lifestyle_t1","bestbizideas":"cnnmoney.com_businessnews_bestbusinessideas_t1","greenbiz":"cnnmoney.com_businessnews_bizgreen_t1","morningbuzz":"cnnmoney.com_businessnews_thebuzz_t1","bestjobs2009":"cnnmoney.com_businessnews_jobsandeconomy_bestjobs_t1","bestjobs":"cnnmoney.com_businessnews_jobsandeconomy_bestjobs_t1","detroit":"cnnmoney.com_businessnews_jobsandeconomy_detroitproject_t1","TheRescue":"cnnmoney.com_businessnews_jobsandeconomy_election_t1","gas":"cnnmoney.com_businessnews_jobsandeconomy_energy_t1","fortuneoutlook":"cnnmoney.com_businessnews_jobsandeconomy_theoutlook_t1","luxurylifetop":"cnnmoney.com_luxury_t1","bestplacelive_2010":"cnnmoney.com_personalfinance_bestplacestolive_t1","bestplacelive_2009":"cnnmoney.com_personalfinance_bestplacestolive_t1","bestplacelive_2008":"cnnmoney.com_personalfinance_bestplacestolive_t1","bestplacelive_2007":"cnnmoney.com_personalfinance_bestplacestolive_t1","doitnow":"cnnmoney.com_personalfinance_doitnow_t1","holiday":"cnnmoney.com_personalfinance_holidaymoney_t1","holidaymoney2009":"cnnmoney.com_personalfinance_holidaymoney_t1","holiday2007":"cnnmoney.com_personalfinance_holidaymoney_t1","moneymainstreet":"cnnmoney.com_personalfinance_moneyandmainstreet_t1","familymoney":"cnnmoney.com_personalfinance_yourfamily_t1","yourfamilymoney":"cnnmoney.com_personalfinance_yourfamily_t1","familymoney":"cnnmoney.com_realestate_yourfamily_t1","yourfamilymoney":"cnnmoney.com_realestate_yourfamily_t1","MONEY":"cnnmoney.com_retirement_asktheexpert_t1","bestplaceretire_2009":"cnnmoney.com_retirement_bestplacestoretire_t1","bestplaceretire_2008":"cnnmoney.com_retirement_bestplacestoretire_t1","bestplaceretire_2007":"cnnmoney.com_retirement_bestplacestoretire_t1","bestplaceretire":"cnnmoney.com_retirement_bestplacestoretire_t1","retirerich":"cnnmoney.com_retirement_retirerich_t1","revell":"cnnmoney.com_retirement_rulesofretirement_t1","bestbizideas":"cnnmoney.com_smallbusiness_bestbusinessideas_t1","innovationnation":"cnnmoney.com_smallbusiness_innovationnation_t1","smallandglobal":"cnnmoney.com_smallbusiness_smallandglobal_t1","fsbmakeover":"cnnmoney.com_smallbusiness_smallbusinessmakeover_t1","fortunetechtalk":"cnnmoney.com_technology_techtalk_t1","toptips":"cnnmoney.com_personalfinance_fivetips_t1","visionaries":"cnnmoney.com_businessnews_visionaries_t1","bestadvice2009":"fortune.com_businessnews_bestadvice_t1","brainstormgreen":"fortune.com_businessnews_brainstormgreenconference_t1","dumbest":"fortune.com_lists_dumbmoments_t1","stanleybing":"fortune.com_businessnews_stanleybing_t1","powerwomen2009":"fortune.com_clevel_50mostpowerfulwomen_t1","powerwomen2008":"fortune.com_clevel_50mostpowerfulwomen_t1","powerwomen2007":"fortune.com_clevel_50mostpowerfulwomen_t1","powerwomen":"fortune.com_clevel_50mostpowerfulwomen_t1","csuite":"fortune.com_clevel_csuitestrategies_t1","leadership2008":"fortune.com_clevel_leadershipseries_t1","fortpower25":"fortune.com_clevel_powerissue_t1","peopleinpower":"fortune.com_clevel_powerissue_t1","bestcos2010":"fortune.com_lists_100bestcompaniestoworkfor_t1","bestcos2009":"fortune.com_lists_100bestcompaniestoworkfor_t1","bestcos2008":"fortune.com_lists_100bestcompaniestoworkfor_t1","bestcos":"fortune.com_lists_100bestcompaniestoworkfor_t1","fastestgrowingcos2009":"fortune.com_lists_fastestgrowingcompanies_t1","fastestgrowingcos2008":"fortune.com_lists_fastestgrowingcompanies_t1","fortfastgrow_2007":"fortune.com_lists_fastestgrowingcompanies_t1","fortune500_2010":"fortune.com_lists_fortune500_t1","fortune500_2009":"fortune.com_lists_fortune500_t1","fortune500_2008":"fortune.com_lists_fortune500_t1","fortune500_2007":"fortune.com_lists_fortune500_t1","fortune500_2006":"fortune.com_lists_fortune500_t1","global500_2009":"fortune.com_lists_global500_t1","global500_2008":"fortune.com_lists_global500_t1","global500_2007":"fortune.com_lists_global500_t1","globalforum":"fortune.com_worldbiz_globalforum_t1","mostadmired2009":"fortune.com_lists_mostadmiredcompanies_t1","mostadmired2008":"fortune.com_lists_mostadmiredcompanies_t1","mostadmiredcos":"fortune.com_lists_mostadmiredcompanies_t1","callawaycars":"fortune.com_lifestyle_autos_callawaycars_t1","fortluxbiz2008":"fortune.com_lifestyle_bizofluxury_t1","luxurylifetop":"fortune.com_lifestyle_lifeatthetop_t1","roadwarriorsfortune":"fortune.com_lifestyle_travel_roadwarriorsguide_t1","captainsblog":"fortune.com_marketsandstocks_streetlife_t1","investorsp-econ08":"fortune.com_personalfinance_investorsspecialguide_t1","investorsguide2010":"fortune.com_personalfinance_ultimateinvestmentguide_t1","bpsmbiz2009":"fortune.com_smallbusiness_bestplacesforsmallbusiness_t1","fsbhowwegotstarted":"fortune.com_smallbusiness_entrepreneurialheroes_t1","brainstormTech2008":"fortune.com_technology_brainstorm_t1","brainstormtech":"fortune.com_technology_brainstorm_t1","disruptors":"fortune.com_technology_disruptors_t1","techinnovation":"fortune.com_technology_innovationtechspecial_t1","techinnovators2008":"fortune.com_technology_techspecialreport_t1","biztransform":"fortune.com_technology_techtransformation_t1"};

var ipadCheck=((navigator.userAgent.indexOf('iPad')!==-1)||(navigator.userAgent.indexOf('iPhone')!==-1));var totalplaytime=-1;var totalplaytime_interval=null;function start_total_play_time()
{if(totalplaytime_interval!=null)
{window.clearInterval(totalplaytime_interval);totalplaytime_interval=null;}
totalplaytime=-1;totalplaytime_interval=window.setInterval(count_total_play_time,1000);}
function end_total_play_time()
{window.clearInterval(totalplaytime_interval);}
function count_total_play_time()
{totalplaytime++;}
function get_story_section()
{var loc=parent.location.pathname;var pairs=loc.split("/");var sectionItems=[];var section='';for(var i=0;i<pairs.length-2;i++)
{if(isNaN(parseInt(pairs[i],10))&&pairs[i]!='')
{sectionItems.push(pairs[i]);}}
for(var i=0;i<sectionItems.length;i++)
{section+=sectionItems[i];if(i<sectionItems.length-1)
{section+='/';}}
if(parent.cnnSource=="FORT")
{section="fortune_"+section;}
return section;}
function get_story_branding()
{if(typeof(top.cnnBrandingValue)=='undefined')
{return'';}
if(top.cnnBrandingValue=='')
{return'';}
return top.cnnBrandingValue;}
function get_story_ssid()
{var branding=get_story_branding();var section=get_story_section();var branding_ssid=cnnStoryAdSections[branding];var section_ssid=cnnStoryAdSections[section];if(branding_ssid!=null)
{return branding_ssid;}
if(section_ssid!=null)
{return section_ssid;}
if(parent.cnnSource=="FORT")
{section="fortune_technology";}
else
{section="news";}
return cnnStoryAdSections[section];}
function get_bvp_ssid(videoBranding,videoCategory,videoSource)
{var branding=get_story_branding();var branding_ssid=cnnBVPAdSections[branding];if(branding_ssid!=null)
{return branding_ssid;}
if(typeof(cnnBVPAdSections[videoBranding])!='undefined')
{return cnnBVPAdSections[videoBranding];}
if(videoSource.toLowerCase()=="fortune")
{if(typeof(cnnBVPAdSections["fortune_"+videoCategory])!='undefined')
{return cnnBVPAdSections["fortune_"+videoCategory];}
return cnnBVPAdSections["fortune_technology"];}
if(typeof(cnnBVPAdSections[videoCategory])!='undefined')
{return cnnBVPAdSections[videoCategory];}
return cnnBVPAdSections["news"];}
function get_smallplayer_ssid()
{var ssid='cnnmoney.com_homepage';var loc=location.pathname;if(loc=="/smallbusiness/"||loc.match("/smallbusiness/index.html"))
{ssid='cnnmoney.com_smallbusiness_sectionhomepage';}
else if(loc=='/smallbusiness/makeover/'||loc.match("/smallbusiness/makeover/index.html"))
{ssid='cnnmoney.com_smallbusiness_makeover';}
else if(loc=="/magazines/fortune/"||loc.match("/magazines/fortune/index.html"))
{ssid='fortune.com_homepage';}
else if(loc.match("data/premarket"))
{ssid='cnnmoney.com_premarkets';}
else if(loc.match("data/afterhours"))
{ssid='cnnmoney.com_afterhours';}
return ssid;}
var cnnVideoStorage=null;function initVideoStorage()
{try{cnnVideoStorage=StorageManager.getInstance().getStorage();cnnVideoStorage.setOnload(videoStorageLoaded);cnnVideoStorage.load();}
catch(e){}}
function videoStorageLoaded()
{var volume=null;try{if(document.cookie.length>0)
{var c_name='videovolume';var c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1)
{c_start=c_start+c_name.length+1;var c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;volume=unescape(document.cookie.substring(c_start,c_end));expireCookie(volume);}}}
catch(e){}
if(volume==null)
{volume=getVolumeCookie();}
storeVolume(volume);}
function storeVolume(volume)
{if(cnnVideoStorage){try{var expirationDate=new Date();expirationDate.setDate(expirationDate.getDate()+356);cnnVideoStorage.put('moneyvidvolume',volume.toString(),expirationDate);cnnVideoStorage.save();}
catch(e){}}}
function storeVolumeCookie(val)
{if(document.cookies)
{expireCookie(val);}
storeVolume(val);}
function expireCookie(volume)
{var expirationDate=new Date();expirationDate.setDate(expirationDate.getDate()-1);document.cookie='videovolume='+volume+";expires="+expirationDate.toGMTString()+';path=/';}
function writeStorageInformation(){document.getElementById('containerD').innerHTML='';str="Storage Type: "+cnnVideoStorage.name;var dataSize=0;var storeText='';if(cnnVideoStorage.name=='IEStorage'){storeText=cnnVideoStorage.dataHook.document.getElementById('dataNode').getAttribute('data');if(storeText!=null){dataSize=storeText.length;}else{dataSize=0;}}
else if(cnnVideoStorage.name=='DOMStorage'){storeText=(''+window.globalStorage[document.domain].storage);dataSize+=storeText.length;}
else if(cnnVideoStorage.name=='CookieStorage'){storeText=document.cookie;dataSize+=storeText.length;}
str+="<br>Data Size: "+dataSize;str+="<br>Storage Text: <i> "+storeText+"</i>";document.getElementById('containerD').innerHTML=str;}
function getVolumeCookie()
{var volume=.45;if(cnnVideoStorage){try
{if(cnnVideoStorage.contains('moneyvidvolume'))
{volume=cnnVideoStorage.get('moneyvidvolume');if(volume>1)
{volume=volume*.01;}}
else
{volume=.45;}}
catch(e)
{volume=.45;}}
return volume;}
function can_autostart()
{function _disableWeekendAutoplay()
{return((_isWeekend()==true)&&(_isHomepage()==true))};function _isHomepage()
{try{if(location.pathname.match('homepage.player.html')){return true;}}
catch(e){}
return false;}
function _isWeekend()
{var val=false;try{if(cnnCurrDay.toLowerCase()=='sat'||cnnCurrDay.toLowerCase()=='sun'){val=true;}}catch(e){}
return val;}
var RB=0;var firstvisit=0;if(_cvpSettings.useTurnerRB==true){if(location.hostname.match('turner.com')){RB=1;}}
if(typeof top.adHeight!='undefined'){if(top.adHeight==90){RB=1;}}
if(location.pathname.match('markets.player.html')){RB=0;}
if(document.cookie.match("cnnmoneyvideo")){firstvisit=0;}
else{document.cookie="cnnmoneyvideo=autoplay";firstvisit=1;}
if(RB==0&&firstvisit==1&&_disableWeekendAutoplay()==false)
{return true;}
return false;}
function load_house_sync_ad()
{try
{var compSize=_cvpSettings.sync_ad_width+'x'+_cvpSettings.sync_ad_height;var adTag=_cvpSettings.house_sync_ad;top.document.getElementById(_cvpSettings.sync_ad_div_id).innerHTML='<iframe src="'+adTag+'" id="companion'+compSize+'" width="'+_cvpSettings.sync_ad_width+'" height="'+_cvpSettings.sync_ad_height+'" '+'marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no></iframe>';}
catch(e){}}
function load_sync_ad()
{try
{var compSize=_cvpSettings.sync_ad_width+'x'+_cvpSettings.sync_ad_height;var adTag=document.getElementById(_cvpSettings.id).getCompanionAd(compSize);top.document.getElementById(_cvpSettings.sync_ad_div_id).innerHTML='<iframe src="'+adTag+'" id="companion'+compSize+'" width="'+_cvpSettings.sync_ad_width+'" height="'+_cvpSettings.sync_ad_height+'" '+'marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no></iframe>';}
catch(e){}}
function updatePlaylist(videoId)
{var max_items=_cvpSettings.maxPlaylistItems;try
{var pointer=_cvpPlaylist.pointer;var playlist=_cvpPlaylist.list;var start=(pointer+1);max_items--;var end=start+max_items;var str=getPlaylistItems(start,end);if(str=='')
{str=getPlaylistItems(1,max_items+1);}
$('videoPlaylist').update(str);}
catch(e)
{}}
function getPlaylistItems(start,end)
{var max_items=_cvpSettings.maxPlaylistItems;var pointer=_cvpPlaylist.pointer;var playlist=_cvpPlaylist.list;var str='';for(var i=0;i<playlist.length;i++)
{if(i>=start&&i<=end)
{max_items--;var _cmd='playVideo(\''+playlist[i].id+'\');';str+='<li>';str+='<a href="#" onclick="'+_cmd+'; return false;">';str+='<img src="http://i2.cdn.turner.com/money/.element/img/2.0/buttons/video/play.enabled.gif" width="30" height="15" class="vicon2" alt="" />';str+='</a>';str+='<a href="#" onclick="'+_cmd+'; return false;">'+playlist[i].headline+'</a>';str+='</li>';}}
if(max_items>0)
{for(var i=0;i<max_items;i++)
{var _cmd='playVideo(\''+playlist[i].id+'\');';str+='<li>';str+='<a href="#" onclick="'+_cmd+'; return false;">';str+='<img src="http://i2.cdn.turner.com/money/.element/img/2.0/buttons/video/play.enabled.gif" width="30" height="15" class="vicon2" alt="" />';str+='</a>';str+='<a href="#" onclick="'+_cmd+'; return false;">'+playlist[i].headline+'</a>';str+='</li>';}}
return str;}
function playVideo(id)
{var index=_cvpPlaylist.getIndex(id);if(index==null)
{return;}
if(!is_flash_compliant())
{if(ipadCheck)
{_cvpPlaylist.setPointer(id);html5_player.play({"autostart":true});_cvpPlaylist.pointer=index;if(typeof(updatePlaylist)=="function")
{updatePlaylist(id);}
return;}}
if(_cvpSettings.player_ready==true)
{_cvpSettings.is_user_initiated=true;player.emptyQueue();player.play(id);_cvpPlaylist.pointer=index;_cvpPlaylist.queueVideos(index+1);if(typeof(updatePlaylist)=="function")
{updatePlaylist(id);}}
else
{_cvpPlaylist.pointer=index;_cvpPlaylist.queueVideos(index+1);initializeVideo();}}
function log(s)
{try
{var logOutput=top.document.getElementById('logger');logOutput.innerHTML=s+'<br/>'+logOutput.innerHTML;}
catch(e){}}
function getSectionVideos(xmlURI,callback,async)
{var conn=getXMLHTTPRequest();if(conn==null){return;}
if(async==false)
{conn.open("GET",xmlURI,async);conn.send(null);callback(conn.responseText,conn.status);}
else
{conn.onreadystatechange=function(){if(conn.readyState==4){callback(conn.responseText,conn.status);}};conn.open("GET",xmlURI,async);conn.send(null);}}
function getSectionVideosLoaded(responseText)
{if(_cvpSettings.videoList.length>=_cvpSettings.maxVideos)
{return;}
var XML_content=getDocRoot(responseText);var XML_top_node=XML_content.getElementsByTagName("video");var numCount=_cvpSettings.videoList.length;for(var i=0;i<XML_top_node.length;i++)
{try
{var videoId=XML_top_node[i].getElementsByTagName("id")[0].childNodes[0].nodeValue;var headline=XML_top_node[i].getElementsByTagName("headline")[0].childNodes[0].nodeValue;if(videoId!=''&&headline!='')
{_cvpSettings.videoList.push({'id':videoId,'headline':headline});}}
catch(e){}}}
function getDocRoot(text_string)
{var doc=null;if(window.ActiveXObject){doc=new ActiveXObject("Microsoft.XMLDOM");doc.async="false";doc.loadXML(text_string);}
else{var parser=new DOMParser();doc=parser.parseFromString(text_string,"text/xml");}
return doc;}
function getXMLHTTPRequest()
{var _http=null;try{_http=new XMLHttpRequest();}
catch(e){try{_http=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{_http=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){}}}
return _http;}
function content_error_handler(error_message,video_id)
{if(_cvpPlaylist.list.length>_cvpPlaylist.pointer)
{player.play(_cvpPlaylist.list[_cvpPlaylist.pointer+1].id);_cvpPlaylist.queueVideos(_cvpPlaylist.pointer+2);}}
function no_flash_error()
{var noFlashImage='';switch(_cvpSettings.width)
{case 576:noFlashImage='http://i2.cdn.turner.com/money/.element/img/4.0/video/no_flash/576x361_no_flash.gif';break;case 384:noFlashImage='http://i2.cdn.turner.com/money/.element/img/4.0/video/no_flash/384x260_no_flash.gif';break;case 300:noFlashImage='http://i2.cdn.turner.com/money/.element/img/4.0/video/no_flash/300x204_no_flash.gif';break;default:break;}
var s='<a href="http://get.adobe.com/flashplayer/" target="_blank"><img src="'+noFlashImage+'" width="'+_cvpSettings.width+'" height="'+_cvpSettings.height+'" alt="" border="0"></a>';$(_cvpSettings.div_id).parentNode.innerHTML=s;}
var tracker=null;function html5Player()
{var _self=this;this.width=_cvpSettings.width;this.height=_cvpSettings.video_height;this.domIdStr=_cvpSettings.div_id;this.imagename=_cvpSettings.name;this.filename=_cvpSettings.name;this.autostart=_cvpSettings.autostart;this.playerDomId=this.domIdStr+'_html5videoplayer';this.htmlvidnode=null;this.container=null;this.headlinenode=null;this.videoData=null;this.useDynamicSync=false;this.init=function(options)
{if(typeof(options)=='undefined')
{var options={};}
this.autostart=(typeof(options.autostart)=='undefined')?_cvpSettings.autostart:options.autostart;this.htmlvidnode=null;this.container=null;this.headlinenode=null;switch(_cvpSettings.name)
{case'bvp':case'detroit':case'csuite':this.imagename='lg';this.filename='bvp';break;case'story':this.imagename='md';break;default:this.imagename=_cvpSettings.name;break;}
var headline_id=this.playerDomId+'_headline';var video_str='<div class="html5player">';video_str+='<video controls="controls" id="'+this.playerDomId+'" style="width:'+this.width+'px;height:'+this.height+'px;" ';if(this.autostart==true)
{video_str+='autoplay="autoplay" ';}
video_str+='></video>';video_str+='</div>';video_str+='<div id="'+headline_id+'"></div>';document.getElementById(this.domIdStr).innerHTML=video_str;this.htmlvidnode=document.getElementById(this.playerDomId);this.htmlvidnode.addEventListener("ended",function(){_self.next_item();});}
this.load_sync_ad=function(sync_uri)
{document.getElementById(_cvpSettings.sync_ad_div_id).innerHTML='<iframe src="'+sync_uri+'" id="companion336x280" width="'+_cvpSettings.sync_ad_width+'" height="'+_cvpSettings.sync_ad_height+'" '+'marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no></iframe>';}
this.play=function(options)
{if(typeof(options)=='undefined')
{var options={};}
var videoId=_cvpPlaylist.list[_cvpPlaylist.pointer].id;var videoXmlUrl='/video/data/4.0/'+videoId+'.xml';_cvpPlaylist.setPointer(videoId);if(typeof(updatePlaylist)=="function")
{updatePlaylist(videoId);}
var req=new XMLHttpRequest();req.onreadystatechange=function(response)
{if(req.readyState!=4)
{return;}
try
{var data=req.responseText;data=data.replace(" <?xml version","<?xml version");_self.currentVideo=null;tracker=null;var flvRegexp=new RegExp('<file type="'+_self.filename+'" bitrate="[^"]+">([^<]+)<\/file>');var flvurl=false;var flvurlMatchArr=flvRegexp.exec(data);if(flvurlMatchArr)
{flvurl=flvurlMatchArr[1];flvurl='http://ht3.cdn.turner.com/money/big/'+flvurl.replace(/\_[0-9]+x[0-9]+_dl\.flv$/,'_cnn_iphone_wifi_hi.mp4');}
var posterRegexp=new RegExp('<image name="'+_self.imagename+'" width="'+_self.width+'" height="'+_self.height+'">([^<]+)<\/image>');var posterurl='';var posturlMatchArr=posterRegexp.exec(data);if(posturlMatchArr)
{posterurl=posturlMatchArr[1];}
var headline=false;var headlineMatchArr=data.match(/<headline><!\[CDATA\[([^\]]+)\]\]><\/headline>/mi);if(headlineMatchArr)
{headline=headlineMatchArr[1];}
_self.headlinenode=document.getElementById(_self.playerDomId+'_headline');_self.headlinenode.innerText=headline;_self.htmlvidnode=document.getElementById(_self.playerDomId);if(_self.htmlvidnode!==null)
{_self.htmlvidnode.src=flvurl;_self.htmlvidnode.poster=posterurl;if(options.autostart==true)
{_self.htmlvidnode.setAttribute("autoplay","autoplay");}
_self.htmlvidnode.load();var parser=new DOMParser();data=parser.parseFromString(data,"text/xml");_self.videoData={};_self.videoData.videoId=data.querySelector('video:root').getAttribute('id');_self.videoData.videoHeadline=data.querySelector('video:root > headline').firstChild.nodeValue;_self.videoData.videoSection=data.querySelector('video:root > section').firstChild.nodeValue;_self.videoData.videoSource=data.querySelector('video:root > source').firstChild.nodeValue;_self.videoData.videoBranding=data.querySelector('video:root > branding').firstChild;_self.videoData.videoBranding=(_self.videoData.videoBranding==null)?'':_self.videoData.videoBranding.nodeValue;_self.videoData.videoSensitive=data.querySelector('video:root > isAdSensitive').firstChild;_self.videoData.videoSensitive=(_self.videoData.videoSensitive==null)?'':_self.videoData.videoSensitive.nodeValue;_self.videoData.sync=data.querySelector('video:root > ads > ad:nth-child(3)').firstChild.nodeValue;override_omniture_fields(_self.videoData.videoId,{'headline':_self.videoData.videoHeadline,'source':_self.videoData.videoSource});tracker=new CNN_VideoTracker(_self.htmlvidnode,_self.videoData,options.autostart);if(_cvpSettings.name!='bvp'&&_cvpSettings.name!='detroit')
{return;}
try{if(document.getElementById('digg-video-share-counter').innerHTML=="")
{cnnUpdateDiggButtons();}}catch(e){}
if(document.getElementById('social-share-video')!=null)
{try{cnnUpdateShareWidget({"video_id":videoId,"title":headline});}catch(e){}}
if(_self.videoData.videoSensitive.toLowerCase()=='yes')
{sync_uri=_cvpSettings.house_sync_ad;_self.load_sync_ad(sync_uri);_cvpSettings.totalSyncs=0;}
else if(_self.useDynamicSync==false)
{if(_cvpSettings.totalSyncs<_cvpSettings.maxSyncs)
{_cvpSettings.totalSyncs++;sync_uri='http://ads.cnn.com/html.ng/site=cnn_money&cnn_money_pagetype=money_video&cnn_money_position=336x280_rgt&params.styles=fs';_self.load_sync_ad(sync_uri);}}
else
{if(_cvpSettings.totalSyncs<_cvpSettings.maxSyncs)
{_cvpSettings.totalSyncs++;var additional_seg_vars='&params.styles=fs&cnn_money_pagetype=money_video&cnn_money_position=video_336x280_sync';var syncAdRequest=new XMLHttpRequest();syncAdRequest.onreadystatechange=function(response)
{if(syncAdRequest.readyState!=4){return;}
try
{var data=syncAdRequest.responseText;sync_uri='http://ads.cnn.com/html.ng/'+data+additional_seg_vars;_self.load_sync_ad(sync_uri);}
catch(e){}}
syncAdRequest.open("GET",_self.videoData.sync,true);syncAdRequest.send('');}}}}
catch(e)
{}}
req.open("GET",videoXmlUrl,true);req.send('');}
this.replay_last_item=function()
{_cvpPlaylist.setPointer(_cvpPlaylist.list[_cvpPlaylist.list.length-1].id);_self.play();}
this.next_item=function()
{if(_cvpPlaylist.list.length-1==_cvpPlaylist.pointer)
{_cvpPlaylist.pointer=0;document.getElementById(_cvpSettings.div_id).innerHTML='';this.init({'autostart':false});this.play();return;}
_cvpPlaylist.nextItem();this.play({"autostart":true});}
this.init();this.play();}
function is_flash_compliant()
{if(typeof CVP.swfobject=='object'&&!(CVP.swfobject.hasFlashPlayerVersion("9.0")))
{return false;}
return true;}
function ingest_old_video_format()
{var videoList=[];for(var i=0;i<vidConfig.videoArray.length;i++)
{if(typeof(vidConfig.videoArray[i])!="object")
{var video_json=vidConfig.videoArray[i];if(video_json.indexOf(".json")>0)
{video_json=video_json.replace('/video/','video/');video_json=video_json.replace('.json','');videoList.push({'id':video_json});}}}
if(videoList.length>0)
{vidConfig.videoArray=videoList;}}
function override_omniture_fields(video_id,o)
{cnnOmniture_prop14='';cnnOmniture_prop17='';cnnOmniture_prop19='';cnnOmniture_prop24='';if(o.source=='CNNMoney')
{cnnOmniture_prop14='CNN';}
else if(o.source=='Fortune')
{cnnOmniture_prop14='FORT';}
if(video_id.match('fsb')||video_id.match('smallbusiness'))
{cnnOmniture_prop17='Video: '+o.headline;}
switch(o.section)
{case'/video/news':cnnOmniture_prop19='News';break;case'/video/markets':cnnOmniture_prop19='Markets';break;case'/video/pf':cnnOmniture_prop19='PersonalFinance';break;case'/video/technology':cnnOmniture_prop19='Technology';break;case'/video/luxury':cnnOmniture_prop19='Luxury';break;default:break;}
if(location.pathname=="/"||location.pathname=="/index.html")
{cnnOmniture_prop24='cnnmoney homepage';}
else if(location.pathname=="/smallbusiness/"||location.pathname.match("/smallbusiness/index.html"))
{cnnOmniture_prop24='smallbusiness homepage';}
else if(location.pathname=='/smallbusiness/makeover/'||location.pathname.match("/smallbusiness/makeover/index.html"))
{cnnOmniture_prop24='smallbusiness makeover';}
else if(location.pathname=="/magazines/fortune/"||location.pathname.match("/magazines/fortune/index.html"))
{cnnOmniture_prop24='fortune homepage';}
else if(top.location.pathname.match("data/premarket"))
{cnnOmniture_prop24='premarkets';}
else if(top.location.pathname.match("data/afterhours"))
{cnnOmniture_prop24='afterhours';}
else if(location.pathname.match("story.player.html"))
{cnnOmniture_prop24='story player';}
else if(location.pathname.match("news/specials/assignment_detroit"))
{cnnOmniture_prop24='detroit homepage';}
else
{cnnOmniture_prop24='videoclip';}}
var CNN_VideoTracker=function(video,videoData,autostart)
{this.is_autostart=autostart;this.video=video;this.video.addEventListener('playing',this,false);this.video.addEventListener('ended',this,false);this.video.addEventListener('timeupdate',this,false);this.videoId=videoData.videoId;this.videoHeadline=videoData.videoHeadline;this.videoBranding=videoData.videoBranding
this.videoSection=videoData.videoSection;};CNN_VideoTracker.prototype.nielsenStart=function()
{this.nielsenStart=function(){};var bug=new Image();bug.onload=function()
{};var neilsen_uri='http://secure-us.imrworldwide.com/cgi-bin/m?ci=us-100120&c6=vc,c02';neilsen_uri+='&tl=dav0-'+this.videoHeadline;neilsen_uri+='&cg=';neilsen_uri+='&rnd='+(new Date().getTime().toString().slice(0,-3));bug.src=neilsen_uri;};CNN_VideoTracker.prototype.nielsenEnd=function()
{this.nielsenEnd=function(){};var bug=new Image();bug.onload=function()
{};var neilsen_uri='http://secure-us.imrworldwide.com/cgi-bin/m?ci=us-100120&c6=vc,c02';neilsen_uri+='&tl=dav2-'+this.videoHeadline;neilsen_uri+='&cg=';neilsen_uri+='&rnd='+(new Date().getTime().toString().slice(0,-3));bug.src=neilsen_uri;};CNN_VideoTracker.prototype.omniStart=function()
{start_total_play_time();this.omniStart=function(){};var d=new Date();var omniImage=new Image();var omniture_uri='http://metrics.cnn.com/b/ss/aolturnercnnmoney-2010/0/FAS-2.8-AS3/s15837656636722?';omniture_uri+='AQB=1';omniture_uri+='&AQE=1';omniture_uri+='&server='+location.hostname;omniture_uri+='&pageName='+encodeURIComponent(this.videoHeadline);omniture_uri+='&c1=Video';omniture_uri+='&c2=Video';if(cnnOmniture_prop14=='')
{omniture_uri+='&c5='+encodeURIComponent(cnnOmniture_prop14);}
if(this.videoBranding!='')
{omniture_uri+='&c8='+this.videoBranding;omniture_uri+='&c11='+this.videoBranding;}
omniture_uri+='&c15='+this.videoId;omniture_uri+='&c16='+cnnOmniture_prop24;omniture_uri+='&c29='+this.videoId;omniture_uri+='&c30=mny';omniture_uri+='&c32=adbp:video';omniture_uri+='&c33=adbp:video start';omniture_uri+='&v1=Video';omniture_uri+='&v2=Video';if(cnnOmniture_prop14!='')
{omniture_uri+='&v5='+encodeURIComponent(cnnOmniture_prop14);}
if(this.videoBranding!='')
{omniture_uri+='&v8='+this.videoBranding;omniture_uri+='&v11='+this.videoBranding;}
omniture_uri+='&v15='+this.videoId;omniture_uri+='&v16='+cnnOmniture_prop24;omniture_uri+='&v29='+location.hostname;omniture_uri+='&v30=mny';omniture_uri+='&v32=adbp:video';omniture_uri+='&v33=adbp:video start';omniture_uri+='&v41='+this.videoId;omniture_uri+='&v42='+this.videoId;if(this.is_autostart==true)
{omniture_uri+='&events=event32';}
else
{omniture_uri+='&events=event32,event34';}
omniture_uri+='&cc=USD';omniture_uri+='&ce=ISO-8859-1';omniture_uri+='&g='+location.href;omniture_uri+='&ndh=1';omniture_uri+='&pe=lnk_o';omniture_uri+='&pev2=Video Start';omniture_uri+='&s='+screen.width+'x'+screen.height;omniture_uri+='&t='+d.getDate()+'/'+d.getMonth()+'/'+d.getFullYear()+' '+d.getHours()+':'+d.getMinutes()+':'+d.getSeconds();omniImage.src=omniture_uri;};CNN_VideoTracker.prototype.omniHalfway=function()
{this.omniHalfway=function(){};};CNN_VideoTracker.prototype.omniEnd=function()
{this.omniEnd=function(){};end_total_play_time();var d=new Date();var omniImage=new Image();var omniture_uri='http://metrics.cnn.com/b/ss/aolturnercnnmoney-2010/0/FAS-2.8-AS3/s15837656636722?';omniture_uri+='AQB=1';omniture_uri+='&AQE=1';omniture_uri+='&products=;;;;event36='+totalplaytime;omniture_uri+='&events=event33,event36';omniture_uri+='&cc=USD';omniture_uri+='&ce=ISO-8859-1';omniture_uri+='&g='+location.href;omniture_uri+='&ndh=1';omniture_uri+='&oidt=1';omniture_uri+='&pe=lnk_o';omniture_uri+='&pev2=Video End';omniture_uri+='&pid='+location.href;omniture_uri+='&s='+screen.width+'x'+screen.height;omniture_uri+='&t='+d.getDate()+'/'+d.getMonth()+'/'+d.getFullYear()+' '+d.getHours()+':'+d.getMinutes()+':'+d.getSeconds();omniImage.src=omniture_uri;};CNN_VideoTracker.prototype.handleEvent=function(event)
{switch(event.type)
{case'playing':this.video.removeEventListener('playing',this,false);this.omniStart();this.nielsenStart();break;case'ended':this.video.removeEventListener('ended',this,false);this.omniEnd();this.nielsenEnd();break;case'timeupdate':if(this.video.currentTime/this.video.duration>=0.5){this.video.removeEventListener('timeupdate',this,false);this.omniHalfway();}
break;}};function cnnUpdateDiggButtons()
{var diggString='';for(var i=0;i<_cvpPlaylist.list.length;i++)
{var diggURI=encodeURIComponent('http://money.cnn.com/'+_cvpPlaylist.list[i].id);var diggTitle=(typeof(_cvpPlaylist.list[i].headline)=='undefined')?document.title:encodeURIComponent(_cvpPlaylist.list[i].headline);diggString+='<a class="DiggThisButton DiggMedium" href="http://digg.com/submit?url='+diggURI+'&amp;title='+diggTitle+'"></a>';}
document.getElementById('digg-video-share-counter').innerHTML=diggString;(function()
{var s=document.createElement('SCRIPT'),s1=document.getElementsByTagName('SCRIPT')[0];s.type='text/javascript';s.async=true;s.src='http://widgets.digg.com/buttons.js';s1.parentNode.insertBefore(s,s1);})();}
function getFBShareCount(uri)
{FB.api({method:'fql.query',query:'SELECT share_count FROM link_stat WHERE url="'+uri+'"'},function(response){if(!isNaN(response[0].share_count)){try{addFBShareCount(response[0].share_count);}catch(e){}}});}
function addFBShareCount(share_count){var fbcount=parseInt(share_count);if(fbcount<10000)
document.getElementById('fb-share-counter-link').innerHTML=fbcount;else if(fbcount<1000000)
document.getElementById('fb-share-counter-link').innerHTML=Math.round(fbcount/1000)+'K';else
document.getElementById('fb-share-counter-link').innerHTML=Math.round(fbcount/1000000)+'M';}
function cnnUpdateShareWidget(data)
{var videoTitle=(data.title==null)?document.title:data.title;var videoId=data.video_id;var uri='http://money.cnn.com/'+videoId+'/';var diggURI=uri+'?title='+encodeURIComponent(videoTitle);var darkScheme=(_cvpSettings.name=='detroit')?' colorscheme="dark"':'';var twitterSource='CNNMoney';if(document.getElementById('digg-video-share-counter')!=null)
{for(var i=0;i<_cvpPlaylist.list.length;i++)
{if(_cvpPlaylist.list[i].id!=data.video_id)
{document.getElementById('digg-video-share-counter').childNodes[i].style.display="none";}
else
{break;}}}
try{$('cnnVP_playerfooter').update('<fb:like action="recommend" href="'+uri+'" background="none" show_faces="false"'+darkScheme+'></fb:like>');}catch(e){}
try{document.getElementById('fb-video-recommend').innerHTML='<fb:like action="recommend" href="'+uri+'" width="305" background="none" show_faces="false" width="340" layout="standard"></fb:like>';}catch(e){}
try{document.getElementById('fb-video-share-counter').innerHTML='<a href="http://www.facebook.com/sharer.php?u='+escape(uri)+'&t='+escape(videoTitle)+'" id="fb-share-counter-link" target="_blank" onclick="if(document.getElementById(\'fb-share-counter-link\').innerHTML==\'9999\')document.getElementById(\'fb-share-counter-link\').innerHTML=\'10K\';else if((document.getElementById(\'fb-share-counter-link\').innerHTML.indexOf(\'K\')==-1)&&(document.getElementById(\'fb-share-counter-link\').innerHTML.indexOf(\'M\')==-1))document.getElementById(\'fb-share-counter-link\').innerHTML = parseInt(document.getElementById(\'fb-share-counter-link\').innerHTML)+1;"></a>';}catch(e){}
try{getFBShareCount(uri);}catch(e){}
if(uri.indexOf('.fortune')!=-1){twitterSource='FortuneMagazine';}
try{document.getElementById('tweetmeme-video-iframe').src='http://api.tweetmeme.com/button.js?source='+twitterSource+'&style=normal&url='+uri;}catch(e){}
try{FB.XFBML.parse();}catch(e){}}

var _cvpPlaylist={list:[],pointer:0,getIndex:function(id)
{for(var i=0;i<this.list.length;i++)
{if(this.list[i].id==id)
{return i;}}
return null;},getItem:function(id)
{for(var i=0;i<this.list.length;i++)
{if(this.list[i].id==id)
{return this.list[i];}}},getCurrentItemId:function()
{return this.list[this.pointer].id;},load:function(list)
{var playlist=[];if(list.length==1)
{this.list=list;return;}
if(this.list.length>=_cvpSettings.maxVideos)
{return;}
var temp_list=[];for(var i=0;i<list.length;i++)
{temp_list[i]=list[i].id;}
playlist.push(list[0]);for(var i=1;i<temp_list.length;i++)
{var found_dup=false;for(var j=0;j<playlist.length;j++)
{if(temp_list[i]==playlist[j].id)
{found_dup=true;break;}}
if(found_dup==false)
{playlist.push(list[i]);}}
this.list=playlist;},nextItem:function()
{if(_cvpPlaylist.pointer<_cvpPlaylist.list.length-1)
{_cvpPlaylist.pointer++;}},queueVideos:function(start)
{for(var i=start;i<this.list.length;i++)
{try
{player.queue(this.list[i].id);}
catch(e){}}},remove:function(video_id)
{var new_list=[];for(var i=0;i<this.list.length;i++)
{if(this.list[i].id!=video_id)
{new_list.push(this.list[i]);}}
this.load(new_list);},setPointer:function(videoId)
{var pointer=_cvpPlaylist.getIndex(videoId);this.pointer=pointer;}};

var html5_player=null;var player=null;function init_cvp_player()
{try
{_cvpSettings.videoList=vidConfig.videoArray;_cvpSettings.autostart=(typeof(vidConfig.autostart)=='undefined')?_cvpSettings.autostart:vidConfig.autostart;_cvpSettings.defaultSection=(typeof(vidConfig.defaultSection)=='undefined')?null:vidConfig.defaultSection;_cvpSettings.maxVideos=(typeof(vidConfig.maxVideos)=='undefined')?_cvpSettings.maxVideos:vidConfig.maxVideos;_cvpSettings.useTurnerRB=(typeof(vidConfig.useTurnerRB)=='undefined')?_cvpSettings.useTurnerRB:vidConfig.useTurnerRB;_cvpSettings.muteOnAutostart=(typeof(vidConfig.muteOnAutostart)=='undefined')?_cvpSettings.muteOnAutostart:vidConfig.muteOnAutostart;_cvpSettings.name=(typeof(vidConfig.name)=='undefined')?_cvpSettings.name:vidConfig.name;if(_cvpSettings.defaultSection!=null)
{getSectionVideos(_cvpSettings.defaultSection,getSectionVideosLoaded,false);}
_player.flashVars.autostart=_cvpSettings.autostart;_player.flashVars.context=_cvpSettings.name;_cvpPlaylist.load(_cvpSettings.videoList);if(!is_flash_compliant())
{try{popularVids.init();}
catch(e){}
if(ipadCheck)
{html5_player=new html5Player();return;}
else
{no_flash_error();return;}}
player.embedSWF(_cvpSettings.div_id);}
catch(e){}}
var _cvpSettings={id:'cvp_1',name:'bvp',width:576,height:360,video_height:324,div_id:'cnnVPFlashLargeContainer',sync_ad_width:336,sync_ad_height:280,sync_ad_div_id:'cnnVPAd',player_ready:false,is_user_initiated:true,house_sync_ad:'http://ads.cnn.com/html.ng/site=cnn_money&cnn_money_pagetype=money_video&cnn_money_position=video_336x280_house&cnn_money_rollup=house&page.allowcompete=yes&params.styles=fs&page.allowcompete=yes',videoList:[],autostart:true,defaultSection:null,maxVideos:7,useTurnerRB:false,muteOnAutostart:false,totalSyncs:0,maxSyncs:1};var _player={id:_cvpSettings.id,width:_cvpSettings.width,height:_cvpSettings.height,flashVars:{context:_cvpSettings.name,autostart:_cvpSettings.autostart},embed:{containerSwf:'http://i.cdn.turner.com/money/.element/apps/cvp/4.0/swf/cnn_money_video.swf',expressInstallSwf:'http://i.cdn.turner.com/money/.element/apps/cvp/4.0/swf/expressInstall.swf',options:{quality:'high',bgcolor:'#000000',allowFullScreen:'true',allowScriptAccess:'always',wmode:'transparent'}},onPlayerReady:function()
{var videoId=_cvpPlaylist.list[0].id;this.play(videoId);_cvpPlaylist.queueVideos(1);try{cnnUpdateDiggButtons();}catch(e){}
try{popularVids.init();}
catch(e){}
_cvpSettings.player_ready=true;},onAdError:function(message)
{},onAdPrerollUrl:function(videoId,adUrl)
{},onAdPostrollUrl:function(videoId,adUrl)
{},onAdStarted:function(token)
{},onAdFinished:function(token)
{},onAdSensitive:function(videoId)
{},onContentBegin:function(videoId,json)
{start_total_play_time();var json=this.getContentEntry(videoId);var o=eval('('+json+')');override_omniture_fields(videoId,o);var ssid=get_bvp_ssid(o.branding,o.category,o.source);this.setAdSection(ssid);videoId=videoId.replace("/video/","video/");_cvpPlaylist.setPointer(videoId);if(_cvpSettings.is_user_initiated==true)
{if(this.getTrackingContext()=='autostart')
{this.setTrackingContext('576x324');}}
else
{if(this.getTrackingContext()=='576x324')
{this.setTrackingContext('autostart');}}
if(_cvpPlaylist.pointer==_cvpPlaylist.list.length-1)
{_cvpSettings.is_user_initiated=true;}
else
{_cvpSettings.is_user_initiated=false;}
try{cnnUpdateShareWidget({"video_id":videoId,"title":o.headline});}catch(e){}},onContentBuffering:function()
{},onContentDataLoaded:function(videoId)
{},onContentPlay:function()
{},onContentPlayHead:function()
{},onContentStop:function(videoId)
{},onContentPause:function(videoId,paused)
{},onContentCompleted:function()
{end_total_play_time();},onContentVolume:function(muted,volume)
{},onContentError:function(videoId,error_message)
{},onVideoTrackingAdClick:function(videoId,url)
{},onVideoTrackingProgress:function(videoId,percent)
{},onVideoTrackingLifetime:function(seconds)
{},onVideoTrackingFullscreen:function(videoId,fullscreen)
{},onVideoTrackingMuted:function(videoId,muted)
{},onVideoTrackingPaused:function(videoId,paused)
{},onVideoTrackingCompleted:function(videoId)
{},onVideoTrackingReplay:function(videoId)
{},onVideoTrackingPlay:function(videoId)
{},onContentTrackingAdCountdown:function(secs)
{}};_cvpSettings.name=(typeof(vidConfig.name)=='undefined')?_cvpSettings.name:vidConfig.name;player=new CVP(_player);init_cvp_player();

