Index: src/main/webapp/newtournament.xhtml
===================================================================
--- src/main/webapp/newtournament.xhtml	(revision 45)
+++ src/main/webapp/newtournament.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()">
@@ -13,81 +14,55 @@
 	<br />
 
-
+	<select>
+		<option value="APP">All Permutations Tournament Protocol
+			(APP)</option>
+	</select>
+	<br />
+	<br />
+	<input type="number" id="partiespersession" name="tentacles" min="2" max="10" value="2"/>
+	Number of parties in each session
+	<br />
+
+	<input type="checkbox" id="reuseparties"/> Pick
+	parties with return when creating sessions
+	<br />
+
+	<br />
 	<div id="box" class="box">
-		<h3>Tournament global settings</h3>
-		<select id="tourprotocol" onchange="updateTournamentProt()">
-			<option value="AllPermutations">All Permutations Tournament Protocol
-				(APP)</option>
-			<option value="AllPermutationsLearn">APP with learning</option>
-		</select> Tournament protocol <br />
-		<div id="learntimebox">
-			<input type="number" id="learntime" name="learntime" min="1"
-				max="10000" value="30" /> Learning time (s)
-		</div>
-
-		<br /> <input type="number" id="ntournaments" min="1" max="1000000"
-			value="1" /> Number of times to repeat the entire tournament <br />
-
-		<br /> <input type="number" id="teamspersession" min="2" max="10"
-			value="2" /> Number of teams in each session <br /> <input
-			type="checkbox" id="reuseteams" /> Pick teams with return when
-		creating sessions <br />
+		Session Protocol settings
+		<br />
+		Session Protocol: <select>
+			<option value="SAOP">SAOP</option>
+		</select>
+		<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>
+		</select>
 	</div>
-
-	<br />
+	<br />
+
 	<div id="box" class="box">
-		Session Protocol settings <br /> Session Protocol: <select
-			id="protocolselection" onchange="selectSessionProtocol()">
-			<option value="SAOP">SAOP</option>
-			<option value="MOPAC">MOPAC</option>
-			<option value="MOPAC2">MOPAC2</option>
-			<option value="AMOP">AMOP</option>
-			<option value="SHAOP">SHAOP</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 Value</option>
-			</select>
-		</div>
-
-		<br /> Deadline: <input type="number" id="deadlinevalue"
-			name="deadline" min="1" max="10000" value="10" /> <select
-			id="deadlinetype">
-			<option value="ROUNDS">rounds</option>
-			<option value="TIME">seconds</option>
-		</select>
-	</div>
-	<br />
-
-	<div id="box" class="box">
-		<h3>Profiles</h3>
+		<br />
 		Domain/Profile Server: <input type="url" name="url"
-			id="profilesserverurl" value="localhost:8080/profilesserver-1.3.1"
-			pattern=".*:[0-9]+/profilesserver.*" size="30"
-			onchange="connectDomain()"> </input> <br /> Domain: <select
-			id="domainselection" onchange="selectDomain()">
+			id="profilesserverurl" value="localhost:8080/profilesserver-1.0.0"
+			pattern=".*:[0-9]+/profilesserver" size="30"
+			onchange="connectDomain()"> </input>
+		<br />
+		Domain: <select id="domainselection" onclick="selectDomain()">
 			<!-- <option>Waiting for profiles server</option> -->
-		</select> <br /> <br />
-		<!--  first selected profile -->
-		Profile: <select id="profileselection1">
-		</select> Filter: <input type="text" id="filter1" value="" maxlength="40" /> <br />
-		<!--  second selected profile -->
-		<div class="onlySHAOP">
-			COB: <select id="profileselection2">
-			</select> Filter: <input type="text" id="filter2" value="" maxlength="40" />
-			<br />
-		</div>
-		<button onclick="addProfiles()">Add</button>
-		<br /> <br />
+		</select>
+
+		<br />
+		<br />
+		<button onclick="addProfile()">Add</button>
+		Profile: <select id="profileselection">
+			<!-- <option>Waiting for partiesserver</option> -->
+		</select>
+		<br />
+
+		<br />
+
 		<table id="profiles">
 			<thead>
@@ -104,40 +79,23 @@
 	<br />
 	<div id="box" class="box">
-		<h3>Teams</h3>
-		<br /> Parties Server: <input type="url" name="url"
-			id="partiesserverurl" value="localhost:8080/partiesserver-1.3.1"
-			pattern=".*:[0-9]+/partiesserver.*" size="30"
-			onchange="connectParties()"> </input> <br /> <br />
-		<!-- party  1 selection -->
+		<br />
+		Parties Server: <input type="url" name="url" id="partiesserverurl"
+			value="localhost:8080/partiesserver-1.0.0"
+			pattern=".*:[0-9]+/partiesserver" size="30"
+			onchange="connectParties()"> </input>
+		<br />
+		<br />
+		<button onclick="addParty()">Add</button>
 		Party: <select id="partyselection">
-		</select> <br /> Parameters: {
-		<textarea id="parameters" rows="2" cols="70"
-			onchange="getParameters('parameters')" value="" />
-		} <br />
-		<!-- party 2 selection -->
-		<div class="onlySHAOP">
-			COB: <select id="partyselection2">
-			</select> <br /> Parameters: {
-			<textarea id="parameters2" rows="2" cols="70"
-				onchange="getParameters('parameters2')" value="" />
-			}
-		</div>
-		<br />
-
-
-		<button onclick="addTeam()">Add</button>
-
-		<br /> <br />
+			<!-- <option>Waiting for partiesserver</option> -->
+		</select>
+
+		<br />
 		<table>
 			<thead>
-				<th align="left">Party</th>
-				<th align="left">Parameters</th>
-				<th align="left"><div class="onlySHAOP">Compare Bids
-						Party</div></th>
-				<th align="left"><div class="onlySHAOP">Compare Bids
-						Parameters</div></th>
+				<th align="left">Selected Parties</th>
 			</thead>
-			<tbody id="teamList">
-				<tr id="FIXME REMOVE">
+			<tbody id="partiesList">
+				<tr id="partiesList">
 				</tr>
 
@@ -148,10 +106,8 @@
 	<br />
 	<form>
-		<input id="startbutton" type="button" value="Start Tournament"
-			onclick="start()" />
+		<input id="startbutton" type="button" value="Start Tournament" onclick="start()" />
 	</form>
-	<div id="started" style="visibility: hidden">
-		Your tournament started. Click <a href="" id="logref">here</a> to view
-		the log file. <br /> <a href="" id="plotref">show results table.</a>.
+	<div id="started" style="visibility:hidden">
+	Your tournament started. Click <a href="" id="logref">here</a> to view the log file.
 	</div>
 
@@ -159,20 +115,4 @@
 
 <script type="application/javascript">
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
 	
 	
@@ -200,71 +140,13 @@
         
         var domainwebsocket = null;
-        var partieslistlistener=null;
+        var partieswebsocket=null;
         // currently known domains (and profiles) as coming from domainwebsocket.
         // keys are domain names, values are list of profile names
         var knowndomains={};
         
-        var teamslist=[];
+        var parties=[];
         var profiles=[]
 
-    /**
-    The tournament protocol was changed.
-    */
-    function updateTournamentProt() {
-       	updateParameters();
-        var tourprot = document.getElementById("tourprotocol").value;
-       	document.getElementById("learntimebox").style.display=(tourprot=="AllPermutationsLearn" ? 'block': 'none');
-       	
-    }
-        
-    /**
-    Parameters are needed if protocol is APP.
-    */
-    function updateParameters() {
-        var tourprot = document.getElementById("tourprotocol").value;
-   		if (tourprot=='AllPermutationsLearn') {
-    		var params = {"persistentstate":createUUID() };
-    		var str=JSON.stringify(params);
-    		// remove outer brackets from the text in the box
-        	document.getElementById("parameters").value=str.substring(1, str.length-1);
-   		}
-    }
-        
-        
- 	/**
- 	called when user changes the protocol.
- 	With SHAOP we show COB selectors and COB columns in the tables.
-    */
-    function selectSessionProtocol() {
-            const protocol = document.getElementById("protocolselection").value;
-        	setStyleSheet('.onlySHAOP','{ display: '+(protocol=="SHAOP"? '?':'none')+'; }')
-        	
-        	document.getElementById("votingevaluator").style.display=(protocol=="MOPAC" ? 'block': 'none');
-        	
-        	document.getElementById("votingevaluator2").style.display=(protocol=="MOPAC2" ? 'block': 'none');
-
-    }
-    
-    /**
-    Change style sheet to new value. Nothing happens if there is
-    no style sheet with given classname.
-    @param classname the name of the style definition, eg '.onlySHAOP'
-    @param style the new style for the class. eg  '{ max-width: 100px; }'
-    */
-    function setStyleSheet(classname, style) {
-    	for (var cssRulenr=0; cssRulenr< document.styleSheets.length; cssRulenr++) {
-    		var cssRule = document.styleSheets[cssRulenr];
-    		// there may be multple CSS definitions, check each.
-        	var rules = cssRule.cssRules;
-        	for (var rulenr=0;  rulenr<rules.length; rulenr++) {
-        		var rule = rules[rulenr];
-        		if ('selectorText' in rule && rule.selectorText==classname) {
-        			cssRule.deleteRule(rulenr);
-        			cssRule.insertRule(classname+ " "+style, rulenr);
-        		}
-        	}
-    	}
-    }
-        
+ 	
 	/**
 	Refresh known domains using given profilesserver URL. 
@@ -317,102 +199,50 @@
     	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. 
-   	Called when user enters URL for parties server.
-   	*/
-       function connectParties() {
-       	if (partieslistlistener!=null) {
-       		partieslistlistener.close();
-       	}
-   		var url=document.getElementById("partiesserverurl").value;
-           var target = "ws://"+url+"/available";
-           partieslistlistener = new PartiesListWebsocket(target)
-       }
-
-
-	/**
-	@param parties a new list of parties available on the parties server
-	*/
+	/**
+	Refresh known parties using given partiesserver URL. 
+	Called when user enters URL for parties server.
+	*/
+    function connectParties() {
+    	if (partieswebsocket!=null) {
+    		partieswebsocket.close();
+    		partieswebsocket=null;
+    	}
+		var url=document.getElementById("partiesserverurl").value;
+        var target = "ws://"+url+"/available";
+        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({});
+        };
+    }
+
+	
 	function updateParties(parties) {
-		updatePartyCombo(document.getElementById("partyselection"), parties, 'shaop');
-		updatePartyCombo(document.getElementById("partyselection2"), parties, 'comparebids');
-	}
-	
-	/**
-	put the available parties in the party comboboxes.
-	@param combobox a document <select> element 
-	@param parties a dict of party information coming from the partiesserver
-	@param select a string that may be a substring of the part names. 
-	@return the combobox value that contains 'select' as substring, or undefined
-	*/
-	function updatePartyCombo(combobox, parties, select) {
-		var selection=undefined;
+		var combobox = document.getElementById("partyselection");
 		combobox.options.length=0;
     	for (var party in parties) {
             var option = document.createElement('option');
             option.text = option.value = parties[party].uri;
-            if (option.text.includes(select) ) option.selected=true;
             combobox.add(option, 0);
     	}
-    	return selection;
 	}
     
 
-    
-    /**
-    @param elementname eg "parameters", the ID of the element in the <input> element 
-    @return the JSON parsed object, or {} if empty or parsing fails.
-    */
-    function getParameters(elementname) {
-		var text="{"+document.getElementById(elementname).value+"}";
-    	try {
-			return JSON.parse(text);
-    	} catch(e) {
-    		alert("Parameters can not be parsed. Make sure you write correct JSON here."+e);
-    	}
-		return {};
-    }
+
 
 	/**
@@ -426,35 +256,19 @@
 		if (domaincombobox.options.length==0) return; // fixme clean profiles options?
 		var domain = domaincombobox.options[domaincombobox.selectedIndex].value;
-		updateProfiles(knowndomains[domain])
-	}
-	
-	function updateProfiles(profileslist) {
-		updateProfileCombo(document.getElementById("profileselection1"),profileslist);
-		updateProfileCombo(document.getElementById("profileselection2"),profileslist);
-	}
-	
-	/**
-	@param combobox the <select> element that should be udpated
-	@param profileslist the list of profile names to be put in the combbo
-	*/
-	function updateProfileCombo(profilecombo, profileslist) {
+		
+		var profilecombo = document.getElementById("profileselection");
 		profilecombo.options.length=0;
-		for (var profile in profileslist) {
+		for (var profile in knowndomains[domain]) {
             var option = document.createElement('option');
-            option.text = option.value = profileslist[profile];
+            option.text = option.value = knowndomains[domain][profile];
             profilecombo.add(option, 0);
 		}
 	}
 	
-	
 	/**
 	Called when user clicks "Add" 
 	*/
-	function addTeam() {
+	function addParty() {
 		var partycombo = document.getElementById("partyselection");
-		var partycombo2 = document.getElementById("partyselection2");
-		var param = getParameters("parameters");
-		var param2 = getParameters("parameters2");
-		
 		
 		if (partycombo.options.length==0) {
@@ -462,59 +276,31 @@
 			return;
 		}
-		var team = [];
-		team.push({"partyref":partycombo.options[partycombo.selectedIndex].value, "parameters":param});
-		team.push({"partyref":partycombo2.options[partycombo2.selectedIndex].value, "parameters":param2});
-
-		teamslist.push(team);
-		updateTeamsTable();
-		updateParameters(); // generate new UUID for next party
-	}
-	
-	/** updates the teams table, to match the #partyprofiles list.	 	*/
-	function updateTeamsTable() {
-		var table = document.getElementById("teamList");
+		parties.push(partycombo.options[partycombo.selectedIndex].value)
+		updatePartyTable();
+	}
+	
+	/** updates the party table, to match the #partyprofiles list.	 	*/
+	function updatePartyTable() {
+		var table = document.getElementById("partiesList");
 		table.innerHTML = ""; // clear table
-		for ( const team of teamslist) {
+		for ( var party in parties) {
 			var row = table.insertRow(-1);
-			for (const col in team) {
-				const party = team[col]
-				var cell1 = row.insertCell(-1);
-				var cell2 = row.insertCell(-1);
-				cell1.innerHTML = party["partyref"];
-				cell2.innerHTML = JSON.stringify(party["parameters"]).replace(/,/g,", ");;
-				cell2.setAttribute("style","overflow-wrap: anywhere;");
-				if (col>0) {
-					cell1.className = cell2.className = "onlySHAOP";
-				}
-
-			}
-		}
-		
-		selectSessionProtocol(); // HACK we need to KEEP onlySHAOP elements hidden
-	}
-
-	/**
-	@param profilenr the profile nr, 1 for normal , 2 for cob profile
-	*/
-	function getProfile(profilenr) {
-		var profilecombo = document.getElementById("profileselection"+profilenr);
+			var cell1 = row.insertCell(-1);
+			cell1.innerHTML = parties[party];
+		}
+
+	}
+
+	/**
+	Called when user clicks "Add" to add a profile
+	*/
+	function addProfile() {
+		var profilecombo = document.getElementById("profileselection");
+		
 		if (profilecombo.options.length==0) {
 			alert("Please set domain/profile server and select a domain and a profile");
-			throw "blabla";
-		}
-		var filteroptions = document.getElementById("filter"+profilenr).value;
-		if (filteroptions!="") {
-			filteroptions="?"+filteroptions;
-		}
-
-		//return profilecombo.options[profilecombo.selectedIndex].value + filteroptions
-		return profilecombo.value + filteroptions
-	}
-	
-	/**
-	Called when user clicks "Add" to add a profile set
-	*/
-	function addProfiles() {
-		profiles.push([getProfile(1), getProfile(2)]);
+			return;
+		}
+		profiles.push(profilecombo.options[profilecombo.selectedIndex].value)
 		updateProfileTable(); // what, MVC?
 	}
@@ -524,20 +310,17 @@
 		var table = document.getElementById("profilesList");
 		table.innerHTML = ""; // clear table
-		for ( const profileset of profiles) {
+		for ( var profile in profiles) {
 			var row = table.insertRow(-1);
-			for (var col in profileset) {
-				var profile = profileset[col];
-				var cell1 = row.insertCell(-1);
-				cell1.innerHTML = profile;
-				if (col>0) cell1.className = "onlySHAOP"
-			}			
-		}
-		selectSessionProtocol(); // HACK we need to KEEP onlySHAOP elements hidden
+			var cell1 = row.insertCell(-1);
+			cell1.innerHTML = profiles[profile];
+		}
+
 	}
 	
 	/**
 	start the tournament as currently set on this page.
-	We need to send a TournamentSettings object to the server, which typically looks like this with SAOP
-	<code>
+	We need to send a TournamentSettings object to the server, which typically looks like this
+	but is protocol dependent (currently we do SAOP)
+	
 	{"AllPermutationsSettings":{"parties":["party1","party2"],
 		"profiles":["profile1","profile2","profile3"],
@@ -545,32 +328,17 @@
 		"partiesPerSession":2,
 		"sessionsettings":{"SAOPSettings":{"participants":[],"deadline":{"deadlinetime":{"durationms":10}}}}}}
-	</code>
+	
 	participants are already in the global partyprofiles dictionary
-	
-	With SHAOP, it looks like this
-	<code>
-	{
-		"AllPermutationsSettings": {
-			"parties": [ { "partyref": "classpath:geniusweb.exampleparties.simpleshaop.ShaopParty", "parameters": { } },
-				{ "partyref": "classpath:geniusweb.exampleparties.randomparty.RandomParty",	"parameters": {	}}
-			],
-			"reuseParties": false,
-			"profiles": [ 	"prof1?partial=10", "prof2?partial=15"],
-			"partiesPerSession": 2,
-			"sessionsettings": { 	"SHAOPSettings": {
-					"participants": [ ], 
-					"deadline": { "deadlinerounds": {	"rounds": 10, "durationms": 10000	} } } } } }
-	</code>
 	*/
 	function start() {
-		const npersession = document.getElementById("teamspersession").value;
-		
-		if (teamslist.length < npersession) {
-			alert("At least "+npersession+" teams are needed.");
+		var npersession = document.getElementById("partiespersession").value;
+		
+		if (parties.length < npersession || npersession <2) {
+			alert("At least "+npersession+" parties are needed.");
 			return;
 		}
 		
 		if (profiles.length < npersession) {
-			alert("At least "+npersession+" profilesets are needed.");
+			alert("At least "+npersession+" profiles are needed.");
 			return;
 		}
@@ -584,5 +352,4 @@
 	        		document.getElementById("started").setAttribute("style","");
     	    		document.getElementById("logref").href="log/"+this.responseText+".json";
-	        		document.getElementById("plotref").href="utilstable.xhtml?"+this.responseText;
 	        	} else 
 	        		alert("request failed:"+this.statusText);
@@ -594,100 +361,28 @@
 	
 	/**
-	@return a json request package containing a AllPermutationsSettings.
-	It assumes that global vars parties and sessionSettings have been set properly.
+	@return a json request package containing a AllPermutationsSettings
 	*/
 	function makeRequest() {
-		const npersession = document.getElementById("teamspersession").value;
-		const ntournaments = document.getElementById("ntournaments").value;
-		const reuseTeams  = document.getElementById("reuseteams").checked;
-		const protocolcombobox = document.getElementById("protocolselection");
-		const protocol = protocolcombobox.options[protocolcombobox.selectedIndex].value;
-		const header=protocol+"Settings";
-
 		var deadline={};
-		const value = document.getElementById("deadlinevalue").value;
-		const dtypecombo  = document.getElementById("deadlinetype");
+		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};
-		}
-		
-		// create S(H)AOPSettings. [header] is a weird ECMA script workaround for javascript issue.
-		var settingvalues={"participants":[],"deadline":deadline};
-		if (protocol=="MOPAC") {
-			var combo = document.getElementById("selectedevaluator");
-			var evaluator = combo.options[combo.selectedIndex].value;
-			settingvalues['votingevaluator'] = { [evaluator]: {} };
-		} 
-		if (protocol=="MOPAC2") {
-			var combo = document.getElementById("selectedevaluator2");
-			var evaluator = combo.options[combo.selectedIndex].value;
-			settingvalues['votingevaluator'] = { [evaluator]: {} };
-		} 
-
-		const sessionSettings = { [header]:settingvalues};
-
-		var teamsFull = [];
-		for (const team of teamslist) {
-			if (protocol=="SHAOP") 
-				teamsFull.push({"Team":team});
-			else
-				teamsFull.push({"Team":[team[0]]}); // most protocols have just 1 member per team
-		}
-		var profilesFull = [] ;
-		for (const profileset of profiles) {
-			if (protocol=="SHAOP") // only first member of team is used.
-				profilesFull.push({"ProfileList":profileset});
-			else
-				profilesFull.push({"ProfileList":[profileset[0]]});
-		}
-
-   		var settings={"teams":teamsFull,"profileslists":profilesFull,
-   				"reuseTeams":reuseTeams,"teamsPerSession":npersession,
-   				"sessionsettings":sessionSettings,
-   				"numberTournaments":ntournaments};
-
-		// add the Learn settings if needed
-        var tourprot = document.getElementById("tourprotocol").value;
-        var learntime = 1000*document.getElementById("learntime").value;
-   		if (tourprot=='AllPermutationsLearn') {
-			settings["learnSettings"]={
-				"LearnSettings":{
-					"participants":[], 
-					"deadline": {"deadlinetime": { "durationms": learntime }}
-				}
-			} ;
-   		}
-   		
-   		var mainheader=tourprot+"Settings";
-		return JSON.stringify({[mainheader]:settings});
-	}
-		
-		
-	/**
-	@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};
+		}
+		
+		var reuseParties  = "on"== document.getElementById("reuseparties").value;
+		var sessionSettings = {"SAOPSettings":{"participants":[],"deadline":deadline}};
+		return JSON.stringify({"AllPermutationsSettings":{"parties":parties,"profiles":profiles,"reuseParties":reuseParties,"partiesPerSession":2,"sessionsettings":sessionSettings}});
+	}
+	
 	/**
 	Initialize the page after html is loaded. 
 	*/
 	function init() {
-		document.getElementById("partiesserverurl").value =window.location.hostname+":8080/partiesserver-2.1.6";
-		document.getElementById("profilesserverurl").value =window.location.hostname+":8080/profilesserver-2.1.6";
-
-		selectSessionProtocol();
 		connectDomain();
 		connectParties();
-		updateTournamentProt();
 	}
 
@@ -698,20 +393,4 @@
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 </script>
 
