//ログインチェック
function isLogin(){
    
    if ($("isLogin") || $("noLogin")) {
        email = getCookie('sessEmail');
        password = getCookie('sessPassword');
        point = getCookie('sessPoint');
        kind = decodeURIComponent(getNoUnescapeCookie('sessMemberKind'));
        userName = decodeURIComponent(getNoUnescapeCookie('sessUserName'));

        if(email.length && password.length){
            $("isLogin").style.display='block';
            $("memName").innerHTML = userName;
            $("memPoint").innerHTML = point;
            if(kind.length){
                $("memKind").innerHTML = kind;
            }

            if (point >= 2000)
            {
                $("dispGold").innerHTML = '<img class=\"mid\" src=\"/img/2009/mem_g.gif\" alt=\"ゴールド会員\" height=\"19\" width=\"47\" />';
            }

        }else{
            $("noLogin").style.display='block';
        }
    }
}

//代引規約同意チェック
function disableCod(){

    if($("cod_agree") && !$("adult_flg").value)
    {
        if($("cod_agree").checked){
            $("colect_settle").disabled = false;
        }else{
            $("colect_settle").disabled = true;
        }
    }
}



//cookieデータ取得
function getCookie(name){
    name += "=";
    theCookie = document.cookie + ";";
    start = theCookie.indexOf(name);

    if(start != -1){
        end = theCookie.indexOf(";",start);
        return unescape(theCookie.substring(start + name.length,end));
    }
    return false;
}

//cookieデータ取得  ##unescapeしない
function getNoUnescapeCookie(name){
    name += "=";
    theCookie = document.cookie + ";";
    start = theCookie.indexOf(name);

    if(start != -1){
        end = theCookie.indexOf(";",start);
        return theCookie.substring(start + name.length,end);
    }
    return false;
}

//cookieデータ削除
function deleteCookie(name){
    setDay = new Date();
    setDay.setTime(setDay.getYear() - 1);
    expDay = setDay.toGMTString();
    document.cookie = name + "=;expires=" + expDay + ";domain=t.agn.centsys.jp;path=/";
    return true;
}

//商品詳細表示切替
function changeDetailView($strDispType){

    $("backCover").style.display='none';
    $("sampleMovie").style.display='none';
    $("captureImage").style.display='none';
    $("officialReview").style.display='none';

    if($strDispType == 'menuSampleMovie'){

        $("sampleMovie").style.display='block';

    }else if($strDispType == 'menuCaptureImage'){

        $("captureImage").style.display='block';

    }else if($strDispType == 'menuOfficialReview'){

        $("officialReview").style.display='block';

    }else{

        $("backCover").style.display='block';
    }
}

function winPRE(workurl){
    win=window.open(workurl,"present","width=650,height=650,scrollbars=yes");
    win.focus();
}
