var Ajax = {
	insert:function(argument){
  		//alert(argument);
  		YAHOO.util.Connect.asyncRequest('POST', 'view/ajaxFlash/ajaxAjoutInfo.php', callback, argument);
	},
	retourFlash:function(o){
		var arrArgument = new Array();
		for(arg in o){
			arrArgument.push(arg+"=" + o[arg]);
		}
		var argument = arrArgument.join('&');
		if(o.stat == undefined)
			this.insert("action=ajoutInfo&"+argument);
		else this.insert("action=stat&"+argument);
	},
	handleSuccess:function(o){
		var swfMovie = document.getElementById("myFlash");
		if(o.responseText != "stat"){
			swfMovie.retourAjax(o.responseText);
		}
	}
}

var callback = {
 success:Ajax.handleSuccess,
 failure: function(o){dialog.showDialog("Erreur XHR : inscription non prise en compte<br />"+o.status, "Erreur !", "");},
 argument: ['foo','bar']
};

var handleOk = function(o){
	dialog.showDialog(o.responseText());
}

var globalEvents = {
	start:function(type, args){
		divLoader.innerHTML = "<img src='img/ajax-loader.gif>";
		divLoader.style.display = "block";
		divLoader.style.position = "absolute";
		divLoader.style.margin = "0 auto";
		divLoader.style.marginTop = "-33px";
		divLoader.style.marginLeft = "-33px";
		divLoader.style.top = "50%";
		divLoader.style.left = "50%";
		divLoader.style.zIndex = "100";
		divCache.style.display = "block";
		divCache.style.position = "absolute";
		divCache.style.top = "0";
		divCache.style.left = "0";
		divCache.style.width = "100%";
		divCache.style.height = "100%";
		divCache.style.background = "#000000";
		divCache.style.opacity = "0.3";
 		divCache.style.filter = "alpha(opacity=30)";
	},

	complete:function(type, args){
		divLoader.innerHTML = "";
		divLoader.style.display = "none";
		divCache.style.display = "none";
	}
};