
		var httpreq;


		function AJAX()
		{
			try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}
			try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}
			try { return new XMLHttpRequest(); } catch(e) {}
			alert("XMLHttpRequest not supported");
			return null;
		}


		function tilmeld(event_id)
		{
			httpreq = new this.AJAX;
			httpreq.open('POST', 'attend_meeting.php', true);
			httpreq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			httpreq.onreadystatechange = function()
			{
				tilmeldMig(event_id);
			}
			httpreq.send('event_id=' + event_id);

		}

		function tilmeldMig(event_id)
		{

			var tilmeld = document.getElementById('tilmeld_' + event_id);

			if(httpreq.readyState == 4)
			{
				eval(httpreq.responseText);
				if(calResponse.signedup == 'false')
					alert(calResponse.message)

					tilmeld.style.display = 'none';
					updateParticipants(event_id);

			}

		}

		function updateParticipants(event_id)
		{
			httpreq = new this.AJAX;
			httpreq.open('POST', 'get_participants.php', true);
			httpreq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			httpreq.onreadystatechange = function()
			{
				writeParticipants(event_id);
			}
			httpreq.send('event_id=' + event_id);
		}

		function writeParticipants(event_id)
		{

			var html = '';

			if(httpreq.readyState == 4)
			{
				eval(httpreq.responseText);

				for (i=0;i<response.participants.length;i++)
				{
					html = html + response.participants[i].name;
					if((i + 1) < response.participants.length)
						html = html + ', ';

				}

				document.getElementById('participants_' + event_id).innerHTML = html;

			}

		}
