/***Order 666***/
 $(".campaignid-666 #button_ProcessPayment").val("Order & Service");
/**$(".campaignid-666 .btn_Checkout").text("Order & Service");**/
$(".body_666 #mp_contentplaceholder_Content_textbox_EmailAddress").val("srayut@loligoresort.com");


/***Order 666***/

/***Order 665***/
/***
$(".body_665 #mp_contentplaceholder_Content_textbox_EmailAddress").val("srayut@loligoresort.com");

  $(document).ready(function() {
    $(".body_665 #button_ProcessPayment").click(function() { 
        
        if ($(".body_665 #hiddenfield_PaymentGateway").val() == "CASH" && $(".body_665 #hiddenfield_PaymentMethod").val() == "PAYAFTERCHECKOUT"){
            
           $(".body_665 #textbox_OtherRequirement").val("Pay Upon Check-out");
        }else if($(".body_665 #hiddenfield_PaymentGateway").val() == "CASH" && $(".body_665 #hiddenfield_PaymentMethod").val() == "CASH"){
			$(".body_665 #textbox_OtherRequirement").val("CASH");
		}
    });
  });

***/
/***Order 665***/


$("div.item.id-5289").hide();

//not paotung 156

jQuery.expr[':'].regex = function(elem, index, match) {

    var matchParams = match[3].split(','),

        validLabels = /^(data|css):/,

        attr = {

            method: matchParams[0].match(validLabels) ?

                matchParams[0].split(':')[0] : 'attr',

            property: matchParams.shift().replace(validLabels, '')

        },

        regexFlags = 'ig',

        regex = new RegExp(matchParams.join('').replace(/^\s+|\s+$/g, ''), regexFlags);

    return regex.test(jQuery(elem)[attr.method](attr.property));

}



/*KTC*/
$(window).on("load", function() {
    setTimeout(function() {
        if ($("[id^=RR-][id$=-2186]").length + $("[id^=SR-][id$=-2186]").length > 0) {
            $('.payment_method_box_content.row').append('<div class="creditcard-message">กรุณาชำระด้วยบัตรเครดิต KTC เท่านั้นเพราะเนื่องจากลูกค้าเลือกส่วนลดร่วมรายการกับ KTC</div>');


            var str_Modal = '<div id="div_NotKTC"  style="display: none; padding-right: 17px;text-align: center;color: red;font-size: 16px;"><b>กรุณาชำระด้วยบัตรเครดิต KTC เท่านั้นเพราะเนื่องจากลูกค้าเลือกส่วนลดร่วมรายการกับ KTC</b></div>';

            $("#grand-total-submit-btn").after(str_Modal);

            $('input[name="textbox_CreditCardNumber"]').focusout(function() {

                var var_KTC = $('input[name="textbox_CreditCardNumber"]').val();
                var str_Modal = '';

                if (var_KTC.startsWith("430445") || var_KTC.startsWith("439137") || var_KTC.startsWith("456723") || var_KTC.startsWith("493113") || var_KTC.startsWith("456724") || var_KTC.startsWith("493112") || var_KTC.startsWith("451347")) {
                    /*KTCVISA*/
                    $('#grand-total-submit-btn').show();
                    $('#div_NotKTC').css("display", "none");
                } else if (var_KTC.startsWith("523910") || var_KTC.startsWith("540716") || var_KTC.startsWith("540605") || var_KTC.startsWith("540604") || var_KTC.startsWith("543420") || var_KTC.startsWith("356342") || var_KTC.startsWith("626278")) {
                    /*KTC*/
                    $('#grand-total-submit-btn').show();
                    $('#div_NotKTC').css("display", "none");
                } else {
                    //$('#myModal').modal('show');
                    $('#grand-total-submit-btn').hide();
                    $('#div_NotKTC').css("display", "block");
                }
            });

        }
    }, 2000);
});



$('.online-voucher #mp_contentplaceholder_Content_panel_Prefix label').html('Title <em id="mp_contentplaceholder_Content_panel_RequirePrefix">*</em> (คำนำหน้า)');
$('.online-voucher #mp_contentplaceholder_Content_panel_FirstName label').html('First name <em id="mp_contentplaceholder_Content_panel_RequireFirstName">*</em> (ชื่อ)');
$('.online-voucher #mp_contentplaceholder_Content_panel_LastName label').html('Last name <em id="mp_contentplaceholder_Content_panel_RequireLastName">*</em> (นามสกุล)');
$('.online-voucher #mp_contentplaceholder_Content_panel_PhoneNumber label').html('Contact phone number <em id="mp_contentplaceholder_Content_panel_RequirePhoneNumber">*</em> (เบอร์โทรศัพท์ติดต่อ)');
$('.online-voucher #mp_contentplaceholder_Content_panel_EmailAddress label').html('E-mail address <em id="mp_contentplaceholder_Content_panel_RequireEmailAddress">*</em> (อีเมลล์)');

/*$('.online-voucher #mp_contentplaceholder_Content_panel_Address label').html('Delivery Address <em id="mp_contentplaceholder_Content_panel_RequireFirstName">*</em> <span style="color: red;">สำคัญ! กรุณากรอกที่อยู่ และรหัสไปรษณีย์ให้ครบถ้วน เพื่อใช้ในการจัดส่งบัตรกำนัลฉบับจริงทางไปรษณีย์ (จัดส่งเฉพาะภายในประเทศไทยเท่านั้น)</span>');*/
$('#mp_contentplaceholder_Content_panel_Address').hide();

$('.online-voucher #mp_contentplaceholder_Content_panel_Nationality label').html('Nationality <em id="mp_contentplaceholder_Content_panel_RequireNationality">*</em> (สัญชาติ)');



/**Add Logo Etax in Footer v2**/

$("<img  class='img_etaxlogo' src='//instant-bookings.com/ibs/medias/gallerys/hotels/156/template/images/etax-logo.png' width='auto' height='auto'>").insertAfter(".txt-address");

/**Add Logo Etax in Footer v2**/

/**online store**/

/**
$(".online-store ul.header-features li").html("<div class='header-feature-caption'><p class='header-feature-sub-title'>83/188 Soi Huathanon 23, Khaotakieb - Hua Hin Road, Hua Hin, 77110</p><i class='fa fa-phone' style='width: 22px;height: 22px;line-height: 22px;'></i><h5 class='header-feature-title'>+66(0) 32 900 800 , WhatsApp Text: +66 66 0 27 2828</h5> </div>");
**/

$(".online-store .sidebar-left h3.mb20").html("I wish");


$(".online-store ul.header-features li").html(`
    <div class='header-feature-caption'>
        <p class='header-feature-sub-title'>83/188 Soi Huathanon 23, Khaotakieb - Hua Hin Road, Hua Hin, 77110</p>       
        <h5 class='header-feature-title'> <i class='fa fa-phone' style='width: 22px;height: 22px;line-height: 22px;'></i> +66(0) 32 900 800 , 
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" width="22" height="22">
                <path fill="green" d="M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7 .9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z"/>
            </svg>
            WhatsApp : +66 66 0 27 2828
        </h5>
    </div>
`);


/**online store**/
 $(".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);   
                                    });
                                    