
/*Member Rate*/
/*
14519 (Promotion ID)
14595 (Promotion ID - Top up)

RR-3840-17554-14519-0 (14519)
RR-3840-17554-14519|14595-0 (14595)
*/


$('#etm_rate_table').bind('append', function() {
    $('.rate-plan-item:regex(data-termofpaymentid, ^1|2|3$):regex(data-promotionid, ^14987|14989|15056|15062|15063|15090|15148|15091|15146|15090|15574$)').each(function(index) {
        $(this).addClass('item-member-rate');
    });
    $('.rate-plan-item:regex(data-termofpaymentid, ^1|2|3$):regex(data-promotionid, ^14987|14989|15056|15062|15063|15090|15148|15091|15146|15090|15574$) .price .tooltip_show_content.modal_show_content').each(function(index) {
        $(this).html($(this).html() + '<div class="member-rate-txt">ราคาสมาชิก<div>');
    });
    $('.rate-plan-item:regex(data-termofpaymentid, ^1|2|3$):regex(data-promotionid, ^14987|14989|15056|15062|15063|15090|15148|15091|15146|15090|15574$) .ribbon-pro-save').each(function(index) {
        $(this).find('.txt.etmtranslate').html('Member');
    });
});

$('#etm_rata_table_addon').bind('append', function() {
    $('.addon-card-item:regex(id, ^rate_plan_()-1$)').each(function(index) {
        $(this).addClass('item-member-rate');
        $(this).find('.addon-photo .addon_img').after(`<div class="ribbon-pro-save">       
        <span class="txt etmtranslate">Member</span>
        </div>`);
    });
});

if ($('body#reservation_engine_page_review').length > 0) {
    $(document).ajaxComplete(function() {
        var ls_Data = localStorage.getItem(global_ReadyEngine._KeyStore);
        var obj_LS = JSON.parse(ls_Data);
        var rm = false;
        $.each(obj_LS.Basket, function(i, item) {
            if (item.rate_id.search(/^(RR|SR|PA)-.*-.*-(14987|14989|15056|15062|15063|15090|15148|15091|15146|15090|.*\|15056|.*\|15574)-.*/) >= 0) { 
rm = true;
return false;
            }
            else if (item.rate_id.search(/^()-1/) >= 0) {
rm = true;
return false;
            }
        });

        CheckSignin(rm);
    });
}

async function CheckSignin(rm) {
    if (rm) {
        //$('#etm-bookingFrom').attr('action', '#');
        $('#grand-total-submit-btn').off('click');
        $('#grand-total-submit-btn').on('click', async function() {
            console.log('Member Rate - Click Confirm this reservaton');
            let res_authstate = await pstm.getAuthState();

            if (rm && !res_authstate) {
var word = '';
if (global_ReadyEngine._SearchParameter.language == 'th') {
    word = `<div class="col-12 col-no-padding">
        <div class="modal_addon">
            <svg xmlns="http://www.w3.org/2000/svg" class="icon-pointspot" version="1.0" width="538.000000pt" height="477.000000pt" viewBox="0 0 538.000000 477.000000" preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,477.000000) scale(0.100000,-0.100000)" fill="#566375" stroke="none">
    <path d="M2475 4655 c-147 -27 -314 -92 -419 -165 l-43 -29 -87 99 c-81 94 -89 100 -124 100 -75 0 -73 6 -178 -535 -51 -268 -94 -494 -94 -502 0 -8 14 -28 30 -45 l31 -31 262 7 c825 20 758 16 784 42 15 15 23 35 23 58 0 30 -13 51 -81 132 -92 110 -93 105 21 145 176 64 404 -3 514 -150 67 -89 81 -101 121 -101 46 0 85 36 85 80 0 68 -141 226 -258 288 -109 58 -185 77 -312 76 -160 0 -255 -30 -393 -127 -91 -63 -93 -106 -12 -202 l45 -52 -102 -7 c-57 -3 -206 -6 -333 -7 -190 -1 -230 1 -228 12 3 27 109 578 119 618 5 24 6 23 37 -15 88 -108 103 -109 236 -20 170 114 318 164 516 173 97 4 139 1 217 -15 334 -69 611 -310 712 -619 10 -29 27 -60 39 -68 56 -39 137 1 137 67 0 45 -57 181 -116 279 -58 96 -187 237 -282 307 -137 102 -314 178 -480 207 -102 18 -290 18 -387 0z"/>
    <path d="M3595 3694 c-347 -58 -664 -253 -858 -526 -23 -32 -44 -58 -47 -58 -3 0 -28 30 -55 68 -59 80 -178 202 -256 260 -77 58 -135 58 -165 0 -25 -49 -11 -82 64 -142 95 -76 195 -185 259 -284 l56 -84 -36 -107 c-50 -148 -70 -270 -70 -431 0 -161 18 -275 69 -428 l37 -110 -56 -85 c-165 -253 -426 -434 -719 -498 -486 -106 -990 116 -1241 548 -307 530 -142 1203 378 1542 113 73 340 161 418 161 10 0 32 13 48 29 38 38 39 82 3 118 -24 24 -30 25 -87 20 -86 -9 -244 -60 -357 -117 -301 -151 -540 -421 -653 -736 -53 -147 -72 -265 -71 -444 0 -184 20 -302 75 -454 115 -311 354 -579 649 -726 361 -181 800 -184 1165 -10 202 97 397 263 516 441 l27 39 54 -73 c81 -106 140 -169 224 -237 87 -70 127 -78 169 -35 39 38 34 90 -12 129 -220 185 -333 343 -407 566 -47 141 -60 241 -53 413 10 287 110 523 309 732 175 184 364 289 623 346 80 18 331 18 420 0 665 -132 1074 -782 900 -1431 -115 -427 -489 -765 -922 -832 -78 -12 -108 -31 -119 -73 -9 -34 12 -80 42 -94 36 -16 66 -14 184 13 247 56 456 173 640 356 207 206 336 467 375 760 19 134 19 202 0 342 -59 448 -337 829 -746 1022 -232 110 -528 152 -774 110z"/>
    <path d="M3735 3235 c-21 -21 -25 -33 -25 -89 l0 -65 -42 -11 c-140 -36 -260 -128 -311 -238 -31 -67 -31 -217 0 -284 47 -102 166 -189 298 -219 l55 -12 0 -219 c0 -147 -3 -218 -11 -218 -28 0 -121 55 -146 86 -61 77 -81 94 -110 94 -59 0 -98 -55 -81 -117 12 -47 107 -145 175 -180 32 -17 84 -39 116 -48 l57 -16 0 -65 c0 -56 4 -68 25 -89 16 -17 35 -25 60 -25 25 0 44 8 60 25 21 21 25 33 25 89 l0 65 57 16 c131 38 241 123 290 224 25 50 28 67 28 156 0 89 -3 106 -28 156 -49 101 -135 163 -277 199 l-65 16 -3 217 c-3 240 -6 230 63 198 51 -23 102 -66 120 -101 36 -70 142 -60 161 16 10 39 -3 68 -52 123 -71 79 -148 125 -251 151 l-43 11 0 65 c0 56 -4 68 -25 89 -33 34 -87 34 -120 0z m-25 -535 c0 -232 6 -223 -102 -167 -51 26 -67 40 -85 77 -53 103 -3 214 122 271 22 10 46 19 53 19 9 0 12 -47 12 -200z m280 -448 c152 -74 127 -275 -45 -353 -22 -10 -46 -19 -52 -19 -10 0 -13 48 -13 205 l0 205 28 -6 c15 -3 52 -18 82 -32z"/>
    <path d="M1517 3166 c-21 -8 -48 -22 -59 -33 -11 -10 -59 -94 -105 -188 -47 -93 -86 -171 -87 -172 -1 -2 -81 -14 -177 -28 -96 -14 -188 -30 -205 -36 -32 -10 -74 -48 -93 -86 -15 -30 -14 -109 3 -141 8 -15 75 -87 149 -159 l135 -133 -29 -167 c-16 -93 -29 -186 -29 -208 0 -80 59 -146 143 -160 39 -7 53 -2 225 86 l182 94 183 -94 c171 -88 185 -93 224 -86 84 14 143 80 143 160 0 22 -14 116 -30 208 l-29 168 136 132 c75 73 142 146 149 164 17 39 18 106 3 136 -19 38 -61 76 -93 86 -17 6 -109 22 -205 36 -96 14 -176 26 -177 28 -1 1 -40 79 -87 172 -46 94 -94 178 -105 188 -22 20 -86 46 -112 46 -8 0 -32 -6 -53 -13z m141 -346 c104 -213 98 -208 329 -241 89 -12 166 -25 172 -29 6 -3 -48 -65 -123 -141 -115 -114 -136 -140 -142 -174 -5 -28 2 -95 23 -217 16 -98 27 -178 23 -178 -4 0 -76 37 -161 82 -210 111 -210 111 -418 0 -84 -45 -156 -82 -160 -82 -4 0 6 80 22 179 20 120 27 191 23 217 -6 33 -29 60 -142 173 -82 81 -131 137 -124 141 6 4 84 17 173 29 232 33 226 28 330 241 45 93 84 169 87 169 3 0 42 -76 88 -169z"/>
    <path d="M3115 1219 c-159 -3 -318 -7 -353 -8 -52 -1 -67 -5 -87 -26 -45 -45 -35 -78 55 -187 44 -53 80 -98 80 -101 0 -12 -123 -57 -182 -67 -91 -14 -183 1 -273 45 -66 31 -90 53 -207 177 -48 50 -121 30 -142 -39 -16 -51 79 -171 197 -250 181 -122 418 -143 617 -56 81 35 187 111 200 143 16 39 6 65 -52 132 l-48 56 72 6 c40 3 191 7 336 9 241 4 263 3 259 -12 -2 -9 -30 -154 -62 -321 -33 -168 -61 -307 -63 -310 -2 -2 -27 21 -56 53 -45 48 -58 57 -87 57 -19 0 -46 -8 -60 -18 -138 -92 -173 -114 -225 -137 -500 -223 -1095 25 -1280 532 -30 83 -61 110 -114 98 -59 -13 -79 -63 -55 -138 101 -312 375 -580 707 -691 313 -105 703 -54 966 126 24 17 45 28 46 26 31 -43 154 -181 167 -188 30 -16 66 -11 94 13 21 18 30 40 46 122 130 665 169 883 164 902 -3 12 -15 32 -27 43 -25 23 -51 23 -633 9z"/>
</g>
            </svg>
            <h3 style="font-size: 21px !important;" class="caption-pointspot">ขออภัยค่ะ! ราคาพิเศษดังกล่าวสำหรับสมาชิกเท่านั้น</h3>
            <div style="font-size: 13px;">
<a href="javascript: void(0);" onclick="click_signin();" class="signin-pointspot">เข้าสู่ระบบ</a> | ยังไม่ได้เป็นสมาชิก <a href="javascript: void(0);" onclick="click_signin();" class="signin-pointspot">สมัครสมาชิก<a>
            </div>
            <div class="pointspot_poweredby">Powered by <img src="//instant-bookings.com/ibs/bookings/images/icon-pointspot.png" class="icon_pointspot"> PointSpot</div>
        </div>
    </div>`;
}
else {
    word = `<div class="col-12 col-no-padding">
        <div class="modal_addon">
            <svg xmlns="http://www.w3.org/2000/svg" class="icon-pointspot" version="1.0" width="538.000000pt" height="477.000000pt" viewBox="0 0 538.000000 477.000000" preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,477.000000) scale(0.100000,-0.100000)" fill="#566375" stroke="none">
    <path d="M2475 4655 c-147 -27 -314 -92 -419 -165 l-43 -29 -87 99 c-81 94 -89 100 -124 100 -75 0 -73 6 -178 -535 -51 -268 -94 -494 -94 -502 0 -8 14 -28 30 -45 l31 -31 262 7 c825 20 758 16 784 42 15 15 23 35 23 58 0 30 -13 51 -81 132 -92 110 -93 105 21 145 176 64 404 -3 514 -150 67 -89 81 -101 121 -101 46 0 85 36 85 80 0 68 -141 226 -258 288 -109 58 -185 77 -312 76 -160 0 -255 -30 -393 -127 -91 -63 -93 -106 -12 -202 l45 -52 -102 -7 c-57 -3 -206 -6 -333 -7 -190 -1 -230 1 -228 12 3 27 109 578 119 618 5 24 6 23 37 -15 88 -108 103 -109 236 -20 170 114 318 164 516 173 97 4 139 1 217 -15 334 -69 611 -310 712 -619 10 -29 27 -60 39 -68 56 -39 137 1 137 67 0 45 -57 181 -116 279 -58 96 -187 237 -282 307 -137 102 -314 178 -480 207 -102 18 -290 18 -387 0z"/>
    <path d="M3595 3694 c-347 -58 -664 -253 -858 -526 -23 -32 -44 -58 -47 -58 -3 0 -28 30 -55 68 -59 80 -178 202 -256 260 -77 58 -135 58 -165 0 -25 -49 -11 -82 64 -142 95 -76 195 -185 259 -284 l56 -84 -36 -107 c-50 -148 -70 -270 -70 -431 0 -161 18 -275 69 -428 l37 -110 -56 -85 c-165 -253 -426 -434 -719 -498 -486 -106 -990 116 -1241 548 -307 530 -142 1203 378 1542 113 73 340 161 418 161 10 0 32 13 48 29 38 38 39 82 3 118 -24 24 -30 25 -87 20 -86 -9 -244 -60 -357 -117 -301 -151 -540 -421 -653 -736 -53 -147 -72 -265 -71 -444 0 -184 20 -302 75 -454 115 -311 354 -579 649 -726 361 -181 800 -184 1165 -10 202 97 397 263 516 441 l27 39 54 -73 c81 -106 140 -169 224 -237 87 -70 127 -78 169 -35 39 38 34 90 -12 129 -220 185 -333 343 -407 566 -47 141 -60 241 -53 413 10 287 110 523 309 732 175 184 364 289 623 346 80 18 331 18 420 0 665 -132 1074 -782 900 -1431 -115 -427 -489 -765 -922 -832 -78 -12 -108 -31 -119 -73 -9 -34 12 -80 42 -94 36 -16 66 -14 184 13 247 56 456 173 640 356 207 206 336 467 375 760 19 134 19 202 0 342 -59 448 -337 829 -746 1022 -232 110 -528 152 -774 110z"/>
    <path d="M3735 3235 c-21 -21 -25 -33 -25 -89 l0 -65 -42 -11 c-140 -36 -260 -128 -311 -238 -31 -67 -31 -217 0 -284 47 -102 166 -189 298 -219 l55 -12 0 -219 c0 -147 -3 -218 -11 -218 -28 0 -121 55 -146 86 -61 77 -81 94 -110 94 -59 0 -98 -55 -81 -117 12 -47 107 -145 175 -180 32 -17 84 -39 116 -48 l57 -16 0 -65 c0 -56 4 -68 25 -89 16 -17 35 -25 60 -25 25 0 44 8 60 25 21 21 25 33 25 89 l0 65 57 16 c131 38 241 123 290 224 25 50 28 67 28 156 0 89 -3 106 -28 156 -49 101 -135 163 -277 199 l-65 16 -3 217 c-3 240 -6 230 63 198 51 -23 102 -66 120 -101 36 -70 142 -60 161 16 10 39 -3 68 -52 123 -71 79 -148 125 -251 151 l-43 11 0 65 c0 56 -4 68 -25 89 -33 34 -87 34 -120 0z m-25 -535 c0 -232 6 -223 -102 -167 -51 26 -67 40 -85 77 -53 103 -3 214 122 271 22 10 46 19 53 19 9 0 12 -47 12 -200z m280 -448 c152 -74 127 -275 -45 -353 -22 -10 -46 -19 -52 -19 -10 0 -13 48 -13 205 l0 205 28 -6 c15 -3 52 -18 82 -32z"/>
    <path d="M1517 3166 c-21 -8 -48 -22 -59 -33 -11 -10 -59 -94 -105 -188 -47 -93 -86 -171 -87 -172 -1 -2 -81 -14 -177 -28 -96 -14 -188 -30 -205 -36 -32 -10 -74 -48 -93 -86 -15 -30 -14 -109 3 -141 8 -15 75 -87 149 -159 l135 -133 -29 -167 c-16 -93 -29 -186 -29 -208 0 -80 59 -146 143 -160 39 -7 53 -2 225 86 l182 94 183 -94 c171 -88 185 -93 224 -86 84 14 143 80 143 160 0 22 -14 116 -30 208 l-29 168 136 132 c75 73 142 146 149 164 17 39 18 106 3 136 -19 38 -61 76 -93 86 -17 6 -109 22 -205 36 -96 14 -176 26 -177 28 -1 1 -40 79 -87 172 -46 94 -94 178 -105 188 -22 20 -86 46 -112 46 -8 0 -32 -6 -53 -13z m141 -346 c104 -213 98 -208 329 -241 89 -12 166 -25 172 -29 6 -3 -48 -65 -123 -141 -115 -114 -136 -140 -142 -174 -5 -28 2 -95 23 -217 16 -98 27 -178 23 -178 -4 0 -76 37 -161 82 -210 111 -210 111 -418 0 -84 -45 -156 -82 -160 -82 -4 0 6 80 22 179 20 120 27 191 23 217 -6 33 -29 60 -142 173 -82 81 -131 137 -124 141 6 4 84 17 173 29 232 33 226 28 330 241 45 93 84 169 87 169 3 0 42 -76 88 -169z"/>
    <path d="M3115 1219 c-159 -3 -318 -7 -353 -8 -52 -1 -67 -5 -87 -26 -45 -45 -35 -78 55 -187 44 -53 80 -98 80 -101 0 -12 -123 -57 -182 -67 -91 -14 -183 1 -273 45 -66 31 -90 53 -207 177 -48 50 -121 30 -142 -39 -16 -51 79 -171 197 -250 181 -122 418 -143 617 -56 81 35 187 111 200 143 16 39 6 65 -52 132 l-48 56 72 6 c40 3 191 7 336 9 241 4 263 3 259 -12 -2 -9 -30 -154 -62 -321 -33 -168 -61 -307 -63 -310 -2 -2 -27 21 -56 53 -45 48 -58 57 -87 57 -19 0 -46 -8 -60 -18 -138 -92 -173 -114 -225 -137 -500 -223 -1095 25 -1280 532 -30 83 -61 110 -114 98 -59 -13 -79 -63 -55 -138 101 -312 375 -580 707 -691 313 -105 703 -54 966 126 24 17 45 28 46 26 31 -43 154 -181 167 -188 30 -16 66 -11 94 13 21 18 30 40 46 122 130 665 169 883 164 902 -3 12 -15 32 -27 43 -25 23 -51 23 -633 9z"/>
</g>
            </svg>
            <h3 style="font-size: 21px !important;" class="caption-pointspot">Sorry! <b>Member Rates</b> applicable for <b>Membership only!</b> </h3>
            <div style="font-size: 13px;">
Already member, please <a href="javascript: void(0);" onclick="click_signin();" class="signin-pointspot">Sign in</a> | Not a member yet? <a href="javascript: void(0);" onclick="click_signin();" class="signin-pointspot">Create an account.<a>
            </div>
            <div class="pointspot_poweredby">Powered by <img src="//instant-bookings.com/ibs/bookings/images/icon-pointspot.png" class="icon_pointspot"> PointSpot</div>
        </div>
    </div>`;
}


$('#mainmodal-memberrate').modal('show');               
$('#mainmodal-memberrate').find('.modal-dialog').addClass('modal-md');
$('#mainmodal-memberrate').find('.body_landing').html(word);

return false;
            }
            else if (_this._EtmValidationForm(_this._reviewForm) == 0 && ($('#hiddenfield_PaymentMethod').val() != 'SMARTPAY' || parseFloat($('#hiddenfield_GrandTotal').val()) >= parseFloat($('#hd_KBANKSmartPayMinimumAmount').val()))) {
$('#grand-total-submit-btn').prop('disabled', true);
$('#grand-total-submit-btn').html('Please Wait, Processing...');
$('#grand-total-submit-btn').attr('style', 'text-transform: none; background-color: #f1f1f1 !important; color: var(--main-theme-color)!important; text-align: left;');
clearInterval(_this._Interval);
_this._Basket = [];      
_this._CookieID = {};      
_this._AllotmentStore = [];
_this._storeReservationValUpdate();
$(_this._reviewForm).submit();
            } 
            else if (($('#hiddenfield_PaymentMethod').val() == 'SMARTPAY' || $('#hiddenfield_PaymentMethod').val() == 'IPP') && parseFloat($('#hiddenfield_GrandTotal').val()) < parseFloat($('#hd_KBANKSmartPayMinimumAmount').val())) {
alert('This booking amount cannot be paid in installments.');
return false;
            } 
            else {
alert('please fill information');
var reqEle = $(_this._reviewForm).find('.etm-required').not('div');

$.each(reqEle, function() {
    $(this).on('change keyup', function() {
        _this._EtmValidationForm(_this._reviewForm);
    });
});

$('html, body').animate({
    scrollTop: $('.etm-invalid:eq(0)').offset().top - 100
}, 1000);

return false;
            }
        });

        let res_authstate = await pstm.getAuthState();
        modalWrap = document.createElement('div');
        modalWrap = document.createElement('div');
        modalWrap.innerHTML = `
        <div class="modal fade" tabindex="-1" role="dialog" id="mainmodal-memberrate" aria-labelledby="myLargeModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">
        <div class="modal-dialog" style="max-width: 750px !important;">
            <div class="modal-content">
<div class="modal-body">
    <a href="#" class="mainmodal_close" data-dismiss="modal"><i class="flaticon-close"></i></a>
    <div class="container-fluid">
            <div class="row body_landing">
       
            </div>
    </div>
</div>
            </div>
        </div>
        </div>
        `;

        document.body.append(modalWrap);

        if(!res_authstate) {
            var word = '';

            if (global_ReadyEngine._SearchParameter.language == 'th') {
word = `<div class="col-12 col-no-padding">
    <div class="modal_addon">
        <svg xmlns="http://www.w3.org/2000/svg" class="icon-pointspot" version="1.0" width="538.000000pt" height="477.000000pt" viewBox="0 0 538.000000 477.000000" preserveAspectRatio="xMidYMid meet">
            <g transform="translate(0.000000,477.000000) scale(0.100000,-0.100000)" fill="#566375" stroke="none">
<path d="M2475 4655 c-147 -27 -314 -92 -419 -165 l-43 -29 -87 99 c-81 94 -89 100 -124 100 -75 0 -73 6 -178 -535 -51 -268 -94 -494 -94 -502 0 -8 14 -28 30 -45 l31 -31 262 7 c825 20 758 16 784 42 15 15 23 35 23 58 0 30 -13 51 -81 132 -92 110 -93 105 21 145 176 64 404 -3 514 -150 67 -89 81 -101 121 -101 46 0 85 36 85 80 0 68 -141 226 -258 288 -109 58 -185 77 -312 76 -160 0 -255 -30 -393 -127 -91 -63 -93 -106 -12 -202 l45 -52 -102 -7 c-57 -3 -206 -6 -333 -7 -190 -1 -230 1 -228 12 3 27 109 578 119 618 5 24 6 23 37 -15 88 -108 103 -109 236 -20 170 114 318 164 516 173 97 4 139 1 217 -15 334 -69 611 -310 712 -619 10 -29 27 -60 39 -68 56 -39 137 1 137 67 0 45 -57 181 -116 279 -58 96 -187 237 -282 307 -137 102 -314 178 -480 207 -102 18 -290 18 -387 0z"/>
<path d="M3595 3694 c-347 -58 -664 -253 -858 -526 -23 -32 -44 -58 -47 -58 -3 0 -28 30 -55 68 -59 80 -178 202 -256 260 -77 58 -135 58 -165 0 -25 -49 -11 -82 64 -142 95 -76 195 -185 259 -284 l56 -84 -36 -107 c-50 -148 -70 -270 -70 -431 0 -161 18 -275 69 -428 l37 -110 -56 -85 c-165 -253 -426 -434 -719 -498 -486 -106 -990 116 -1241 548 -307 530 -142 1203 378 1542 113 73 340 161 418 161 10 0 32 13 48 29 38 38 39 82 3 118 -24 24 -30 25 -87 20 -86 -9 -244 -60 -357 -117 -301 -151 -540 -421 -653 -736 -53 -147 -72 -265 -71 -444 0 -184 20 -302 75 -454 115 -311 354 -579 649 -726 361 -181 800 -184 1165 -10 202 97 397 263 516 441 l27 39 54 -73 c81 -106 140 -169 224 -237 87 -70 127 -78 169 -35 39 38 34 90 -12 129 -220 185 -333 343 -407 566 -47 141 -60 241 -53 413 10 287 110 523 309 732 175 184 364 289 623 346 80 18 331 18 420 0 665 -132 1074 -782 900 -1431 -115 -427 -489 -765 -922 -832 -78 -12 -108 -31 -119 -73 -9 -34 12 -80 42 -94 36 -16 66 -14 184 13 247 56 456 173 640 356 207 206 336 467 375 760 19 134 19 202 0 342 -59 448 -337 829 -746 1022 -232 110 -528 152 -774 110z"/>
<path d="M3735 3235 c-21 -21 -25 -33 -25 -89 l0 -65 -42 -11 c-140 -36 -260 -128 -311 -238 -31 -67 -31 -217 0 -284 47 -102 166 -189 298 -219 l55 -12 0 -219 c0 -147 -3 -218 -11 -218 -28 0 -121 55 -146 86 -61 77 -81 94 -110 94 -59 0 -98 -55 -81 -117 12 -47 107 -145 175 -180 32 -17 84 -39 116 -48 l57 -16 0 -65 c0 -56 4 -68 25 -89 16 -17 35 -25 60 -25 25 0 44 8 60 25 21 21 25 33 25 89 l0 65 57 16 c131 38 241 123 290 224 25 50 28 67 28 156 0 89 -3 106 -28 156 -49 101 -135 163 -277 199 l-65 16 -3 217 c-3 240 -6 230 63 198 51 -23 102 -66 120 -101 36 -70 142 -60 161 16 10 39 -3 68 -52 123 -71 79 -148 125 -251 151 l-43 11 0 65 c0 56 -4 68 -25 89 -33 34 -87 34 -120 0z m-25 -535 c0 -232 6 -223 -102 -167 -51 26 -67 40 -85 77 -53 103 -3 214 122 271 22 10 46 19 53 19 9 0 12 -47 12 -200z m280 -448 c152 -74 127 -275 -45 -353 -22 -10 -46 -19 -52 -19 -10 0 -13 48 -13 205 l0 205 28 -6 c15 -3 52 -18 82 -32z"/>
<path d="M1517 3166 c-21 -8 -48 -22 -59 -33 -11 -10 -59 -94 -105 -188 -47 -93 -86 -171 -87 -172 -1 -2 -81 -14 -177 -28 -96 -14 -188 -30 -205 -36 -32 -10 -74 -48 -93 -86 -15 -30 -14 -109 3 -141 8 -15 75 -87 149 -159 l135 -133 -29 -167 c-16 -93 -29 -186 -29 -208 0 -80 59 -146 143 -160 39 -7 53 -2 225 86 l182 94 183 -94 c171 -88 185 -93 224 -86 84 14 143 80 143 160 0 22 -14 116 -30 208 l-29 168 136 132 c75 73 142 146 149 164 17 39 18 106 3 136 -19 38 -61 76 -93 86 -17 6 -109 22 -205 36 -96 14 -176 26 -177 28 -1 1 -40 79 -87 172 -46 94 -94 178 -105 188 -22 20 -86 46 -112 46 -8 0 -32 -6 -53 -13z m141 -346 c104 -213 98 -208 329 -241 89 -12 166 -25 172 -29 6 -3 -48 -65 -123 -141 -115 -114 -136 -140 -142 -174 -5 -28 2 -95 23 -217 16 -98 27 -178 23 -178 -4 0 -76 37 -161 82 -210 111 -210 111 -418 0 -84 -45 -156 -82 -160 -82 -4 0 6 80 22 179 20 120 27 191 23 217 -6 33 -29 60 -142 173 -82 81 -131 137 -124 141 6 4 84 17 173 29 232 33 226 28 330 241 45 93 84 169 87 169 3 0 42 -76 88 -169z"/>
<path d="M3115 1219 c-159 -3 -318 -7 -353 -8 -52 -1 -67 -5 -87 -26 -45 -45 -35 -78 55 -187 44 -53 80 -98 80 -101 0 -12 -123 -57 -182 -67 -91 -14 -183 1 -273 45 -66 31 -90 53 -207 177 -48 50 -121 30 -142 -39 -16 -51 79 -171 197 -250 181 -122 418 -143 617 -56 81 35 187 111 200 143 16 39 6 65 -52 132 l-48 56 72 6 c40 3 191 7 336 9 241 4 263 3 259 -12 -2 -9 -30 -154 -62 -321 -33 -168 -61 -307 -63 -310 -2 -2 -27 21 -56 53 -45 48 -58 57 -87 57 -19 0 -46 -8 -60 -18 -138 -92 -173 -114 -225 -137 -500 -223 -1095 25 -1280 532 -30 83 -61 110 -114 98 -59 -13 -79 -63 -55 -138 101 -312 375 -580 707 -691 313 -105 703 -54 966 126 24 17 45 28 46 26 31 -43 154 -181 167 -188 30 -16 66 -11 94 13 21 18 30 40 46 122 130 665 169 883 164 902 -3 12 -15 32 -27 43 -25 23 -51 23 -633 9z"/>
            </g>
        </svg>
        <h3 style="font-size: 21px !important;" class="caption-pointspot">ลงทะเบียนเพื่อรับส่วนลดและสะสมคะแนน</h3>
        <div style="font-size: 13px;">
            <a href="javascript: void(0);" onclick="click_signin();" class="signin-pointspot">เข้าสู่ระบบ</a> | ยังไม่ได้เป็นสมาชิก <a href="javascript: void(0);" onclick="click_signin();" class="signin-pointspot">สมัครสมาชิก<a>
        </div>
        <div class="pointspot_poweredby">Powered by <img src="//instant-bookings.com/ibs/bookings/images/icon-pointspot.png" class="icon_pointspot"> PointSpot</div>
    </div>
</div>`;
            }
            else {
word = `<div class="col-12 col-no-padding">
    <div class="modal_addon">
        <svg xmlns="http://www.w3.org/2000/svg" class="icon-pointspot" version="1.0" width="538.000000pt" height="477.000000pt" viewBox="0 0 538.000000 477.000000" preserveAspectRatio="xMidYMid meet">
            <g transform="translate(0.000000,477.000000) scale(0.100000,-0.100000)" fill="#566375" stroke="none">
<path d="M2475 4655 c-147 -27 -314 -92 -419 -165 l-43 -29 -87 99 c-81 94 -89 100 -124 100 -75 0 -73 6 -178 -535 -51 -268 -94 -494 -94 -502 0 -8 14 -28 30 -45 l31 -31 262 7 c825 20 758 16 784 42 15 15 23 35 23 58 0 30 -13 51 -81 132 -92 110 -93 105 21 145 176 64 404 -3 514 -150 67 -89 81 -101 121 -101 46 0 85 36 85 80 0 68 -141 226 -258 288 -109 58 -185 77 -312 76 -160 0 -255 -30 -393 -127 -91 -63 -93 -106 -12 -202 l45 -52 -102 -7 c-57 -3 -206 -6 -333 -7 -190 -1 -230 1 -228 12 3 27 109 578 119 618 5 24 6 23 37 -15 88 -108 103 -109 236 -20 170 114 318 164 516 173 97 4 139 1 217 -15 334 -69 611 -310 712 -619 10 -29 27 -60 39 -68 56 -39 137 1 137 67 0 45 -57 181 -116 279 -58 96 -187 237 -282 307 -137 102 -314 178 -480 207 -102 18 -290 18 -387 0z"/>
<path d="M3595 3694 c-347 -58 -664 -253 -858 -526 -23 -32 -44 -58 -47 -58 -3 0 -28 30 -55 68 -59 80 -178 202 -256 260 -77 58 -135 58 -165 0 -25 -49 -11 -82 64 -142 95 -76 195 -185 259 -284 l56 -84 -36 -107 c-50 -148 -70 -270 -70 -431 0 -161 18 -275 69 -428 l37 -110 -56 -85 c-165 -253 -426 -434 -719 -498 -486 -106 -990 116 -1241 548 -307 530 -142 1203 378 1542 113 73 340 161 418 161 10 0 32 13 48 29 38 38 39 82 3 118 -24 24 -30 25 -87 20 -86 -9 -244 -60 -357 -117 -301 -151 -540 -421 -653 -736 -53 -147 -72 -265 -71 -444 0 -184 20 -302 75 -454 115 -311 354 -579 649 -726 361 -181 800 -184 1165 -10 202 97 397 263 516 441 l27 39 54 -73 c81 -106 140 -169 224 -237 87 -70 127 -78 169 -35 39 38 34 90 -12 129 -220 185 -333 343 -407 566 -47 141 -60 241 -53 413 10 287 110 523 309 732 175 184 364 289 623 346 80 18 331 18 420 0 665 -132 1074 -782 900 -1431 -115 -427 -489 -765 -922 -832 -78 -12 -108 -31 -119 -73 -9 -34 12 -80 42 -94 36 -16 66 -14 184 13 247 56 456 173 640 356 207 206 336 467 375 760 19 134 19 202 0 342 -59 448 -337 829 -746 1022 -232 110 -528 152 -774 110z"/>
<path d="M3735 3235 c-21 -21 -25 -33 -25 -89 l0 -65 -42 -11 c-140 -36 -260 -128 -311 -238 -31 -67 -31 -217 0 -284 47 -102 166 -189 298 -219 l55 -12 0 -219 c0 -147 -3 -218 -11 -218 -28 0 -121 55 -146 86 -61 77 -81 94 -110 94 -59 0 -98 -55 -81 -117 12 -47 107 -145 175 -180 32 -17 84 -39 116 -48 l57 -16 0 -65 c0 -56 4 -68 25 -89 16 -17 35 -25 60 -25 25 0 44 8 60 25 21 21 25 33 25 89 l0 65 57 16 c131 38 241 123 290 224 25 50 28 67 28 156 0 89 -3 106 -28 156 -49 101 -135 163 -277 199 l-65 16 -3 217 c-3 240 -6 230 63 198 51 -23 102 -66 120 -101 36 -70 142 -60 161 16 10 39 -3 68 -52 123 -71 79 -148 125 -251 151 l-43 11 0 65 c0 56 -4 68 -25 89 -33 34 -87 34 -120 0z m-25 -535 c0 -232 6 -223 -102 -167 -51 26 -67 40 -85 77 -53 103 -3 214 122 271 22 10 46 19 53 19 9 0 12 -47 12 -200z m280 -448 c152 -74 127 -275 -45 -353 -22 -10 -46 -19 -52 -19 -10 0 -13 48 -13 205 l0 205 28 -6 c15 -3 52 -18 82 -32z"/>
<path d="M1517 3166 c-21 -8 -48 -22 -59 -33 -11 -10 -59 -94 -105 -188 -47 -93 -86 -171 -87 -172 -1 -2 -81 -14 -177 -28 -96 -14 -188 -30 -205 -36 -32 -10 -74 -48 -93 -86 -15 -30 -14 -109 3 -141 8 -15 75 -87 149 -159 l135 -133 -29 -167 c-16 -93 -29 -186 -29 -208 0 -80 59 -146 143 -160 39 -7 53 -2 225 86 l182 94 183 -94 c171 -88 185 -93 224 -86 84 14 143 80 143 160 0 22 -14 116 -30 208 l-29 168 136 132 c75 73 142 146 149 164 17 39 18 106 3 136 -19 38 -61 76 -93 86 -17 6 -109 22 -205 36 -96 14 -176 26 -177 28 -1 1 -40 79 -87 172 -46 94 -94 178 -105 188 -22 20 -86 46 -112 46 -8 0 -32 -6 -53 -13z m141 -346 c104 -213 98 -208 329 -241 89 -12 166 -25 172 -29 6 -3 -48 -65 -123 -141 -115 -114 -136 -140 -142 -174 -5 -28 2 -95 23 -217 16 -98 27 -178 23 -178 -4 0 -76 37 -161 82 -210 111 -210 111 -418 0 -84 -45 -156 -82 -160 -82 -4 0 6 80 22 179 20 120 27 191 23 217 -6 33 -29 60 -142 173 -82 81 -131 137 -124 141 6 4 84 17 173 29 232 33 226 28 330 241 45 93 84 169 87 169 3 0 42 -76 88 -169z"/>
<path d="M3115 1219 c-159 -3 -318 -7 -353 -8 -52 -1 -67 -5 -87 -26 -45 -45 -35 -78 55 -187 44 -53 80 -98 80 -101 0 -12 -123 -57 -182 -67 -91 -14 -183 1 -273 45 -66 31 -90 53 -207 177 -48 50 -121 30 -142 -39 -16 -51 79 -171 197 -250 181 -122 418 -143 617 -56 81 35 187 111 200 143 16 39 6 65 -52 132 l-48 56 72 6 c40 3 191 7 336 9 241 4 263 3 259 -12 -2 -9 -30 -154 -62 -321 -33 -168 -61 -307 -63 -310 -2 -2 -27 21 -56 53 -45 48 -58 57 -87 57 -19 0 -46 -8 -60 -18 -138 -92 -173 -114 -225 -137 -500 -223 -1095 25 -1280 532 -30 83 -61 110 -114 98 -59 -13 -79 -63 -55 -138 101 -312 375 -580 707 -691 313 -105 703 -54 966 126 24 17 45 28 46 26 31 -43 154 -181 167 -188 30 -16 66 -11 94 13 21 18 30 40 46 122 130 665 169 883 164 902 -3 12 -15 32 -27 43 -25 23 -51 23 -633 9z"/>
            </g>
        </svg>
        <h3 style="font-size: 21px !important;" class="caption-pointspot">Register for Special Member Rates and Points Collection</h3>
        <div style="font-size: 13px;">
            Already member, please <a href="javascript: void(0);" onclick="click_signin();" class="signin-pointspot">Sign in</a> | Not a member yet? <a href="javascript: void(0);" onclick="click_signin();" class="signin-pointspot">Create an account.<a>
        </div>
        <div class="pointspot_poweredby">Powered by <img src="//instant-bookings.com/ibs/bookings/images/icon-pointspot.png" class="icon_pointspot"> PointSpot</div>
    </div>
</div>`;
            }

            
            $('#mainmodal-memberrate').modal('show');        
            $('#mainmodal-memberrate').find('.modal-dialog').addClass('modal-md');
            $('#mainmodal-memberrate').find('.body_landing').html(word);
        }
    }
}

function click_signin() {
    $('#mainmodal-memberrate').modal('hide');
    signin();
}
            // str_Message  =  '<div id="carousel_item_img" class="carousel-item etm_tab_banner carousel_item_img item_etm_tab_banner"><a href="#"  class="link-redeem"><img class="banner_redeem-lg" src="https://ibs.instant-bookings.com/medias/gallerys/hotels/701/template/images/bannerpoor.jpg" width="100%"><img class="banner_redeem-sm" src="https://ibs.instant-bookings.com/medias/gallerys/hotels/701/template/images/bannersm.jpg" width="100%"></a></div>';

//$('.row_etm_tab_banner').append(str_Message);

 $("<span class='span_SMS'  style='font-size: 11px;color: red;'>SMS Confirmation will be sent for Online Voucher Purchase Confirmation.<br>ระบบจะส่ง SMS เพื่อยืนยันการซื้อบัตรกำนัลไปยังหมายเลขของท่านหากไม่ได้รับ SMS กรุณาติดต่อเจ้าหน้าที่</span>").insertAfter(".online-voucher #mp_contentplaceholder_Content_textbox_PhoneNumber");
                        if (navigator.userAgent.search('Line/') >= 0) { 
                            //alert('LINE in-App Browser (LIFF App)');
                            if (window.location.href.search('openExternalBrowser=1') < 0) {
                                //alert('Open External Browser\n\n' + window.location.href);
                                window.location.replace(window.location.href + '&openExternalBrowser=1');
                                document.body.innerHTML = '';	
                            }
                        };  $(".payment_method_box.box-mobile_banking").hide();
                    // device detection
                    if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) 
                        || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))) { 
    
                       $(".payment_method_box.box-mobile_banking").show();
                         } 
                                $(window).on('load', function () {
                                     setTimeout(() => {
                                    if($('#mainmodal').hasClass('show') )
                                    {
                                       if($('#mainmodal-memberrate').hasClass('show'))
	                                    {
		                                    $('#mainmodal-memberrate').removeClass('show').addClass('hide');
	                                    }
                                    }
 
                                    }, 500);   
                                    });
                                    