var changeCaseData = null;

function changeCaseSetup() {
  	var f = document.forms['parameterForm'];
  	clearForm(f);
   	
  	var div = document.createElement('DIV');
  	f.appendChild(div);
  	
	var tb = createTable(div, 2);   	
	   	
  	tb.rows[0].appendChild(buildCell(1, buildLabel('To:')));
  	tb.rows[0].appendChild(buildCell(1, buildRadio('changeCaseDirection', '1', true),
  													buildLabel('Upper   '),
  													buildRadio('changeCaseDirection', '0', false),
  													buildLabel('Lower')));
  	tb.rows[1].appendChild(buildCell(1, buildRunButton(changeCaseRun)));  	
  	tb.rows[1].appendChild(buildCell(-1, buildButton('Help', changeCaseHelp),
  	                                     buildButton('Example 1', changeCaseExample1)));
	if (changeCaseData) {  		                                     
		changeCaseSet(changeCaseData);
	}
	
	return changeCaseTearDown;
}
   
function changeCaseTearDown() {
	changeCaseData = changeCaseGet();
}

function changeCaseGet() {
  	var o = new Object();
  	o.direction = getRadioChoice(document.forms['parameterForm'].changeCaseDirection);
  	return o;
}

function changeCaseSet(o) {
  	setRadioChoice(document.forms['parameterForm'].changeCaseDirection, o.direction);
}
   
function changeCaseRun() {
  	makeEditorRequest('changeCase', changeCaseGet());
}
   
function changeCaseHelp() {
	window.frames['docFrame'].document.location = "html/changeCase.html";
}
   
function changeCaseExample1() {
	document.forms['parameterForm'].changeCaseDirection.value = '1';
	window.frames['docFrame'].document.location = "html/changeCaseExample1.html";
	document.forms['inputForm'].inputText.value = 'This a warning\nDo not pass Go!';
	document.forms['outputForm'].outputText.value = '';	
}   
