//Affichage des popines formations et news

jQuery.extend({
	goAjaxAction :function (url,callback) {
		callback = callback || function(html){};
		$.ajax({
			type: "POST",
			url: url,
			contentType : "text/html; charset=utf-8",
			dataType : "html",
			success : function(html) {
				callback(html);
				callback=null;
				
			},
			error : function( httprequest, textStatus, errorThrown){
				callback=null;
			}
		});
	}
});


function showNewsPopine(shortcut) {
	text="<div id=\"newsPopine\" title=\"News\" width=\"100%\"> </div>";
	$("body").append(text);
	text=null;
	$.goAjaxAction("/goNewsPopine.do?shortcut="+shortcut, function(html) {
		$("#newsPopine").html(html);				
		$("#newsPopine").dialog({
			modal : true,
			draggable : true,
			resizable:true,
			autoOpen:true,
			width:740,
			height:400,
			close : function(trigger) {
				$("#newsPopine").dialog("destroy").remove();
			}
		}); 
	});
	return false;
}
