function chat_webconf(){
	  $.ajax({type: "GET", url: "chat_webconf/chat-update-stats.php", data: "champ=ecran_1_affichages"});
		
		$( "#chat-dialog" ).dialog({
			resizable: false,
			position: ['center',100],
			width: 405,
			height: "auto",
			modal: true,
			closeOnEscape: false,
			open: function(event, ui) {$(this).parent().children().children('.ui-dialog-titlebar-close').hide();}, //hide close button.
			buttons: {
				"Oui": function() {
					$.ajax({type: "GET", url: "chat_webconf/chat-update-stats.php", data: "champ=ecran_1_oui"});
					$(this).load('chat_webconf/chat-indisponible.php');
					$(this).dialog( "option", "buttons", { 
						"Contactez moi": function() {
							
							$("#chat-dialog form").ajaxSubmit({
                               url: "chat_webconf/chat-indisponible.php",
                               type: "post",
                               error: function(){
                                       alert("Probleme de connexion AJAX");
                               },
                               beforeSubmit:function(){},
                               success: function(e){
							                   $("#chat-dialog").html(e);
																 if(e=="<br>Nous allons vous contacter tr&egrave;s rapidement.") {
																	 $.ajax({type: "GET", url: "chat_webconf/chat-update-stats.php", data: "champ=ecran_2_oui"});
																	 $("#chat-dialog").dialog( "option", "buttons", { 
																	   "OK": function() {
																			 $( this ).dialog( "close" );
																		 }
																	 } );
																 }
                            }
                        });

						}, 
						"Non merci": function() {
							$.ajax({type: "GET", url: "chat_webconf/chat-update-stats.php", data: "champ=ecran_2_non"});
							$( this ).dialog( "close" );
						}
					} );
				},
				"Non merci": function() {
					$.ajax({type: "GET", url: "chat_webconf/chat-update-stats.php", data: "champ=ecran_1_non"});
					$( this ).dialog( "close" );
				}
			}
		});
	};

//setTimeout(chat_webconf, 20000);

