/*********************************************************
 * FCCArticle - JavaScript for "User" interface
 * @author Henry Kurniawan, Angela Jusuf
 * @created 06/08/2008
 * @modified 10/08/2008
 *********************************************************/
var App = {

	// Refresh/Update Article List
	updateList:function() {
		$('moduleFCCArticleArticleListContents').innerHTML = 'Loading...';
		new Ajax.Updater(	'moduleFCCArticleArticleListContents',
							'index.php',
							{	'method': 		'post',
								'parameters': 	{	'module':	'FCCArticle',
													'type':		'ajax',
													'func':		'userFragment',
													'mode':		'articleList'},
								'evalScripts':	true,
								'onFailure':	function() {
													alert('Cannot get article list');
													$('moduleFCCArticleArticleListContents').innerHTML = 'Cannot load article list!';
												}});
	}
}

/*
 * On Window onload, attach event handler to buttons
 */
$j(document).ready(function() {	
	$j('#cmdRefresh', '#frmFCCArticleListCommands').click(function() { App.updateList(); });
	App.updateList();
});
