
function stopSocket() 
{
	ws.close();
}

// Create the websocket
function startSocket() 
{
	if ("WebSocket" in window)
	{
		ws = new WebSocket("%%WEBSOCKET_URL%%");
		
		// Called when the websocket is opened
		ws.onopen = function()
		{
			// Web Socket is connected
			$('#status').css({'background-color': 'green'}).html('Websocket opened');	
			
			// Clear the results window
			$('#results').html('');
		
			// Disable Start Button
			$('#btnStart').attr("disabled","disabled");
			
			// Enable Stop Butt