
//    alert("call to cookie.js \r\n cook_flg is"+get_cook('cook_flg'));

window.onload = function()
{
    if(document.frm.maint_num != undefined)
    {
	  document.frm.maint_num.value = get_cook('cookie1');
    }
    if(document.frm.cereal_num != undefined)
    {
	  document.frm.cereal_num.value = get_cook('cookie2');
    }

    if(document.frm.cookiechk != undefined)
    {
		var chk = get_cook('cookie3');
		if(chk == 1)
		{
			document.frm.cookiechk.checked = true;
		}
		else
		{
			document.frm.cookiechk.checked = false;
		}
    }
}
/*
function sndLogin()
{
}
*/
function get_cook(coknam) {
  coktxt = document.cookie+";";
  stano = coktxt.indexOf(coknam);
  if (stano != -1){
    endno = coktxt.indexOf(";",stano);
    txt0 = unescape(coktxt.substring(stano+coknam.length+1,endno));
  }else{
    txt0 = "";
  }
  return txt0;
}

function sav_cook(coknam,inname) {
  txt0 = document.frm[inname].value;
  day0 = new Date();
  day0.setTime(day0.getTime()+60*60*24*1000);
  endday = day0.toGMTString();
//alert(endday);
  document.cookie = coknam+"="+escape(txt0)+"; expires="+endday+"; path=/;";
}

function reset_cook(coknam) {
  txt0 = "";
  day0 = new Date();
  day0.setTime(day0.getYear() - 1);
  endday = day0.toGMTString();
  document.cookie = coknam+"="+escape(txt0)+"; expires="+endday+"; path=/;";
}
/*
function login_cook()
{
  var txt = "1";
  day0 = new Date();
  day0.setTime(day0.getTime()+60*60*24*1000);
  endday = day0.toGMTString();
  document.cookie = "cook_flg="+escape(txt)+"; expires="+endday+"; path=/;";
}
function logout_cook()
{
  var txt = "2";
  day0 = new Date();
  day0.setTime(day0.getTime()+60*60*24*1000);
  endday = day0.toGMTString();
  document.cookie = "cook_flg="+escape(txt)+"; expires="+endday+"; path=/;";
}
*/

