dojo.declare("com.mgh.LanguagesController", null, {
	constructor : function (id,url){
		this.allLanguagesId = id;
		this.url = url;
	},
	
	GetAllLanguages : function(id,name,type){
		try {
			id = id == '' ? this.allLanguagesId : id;
			dojo.xhrGet({
				url: this.url + 'getAllLanguages.ashx?id=' + id,
				handleAs: "json",
				load : function (response,ioArgs){					
					dojo.publish('languagesDataReady',[response]);
				},
				error : function(response, ioArgs){
					alert("An error occurred, with response: " + response);
				}
			});
		} catch (e) {
			console.log('LanguagesController.GetAllLanguages Error: ' + e);			
		}
	},
	
	Filter : function(id,name){
		showTimer();
		mySearch.queryParams.language = id;
		mySearch.getXmlString();	
	}
});
