Index: src/main/webapp/newsession.xhtml
===================================================================
--- src/main/webapp/newsession.xhtml	(revision 45)
+++ src/main/webapp/newsession.xhtml	(revision 1)
@@ -4,4 +4,5 @@
 <title>Profiles and Domains list</title>
 <link rel="stylesheet" type="text/css" href="style.css" />
+
 </head>
 <body onload="init()">
@@ -12,51 +13,26 @@
 
 	<br /> Protocol:
-	<select id="selectedprotocol" onchange="selectProtocol()">
-		<option value="SAOP">SAOP ( Stacked Alternating Offers
-			Protocol )</option>
-		<option value="MOPAC">MOPAC (Multiple Offers Partial
-			Consensus)</option>
-		<option value="MOPAC2">MOPAC2 (MOPAC but with values for each vote)</option>
-		<option value="AMOP">AMOP (Alternating Multiple Offers
-			Protocol)</option>
-		<option value="SHAOP">SHAOP (Stacked Human Alternating Offers
-			Protocol)</option>
-		<option value="Learn">Learn</option>
-			
+	<select>
+		<option value="SAOP">SAOP</option>
 	</select>
 
-	<div id="votingevaluator">
-		<br /> Voting Evaluator: <select id="selectedevaluator">
-			<option value="LargestAgreement">Largest Agreement</option>
-			<option value="LargestAgreementsLoop">Largest Agreements and Repeat</option>
-		</select>
-	</div>
-	<div id="votingevaluator2">
-		<br /> Voting Evaluator: <select id="selectedevaluator2">
-			<option value="LargestAgreementWithValue">Largest Agreement with Values</option>
-		</select>
-	</div>
-
-	
 	<br /> Deadline:
 	<input type="number" id="deadlinevalue" name="deadline" min="1"
 		max="10000" value="10" />
 	<select id="deadlinetype">
+		<option value="TIME">seconds</option>
 		<option value="ROUNDS">rounds</option>
-		<option value="TIME">seconds</option>
 	</select>
 
-	<div id="profserverselector">
 	<br /> Domain/Profile Server:
 	<input type="url" name="url" id="profilesserverurl"
-		value="localhost:8080/profilesserver-2.1.6"
-		pattern=".*:[0-9]+/profilesserver.*" size="30"
+		value="localhost:8080/profilesserver-1.0.0"
+		pattern=".*:[0-9]+/profilesserver" size="30"
 		onchange="connectDomain()"> </input>
 	<br /> Domain:
-	<select id="domainselection" onchange="selectDomain()">
+	<select id="domainselection" onclick="selectDomain()">
 		<!-- <option>Waiting for profiles server</option> -->
 	</select>
-	</div>
-	
+
 	<br />
 	<br />
@@ -64,35 +40,10 @@
 	<div id="box" class="box">
 		<br /> <b>Participants</b> <br /> Parties Server: <input type="url"
-			name="url" id="partiesserverurl"
-			value="localhost:8080/partiesserver-2.1.6"
-			pattern=".*:[0-9]+/partiesserver.*" size="30"
-			onchange="connectParties()"> </input> <br /> <br /> <b>Party
-			settings</b> <br /> Party : <select id="partyselection">
-		</select> <br /> 
-		
-		<div id="profileselector">
-		Profile: <select id="profileselection"></select> Filter: <input
-			type="text" id="filter" value="" maxlength="40" /> <br />
-		</div>
-		Parameters: {
-		<textarea id="parameters" rows="2" cols="70"
-			onchange="updateParameters()" value="" />
-		} <br /> <br />
-
-		<div id="cobsetting">
-			<input type="checkbox" id="advancedCobSettings"
-				onchange="advancedCobSet()"></input> Advanced COB settings<br />
-			<div id="advancedsettings" style="display: none">
-				<b>COB party settings</b> <br /> Party : <select
-					id="cobpartyselection">
-				</select> <br /> Profile: <select id="cobprofileselection"></select> Filter:
-				<input type="text" id="cobfilter" value="" maxlength="40" /> <br />
-				<!--  -->
-				Parameters: {
-				<textarea id="cobparameters" rows="2" cols="70"
-					onchange="updateCobParameters()" value="" />
-				} <br /> <br />
-			</div>
-		</div>
+			name="url" id="partiesserverurl" value="localhost:8080/partiesserver-1.0.0"
+			pattern=".*:[0-9]+/partiesserver" size="30"
+			onchange="connectParties()"> </input> <br />
+		<br /> <b>Edit next party</b> <br /> Party: <select id="partyselection">
+		</select> <br /> Profile: <select id="profileselection">
+		</select> <br />
 
 		<button onclick="addParty()">Add</button>
@@ -100,25 +51,13 @@
 
 		<br /> <br /> <b>Selected Profiles, Parties for the session</b>
-		<table id="selectedpartiestable" width="100%">
-			<colgroup>
-				<col />
-				<col />
-				<col />
-				<col />
-				<col />
-				<col />
-			</colgroup>
+		<table>
 			<thead>
-				<tr>
-					<th align="center">Party</th>
-					<th align="center">Parameters</th>
-					<th align="center">Profile</th>
-
-					<th align="center">COB Party</th>
-					<th align="center">COB Parameters</th>
-					<th align="center">COB Profile</th>
-				</tr>
+				<th align="left" width='40%'>Party</th>
+				<th align="left" width='40%'>Profile</th>
 			</thead>
 			<tbody id="partiesList">
+				<tr id="partiesList">
+				</tr>
+
 			</tbody>
 		</table>
@@ -132,10 +71,7 @@
 
 	<div id="started" style="visibility: hidden">
-		Your session started. Waiting for the results. <br />
+		Your session started.<br /> <a href="" id="logref">view the log
+			file</a> <br /> <a href="" id="plotref">render a utilities plot</a>.
 	</div>
-	<div id="results" style="visibility: hidden">
-		Session completed. <a href="" id="logref">view the log file</a> <br />
-		<a href="" id="plotref">render a utilities plot</a>.
-	</div>
 
 </body>
@@ -144,28 +80,15 @@
 	
 	
-	
-	
-	
-	
-	
-	
-	
-	
-	
 	// FIXME quick and dirty code. No clean MVC
 	
 	
 	<![CDATA[
-        //"use strict";	
+        "use strict";	
         
         var domainwebsocket = null;
-        var partieslistlistener=null;
-        // current setting of parameters
-        var parameters = {};
-
+        var partieswebsocket=null;
         // currently known domains (and profiles) as coming from domainwebsocket.
         // keys are domain names, values are list of profile names
         var knowndomains={};
-        
         
         /**
@@ -178,72 +101,6 @@
 		*/
         var partyprofiles=[];
-        
-        var cobpartyprofiles=[];
-
-	/** from http://fitzgeraldnick.com/2010/08/10/settimeout-patterns.html */
-    
-	function getAdvancedCobSettings() {
-		return document.getElementById('advancedCobSettings').checked;
-	}
-	
-	function advancedCobSet() {
-	    document.getElementById('advancedsettings').style.display=(getAdvancedCobSettings()?'':'none');
-	}
-	
-    function async (fn) {
-        setTimeout(fn, 1000);
-    }
-
-    function sometimeWhen (test, then) {
-        async(function () {
-            if ( test() ) {
-                then();
-            } else {
-                async(arguments.callee);
-            }
-        });
-    }
-
-    /**
-    Called when user changes the protocol */
-    function selectProtocol() {
-    	var visible=getSelectedProtocol() == "SHAOP";
-		
-    	document.getElementById("cobsetting").style.display=(visible ? 'block': 'none');
-	    var tbl = document.getElementById('selectedpartiestable');
-	    tbl.getElementsByTagName('col')[3].style.visibility=(visible?'':'collapse');
-	    tbl.getElementsByTagName('col')[4].style.visibility=(visible?'':'collapse');
-	    tbl.getElementsByTagName('col')[5].style.visibility=(visible?'':'collapse');
-	    
-    	var evaluatorvisible=getSelectedProtocol() == "MOPAC";
-    	document.getElementById("votingevaluator").style.display=(evaluatorvisible ? 'block': 'none');
-		
-    	var evaluator2visible=getSelectedProtocol() == "MOPAC2";
-    	document.getElementById("votingevaluator2").style.display=(evaluator2visible ? 'block': 'none');
-
-    	
-    	var profileselectorvisible=!isUsingFakeProfile();
-    	document.getElementById("profserverselector").style.display=(profileselectorvisible ? 'block': 'none');
-    	document.getElementById("profileselector").style.display=(profileselectorvisible ? 'block': 'none');
-    	if (getSelectedProtocol() == "Learn") {
-    		params = {"persistentstate":createUUID(), "negotiationdata":[ createUUID() ] };
-    		str=JSON.stringify(params);
-    		// remove outer brackets from the text in the box
-        	document.getElementById("parameters").value=str.substring(1, str.length-1);
-    		updateParameters();
-    	}
-    }
-
-    /**
-    @return true iff we need to use a fake profile.
-    */
-    function isUsingFakeProfile() {
-    	return  getSelectedProtocol() == "Learn";
-    }
-    
-    function isUsingCobParty() {
-    	return getSelectedProtocol() == "SHAOP";
-    }
-    
+
+ 	
 	/**
 	Refresh known domains using given profilesserver URL. 
@@ -255,7 +112,6 @@
     		domainwebsocket=null;
     	}
-		var url=new URL("http:"+document.getElementById("profilesserverurl").value);
-		// insert the liststream to the path
-        var target = "ws://"+url.host+url.pathname+"/websocket/liststream"+window.location.search+url.hash;
+		var url=document.getElementById("profilesserverurl").value;
+        var target = "ws://"+url+"/websocket/liststream";
         if ('WebSocket' in window) {
         	domainwebsocket = new WebSocket(target);
@@ -297,46 +153,4 @@
     	selectDomain();
     }
-    
-    /**
-    Connects to partieslist service on partiesserver and 
-    forwards reported parties into the updateParties() call.
-    */
-    class PartiesListWebsocket {
-    	constructor(target) {
-    		this.isopen=false
-    		var that=this
-            if ('WebSocket' in window) {
-            	this.partieswebsocket = new WebSocket(target);
-            } else if ('MozWebSocket' in window) {
-            	this.partieswebsocket = new MozWebSocket(target);
-            } else {
-                alert('WebSocket is not supported by this browser. Please use a newer browser');
-                return;
-            }
-            this.partieswebsocket.onopen = function () {
-            	console.log("new websocket conn made")
-            	that.isopen=true
-            };
-            this.partieswebsocket.onmessage = function (event) {
-            	console.log("new parties data came in")
-            	updateParties(JSON.parse(event.data));
-            };
-            this.partieswebsocket.onclose = function (event) {
-                if (that.isopen) {
-                    alert('Info: Server closed connection. Code: ' + event.code + 
-                    		(event.reason == "" ? "" : ", Reason: " + event.reason));
-                	that.isopen=false;
-                	updateParties({});
-                }
-            };
-    	}
-    	close() {
-    		if (this.isopen)
-    			console.log("closing parties listener")
-	    		this.isopen=false;
-				this.partieswebsocket.close()
-    	}
-    }
-    
 	/**
 	Refresh known parties using given partiesserver URL. 
@@ -344,10 +158,30 @@
 	*/
     function connectParties() {
-    	if (partieslistlistener!=null) {
-    		partieslistlistener.close();
+    	if (partieswebsocket!=null) {
+    		partieswebsocket.close();
+    		partieswebsocket=null;
     	}
 		var url=document.getElementById("partiesserverurl").value;
         var target = "ws://"+url+"/available";
-        partieslistlistener = new PartiesListWebsocket(target)
+        if ('WebSocket' in window) {
+        	partieswebsocket = new WebSocket(target);
+        } else if ('MozWebSocket' in window) {
+        	partieswebsocket = new MozWebSocket(target);
+        } else {
+            alert('WebSocket is not supported by this browser. Please use a newer browser');
+            return;
+        }
+        partieswebsocket.onopen = function () {
+        	// whatever.
+        };
+        partieswebsocket.onmessage = function (event) {
+        	updateParties(JSON.parse(event.data));
+        };
+        partieswebsocket.onclose = function (event) {
+            alert('Info: Server closed connection. Code: ' + event.code + 
+            		(event.reason == "" ? "" : ", Reason: " + event.reason));
+            partieswebsocket=null;
+        	updateParties({});
+        };
     }
 
@@ -356,61 +190,23 @@
 	 refresh table: copy all parties elements in there.
 	 Typically parties is something like
-	 [{"uri":"http:130.161.180.1:8080/partiesserver/run/randomparty-2.1.6",
+	 [{"uri":"http:130.161.180.1:8080/partiesserver/run/randomparty-1.0.0",
 		 "capabilities":{"protocols":["SAOP"]},
 		 "description":"places random bids until it can accept an offer with utility >0.6",
-		 "id":"randomparty-2.1.6",
+		 "id":"randomparty-1.0.0",
 		 "partyClass":"geniusweb.exampleparties.randomparty.RandomParty"},
 		 		 ...]
 	 */
 	function updateParties(parties) {
-		 console.log("new parties set to "+parties)
-		 updatePartiesCombobox(parties, document.getElementById("partyselection"),['SAOP','AMOP','SHAOP','MOPAC', 'MOPAC2']);
-		 updatePartiesCombobox(parties, document.getElementById("cobpartyselection"),['COB']);
-	}
-    
-    /**
-    @param parties a list of parties r(as received from the server)
-    @param combobox a combobox element to put the party URLs in
-    @param behaviours a list of behaviours for the parties. Only these are put in the combobox.
-    */
-    function updatePartiesCombobox(parties, combobox, behaviours) {
+		var combobox = document.getElementById("partyselection");
 		combobox.options.length=0;
-    	for (var p in parties) {
-    		var party = parties[p];
-    		if (intersect(party.capabilities.behaviours, behaviours).length==0)  
-    			continue;
+    	for (var party in parties) {
             var option = document.createElement('option');
-            option.text = option.value = party.uri;
+            option.text = option.value = parties[party].uri;
             combobox.add(option, 0);
     	}
-
-    }
-
-    /**
-    @param a a list
-    @param b another list
-    @return intersection of a and b
-    */
-    function intersect(a, b) {
-        var t;
-        if (b.length > a.length) t = b, b = a, a = t; // indexOf to loop over shorter
-        return a.filter(function (e) {
-            return b.indexOf(e) > -1;
-        });
-    }
-
-
-    /**
-    updates parameters field to match the given text.
-    */
-	function updateParameters() {
-		var text="{"+document.getElementById("parameters").value+"}";
-    	try {
-			parameters=JSON.parse(text);
-    	} catch(e) {
-    		alert("Parameters can not be parsed. "+e);
-    		return;
-    	}
-	}
+	}
+    
+
+
 
 	/**
@@ -425,16 +221,11 @@
 		var domain = domaincombobox.options[domaincombobox.selectedIndex].value;
 		
-		updateProfileComboBox(document.getElementById("profileselection"), knowndomains[domain]);
-		updateProfileComboBox(document.getElementById("cobprofileselection"), knowndomains[domain]);
-	}
-	
-	function updateProfileComboBox(profilecombo, options) {
+		var profilecombo = document.getElementById("profileselection");
 		profilecombo.options.length=0;
-		for (var profile in options) {
+		for (var profile in knowndomains[domain]) {
             var option = document.createElement('option');
-            option.text = option.value = options[profile];
+            option.text = option.value = knowndomains[domain][profile];
             profilecombo.add(option, 0);
 		}
-
 	}
 	
@@ -443,76 +234,22 @@
 	*/
 	function addParty() {
-		addNormalParty();
-		if (isUsingCobParty()) {
-			addCobParty();
-		}
-		updatePartyProfileTable(); // what, MVC?
-	}
-	
-	function addNormalParty() {
 		var partycombo = document.getElementById("partyselection");
 		var profilecombo = document.getElementById("profileselection");
-		var filteroptions = document.getElementById("filter").value;
-		if (filteroptions!="") {
-			filteroptions="?"+filteroptions;
-		}
-		
-		var selectedprofile;
-		if (isUsingFakeProfile()) {
-			selectedprofile="not://valid";
-		} else {
-			if (partycombo.options.length==0) {
-				alert("Please set partier server and select a party");
-				return;
-			}
-			if (profilecombo.options.length==0) {
-				alert("Please set domain/profile server and select a domain and a profile");
-				return;
-			}
-			selectedprofile=profilecombo.options[profilecombo.selectedIndex].value +filteroptions;
-		}
-		
+		
+		if (partycombo.options.length==0) {
+			alert("Please set partier server and select a party");
+			return;
+		}
+		if (profilecombo.options.length==0) {
+			alert("Please set domain/profile server and select a domain and a profile");
+			return;
+		}
 		var newpartyprof = {};
-		newpartyprof["party"]={"partyref":partycombo.options[partycombo.selectedIndex].value , 
-				"parameters":parameters };
-		newpartyprof["profile"]=selectedprofile;
+		newpartyprof["party"]=partycombo.options[partycombo.selectedIndex].value;
+		newpartyprof["profile"]=profilecombo.options[profilecombo.selectedIndex].value;
 		
 		partyprofiles.push(newpartyprof)
-	}
-	
-	
-	function addCobParty() {
-		// we assume a sensible default has been loaded into the combo and set,
-		// regardless it being invisible
-		var partycombo = document.getElementById("cobpartyselection");
-		if (partycombo.options.length==0) {
-			alert("Please set cpb partier server and select a party");
-			return;
-		}
-
-		var newpartyprof = {};
-		if (getAdvancedCobSettings()) {
-			var profilecombo = document.getElementById("cobprofileselection");
-			var filteroptions = document.getElementById("cobfilter").value;
-
-			if (profilecombo.options.length==0) {
-				alert("Please set a cob profile");
-				return;
-			}
-			if (filteroptions!="") {
-				filteroptions="?"+filteroptions;
-			}
-			newpartyprof["party"]={"partyref":partycombo.options[partycombo.selectedIndex].value , 
-					"parameters":parameters };
-			newpartyprof["profile"]=profilecombo.options[profilecombo.selectedIndex].value +filteroptions;
-		} else {
-			var profilecombo = document.getElementById("profileselection");
-			newpartyprof["party"]={"partyref":partycombo.options[partycombo.selectedIndex].value , 
-					"parameters":{} };
-			newpartyprof["profile"]=profilecombo.options[profilecombo.selectedIndex].value;
-		}
-		cobpartyprofiles.push(newpartyprof)
-	}
-
+		updatePartyProfileTable(); // what, MVC?
+	}
 	
 	/** updates the party and profiles table, to match the #partyprofiles list.	 	*/
@@ -524,28 +261,10 @@
 			var cell1 = row.insertCell(-1);
 			var cell2 = row.insertCell(-1);
-			var cell3 = row.insertCell(-1);
-
-			cell1.innerHTML = partyprofiles[pp]["party"]["partyref"];
-			// help browser breaking too large strings 
-			cell2.innerHTML = JSON.stringify(partyprofiles[pp]["party"]["parameters"]).replace(/,/g,", ");
-			cell2.setAttribute("style","overflow-wrap: anywhere;");
-			cell3.innerHTML = partyprofiles[pp]["profile"];
-
-			if (isUsingCobParty()) {
-				var cell4 = row.insertCell(-1);
-				var cell5 = row.insertCell(-1);
-				var cell6 = row.insertCell(-1);
-				cell4.innerHTML = cobpartyprofiles[pp]["party"]["partyref"];
-				cell5.innerHTML = JSON.stringify(cobpartyprofiles[pp]["party"]["parameters"]).replace(/,/g,", ");
-				cell5.setAttribute("style","overflow-wrap: anywhere;");
-				cell6.innerHTML = cobpartyprofiles[pp]["profile"];
-
-			}
-			
-		}
-
-	}
-
-	var x=1;
+			cell1.innerHTML = partyprofiles[pp]["party"];
+			cell2.innerHTML = partyprofiles[pp]["profile"];
+		}
+
+	}
+
 	/**
 	start the session as currently set on this page.
@@ -555,6 +274,6 @@
 	{"SAOPSettings":
 	  {"participants":[
-		    {"party":{"partyref":"http://party1","parameters":{}},"profile":"ws://profile1"},
-		    {"party":{"partyref",}"http://party2","parameters":{}},"profile":"ws://profile2"}],
+		    {"party":"http://party1","profile":"ws://profile1"},
+		    {"party":"http://party2","profile":"ws://profile2"}],
 		    "deadline":{"deadlinetime":{"durationms":100}}}}
 	
@@ -562,26 +281,19 @@
 	*/
 	function start() {
-		var minParties = getSelectedProtocol() == "Learn" ? 1: 2;
-		if (Object.keys(partyprofiles).length < minParties) {
-			alert("At least "+minParties+" parties are needed to run a "+getSelectedProtocol()+" session.");
+		if (Object.keys(partyprofiles).length <2) {
+			alert("At least 2 parties are needed to run a session.");
 			return;
 		}
 
 		// see https://www.w3schools.com/xml/dom_httprequest.asp
-  		document.getElementById("startbutton").disabled=true;
-		document.getElementById("started").setAttribute("style","");
-
-		var xmlHttp = new XMLHttpRequest();
+	    var xmlHttp = new XMLHttpRequest();
 	    xmlHttp.onreadystatechange = function() { 
 	        if (this.readyState == 4) {
 	        	if (this.status == 200) {
-	        		var logurl="log/"+this.responseText+".json";
-	        		document.getElementById("logref").href=logurl;
-	        		document.getElementById("plotref").href="plotlog.xhtml"+
-	        		combineQuery("?id="+this.responseText,window.location.search);
+	        		document.getElementById("startbutton").disabled=true;
+	        		document.getElementById("started").setAttribute("style","");
+	        		document.getElementById("logref").href="log/"+this.responseText+".json";
+	        		document.getElementById("plotref").href="plotlog.xhtml?id="+this.responseText;
 	        		
-	        		sometimeWhen(function() { return urlExists(logurl) },
-	        				function() { document.getElementById("results").setAttribute("style",""); });
-
 	        	}
 	        	else 
@@ -594,140 +306,24 @@
 	}
 
-
-
-	/**
-	@param query1 a query string like &p=q (part of URL)
-	@param query2 another query string 
-	@return the combined querystring of query1 and query2 
-	*/
-	function combineQuery(query1, query2) {
-		if (query1=="") return query2;
-		if (query2=="") return query1;
-		return query1+"&"+query2.substring(1);
-	}
-
-	
-	/**
-	@return true iff the URL exists.
-	*/
-	function urlExists(urlToFile) {
-		// Warning. Synchronous XMLHttpRequest on the main thread is 
-		// deprecated because of its detrimental effects to the end user’s
-		// experience. For more help http://xhr.spec.whatwg.org/
-	    var xhr = new XMLHttpRequest();
-	    xhr.open('HEAD', urlToFile, false);
-	    xhr.send();
-	     
-		return (xhr.status == "200") 
-	}
-	
-	function getSelectedProtocol() {
-		var protocolcombo = document.getElementById("selectedprotocol");
-		return protocolcombo.options[protocolcombo.selectedIndex].value;
-	}
+	
 	/**
 	@return a json request package for the run server
 	*/
 	function makeRequest() {
-		switch(getSelectedProtocol()) {
-		case "SHAOP":
-			return makeShaopRequest();
-		case"SAOP":
-		case "AMOP":
-		case "Learn":
-			return makeStdRequest(getSelectedProtocol()+"Settings");
-		case "MOPAC":
-			return makeMopacRequest();			
-		case "MOPAC2":
-			return makeMopac2Request();			
-		} 
-	}
-	
-	/**
-	@return a SAOP/AMOP request
-	The header contains 'SAOSettings' or 'AMOPSettings'
-	*/
-	function makeStdRequest(header) {
-		return JSON.stringify({[header]: standardHeader() });
-	}
-	
-	/**
-	* @ereturn MOPAC request. Almost standard but extra 'votingEvaluator'.
-	*/
-	function makeMopacRequest() {
-		var extended = standardHeader();
-		var combo = document.getElementById("selectedevaluator");
-		var evaluator = combo.options[combo.selectedIndex].value;
-		extended['votingevaluator'] = { [evaluator]: {} };
-		return JSON.stringify({"MOPACSettings": extended });
-	}
-
-	/**
-	* @ereturn MOPAC2 request. Almost standard but extra 'votingEvaluator'.
-	*/
-	function makeMopac2Request() {
-		var extended = standardHeader();
-		var combo = document.getElementById("selectedevaluator2");
-		var evaluator = combo.options[combo.selectedIndex].value;
-		extended['votingevaluator'] = { [evaluator]: {} };
-		return JSON.stringify({"MOPAC2Settings": extended });
-	}
-	
-	/**
-	@return standard header with participants and deadline 
-	*/
-	function standardHeader() {
 		var deadline={};
 		var value = document.getElementById("deadlinevalue").value;
 		var dtypecombo  = document.getElementById("deadlinetype");
 		if (dtypecombo.options[dtypecombo.selectedIndex].value=="TIME") {
-			deadline["DeadlineTime"] = { "durationms": 1000*value};
+			deadline["deadlinetime"] = { "durationms": 1000*value};
 		} else {
 			// ROUNDS
-			deadline["DeadlineRounds"] = {"rounds": value, "durationms":10000};
-		}
-		var parties=[];
-		for (let i=0; i< partyprofiles.length; i++) {
-			parties.push( {"TeamInfo":{"parties": [ partyprofiles[i] ] }} );
-		}
-		return  { "participants": parties, "deadline":deadline }
-	}
-	
-	
-
-	/**
-	@return a SHAOP request
-	*/
-	function makeShaopRequest() {
-		var deadline={};
-		var value = document.getElementById("deadlinevalue").value;
-		var dtypecombo  = document.getElementById("deadlinetype");
-		if (dtypecombo.options[dtypecombo.selectedIndex].value=="TIME") {
-			deadline["DeadlineTime"] = { "durationms": 1000*value};
-		} else {
-			// ROUNDS
-			deadline["DeadlineRounds"] = {"rounds": value, "durationms":10000};
-		}
-		
-		var parties=[];
-		for (let i=0; i< partyprofiles.length; i++) {
-			var team=[ partyprofiles[i] , cobpartyprofiles[i]  ];
-			parties.push( {"TeamInfo":{"parties":  team }} );
-		}
-		return JSON.stringify({"SHAOPSettings": { "participants": parties, "deadline":deadline }});
-	}
-
-	/**
-	@return a random UUID. 
-	Note − This should not be used in production as GUID or UUID 
-	generated by Math.Random() may not be unique.
-	*/
-	function createUUID() {
-		   return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
-		      var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
-		      return v.toString(16);
-		   });
-	}
-
+			deadline["deadlinerounds"] = {"rounds": value, "durationms":10000};
+		}
+		
+		
+		return JSON.stringify({"SAOPSettings": { "participants": partyprofiles, "deadline":deadline }});
+
+	}
+	
 	
 	/**
@@ -735,7 +331,4 @@
 	*/
 	function init() {
-		selectProtocol();
-		document.getElementById("partiesserverurl").value =window.location.hostname+":8080/partiesserver-2.1.6"
-		document.getElementById("profilesserverurl").value =window.location.hostname+":8080/profilesserver-2.1.6"
 		connectDomain();
 		connectParties();
@@ -745,11 +338,4 @@
 
 
-
-
-
-
-
-
-
 </script>
 
