$(function() {
	var ec = new evercookie();
	$('#computerid').attr({value: 2});
	$('#loginsubmit').attr({disabled: 'disabled'}).css("display", "none");
	ec.get("hciid", function(best, candidates) {
		$('#computerid').attr({value: 3});
//		var olduser = $('#username').val();
//		alert("user: " + olduser + " best: " + best);
		if (best === undefined || best.length != 36) {
			var computerid = uuid();
			ec.set("hciid", computerid);
			$('#computerid').attr({value: computerid});
			var candstring = "";
			for (var item in candidates) {
				candstring = candstring + item + " - " + candidates[item] + ", ";
			}
			$('#candidates').attr({value: candstring});
		} else {
			$('#computerid').attr({value: best});
		}
		$('#loginsubmit').css("display", "inline-block").removeAttr("disabled");
//		$('#username').val(olduser);
	}, false);
});

