/****************************************************
		RyderCup.com Omniture Implementation


	This file is responsible for appending data about the page to the necessary Omniture variables.
	The code will live as an include inside of the s_code.js provided by Omniture.
	
********************************************************/
	
	//prepares the URL to be parsed
	var pathname = window.location.pathname.substring(1);
	if (pathname.charAt(pathname.length - 1) == "/") pathname += "index.html";
	var path_array = pathname.split('/');
	
	//Initializing the JSON that holds the necessary data to be sent to Omniture
	var metrics = {
		server: 	window.location.host,
		channel:	null,
		pageName:	null
	}
	
	var yearRegExp = /20\d{2}/g; //regular expression to check for a year
	
//When this function is called, the page data that is stored is set to the Omniture variables.
function populateMetricsData(){
	s.server = metrics.server;
	s.pageType = metrics.pageType;
	s.pageName = (metrics.pageName != null) ? metrics.pageName : s.getPageName();
	s.channel = metrics.channel;
}
	
//base of the pageName
metrics.pageName = "pga:rydercup";
//set metrics.pageName
for (var index = 0; index < path_array.length; ++index) {
	metrics.pageName += ':'+path_array[index];
}

	

