/* This Javascript file is used to build the pgt_metadata object on each page for Omniture/ADBP use. */

/* MAJORS CHAMPIONSHIPS HOME PAGE */
if(window.location.href.match('^(.*)majorschampionships.com/(index.cfm)?$')){
	var pgt_metadata = {
		section: ["Majors Championships",""],
		template_type: "section front",
		content_type: "none"
	};
}

/* MAJORS CHAMPIONSHIPS USOPEN AND MASTERS PAGES */
else if(window.location.pathname.match('^/(usopen|masters)/[0-9]{4}/.*/?')){
	var regex = new RegExp('^/(usopen|masters)/([0-9]{4})/([a-z]*)/?');
	var subSection = regex.exec(window.location.pathname);
	if(subSection[1] == "usopen"){
		subSection[1] = "U.S. Open";
	}
	else if(subSection[1] == "masters"){
		subSection[1] = "Masters";
	}
	var pgt_metadata = {
		section: [subSection[1],subSection[1]+" "+subSection[2]],
		content_type: "none"
	};
	if(window.location.pathname.match('^/(usopen|masters)/[0-9]{4}/(index.cfm)?$')){
		pgt_metadata.template_type = "section front"
	}
	else if(window.location.pathname.match('^/(usopen|masters)/[0-9]{4}/'+subSection[3]+'/(tour/)?(past_winners|masters_field|field|index)?(.cfm)?$')){
		pgt_metadata.template_type = "section front"
	}
	else if(window.location.pathname.match('/multimedia/video/')){
		pgt_metadata.template_type = "video";
	}
	else{
		pgt_metadata.template_type = "other";
	}
}

