function savePreset()
{
	var mac = document.getElementById('enigma_type').value;

	// If using M4 Enigma
	if (mac == "m4") {
		var ukw = document.getElementById('use_reflector_thin').value + ";";
	} else {
		var ukw = document.getElementById('use_reflector').value + ";";
	}

	mac = 	mac + ";"

	var rot = document.getElementById('greek_no').value
				 + document.getElementById('leftw_no').value 
				 + document.getElementById('middlew_no').value
				 + document.getElementById('rightw_no').value + ";";

	var rin = document.getElementById('greek_ring').value
				+ document.getElementById('leftw_ring').value
				+ document.getElementById('middlew_ring').value
				+ document.getElementById('rightw_ring').value + ";";

	var gro = document.getElementById('greek_set').value
				 + document.getElementById('leftw_set').value
				 + document.getElementById('middlew_set').value
				 + document.getElementById('rightw_set').value;

	var stk = "";
	var i = 1;

	while (i <= 26) {
		if (document.getElementById('plug'+i).value != "") {
			var string_rev = document.getElementById('plug'+i).value.toUpperCase() + ENIGMA.plaintext.charAt(i);

			if (stk.indexOf(string_rev) < 0) {
				if (stk != "") {
					stk = stk + "-";
				} else {
					stk = ";" + stk;
				}
				stk = stk + ENIGMA.plaintext.charAt(i) + document.getElementById('plug'+i).value.toUpperCase();
			}
		}
		i++;
	}

	var months = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");

	var now = new Date();
	var title = now.getDate() + " " + months[now.getMonth()] + ", " + now.getFullYear() + " "
	+ now.getHours() + ":"
	+ ((now.getMinutes() < 10) ? "0" : "") + now.getMinutes() + ":"
	+ ((now.getSeconds() < 10) ? "0" : "") + now.getSeconds(); 
	
	var url = document.URL.replace(/\?.*/gi, "") + "?" + mac + ukw + rot + rin + gro + stk;;

	var savearea = document.getElementById('savearea');

	// Quick'n'dirty use of inner HTML, so sue me!
	savearea.innerHTML = "<p><a href=\"" + url  + "\">Enigma Settings: " + title + "</a><br />\n"
		+ "Right-click on the above link and select \"Add to Bookmarks\" (or similar), or "
		+ "drag it to your bookmarks folder.</p>";

	savearea.setAttribute("class", "showsave");

}
/* FUNCTION --------------------------------------------------------
	Save a user preset as a bookmark
   ----------------------------------------------------------------- */
FUNCTION
Save a user preset as a bookmark
FUNCTION Save a user preset as a bookmark
function savePreset()
{
	var mac = document.getElementById('enigma_type').value;
	if (mac == "m4") {
		var ukw = document.getElementById('use_reflector_thin').value + ";";
	} else {
		var ukw = document.getElementById('use_reflector').value + ";";
	}
	mac = 	mac + ";"
	var rot = document.getElementById('greek_no').value
				 + document.getElementById('leftw_no').value 
				 + document.getElementById('middlew_no').value
				 + document.getElementById('rightw_no').value + ";";
	var rin = document.getElementById('greek_ring').value
				+ document.getElementById('leftw_ring').value
				+ document.getElementById('middlew_ring').value
				+ document.getElementById('rightw_ring').value + ";";
	var gro = document.getElementById('greek_set').value
				 + document.getElementById('leftw_set').value
				 + document.getElementById('middlew_set').value
				 + document.getElementById('rightw_set').value;
	var stk = "";
	var i = 1;
	while (i <= 26) {
		if (document.getElementById('plug'+i).value != "") {
			var string_rev = document.getElementById('plug'+i).value.toUpperCase() + ENIGMA.plaintext.charAt(i);
			if (stk.indexOf(string_rev) < 0) {
				if (stk != "") {
					stk = stk + "-";
				} else {
					stk = ";" + stk;
				}
				stk = stk + ENIGMA.plaintext.charAt(i) + document.getElementById('plug'+i).value.toUpperCase();
			}
		}
		i++;
	}
	var months = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
	var now = new Date();
	var title = now.getDate() + " " + months[now.getMonth()] + ", " + now.getFullYear() + " "
	+ now.getHours() + ":"
	+ ((now.getMinutes() < 10) ? "0" : "") + now.getMinutes() + ":"
	+ ((now.getSeconds() < 10) ? "0" : "") + now.getSeconds(); 
	var url = document.URL.replace(/\?.*/gi, "") + "?" + mac + ukw + rot + rin + gro + stk;;
	var savearea = document.getElementById('savearea');
	savearea.innerHTML = "<p><a href=\"" + url  + "\">Enigma Settings: " + title + "</a><br />\n"
		+ "Right-click on the above link and select \"Add to Bookmarks\" (or similar), or "
		+ "drag it to your bookmarks folder.</p>";
	savearea.setAttribute("class", "showsave");
}
function savePreset ( ) { var mac = document . getElementById ( 'enigma_type' ) . value ; if ( mac == "m4" ) { var ukw = document . getElementById ( 'use_reflector_thin' ) . value + ";" ; } else { var ukw = document . getElementById ( 'use_reflector' ) . value + ";" ; } mac = mac + ";" var rot = document . getElementById ( 'greek_no' ) . value + document . getElementById ( 'leftw_no' ) . value + document . getElementById ( 'middlew_no' ) . value + document . getElementById ( 'rightw_no' ) . value + ";" ; var rin = document . getElementById ( 'greek_ring' ) . value + document . getElementById ( 'leftw_ring' ) . value + document . getElementById ( 'middlew_ring' ) . value + document . getElementById ( 'rightw_ring' ) . value + ";" ; var gro = document . getElementById ( 'greek_set' ) . value + document . getElementById ( 'leftw_set' ) . value + document . getElementById ( 'middlew_set' ) . value + document . getElementById ( 'rightw_set' ) . value ; var stk = "" ; var i = 1 ; while ( i <= 26 ) { if ( document . getElementById ( 'plug' + i ) . value != "" ) { var string_rev = document . getElementById ( 'plug' + i ) . value . toUpperCase ( ) + ENIGMA . plaintext . charAt ( i ) ; if ( stk . indexOf ( string_rev ) < 0 ) { if ( stk != "" ) { stk = stk + "-" ; } else { stk = ";" + stk ; } stk = stk + ENIGMA . plaintext . charAt ( i ) + document . getElementById ( 'plug' + i ) . value . toUpperCase ( ) ; } } i ++ ; } var months = new Array ( "Jan" , "Feb" , "Mar" , "Apr" , "May" , "Jun" , "Jul" , "Aug" , "Sep" , "Oct" , "Nov" , "Dec" ) ; var now = new Date ( ) ; var title = now . getDate ( ) + " " + months [ now . getMonth ( ) ] + ", " + now . getFullYear ( ) + " " + now . getHours ( ) + ":" + ( ( now . getMinutes ( ) < 10 ) ? "0" : "" ) + now . getMinutes ( ) + ":" + ( ( now . getSeconds ( ) < 10 ) ? "0" : "" ) + now . getSeconds ( ) ; var url = document . URL . replace ( / \?.* / gi , "" ) + "?" + mac + ukw + rot + rin + gro + stk ; ; var savearea = document . getElementById ( 'savearea' ) ; savearea . innerHTML = "<p><a href=\"" + url + "\">Enigma Settings: " + title + "</a><br />\n" + "Right-click on the above link and select \"Add to Bookmarks\" (or similar), or " + "drag it to your bookmarks folder.</p>" ; savearea . setAttribute ( "class" , "showsave" ) ; }
FUNCTION
Save a user preset as a bookmark
FUNCTION Save a user preset as a bookmark
// If using M4 Enigma // Quick'n'dirty use of inner HTML, so sue me!