var History = {
	adminURL : '../modules/history/admin.php',
	//------------------------------------------------------------------//
	// Edition d'une date												//
	//------------------------------------------------------------------//
	editDate : function(IdHistory){
		$.ajax({
			type: 'post', 
			url: History.adminURL,
			data: {
				action: 'editDate',
				id_history: IdHistory
			},
			success: function(msg){
				$('#workspace').html(msg);
			}
		});
		return false;
	},
	//------------------------------------------------------------------//
	// Enregistrement d'une date										//
	//------------------------------------------------------------------//
	saveDate : function(IdHistory){
		if ( Global.verifForm() ){
			var Bodies = new Array;
			for(i=0; i<LANGS.length; i++){
				var IdLang   = LANGS[i][0];
				var CodeLang = LANGS[i][1];
				var oEditor  = FCKeditorAPI.GetInstance(CodeLang + '_body');
				Bodies[Bodies.length] = CodeLang + '=' + oEditor.GetXHTML();
			}
			$.ajax({
				type: 'post',
				url: History.adminURL,
				data: {
					action: 'saveDate',
					id_history: IdHistory,
					name: $('#name').val(),
					year: $('#year').val(),
					bodies: Bodies.join('||')
				},
				success: function(msg){
					messagebox('La date a été enregistrée');
					Modules.openAdmin('history');
				}
			});
		}
		return false;
	}
}
