dojo.declare("com.mgh.AgeGroup",null, {
	constructor : function(id, name) {
		this.id = id;
		this.name = name;
		this.type = 'Age';
		this.formatString = '<a href="#" onclick="dojo.publish(\'ageGroupClicked\',[\'${id}\',\'${name}\',\'${type}\'])">${name}</a>';
		this.deselectFormatString = '<a href="#" class="goBack" id="${id}" onclick="dojo.publish(\'showAllAgeGroups\',[\'\',\'\',\'${type}\'])">Show all</a>';
		this.selectedFormatString = '<p class="title">${name}</p>' + this.deselectFormatString;		
	}, 
	
	Format : function(){
		return dojo.string.substitute(this.formatString,this);		
	},
	
	SelectedFormat : function(){
		return dojo.string.substitute(this.selectedFormatString,this);
	}
});
