/*******************************************************
DataProcessor Object:

- formats specific data values for proper display
*******************************************************/
	 
DataProcessor = function(){}

DataProcessor.prototype.getWins = function(n) { return n.w; }
DataProcessor.prototype.getLosses = function(n) { return n.l; }
DataProcessor.prototype.getPercentage = function(n) { return n.pct; }
DataProcessor.prototype.getGamesBack = function(n) { return n.gb; }
DataProcessor.prototype.getStreak = function(n) { return n.strk; }
DataProcessor.prototype.getLast10 = function(n) { return n.last10; }
DataProcessor.prototype.getElim = function(n) { return n.elim; }

DataProcessor.prototype.getTeamRs = function(n) { 
	return "<a href='http://" + getTeamDomain(n.code) + ".mlb.com/index.jsp?c_id=" + n.code + "' title='Go to the " + n.league_sensitive_team_name + " homepage'>" + n.league_sensitive_team_name + "</a>";
}

DataProcessor.prototype.getTeamWc = function(n) { 
	return "<a href='http://" + getTeamDomain(n.code) + ".mlb.com/index.jsp?c_id=" + n.code + "' title='Go to the " + n.league_sensitive_team_name + " homepage'>" + n.league_sensitive_team_name + "</a>";
}

DataProcessor.prototype.getTeamSt = function(n) { 
	return "<a href='http://" + getTeamDomain(n.code) + ".mlb.com/index.jsp?c_id=" + n.code + "' title='Go to the " + n.league_sensitive_team_name + " homepage'>" + n.league_sensitive_team_name + "</a>";
}

DataProcessor.prototype.getTeamDl = function(n) { 
	return n.div + " - <a href='http://" + getTeamDomain(n.code) + ".mlb.com/index.jsp?c_id=" + n.code + "' title='Go to the " + n.league_sensitive_team_name + " homepage'>" + n.league_sensitive_team_name + "</a>";
}

DataProcessor.prototype.getLastGame = function(n) { 
	var output = "";
	if (n.lastg != null) {
		if (n.wrap != null) output = "<a href=\"" + n.wrap + "\">" + n.lastg + "</a>";
		else output = n.lastg;
	}
	else output = "-";
	return output;
}

DataProcessor.prototype.getNextGame = function(n) {
	var output = ""; 
	if (n.nextg != null) {
		if (n.status.indexOf("I") != -1) output = "<a href='javascript:void(launchGameday(\"" + n.gameid + "\"));'>" + n.nextg + "</a> <img src='/mlb/images/audio/gda_2003/icon_live.gif' width='10' height='10' alt='LIVE' valign='absmiddle' border='0' />";
		else if ((n.status.indexOf("P") != -1) && n.pre != null) output = "<a href='" + n.pre + "'>" + n.nextg + "</a>"; 
		else output = n.nextg; 
	}
	else output = "-";
	return output;
}
