zenNum = new Array("‚P", "‚Q", "‚R", "‚S", "‚T", "‚U", "‚V", "‚W", "‚X", "‚O");
hanNum = new Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "0");
pareNum = new Array("‡@", "‡A", "‡B", "‡C", "‡D", "‡E", "‡F", "‡G", "‡H");
greeNum1 = new Array("‡T", "‡U", "‡V", "‡W", "‡X", "‡Y", "‡Z", "‡[", "‡\");
greeNum2 = new Array("ú@", "úA", "úB", "úC", "úD", "úE", "úF", "úG", "úH");

function numZenToHan(str) {
    while(str.match(/[‚O-‚X]/)) {
        //“ü—Íƒf[ƒ^‚É‘SŠp”Žš‚ª‚ ‚éê‡
        for(i = 0 ; i < zenNum.length ; i++) {
            //“ü—Íƒf[ƒ^‚ð‘SŠp”Žš‚©‚ç”¼Šp”Žš‚É’uŠ·‚·‚é
            str = str.replace(zenNum[i], hanNum[i]);
        }
    }
    return str;
}

function replaceNum(str) {
    while(str.match(/[‡@-‡H]/)) {
        //“ü—Íƒf[ƒ^‚ÉŠ‡ŒÊ•t”Žš‚ª‚ ‚éê‡
        for(i = 0 ; i < pareNum.length ; i++){
            //“ü—Íƒf[ƒ^‚ðŠ‡ŒÊ•t”Žš‚©‚ç‘SŠp”Žš‚É’uŠ·‚·‚é
            str = str.replace(pareNum[i], zenNum[i]);
        }
    }
    while(str.match(/[‡T-‡\]/)) {
        //“ü—Íƒf[ƒ^‚ÉƒMƒŠƒVƒƒ”Žš‚ª‚ ‚éê‡
        for(i = 0 ; i < greeNum1.length ; i++){
            //“ü—Íƒf[ƒ^‚ðƒMƒŠƒVƒƒ”Žš‚©‚ç‘SŠp”Žš‚É’uŠ·‚·‚é
            str = str.replace(greeNum1[i], zenNum[i]);
        }
    }
    while(str.match(/[ú@-úH]/)) {
        //“ü—Íƒf[ƒ^‚ÉƒMƒŠƒVƒƒ”Žš‚ª‚ ‚éê‡
        for(i = 0 ; i < greeNum2.length ; i++){
            //“ü—Íƒf[ƒ^‚ðƒMƒŠƒVƒƒ”Žš‚©‚ç‘SŠp”Žš‚É’uŠ·‚·‚é
            str = str.replace(greeNum2[i], zenNum[i]);
        }
    }
    return str;
}

function convertNum(element) {
    var value = element.value;
    value = replaceNum(value);
    element.value = value;
}

// “ü—Í€–Ú‚ÌƒNƒŠƒA
function formClear(form) {
    for (i = 0 ; i < form.length ; i++) {
        if (form.elements[i].type == "text"
            || form.elements[i].type == "textarea") {
            form.elements[i].value = "";
        }
    }
}

// ƒIƒvƒVƒ‡ƒ“€–Ú‚ÌƒNƒŠƒA
function clearOpion(select) {
    if (select && select.type == "select-one") {
        var len = select.length;
        for (i = len - 1 ; i >= 0 ; i--) {
            select.options[i] = null;
        }
        len = null;
    }
}

// ƒIƒvƒVƒ‡ƒ“€–Ú‚Ì’Ç‰Á
function addOption(select, key, value, selected) {
    if (select && select.type == "select-one") {
        var len = select.length;
        select.options[len] = new Option(value, key);
        if (selected) {
            select.options[len].selected = selected;
        }
        len = null;
    }
}

function toolsReadDone() {}

