
//all articles that are corporate leadership articles
//add and remove accordingly to match up with corporate leadership pages
var corporateLeaderShipArray = new Array();
corporateLeaderShipArray.push("1001"); 
corporateLeaderShipArray.push("1002");
corporateLeaderShipArray.push("1003");
corporateLeaderShipArray.push("1004");
corporateLeaderShipArray.push("1005");
corporateLeaderShipArray.push("1006");
corporateLeaderShipArray.push("1007");
corporateLeaderShipArray.push("1008");
corporateLeaderShipArray.push("1009");
corporateLeaderShipArray.push("1010");
corporateLeaderShipArray.push("1011");
corporateLeaderShipArray.push("1012");
corporateLeaderShipArray.push("1013");
corporateLeaderShipArray.push("1014");

/**
 * Interceptor for handling press center custom tracking.
 */
function trackPressCenter() {
	
	
	var url= document.URL.toLowerCase().split('/');
	if (url.length >= 4){
		
		var hostname = url[2];
	 
	 	//this is like this for firebug js debugger.. something weird was happening
	 	var myurl = document.URL;
		var myindex = myurl.indexOf("article_display.cfm");
	 
	 
	 	//check to see if its the article_display.cfm page
		if(myindex >= 0) {
			var articleId = s_om.getQueryParam("article_id");
			
			//s_om.prop12 = articleId;
			
			//is it a corporate page or just a normal news article
			if(isCorporateLeadershipArticle(articleId)) {
				s_om.pageName = "amp:news:corporate leadership:"+ stripTitle(document.title);
			} else {		
				s_om.pageName = "amp:news:view press release:"+ stripTitle(document.title);
			}
			
	  }	else {
			
			//default page
			if(url[3] == "") {
				s_om.pageName = "amp:news";
			} else {
				s_om.pageName = "amp:news:" + url[3];
			}
		}
	}
	
}



/**
 * Check to see if the article is a corporate leadership article
 * @param articleId - article id from query string
 */
function isCorporateLeadershipArticle(articleId) {
	
	for (var i = 0; i < corporateLeaderShipArray.length; i++) {
		if(articleId == corporateLeaderShipArray[i]) {
			return true;
		}
	}
	return false;
	
	
}

/**
 * Trim the title tag for pagename tracking
 * @param title - title tag
 */ 
function stripTitle(title) {
	title = title.replace("Ameriprise Newsroom | ", "");
	return title;
}
