radio = "radio";
radio2 = "radio2";
njsjqk_djfy = "document.f1.njsjqk_djfy";


function DoSave() {
    var lcon = window.confirm("要使用客户端保存的功能,确定您的IE是5.5以上版本!\n\n保存到客户端需要1分钟左右的时间,请耐心等待!");
    if (lcon) {
        save();
        radioSave();
        hiddensave();
    }
}


function DoLoad() {
    var con = window.confirm("要使用客户端装载的功能,确定您的IE是5.5以上版本!\n\n保存到客户端需要1分钟左右的时间,请耐心等待!");
    if (con) {
        load();
        radioLoad();
        hiddenload();
    }
}

function radioSave() {
    var ips = document.all.tags("INPUT");
    for (var i = 0; i < ips.length; i++) {
        if (ips[i].type == "radio" && ips[i].checked) {
            wsnj.setAttribute(ips[i].name, ips[i].value);
            wsnj.save("content");
        }
    }
}

function save() {
    try {
        for (var i = 0; i < document.f1.elements.length; i++) {
            var objname = document.f1.elements[i].name;
            if (document.f1.elements[i].type != "radio") {
                wsnj.setAttribute(objname, document.f1.elements[i].value);
                wsnj.save("content");
            }
        }
    } catch(exception) {
        return true;
    }
}

function radioLoad() {
    var ips = document.all.tags("INPUT");
    for (var i = 0; i < ips.length; i++)
    {
        if (ips[i].type == "radio" && ips[i].value == "0")
        {
            wsnj.load("content");
            if (wsnj.getAttribute(ips[i].name) == "0") {
                ips[i].checked = true;
                checkValueXX(ips[i]);
            }
        }
    }
}

function load() {
    try {
        for (var j = 0; j < document.f1.elements.length; j++) {
            var objname = document.f1.elements[j].name;
            if (document.f1.elements[j].type != "radio") {
                wsnj.load("content");
                document.f1.elements[j].value = wsnj.getAttribute(objname);
            }
        }
    } catch(exception) {
        return true;
    }
}

function hiddensave() {
    wsnj.setAttribute(njsjqk_djfy, document.f1.njsjqk_djfy.value);
    wsnj.save("content");
    alert("保存成功!");
}

function hiddenload() {
    wsnj.load("content");
    document.f1.njsjqk_djfy.value = wsnj.getAttribute(njsjqk_djfy);
    if (document.f1.njsjqk_djfy.value == "1") {
        if (document.f1.radio != null) document.f1.radio.checked = true;
    }
    if (document.f1.njsjqk_djfy.value == "0") {
        if (document.f1.radio2 != null) document.f1.radio2.checked = true;
    }
}

window.attachEvent("OnLoad", DoLoad);