function reset()
{
	if('TLR' in window)
	{
		// cleanup
		clearElement(TLR.messagesContainer);
		clearElement(TLR.axisTimesContainer);
		TLR.userScriptInput.removeEventListener('input', TLR.inputChangeCallback);
		TLR.style.remove();
	}

	window.TLR = {
		messagesContainer: document.getElementById('messages'),
		axisTimesContainer: document.getElementById('axis-times'),
		userScriptInput: document.getElementById('user-script-input'),
		userScriptOutput: document.getElementById('user-script-output'),
		messageHeight: 20,
		offsetT: 0,
		scaleT: 1,
		maxMessageNumber: -1,
		axisTimes: []
	};

	TLR.inputChangeCallback = function(){reloadUserScript()};
	TLR.userScriptInput.addEventListener('input', TLR.inputChangeCallback);
	var colors = [
		// delay color, send color, text color
		['grey','black','white'],		//default
		['pink', 'red','white'],		//m1
		['lightblue', 'blue','white'],	//m2
		['lightgreen', 'green','white'],//...
	];
	TLR.style = document.createElement('style');
	document.head.appendChild(TLR.style);
	addColorRules('', colors[0][0], colors[0][1], colors[0][2]);
	for(var n=1;n<colors.length;n++)
		addColorRules('.m' + n + ' ', colors[n][0], colors[n][1], colors[n][2]);
}
// reset to default state, resets DOM under #container

reset to default state, resets DOM under #container
reset to default state resets DOM under #container
function reset()
{
	if('TLR' in window)
	{
		clearElement(TLR.messagesContainer);
		clearElement(TLR.axisTimesContainer);
		TLR.userScriptInput.removeEventListener('input', TLR.inputChangeCallback);
		TLR.style.remove();
	}
	window.TLR = {
		messagesContainer: document.getElementById('messages'),
		axisTimesContainer: document.getElementById('axis-times'),
		userScriptInput: document.getElementById('user-script-input'),
		userScriptOutput: document.getElementById('user-script-output'),
		messageHeight: 20,
		offsetT: 0,
		scaleT: 1,
		maxMessageNumber: -1,
		axisTimes: []
	};
	TLR.inputChangeCallback = function(){reloadUserScript()};
	TLR.userScriptInput.addEventListener('input', TLR.inputChangeCallback);
	var colors = [
		['grey','black','white'],		
		['pink', 'red','white'],		
		['lightblue', 'blue','white'],	
		['lightgreen', 'green','white'],
	];
	TLR.style = document.createElement('style');
	document.head.appendChild(TLR.style);
	addColorRules('', colors[0][0], colors[0][1], colors[0][2]);
	for(var n=1;n<colors.length;n++)
		addColorRules('.m' + n + ' ', colors[n][0], colors[n][1], colors[n][2]);
}
function reset ( ) { if ( 'TLR' in window ) { clearElement ( TLR . messagesContainer ) ; clearElement ( TLR . axisTimesContainer ) ; TLR . userScriptInput . removeEventListener ( 'input' , TLR . inputChangeCallback ) ; TLR . style . remove ( ) ; } window . TLR = { messagesContainer : document . getElementById ( 'messages' ) , axisTimesContainer : document . getElementById ( 'axis-times' ) , userScriptInput : document . getElementById ( 'user-script-input' ) , userScriptOutput : document . getElementById ( 'user-script-output' ) , messageHeight : 20 , offsetT : 0 , scaleT : 1 , maxMessageNumber : - 1 , axisTimes : [ ] } ; TLR . inputChangeCallback = function ( ) { reloadUserScript ( ) } ; TLR . userScriptInput . addEventListener ( 'input' , TLR . inputChangeCallback ) ; var colors = [ [ 'grey' , 'black' , 'white' ] , [ 'pink' , 'red' , 'white' ] , [ 'lightblue' , 'blue' , 'white' ] , [ 'lightgreen' , 'green' , 'white' ] , ] ; TLR . style = document . createElement ( 'style' ) ; document . head . appendChild ( TLR . style ) ; addColorRules ( '' , colors [ 0 ] [ 0 ] , colors [ 0 ] [ 1 ] , colors [ 0 ] [ 2 ] ) ; for ( var n = 1 ; n < colors . length ; n ++ ) addColorRules ( '.m' + n + ' ' , colors [ n ] [ 0 ] , colors [ n ] [ 1 ] , colors [ n ] [ 2 ] ) ; }
reset to default state, resets DOM under #container
reset to default state resets DOM under #container
// cleanup
 // delay color, send color, text color
 //default
 //m1
 //m2
 //...
