/**
 * JavaScript for "Administrative" interface
 */
 
 
var App_type = {
	vTextDeletePrompt:'Delete record?',
	vTextErrorFetchGCList:'Cannot get gold class list',
	vTextErrorFetchGCEditor:'Cannot get editor',
	updateList:function() {
		$('moduleGoldClassListContainer').innerHTML = 'Loading...';
		new Ajax.Updater(	'moduleGoldClassListContainer',
							'index.php',
							{	'method': 		'post',
								'parameters': 	{	'module':	'GoldClass',
													'type':		'ajax',
													'func':		'userFragment',
													'mode':		'gcList'},
								'evalScripts':	true,
								'onFailure':	function() {
													alert(this.vTextErrorFetchGCList);
													$('moduleGoldClassListContainer').innerHTML = this.vTextErrorFetchGCList;
												}});
	},
	
	updateListT:function(gctype) {
		$('moduleGoldClassListContainerS').innerHTML = 'Loading...';
		new Ajax.Updater(	'moduleGoldClassListContainerS',
							'index.php',
							{	'method': 		'post',
								'parameters': 	{	'module':	'GoldClass',
													'type':		'ajax',
													'func':		'userFragment',
													'mode':		'gcListBasedOnTypes',
													'gcType':	gctype},
								'evalScripts':	true,
								'onFailure':	function() {
													alert(this.vTextErrorFetchGCList);
													$('moduleGoldClassListContainerS').innerHTML = this.vTextErrorFetchGCList;
												}});
	},
	
	updateListTypes:function() {
		$('moduleGoldClassListTypesContainer').innerHTML = 'Loading...';
		new Ajax.Updater(	'moduleGoldClassListTypesContainer',
							'index.php',
							{	'method': 		'post',
								'parameters': 	{	'module':	'GoldClass',
													'type':		'ajax',
													'func':		'userFragment',
													'mode':		'gcListTypes'},
								'evalScripts':	true,
								'onFailure':	function() {
													alert('cannot get GC List');
													$('moduleGoldClassListTypesContainer').innerHTML = 'Cannot load Gold Class list!';
												}});
		
	}
}	


Event.observe(window, 'load', function() {
	<!--$(document.frmGoldClassListCommands.cmdRefresh).observe('click', function() { App_type.updateListTypes(); }); -->
	<!--$(document.frmGoldClassListCommands.cmdNew).observe('click', function() { App_type.editorShow(); });-->
	<!--App_type.updateList();-->
	App_type.updateListTypes();
	App_type.updateListT();
});
