/**
 * Load content with ajax
 *
 * Load content with ajax ant put it in the specief container.
 * It also adds a fade out / in effect and an extra GET parameter nocache
 *
 * @param string ContainerId the id of the destination container
 * @param string AjaxLoadUrl the url used for ajax call (this wil be suffixed with &nocache=xxxx)
 * @return boolean false on succes, or true otherwise
 */
var __ContainerId = null;
function ajaxLoad( ContainerId, AjaxLoadUrl, noEffects ){

	if ( typeof noEffects == "undefined" ) noEffects = false;
	//alert ( AjaxLoadUrl );

	if ( typeof(ContainerId) == 'undefined' ) { alert('1'); return true;}
	if ( typeof(AjaxLoadUrl) == 'undefined' ) { alert('2'); return true;}

	noCacheStr = 'nocache=' + parseInt(Math.random()*9999999);
	if ( AjaxLoadUrl.indexOf ( '?') == -1 ) noCacheStr = '?' + noCacheStr;
	else noCacheStr = '&' + noCacheStr;

	//alert ( AjaxLoadUrl );
	__ContainerId = ContainerId;
	objContainer = $('#' + ContainerId); 			// indentify the container
	if ( !noEffects ) objContainer.fadeOut( 300 ); 					// fadeOut effect
	objContainer.load( 								// ajax call
			AjaxLoadUrl + noCacheStr				// - ajax url
			,{}										// - data (optional)
			, function() {							// - callback function (fadeIn effect)
				objContainer = $('#' + __ContainerId);
				if ( !noEffects ) objContainer.fadeIn( 500 );
				objContainer.show( 0 );
			}
		) ;

	return false;
}
