
document.write('<script language="JavaScript"> \n');document.write('window.onerror=function(){clickURL=stripParams(document.location.href);return true;} \n');document.write('if(!self.clickURL) clickURL=stripParams(parent.location.href); \n');document.write('<\/script> \n');var cvsVersion="$Revision: 1.65 $";var version=cvsVersion.replace(/\s+\S$/,"").replace(/\S+\s*/,"");var partnerID=2356;var custom=1;var popWin="width=510,height=480,resizable=1,scrollbars=1";var commonLoc="&fb=Y&url="+escape(getClickURL())+"&title="+escape(getClickTitle())+"&random="+Math.random()+"&partnerID="+partnerID+"&expire="+escape(getClickExpire());var btn=new Image();var clickRan=Math.random();var clickFac=20;if(clickFac==0)clickFac=1;if(clickRan>(1-(1/clickFac))){btn.src="http://imp.clickability.com/"+clickRan+"&"+escape(getClickTitle())+"&"+escape(getClickURL())+"?1"+"1"+"1"+"1"+"0"+"0"+"0000|"+"5010"+"|"+"4010"+"|"+"3002"+"|"+"2356"+"|"+"2356"+"|"+"1"+"|"+version+"|20";}
var IMG="http://s.a.cnn.net/si/images/clickability/";var stT,etT,ptT,mpT,altST,altET,altPT,altMP,textWrap,iCol,tCol;var spons,sponLoc,sponIntro,sponCol,sponTagTop,sponTagBot,sponFunc;var bLay=new Array(),sponLay=new Array();function ST(){window.open('http://si.savethis.clickability.com/st/saveThisApp?clickMap=saveThis'+commonLoc,'click',popWin);return false;}
function STMouseOver(){window.status='SAVE THIS';return true;}
function STMouseOut(){window.status='';return true;}
function ET(){window.open('http://si.emailthis.clickability.com/et/emailThis?clickMap=create'+commonLoc,'click',popWin);return false;}
function ETWPARAMS(url,title){window.open('http://si.emailthis.clickability.com/et/emailThis?clickMap=create'+GENCOMMONLOCSTR(url,title),'click',popWin);return false;}
function GENCOMMONLOCSTR(url,title){var u=escape(url);var t=escape(title);if(url==""){u=escape(getClickURL());}
if(title==""){t=escape(getClickTitle());}
return"&fb=Y&url="+u+"&title="+t+"&random="+Math.random()+"&partnerID="+partnerID+"&expire="+escape(getClickExpire());}
function ETMouseOver(){window.status='EMAIL THIS';return true;}
function ETMouseOut(){window.status='';return true;}
function PT(){window.open('http://si.printthis.clickability.com/pt/printThis?clickMap=printThis'+commonLoc,'click',popWin);return false;}
function PTMouseOver(){window.status='PRINT THIS';return true;}
function PTMouseOut(){window.status='';return true;}
function MP(){window.open('http://sportsillustrated.cnn.com/scripts/js/clickability/mp_templates/etmp.html','click',popWin);return false;}
function MPMouseOver(){window.status='MOST POPULAR';return true;}
function MPMouseOut(){window.status='';return true;}
function drawBtn(type,text){if(type=='h'||type=='H')type='h';if(type=='v'||type=='V')type='v';var i=bLay.length;sponLay[i]=sponTagBot;bLay[i]="";if(!textWrap){var sIconImg=IMG+iCol+"/"+type+"-s-icon-l.gif";var sTextImg=IMG+tCol+"/"+type+"-s-text-l.gif";var eIconImg=IMG+iCol+"/"+type+"-e-icon-l.gif";var eTextImg=IMG+tCol+"/"+type+"-e-text-l.gif";var pIconImg=IMG+iCol+"/"+type+"-p-icon-l.gif";var pTextImg=IMG+tCol+"/"+type+"-p-text-l.gif";var mpIconImg=IMG+iCol+"/"+type+"-mp-icon-l.gif";var mpTextImg=IMG+tCol+"/"+type+"-mp-text-l.gif";if(type=='h'){var iconHeight=18,sIconWidth=34,eIconWidth=30,pIconWidth=31,sTextWidth=50,eTextWidth=56,pTextWidth=55,mpIconWidth=30,mpTextWidth=77;}
else{var iconHeight=23,sIconWidth=35,eIconWidth=35,pIconWidth=35,sTextWidth=55,eTextWidth=55,pTextWidth=55,mpIconWidth=35,mpTextWidth=77;}}
if(textWrap){var sIconImg=IMG+iCol+"/"+type+"-s-icon-s.gif";var sTextImg=IMG+tCol+"/"+type+"-s-text-s.gif";var eIconImg=IMG+iCol+"/"+type+"-e-icon-s.gif";var eTextImg=IMG+tCol+"/"+type+"-e-text-s.gif";var pIconImg=IMG+iCol+"/"+type+"-p-icon-s.gif";var pTextImg=IMG+tCol+"/"+type+"-p-text-s.gif";var mpIconImg=IMG+iCol+"/"+type+"-mp-icon-s.gif";var mpTextImg=IMG+tCol+"/"+type+"-mp-text-s.gif";if(type=='h'){var iconHeight=24,sIconWidth=35,eIconWidth=30,pIconWidth=32,sTextWidth=30,eTextWidth=34,pTextWidth=31,mpIconWidth=31,mpTextWidth=53;}
else{var iconHeight=32,sIconWidth=35,eIconWidth=35,pIconWidth=35,sTextWidth=32,eTextWidth=32,pTextWidth=32,mpIconWidth=35,mpTextWidth=50;}}
if(spons){if(type=='h'){if(sponLoc=="top"){document.write('<table><tr><td align="right"><table><tr><td><font size="1" face="Arial,Helvetica" color="#000000">'+sponIntro+'</font> </td><td>');eval(sponTagTop);document.write('</td></tr></table></td></tr><tr><td>');}
else{document.write('<table><tr><td>');}}}
if(type=='h')document.write('<nobr>');if(stT){if(type=='v')bLay[i]+="<div>";bLay[i]+="<A HREF=\"#\" ONCLICK=\"return(ST());\" onMouseOver=\"return(STMouseOver());\" onMouseOut=\"return(STMouseOut());\">";bLay[i]+="<IMG src=\""+sIconImg+"\" width=\""+sIconWidth+"\" height=\""+iconHeight+"\" border=\"0\" alt=\""+altST+"\" title=\""+altST+"\">";if(text)bLay[i]+="<IMG src=\""+sTextImg+"\" width=\""+sTextWidth+"\" height=\""+iconHeight+"\" border=\"0\" alt=\""+altST+"\" title=\""+altST+"\">";if(type=='h')bLay[i]+="</a>&nbsp;&nbsp;";if(type=='v')bLay[i]+="</a></div>";}
if(etT){if(type=='v')bLay[i]+="<div>";bLay[i]+="<A HREF=\"#\" ONCLICK=\"return(ET());\" onMouseOver=\"return(ETMouseOver());\" onMouseOut=\"return(ETMouseOut());\">";bLay[i]+="<IMG src=\""+eIconImg+"\" width=\""+eIconWidth+"\" height=\""+iconHeight+"\" border=\"0\" alt=\""+altET+"\" title=\""+altET+"\">";if(text)bLay[i]+="<IMG src=\""+eTextImg+"\" width=\""+eTextWidth+"\" height=\""+iconHeight+"\" border=\"0\" alt=\""+altET+"\" title=\""+altET+"\">";if(type=='h')bLay[i]+="</a>&nbsp;&nbsp;";if(type=='v')bLay[i]+="</a></div>";}
if(ptT){if(type=='v')bLay[i]+="<div>";bLay[i]+="<A HREF=\"#\" ONCLICK=\"return(PT());\" onMouseOver=\"return(PTMouseOver());\" onMouseOut=\"return(PTMouseOut());\">";bLay[i]+="<IMG src=\""+pIconImg+"\" width=\""+pIconWidth+"\" height=\""+iconHeight+"\" border=\"0\" alt=\""+altPT+"\" title=\""+altPT+"\">";if(text)bLay[i]+="<IMG src=\""+pTextImg+"\" width=\""+pTextWidth+"\" height=\""+iconHeight+"\" border=\"0\" alt=\""+altPT+"\" title=\""+altPT+"\">";if(type=='h')bLay[i]+="</a>&nbsp;&nbsp;";if(type=='v')bLay[i]+="</a></div>";}
if(mpT){if(type=='v')bLay[i]+="<div>";bLay[i]+="<A HREF=\"#\" ONCLICK=\"return(MP());\" onMouseOver=\"return(MPMouseOver());\" onMouseOut=\"return(MPMouseOut());\">";bLay[i]+="<IMG src=\""+mpIconImg+"\" width=\""+mpIconWidth+"\" height=\""+iconHeight+"\" border=\"0\" alt=\""+altMP+"\" title=\""+altMP+"\">";if(text)bLay[i]+="<IMG src=\""+mpTextImg+"\" width=\""+mpTextWidth+"\" height=\""+iconHeight+"\" border=\"0\" alt=\""+altMP+"\" title=\""+altMP+"\">";if(type=='h')bLay[i]+="</a>&nbsp;&nbsp;";if(type=='v')bLay[i]+="</a></div>";}
document.write(bLay[i]);if(type=='h')document.write('</nobr>');if(spons){if(sponLoc=="top"){document.write('</td></tr></table>');}
else if(type=='h'){document.write('</td><td valign="top">');if(sponIntro&&sponIntro!=' ')document.write('<font size="1" face="Arial,Helvetica" color="#000000">'+sponIntro+'</font><br>');eval(sponTagTop);document.write('</td></tr></table>');}
else{document.write('<div><table><tr><td> ');if(sponIntro&&sponIntro!=' ')document.write('<font size="1" face="Arial,Helvetica" color="#000000">'+sponIntro+'</font><br> ');eval(sponTagTop);document.write('</td></tr></table></div>');}}}
function initBtn(){var a=initBtn.arguments;stT=a[0];etT=a[1];ptT=a[2];mpT=a[3]
textWrap=a[4];iCol=a[5];tCol=a[6];}
function initSponsor(){var a=initSponsor.arguments;spons=a[0];sponLoc=a[1];sponIntro=a[2];sponCol=a[3];sponTagTop=a[4];sponTagBot=a[5];sponFunc=a[6];}
function initAlt(save,email,print,mostpopular){altST=(save)?"Save a link to this article and return to it at www.savethis.com":"";altET=(email)?"Email a link to this article":"";altPT=(print)?"Printer-friendly version of this article":"";altMP=(mostpopular)?"View a list of the most popular articles on our site":"";}
function btnDone(){for(i=0;i<sponLay.length;i++){if(sponLay[i])eval(sponLay[i]);}}
function getClickURL(){if(self.clickURL)return clickURL;return stripParams(document.location.href);}
function getClickTitle(){if(self.clickTitle)return clickTitle;return document.title;}
function getClickExpire(){if(self.clickExpire)return clickExpire;return"";}
function stripParams(url){var clickURL=url;var index=url.indexOf("?");if(index!=-1)clickURL=(document.location.href).substring(0,index);return clickURL;}
window.onresize=function(){for(var i=0;i<document.links.length;i++){document.links[i].onclick=document.links[i].onclick;}}
if(!custom){initBtn(1,1,1,1,0,'000099','000099');initSponsor(0,'right',' ','000000',' ',' ',' ');initAlt(1,1,1,1);eval(sponFunc);drawBtn('H',1);}

var siPhotoGallery=function(){var that={};var bodyId='#sipg';var expressInstallSwf='../flash/poll/expressInstall.swf';var pageTitle='';var galleryTitle='';var url=document.location.href;var m='image';var desc='';var cl='';var galleryThumbsPath=url.replace(/[^\/]+$/,'')+'galleryThumbnails.html';var isOverShareOptionsBox=false;var isOverShareOption=false;var shareInt;var currShareBtn;that.init=function(urlPrev,urlNext,showArrowsOnLoad){this.setAdConfig();$(document).ready(function(){pageTitle=$('div.rightRail > h2').text();galleryTitle=$('h1').text();desc=$('meta[name="description"]').attr('content');if(!showArrowsOnLoad){showArrowsOnLoad=false;}
if($.browser.safari){setTimeout(initInteractiveElts,2000);}else{initInteractiveElts();}
if(urlPrev&&urlNext){initPhotoArrows(urlPrev,urlNext,showArrowsOnLoad);}
initIndexPromo();});};that.writeFlashPoll=function(pollId,qUrl,xmlLoc){var params={quality:"high",scale:"noscale",wmode:"opaque",allowscriptaccess:"always"};var flashvars={id:pollId,relatedXML:xmlLoc,questionsXML:qUrl};var attributes={id:"flashContent",name:"flashContent"};swfobject.embedSWF("http://i.cdn.turner.com/si/.e/swf/4.1/sect/photo_gallery/poll.v5.swf","flashContent","946","460","9.0.0",expressInstallSwf,flashvars,params,attributes);};initInteractiveElts=function(urlPrev,urlNext,showArrowsOnLoad){initShare();initMoreGalleries();initViewAllThumbs();initRightNav();};initPhotoArrows=function(urlPrev,urlNext,showArrowsOnLoad){if($(bodyId+' div.gallPhoto').length){$(bodyId+' div.gallPhoto div.innerFrame').arrowNav({prevUrl:urlPrev,nextUrl:urlNext,arrowY:150,initDisplayTime:2000,showArrows:showArrowsOnLoad});}};initShare=function(){var needsShareOptions=false;if($(bodyId+' div.share').css('float')==='right'){needsShareOptions=true;}
$(bodyId+' div.share').addClass('jsEnabled').find('ul.icons li a[class!="icon more"]').mouseleave(function(){if(needsShareOptions){isOverShareOption=false;shareInt=setInterval(hideShareOptions,100);}else{currShareBtn=null;}}).mouseenter(function(){if(needsShareOptions){isOverShareOption=true;showShareOptions(this);clearInterval(shareInt);}
currShareBtn=this;}).click(function(e){e.preventDefault();shareMe('image');});};initRightNav=function(){if($(bodyId+' .indexSort .outerList').length){var folder=cnnPage.path.replace(/\/[^\/]*$/,'');$(bodyId+' .indexSort .outerList li a[href='+folder+']').addClass('listNav_on');$(bodyId+' .indexSort .outerList li a[href='+folder+']').parent().parent().prev().addClass('listNav_on');}}
showShareOptions=function(obj){if($(bodyId+' div.share ul.sharePop').length>0){$(bodyId+' div.share ul.sharePop').remove();}
var shareOptionsMarkup='<ul class="module links sharePop" style="left:'+($(obj).offset().left-$(obj).parent().parent().offset().left-35)+'px;">\
                 <li><a href="#">Share this <strong>Gallery</strong></a></li>\
                 <li><a href="#" class="selected">Share this <strong>Image</strong></a></li>\
               </ul>';$(bodyId+' div.share').append(shareOptionsMarkup).find('ul.sharePop').hide().fadeIn(80);$(bodyId+' div.share ul.sharePop').mouseleave(function(){isOverShareOptionsBox=false;hideShareOptions();}).mouseenter(function(){isOverShareOptionsBox=true;clearInterval(shareInt);$(currShareBtn).addClass('over');$(this).find('li a.selected').removeClass('selected');}).find('li a').click(function(e){e.preventDefault();var index=$(this).parent().parent().find('li').index($(this).parent());if(index===0){shareMe('gallery');}else{shareMe('image');}});};hideShareOptions=function(){if(!isOverShareOptionsBox||!isOverShareOption){$(bodyId+' div.share ul.sharePop').fadeOut(100,function(){$(this).remove()});$(currShareBtn).removeClass('over');currShareBtn=null;}};shareMe=function(type){var t;var u;if(type==='image'){if(pageTitle!==''){pageTitle+=' - ';}
t=pageTitle+galleryTitle;u=url;}else{t=galleryTitle;u=url.replace(/[\w_.-]*?(?=\?)|[\w_.-]*$/g,'');u+='content.1.html';}
t+=' - Photos - SI.com';if($(currShareBtn).hasClass('email')){ETWPARAMS(u,t);}
else if($(currShareBtn).hasClass('buzz')){window.open('http://buzz.yahoo.com/buzz?targetUrl='+escape(u));}
else if($(currShareBtn).hasClass('fb')){window.open('http://www.facebook.com/sharer.php?u='+escape(u+'?eref=shareFB')+'&t='+escape(t),'pop','width=550,height=400');}
else if($(currShareBtn).hasClass('digg')){window.open('http://digg.com/submit?title='+escape(t)+'&url='+escape(u+'?eref=shareDigg')+'&media='+escape(m)+'&bodytext='+escape(desc),'pop','width=1000,height=600,scrollbars=yes');}
else if($(currShareBtn).hasClass('twitter')){var twitterTitle;if(type==='image'){twitterTitle=pageTitle;}else{twitterTitle=galleryTitle;}
window.open('http://www.sikids.com/tweet/?t='+escape(twitterTitle)+'&l='+escape(u));}};initMoreGalleries=function(){if($(bodyId+' div.moreGalls').length){$(bodyId+' div.moreGalls').addClass('jsEnabled');$(bodyId+' div.moreGalls div.gallPanel > ul').each(function(){var itemWidth=$(this).find('li').width();var totalItems=$(this).find('li').length;$(this).css('width',totalItems*itemWidth);});var gallTabs=$(bodyId+' div.moreGalls').tabs();var currContent=$(bodyId+' div.moreGalls div.gallPanel > ul')[($(gallTabs).tabs('option','selected'))];$(bodyId+' div.moreGalls div.paginator').slidePaginator({'contentPanel':currContent,'displayItems':4});$(bodyId+' div.moreGalls').bind('tabsshow',function(evt,ui){$(bodyId+' div.moreGalls div.paginator').slidePaginator({'contentPanel':ui.panel,'displayItems':4});});var gal=cnnPage.path.replace(/\/[^\/]+$/,'')+'/content.1.html';$(bodyId+' ul#mgRecent li a[href='+gal+']').parent().hide();$(bodyId+' ul#mgPopular li a[href='+gal+']').parent().hide();$(bodyId+' ul#mgPopular li a[href=http://sportsillustrated.cnn.com'+gal+']').parent().hide();$(bodyId+' ul#mgPopular li a small:contains(Views)').hide();$(bodyId+' ul#mgRelated li a[href='+gal+']').parent().hide();}};initViewAllThumbs=function(){$(bodyId+' a.thumbsBtn').click(function(e){e.preventDefault();showLightBox(galleryTitle,galleryThumbsPath,true,'body > a');});};showLightBox=function(title,url,showDisplayCount,elt){var markup='<div class="ltbx">\
          <div class="bg"></div>\
          <div class="pop">\
           <h4>'+title+'</h4><span class="count"></span><a href="#" class="close">Close</a>\
           <ul class="content"><li></li></ul>\
           <div class="clear"></div>\
          </div>\
         </div>';$(bodyId).prepend(markup).find('div.ltbx').css('height',$(document).height()).css('min-width','1060px').end().find('div.ltbx .bg').click(function(){hideLightBox();}).end().find('div.pop a.close').click(function(e){e.preventDefault();hideLightBox();}).end();$(bodyId+' div.ltbx .pop ul.content > li').load(galleryThumbsPath," ",function(){if(showDisplayCount){var numItems=$(this).find('a').length;$(this).parent().parent().parent().find('div.pop > span.count').text(numItems+' images');}});$(bodyId+' div.ltbx .pop').css('top',calculateLightBoxPopTop());$(window).bind('resize',function(e){$(bodyId+' div.ltbx .pop').css('top',calculateLightBoxPopTop());})
$(window).bind('scroll',function(e){;$(bodyId+' div.ltbx .pop').css('top',calculateLightBoxPopTop());});};hideLightBox=function(){$(bodyId+' div.ltbx').remove();$(window).unbind('resize');$(window).unbind('scroll');};calculateLightBoxPopTop=function(){return Math.ceil(($(window).height()-$(bodyId+' div.ltbx .pop').height())/2)+$(window).scrollTop()-50;};initIndexPromo=function(){if($(bodyId+'.indexGallery div.indexPromo').length){if(!checkCookie()){$(bodyId+'.indexGallery div.indexPromo').css("display","block");$(bodyId+'.indexGallery div.indexPromo a.promoB').click(function(evt){evt.preventDefault();killIndexPromo();});}}};function checkCookie(){cookiecheck=document.cookie.indexOf("sipgPromo=");if(cookiecheck!=-1){return true;}else{return false;}};killIndexPromo=function(){$(bodyId+'.indexGallery div.indexPromo').slideUp('fast');var exdate=new Date();exdate.setDate(exdate.getDate()+1);var cookieSet='sipgPromo=closed; expires='+exdate.toGMTString()+'; path=/';document.cookie=cookieSet;};that.showRelatedGalleries=function(list,limit){var count=0;var out='';for(var i=0;i<list.length;i++){var gal=list[i];if(cnnPage.path.indexOf(gal.path)==-1){var units='Photos';out+='<li><a href="'+gal.path+'/content.1.html" class="thumb info"><span class="tframe"></span>'
+'<img src="'+gal.thumb+'" alt="'+gal.headline+'" />';if(gal.type=='poll'){out+='<q class="icon poll">Poll</q>';units='Questions';}
else{out+='<q class="icon pg">Photo Gallery</q>';}
out+='<big>'+gal.headline+'</big><small>Posted: '+gal.date+'</small><small>'+gal.count+' '+units+'</small></a></li>'+"\n";count++;if(limit){if(count>=limit)break;}}}
document.write(out);};that.setAdConfig=function(){if(this.adConfig){;}else{this.adConfig={"preroll_cap":"3","preroll":"","ad300x250":"","promo300x50":"","banner":"","chip":"","skin":"","sponsored":"0"};return;}
var folder=cnnPage.path.replace(/\/multimedia\/photo_gallery/,'').replace(/[^\/]+$/,'');for(var i=0;i<this.adConfig.sponsored_list.length;i++){var profile=this.adConfig.sponsored_list[i];if(cnnPage.path.indexOf(profile.url)>=0||folder==profile.page){this.adConfig.sponsored=1;if(profile.preroll){this.adConfig.preroll=profile.preroll;}
if(profile.ad300x250){this.adConfig.ad300x250=profile.ad300x250;}
if(profile.promo300x50){this.adConfig.promo300x50=profile.promo300x50;}
if(profile.promoEOG){this.adConfig.promoEOG=profile.promoEOG;}
if(profile.chip){this.adConfig.chip=profile.chip;}
if(profile.banner){this.adConfig.banner=profile.banner;}
if(profile.skin){this.adConfig.skin=profile.skin;}
break;}}}
that.getSponsorSkin=function(){if(this.adConfig.skin){renderAd(this.adConfig.skin);}}
that.getSponsorChip=function(){if(this.adConfig.chip){renderAd(this.adConfig.chip);}}
that.getSponsorBanner=function(){if(typeof(this.adConfig.banner)=='object'){var out='<div class="indexPromo"><a href="'+this.adConfig.banner.url+'" class="promoB">close</a>'
+'<img src="'+this.adConfig.banner.image+'"/></a></div>';document.write(out);}}
that.getPromo300x50=function(){if(typeof(this.adConfig.promo300x50)=='object'){var out='<div class="promo300x50"><div class="inner"><a href="'+this.adConfig.promo300x50.url+'">'
+'<img src="'+this.adConfig.promo300x50.image+'"/></a></div></div>';document.write(out);}}
that.getPromoEOG=function(){if(typeof(this.adConfig.promoEOG)=='object'){var out='<a href="'+this.adConfig.promoEOG.url+'"><img class="eogPromo" src="'+this.adConfig.promoEOG.image+'"/></a>';document.write(out);}}
that.getAd300x250=function(){renderAd(this.adConfig.ad300x250,'multimedia_photo_gallery','sz=300x250,300x600',300,250,'300x600,160x600');}
renderAd=function(cfg,defZone,defParam,defWidth,defHeight,defMultisize){var zone,param,width,height,multizize='';if(defZone){zone=defZone;}
if(defParam){param=defParam;}
if(defWidth){width=defWidth;}
if(defHeight){height=defHeight;}
if(defMultisize){multizize=defMultisize;}
if(cfg){var adParams=cfg.split('|');if(adParams.length>=2){zone=adParams[0];param=adParams[1];}
if(adParams.length>=4){width=adParams[2];height=adParams[3];}
if(adParams.length>=5){multizize=adParams[4];}}
cnnad_preamble();cnnad_createAd(zone,param,width,height,multizize);}
that.prerollCheck=function(){var msg='';var viewed='';if(readCookie('cnnViewedPG')){viewed=readCookie('cnnViewedPG').toString();}
var sipgID=cnnPage.path.replace(/\/[^\/]+$/,'').replace(/\/multimedia\/photo_gallery\//,'').replace(/\//g,'.');var viewedList=viewed.split("|");var viewedCount=0;if(viewed!=''){for(i=0;i<viewedList.length;i++){if(viewedList[i].indexOf('sponsored')==-1&&viewedList[i].indexOf(sipgID)==-1&&viewedList[i]!=''){viewedCount++;}}}
if(this.adConfig.sponsored==1){msg+='Sponsored=yes, ';if(viewed.indexOf('sponsored'+sipgID)==-1){if(viewed!=''){viewed+="|";}
viewed+='sponsored'+sipgID;this.doPreroll();}}else{msg+='Sponsored=no, ';if(viewed.indexOf(sipgID)==-1){if(viewed!=''){viewed+="|";}
viewed+=sipgID;viewedCount++;}
if(viewedCount>=this.adConfig.preroll_cap){viewed='';this.doPreroll();}}
msg+='Count='+viewedCount+', ';msg+='Viewed='+viewed+' ';createCookie('cnnViewedPG',viewed,1);}
that.doPreroll=function(){if(this.adConfig.preroll.indexOf('|')==-1){return;}
var thumb='http://i.cdn.turner.com/si/.e1d/img/4.0/global/logos/si_100x100.jpg';if(this.galleryThumb)thumb=this.galleryThumb;var preroll=new siPrerollAd();preroll.writeAd({thumbnailImage:thumb});}
return that;};

var siPrerollAd=function(){var that={};var contentElt;var prerollElt;var pInt;var pCount;var hashAdInPrefix="_pi";var hashAdOutPrefix="_po";var now=new Date().getTime();var settings={adTagUrl:'/ads/photo_gallery/sipgPrerollAd.html',height:'600',width:'1020',contentId:'primeCont',preEltId:'preRollCont',thumbnailImage:'',pollInterval:500,pollTimeout:20000};that.writeAd=function(params){for(name in params){settings[name]=params[name];}
contentElt=document.getElementById(settings.contentId);prerollElt=document.getElementById(settings.preEltId);prerollElt.style.height=settings.height+'px';var imgQs='';if(settings.thumbnailImage!=''){imgQs='&img='+settings.thumbnailImage;}
var s;var frameUrl=settings.adTagUrl+'?hmi='+(hashAdInPrefix+now)+'&hmo='+(hashAdOutPrefix+now)+'&title='+document.getElementsByTagName('h1')[0].innerHTML+imgQs;if(navigator.userAgent.indexOf("Firefox")!=-1){s=document.createElement('object');s.setAttribute('data',frameUrl);s.setAttribute('type','text/html');}else{s=document.createElement('iframe');s.setAttribute('src',frameUrl);s.setAttribute('frameborder','0');s.setAttribute('scrollbars','no');s.setAttribute('allowTransparency','true');}
s.setAttribute('width',(Number(settings.width)+10)+'px');s.setAttribute('height',(Number(settings.height)+10)+'px');s.style.margin='-5px 0 0 -5px';prerollElt.appendChild(s);prerollElt.style.display='none';startPolling();};removePreroll=function(){if(prerollElt!=null){prerollElt.parentNode.removeChild(prerollElt);showContent();}};hideContent=function(){if(contentElt!=null){contentElt.style.display='none';}};showContent=function(){if(contentElt!=null){contentElt.style.display='block';}};startPolling=function(){pCount=0;pInt=setInterval(pollLoc,settings.pollInterval);};stopPolling=function(){clearInterval(pInt);};pollLoc=function(){var u=window.location.hash;if(u==="#"+hashAdInPrefix+now){prerollElt.style.display='block';hideContent();}
else if(u==="#"+hashAdOutPrefix+now){removePreroll();showContent();stopPolling();clearHash();}
pCount++;if(pCount>settings.pollTimeout&&prerollElt.style.display==='none'){stopPolling();}};clearHash=function(){window.location.href=window.location.href.split('#')[0]+"#";};return that;};

