/**
 * JavaScript for "Administrative" interface
 */
 
 
var App_type = {
	vTextDeletePrompt:'Delete record?',
	vTextErrorFetchPodcastList:'Cannot get podcast list',
	vTextErrorFetchPodcastEditor:'Cannot get editor',
	updateList:function() {
		$('modulePodcastListContainer').innerHTML = 'Loading...';
		new Ajax.Updater(	'modulePodcastListContainer',
							'index.php',
							{	'method': 		'post',
								'parameters': 	{	'module':	'Podcast',
													'type':		'ajax',
													'func':		'userFragment',
													'mode':		'podcastList'},
								'evalScripts':	true,
								'onFailure':	function() {
													alert(this.vTextErrorFetchPodcastList);
													$('modulePodcastListContainer').innerHTML = this.vTextErrorFetchPodcastList;
												}});
	},
	
	updateListT:function(podcastserial) {
		$('modulePodcastListContainerS').innerHTML = 'Loading...';
		//document.write(podcastserial);
		new Ajax.Updater(	'modulePodcastListContainerS',
							'index.php',
							{	'method': 		'post',
								'parameters': 	{	'module':	'Podcast',
													'type':		'ajax',
													'func':		'userFragment',
													'mode':		'podcastListBasedOnSerial',
													'podcastserial':	podcastserial},
								'evalScripts':	true,
								'onFailure':	function() {
													alert(this.vTextErrorFetchPodcastList);
													$('modulePodcastListContainerS').innerHTML = this.vTextErrorFetchPodcastList;
												}});
	},
	
	updateListTypes:function() {
		$('modulePodcastListTypesContainer').innerHTML = 'Loading...';
		new Ajax.Updater(	'modulePodcastListTypesContainer',
							'index.php',
							{	'method': 		'post',
								'parameters': 	{	'module':	'Podcast',
													'type':		'ajax',
													'func':		'userFragment',
													'mode':		'podcastListSerial'},
								'evalScripts':	true,
								'onFailure':	function() {
													alert('cannot get Podcast List');
													$('modulePodcastListTypesContainer').innerHTML = 'Cannot load Podcast list!';
												}});
		
	}
}	


Event.observe(window, 'load', function() {
	<!--$(document.frmPodcastListCommands.cmdRefresh).observe('click', function() { App_type.updateListTypes(); }); -->
	<!--$(document.frmPodcastListCommands.cmdNew).observe('click', function() { App_type.editorShow(); });-->
	<!--App_type.updateList();-->
	App_type.updateListTypes();
	App_type.updateListT($j('.podcastserial').val());

	<!--App_type.updateListT();-->
});
