﻿
function addFavorite(approot, target_id, type) {
    if (isAuthMember.toLowerCase() === 'true') {
        jQuery.ajax({
            type: 'POST',
            url: approot + '/ajax/member_add_favorite.aspx',
            data: 'tid=' + target_id + '&type=' + type,
            success: function() {
                jQuery('#myFavorite').css("display", "block");
                jQuery('#addMypage').css("display", "none");
            }
        });
    }
}

function mailmagazineSubscription(anchor, memberid, shopide, approot, type) {
    if (anchor.processing === true)
        return;
    if (isAuthMember.toLowerCase() === 'false') {
        if (type === 1) {
            jQuery('#login_form_mail').slideDown('normal');
            jQuery('#login_form').slideUp(0);
        }
        else {
            jQuery('#login_form_content').slideDown('normal');
        }
        jQuery('#reg_mailmagazine').css("display", "block");
    }
    else {
        anchor.processing = true;
        jQuery.ajax({
            type: 'POST',
            url: approot + '/ajax/mailmagazine_subscription.aspx',
            data: 'mid=' + memberid + '&shopide=' + shopide,
            success: function() {
                jQuery('#mailmagazine').css("display", "none");
                jQuery('#mail_shop').css("display", "block");
                jQuery('#magazine_regist').css("display", "block");
                jQuery('#magazine').css("display", "none");
            }
        });
    }
}

