(function ($){ "use strict"; $(function(){ //jquery 1.4.2 var on = $.isFunction($.on) ? 'on' : 'bind'; var btnElms = { 'register' : $('.applyBtnEntry'), 'change' : $('.applyBtnChange') }; //2017.7.20カード再発行申込用追加修正 var reissue_URL_BASE = "/memberservice/pc/cardreissue/cardreissue_design_select.do?cardreissue=capcom&dsn="; var reissueSwicth = function(e){ var _href = e.attr("href"); var reissue_href = _href.replace(/^(.*)(\d{3})$/,reissue_URL_BASE + "$2"); e.attr("href",reissue_href); }; if (!(typeof CAP !== 'undefined' && typeof CAP.smp.cookie !== 'undefined')) { btnElms.register.show(); btnElms.change.hide(); return ; } //2022.2.10 ウェブチャネル遷移用追加修正 var voi_URL_BASE = "/eposnet/cardapplywc.jsp?dsn=06_0"; var voiSwicth = function(e){ var card_number = e.attr("name"); var voi_href = voi_URL_BASE + card_number; e.attr("href",voi_href); }; /* cookie Set */ $.each(btnElms, function() { var $self = $("a", this).addClass('hide'); $self[on]('click', function(){ // cardSelected(e, $(this)); var selectedNum = CAP.cookie.getSelectedDesignNo($(this)); CAP.cookie.setSelectedDesignNo(selectedNum); }); }); /* cookie Judgement */ if($.cookie("webchannel") && $.cookie("webchannel") === "true" ){ btnElms.register.show().each(function(){ voiSwicth($(this).find("a")); }); btnElms.change.hide(); } else if($.cookie("cardchange") && $.cookie("cardchange") === "true" && $.cookie("login") === "1" ){ // 切替えボタン btnElms.register.hide(); btnElms.change.show(); } else if ( $.cookie("cardreissue") && $.cookie("cardreissue") === "true" && $.cookie("login") === "1" ) { //2017.7.20カード再発行申込用追加修正 // 再発行ボタン btnElms.register.show().each(function(){ reissueSwicth($(this).find("a")); }); btnElms.change.hide(); } else { // 通常ボタン btnElms.register.show(); btnElms.change.hide(); } }); }(jQuery)); /** * @voiContentChange */ (function ($){ $(function(){ /** * @voiContentChange * - read URL parameter */ var voiElms = { 'voiContent' : $('.voiContent'), 'voiNoContent' : $('.no_voiContent') }; if(voiElms.voiContent.length ===0 && voiElms.voiNoContent.length ===0) {return false} if(location.search.indexOf('from=voi0101') !== -1 || $.cookie("webchannel") === "true"){ voiElms.voiNoContent.hide(); }else{ voiElms.voiContent.hide(); } }); }(jQuery));