var cnn_omnitureData = new Array();
cnn_omnitureData = {
	path: null, // set automatically
	server: null, // set automatically
	section: null,
	pageType: null,
	branding: null,
	date: null,
	slug: null,
	file: null,
	referrer: null,
	pageName: null
}
var sectionNameError = "unknown section";
var eventNameError = "unknown event";
var videoNameError = "unknown video";

cnn_omnitureData['server'] = window.location.host;
cnn_omnitureData['path'] = ( document.URL ).replace( /http:\/\/([^\/]+)/, "" );
cnn_omnitureData['path'] = ( cnn_omnitureData['path'] ).replace( /\/\//, "/" );
if( cnn_omnitureData['path'].charAt( cnn_omnitureData['path'].length - 1 ) == "/" ) cnn_omnitureData['path'] += "index.html"; // make sure there's always a filename
if( queryString( 'eref' ) != "false" ) {
	cnn_omnitureData['referrer'] = "from ";
	switch( queryString( 'eref' ) ) {
		case "google_phpm":	cnn_omnitureData['referrer'] += "Google"; break;
		case "siwriters_yahoo":	cnn_omnitureData['referrer'] += "Yahoo"; break;
		case "yahoo":		cnn_omnitureData['referrer'] += "Yahoo"; break;
		case "fromFront_yahoo":	cnn_omnitureData['referrer'] += "Yahoo Front"; break;
		case "cnn":		cnn_omnitureData['referrer'] += "CNN"; break;
		default:		cnn_omnitureData['referrer'] += "unknown"; break;
	}
	cnn_omnitureData['referrer'] += " - " + cnn_omnitureData['path'];
}
if( queryString( 'cnn' ) != "false" ) {
	cnn_omnitureData['referrer'] = "from ";
	switch( queryString( 'cnn' ) ) {
		case "yes":		cnn_omnitureData['referrer'] += "CNN"; break;
		default:		cnn_omnitureData['referrer'] += "unknown"; break;
	}
	cnn_omnitureData['referrer'] += " - " + cnn_omnitureData['path'];
}
var path_array = ( cnn_omnitureData['path'].substr( 1 ) ).split( "/" );

/******************************
 START CATEGORZING
 ******************************/

// FANTASY SITE
	if( window.location.host == "games.si.cnn.com" ) { setGamesHostname(); }
// DYNAMIC SITE
	else if( window.location.host == "dynamic.si.cnn.com" ) { setDynamicHostname(); }
// TSN SITE
	else if( window.location.host == "sports.si.cnn.com" ) { setSportsHostname(); }
// SECONDTHOUGHT
	else if( ( window.location.host ).indexOf( "secondthought.com" ) > 0 ) { setSecondThoughtHostname(); }
// HOME FRONT
	else if( path_array[0] == "index.html" ) { setFronts( "Home" ); }
	else if( document.URL == "http://sportsillustrated.cnn.com" ) { setFronts( "Home" ); }
// CMS STORIES
	else if( ( path_array[0] ).match( /^\d{4}/ ) ) { setCMSStory(); } // if path starts with a YEAR, it's a story
// CMS PREVIEWS STORIES
	else if( path_array[0] == "preview" ) { setCMSStory(); } // if path starts with a YEAR, it's a story
// PHOTO GALLERIES
	else if( ( path_array[0] == "multimedia" ) && ( path_array[1] == "photo_gallery" ) ) { cnn_omnitureData['path'] = cnn_omnitureData['path'].split( "?" )[0];path_array = ( cnn_omnitureData['path'].substr( 1 ) ).split( "/" );setPhotoGallery() }
// SI ONLINE
	else if( ( path_array[0] == "si_online" ) && ( path_array[1] == "covers" ) ){ setGeneric( "SI Covers", "SI Covers - Cover" ); }
// SI BLOGS
	else if( path_array[0] == "si_blogs" ){ setBlogs(); }
// SI WRITERS
	else if( path_array[0] == "writers" ){ setWriters(); }
// ADVERTISERS
	else if( path_array[0] == "advertisers" ){ setAdvertiser( "None", "N/A" ) }
// GOODSPORTS
	else if( path_array[0] == "goodsports" ){ setAdvertiser( "Goodsports", "N/A" ) }
// SICHAMPION
	else if( path_array[0] == "sichampion" ){ setAdvertiser( "SI Champions", path_array[1] ) }
// PREMIUM
	else if( isPremium () ){ setCMSStory(); }
// SWIMSUIT
	else if( ( path_array[0] == "swimsuit" ) && ( path_array[1] == "collection" ) ) { setSwimsuitCollection(); } // /swimsuit/collection
	else if( path_array.length > 1 ) {
// SPECIAL SECTION FRONTS
		if( ( ( path_array[path_array.length - 2] ).match( /^\d{4}/ ) ) && elementExist( path_array, "specials" ) ) {
			if( cnn_omnitureData['path'].indexOf( "/magazine/specials/sportsman/archive/" ) == 0 ) { setSpecialStories( getSectionName( "magazine" ), "Archive  " + getEventName( "sportsman" ) ); }
			else {
				var event_year = path_array[path_array.length - 2];
				var section = ( path_array.slice( 0, arrayIndexOf( "specials", path_array ) ) ).join( "/" );
				var event_id = ( path_array.slice( arrayIndexOf( "specials", path_array ) + 1, path_array.length - 2 ) ).join( "/" );
				setSpecialFronts( getSectionName( section ), event_year + " " + getEventName( event_id ) );
			}
		}
		else {
// REGULAR SECTION FRONTS
			var section = getSectionName( cnn_omnitureData['path'].substr( 1, cnn_omnitureData['path'].length - 12 ) );
			if( section != sectionNameError ) { setFronts( section ); }
			else {
// SPORTSMAN ARCHIVES
				if( cnn_omnitureData['path'].indexOf( "/magazine/specials/sportsman/archive/" ) == 0 ) { setSpecialStories( getSectionName( "magazine" ), "Archive  " + getEventName( "sportsman" ) ); }
// MLB STATS
				if( cnn_omnitureData['path'].indexOf( "/baseball/mlb/scoreboards/" ) == 0 ) { setScores( "MLB" ); }
				else if( cnn_omnitureData['path'].indexOf( "/baseball/mlb/" ) == 0 ) { setOther( "MLB" ); }
// NBA STATS
				else if( cnn_omnitureData['path'].indexOf( "/basketball/nba/scoreboards/" ) == 0 ) { setScores( "NBA" ); }
				else if( ( cnn_omnitureData['path'].indexOf( "/basketball/nba/" ) == 0 ) && ( cnn_omnitureData['path'].indexOf( "/tracker/" ) > 0 ) ) { setTracker(); }
				else if( cnn_omnitureData['path'].indexOf( "/basketball/nba/" ) == 0 ) { setOther( "NBA" ); }
// NCAAF STATS
				else if( cnn_omnitureData['path'].indexOf( "/football/ncaa/scoreboards/" ) == 0 ) { setScores( "NCAAF" ); }
				else if( cnn_omnitureData['path'].indexOf( "/football/ncaa/" ) == 0 ) { setOther( "NCAAF" ); }
// NHL STATS
				else if( cnn_omnitureData['path'].indexOf( "/hockey/nhl/scoreboards/" ) == 0 ) { setScores( "NHL" ); }
				else if( cnn_omnitureData['path'].indexOf( "/hockey/nhl/" ) == 0 ) { setOther( "NHL" ); }
// NCAAB STATS
				else if( cnn_omnitureData['path'].indexOf( "/basketball/ncaa/men/scoreboards/" ) == 0 ) { setScores( "NCAAB" ); }
				else if( cnn_omnitureData['path'].indexOf( "/basketball/ncaa/men/" ) == 0 ) { setOther( "NCAAB" ); }
				else if( ( cnn_omnitureData['path'].indexOf( "/basketball/" ) == 0 ) && ( cnn_omnitureData['path'].indexOf( "/draft/" ) > 0 ) ) { setSpecialStories( getSectionName( "basketball/nba" ), cnn_omnitureData['path'].substr( 12, 4 ) + " " + getEventName( "draft" ) ); }
// NFL STATS
				else if( cnn_omnitureData['path'].indexOf( "/football/nfl/scoreboards/" ) == 0 ) { setScores( "NFL" ); }
				else if( cnn_omnitureData['path'].indexOf( "/football/nfl/" ) == 0 ) { setOther( "NFL" ); }
				else if( ( cnn_omnitureData['path'].indexOf( "/football/" ) == 0 ) && ( cnn_omnitureData['path'].indexOf( "/draft/" ) > 0 ) ) { setSpecialStories( getSectionName( "football/nfl" ), cnn_omnitureData['path'].substr( 10, 4 ) + " " + getEventName( "draft" ) ); }
// GOLF STATS
				else if( ( cnn_omnitureData['path'].indexOf( "/golf/pga/" ) == 0 ) && ( cnn_omnitureData['path'].indexOf( "/leaderboards/" ) > 0 ) ) { setScores( "Golf" ); }
				else if( cnn_omnitureData['path'].indexOf( "/golf/pga/" ) == 0 ) { setOther( "Golf" ); }
				else if( ( cnn_omnitureData['path'].indexOf( "/golf/ega/" ) == 0 ) && ( cnn_omnitureData['path'].indexOf( "/leaderboards/" ) > 0 ) ) { setScores( "Golf" ); }
				else if( cnn_omnitureData['path'].indexOf( "/golf/ega/" ) == 0 ) { setOther( "Golf" ); }
				else if( ( cnn_omnitureData['path'].indexOf( "/golf/sga/" ) == 0 ) && ( cnn_omnitureData['path'].indexOf( "/leaderboards/" ) > 0 ) ) { setScores( "Golf" ); }
				else if( cnn_omnitureData['path'].indexOf( "/golf/sga/" ) == 0 ) { setOther( "Golf" ); }
				else if( ( cnn_omnitureData['path'].indexOf( "/golf/lpga/" ) == 0 ) && ( cnn_omnitureData['path'].indexOf( "/leaderboards/" ) > 0 ) ) { setScores( "Golf" ); }
				else if( cnn_omnitureData['path'].indexOf( "/golf/lpga/" ) == 0 ) { setOther( "Golf" ); }
				else if( ( cnn_omnitureData['path'].indexOf( "/golf/nationwide/" ) == 0 ) && ( cnn_omnitureData['path'].indexOf( "/leaderboards/" ) > 0 ) ) { setScores( "Golf" ); }
				else if( cnn_omnitureData['path'].indexOf( "/golf/nationwide/" ) == 0 ) { setOther( "Golf" ); }
				else if( cnn_omnitureData['path'].indexOf( "/golf/players/" ) == 0 ) { setOther( "Golf" ); }
				else if( cnn_omnitureData['path'].indexOf( "/golf/instruction/" ) == 0 ) { setStories( "GolfOnline" ); }
				else if( ( cnn_omnitureData['path'].indexOf( "/golf/" ) == 0 ) && ( cnn_omnitureData['path'].indexOf( "/players/" ) > 0 ) ) { setOther( "Golf" ); }
// WORLD CUP STATS
				else if( cnn_omnitureData['path'].indexOf( "/soccer/worldcup/" ) == 0 ) { setWorldCup( path_array[2] ); }
// VIDEO
				else if( cnn_omnitureData['path'].indexOf( "/video/" ) == 0 ) { setVideo(); }
// 2006 OLYMPICS
				else if( cnn_omnitureData['path'].indexOf( "/olympics/2006/" ) == 0 ) { setOlympics( "2006" ); }
// MORE SPECIAL SECTIONS
				else if( cnn_omnitureData['path'].indexOf( "/more/specials/fortunate50/" ) == 0 ) {
					cnn_omnitureData['section'] = getSectionName( "more" );
					cnn_omnitureData['pageType'] = getSectionName( "more" ) + " Fortunate 50";
					cnn_omnitureData['date'] = "N/A";
					cnn_omnitureData['slug'] = "N/A";
					cnn_omnitureData['file'] = "N/A";
					cnn_omnitureData['pageName'] = cnn_omnitureData['pageType'] + " - " + path_array[path_array.length - 1];
				}
			}
		}
	}
function setOlympics( year ) {
	cnn_omnitureData['section'] = "Olympics " + year;
	cnn_omnitureData['pageType'] = cnn_omnitureData['section'] + " " + path_array[2];
	cnn_omnitureData['date'] = "N/A";
	cnn_omnitureData['slug'] = "N/A";
	cnn_omnitureData['file'] = "N/A";
	if( path_array[3] == "index.html" ) {
		setFronts( cnn_omnitureData['section'] );
	} else {
		var fileName = "";
		switch( path_array[2] ) {
			case "bios":		fileName = ( path_array[3] ).replace( ".html","" ); break;
			case "boxscores":	fileName = ( path_array[4] ).replace( ".html","" ); break;
			case "explainers":	fileName = ( path_array[3] ).replace( ".html","" ); break;
			case "medals":		cnn_omnitureData['pageType'] += " " + path_array[3]; fileName = ( path_array[4] ).replace( ".html","" ); break;
			case "news":		fileName = ( path_array[3] ); break;
			case "photos":		fileName = ( path_array[3] ).replace( ".html","" ); break;
			case "previews":	fileName = ( path_array[3] ); break;
			case "results":		fileName = ( path_array[3] ).replace( ".html","" ); break;
			case "schedules":	if( path_array[3] == "index.html" ) { fileName = "index"; }
						else { cnn_omnitureData['pageType'] += " " + path_array[3]; fileName = ( path_array[4] ).replace( ".html","" ); }
						break;
			case "sports":		if( path_array[3] == "index.html" ) { fileName = "index"; }
						else { cnn_omnitureData['pageType'] += " " + path_array[3]; fileName = ( path_array[4] ).replace( ".html","" ); }
						break;
			case "wires":		fileName = ( path_array[3] ).replace( ".html","" ); break;
			case "writers":		fileName = ( path_array[3] ).replace( ".html","" ); break;
			default: 		break;
		}
		cnn_omnitureData['pageName'] = cnn_omnitureData['pageType'] + " " + fileName;
	}
}

function setTracker() {
	if( cnn_omnitureData['path'].indexOf( "/basketball/nba/" ) == 0 ) { cnn_omnitureData['section'] = "NBA " + path_array[2] + " " + getEventName( path_array[3] ); }
	else if( cnn_omnitureData['path'].indexOf( "/football/nfl/" ) == 0 ) { cnn_omnitureData['section'] = "NFL " + path_array[2] + " " + getEventName( path_array[3] ); }
	cnn_omnitureData['pageType'] = cnn_omnitureData['section'] + " Tracker";
	cnn_omnitureData['date'] = "N/A";
	cnn_omnitureData['slug'] = "N/A";
	cnn_omnitureData['file'] = "N/A";
	cnn_omnitureData['pageName'] = cnn_omnitureData['pageType'];
}
function setWorldCup( year ) {
	cnn_omnitureData['section'] = "World Cup " + year;
	cnn_omnitureData['pageType'] = cnn_omnitureData['section'];
	cnn_omnitureData['date'] = "N/A";
	cnn_omnitureData['slug'] = "N/A";
	cnn_omnitureData['file'] = "N/A";
	cnn_omnitureData['pageName'] = cnn_omnitureData['section'];
	if( cnn_omnitureData['path'].indexOf( "/boxscores/" ) > 0 ) { cnn_omnitureData['pageType'] += " Box Scores";cnn_omnitureData['pageName'] += ( document.title ).replace( /SI(.+) - /, " Box Score - " ); }
	else if( cnn_omnitureData['path'].indexOf( "/matchcast/" ) > 0 ) {
		cnn_omnitureData['pageType'] += " Matchcast";
		if( cnn_omnitureData['path'].indexOf( "teams" ) > 0 ) {
			cnn_omnitureData['pageName'] += ( document.title ).replace( / Matchcast (.+)/, " Teams" ).replace( /SI(.+) - /, " Matchcast - " );
		} else {
			cnn_omnitureData['pageName'] += ( document.title ).replace( " Matchcast", "" ).replace( /SI(.+) - /, " Matchcast - " );
		}
	}
	else if( cnn_omnitureData['path'].indexOf( "/playbyplay/" ) > 0 ) { cnn_omnitureData['pageType'] += " Play by Play";cnn_omnitureData['pageName'] += ( document.title ).replace( /SI(.+) - /, " Play by Play - " ); }
	else if( cnn_omnitureData['path'].indexOf( "/players/" ) > 0 ) { cnn_omnitureData['pageType'] += " Players";cnn_omnitureData['pageName'] += ( document.title ).replace( "Player Page", "" ).replace( /SI(.+) - /, " Player - " ); }
	else if( cnn_omnitureData['path'].indexOf( "/previews/" ) > 0 ) { cnn_omnitureData['pageType'] += " Preview";cnn_omnitureData['pageName'] += " Preview"; }
	else if( cnn_omnitureData['path'].indexOf( "/recaps/" ) > 0 ) { cnn_omnitureData['pageType'] += " Recap";cnn_omnitureData['pageName'] += " Recap"; }
	else if( cnn_omnitureData['path'].indexOf( "/schedules/" ) > 0 ) { cnn_omnitureData['pageType'] += " Schedules";cnn_omnitureData['pageName'] += " Schedules"; }
	else if( cnn_omnitureData['path'].indexOf( "/scoreboards/" ) > 0 ) {
		setScores( cnn_omnitureData['section'] )
		if( cnn_omnitureData['path'] != "/soccer/worldcup/" + year + "/scoreboards/today/index.html" ) {
			cnn_omnitureData['pageName'] += ( document.title ).replace( /SI(.+) - /, " - " );
		}
	}
	else if( cnn_omnitureData['path'].indexOf( "/standings/" ) > 0 ) { cnn_omnitureData['pageType'] += " Standings";cnn_omnitureData['pageName'] += " Standings"; }
	else if( cnn_omnitureData['path'].indexOf( "/stats/" ) > 0 ) {
		cnn_omnitureData['pageType'] += " Stats";
		if( cnn_omnitureData['path'] == "/soccer/worldcup/" + year + "/stats/index.html" ) {
			cnn_omnitureData['pageName'] += " Stats";
		} else {
			cnn_omnitureData['pageName'] += ( document.title ).replace( " Page", "" ).replace( /SI(.+) - /, " Stats - " );
		}
	}
	else if( cnn_omnitureData['path'].indexOf( "/teams/" ) > 0 ) {
		if( cnn_omnitureData['path'] == "/soccer/worldcup/" + year + "/teams/index.html" ) {
			cnn_omnitureData['pageType'] += " Teams";cnn_omnitureData['pageName'] += " Teams";
		} else if( cnn_omnitureData['path'].indexOf( "index.html" ) > 0 ) {
			cnn_omnitureData['pageType'] += " Teams";
			cnn_omnitureData['pageName'] += ( document.title ).replace( / Team (.+)/, "" ).replace( /SI(.+) - /, " Teams - " );
		} else if( cnn_omnitureData['path'].indexOf( "schedule.html" ) > 0 ) {
			cnn_omnitureData['pageType'] += " Schedules";
			cnn_omnitureData['pageName'] += ( document.title ).replace( / Schedule (.+)/, "" ).replace( /SI(.+) - /, " Schedule - " );
		} else if( cnn_omnitureData['path'].indexOf( "roster.html" ) > 0 ) {
			cnn_omnitureData['pageType'] += " Roster";
			cnn_omnitureData['pageName'] += ( document.title ).replace( / Roster(.+)/, "" ).replace( /SI(.+) - /, " Roster - " );
		}
	}
	else { setOther( cnn_omnitureData['section'] ); }
}


/******************************
 REMOTE SERVERS
 ******************************/

function setGamesHostname() { // handle games.si.cnn.com
	switch( path_array[0] ) {
		case "baseball":	setFantasyGames( "Baseball Commissioner" ); break;
		case "bbsal":		setFantasyGames( "Baseball Salary Cap" ); break;
		case "fbpick":		setFantasyGames( "Beat The Experts" ); break;
		case "football":	setFantasyGames( "Football Commissioner" ); break;
		case "fbsal":		setFantasyGames( "Football Salary Cap" ); break;
		case "cfbpick":		setFantasyGames( "College Football Pickoff" ); break;
		case "bowlpick":	setFantasyGames( "College Bowl Pickoff" ); break;
		case "madness":		setFantasyGames( "Hoops Bracket Challenge" ); break;
		default: 		setGeneric( "Fantasy Games", "Fantasy Games - unknown" );break;
	}
}
function setSecondThoughHostname() { // handle *.secondthought.com
	var server_array = ( cnn_omnitureData['server'].substr( 1 ) ).split( "." );
	setAdvertiser( "Second Thought - " + server_array[0], "N/A" )
}

function setDynamicHostname() { // handle dynamic.si.cnn.com
	if( path_array[0] == "covers" ) {
		setGeneric( "SI Covers", "SI Covers - Cover" );
	} else {
		setGeneric( "Dynamic", "Dynamic - unknown" );
	}
}
function setSportsHostname() { // handle sports.si.cnn.com
	if( queryString( 'page' ).indexOf( "auto" ) > -1  ) {
		if( queryString( 'page' ).indexOf( "WINNERS" ) > -1  ) { setScores( "Racing" ); }
		else { setOther( "Racing" ); }
	} else if( queryString( 'page' ).indexOf( "bask-w" ) > -1  ) {
		if( queryString( 'page' ).indexOf( "scores" ) > -1  ) {	setScores( "WNBA" ); }
		else { setOther( "WNBA" ); }
	} else if( queryString( 'page' ).indexOf( "boxing" ) > -1  ) {
		if( queryString( 'page' ).indexOf( "champions" ) > -1  ) { setScores( "Boxing" ); }
		else { setOther( "Boxing" ); }
	} else if( queryString( 'page' ).indexOf( "cbase" ) > -1  ) {
		if( queryString( 'page' ).indexOf( "scores" ) > -1  ) { setScores( "Baseball" ); }
		else { setOther( "Baseball" ); }
	} else if( queryString( 'page' ).indexOf( "cbask-w" ) > -1  ) {
		if( queryString( 'page' ).indexOf( "scores" ) > -1  ) {	setScores( "NCAAB" ); }
		else { setOther( "NCAAB" ); }
	} else if( queryString( 'page' ).indexOf( "drf" ) > -1  ) {
		if( queryString( 'page' ).indexOf( "leaders" ) > -1  ) { setScores( "Horse Racing" ); }
		if( queryString( 'page' ).indexOf( "LEADERS" ) > -1  ) { setScores( "Horse Racing" ); }
		else { setOther( "Horse Racing" ); }
	} else if( queryString( 'page' ).indexOf( "formula" ) > -1  ) {
		if( queryString( 'page' ).indexOf( "WINNERS" ) > -1  ) { setScores( "Racing" ); }
		else { setOther( "Racing" ); }
	} else if( queryString( 'page' ).indexOf( "golf" ) > -1  ) {
		if( queryString( 'page' ).indexOf( "scores" ) > -1  ) {	setScores( "Golf" ); }
		else { setOther( "Golf" ); }
	} else if( queryString( 'page' ).indexOf( "horse" ) > -1  ) {
		if( queryString( 'page' ).indexOf( "leaders" ) > -1  ) { setScores( "Horse Racing" ); }
		if( queryString( 'page' ).indexOf( "LEADERS" ) > -1  ) { setScores( "Horse Racing" ); }
		else { setOther( "Horse Racing" ); }
	} else if( queryString( 'page' ).indexOf( "milb" ) > -1  ) {
		if( queryString( 'page' ).indexOf( "scores" ) > -1  ) { setScores( "Baseball" ); }
		else { setOther( "Baseball" ); }
	} else if( queryString( 'page' ).indexOf( "minorbase" ) > -1  ) {
		if( queryString( 'page' ).indexOf( "scores" ) > -1  ) { setScores( "Baseball" ); }
		else { setOther( "Baseball" ); }
	} else if( queryString( 'page' ).indexOf( "nascar" ) > -1  ) {
		if( queryString( 'page' ).indexOf( "WINNERS" ) > -1  ) { setScores( "Racing" ); }
		else { setOther( "Racing" ); }
	} else if( queryString( 'page' ).indexOf( "soc-" ) > -1  ) {
		if( queryString( 'page' ).indexOf( "scores" ) > -1  ) { setScores( "Soccer" ); }
		else { setOther( "Soccer" ); }
	} else if( queryString( 'page' ).indexOf( "tennis" ) > -1  ) {
		if( queryString( 'page' ).indexOf( "scores" ) > -1  ) {	setScores( "Tennis" ); }
		else { setOther( "Tennis" ); }
	} else if( queryString( 'page' ).indexOf( "wbc" ) > -1  ) {
		if( queryString( 'page' ).indexOf( "scores" ) > -1  ) { setScores( "Baseball" ); }
		else { setOther( "Baseball" ); }
	} else {
		setOther( "TSN" );
	}
}

/******************************
 SETTING FUNCTIONS
 ******************************/

function setUnknown( section, pageType, pageName, branding, date, slug, file ) {
	cnn_omnitureData['section'] = section;
	cnn_omnitureData['pageType'] = pageType;
	cnn_omnitureData['branding'] = branding;
	cnn_omnitureData['date'] = date;
	cnn_omnitureData['slug'] = slug;
	cnn_omnitureData['file'] = file;
	cnn_omnitureData['pageName'] = pageName;
}
function setGeneric( section, pageName ) {
	cnn_omnitureData['section'] = section;
	cnn_omnitureData['pageType'] = pageName;
	cnn_omnitureData['date'] = "N/A";
	cnn_omnitureData['slug'] = "N/A";
	cnn_omnitureData['file'] = "N/A";
	cnn_omnitureData['pageName'] = pageName;
}
function setGenericBranding( section, pageName ) {
	cnn_omnitureData['section'] = section;
	cnn_omnitureData['pageType'] = pageName;
	cnn_omnitureData['date'] = "N/A";
	cnn_omnitureData['slug'] = "N/A";
	cnn_omnitureData['file'] = "N/A";
	cnn_omnitureData['pageName'] = pageName;
}
function setAdvertiser( campaign, branding ) {
	cnn_omnitureData['section'] = "Advertiser";
	cnn_omnitureData['pageType'] = cnn_omnitureData['section'] + " " + campaign ;
	cnn_omnitureData['date'] = "N/A";
	cnn_omnitureData['slug'] = "N/A";
	cnn_omnitureData['file'] = "N/A";
	cnn_omnitureData['pageName'] = cnn_omnitureData['pageType'] + " " + branding;
}
function setRedirects( campaign ) {
	cnn_omnitureData['section'] = "Redirects";
	cnn_omnitureData['pageType'] = cnn_omnitureData['section'] + " " + campaign ;
	cnn_omnitureData['date'] = "N/A";
	cnn_omnitureData['slug'] = "N/A";
	cnn_omnitureData['file'] = "N/A";
	cnn_omnitureData['pageName'] = cnn_omnitureData['pageType'];
}
function setOther( section ) {
	cnn_omnitureData['section'] = section;
	cnn_omnitureData['pageType'] = section + " Other";
	cnn_omnitureData['date'] = "N/A";
	cnn_omnitureData['slug'] = "N/A";
	cnn_omnitureData['file'] = "N/A";
	cnn_omnitureData['pageName'] = section + " Other";
}
function setScores( section ) {
	cnn_omnitureData['section'] = section;
	cnn_omnitureData['pageType'] = section + " Scores";
	cnn_omnitureData['date'] = "N/A";
	cnn_omnitureData['slug'] = "N/A";
	cnn_omnitureData['file'] = "N/A";
	cnn_omnitureData['pageName'] = section + " Scores";
}
function setFronts( section ) {
	cnn_omnitureData['section'] = section;
	cnn_omnitureData['pageType'] = section + " Front";
	cnn_omnitureData['date'] = "N/A";
	cnn_omnitureData['slug'] = "N/A";
	cnn_omnitureData['file'] = "N/A";
	cnn_omnitureData['pageName'] = section + " Front";
}
function setSpecialFronts( base, section ) {
	cnn_omnitureData['section'] = base;
	cnn_omnitureData['pageType'] = base + " " + section + " Front";
	cnn_omnitureData['date'] = "N/A";
	cnn_omnitureData['slug'] = "N/A";
	cnn_omnitureData['file'] = "N/A";
	cnn_omnitureData['pageName'] = base + " " + section + " Front";
}
function setBlogs() {
	cnn_omnitureData['section'] = "SI Blogs";
	cnn_omnitureData['pageType'] = cnn_omnitureData['section'] + " Other";
	cnn_omnitureData['date'] = "N/A";
	cnn_omnitureData['slug'] = "N/A";
	cnn_omnitureData['file'] = "N/A";
	cnn_omnitureData['pageName'] = cnn_omnitureData['section'] + path_array[1] + path_array[2];
}
function setWriters() {
	cnn_omnitureData['section'] = "SI Writers";
	if( ( path_array[0] ).match( /^\d{4}/ ) ) {
		cnn_omnitureData['pageType'] = "SI Writers - " + upper( path_array[2].replace( /_/, " " ) );
		cnn_omnitureData['branding'] = cnn_omnitureData['pageType'] + " - default";
		cnn_omnitureData['date'] = getStoryDate();
		cnn_omnitureData['slug'] = path_array[path_array.length - 2];
		cnn_omnitureData['file'] = path_array[path_array.length - 1];
		cnn_omnitureData['pageName'] = cnn_omnitureData['pageType'] + " - " + cnn_omnitureData['date'] + " - " + cnn_omnitureData['slug'] + " - " + cnn_omnitureData['file'];
	} else {
		cnn_omnitureData['pageType'] = "SI Writers - " + upper( path_array[1].replace( /_/, " " ) );
		cnn_omnitureData['branding'] = cnn_omnitureData['pageType'] + " - default";
		cnn_omnitureData['date'] = "N\A";
		cnn_omnitureData['slug'] = "N\A";
		cnn_omnitureData['file'] = "N\A";
		cnn_omnitureData['pageName'] = cnn_omnitureData['pageType'] + " - Archive";
	}	
}
function setWritersBranding( branding ) {
	if( ( path_array[0] ).match( /^\d{4}/ ) ) {
		cnn_omnitureData['branding'] = cnn_omnitureData['pageType'] + " - " + branding;
	} else {
		cnn_omnitureData['branding'] = cnn_omnitureData['pageType'] + " - " + branding;
	}	
}
function setSCWriters() {
	cnn_omnitureData['section'] = "Scorecard Writers";
	if( ( path_array[0] ).match( /^\d{4}/ ) ) {
		cnn_omnitureData['pageType'] = "Scorecard Writers - " + upper( path_array[2].replace( /_/, " " ) );
		cnn_omnitureData['branding'] = cnn_omnitureData['pageType'] + " - default";
		cnn_omnitureData['date'] = getStoryDate();
		cnn_omnitureData['slug'] = path_array[path_array.length - 2];
		cnn_omnitureData['file'] = path_array[path_array.length - 1];
		cnn_omnitureData['pageName'] = cnn_omnitureData['pageType'] + " - " + cnn_omnitureData['date'] + " - " + cnn_omnitureData['slug'] + " - " + cnn_omnitureData['file'];
	} else {
		cnn_omnitureData['pageType'] = "Scorecard Writers - " + upper( path_array[1].replace( /_/, " " ) );
		cnn_omnitureData['branding'] = cnn_omnitureData['pageType'] + " - default";
		cnn_omnitureData['date'] = "N\A";
		cnn_omnitureData['slug'] = "N\A";
		cnn_omnitureData['file'] = "N\A";
		cnn_omnitureData['pageName'] = cnn_omnitureData['pageType'] + " - Archive";
	}	
}
function setSCWritersBranding( branding ) {
	cnn_omnitureData['branding'] = cnn_omnitureData['pageType'] + " - " + branding;
}
function setFantasyGames( input ) { // set the values of a Fantasy Game
	cnn_omnitureData['section'] = "Fantasy Games";
	cnn_omnitureData['pageType'] = cnn_omnitureData['section'] + " - " + input;
	cnn_omnitureData['date'] = "N/A";
	cnn_omnitureData['slug'] = "N/A";
	cnn_omnitureData['file'] = "N/A";
	cnn_omnitureData['pageName'] = cnn_omnitureData['pageType'];
}
function setSpecialStories( base, section ) {
	cnn_omnitureData['section'] = base;
	cnn_omnitureData['pageType'] = base + " " + section;
	cnn_omnitureData['date'] = getStoryDate();
	cnn_omnitureData['slug'] = path_array[path_array.length - 2];
	cnn_omnitureData['file'] = path_array[path_array.length - 1];
	cnn_omnitureData['branding'] = cnn_omnitureData['pageType'] + " - default";
	cnn_omnitureData['pageName'] = cnn_omnitureData['pageType'] + " - " + cnn_omnitureData['date'] + " - " + cnn_omnitureData['slug'] + " - " + cnn_omnitureData['file'];
}
function setStories( section ) {
	cnn_omnitureData['section'] = section;
	cnn_omnitureData['pageType'] = section + " News";
	cnn_omnitureData['date'] = getStoryDate();
	cnn_omnitureData['slug'] = path_array[path_array.length - 2];
	cnn_omnitureData['file'] = path_array[path_array.length - 1];
	if( cnn_omnitureData['section'] == "SI Preview" ) {
		cnn_omnitureData['file'] = cnn_omnitureData['file'].substr( 0, cnn_omnitureData['file'].indexOf( "?url" ) );
		if( cnn_omnitureData['file'] == '' ) cnn_omnitureData['file'] = "index.html";
	}
	cnn_omnitureData['branding'] = cnn_omnitureData['pageType'] + " - default";
	cnn_omnitureData['pageName'] = cnn_omnitureData['pageType'] + " - " + cnn_omnitureData['date'] + " - " + cnn_omnitureData['slug'] + " - " + cnn_omnitureData['file'];
}
function setSpecialStoriesBranding( branding ) {
	cnn_omnitureData['branding'] = cnn_omnitureData['pageType'] + " - " + branding;
	cnn_omnitureData['pageName'] = cnn_omnitureData['branding'] + " - " + cnn_omnitureData['date'] + " - " + cnn_omnitureData['slug'] + " - " + cnn_omnitureData['file'];
}
function setStoriesBranding( branding ) {
	cnn_omnitureData['branding'] = cnn_omnitureData['pageType'] + " - " + branding;
	cnn_omnitureData['pageName'] = cnn_omnitureData['branding'] + " - " + cnn_omnitureData['date'] + " - " + cnn_omnitureData['slug'] + " - " + cnn_omnitureData['file'];
}
function setPhotoGallery() {
	if( path_array[2] == "index.html" ) { // /multimedia/photo_gallery front
		setFronts( "SI Photos" );
	} else { // /multimedia/photo_gallery
		cnn_omnitureData['section'] = "SI Photos";
		if( typeof( cnnOmnitureGallery ) != "undefined" ) { cnn_omnitureData['section'] += " - " + cnnOmnitureGallery; }
		cnn_omnitureData['date'] = path_array[2] + "/" + path_array[3] + "/" + path_array[4];
		cnn_omnitureData['slug'] = path_array[5];
		cnn_omnitureData['file'] = path_array[6];
		cnn_omnitureData['pageType'] = "SI Photos - ";
		cnn_omnitureData['pageName'] = "SI Photos - ";
		if( typeof( cnnOmnitureGallery ) != "undefined" ) { cnn_omnitureData['pageType'] += cnnOmnitureGallery + " - "; }
		if( typeof( cnnOmnitureGallery ) != "undefined" ) { cnn_omnitureData['pageName'] += cnnOmnitureGallery + " - "; }
		cnn_omnitureData['pageType'] += cnn_omnitureData['date'] + " - " + cnn_omnitureData['slug'];
		cnn_omnitureData['pageName'] += cnn_omnitureData['date'] + " - " + cnn_omnitureData['slug'] + " - " + cnn_omnitureData['file'];
	}
}
function setSwimsuitCollection() {
	if( path_array[2] == "index.html" ) { // /swimsuit/collection front
		setFronts( "Swimsuit Collection" );
	} else if( path_array[2] == "issues" ) { // /swimsuit/collection/issues
		if( path_array[4] == "index.html" ) {
			cnn_omnitureData['section'] = "Swimsuit Collection";
			cnn_omnitureData['pageType'] = "Swimsuit Collection - " + path_array[3] + " Issue Index";
			cnn_omnitureData['date'] = "N/A";
			cnn_omnitureData['slug'] = "N/A";
			cnn_omnitureData['file'] = "N/A";
			cnn_omnitureData['pageName'] = "Swimsuit Collection - " + path_array[3] + " Issue Index";
		} else {
			cnn_omnitureData['section'] = "Swimsuit Collection";
			cnn_omnitureData['pageType'] = "Swimsuit Collection - " + path_array[3] + " " + path_array[4].substring( path_array[4].indexOf( "_" ) + 1, path_array[4].indexOf( "_", 5 ) ) + " image";
			cnn_omnitureData['date'] = "N/A";
			cnn_omnitureData['slug'] = "N/A";
			cnn_omnitureData['file'] = "N/A";
			cnn_omnitureData['pageName'] = "Swimsuit Collection - " + path_array[4].substring( path_array[4].indexOf( "_" ) + 1, path_array[4].indexOf( ".html" )) + " in " + path_array[3] + " issue";
		}
	} else if( path_array[2] == "video" ) { // /swimsuit/collection/video
		if( path_array[3] == "index.html" ) {
			cnn_omnitureData['section'] = "Swimsuit Collection";
			cnn_omnitureData['pageType'] = "Swimsuit Collection - Video Index";
			cnn_omnitureData['date'] = "N/A";
			cnn_omnitureData['slug'] = "N/A";
			cnn_omnitureData['file'] = "N/A";
			cnn_omnitureData['pageName'] = "Swimsuit Collection - Video Index";
		} else if( path_array[4] == "index.html" ) {
			cnn_omnitureData['section'] = "Swimsuit Collection";
			cnn_omnitureData['pageType'] = "Swimsuit Collection - " + path_array[3] + " Video Index";
			cnn_omnitureData['date'] = "N/A";
			cnn_omnitureData['slug'] = "N/A";
			cnn_omnitureData['file'] = "N/A";
			cnn_omnitureData['pageName'] = "Swimsuit Collection - " + path_array[3] + " Video Index";
		} else if( path_array[3] == "clips" ) {
			cnn_omnitureData['section'] = "Swimsuit Collection";
			cnn_omnitureData['pageType'] = "Swimsuit Collection - old video";
			cnn_omnitureData['date'] = "N/A";
			cnn_omnitureData['slug'] = "N/A";
			cnn_omnitureData['file'] = "N/A";
			cnn_omnitureData['pageName'] = "Swimsuit Collection - " + path_array[4].substring( 0, path_array[4].indexOf( ".html" )) + " in old video";
		} else {
			cnn_omnitureData['section'] = "Swimsuit Collection";
			cnn_omnitureData['pageType'] = "Swimsuit Collection - " + path_array[3] + " " + path_array[4].substring( path_array[4].indexOf( "_" ) + 1, path_array[4].indexOf( "_", 5 ) ) + " video";
			cnn_omnitureData['date'] = "N/A";
			cnn_omnitureData['slug'] = "N/A";
			cnn_omnitureData['file'] = "N/A";
			cnn_omnitureData['pageName'] = "Swimsuit Collection - " + path_array[4].substring( path_array[4].indexOf( "_" ) + 1, path_array[4].indexOf( ".html" )) + " in " + path_array[3] + " video";
		}
	} else if( path_array[2] == "vr" ) { // /swimsuit/collection/vr
		if( path_array[3] == "index.html" ) {
			cnn_omnitureData['section'] = "Swimsuit Collection";
			cnn_omnitureData['pageType'] = "Swimsuit Collection - VR Index";
			cnn_omnitureData['date'] = "N/A";
			cnn_omnitureData['slug'] = "N/A";
			cnn_omnitureData['file'] = "N/A";
			cnn_omnitureData['pageName'] = "Swimsuit Collection - VR Index";
		} else if( path_array[4] == "index.html" ) {
			cnn_omnitureData['section'] = "Swimsuit Collection";
			cnn_omnitureData['pageType'] = "Swimsuit Collection - " + path_array[3] + " VR Index";
			cnn_omnitureData['date'] = "N/A";
			cnn_omnitureData['slug'] = "N/A";
			cnn_omnitureData['file'] = "N/A";
			cnn_omnitureData['pageName'] = "Swimsuit Collection - " + path_array[3] + " VR Index";
		} else {
			cnn_omnitureData['section'] = "Swimsuit Collection";
			cnn_omnitureData['pageType'] = "Swimsuit Collection - " + path_array[3] + " " + path_array[4].substring( path_array[4].indexOf( "_" ) + 1, path_array[4].indexOf( "_", 5 ) ) + " vr";
			cnn_omnitureData['date'] = "N/A";
			cnn_omnitureData['slug'] = "N/A";
			cnn_omnitureData['file'] = "N/A";
			cnn_omnitureData['pageName'] = "Swimsuit Collection - " + path_array[4].substring( path_array[4].indexOf( "_" ) + 1, path_array[4].indexOf( ".html" ) ) + " in " + path_array[3] + " vr";
		}
	} else { // /swimsuit/collection
		cnn_omnitureData['section'] = "Swimsuit Collection";
		cnn_omnitureData['pageType'] = "Swimsuit Collection - " + path_array[2];
		cnn_omnitureData['date'] = "N/A";
		cnn_omnitureData['slug'] = "N/A";
		cnn_omnitureData['file'] = "N/A";
		cnn_omnitureData['pageName'] = "Swimsuit Collection - " + path_array[2] + " " + path_array[3].substring( 0, path_array[3].indexOf( ".html" ) );

//		cnn_omnitureData['section'] = "SI Photos";
//		cnn_omnitureData['date'] = path_array[2] + "/" + path_array[3] + "/" + path_array[4];
//		cnn_omnitureData['slug'] = path_array[5];
//		cnn_omnitureData['file'] = path_array[6];
//		cnn_omnitureData['pageType'] = "SI Photos - " + cnn_omnitureData['date'] + " - " + cnn_omnitureData['slug'];
//		cnn_omnitureData['pageName'] = "SI Photos - " + cnn_omnitureData['date'] + " - " + cnn_omnitureData['slug'] + " - " + cnn_omnitureData['file'];
	}
}
function setCMSStory() {
	// SPECIAL SECTION STORIES
		if( elementExist( path_array, "specials" ) ) {
			var event_year = path_array[arrayIndexOf( "specials", path_array ) + 2];
			var section = path_array.slice( 1, arrayIndexOf( "specials", path_array ) ).join( "/" );
			var event_id = path_array[arrayIndexOf( "specials", path_array ) + 1];
			setSpecialStories( getSectionName( section ), event_year + " " + getEventName( event_id ) );
		}
	// PREMIUM
		else if ( path_array[0] == "pr" ) { setStories( "SI Extra" ); }
	// PREVIEW
		else if ( path_array[0] == "preview" ) { setStories( "SI Preview" ); }
	// OLYMPIC STORIES
		else if( path_array[1] == "olympics" ) { setStories( "Olympics " + path_array[2] ); }
	// SI WRITER STORIES
		else if ( path_array[1] == "writers" ) { setWriters(); }
	// OLD VIDEO
		else if ( path_array[1] == "video" ) { setVideo(); }
	// REGULAR EVERGREEN SPORT STORIES
		else if( getStoryDate().indexOf( 'evergreen' ) == 5 ) { setStories( getSectionName( path_array.slice( 1, path_array.length - 2 ).join( "/" ) ) ); }
	// REGULAR DATED SPORT STORIES
		else { setStories( getSectionName( path_array.slice( 1, path_array.length - 4 ).join( "/" ) ) ); }
}
function setVideo() {
	cnn_omnitureData['section'] = "SI Video";
	cnn_omnitureData['file'] = "N/A";
	if( ( path_array[0] ).match( /^\d{4}/ ) ) {
		cnn_omnitureData['date'] = getStoryDate();
		cnn_omnitureData['slug'] = path_array[5];
		cnn_omnitureData['pageType'] = "SI Video - " + getVideoName( path_array[2] );
		cnn_omnitureData['pageName'] = cnn_omnitureData['pageType'] + " - " + cnn_omnitureData['date'] + " - " + cnn_omnitureData['slug'];
	} else if( path_array.length == 3 ) {
		cnn_omnitureData['date'] = "N/A";
		cnn_omnitureData['slug'] = "N/A";
		cnn_omnitureData['pageType'] = "SI Video - " + getVideoName( path_array[1] ) + " - Archive";
		cnn_omnitureData['pageName'] = cnn_omnitureData['pageType'];
	} else {
		cnn_omnitureData['date'] = getStoryDate();
		cnn_omnitureData['slug'] = path_array[path_array.length-1].slice( 0, -5 );
		cnn_omnitureData['pageType'] = "SI Video - " + getVideoName( path_array[1] );
		cnn_omnitureData['pageName'] = cnn_omnitureData['pageType'] + " - " + cnn_omnitureData['date'] + " - " + cnn_omnitureData['slug'];
	}
}

/******************************
 GETTING FUNCTIONS
 ******************************/

function getStoryDate() {
	var returnString = "";
	var year = 0;
	if( path_array[0] == "pr" ) { year = path_array[3]; }
	if( path_array[0] == "preview" ) { year = path_array[2]; }
	else if( path_array[0] == "video" ) { year = path_array[2]; }
	else { year = path_array[0]; }
	var month = -1;
	var day = -1;
	var x = 1;
	var date = "";
	while( x < path_array.length ) { // find month and day in path
		if( ( path_array[x] ).match( /^\d{2}/ ) && !( path_array[x] ).match( /^\d{4}/ ) ) {
			month = path_array[x];
			day = path_array[x+1];
			break;
		}
		x++;
	}
	if( month > 0 ) {
		returnString = year + "/" + month + "/" + day;
	} else { // if there is no month, the story is evergreen
		returnString = year + " evergreen";
	}
	return returnString;
}
function getSectionName( input ) { // if input is a recognized section name, return the readable form; otherwise return an error message
	var ret_value = sectionNameError;
	switch( input ) {
		case "about_us": ret_value = "Other"; break;
		case "baseball/mlb": ret_value = "MLB"; break;
		case "baseball/mlb/wires": ret_value = "MLB"; break;
		case "baseball/more": ret_value = "Baseball"; break;
		case "basketball/more": ret_value = "Basketball"; break;
		case "basketball/nba": ret_value = "NBA"; break;
		case "basketball/nba/wires": ret_value = "NBA"; break;
		case "basketball/ncaa": ret_value = "NCAAB"; break;
		case "basketball/ncaa/wires": ret_value = "NCAAB"; break;
		case "basketball/ncaa/women": ret_value = "NCAAB"; break;
		case "basketball/ncaa/women/wires": ret_value = "NCAAB"; break;
		case "basketball/wnba": ret_value = "NBA"; break;
		case "bowling/wires": ret_value = "More Sports"; break;
		case "boxing/wires": ret_value = "More Sports"; break;
		case "cricket/wires": ret_value = "More Sports"; break;
		case "cycling/wires": ret_value = "More Sports"; break;
		case "fantasy": ret_value = "Fantasy"; break;
		case "football/more": ret_value = "Football"; break;
		case "football/ncaa": ret_value = "NCAAF"; break;
		case "football/ncaa/wires": ret_value = "NCAAF"; break;
		case "football/nfl": ret_value = "NFL"; break;
		case "football/nfl/wires": ret_value = "NFL"; break;
		case "golf": ret_value = "Golf"; break;
		case "golf/wires": ret_value = "Golf"; break;
		case "gymnastics/wires": ret_value = "More Sports"; break;
		case "highschool": ret_value = "High School"; break;
		case "hockey/more": ret_value = "Hockey"; break;
		case "hockey/nhl": ret_value = "NHL"; break;
		case "hockey/nhl/wires": ret_value = "NHL"; break;
		case "horse_racing/wires": ret_value = "More Sports"; break;
		case "instruction": ret_value = "GolfOnline"; break;
		case "magazine": ret_value = "SI Extra"; break;
		case "more": ret_value = "More Sports"; break;
		case "more/wires": ret_value = "More Sports"; break;
		case "olympics": ret_value = "Olympics"; break;
		case "olympics/wires": ret_value = "Olympics"; break;
		case "players": ret_value = "SI Players"; break;
		case "racing": ret_value = "NASCAR"; break;
		case "racing/more": ret_value = "Racing"; break;
		case "racing/wires": ret_value = "NASCAR"; break;
		case "rugby/wires": ret_value = "More Sports"; break;
		case "scorecard": ret_value = "Scorecard"; break;
		case "scoreboards": ret_value = "Scoreboards"; break;
		case "sioncampus": ret_value = "SI On Campus"; break;
		case "soccer": ret_value = "Soccer"; break;
		case "soccer/wires": ret_value = "Soccer"; break;
		case "specials": ret_value = "Specials"; break;
		case "tennis": ret_value = "Tennis"; break;
		case "tennis/wires": ret_value = "Tennis"; break;
		case "track_field/wires": ret_value = "More Sports"; break;
		case "winter_sports/wires": ret_value = "More Sports"; break;
		default: break;
	}
	return ret_value;
}
function getEventName( input ) { // if input is a recognized event name, return the readable form; otherwise return an error message
	var ret_value = eventNameError;
	switch( input ) {
		case "all_star": ret_value = "All Star"; break;
		case "australian_open": ret_value = "Australian Open"; break;
		case "bowls": ret_value = "Bowls"; break;
		case "brickyard_400": ret_value = "Brickyard 400"; break;
		case "british_open": ret_value = "British Open"; break;
		case "daytona500": ret_value = "Daytona500"; break;
		case "draft": ret_value = "Draft"; break;
		case "french_open": ret_value = "French Open"; break;
		case "masters": ret_value = "Masters"; break;
		case "ncaa_tourney": ret_value = "NCAA Tourney"; break;
		case "pga_championship": ret_value = "PGA Championship"; break;
		case "playoffs": ret_value = "Playoffs"; break;
		case "player_of_the_year": ret_value = "Player of the Year"; break;
		case "postseason": ret_value = "Postseason"; break;
		case "presidents_cup": ret_value = "President's Cup"; break;
		case "preview": ret_value = "Preview"; break;
		case "ryder_cup": ret_value = "Ryder Cup"; break;
		case "sports_year": ret_value = "Year in Sports"; break;
		case "sportsman": ret_value = "Sportsman"; break;
		case "spring_training": ret_value = "Spring Training"; break;
		case "tiger": ret_value = "Tiger"; break;
		case "tour_de_france": ret_value = "Tour de France"; break;
		case "us_open": ret_value = "US Open"; break;
		case "wimbledon": ret_value = "Wimbledon"; break;
		case "womens_worldcup": ret_value = "Women's Worldcup"; break;
		case "world_cup": ret_value = "World Cup"; break;
		default: break;
	}
	return ret_value;
}
function getVideoName( input ) { // if input is a recognized video name, return the readable form; otherwise return an error message
	var ret_value = videoNameError;
	switch( input ) {
		case "hbo_costas": ret_value = "Costas Now";break;
		case "hoop_thoughts": ret_value = "Hoop Thoughts";break;
		case "josh_elliott": ret_value = "Josh Elliott";break;
		case "kings_corner": ret_value = "King's Corner";break;
		case "nba_tnt": ret_value = "Inside the NBA";break;
		case "ncaaf_video": ret_value = "College Football";break;
		case "peter_king": ret_value = "Kings Corner";break;
		case "seth_davis": ret_value = "Hoop Thoughs";break;
		case "si_video": ret_value = "SI Video";break;
		case "tom_verducci": ret_value = "Tom Verducci";break;
		case "warner.bros": ret_value = "Warner Brothers";break;
		default: break;
	}
	return ret_value;
}

/******************************
 HELPER FUNCTIONS
 ******************************/

function pageQuery( q ) {
	if( q.length > 1 ) this.q = q.substring( 1, q.length );
	else this.q = null;
	this.keyValuePairs = new Array();
	if( q ) {
		for( var i = 0; i < this.q.split( "&" ).length; i++ ) {
			this.keyValuePairs[i] = this.q.split( "&" )[i];
		}
	}
	this.getKeyValuePairs = function() { return this.keyValuePairs; }
	this.getValue = function( s ) {
		for( var j = 0; j < this.keyValuePairs.length; j++ ) {
			if( this.keyValuePairs[j].split( "=" )[0] == s )
			return this.keyValuePairs[j].split( "=" )[1];
		}
		return false;
	}
	this.getParameters = function() {
		var a = new Array( this.getLength() );
		for( var j = 0; j < this.keyValuePairs.length; j++ ) {
			a[j] = this.keyValuePairs[j].split( "=" )[0];
		}
		return a;
	}
	this.getLength = function() { return this.keyValuePairs.length; } 
}
function queryString( key ){
	var page = new pageQuery( window.location.search ); 
	return unescape( page.getValue( key ) ); 
}
function elementExist( in_array, in_string ) {
	var ret_value = false;
	for( var x = 0; x < in_array.length; x++ ) {
		if( in_array[x] == in_string ) {
			ret_value = true;
		}
	}
	return ret_value;
}
function isPremium () {
	var ret_value = false;
	if( path_array[0] == "pr" ) {
		if( ( path_array[1] == "subs" ) || ( path_array[1] == "subs2" ) ) {
			if( path_array[2] == "siexclusive" ) {
				ret_value = true;
			}
		}
	}
	return ret_value;
}
function upper( phrase ){ // capitalizes the first letter of each word in phrase
	phrase = phrase.split(' ')
	for ( i=0; i < phrase.length; i++ ) {
		phrase[i] = phrase[i].replace( /^(.)/, phrase[i].charAt( 0 ).toUpperCase() )
	}
	return phrase.join(' ');
}
function arrayIndexOf( searchValue, in_array ) { // if searchValue exists in in_array, return the index of searchValue; otherwise return -1
	var ret_value = -1;
	for( var x = 0; x < in_array.length; x++ ) {
		if( in_array[x] == searchValue ) {
			ret_value = x;
		}
	}
	return ret_value;
}

function writeData() {
	document.write( '<table border="0" cellpadding="0" cellspacing="0">' );
	document.write( '<tr><td>path:</td><td>' + cnn_omnitureData['path'] + '</td></tr>' );
	document.write( '<tr><td>server:</td><td>' + cnn_omnitureData['server'] + '</td></tr>' );
	document.write( '<tr><td>section:</td><td>' + cnn_omnitureData['section'] + '</td></tr>' );
	document.write( '<tr><td>pageType:</td><td>' + cnn_omnitureData['pageType'] + '</td></tr>' );
	document.write( '<tr><td>branding:</td><td>' + cnn_omnitureData['branding'] + '</td></tr>' );
	document.write( '<tr><td>date:</td><td>' + cnn_omnitureData['date'] + '</td></tr>' );
	document.write( '<tr><td>slug:</td><td>' + cnn_omnitureData['slug'] + '</td></tr>' );
	document.write( '<tr><td>file:</td><td>' + cnn_omnitureData['file'] + '</td></tr>' );
	document.write( '<tr><td>referrer:</td><td>' + cnn_omnitureData['referrer'] + '</td></tr>' );
	document.write( '<tr><td>pageName:</td><td>' + cnn_omnitureData['pageName'] + '</td></tr>' );
	document.write( '</table>' );
}
function getData() {
	var ret_value = "";
	ret_value += '<table border="0" cellpadding="0" cellspacing="0">';
	ret_value += '<tr><td>path:</td><td>' + cnn_omnitureData['path'] + '</td></tr>';
	ret_value += '<tr><td>server:</td><td>' + cnn_omnitureData['server'] + '</td></tr>';
	ret_value += '<tr><td>section:</td><td>' + cnn_omnitureData['section'] + '</td></tr>';
	ret_value += '<tr><td>pageType:</td><td>' + cnn_omnitureData['pageType'] + '</td></tr>';
	ret_value += '<tr><td>branding:</td><td>' + cnn_omnitureData['branding'] + '</td></tr>';
	ret_value += '<tr><td>date:</td><td>' + cnn_omnitureData['date'] + '</td></tr>';
	ret_value += '<tr><td>slug:</td><td>' + cnn_omnitureData['slug'] + '</td></tr>';
	ret_value += '<tr><td>file:</td><td>' + cnn_omnitureData['file'] + '</td></tr>';
	ret_value += '<tr><td>referrer:</td><td>' + cnn_omnitureData['referrer'] + '</td></tr>';
	ret_value += '<tr><td>pageName:</td><td>' + cnn_omnitureData['pageName'] + '</td></tr>';
	ret_value += '</table>';
	return ret_value;
}
