function setCookie(field_name,value) {
        document.cookie=field_name+"="+value;
}

function getCookie(field_name) {
        if (document.cookie.length>0) {
                c_start=document.cookie.indexOf(field_name + "=");
                if (c_start!=-1) {
                        c_start=c_start + field_name.length+1;
                        c_end=document.cookie.indexOf(";",c_start);
                        if (c_end==-1) {
                                c_end=document.cookie.length;
                        }
                        return unescape(document.cookie.substring(c_start,c_end));
                }
        }
        return "";
}

function killCookies() {
        var kill_time = new Date("January 1, 1970");
        var cookies=new Array("acct_type","dct_bar_member","dct_bar_month","dct_bar_year","prohac_vice","oth_ctlogin","oth_ct","casenum","state_num","bar_state","edmo_num","lu_case");
        for (i=0;i < cookies.length;i++) {
                cookie_name=cookies[i];
                if (document.cookie && document.cookie.indexOf(cookie_name) > -1) {
                        kill_string = cookie_name+"=stub;expires="+kill_time.toGMTString();
                        document.cookie = kill_string;
                }
        }
}

// Get cookie values and store them in the hidden form fields
function getCookieData() {
        document.forms[0].oth_ctlogin.value=getCookie('oth_ctlogin');
        document.forms[0].oth_ct.value=getCookie('oth_ct');
        document.forms[0].casenum.value=getCookie('casenum');
        document.forms[0].prohac_vice.value=getCookie('prohac_vice');
        document.forms[0].dct_bar_member.value=getCookie('dct_bar_member');
        document.forms[0].edmo_num.value=getCookie('edmo_num');
        document.forms[0].state_num.value=getCookie('state_num');
        document.forms[0].bar_state.value=getCookie('bar_state');
        document.forms[0].acct_type.value=getCookie('acct_type');
		return 1;
}

