/**
 * last login information retrival action AJAX call.
 *
 * @return void
 */
function getLastLoginInfo() {
	new Ajax.Request('/index/showlogininfo',{
		method: 'post',
		onSuccess: function(a_objResponse) {
			Element.update('pLoginInfo', a_objResponse.responseText);
		}
	});
}

/**
 * Login action AJAX call.
 *
 * @return void
 */
function doLogin() {
	Element.update('spnAjaxStatus', '<img src="/img/ajax-loader.gif" height="16" width="16" align="absmiddle" alt="Loading ..." />');

	$('frmMain').request({
		onSuccess: function(a_objResponse) {
			Element.update('spnAjaxStatus', ''),
			Element.update('spnStatus', a_objResponse.responseText),
			new Effect.Highlight('divMsgDisplay', {duration: 1.7, startcolor:'#FFFF64'});
		}
	});
}

/**
 * Message display toggle action.
 *
 * @return void
 */
function toggleDetails() {
	blnObj = $('ulMsgList');
	imgObj = $('imgExpangMsg');

	if (blnObj.style.display == 'none') {
		blnObj.style.display = '';
		imgObj.src = '/img/icon/minus.gif';
		imgObj.alt = 'Hide message';
		imgObj.title = 'Hide message';
	}

	else {
		blnObj.style.display = 'none';
		imgObj.src = '/img/icon/plus.gif';
		imgObj.alt = 'Show message';
		imgObj.title = 'Show message';
	}
}

/**
 * Logoff confirm action AJAX call.
 *
 * @return void
 */
function confirmLogoff() {
	$strMsg = '<strong>Are you sure that you want to logoff ?</strong>';

	new LITBox($strMsg, {type:'confirm', overlay:true, func:logoff, width:400, height:100});
}

/**
 * Lofoff action AJAX call.
 *
 * @return void
 */
function logoff() {
	window.document.location = '/index/logoff';
}
