function CNN_MagazinePhotoBox( photoCellId ) {
	this.photoCellId = photoCellId || "cnnMagazinePhotoCell";
	this.photoCell = ( document.getElementById ) ? document.getElementById( this.photoCellId ) : null;
	this.isSupported = Boolean( this.photoCell ) && this.photoCell.getElementsByTagName;
	this.photoLink = null;
	this.photoImage = null;
	this.trackingElements = new Array();
	this.highlight = function () { };
	
	if ( this.isSupported ) {
		this.photoLink = this.photoCell.getElementsByTagName( "A" )[0];
		this.photoImage = this.photoCell.getElementsByTagName( "IMG" )[0];
		this.trackingElements.push( document.getElementById( "cnnMagazineRow1" ) );
		this.trackingElements.push( document.getElementById( "cnnMagazineRow2" ) );
		this.trackingElements.push( document.getElementById( "cnnMagazineRow3" ) );
		
		this.highlight = function ( node, imageUrl ) {
			var nodeLink = node.getElementsByTagName( "A" ) && node.getElementsByTagName( "A" )[0].href;
			/* set image link */
			if ( this.photoLink && nodeLink ) {
				this.photoLink.setAttribute( "HREF", nodeLink );
				this.photoLink.href = nodeLink;
			}
			/* set image src */
			if ( this.photoImage && imageUrl ) {
				this.photoImage.setAttribute( "SRC", imageUrl );
				this.photoImage.src = imageUrl;
			}
			/* highlight rows */
			for ( var anItem in this.trackingElements ) {
				var trackedNode = this.trackingElements[anItem];
				if ( trackedNode ) {
					if ( node == trackedNode ) {
						trackedNode.bgColor = "#FFFFFF";
					} else {
						trackedNode.bgColor = "";
					}
				}
			}
		}
	}
}

var cnnMagPhotoBox = null;

function cnnPageOnload() {
	if ( location.pathname == '/' || location.pathname == '/index.html' ) {
		cnnMagPhotoBox = new CNN_MagazinePhotoBox();
	}
}

function pollSubPop (url,name,widgets,specialsURL) {
	popupWin = window.open(url,name,widgets);
	popupWin.opener.top.name="opener";
	popupWin.focus();
}

function CNN_openPopup(url,name,widgets,openerUrl) {
	var host=location.hostname;
	try {window.top.name = "opener";}
	catch (e) {}
	var popupWin=window.open(url,name,widgets);
	if (popupWin) {cnnHasOpenPopup=1;}
	if (popupWin && popupWin.opener) {
		if (openerUrl) {popupWin.opener.location = openerUrl;}
	}
	if (popupWin) {popupWin.focus();}
}

function cnnGetObject( id ) {
        var object = null;
        if ( document.getElementById )
        {
               object = document.getElementById( id );
        }
        else
        if ( document.all )
        {
               object = document.all[ id ];
        }
        return object;
}

var cnnEnableCL = true;
document.switchDocDomain = true;
if((window.location.pathname.indexOf('/')==window.location.pathname.lastIndexOf('/')) && (window.location.host == "sportsillustrated.cnn.com"))
{
	document.switchDocDomain = false;
}

//*************************
// CSI Functions
var cnnCSIs = new Array();
var cnnUseDelayedCSI = 0;
var localUserAgent = navigator.userAgent.toLowerCase();
if((localUserAgent.indexOf('msie')>-1) && (localUserAgent.indexOf('mac')>-1)){cnnUseDelayedCSI = 1;}

function cnnAddCSI(id,source,args)
{
	if(!args) { args='';}
	if(cnnUseDelayedCSI)
	{
		var newCSI = new Object();
		newCSI.src = source;
		newCSI.id  = id;
		newCSI.args = args;
		cnnCSIs[cnnCSIs.length]=newCSI;
	}
	else
	{
		var today = new Date();
		var currTime = today.getTime();
		var iframeArgs = '&time='+currTime;
		if(!document.switchDocDomain) {iframeArgs=iframeArgs+'&disableDocDom=1';}
		if(args)
		{
			iframeArgs=iframeArgs+'&'+args;
		}
		var iframeHtmlSrc='<iframe src="'+source+'?domId='+id+iframeArgs+'" name="iframe'+id+'" id="iframe'+id+'" width="0" height="0" align="right" style="position:absolute;visibility:hidden;"></iframe>';
		document.write(iframeHtmlSrc);
	}
}

function cnnUpdateCSI(html, id)
{
	var htmlContainerObj = cnnGetObject( id );
	if(htmlContainerObj)
	{
		htmlContainerObj.innerHTML = html;
	}

// force a refresh of the content area
	var htmlContentArea = document.body;
	if(htmlContentArea)
	{
		var previousTopVal = htmlContentArea.style.top || '0px';
		htmlContentArea.style.top = '1px';
		htmlContentArea.style.top = previousTopVal;
	}
}
function cnnHandleCSIs()
{
	if(document.body && document.body.innerHTML && cnnUseDelayedCSI)
	{
		var iframeOwner = cnnGetObject( 'csiIframe' );
		var iframeHtmlSrc = '';

		for(var incCounter=0;incCounter<cnnCSIs.length;incCounter++)
		{
			var src = cnnCSIs[incCounter].src;
			var id = cnnCSIs[incCounter].id;
			var today = new Date();
			var currTime = today.getTime();
			var args = '&time='+currTime;
			if(!document.switchDocDomain) {args=args+'&disableDocDom=1';}
			if(cnnCSIs[incCounter].args)
			{
				args=args+'&'+cnnCSIs[incCounter].args;
			}

			iframeHtmlSrc+='<iframe src="'+src+'?domId='+id+args+'" name="iframe'+id+'" id="iframe'+id+'" width="0" height="0" align="right"></iframe>';
		}
		if(iframeOwner)
		{
			iframeOwner.innerHTML=iframeHtmlSrc;
		}
	}
}
// end CSI code
//**************

//*************************
// Flash Detect & Renderer
var VBS_Result = false;

function CNN_FlashDetect() { }

CNN_FlashDetect.prototype.maxVersionToDetect = 8;
CNN_FlashDetect.prototype.minVersionToDetect = 3;

CNN_FlashDetect.prototype.hasPlugin = Boolean( Boolean(navigator.mimeTypes) &&
		navigator.mimeTypes.length &&
		Boolean(navigator.mimeTypes["application/x-shockwave-flash"]) &&
		navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin );

CNN_FlashDetect.prototype.hasActiveX = Boolean( Boolean(window.ActiveXObject) &&
		typeof ActiveXObject != "undefined" );

CNN_FlashDetect.prototype.hasWinIE = Boolean( Boolean(navigator.userAgent) &&
		( navigator.userAgent.indexOf( "MSIE" ) != -1 ) &&
		Boolean(navigator.appVersion) &&
		( navigator.appVersion.indexOf( "Win" ) != -1 ) );

CNN_FlashDetect.prototype.getVersion = function () {
	var versionNum = 0;
	var i = 0;

	if ( this.hasPlugin ) {
		if ( Boolean(navigator.plugins) && navigator.plugins.length && Boolean(navigator.plugins["Shockwave Flash"]) ) {
			var words = navigator.plugins["Shockwave Flash"].description.split( " " );
			for ( i = 0; i < words.length; ++i ) {
				if ( isNaN( parseInt( words[i] ) ) )
					continue;
				versionNum = words[i];
			}
		}
	} else if ( this.hasActiveX ) {
		var activeXObject = false;
		for ( i = this.maxVersionToDetect; i >= this.minVersionToDetect && !activeXObject; versionNum = ( activeXObject ? i : versionNum ), i-- ) {
			try {
				activeXObject = new ActiveXObject( "ShockwaveFlash.ShockwaveFlash." + i );
			} catch( e ) {
				// do nothing
			}
		}
	} else if ( this.hasWinIE ) {
		VBS_Result = false;
		for ( i = this.maxVersionToDetect; i >= this.minVersionToDetect && !VBS_Result; versionNum = ( VBS_Result ? i : versionNum ), i-- ) {
			execScript( 'on error resume next: VBS_Result = IsObject( CreateObject( "ShockwaveFlash.ShockwaveFlash.' + i + '" ) )', 'VBScript' );
		}
	}

	return ( versionNum );
}

CNN_FlashDetect.prototype.detectVersion = function ( num ) {
	var isVersionSupported = false;

	if ( ! isNaN( num ) ) {
		isVersionSupported = ( this.getVersion() >= parseInt( num ) );
	}

	return ( isVersionSupported );
}


function CNN_FlashObject( p_name, p_src, p_width, p_height, p_parameters, p_flashVars ) {
	this.m_name			= p_name;
	this.m_src			= p_src;
	this.m_width		= p_width;
	this.m_height		= p_height;
	this.m_flashVars	= p_flashVars;

// constructor
	if ( Boolean(p_parameters) )
	{
		this.setParams( p_parameters );
	}
}

// Declare member properties
CNN_FlashObject.prototype.m_name = '';
CNN_FlashObject.prototype.m_src = '';
CNN_FlashObject.prototype.m_width = '100%';
CNN_FlashObject.prototype.m_height = '100%';
CNN_FlashObject.prototype.m_flashVars = '';

CNN_FlashObject.prototype.m_params = {
	menu:		"false",
	quality:	"high",
	wmode:		"transparent"
};

CNN_FlashObject.prototype.setParam = function ( p_name, p_value ) {
	this.m_params[ p_name.toLowerCase() ] = p_value;
}

CNN_FlashObject.prototype.setParams = function ( p_paramHash ) {
	if ( typeof p_paramHash == "object" ) {
		for ( var param in p_paramHash ) {
			if ( p_paramHash[param] ) {
				this.setParam( param, p_paramHash[param] );
			}
		}
	}
}

CNN_FlashObject.prototype.getParam = function ( p_name ) {
	return ( this.m_params[ p_name.toLowerCase() ] );
}

CNN_FlashObject.prototype.getParams = function () {
	return ( this.m_params );
}

CNN_FlashObject.prototype.getFlashVarsString = function () {
	var flashVarsString = '';

	if ( typeof this.m_flashVars == "string" ) {
		flashVarsString = this.m_flashVars;
	} else if ( typeof this.m_flashVars == "object" ) {
		for ( var flashVar in this.m_flashVars ) {
			if ( flashVarsString != '' ) {
				flashVarsString += "&amp;";
			}
			flashVarsString += flashVar + "=" + escape( this.m_flashVars[flashVar] );
		}
	}

	return ( flashVarsString );
}

CNN_FlashObject.prototype.getAttributeString = function ( p_attr, p_value ) {
	return ( Boolean(p_value) ? ' ' + p_attr + '="' + p_value + '"' : '' );
}

CNN_FlashObject.prototype.getParamTag = function ( p_name, p_value ) {
	return ( Boolean(p_value) ? '<param name="' + p_name + '" value="' + p_value + '">' : '' );
}

CNN_FlashObject.prototype.getHtml = function () {
	var htmlString = '';
	var eachParam = '';
	var flashUrl = 'http://www.macromedia.com/go/getflashplayer';

// open object
	htmlString += '<object type="application/x-shockwave-flash" \
					classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
	htmlString += this.getAttributeString( 'pluginspage', flashUrl );
	htmlString += this.getAttributeString( 'id', this.m_name );
	htmlString += this.getAttributeString( 'data', this.m_src );
	htmlString += this.getAttributeString( 'width', this.m_width );
	htmlString += this.getAttributeString( 'height', this.m_height );
	htmlString += this.getAttributeString( 'flashVars', this.getFlashVarsString() );
	htmlString += '>';
	htmlString += this.getParamTag( 'movie', this.m_src );
	for ( eachParam in this.getParams() ) {
		htmlString += this.getParamTag( eachParam, this.getParam( eachParam ) );
	}
	htmlString += this.getParamTag( 'flashVars', this.getFlashVarsString() );

// open embed
	htmlString += '<embed type="application/x-shockwave-flash"';
	htmlString += this.getAttributeString( 'pluginspage', flashUrl );
	htmlString += this.getAttributeString( 'name', this.m_name );
	htmlString += this.getAttributeString( 'src', this.m_src );
	htmlString += this.getAttributeString( 'width', this.m_width );
	htmlString += this.getAttributeString( 'height', this.m_height );
	for ( eachParam in this.getParams() ) {
		htmlString += this.getAttributeString( eachParam, this.getParam( eachParam ) );
	}
	htmlString += this.getAttributeString( 'flashVars', this.getFlashVarsString() );
	htmlString += '>';

// close embed
	htmlString += '<\/embed>';

// close object
	htmlString += '<\/object>';

	return ( htmlString );
}

CNN_FlashObject.prototype.writeHtml = function () {
	document.write( this.getHtml() );
}
// end Flash detect
//*************************

//Dropdown Nav
siKHover = function() {
	var sfEls = document.getElementById("siKnav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" siKhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" siKhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", siKHover);

// Hide selects from Dropdown on IE rollover
function cnnToggleSelect(state) {
	var dom = (document.getElementById) ? true : false;
	var windows = (navigator.userAgent.toLowerCase().indexOf("windows")>-1) ? true : false;
	var ie5 = ((navigator.userAgent.toLowerCase().indexOf("msie")>-1) && dom) ? true : false;
	var cnn_selects = document.getElementsByTagName("select");
	if (windows && ie5) {
		for (i=0; i<cnn_selects.length; i++) {
			cnn_selects[i].style.visibility = state;
		}
	}
}

document.write("<scr"+"ipt type=\"text/javascript\" language=\"JavaScript1.2\" src=\"http://i.a.cnn.net/si/sifk/.element/ssi/js/1.1/adcode.js\"><\/scr"+"ipt>");

//This must always be at the very bottom
var cnnDocDomain = '';
if(location.hostname.indexOf('cnn.com')>0) {cnnDocDomain='cnn.com';}
if(location.hostname.indexOf('turner.com')>0) {if(document.layers){cnnDocDomain='turner.com:'+location.port;}else{cnnDocDomain='turner.com';}}
if(cnnDocDomain && document.switchDocDomain) {document.domain = cnnDocDomain;}
//Nothing should go after this