function swapPlugs(n)
{
	var plug_i = document.getElementById('plug'+n).value.toUpperCase();
	var plug_o = "";

	if (plug_i == "") {
		// If the input letter is blank (ie, self-steckered), output the letter unchanged.
		plug_o = n;
	} else {
		// Otherwise do the swapsies!
		plug_o = ENIGMA.plaintext.indexOf(plug_i);
	}

	return plug_o;
}
/* FUNCTION --------------------------------------------------------
	Swap the steckerbrett pairings.
	Eg, pair 'AD' - if 'A' goes in, 'D' comes out and vice versa
   ----------------------------------------------------------------- */
FUNCTION
Swap the steckerbrett pairings.
FUNCTION Swap the steckerbrett pairings .
function swapPlugs(n)
{
	var plug_i = document.getElementById('plug'+n).value.toUpperCase();
	var plug_o = "";
	if (plug_i == "") {
		plug_o = n;
	} else {
		plug_o = ENIGMA.plaintext.indexOf(plug_i);
	}
	return plug_o;
}
function swapPlugs ( n ) { var plug_i = document . getElementById ( 'plug' + n ) . value . toUpperCase ( ) ; var plug_o = "" ; if ( plug_i == "" ) { plug_o = n ; } else { plug_o = ENIGMA . plaintext . indexOf ( plug_i ) ; } return plug_o ; }
FUNCTION
Swap the steckerbrett pairings.
FUNCTION Swap the steckerbrett pairings .
// If the input letter is blank (ie, self-steckered), output the letter unchanged. // Otherwise do the swapsies!