// JavaScript Document

function dynAnimation() {}

function clickSwapImg() {}

function ch_display(id,id2){
    target = document.all(id);
    if(target.style.display == 'none'){
        target.style.display = 'inline';
    } else {
        target.style.display = 'none';
    }
    target = document.all(id2);
    if(target.style.display == 'inline'){
        target.style.display = 'none';
    } else {
        target.style.display = 'inline';
    }
}

function chg2(bool){
  obj = eval("document.fm.ダンボールの数");
  obj.disabled = bool;
  //テキストボックスの色を条件指定
  obj.style.backgroundColor = (bool)?"#E6E6FA":"white";
  //入力不可のラジオボタンにチェックの場合、テキストボックスの入力データを消す
  if(bool){obj.value = "";}
}

function delConfirm(object) {
if (confirm("本当に削除しますか？") == true) {
    return true;
}
    return false;
}
function delConfirm2(object) {
if (confirm("削除してよろしいでしょうか？") == true) {
    return true;
}
    return false;
}

//表示を切り替える
function ChDsp(flg,ch,ch2,cookie_name){

    var obj=document.all && document.all(ch) || document.getElementById && document.getElementById(ch);
    var obj2=document.all && document.all(ch2) || document.getElementById && document.getElementById(ch2);

    if(obj && obj.style &&obj2 && obj2.style){
        if(flg==0){
            obj.style.display = "block";        //表示する
            obj2.style.display = "none";
        } else if(flg==1){
            obj.style.display = "none";            //非表示にする
            obj2.style.display = "block";
        }
    }
    CookieWrite(cookie_name,flg,30)
}

//クッキーを書き込む
function CookieWrite(kword, kdata, kday)
{
  if(!navigator.cookieEnabled){    // クッキーが利用可能かどうか
    alert("クッキーへの書き込みができません");
    return;
  }
  sday = new Date();
  sday.setTime(sday.getTime() + (kday * 1000 * 60 * 60 * 24));
  s2day = sday.toGMTString();
  document.cookie = kword + "=" + escape(kdata) + ";expires=" + s2day;
}

//クッキーを読み込む
function CookieRead(kword)
{
  if(typeof(kword) == "undefined")  // キーワードなし
    return "";        // 何もしないで戻る
  kword = kword + "=";
  kdata = "";
  scookie = document.cookie + ";";    // クッキー情報を読み込む
  start = scookie.indexOf(kword);    // キーワードを検索
  if (start != -1){    // キーワードと一致するものあり
    end = scookie.indexOf(";", start);    // 情報の末尾位置を検索
    kdata = unescape(scookie.substring(start + kword.length, end));  // データ取り出し
  }
  return kdata;
}

//クッキーを削除する
function CookieDelete(kword)
{
  document.cookie = kword + "=;expires=Thu,01-Jan-70 00:00:01 GMT";
}