Id('reverse').disabled = !connected;
		}

		function connect() {
			var target = document.getElementById('target').value;
			ws = new WebSocket(target);
			ws.onopen = function () {
				setConnected(true);
				log('Info: WebSocket connection opened.');
			};
			ws.onmessage = function (event) {
				log('Received: ' + event.data);
			};
			ws.onclose = function () {
				setConnected(false);
				log('Info: WebSocket connection closed.');
			};
		}

		function updateTarget() {
			if (window.location.protocol =