403Webshell
Server IP : 103.234.187.230  /  Your IP : 216.73.216.216
Web Server : Apache
System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/b2b.hellogtx.com/public/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/b2b.hellogtx.com/public/js//custom.js
$(document).on('click', '.iamplusminus', function () {
    if ($(this).hasClass('expand')) {
        $(this).html('<i class="fa fa-plus"></i>').addClass('collepse').removeClass('expand').attr('title', 'More...').css('color', '#428bca');
        $(this).parent().css({'height': '180px'});
    } else {
        $(this).html('<i class="fa fa-minus"></i>').addClass('expand').removeClass('collepse').attr('title', 'Less...').css('color', '#428bca');
        ;
        $(this).parent().css({'height': 'auto'});
    }
});
setTimeout(function () {
    $.getJSON(SITEURL + 'public/upload/' + gtxagencysysid + '/data/dynamic/package_destinations.json?' + Math.random(), function (destinations) {
        $(".destinationBox").autocomplete({
            minLength: 2,
            autoFocus: true,
            source: destinations,
            select: function (event, ui) {
                var label = ui.item.label;
                var value = ui.item.value;
                var code = ui.item.code;
                var cityid = ui.item.id;

            }
        });
    });
}, 1000);
$.getJSON(SITEURL + 'public/upload/' + gtxagencysysid + '/data/dynamic/package_destinations.json?man=' + Math.random(), function (destinations) {
    $("#goingTo").autocomplete({
        minLength: 2,
        autoFocus: true,
        source: destinations,
        select: function (event, ui) {
            var label = ui.item.label;
            var cityid = ui.item.id;
            $("#goingToId").val(cityid);
        }
    });
});
$(document).on('click', '.moreless_anchor', function () {
    if ($(this).hasClass('expand')) {
        $(this).css({'right': '20px', 'bottom': '0', 'position': 'absolute'}).addClass('collapse-act').removeClass('expand').html('+More');
        $(this).parent().css({'height': '110px', 'overflow': 'hidden'});
    } else {
        $(this).css({'right': 'auto', 'bottom': 'auto', 'position': 'relative'}).addClass('expand').addClass('collapse-act').html('-Less');
        $(this).parent().css({'height': 'auto', 'overflow': 'auto'});
    }
});


$(document).on('click', '.iamplusminus', function () {
    if ($(this).hasClass('expand')) {
        $(this).html('<i class="fa fa-plus"></i>').addClass('collepse').removeClass('expand').attr('title', 'More...');
        $(this).parent().css({'height': '180px'});
    } else {
        $(this).html('<i class="fa fa-minus"></i>').addClass('expand').removeClass('collepse').attr('title', 'Less...');
        ;
        $(this).parent().css({'height': 'auto'});
    }
});

$("#slistId").click(function () {
    $("#shortlistShow").toggle();
    $("#cpareShow").hide();
    $("#rcentlyShow").hide();
});

$("#cpareId").click(function () {
    $("#rcentlyShow").toggle();
    $("#shortlistShow").hide();
    $("#cpareShow").hide();
});
$(".crossIcon").click(function () {
    $("#shortlistShow").hide();
    $("#cpareShow").hide();
    $("#rcentlyShow").hide();
});


$(window).load(function () {
    var slideShow = {
        i: 0,
        next: function () {
            this.i++;
            if (this.i === this.max()) {
                this.i = 0;
            }
            ;
            this.reset();
            this.goTo(this.i);
        },
        prev: function () {
            if (this.i === 0) {
                this.i = this.max();
            }
            ;
            this.i--;
            this.reset();
            this.goTo(this.i);
        },
        goTo: function (i) {
            $('.listItem').eq(i).addClass('active');
        },
        init: function () {
            slideShow.next();
        },
        reset: function () {
            $('.listItem').removeClass('active');
        },
        max: function () {
            return $('.listItem').length;
        }

    };

    slideShow.init();

    $('#nextArrow').click(function () {
        slideShow.next();
    });

    $('#prevArrow').click(function () {
        slideShow.prev();
    });
});

$(document).ready(function () {

    var owl = $("#owl-demo2");

    owl.owlCarousel({

        items: 5, //10 items above 1000px browser width
        itemsDesktop: [1000, 5], //5 items between 1000px and 901px
        itemsDesktopSmall: [900, 4], // 3 items betweem 900px and 601px
        itemsTablet: [600, 2], //2 items between 600 and 0;
        itemsMobile: false // itemsMobile disabled - inherit from itemsTablet option

    });

    // Custom Navigation Events
    $(".right").click(function () {
        owl.trigger('owl.next');
    })
    $(".left").click(function () {
        owl.trigger('owl.prev');
    })




    /*custom checkbox js*/
    function customCheckbox(checkboxName) {
        var checkBox = $('input[name="' + checkboxName + '"]');
        $(checkBox).each(function () {
            $(this).wrap("<span class='custom-checkbox'></span>");
            if ($(this).is(':checked')) {
                $(this).parent().addClass("selected");
            }
        });
        $(checkBox).click(function () {
            $(this).parent().toggleClass("selected");
            $(this).parent().parent().toggleClass("labelcolor");
        });
    }
    $(document).ready(function () {
        customCheckbox("trip[]");
        customCheckbox("pref[]");
    })

});

//$(document).ready(function () {
////	(function () {
////		$('#toc').toc();
////	})();
//	$("#calendar").asDatepicker({
//		namespace: 'calendar',
//		lang: 'zh',
//		position: 'bottom'
//	});
//
//	$("#calendar2").asDatepicker({ mode: 'range' });
//
//	$("#calendar3").asDatepicker({
//		mode: 'multiple',
//		calendars: 4,
//	});
//
//	$(".calendar4").asDatepicker();
//
//	$('#calendar-mobile-single').asDatepicker({
//		mobileMode: true
//	});
//	$('#calendar-mobile-range').asDatepicker({
//		mode: 'range',
//		mobileMode: true
//	});
//	$('#calendar-mobile-multiple').asDatepicker({
//		mode: 'multiple',
//		mobileMode: true
//	});
//
//
//
//	$('.asDatepicker').asDatepicker();
//	$('.calendar-multiple').asDatepicker({ mode: 'multiple', calendars: 3 });
//
//	$('#calendar-api-displayMode').asDatepicker({ displayMode: 'inline' });
//
//	$('#calendar-api-show-click').click(function () {
//		$('#calendar-api-show').asDatepicker('show');
//		return false;
//	});
//	$('#calendar-api-hide-click').click(function () {
//		$('#calendar-api-hide').asDatepicker('hide');
//		return false;
//	});
//
//	$('#api-multipleClear-click').click(function () {
//		$("#calendar-api-multipleClear").asDatepicker('multipleClear');
//		return false;
//	});
//
//	$('#api-getDate-click').click(function () {
//		var html = '<div>' + $('#calendar-api-getDate').asDatepicker('getDate') + '</div>';
//		$(html).prependTo($('#api-getDate-info'));
//		return false;
//	});
//
//	$('#api-getDate-format-click').click(function () {
//		var html = '<div>' + $('#calendar-api-getDate-format').asDatepicker('getDate', 'yyyy-mm-dd') + '</div>';
//		$(html).prependTo($('#api-getDate-format-info'));
//		return false;
//	});
//
//	$('#api-update-click').click(function () {
//		$('#calendar-api-update').asDatepicker('update', { mode: 'range' });
//
//		return false;
//	});
//
//
//});

//setTimeout(function(){ 
////    for(var mi = 1;mi<21;mi++){
////        $('#verticalTab'+parseInt(mi)).easyResponsiveTabs({
////            type: 'vertical',
////            width: 'auto',
////            fit: true
////        });   
////    }   
//
//     $(".verticalTab").each(function() {
//        var pkg = $(this).attr('pkg');
//        $('#verticalTab'+parseInt(pkg)).easyResponsiveTabs({
//            type: 'vertical',
//            width: 'auto',
//            fit: true
//        });
//        $("#calendar"+parseInt(pkg)).asDatepicker({   outputFormat: 'dd/mm/yyyy', onceClick: true });
//        $("#customizeTravelDate"+parseInt(pkg)).asDatepicker({ outputFormat: 'dd/mm/yyyy',onceClick: true });
//        $("#EnquireTravelDate"+parseInt(pkg)).asDatepicker({ outputFormat: 'dd/mm/yyyy', onceClick: true});
//        $(".travelerbox"+parseInt(pkg)).click(function(){
//            $(".roomBoxMain"+parseInt(pkg)).toggle();
//        });
//        $(".travelerboxCustom"+parseInt(pkg)).click(function(){
//            $(".roomBoxMainCustom"+parseInt(pkg)).toggle();
//        });
//        $(".travelerboxEnquire"+parseInt(pkg)).click(function(){
//            $(".roomBoxMainEnquire"+parseInt(pkg)).toggle();
//        });
//    });
//}, 10000);

$(document).on('click', '.incr-btn', function (e) {

    var $button = $(this);
    var oldValue = $button.parent().find('.quantity').val();
    if ($button.data('action') == "increase_adult") {
        if (oldValue < 3) {
            var newVal = parseFloat(oldValue) + 1;
        } else {
            return false;
        }
    } else if ($button.data('action') == "increase_child") {
        if (oldValue < 2) {
            var newVal = parseFloat(oldValue) + 1;
        } else {
            return false;
        }
    } else if ($button.data('action') == "decrease_adult") {
        if (oldValue > 1) {
            var newVal = parseFloat(oldValue) - 1;
        } else {
            newVal = 1;
            $button.addClass('inactive');
        }
    } else if ($button.data('action') == "decrease_child") {
        if (oldValue > 0) {
            var newVal = parseFloat(oldValue) - 1;
        } else {
            newVal = 0;
            $button.addClass('inactive');
        }
    }
    $button.parent().find('.quantity').val(newVal);
    e.preventDefault();
});

//
//$('#verticalTab1').easyResponsiveTabs({
//type: 'vertical',
//width: 'auto',
//fit: true
//});
//
//
//$('#verticalTab2').easyResponsiveTabs({
//type: 'vertical',
//width: 'auto',
//fit: true
//});
//
//
//$('#verticalTab3').easyResponsiveTabs({
//type: 'vertical',
//width: 'auto',
//fit: true
//});
//
//
//$('#verticalTab4').easyResponsiveTabs({
//type: 'vertical',
//width: 'auto',
//fit: true
//});
//
//
//$('#verticalTab5').easyResponsiveTabs({
//type: 'vertical',
//width: 'auto',
//fit: true
//});


function addMoreRoomQuote(that) {
    var pkg = $(that).attr('pkg');
    var itinerary_rooms = $('#itinerary_rooms' + parseInt(pkg)).val();
    $('#Room' + parseInt(pkg) + (parseInt(itinerary_rooms) + 1)).show();
    $('#itinerary_rooms' + parseInt(pkg)).val(parseInt(itinerary_rooms) + 1);
}
function removeRoomQuote(that) {
    var pkg = $(that).attr('pkg');
    var itinerary_rooms = $('#itinerary_rooms' + parseInt(pkg)).val();
    $('#quantityAdult' + parseInt(pkg) + parseInt(itinerary_rooms)).val(0);
    $('#quantityChild' + parseInt(pkg) + parseInt(itinerary_rooms)).val(0);
    $('#Room' + parseInt(pkg) + parseInt(itinerary_rooms)).hide();

    $('#itinerary_rooms' + parseInt(pkg)).val(parseInt(itinerary_rooms) - 1);
}
function addMoreRoomCustomize(that) {
    var pkg = $(that).attr('pkg');
    var itinerary_rooms = $('#itinerary_roomsCustomize' + parseInt(pkg)).val();
    $('#RoomCustomize' + parseInt(pkg) + (parseInt(itinerary_rooms) + 1)).show();
    $('#itinerary_roomsCustomize' + parseInt(pkg)).val(parseInt(itinerary_rooms) + 1);
}
function removeRoomCustomize(that) {
    var pkg = $(that).attr('pkg');
    var itinerary_rooms = $('#itinerary_roomsCustomize' + parseInt(pkg)).val();
    $('#quantityAdultCustom' + parseInt(pkg) + parseInt(itinerary_rooms)).val(0);
    $('#quantityChildCustom' + parseInt(pkg) + parseInt(itinerary_rooms)).val(0);
    $('#RoomCustomize' + parseInt(pkg) + parseInt(itinerary_rooms)).hide();

    $('#itinerary_roomsCustomize' + parseInt(pkg)).val(parseInt(itinerary_rooms) - 1);
}
function addMoreRoomEnquire(that) {
    var pkg = $(that).attr('pkg');
    var itinerary_rooms = $('#itinerary_roomsEnquire' + parseInt(pkg)).val();
    $('#RoomEnquire' + parseInt(pkg) + (parseInt(itinerary_rooms) + 1)).show();
    $('#itinerary_roomsEnquire' + parseInt(pkg)).val(parseInt(itinerary_rooms) + 1);
}
function removeMoreRoomEnquire(that) {
    var pkg = $(that).attr('pkg');
    var itinerary_rooms = $('#itinerary_roomsEnquire' + parseInt(pkg)).val();
    $('#quantityAdultEnquire' + parseInt(pkg) + parseInt(itinerary_rooms)).val(0);
    $('#quantityChildEnquire' + parseInt(pkg) + parseInt(itinerary_rooms)).val(0);
    $('#RoomEnquire' + parseInt(pkg) + parseInt(itinerary_rooms)).hide();

    $('#itinerary_roomsEnquire' + parseInt(pkg)).val(parseInt(itinerary_rooms) - 1);
}
function addMoreRoomDynamicCustomize(that) {
    var pkg = $(that).attr('pkg');
    var itinerary_rooms = $('#itinerary_roomsDynamicCustomize').val();
    $('#RoomDynamicCustomize' + parseInt(pkg) + (parseInt(itinerary_rooms) + 1)).show();
    $('#itinerary_roomsDynamicCustomize').val(parseInt(itinerary_rooms) + 1);
}
function removeRoomDynamicCustomize(that) {
    var pkg = $(that).attr('pkg');
    var itinerary_rooms = $('#itinerary_roomsDynamicCustomize').val();
    $('#quantityAdultDynamicCustom' + parseInt(pkg) + parseInt(itinerary_rooms)).val(0);
    $('#quantityChildDynamicCustom' + parseInt(pkg) + parseInt(itinerary_rooms)).val(0);
    $('#RoomDynamicCustomize' + parseInt(pkg) + parseInt(itinerary_rooms)).hide();
    $('#itinerary_roomsDynamicCustomize').val(parseInt(itinerary_rooms) - 1);
}
function closeTravellersForm(that) {
    var pkg = $(that).attr('pkg');
    $('.roomBoxMain' + parseInt(pkg)).hide();
    var totalAdults = 0;
    var totalKids = 0;
    $('.quantityAdult' + parseInt(pkg)).each(function (i, element) {
        console.log($(this).val());
        totalAdults += parseInt($(this).val());
    });
    $('.quantityChild' + parseInt(pkg)).each(function (i, element) {
        totalKids += parseInt($(this).val());
    });

    $('.travelerbox' + parseInt(pkg)).html(parseInt(totalAdults) + parseInt(totalKids));
}
function closeTravellersFormCustomize(that) {
    var pkg = $(that).attr('pkg');
    $('.roomBoxMainCustom' + parseInt(pkg)).hide();
    var totalAdults = 0;
    var totalKids = 0;
    $('.quantityAdultCustom' + parseInt(pkg)).each(function (i, element) {
        console.log($(this).val());
        totalAdults += parseInt($(this).val());
    });
    $('.quantityChildCustom' + parseInt(pkg)).each(function (i, element) {
        totalKids += parseInt($(this).val());
    });

    $('.travelerboxCustom' + parseInt(pkg)).html(parseInt(totalAdults) + parseInt(totalKids));
}

function closeTravellersFormEnquire(that) {
    var pkg = $(that).attr('pkg');
    $('.roomBoxMainEnquire' + parseInt(pkg)).hide();
    var totalAdults = 0;
    var totalKids = 0;
    $('.quantityAdultEnquire' + parseInt(pkg)).each(function (i, element) {
        console.log($(this).val());
        totalAdults += parseInt($(this).val());
    });
    $('.quantityChildEnquire' + parseInt(pkg)).each(function (i, element) {
        totalKids += parseInt($(this).val());
    });

    $('.travelerboxEnquire' + parseInt(pkg)).html(parseInt(totalAdults) + parseInt(totalKids));
}
function closeTravellersFormDynamicCustomize(that) {
    var pkg = $(that).attr('pkg');
    $('.roomBoxMainDynamicCustom').hide();
    var totalAdults = 0;
    var totalKids = 0;
    $('.quantityAdultDynamicCustom' + parseInt(pkg)).each(function (i, element) {
        console.log($(this).val());
        totalAdults += parseInt($(this).val());
    });
    $('.quantityChildDynamicCustom' + parseInt(pkg)).each(function (i, element) {
        totalKids += parseInt($(this).val());
    });

    $('.travelerboxDynamicCustom').html(parseInt(totalAdults) + parseInt(totalKids));
}
function rvMoneyFormatINR(n, prec, currSign) {
    if (prec == null)
        prec = 2;
    var n = ('' + parseFloat(n).toFixed(prec).toString()).split('.');
    var num = n[0];
    var dec = n[1];
    var r, s, t;
    if (num.length > 3) {
        s = num.length % 3;
        if (s) {
            t = num.substring(0, s);
            num = t + num.substring(s).replace(/(\d{3})/g, ",$1");
        } else {
            num = num.substring(s).replace(/(\d{3})/g, ",$1").substring(1);
        }
    }
    //    return(currSign == null ? "" : currSign + "") + num + '.' + dec;
    return (currSign == null ? "" : currSign + "") + num;
}
function viewCheckRate(that) {

    // alert("check "); return false ;
    var pkg = $(that).attr('pkg');
    var index = $(that).attr('index');
    var calendart = $('#calendar' + parseInt(pkg)).val();
    var fixdeparture_destinations = $('.fixdeparture-destinations' + parseInt(pkg)).val();
    var destinationname = $('.fixdeparture-destinations' + parseInt(pkg) + ' option:selected').attr('destinationname');
    if (calendart == '') {
        $('#sucessMsgQueryDiv' + parseInt(pkg)).show();
        $('.sucessMsgQuery' + parseInt(pkg)).html('Please select date.').css({'color': 'red'});
        return false;
    }
    $('#sucessMsgQueryDiv' + parseInt(pkg)).hide();
    var AgencyType = $('#AgencyType').val();
    var viewCheckRateProposal = 'Get Proposal';
    if (AgencyType == 3) {
        viewCheckRateProposal = 'Send Proposal';
    }
    var GTXPkgId = $('#gtxpackage_' + parseInt(pkg)).val();
    $('.viewCheckRateProposalMsg' + parseInt(pkg)).html('');
    if (index == 1) {
        //$('#extraMarkUp' + parseInt(pkg)).val('');

        $('.viewCheckRateProposal' + parseInt(pkg)).html(viewCheckRateProposal).show();
        $('.viewRequestProposal' + parseInt(pkg)).html('Request Proposal').show();
        $('.viewCheckRateBook' + parseInt(pkg)).html('Book Now').show();
        $('.viewCheckRateCopy' + parseInt(pkg)).html('Copy To Clipboard').show();

        $('.viewCheckRateClass' + parseInt(pkg)).html('Please Wait..');
    }

    var data = $('.checkRatePackageForm' + parseInt(pkg)).serialize();
    // console.log(data); return false;
    $.ajax({
        url: SITEURL + 'gtxwebservices/send-enquiry/post',
        type: 'POST',
        data: data + '&index=' + index + '&DestinationID=' + fixdeparture_destinations + '&Destinations=' + destinationname,
        dataType: 'json',
        beforeSend: function () {
            if (index == 1) {
                $('.viewCheckRateClass' + parseInt(pkg)).html('Please Wait..');
            } else if (index == 2) {
                $('.viewCheckRateProposal' + parseInt(pkg)).attr('disabled', true).html('Please Wait..');
                $('.viewRequestProposal' + parseInt(pkg)).attr('disabled', true).html('Please Wait..');
                $('.viewCheckRateBook' + parseInt(pkg)).attr('disabled', true);
                $('.viewCheckRateCopy' + parseInt(pkg)).attr('disabled', true);
            } else if (index == 4) {
                $('.viewCheckRateProposal' + parseInt(pkg)).attr('disabled', true).html(viewCheckRateProposal);
                $('.viewRequestProposal' + parseInt(pkg)).attr('disabled', true).html('Request Proposal');
                $('.viewCheckRateBook' + parseInt(pkg)).attr('disabled', true).html('Book Now');
                $('.viewCheckRateCopy' + parseInt(pkg)).attr('disabled', true).html('Please wait..');
            } else {
                $('.viewCheckRateBook' + parseInt(pkg)).attr('disabled', true).html('Please Wait..');
                $('.viewCheckRateProposal' + parseInt(pkg)).attr('disabled', true);
                $('.viewRequestProposal' + parseInt(pkg)).attr('disabled', true);
                $('.viewCheckRateCopy' + parseInt(pkg)).attr('disabled', true);
            }
            $('.sucessMsgQuery' + parseInt(pkg)).html('');
        },
        success: function (result) {
            if (result.type == 4) {
                $('#clipboardId').val(1);
                var emailbody = result.copyclipboardbody;
                copyToClipboard(emailbody);
                $('.viewCheckRateProposalMsg' + parseInt(pkg)).html('copied!!');
                $('#clipboardId').val(1);
                var emailbody = result.copyclipboardbody;
                copyToClipboard(emailbody);
                $('.viewCheckRateProposalMsg' + parseInt(pkg)).html('copied!!');
                $('.viewCheckRateClass' + parseInt(pkg)).html('Check Rate');
                $('.viewCheckRateProposal' + parseInt(pkg)).html(viewCheckRateProposal);
                $('.viewRequestProposal' + parseInt(pkg)).html('Request Proposal');
                $('.viewCheckRateBook' + parseInt(pkg)).html('Book Now');
                $('.viewCheckRateCopy' + parseInt(pkg)).html('Copy to clipboard');
                return false;
            } else {
                $('.viewCheckRateProposal' + parseInt(pkg)).attr('disabled', false);
                $('.viewRequestProposal' + parseInt(pkg)).attr('disabled', false);
                $('.viewCheckRateBook' + parseInt(pkg)).attr('disabled', false);
                $('.viewCheckRateCopy' + parseInt(pkg)).attr('disabled', false);
            }

            if (result.status == 'success' && result.availability == true) {
                $('.viewCheckRateClass' + parseInt(pkg)).html('Check Rate');
                $('.ratedetail' + parseInt(pkg)).show();
                $('.preratedetail' + parseInt(pkg)).hide();

                //$('#myModa1PerPersonPriceHtml').html(result); 
                var priceTax = result.addtional['GSTAmount']; // Tax
                var sumRoomWise = result.addtional['MyCost']; // TotalPrice
                var MaxDiscountPackage = result.addtional['MaxDiscountPackage']; // TotalPrice
                var PriceCommission = result.addtional['PriceCommission']; // TotalPrice
                var priceGT = result.addtional['AmountWithGST']; // GrandTotal
                var TaxTypeTitle = result.addtional['TaxTypeTitle'];
                var priceTaxFormatted, priceBCFormatted, priceGTFormatted, priceCommissionFormatted = '';
                priceTaxFormatted = rvMoneyFormatINR(priceTax, 2, null);
                priceBCFormatted = rvMoneyFormatINR(sumRoomWise, 2, null);
                priceGTFormatted = rvMoneyFormatINR((priceGT), 2, null);
                priceCommissionFormatted = rvMoneyFormatINR((PriceCommission), 2, null);

                if (result.markupStatus == true) {
                    $('.viewCheckRateProposal' + parseInt(pkg)).html(viewCheckRateProposal).hide();
                    $('.viewRequestProposal' + parseInt(pkg)).html('Request Proposal').hide();
                    $('.viewCheckRateBook' + parseInt(pkg)).html('Book Now').hide();
                    $('.viewCheckRateCopy' + parseInt(pkg)).html('Copy to clipboard').hide();
                    if (index != 3) {
                        $('.viewCheckRateProposalMsg' + parseInt(pkg)).html('Proposal Sent Successfully!!');
                    } 
                    $('#TPSysId' + parseInt(pkg)).val(0);
                    if (AgencyType == 3) {
                        $('.book_now_html_' + parseInt(pkg)).show();
                        $('.send_proposal_html_' + parseInt(pkg)).hide();
                        $('.viewCheckRateBookNow' + parseInt(pkg)).attr('href', result.Url);
                        $('.viewCheckDownloadPdf' + parseInt(pkg)).attr('href', '/detail/index/viewpdf/id/' + result.ProposalId + '/code/' + result.SecureCode + '/name/' + result.FullName);
                        $('.customerContact' + parseInt(pkg)).val(result.customerContact);
                        $('.getMessageBody' + parseInt(pkg)).val(result.whatsappmessage);

                    }
                    if (index == 3) {
                        window.open(result.Url, '_blank');
                    }
                } else if (parseInt(sumRoomWise) > 0) {
                    $('#totalBasicCost' + parseInt(pkg)).html(priceBCFormatted);
                    if (parseInt(priceTax) > 0) {

                        $('.totalTaxCostDiv').show();
                        $('.totalTaxTypeDiv').html(TaxTypeTitle);
                        $('#totalTaxCost' + parseInt(pkg)).html(priceTaxFormatted);
                    } else {
                        $('.totalTaxCostDiv').hide();
                    }
                    $('#MaxDiscountPackage' + parseInt(pkg)).val(MaxDiscountPackage);
                    $('#totalGrandCost' + parseInt(pkg)).html(priceGTFormatted);
                    $('#totalCommissionCost' + parseInt(pkg)).html(priceCommissionFormatted);
                    $('.viewCheckRateProposal' + parseInt(pkg)).html(viewCheckRateProposal);
                    $('.viewRequestProposal' + parseInt(pkg)).html('Request Proposal');
                    $('.viewCheckRateBook' + parseInt(pkg)).html('Book Now');
                    $('#TPSysId' + parseInt(pkg)).val(result.TPSysId);
                    $('.ratedetail' + parseInt(pkg)).show();
                    $('.preratedetail' + parseInt(pkg)).hide();
                    $('.ratedetailModify' + parseInt(pkg)).show();
                } else {
                    $('.ratedetail' + parseInt(pkg)).hide();
                    $('.preratedetail' + parseInt(pkg)).show();
                    $('#sucessMsgQueryDiv' + parseInt(pkg)).show();
                    $('.sucessMsgQuery' + parseInt(pkg)).html('Your query has been submitted successfully.').css({'color': 'green'});
                }


            } else if (result.status == 'error') {
                $('.viewCheckRateClass' + parseInt(pkg)).html('Check Rate');
                $('.viewCheckRateProposal' + parseInt(pkg)).html(viewCheckRateProposal);
                $('.viewRequestProposal' + parseInt(pkg)).html('Request Proposal');
                $('.viewCheckRateBook' + parseInt(pkg)).html('Book Now');
                $('.viewCheckRateCopy' + parseInt(pkg)).html('Copy to clipboard');
                $('#sucessMsgQueryDiv' + parseInt(pkg)).show();
                $('.sucessMsgQuery' + parseInt(pkg)).html(result.message).css({'color': 'red'});
            } else {
                $('.ratedetail' + parseInt(pkg)).hide();
                $('.preratedetail' + parseInt(pkg)).show();
                $('.viewCheckRateClass' + parseInt(pkg)).html('Check Rate');
                $('.viewRequestProposal' + parseInt(pkg)).html('Request Proposal').hide();
                $('.viewCheckRateProposal' + parseInt(pkg)).html(viewCheckRateProposal).hide();
                $('.viewCheckRateBook' + parseInt(pkg)).html('Book Now').hide();
                $('.viewCheckRateCopy' + parseInt(pkg)).html('Copy to clipboard').hide();
                $('#sucessMsgQueryDiv' + parseInt(pkg)).show();
                $('.sucessMsgQuery' + parseInt(pkg)).html('Your query has been submitted successfully.').css({'color': 'green'});
            }
        },
        error: function (result) {

        }
    });



}
function shareWithWhatsapp(url, PkgSysId) {
    var customerContact = $('.customerContact' + PkgSysId).val();
    var getMessageBody = $('.getMessageBody' + PkgSysId).val();
    window.open(url + 'send?phone=' + customerContact + '&text=' + getMessageBody, '_blank');
}
function multiCityQuery(that) {
    var pkg = $(that).attr('pkg');
    // alert(pkg); return false;

    var data = $('.checkRatePackageCustomizeForm' + parseInt(pkg)).serialize();
    console.log(data);
    var tpid = $('#packagetpid_' + parseInt(pkg)).val();
    $.ajax({
        url: SITEURL + 'gtxwebservices/send-enquiry/multi-city-query',
        type: 'POST',
        data: data + '&PkgSysId=' + parseInt(pkg) + '&package_tpid=' + tpid,
        dataType: 'json',
        beforeSend: function () {
            $('.multiCityQuery' + parseInt(pkg)).html('Wait..')
        },
        success: function (result) {
            $('.multiCityQuery' + parseInt(pkg)).html('Submit');
            $('.multiCityQueryMsg' + parseInt(pkg)).html('Query created successfully');
        },
        error: function (result) {

        }
    });



}
function EnquireQuery(that) {
    var pkg = $(that).attr('pkg');

    var data = $('.checkRatePackageEnquireForm' + parseInt(pkg)).serialize();
    // alert(data); return false;
    console.log(data);
    var tpid = $('#packagetpid_' + parseInt(pkg)).val();
    $.ajax({
        url: SITEURL + 'gtxwebservices/send-enquiry/multi-city-query',
        type: 'POST',
        data: data + '&PkgSysId=' + parseInt(pkg) + '&package_tpid=' + tpid,
        dataType: 'json',
        beforeSend: function () {
            $('.EnquireQuery' + parseInt(pkg)).html('Wait..')
        },
        success: function (result) {
            $('.EnquireQuery' + parseInt(pkg)).html('Submit');
            $('.EnquireQueryMsg' + parseInt(pkg)).html('Query created successfully');
        },
        error: function (result) {

        }
    });



}



function showCutomizeHtml(that) {
    $('.quoteCustomizeEnquire').slideUp("slow");
    var pkg = $(that).attr('pkg');
    $("#customizebooking" + parseInt(pkg)).slideDown('slow');
}
function closeCutomizeHtml(that) {
    var pkg = $(that).attr('pkg');
    $('#customizebooking' + parseInt(pkg)).slideUp("slow");
}

function showEnquireHtml(that) {
    $('.quoteCustomizeEnquire').slideUp("slow");
    var pkg = $(that).attr('pkg');
    $("#Enquirebooking" + parseInt(pkg)).slideDown('slow');
//	$(".EnquireItineraryDiv_" + parseInt(pkg)).focus();
//	$(".EnquireItineraryName_" + parseInt(pkg)).focus();
}
function closeEnquireHtml(that) {
    var pkg = $(that).attr('pkg');
    $('#Enquirebooking' + parseInt(pkg)).slideUp("slow");
}

$(document).ready(function () {
    $('#horizontalTab').easyResponsiveTabs({
        type: 'default', //Types: default, vertical, accordion           
        width: 'auto', //auto or any width like 600px
        fit: true, // 100% fit in a container
        closed: 'accordion', // Start closed if in accordion view
        activate: function (event) { // Callback function if tab is switched
            var $tab = $(this);
            var $info = $('#tabInfo');
            var $name = $('span', $info);
            $name.text($tab.text());
            $info.show();
        }
    });

});

$(document).ready(function () {
    $('[data-toggle="tooltip"]').tooltip();
});

(function ($) {
//	$(window).load(function () {
//		$("#content_1,#content_2").mCustomScrollbar();
//
//	});
})(jQuery);


$("#changebtn").click(function () {
    $("#chotel").slideDown('slow');

});


$("#bookingbtn").click(function () {
    $("#booking").slideDown('slow');

});
$("#bookingbtn1").click(function () {
    $("#booking").slideUp('slow');

});

$("#detailbtn").click(function () {
    $("#expanddetail").slideDown('slow');

});
$("#detailbtn1").click(function () {
    $("#expanddetail").slideUp('slow');

});

$("#enquirebtn").click(function () {
    $("#expandenquire").slideDown('slow');

});
$("#enquirebtn1").click(function () {
    $("#expandenquire").slideUp('slow');

});

$("#checkrate").click(function () {
    $(".ratedetail").slideDown('slow');

});

$(".travelerbox").click(function () {
    $(".roomBoxMain").toggle();
});

$("#addtins").click(function () {
    $("#addtinsDiv").toggle();
});


$("#detailbtn").click(function () {
    $("#expanddetail").slideDown('slow');

});
$("#detailbtn1").click(function () {
    $("#expanddetail").slideUp('slow');

});

$(document).ready(function () {
    $("#changehoteldetail").click(function () {
        $("#hoteldetail").slideDown("slow");
    });
});
$(document).ready(function () {
    $("#detailbtn2").click(function () {
        $("#hoteldetail").slideUp("slow");
    });
});
$(document).ready(function () {
    $("#mainhoteldetail").click(function () {
        $("#hoteldescription").slideDown("slow");
    });
});
$(document).ready(function () {
    $("#detailbtn3").click(function () {
        $("#hoteldescription").slideUp("slow");
    });
});
$(document).ready(function () {
    $("#sightseeingdetail").click(function () {
        $("#hoteldescription2").slideDown("slow");
    });
});
$(document).ready(function () {
    $("#sightdetailbtn3").click(function () {
        $("#hoteldescription2").slideUp("slow");
    });
});
$(document).ready(function () {
    $("#detailbtnn").click(function () {
        $("#expanddetail2").slideDown("slow");
    });
});
$(document).ready(function () {
    $("#sdetailbtn1").click(function () {
        $("#expanddetail2").slideUp("slow");
    });
});
$(document).ready(function () {
    $("#sighthoteldetail").click(function () {
        $("#sightdetail").slideDown("slow");
    });
});
$(document).ready(function () {
    $("#sightdetailbtn2").click(function () {
        $("#sightdetail").slideUp("slow");
    });
});
$(document).ready(function () {
    $("#cust").click(function () {
        $("#myModa1Customize1").hide("");
    });
});
$(document).ready(function () {
    $("#detailbtns").click(function () {
        $("#myModa1Customize1").hide("");
    });
});

var x, i, j, selElmnt, a, b, c;
/*look for any elements with the class "custom-select":*/
x = document.getElementsByClassName("custom-select");
for (i = 0; i < x.length; i++) {
    selElmnt = x[i].getElementsByTagName("select")[0];
    /*for each element, create a new DIV that will act as the selected item:*/
    a = document.createElement("DIV");
    a.setAttribute("class", "select-selected");
    a.innerHTML = selElmnt.options[selElmnt.selectedIndex].innerHTML;
    x[i].appendChild(a);
    /*for each element, create a new DIV that will contain the option list:*/
    b = document.createElement("DIV");
    b.setAttribute("class", "select-items select-hide");
    for (j = 0; j < selElmnt.length; j++) {
        /*for each option in the original select element,
         create a new DIV that will act as an option item:*/
        c = document.createElement("DIV");
        c.innerHTML = selElmnt.options[j].innerHTML;
        c.addEventListener("click", function (e) {
            /*when an item is clicked, update the original select box,
             and the selected item:*/
            var y, i, k, s, h;
            s = this.parentNode.parentNode.getElementsByTagName("select")[0];
            h = this.parentNode.previousSibling;
            for (i = 0; i < s.length; i++) {
                if (s.options[i].innerHTML == this.innerHTML) {
                    s.selectedIndex = i;
                    h.innerHTML = this.innerHTML;
                    y = this.parentNode.getElementsByClassName("same-as-selected");
                    for (k = 0; k < y.length; k++) {
                        y[k].removeAttribute("class");
                    }
                    this.setAttribute("class", "same-as-selected");
                    break;
                }
            }
            h.click();
        });
        b.appendChild(c);
    }
    x[i].appendChild(b);
    a.addEventListener("click", function (e) {
        /*when the select box is clicked, close any other select boxes,
         and open/close the current select box:*/
        e.stopPropagation();
        closeAllSelect(this);
        this.nextSibling.classList.toggle("select-hide");
        this.classList.toggle("select-arrow-active");
    });
}
function closeAllSelect(elmnt) {
    /*a function that will close all select boxes in the document,
     except the current select box:*/
    var x, y, i, arrNo = [];
    x = document.getElementsByClassName("select-items");
    y = document.getElementsByClassName("select-selected");
    for (i = 0; i < y.length; i++) {
        if (elmnt == y[i]) {
            arrNo.push(i)
        } else {
            y[i].classList.remove("select-arrow-active");
        }
    }
    for (i = 0; i < x.length; i++) {
        if (arrNo.indexOf(i)) {
            x[i].classList.add("select-hide");
        }
    }
}
function modify_QuadPrice(room, adult_type, type) {
    var quad = '';

    if (adult_type == 0) {
        quad = 'twin';
    } else if (adult_type == 1) {
        quad = 'quad';
    } else if (adult_type == 2) {
        quad = 'quint';
    } else if (adult_type == 3) {
        quad = 'hexa';
    }
    var IsQuadCh = $('#adult_type_' + quad + '_' + room + '_' + type).prop('checked');
    $('.adult_type_' + room + '_' + type).prop('checked', false);
    $('#adult_sharing_html' + room + '_' + type).hide();
    var IsTwin = false;
    var IsQuad = false;
    var IsQuint = false;
    var IsHexa = false;
    if (IsQuadCh == true) {
        if (adult_type == 0) {
            IsTwin = true;
            $('#adult_type_twin_' + room + '_' + type).prop('checked', true);
        } else if (adult_type == 1) {
            IsQuad = true;
            $('#adult_type_quad_' + room + '_' + type).prop('checked', true);
        } else if (adult_type == 2) {
            IsQuint = true;
            $('#adult_type_quint_' + room + '_' + type).prop('checked', true);
        } else if (adult_type == 3) {
            IsHexa = true;
            $('#adult_type_hexa_' + room + '_' + type).prop('checked', true);
        }
    }
    $('.traveler_kids_div_' + type + room).hide();
    $('.childage_' + type + room + '_2').hide();
    $('.travelerLft_' + type + room).html('Kids (2 - 11Yrs)');
    if (IsTwin == false) {
        $('.traveler_adult_' + room).val(2);
    }
    $('.traveler_kids_div_' + type + room).val(0);
    $('.kidcls_' + type + room).val(0);
    $('.kidbedtype_' + type + room).hide();
    $('.infant_' + type + room).val(0);
    $('.adultbed_' + type + room).hide();
    var id123 = "traveler_adult_" + room + '_' + type;
    $("." + id123 + " option[value='5']").attr("hidden", true);
    $("." + id123 + " option[value='4']").attr("hidden", true);
    $("." + id123 + " option[value='6']").attr("hidden", true);
    if ($("." + id123).val() > 1) {
        $("." + id123).val(2);
    }
    if (IsQuad == true) {
        $("." + id123 + " option[value='4']").attr("hidden", false);
        $("." + id123).val(4);
        $('.traveler_kids_div_' + type + room).show();
        $('.travelerLft_' + type + room).html('Kids (2 - 4Yrs)');
    } else if (IsQuint == true) {
        $("." + id123 + " option[value='4']").attr("hidden", false);
        $("." + id123 + " option[value='5']").attr("hidden", false);
        $("." + id123).val(5);
        $('.traveler_kids_div_' + type + room).show();
        $('.travelerLft_' + type + room).html('Kids (2 - 4Yrs)');

    } else if (IsHexa == true) {
        $("." + id123 + " option[value='4']").attr("hidden", false);
        $("." + id123 + " option[value='5']").attr("hidden", false);
        $("." + id123 + " option[value='6']").attr("hidden", false);
        $("." + id123).val(6);
        $('.traveler_kids_div_' + type + room).show();
        $('.travelerLft_' + type + room).html('Kids (2 - 4Yrs)');
    } else {
        if ($("." + id123).val() == 1) {
            $('#adult_sharing_html' + room + '_' + type).show();
        }
    }
}
/*if the user clicks anywhere outside the select box,
 then close all select boxes:*/
document.addEventListener("click", closeAllSelect);

function showGetQuoteHtml(that, type) {
    $('.quoteCustomizeEnquireForms').slideUp("slow");
    var pkg = $(that).attr('pkg');
    //$('#booking'+parsforEnquiryDataIdeInt(pkg)).slideUp("slow");
    var data = $('#forEnquiryDataId' + parseInt(pkg)).val();
    $.ajax({
        url: SITEURL + 'holidays/search-result/get-enquiry-form',
        type: 'POST',
        data: 'data=' + data + '&PkgSysId=' + parseInt(pkg) + '&type=' + type,
        dataType: 'html',
        beforeSend: function () { },
        success: function (result) {
            if (type == 1) {
                $("#booking" + parseInt(pkg)).html(result).slideDown('slow').focus();

            } else if (type == 2) {
                $("#customizebooking" + parseInt(pkg)).html(result).slideDown('slow').focus();
            } else {
                $("#Enquirebooking" + parseInt(pkg)).html(result).slideDown('slow').focus();
            }
            var hotelTypeElementClass = $('.hotelTypeElementClass_' + parseInt(pkg) + ':checked').val();
            $('#hotelTypeElementId_' + parseInt(pkg) + '_' + hotelTypeElementClass).click();
        },
        error: function (result) {

        }
    });
}
function closeGetQoute(that) {
    var pkg = $(that).attr('pkg');

    $('#booking' + parseInt(pkg)).slideUp("slow");
}

function showDynamicCustomizePopup(that) {
    var pkg = $(that).attr('pkg');
    var noofNights = $('#noofNights_' + parseInt(pkg)).val();
    var gtxpackage = $('#gtxpackage_' + parseInt(pkg)).val();
    var hotelcategoryid = $('#hotelcategoryid_' + parseInt(pkg)).val();
    var DestinationsId = $('#DestinationsId_' + parseInt(pkg)).val();
    var SourcePlaceSysId = $('#SourcePlaceSysId_' + parseInt(pkg)).val();
    var DestinationPlacesSysId = $('#DestinationPlacesSysId_' + parseInt(pkg)).val();
    var SourcePlace = $('#SourcePlace_' + parseInt(pkg)).val();
    var DestinationPlaces = $('#DestinationPlaces_' + parseInt(pkg)).val();
    var CountryIds = $('#CountryIds_' + parseInt(pkg)).val();
    var package_destination_night_detail_ = $('#package_destination_night_detail_' + parseInt(pkg)).val();
    var my_custom_select_field_ = $('#my_custom_select_field_' + parseInt(pkg)).val();
    var IsFixedDeparturePackage = $('#IsFixedDeparturePackage_' + parseInt(pkg)).val();
    var fixdeparture_destinations = $('.fixdeparture-destinations' + parseInt(pkg)).val();
    var fixdeparture_dates = $('.fixdeparture-dates' + parseInt(pkg) + '_' + parseInt(fixdeparture_destinations)).html();
    var destinationname = $('.fixdeparture-destinations' + parseInt(pkg) + ' option:selected').attr('destinationname');
    var datehtml = '<input type="text" name="date" id="calendarDynamic1" class="form-control" placeholder="dd/mm/yy" aria-label="Enter destination">';
    if (IsFixedDeparturePackage == 1) {
        datehtml = '<select class="form-control" name="date" id="calendarDynamic1">' + fixdeparture_dates + '</select>';
        SourcePlaceSysId = fixdeparture_destinations;
        SourcePlace = destinationname;
    }
    var hotelid = ($('#hotelid_' + parseInt(pkg) + my_custom_select_field_).val() != '') ? $('#hotelid_' + parseInt(pkg) + my_custom_select_field_).val() : 0;
    var html = '<div class="travelerboxMain hotel_select1_inner hotel_select1_inner-details"><div class="travel-box_cls travelerbox' + pkg + ' travelerboxDynamicCustom" id="travelers" onclick="opentravelerboxDynamicCustom()"><div class="t-box-cls hotel_check form-control dt-selct-white shadow">' +
            '<span class="flight-t-box"><span class="RoomsTotal" id="numberofroom4' + pkg + '">1</span> Room(s),<span class="GuestTotal" id="roomguest4' + pkg + '">2</span> Guests' +
            '</span></div></div><div class="roomBoxMain roomBoxMainDynamicCustom"><div class="roomBoxMainIn"><div class="roomBoxMainScroll roomBoxMainScroll2">';
    for (var mi = 1; mi <= 10; mi++) {
        var display = '';
        var crossBtn = '';
        var defaultAdult = 2;
        if (mi > 1) {
            display = 'display:none;';
            //crossBtn = '<a href="javascript:void(0)" class="close-panel1 pull-right" pkg="' + pkg + '" onclick="removeRoomDynamicCustomize(this)"><i class="fa fa-times text-gray"></i></a>';
            crossBtn = '<a class="disproom disproom4' + pkg + mi + ' disproom_4' + pkg + mi + '" style="cursor:pointer; " pkg="' + pkg + '" onclick="delroom(this,4,' + mi + ')">(x)</a>';
            defaultAdult = 0;
        }
        var htmlm1 = '';
        for (var mic = 1; mic <= 2; mic++) {
            htmlm1 += '<div class="travelerIn childage_4' + pkg + mi + '" id="childcl_4' + pkg + mi + '_' + mic + '" style="display:none;"><div class="travelerLft">CHILD ' + mic + ' BED TYPE</div><div class="travelerrght">' +
                    '<div id="child_age_4' + pkg + mi + '_' + mic + '"><select style="display: inline;" name="child' + mic + '_bed_type[]" class="form-control heightTrav" onchange="checkAdultBedType(this);"><option value="">Select</option>' +
                    '<option value="withoutbed">Without Bed</option><option value="extrabed">With Bed</option><option value="none">None</option></select> </div> </div> <div class="clear"></div> </div>';
        }


        html += '<div class="roomLoop" id="rmres_4' + pkg + mi + '" style="' + display + '"><div class="roomLoop_title_best queryGroupData">Room ' + mi + crossBtn + '</div>' +
                '<div class="travelerIn"><div class="travelerLft">ADULTS (+12 YRS)</div><div class="travelerrght" id="adultgroup_4' + mi + '">' +
                '<select style="display: inline;" id="adult_4' + pkg + mi + '" name="adult[]" class="form-control counttraveler heightTrav form_input_spac" pkg="' + pkg + '" placeholder="Select" onchange="showextrabedbox(this,4,' + mi + ');"><option value="1" >1</option><option value="2" selected>2</option><option value="3" $selected>3</option></select>' +
                '</div><div class="clear"></div></div>' +
                '<div class="travelerIn  "><div class="travelerLft ">CHILDREN(0 - 11YRS)</div><div class="travelerrght" id="childgroup_4' + mi + '">' +
                '<select style="display: inline;" onChange="showextrabedchildagebox(this,4,' + mi + ');" pkg="' + pkg + '" id="child_4' + pkg + mi + '" name="child[]" class="form-control counttravelerchild heightTrav" placeholder="Select"><option value="0" >0</option><option value="1" >1</option><option value="2" >2</option></select>' +
                '</div> <div class="clear"></div> </div><div class="travelerIn" id="infantgroup_4' + mi + '"><div class="travelerLft ">INFANT(0 - 2YRS)</div><div class="travelerrght ">' +
                '<select style="display: inline;" pkg="' + pkg + '" id="infant_4' + pkg + mi + '" name="infant[]" class="form-control counttravelerinfant heightTrav " placeholder="Select" onchange="tottravelerInRoom(this,4,' + mi + ');"><option value="0" >0</option><option value="1" >1</option><option value="2" >2</option></select>' +
                '</div> <div class="clear"></div> </div><div class="travelerIn GroupExtra adultcl_4' + pkg + mi + '_3" style="display:none;"> <div class="travelerLft">Adult Bedtype</div> <div class="travelerrght"> <div id="adultcl_4' + mi + '_3" class="small"><select style="display: inline;" name="adult_bed_type[]" class="form-control heightTrav" onchange="checkAdultBedType(this);">' +
                '<option value="">Select</option><option value="extrabed" selected>With Bed</option><option value="">Select</option><option value="withoutbed" selected>Without Bed</option></select> </div> </div> <div class="clear"></div> </div>' + htmlm1 +
                '<div class="clear"></div></div>';



//		html += '<div class="room-1" id="RoomDynamicCustomize' + pkg + mi + '" style="' + display + '">' +
//			'<h1 class="no-mar-top ">Room ' + mi + ': ' + crossBtn + '</h1><div class="row"><div class="col-md-6">' +
//			'<label><strong>Adults </strong><span>(Above 12 years)</span></label>' +
//			'<div class="count-input space-bottom"> <a class="incr-btn" data-action="decrease_adult" href="#">–</a>' +
//			'<input class="quantityAdultDynamicCustom' + pkg + ' quantity" id="quantityAdultDynamicCustom' + pkg + mi + '" type="text" name="Adult[]" value="' + defaultAdult + '"/>' +
//			'<a class="incr-btn" data-action="increase_adult" href="#">&plus;</a> </div><div class="cl"></div></div>' +
//			'<div class="col-md-6"><label><strong>Children</strong> <span>(Below 12 years)</span></label>' +
//			'<div class="count-input space-bottom"> <a class="incr-btn" data-action="decrease_child" href="#">–</a>' +
//			'<input class="quantityChildDynamicCustom' + pkg + ' quantity" id="quantityChildDynamicCustom' + pkg + mi + '" type="text" name="Child[]" value="0"/>' +
//			'<a class="incr-btn" data-action="increase_child" href="#">&plus;</a> </div><div class="cl"></div></div>' +
//			'</div></div>';


    }
    html += '</div><div class="clearfix"></div><button class="btn-primary addroom" type="button" style="width:100%;" onClick="addroomlist(this,4)" pkg="' + pkg + '">Add more room</button><div class="clear" style="padding-bottom:0px"></div>' +
            '<div class="btn_form_align"><button type="button" class="pax-details btn-group-sm btn-outline btt-btn donemargin" pkg="' + pkg + '" onClick="tottraveller1(this,4);">Done</button></div></div></div></div>' +
            '<input type="hidden" name="room" id="roomlp4' + pkg + '" value="1"> <input type="hidden" name="totadlt" id="totadlt4' + pkg + '" value="2"> <input type="hidden" name="totchld" id="totchld4' + pkg + '" value="0"> <input type="hidden" name="totinfnt" id="totinfnt4' + pkg + '" value="0"> <input type="hidden" name="travelers" id="totaltravelers4' + pkg + '" value="2"> <input type="hidden" name="roominfojson" id="roominfojson4' + pkg + '" value=""></div>' +
            '  <input name="noofNights" value="' + noofNights + '" type="hidden"><input name="DestinationsIds" value="' + DestinationsId + '" type="hidden"><input name="hotelid" value=' + hotelid + ' type="hidden"><input name="hotelCategory" value=' + my_custom_select_field_ + ' type="hidden"><input name="SourcePlaceSysId" value=' + SourcePlaceSysId + ' type="hidden"><input name="DestinationPlacesSysId" value=' + DestinationPlacesSysId + ' type="hidden"><input name="SourcePlace" value=' + SourcePlace + ' type="hidden"><input name="DestinationPlaces" value=' + DestinationPlaces + ' type="hidden"><input name="CountryIds" value=' + CountryIds + ' type="hidden"><input name="pkg" value=' + pkg + ' type="hidden"><input name="gtxpackage" value=' + gtxpackage + ' type="hidden"><input name="hotelcategoryid" value=' + hotelcategoryid + ' type="hidden"><input name="package_destination_night_detail" value=' + package_destination_night_detail_ + ' type="hidden">';




    $('#myModalcustomizePackageHtml').html(html);
    $('#myModalcustomizePackageDates').html(datehtml);
    $('#myModalcustomizePackage').modal('show');
    $("#calendarDynamic1").datepicker({dateFormat: 'dd/mm/yy', minDate: 0});

//        var abc = '</div><div class="cl"><span class="pull-left">' +
//		'<a href="javascript://" class=" btn btn-group-sm btn-outline btt-btn " pkg="' + pkg + '" onclick="addMoreRoomDynamicCustomize(this)">Add room</a></span>' +
//		'<span class="pull-right"> <a href="javascript://" class=" btn btn-group-sm btn-outline btt-btn " onclick="closeTravellersFormDynamicCustomize(this)" pkg="' + pkg + '">Done</a> </span>' +
//		'<div class="cl"></div>' +
//		'</div></div>  </div>';
}

function opentravelerboxDynamicCustom() {
    $('.roomBoxMainDynamicCustom').toggle();
}
$("#calendarDynamic").datepicker({dateFormat: 'dd/mm/yy', minDate: 0});

function dynamicCustomizePackageFunc() {

    var data = $('.dynamicCustomizePackage').serialize();
    $.ajax({
        url: SITEURL + 'holidays/search-result/get-customize-dynamic-package-detail',
        type: 'POST',
        data: data,
        dataType: 'html',
        beforeSend: function () { },
        success: function (result) {

            $('#myModalcustomizePackage').modal('hide');
            $('#customizeDynamicPackageDetailHtml').html(result);
            $('#customizeDynamicPackageDetail').modal('show');
        },
        error: function (result) {

        }
    });
}


function addChangeHotelDynamic(hotelId, nights, DestinationsId, checkInDate, checkOutDate, sequence) {
    var Price = $('#hotelPrice' + parseInt(hotelId)).val();
    var MEALPLANTYPEE = $('.MEALPLANTYPEE_' + parseInt(hotelId)).val();
    var ROOMTYPEE = $('.ROOMTYPEE_' + parseInt(hotelId)).val();
    var data = $('.dynamicCustomizePackage').serialize();
    $.ajax({
        url: SITEURL + 'holidays/search-result/get-hotel-list',
        type: 'POST',
        data: data + '&nightsNew=' + nights + '&DestinationsId=' + DestinationsId + '&checkInDate=' + checkInDate + '&checkOutDate=' + checkOutDate + '&hotelId=' + hotelId + '&Price=' + Price + '&MEALPLANTYPEE=' + MEALPLANTYPEE + '&ROOMTYPEE=' + ROOMTYPEE + '&sequence=' + sequence,
        dataType: 'html',
        beforeSend: function () { },
        success: function (result) {

            $('#changeHotelHtml').html(result);
            //        $('#changeHotel').show();
            $('#changeHotel').slideDown("slow");
        },
        error: function (result) {

        }
    });
}
function changePreviousHotel(hoteljson, hotelId, sequence) {
    //  alert(hotelId)
    $.ajax({
        url: SITEURL + 'holidays/search-result/get-hotel-data-by-id',
        type: 'POST',
        data: '&hoteljson=' + hoteljson + '&prehotelId=' + hotelId + '&sequence=' + sequence,
        dataType: 'html',
        beforeSend: function () { },
        success: function (result) {
            $('#appendHotelonChangeHtml' + parseInt(hotelId) + parseInt(sequence)).html(result);
            $('.addChangeHotelDynamic' + parseInt(hotelId)).html('Change Hotel');
            calculateDynamicPackageprice();
        },
        error: function (result) {

        }
    });
}
function calculateDynamicPackageprice() {
    var price = 0;
    $("input[id^='hotelPrice']").each(function (i) {
        price = parseInt(parseInt(price) + parseInt($(this).val()));
    })
    var flightCostwithmarkup = $('#flightCostwithmarkup').val();
    var mprice = $('#mprice').val();
    var sightseeingprice = $('#sightseeingprice').val();

    var TransferCost = 0;
    $('.transportSelectCheck').each(function (e) {
        if ($(this).prop("checked") == true) {
            var routevechsysid = parseInt($(this).attr('routevechsysid'));
            var routesysid = parseInt($(this).attr('routesysid'));
            TransferCost = parseInt(parseInt(TransferCost) + parseInt($('.Cost' + parseInt(routesysid) + '_' + parseInt(routevechsysid)).val()));
        }
    })
    var finalhotelPrice = parseInt(price) + parseInt(flightCostwithmarkup) + parseInt(mprice) + parseInt(sightseeingprice) + parseInt(TransferCost);

    $('.finalPriceHtml').html(finalhotelPrice);
    $('.finalhotelPrice').val(finalhotelPrice);
}

function closeHotelList() {
    $('#changeHotel').slideUp("slow");
}

function saveCustomizeDynamicData(type) {

    var data = $('.saveCustomizeDynamicDataForm').serialize();
    previewCustomizePackageData(2);
    $.ajax({
        url: SITEURL + 'holidays/search-result/save-customize-dynamic-data',
        type: 'POST',
        data: data,
        dataType: 'json',
        beforeSend: function () {
            $('.saveCustomizeDynamicBtn' + type).html('Please Wait...').attr('disabled', true);
        },
        success: function (result) {

            if (result.status == 'success') {
                if (result.TPSysId != '') {
                    if (type == 2) {
                        window.location.href = result.Url;
                    } else {
                        $('.msgSuccess').html('Proposal Sent Successfully.');
                        alert('Proposal Sent Successfully.');
                    }


                } else {
                    $('.msgSuccess').html('Customized Successfully.');
                    alert('Customized Successfully.');
                }

            } else {
                alert('Customized Successfully.');
            }
            $('.saveCustomizeDynamicBtn1').html('Get Quote');
            $('.saveCustomizeDynamicBtn2').html('Book Now');

        },
        error: function (result) {

        }
    });

}


function selectTransportVehicle(that, RouteVechSysId) {
    var totalcapacity = 0;
    var TotalAdultChild = parseInt($('#TotalAdultChild').val());
    if ($(that).prop('checked') == true) {

        $('.transportSelectCheck').each(function (e) {
            if ($(this).prop("checked") == true) {
                var noofVehicles = $('.noofVehicles' + parseInt($(this).attr('routevechsysid'))).val();
                var capacity = parseInt($(this).attr('capacity'));
                var capacityT = (parseInt(capacity) * parseInt(noofVehicles));
                totalcapacity += parseInt(parseInt(capacityT) - parseInt(capacity));

            }
        })

        if (totalcapacity > TotalAdultChild) {
            alert('Can Not Select');
            $(that).prop('checked', false);
            return false;
        } else {
            $('.noofVehicles' + parseInt(RouteVechSysId)).val(1);


        }
    }

    calculateDynamicPackageprice();

}
function changeNoofVehicle(that, RouteVechSysId) {
    var totalcapacity = 0;
    var TotalAdultChild = parseInt($('#TotalAdultChild').val());
    $('.transportSelectCheck').each(function (e) {
        if ($(this).prop("checked") == true) {
            var noofVehicles = $('.noofVehicles' + parseInt($(this).attr('routevechsysid'))).val();
            var capacity = parseInt($(this).attr('capacity'));
            var capacityT = (parseInt(capacity) * parseInt(noofVehicles));
            totalcapacity += parseInt(capacityT - capacity);

        }
    })

    if (totalcapacity > TotalAdultChild) {
        alert('Can Not Select');
        $(that).val(1);
        return false;
    } else {

    }
    var price = $('.finalhotelPrice').val();
    var Cost = 0;
    $('.transportSelectCheck').each(function (e) {
        if ($(this).prop("checked") == true) {
            var routevechsysid = parseInt($(this).attr('routevechsysid'));
            var routesysid = parseInt($(this).attr('routesysid'));
            Cost = parseInt(parseInt(Cost) + $('.Cost' + parseInt(routesysid) + '_' + parseInt(routevechsysid)).val());
        }
    })
    $('.finalPrice').val(parseInt(price) + parseInt(Cost));
    $('.finalPriceHtml').html(parseInt(price) + parseInt(Cost));
}
function previewCustomizePackageData(type) {
    var TPSysId = $('#tpsysid').val();
    var data = $('.saveCustomizeDynamicDataForm').serialize();
    $.ajax({
        url: SITEURL + 'holidays/search-result/preview-customize-dynamic-data',
        type: 'POST',
        data: data + '&TPSysId=' + TPSysId,
        dataType: 'json',
        beforeSend: function () {
            if (type == 1) {
                $('.previewCustomizeDynamicBtn').html('Please Wait...').attr('disabled', true);
            }
        },
        success: function (result) {
            if (result.status == true) {
                if (type == 1) {
                    $('.msgSuccess').html('Data Saved Successfully.');
                }

                //alert(result.TPSysId)
                $('#tpsysid').val(result.TPSysId);
                var custom_detail_link_ = $('.custom_detail_link_' + parseInt($('#pkg').val())).val();
                if (type == 1) {
                    window.open('dynamic' + custom_detail_link_ + parseInt(result.TPSysId) + '.html', '_blank');
                }

            }
            $('.previewCustomizeDynamicBtn').html('Preview').attr('disabled', false);

        },
        error: function (result) {

        }
    });
}
changeHotelType = function (that) {
    // alert("test");
    var categoryName = $(that).val();
    var PkgSysId = $(that).attr('PkgSysId');
    $('#hotelTypeElementId_' + parseInt(PkgSysId) + '_' + categoryName).click();

};
function changeFlightDestination(that, type) {
    var PkgSysId = $(that).attr('PkgSysId');
    var destinationId = $(that).val();
    var destinationName = $('.fixdeparture-destinations' + parseInt(PkgSysId) + ' option:selected').attr('destinationname');
    $('.packageFlightDetail' + parseInt(PkgSysId)).hide();
    $('.packageFlightDetail' + parseInt(PkgSysId) + parseInt(destinationId)).show();

    if (type == 1) {

        var hotelTypeElementClass = $('.hotelTypeElementClass_' + parseInt(PkgSysId) + ':checked').val();
        $('#hotelTypeElementId_' + parseInt(PkgSysId) + '_' + hotelTypeElementClass).click();
        var my_custom_select_field = $('#my_custom_select_field_' + parseInt(PkgSysId)).val();
        $('#my_custom_select_field_' + parseInt(PkgSysId)).val(my_custom_select_field);
    } else {
        var FixedDepartureFlightPrice = $('.fixdeparture-destinations' + parseInt(PkgSysId) + ' option:selected').attr('costval');
        var perAdultPrice_ = $('#original_pkgprice_' + parseInt(PkgSysId)).val();
        if (!isNaN(FixedDepartureFlightPrice)) {
            perAdultPrice_ = parseInt(perAdultPrice_) + parseInt(FixedDepartureFlightPrice);
        }
        var x = perAdultPrice_;
        var perAdultPrice_ = x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
        $('.pkgprice_html_' + parseInt(PkgSysId)).html(perAdultPrice_);
        $('#from_destination_id').val(destinationId);
        $('#from_destination').val(destinationName);
    }

    $('.FlightDestinationWiseDates' + PkgSysId).addClass('display-none-class');
    $('.FlightDestinationWiseDates' + PkgSysId + '_' + destinationId).removeClass('display-none-class');
}
;
$(".sendingrequestCallbackDetails").on('submit', function (e) {


    var EmailReg = new RegExp(/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/);
    e.preventDefault();
    var data = $(".sendingrequestCallbackDetails").serialize();
    var mleadsend = $("#mleadsendD").val();

    if ($('.sendingrequestCallbackDetails input[name="fname"]').val() == '') {
        $('.msgrequest').show().html('Please enter your first name').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetails input[name="fname"]').focus();
        return false;
    }
    if ($('.sendingrequestCallbackDetails input[name="email"]').val() == '') {
        $('.msgrequest').show().html('Please enter your email id').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetails input[name="email"]').focus();
        return false;
    }
    if (!EmailReg.test($('.sendingrequestCallbackDetails input[name="email"]').val())) {
        $('.msgrequest').show().html('Please enter valid email address!!!').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetails input[name="email"]').focus();
        return false;
    }
    if ($('.sendingrequestCallbackDetails input[name="mobile"]').val() == '') {
        $('.msgrequest').show().html('Please enter your Mobile').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetails input[name="mobile"]').focus();
        return false;
    }

    if (!$.isNumeric($('.sendingrequestCallbackDetails input[name="mobile"]').val())) {
        $('.msgrequest').show().html('Mobile should be numeric!!').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetails input[name="mobile"]').focus();
        return false;
    }
    if ($('.sendingrequestCallbackDetails input[name="mobile"]').val().length != '10') {
        $('.msgrequest').show().html('Mobile should be 10 digit?').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetails input[name="mobile"]').focus();
        return false;
    }

    $('.msgrequest').html('');
    //$('.sendingrequestDetails').attr('disabled', true);
    if (mleadsend == 1) {
        var PlanType = $('.sendingrequestCallbackDetails input[name="PlanType"]:checked').val();

//alert(PlanType);
        if (PlanType == 1) {
            if ($('.sendingrequestCallbackDetails input[name="Destination_flight"]').val() == '') {
                $('.msgrequest').show().html('Please enter your source city..').css('color', 'red').fadeIn().delay(5000).fadeOut();
                $('.sendingrequestCallbackDetails input[name="Destination_flight"]').focus();
                return false;
            }
            if ($('.sendingrequestCallbackDetails input[name="ToDestination"]').val() == '') {
                $('.msgrequest').show().html('Please enter your destination city..').css('color', 'red').fadeIn().delay(5000).fadeOut();
                $('.sendingrequestCallbackDetails input[name="ToDestination"]').focus();
                return false;
            }
            if ($('.sendingrequestCallbackDetails input[name="traveldate_flight"]').val() == '') {
                $('.msgrequest').show().html('Please enter your travel date').css('color', 'red').fadeIn().delay(5000).fadeOut();
                $('.sendingrequestCallbackDetails input[name="traveldate_flight"]').focus();
                return false;
            }

        } else if ((PlanType == 5) || (PlanType == 6) || (PlanType == 9) || (PlanType == 6) || (PlanType == 11)) {
            if ($('.sendingrequestCallbackDetails input[name="travel_date"]').val() == '') {
                $('.msgrequest').show().html('Please enter your travel date').css('color', 'red').fadeIn().delay(5000).fadeOut();
                $('.sendingrequestCallbackDetails input[name="travel_date"]').focus();
                return false;
            }

        } else if ((PlanType == 2)) {
            if ($('.sendingrequestCallbackDetails input[name="checkInDate"]').val() == '') {
                $('.msgrequest').show().html('Please enter your checkIn date').css('color', 'red').fadeIn().delay(5000).fadeOut();
                $('.sendingrequestCallbackDetails input[name="checkInDate"]').focus();
                return false;
            }
            if ($('.sendingrequestCallbackDetails input[name="checkOutDate"]').val() == '') {
                $('.msgrequest').show().html('Please enter your Checkout date').css('color', 'red').fadeIn().delay(5000).fadeOut();
                $('.sendingrequestCallbackDetails input[name="checkOutDate"]').focus();
                return false;
            }

        }
        if (PlanType != 7) {
            if ($('.sendingrequestCallbackDetails input[name="noofpax"]').val() == '') {
                $('.msgrequest').show().html('Please enter travellers').css('color', 'red').fadeIn().delay(5000).fadeOut();
                $('.sendingrequestCallbackDetails input[name="noofpax"]').focus();
                return false;
            }
        }

        if (PlanType != 1 && PlanType != 7) {
            if ($('.sendingrequestCallbackDetails input[name="noofdays"]').val() == '') {
                $('.msgrequest').show().html('Please enter no of days').css('color', 'red').fadeIn().delay(5000).fadeOut();
                $('.sendingrequestCallbackDetails input[name="noofdays"]').focus();
                return false;
            }
        }


        $.ajax({url: SITEURL + 'cms/index/send-query-details', type: 'POST', data: data, dataType: 'json', beforeSend: function () {
                $('.sendingrequestDetails').val(' Please Wait...');
            }, success: function (result) {
                if (result.status) {

                    $('.sendingrequestDetails').val('Submit').attr('disabled', false);
                    $('.msgrequest').html(result.message).css({'color': 'green'}).fadeIn().delay(10000).fadeOut();
                } else {
                    $('.sendingrequestDetails').val('Submit').attr('disabled', false);
                    $('.msgrequest').html(result.message);
                }


            }, error: function (result) {
                $('.sendingrequestDetails').val('Submit').attr('disabled', false);
                alert('Some error occured.');
            }});
    } else {
        $("#mleadsendD").val(1);
        $('.enquiryFormHiddenDataD').show();

    }

});


// =======================//
$(".sendingrequestCallbackDetailspkg").on('submit', function (e) {


    var EmailReg = new RegExp(/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/);
    e.preventDefault();
    var data = $(".sendingrequestCallbackDetailspkg").serialize();
    // alert(data); return false;
    var mleadsend = $("#mleadsendD").val();

    if ($('.sendingrequestCallbackDetailspkg input[name="fname"]').val() == '') {
        $('.msgrequest').show().html('Please enter your first name').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailspkg input[name="fname"]').focus();
        return false;
    }
    if ($('.sendingrequestCallbackDetailspkg input[name="email"]').val() == '') {
        $('.msgrequest').show().html('Please enter your email id').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailspkg input[name="email"]').focus();
        return false;
    }
    if (!EmailReg.test($('.sendingrequestCallbackDetailspkg input[name="email"]').val())) {
        $('.msgrequest').show().html('Please enter valid email address!!!').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailspkg input[name="email"]').focus();
        return false;
    }
    if ($('.sendingrequestCallbackDetailspkg input[name="mobile"]').val() == '') {
        $('.msgrequest').show().html('Please enter your Mobile').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailspkg input[name="mobile"]').focus();
        return false;
    }

    if (!$.isNumeric($('.sendingrequestCallbackDetailspkg input[name="mobile"]').val())) {
        $('.msgrequest').show().html('Mobile should be numeric!!').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailspkg input[name="mobile"]').focus();
        return false;
    }
    if ($('.sendingrequestCallbackDetailspkg input[name="mobile"]').val().length != '10') {
        $('.msgrequest').show().html('Mobile should be 10 digit?').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailspkg input[name="mobile"]').focus();
        return false;
    }


    $('.msgrequest').html('');
    //$('.sendingrequestDetails').attr('disabled', true);
    if ($('.sendingrequestCallbackDetailspkg input[name="destination"]').val() == '') {
        $('.msgrequest').show().html('Please enter city name.').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailspkg input[name="destination"]').focus();
        return false;
    }

    if (mleadsend == 1) {
        if ($('.sendingrequestCallbackDetailspkg input[name="travel_date"]').val() == '') {
            $('.msgrequest').show().html('Please enter your travel date').css('color', 'red').fadeIn().delay(5000).fadeOut();
            $('.sendingrequestCallbackDetailspkg input[name="travel_date"]').focus();
            return false;
        }
        if ($('.sendingrequestCallbackDetailspkg input[name="noofpax"]').val() == '') {
            $('.msgrequest').show().html('Please enter travellers').css('color', 'red').fadeIn().delay(5000).fadeOut();
            $('.sendingrequestCallbackDetailspkg input[name="noofpax"]').focus();
            return false;
        }
        if ($('.sendingrequestCallbackDetailspkg input[name="noofdays"]').val() == '') {
            $('.msgrequest').show().html('Please enter no of days').css('color', 'red').fadeIn().delay(5000).fadeOut();
            $('.sendingrequestCallbackDetailspkg input[name="noofdays"]').focus();
            return false;
        }


        $.ajax({url: SITEURL + 'cms/index/send-query-detailsnew1', type: 'POST', data: data, dataType: 'json', beforeSend: function () {
                $('.sendingrequestDetails').val(' Please Wait...');
            }, success: function (result) {
                if (result.status) {

                    $('.sendingrequestDetails').val('Submit').attr('disabled', false);
                    $('.msgrequest').html(result.message).css({'color': 'green'}).fadeIn().delay(10000).fadeOut();
                } else {
                    $('.sendingrequestDetails').val('Submit').attr('disabled', false);
                    $('.msgrequest').html(result.message);
                }


            }, error: function (result) {
                $('.sendingrequestDetails').val('Submit').attr('disabled', false);
                alert('Some error occured.');
            }});
    } else {
        $("#mleadsendD").val(1);
        $('.enquiryFormHiddenDataD').show();

    }

});


$(".sendingrequestCallbackDetailsFlight").on('submit', function (e) {
    // alert("Flight");
    var EmailReg = new RegExp(/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/);
    e.preventDefault();
    var data = $(".sendingrequestCallbackDetailsFlight").serialize();
    // var mleadsend = $("#mleadsendD").val();
//    alert(data);

    if ($('.sendingrequestCallbackDetailsFlight input[name="fname"]').val() == '') {
        $('.msgrequest').show().html('Please enter your first name').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailsFlight input[name="fname"]').focus();
        return false;
    }
    if ($('.sendingrequestCallbackDetailsFlight input[name="email"]').val() == '') {
        $('.msgrequest').show().html('Please enter your email id').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailsFlight input[name="email"]').focus();
        return false;
    }
    if (!EmailReg.test($('.sendingrequestCallbackDetailsFlight input[name="email"]').val())) {
        $('.msgrequest').show().html('Please enter valid email address!!!').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailsFlight input[name="email"]').focus();
        return false;
    }
    if ($('.sendingrequestCallbackDetailsFlight input[name="mobile"]').val() == '') {
        $('.msgrequest').show().html('Please enter your Mobile').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailsFlight input[name="mobile"]').focus();
        return false;
    }

    if (!$.isNumeric($('.sendingrequestCallbackDetailsFlight input[name="mobile"]').val())) {
        $('.msgrequest').show().html('Mobile should be numeric!!').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailsFlight input[name="mobile"]').focus();
        return false;
    }
    if ($('.sendingrequestCallbackDetailsFlight input[name="mobile"]').val().length != '10') {
        $('.msgrequest').show().html('Mobile should be 10 digit?').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailsFlight input[name="mobile"]').focus();
        return false;
    }

    if ($('.sendingrequestCallbackDetailsFlight input[name="from_city"]').val() == '') {
        $('.msgrequest').show().html('Please enter a from city').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailsFlight input[name="from_city"]').focus();

        return false;
    }

    if ($('.sendingrequestCallbackDetailsFlight input[name="to_city"]').val() == '') {
        $('.msgrequest').show().html('Please enter a to city').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailsFlight input[name="to_city"]').focus();

        return false;
    }

    if ($('.sendingrequestCallbackDetailsFlight input[name="check_in"]').val() == '') {
        $('.msgrequest').show().html('Please enter check in date').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailsFlight input[name="check_in"]').focus();

        return false;
    }

    if ($('.sendingrequestCallbackDetailsFlight input[name="noofpax"]').val() == '') {
        $('.msgrequest').show().html('Please enter Travellers').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailsFlight input[name="noofpax"]').focus();
        return false;
    }




    $.ajax({url: SITEURL + 'cms/index/send-query-detailsnew1', type: 'POST', data: data, dataType: 'json', beforeSend: function () {
            $('.sendingrequestDetails').val(' Please Wait...');
        }, success: function (result) {
            if (result.status) {

                $('.sendingrequestDetails').val('Submit').attr('disabled', false);
                $('.msgrequest').html(result.message).css({'color': 'green'}).fadeIn().delay(10000).fadeOut();
            } else {
                $('.sendingrequestDetails').val('Submit').attr('disabled', false);
                $('.msgrequest').html(result.message);
            }


        }, error: function (result) {
            $('.sendingrequestDetails').val('Submit').attr('disabled', false);
            alert('Some error occured.');
        }});


});



$(".sendingrequestCallbackDetailsHotel").on('submit', function (e) {
    // alert("hotel");
    var EmailReg = new RegExp(/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/);
    e.preventDefault();
    var data = $(".sendingrequestCallbackDetailsHotel").serialize();
    // var mleadsend = $("#mleadsendD").val();
//    alert(data);

    if ($('.sendingrequestCallbackDetailsHotel input[name="fname"]').val() == '') {
        $('.msgrequest').show().html('Please enter your first name').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailsHotel input[name="fname"]').focus();
        return false;
    }
    if ($('.sendingrequestCallbackDetailsHotel input[name="email"]').val() == '') {
        $('.msgrequest').show().html('Please enter your email id').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailsHotel input[name="email"]').focus();
        return false;
    }
    if (!EmailReg.test($('.sendingrequestCallbackDetailsHotel input[name="email"]').val())) {
        $('.msgrequest').show().html('Please enter valid email address!!!').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailsHotel input[name="email"]').focus();
        return false;
    }
    if ($('.sendingrequestCallbackDetailsHotel input[name="mobile"]').val() == '') {
        $('.msgrequest').show().html('Please enter your Mobile').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailsHotel input[name="mobile"]').focus();
        return false;
    }

    if (!$.isNumeric($('.sendingrequestCallbackDetailsHotel input[name="mobile"]').val())) {
        $('.msgrequest').show().html('Mobile should be numeric!!').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailsHotel input[name="mobile"]').focus();
        return false;
    }
    if ($('.sendingrequestCallbackDetailsHotel input[name="mobile"]').val().length != '10') {
        $('.msgrequest').show().html('Mobile should be 10 digit?').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailsHotel input[name="mobile"]').focus();
        return false;
    }

    if ($('.sendingrequestCallbackDetailsHotel input[name="Destination"]').val() == '') {
        $('.msgrequest').show().html('Please enter a destination').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailsHotel input[name="Destination"]').focus();

        return false;
    }


    if ($('.sendingrequestCallbackDetailsHotel input[name="check_in"]').val() == '') {
        $('.msgrequest').show().html('Please enter check in date').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailsHotel input[name="check_in"]').focus();

        return false;
    }

    if ($('.sendingrequestCallbackDetailsHotel input[name="noofpax"]').val() == '') {
        $('.msgrequest').show().html('Please enter Travellers').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailsHotel input[name="noofpax"]').focus();
        return false;
    }




    $.ajax({url: SITEURL + 'cms/index/send-query-detailsnew1', type: 'POST', data: data, dataType: 'json', beforeSend: function () {
            $('.sendingrequestDetails').val(' Please Wait...');
        }, success: function (result) {
            if (result.status) {

                $('.sendingrequestDetails').val('Submit').attr('disabled', false);
                $('.msgrequest').html(result.message).css({'color': 'green'}).fadeIn().delay(10000).fadeOut();
            } else {
                $('.sendingrequestDetails').val('Submit').attr('disabled', false);
                $('.msgrequest').html(result.message);
            }


        }, error: function (result) {
            $('.sendingrequestDetails').val('Submit').attr('disabled', false);
            alert('Some error occured.');
        }});


});


$(".sendingrequestCallbackDetailSightseeing").on('submit', function (e) {
    // alert("hotel");
    var EmailReg = new RegExp(/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/);
    e.preventDefault();
    var data = $(".sendingrequestCallbackDetailSightseeing").serialize();
    // var mleadsend = $("#mleadsendD").val();
//    alert(data);

    if ($('.sendingrequestCallbackDetailSightseeing input[name="fname"]').val() == '') {
        $('.msgrequest').show().html('Please enter your first name').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailSightseeing input[name="fname"]').focus();
        return false;
    }
    if ($('.sendingrequestCallbackDetailSightseeing input[name="email"]').val() == '') {
        $('.msgrequest').show().html('Please enter your email id').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailSightseeing input[name="email"]').focus();
        return false;
    }
    if (!EmailReg.test($('.sendingrequestCallbackDetailSightseeing input[name="email"]').val())) {
        $('.msgrequest').show().html('Please enter valid email address!!!').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailSightseeing input[name="email"]').focus();
        return false;
    }
    if ($('.sendingrequestCallbackDetailSightseeing input[name="mobile"]').val() == '') {
        $('.msgrequest').show().html('Please enter your Mobile').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailSightseeing input[name="mobile"]').focus();
        return false;
    }

    if (!$.isNumeric($('.sendingrequestCallbackDetailSightseeing input[name="mobile"]').val())) {
        $('.msgrequest').show().html('Mobile should be numeric!!').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailSightseeing input[name="mobile"]').focus();
        return false;
    }
    if ($('.sendingrequestCallbackDetailSightseeing input[name="mobile"]').val().length != '10') {
        $('.msgrequest').show().html('Mobile should be 10 digit?').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailSightseeing input[name="mobile"]').focus();
        return false;
    }

    // if($('.sendingrequestCallbackDetailSightseeing input[name="selectDestination"]').val()=='') { 
    // 	 $('.msgrequest').show().html('Please enter a destination').css('color', 'red').fadeIn().delay(5000).fadeOut();
    //      $('.sendingrequestCallbackDetailSightseeing input[name="selectDestination"]').focus();

    // 	return false;
    // }

    if ($('.sendingrequestCallbackDetails input[name="travel_dateS"]').val() == '') {
        $('.msgrequest').show().html('Please enter your travel date').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetails input[name="travel_date"]').focus();
        return false;
    }

    if ($('.sendingrequestCallbackDetailSightseeing input[name="costType"]').val() == '') {
        $('.msgrequest').show().html('Please select cost type').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailSightseeing input[name="costType"]').focus();
        return false;
    }



    if ($('.sendingrequestCallbackDetailSightseeing input[name="noofpax"]').val() == '') {
        $('.msgrequest').show().html('Please enter Travellers').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailSightseeing input[name="noofpax"]').focus();
        return false;
    }





    $.ajax({url: SITEURL + 'cms/index/send-query-detailsnew1', type: 'POST', data: data, dataType: 'json', beforeSend: function () {
            $('.sendingrequestDetails').val(' Please Wait...');
        }, success: function (result) {
            if (result.status) {

                $('.sendingrequestDetails').val('Submit').attr('disabled', false);
                $('.msgrequest').html(result.message).css({'color': 'green'}).fadeIn().delay(10000).fadeOut();
            } else {
                $('.sendingrequestDetails').val('Submit').attr('disabled', false);
                $('.msgrequest').html(result.message);
            }


        }, error: function (result) {
            $('.sendingrequestDetails').val('Submit').attr('disabled', false);
            alert('Some error occured.');
        }});


});



$(".sendingrequestCallbackDetailVisa").on('submit', function (e) {
    // alert("hotel");
    var EmailReg = new RegExp(/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/);
    e.preventDefault();
    var data = $(".sendingrequestCallbackDetailVisa").serialize();
    // var mleadsend = $("#mleadsendD").val();
    // alert(data);
    // return false;

    if ($('.sendingrequestCallbackDetailVisa input[name="fname"]').val() == '') {
        $('.msgrequest').show().html('Please enter your first name').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailVisa input[name="fname"]').focus();
        return false;
    }
    if ($('.sendingrequestCallbackDetailVisa input[name="email"]').val() == '') {
        $('.msgrequest').show().html('Please enter your email id').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailVisa input[name="email"]').focus();
        return false;
    }
    if (!EmailReg.test($('.sendingrequestCallbackDetailVisa input[name="email"]').val())) {
        $('.msgrequest').show().html('Please enter valid email address!!!').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailVisa input[name="email"]').focus();
        return false;
    }
    if ($('.sendingrequestCallbackDetailVisa input[name="mobile"]').val() == '') {
        $('.msgrequest').show().html('Please enter your Mobile').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailVisa input[name="mobile"]').focus();
        return false;
    }

    if (!$.isNumeric($('.sendingrequestCallbackDetailVisa input[name="mobile"]').val())) {
        $('.msgrequest').show().html('Mobile should be numeric!!').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailVisa input[name="mobile"]').focus();
        return false;
    }
    if ($('.sendingrequestCallbackDetailVisa input[name="mobile"]').val().length != '10') {
        $('.msgrequest').show().html('Mobile should be 10 digit?').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailVisa input[name="mobile"]').focus();
        return false;
    }

    if ($('.sendingrequestCallbackDetailVisa input[name="selectDestination"]').val() == '') {
        $('.msgrequest').show().html('Please enter a destination').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailVisa input[name="selectDestination"]').focus();

        return false;
    }

    if ($('.sendingrequestCallbackDetails input[name="travel_date2"]').val() == '') {
        $('.msgrequest').show().html('Please enter your travel date').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetails input[name="travel_date2"]').focus();
        return false;
    }


    if ($('.sendingrequestCallbackDetailVisa input[name="noofpax"]').val() == '') {
        $('.msgrequest').show().html('Please enter Travellers').css('color', 'red').fadeIn().delay(5000).fadeOut();
        $('.sendingrequestCallbackDetailVisa input[name="noofpax"]').focus();
        return false;
    }





    $.ajax({url: SITEURL + 'cms/index/send-query-detailsnew1', type: 'POST', data: data, dataType: 'json', beforeSend: function () {
            $('.sendingrequestDetails').val(' Please Wait...');
        }, success: function (result) {
            if (result.status) {

                $('.sendingrequestDetails').val('Submit').attr('disabled', false);
                $('.msgrequest').html(result.message).css({'color': 'green'}).fadeIn().delay(10000).fadeOut();
            } else {
                $('.sendingrequestDetails').val('Submit').attr('disabled', false);
                $('.msgrequest').html(result.message);
            }


        }, error: function (result) {
            $('.sendingrequestDetails').val('Submit').attr('disabled', false);
            alert('Some error occured.');
        }});


});




$(document).ready(function () {

    $("#selectDestination").autocomplete({
        source: function (request, response) {
            var query = $("#selectDestination").val();
            var countryId = '';
            $.getJSON("/index/autosuggest", {query: query, countryId: countryId},
                    response);
        },
        minLength: 2,
        autoFocus: true,
        select: function (event, ui) {
            var CityId = ui.item.CityId;
            var CityName = ui.item.CityName;

            $("#destinationDDId").val(CityId);
            //$("#hidden_selected_city_name").val(CityName);
        }
    });
});
function ExportExcelForm() {
    $(".ExportExcelForm").submit();
}
$('#search-form').on('submit', function () {
    var destinationBox = $('.destinationBox').val();

    if (destinationBox == '') {
        $('.select2-selection').css({'border': '2px solid red'}).effect("shake");
        ;
        return false;
    }
    window.location.href = SITEURL + 'holidays/search-result?des=' + destinationBox;
})
function addSightseeingInPackage(day, SSRefId, that) {
    var isAdded = $(that).attr('isAdded');
    var SightseeingCost = $('.SightseeingCost' + day + SSRefId).val();
    var sightseeingprice = $('#sightseeingprice').val();
    var sightseeingpriceNew = 0;
    if (isAdded == 0) {
        $('.IsIncludedClass' + day + SSRefId).val(1);
        $(that).attr('isAdded', 1);
        $(that).html('Remove');
        sightseeingpriceNew = parseInt(sightseeingprice) + parseInt(SightseeingCost);
    } else {
        $('.IsIncludedClass' + day + SSRefId).val(0);
        $(that).attr('isAdded', 0);
        $(that).html('Add');
        sightseeingpriceNew = parseInt(sightseeingprice) - parseInt(SightseeingCost);
    }
    $('#sightseeingprice').val(parseInt(sightseeingpriceNew));
    calculateDynamicPackageprice();


}
function copyToClipboard(text) {
    var tempElement = document.createElement('div');
    tempElement.innerHTML = text;
    document.body.appendChild(tempElement);
    var range = document.createRange();
    range.selectNode(tempElement);
    window.getSelection().removeAllRanges();
    window.getSelection().addRange(range);
    document.execCommand("copy");
    document.body.removeChild(tempElement);
    // alert("Email body copied to clipboard!");
    $('#clipboardId').val(0);
}
function validateDiscount(input, PkgSysId) {

    var MaxDiscountPackage = $('#MaxDiscountPackage' + PkgSysId).val();
    console.log(MaxDiscountPackage);
    let value = parseInt(input.value, 10);

    if (value > MaxDiscountPackage) {
        input.value = input.value.slice(0, -1);
        $('.viewCheckRateProposalMsg' + PkgSysId).html('Max Discount Allowed : ' + MaxDiscountPackage).css('color', 'red');
    } else {
        $('.viewCheckRateProposalMsg' + PkgSysId).html('');
        $('.sucessMsgQuery' + PkgSysId).html('');

    }

//        var extraDiscount = $('#extraDiscount'+PkgSysId).val();
//           
//        if(parseInt(extraDiscount) > parseInt(MaxDiscountPackage)){
//            $('.viewCheckRateProposalMsg'+PkgSysId).html('Max Discount Allowed : '+MaxDiscountPackage).css('color','red');
//            //$('#extraDiscount'+PkgSysId).val(0);
//            return false;
//        }else{
//            $('.viewCheckRateProposalMsg'+PkgSysId).html('');
//        } 

}

$('.invoiceDate').datepicker({
    dateFormat: 'dd/mm/yy',
    autoclose: true,
    todayBtn: true,
    minDate: 0
});


Youez - 2016 - github.com/yon3zu
LinuXploit