dojo.declare("com.mgh.Language",null, {
	constructor : function(id,name) {
		this.id = id;
		this.name = name;
		this.type = 'Language';
		this.formatString = '<a href="#" id="${id}" onclick="dojo.publish(\'languageClicked\',[\'${id}\',\'${name}\',\'${type}\'])">${name}</a>';
		this.deselectFormatString = '<a href="#" class="goBack" id="${id}" onclick="dojo.publish(\'showAllLanguages\',[\'\',\'\',\'${type}\'])">Show all languages</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);
	}
});
