function decodeKey(val) {
	var flag = false;
	var result = null;
	if (val.length >= 2) {
		if (val.substr(0, 1) == "1") {
			flag = true;
		}
		result = val.substr(1, 1);
	} else {
		result = val.substr(0, 1);
	}
	if (isNaN(result)) {
		result = result.charCodeAt(result.substr(0, 1)) - MIN_VALUE;
	} else {
		result -= MIN_VALUE;
		result += NUM_ADD_VALUE;
	}
	if (flag) {
		result += (STR_MAX_VALUE - MIN_VALUE);
	}
	return result;
}
function decode(str) {
	var result = "";
	for (var i=(str.length-1) ; i>=0 ; i--) {
		shiftTable.indexOf(str.substr(i, 1));
		result += orgTable.substr((shiftTable.indexOf(str.substr(i, 1))), 1);
	}
	return unescape(result);
}
/*******************************************************************************
 * 暗号化された暗号化キーを変数に格納し、復号の前処理を行なう
 *******************************************************************************/
function setEncodedKey(val) {
	encodedKey = val;
	key = decodeKey(encodedKey);
	makeOrgTableMain();
	makeShiftTable();
}
