<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>Авиабилеты чартер поиск бронирование - funny aviabook</title>
    <link href="favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <link href="/Content/bootstrap/bootstrap.min.css" rel="stylesheet" />
    <link href="/Content/main.min.css?v=636549012185973537" rel="stylesheet" />
    <link href="/Content/font-awesome.min.css?v=636548496046713226" rel="stylesheet" />
    
    <link href="/Content/select2/select2.css" rel="stylesheet" />
    <link href="/Content/jquery_bootstrap-touchspin.min.css" rel="stylesheet" />
    <link href="/Content/bootstrap-datepicker3.standalone.min.css" rel="stylesheet" />
    <link href="/Content/index.min.css?v=636548526180122621" rel="stylesheet" />
    <link href="/Content/results.min.css?v=636372842814946444" rel="stylesheet" />

    <meta name="viewport" content="width=device-width" />
    
</head>
<body>
    <div id="body">        

<div id="header_wrap" class="container">
    <div id="header">
        <div id="top_head">
            <div class="logo"><a title="На главную" href="/"><img src="/images/logo2.png"></a>
                <p>+7 (495) 620 5 777</p>
            </div>
            <div class="mount"></div>
            
            <div class="lk">
            
                <a href="https://www.facebook.com/funnyavia/" target="_blank"><img src="/images/fb.png" width="40"></a>
                <a href="https://vk.com/aviafunny" target="_blank"><img src="/images/vk.png" width="40"></a>
            </div>
            
        </div>
        <div class="clearfix"></div>
        <div class="menu">
            <div class="menu_inner">
                <ul>
                    <li>
                        <a href="/airline-ticketing/"><span>Авиабилеты в Черногорию</span></a>
                        <ul class="podmenu">
                            <li><a href="/airline-ticketing/Tivat/">Тиват</a></li>
                            <li><a href="/airline-ticketing/Podgorica/">Подгорица</a></li>
                            <li><a href="/airline-ticketing/Regular/">Регулярные</a></li>
                            <li><a href="/airline-ticketing/Charter/">Чартеры</a></li>
                            <li><a href="/airline-ticketing/ostalnoy-mir/">Все рейсы в Черногорию</a></li>
                        </ul>
                    </li>
                    <li><a href="/Туры-в-Черногорию/"><span>Туры</span></a></li>
                    <li>
                        <a href="/tour/"><span>Топ 5 отелей</span></a>
                        <ul class="podmenu">
                            <li><a href="/tour/HotelSplendidConferenceSPABeachResort-copy/">Splendid Conference &amp; SPA Beach Resort 5*</a></li>
                            <li><a href="/tour/VillaMontenegro-copy/">Villa Montenegro 5</a></li>
                            <li><a href="/tour/азимут-copy/">Azimut 4*</a></li>
                            <li><a href="/tour/AvalaResortVillas-copy/">Avala Resort &amp; Villas 4+</a></li>
                            <li><a href="/tour/tarasentido-copy/">Sentido Tаrа Magnolia Villas 4</a></li>
                        </ul>
                    </li>
                    <li>
                        <a href="/about/"><span>О нас</span></a>
                        <ul class="podmenu">
                            <li><a href="/about/contacts/">Контакты</a></li>
                            <li><a href="/about/work-time/">Часы работы</a></li>
                        </ul>
                    </li>
                    <li><a href="/Видео-о-Черногории/"><span>Видео о Черногории</span></a></li>
                </ul>
            </div>
        </div>
    </div>
</div>
       <section>
            <div id="body-wrapper">
                



<form action="/results" class="" method="get"><input id="rt-mode" name="rt-mode" type="hidden" value="False" /><input id="iframe" name="iframe" type="hidden" value="" />    <div class="container search-cnt">
            <div class="row">
                <div class="col-sm-12">
                    <h1>Поиск  и  бронирование  авиабилетов онлайн на чартерные рейсы</h1>
                    
                </div>
            </div>
                    
            <div class="row">
                <div class="col-dep">
                    <div class="input-group">
                        <input type="hidden" name="cityFrom" value="" />
                        <input type="text" class="search-city" placeholder="Город вылета" autocomplete="off" id="cityFrom" />
                        <span class="input-group-btn grp">
                            <button class="btn switch" title="Поменять местами"></button>
                        </span>
                    </div>
                </div>
                <div class="col-arr">
                    <input type="hidden" name="cityTo" value="" />
                    <input type="text" class="search-city brd" placeholder="Город прилета" autocomplete="off" id="cityTo" />
                </div>
                <div class="col-cal-dep">
                    <div class="input-group">
                        <input type="text" class="search-cal" id="dtFrom" placeholder="Туда" autocomplete="off" name="dtFrom"
                               value="" />
                        <span class="input-group-btn grp">
                            <button class="btn glyphicon glyphicon-calendar"></button>
                            
                        </span>
                    </div>
                </div>
                <div class="col-cal-arr">
                    <div class="input-group">
                        <input type="text" class="search-cal" id="dtTo" placeholder="Обратно" autocomplete="off" name="dtTo" value="" />
                        <span class="input-group-btn grp2">
                            <button class="btn glyphicon glyphicon-calendar" title="Обратный перелет"></button>
                            
                        </span>
                    </div>
                </div>
            </div>
            <div class="row tourists">
                <div class="col-adult-sm">
                    <label for="adult" class="title">Взрослых</label>
                    <input type="text" id="adult" name="adult" value="1" />
                </div>
                <div class="col-child-sm">
                    <div class="cont">
                        <label for="child" class="title">Детей</label>
                        <div class="title2">2-11</div>
                    </div>
                    <input type="text" id="child" name="child" value="0" />
                </div>
                <div class="col-inf-sm">
                    <div class="cont">
                        <label for="inf" class="title">Младенцев</label>
                        <div class="title2">До 2-х лет</div>
                    </div>
                    <input type="text" id="inf" name="inf" value="0" />
                </div>
                <div class="col-currency-sm">
                    <select name="curSel" id="curSel">
                                <option  value="$">доллар</option>
                                <option  value="EU">евро</option>
                                <option selected value="рб">рубль</option>
                                <option  value="UA">гривна</option>

                    </select>
                </div>
                <div class="col-searchbtn-sm">
                    <button id="search-avia" name="showResult" value="true" class="btn btn-primary show-result" data-toggle="modal" data-target="#progressModal">
                        Найти билеты
                    </button>
                </div>
            </div>
            


    </div>
</form>
<div class="container hidden" id="searchresults">
    <div class="progress">
        <div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">
            <span class="sr-only">0% Complete</span>
        </div>
    </div>
    <div class="row eightcolumns hidden-xs">
        <div class="col-sm-2 corner" data-bind="visible: RT">
            <img src="/content/img/tbl-corner.jpg" class="" alt="" />
        </div>
        <!-- ko foreach: ColumnDates -->
        <div class="col-sm-2 cell-h" data-bind="text: moment($data).format('DD.MM.YYYY, dd')"></div>
        <!-- /ko -->
    </div>
    <!-- ko foreach: Rows -->
    <div class="row eightcolumns">
        <div class="col-sm-2 cell-v" data-bind="visible: Matrix.RT"><span class="visible-xs-inline">Вылет</span><span data-bind="text: moment(DT).format('DD.MM.YYYY, dd')"></span></div>
        <!-- ko foreach: Columns -->
        <div class="col-sm-2" data-bind="css: {'cell-f':$index() == 0, 'cell':$index() > 0, 'cell-fl':$parentContext.$index()==0, 'cell-sl':$parentContext.$index()>0, 'active':Selected}" matrixcell>
            
            <!-- ko if: Offers().length > 0 -->
            <button class="btn price-btn" type="submit" name="selected" data-bind="value: 'dtFwd=' + moment($data).format('DD.MM.YYYY'), click: Select">
                <span class="visible-xs-inline" data-bind="text: Best?moment(Best.CheckInDate).format('DD.MM.YYYY'):''">

                </span>
                <span data-bind="if: Offers().length > 1">от</span>
                <!--<pre data-bind="text: ko.toJSON(Best(), null, 2)"></pre>-->
                <span class="price" data-bind="text: FormatPrice($('#curSel').val(), 'рб')"></span><br />
                <span class="var" data-bind="if: Offers().length > 1">Вариантов: <span data-bind="text: Offers().length"></span></span>
            </button>
            <!-- /ko -->
        </div>
        <!-- /ko -->
    </div>
    <!-- /ko -->
    <!--ko foreach: Selected-->
    <div class="row offer-detail" id="scroll">
        <div class="col-sm-12">
            <!--ko foreach: Directions-->
            <div class="row hdr">
                <div class="col-sm-12 airline">
                    <span data-bind="text: Segments[0].Airline.Name"></span>
                    <span data-bind="text: '{0} {1}'.format(Segments[0].FlightNumber, Segments[0].Airline.Code)"></span>
                    <span data-bind="text: Segments[0].AirService?Segments[0].AirService.Name:''"></span>
                    <span data-bind="text: Segments[0].PlaneInfo?Segments[0].PlaneInfo.Name:''"></span>
                </div>
            </div>
            <div class="row segment">
                <div class="col-sm-12">
                    <div class="row">
                        <div class="col-sm-2 visible-sm"></div>
                        <div class="col-sm-3 col-xs-6 lbl">Вылет</div>
                        <div class="col-sm-3 col-xs-6 lbl">Прибытие</div>
                    </div>
                    <div class="row">
                        <div class="col-sm-2 text-right lbl visible-sm">Дата</div>
                        <div class="col-sm-3 col-xs-6" data-bind="text: moment(Segments[0].DepartureDate).format('D MMMM, dd')"></div>
                        <div class="col-sm-3 col-xs-6" data-bind="text: moment(Segments[0].ArrivalDate).format('D MMMM, dd')"></div>
                    </div>
                    <div class="row">
                        <div class="col-sm-2 text-right lbl visible-sm">Время</div>
                        <div class="col-sm-3 col-xs-6 time" data-bind="text: Segments[0].DepartureTime"></div>
                        <div class="col-sm-3 col-xs-6 time" data-bind="text: Segments[0].ArrivalTime"></div>
                    </div>
                    <div class="row">
                        <div class="col-sm-2 text-right lbl visible-sm">Аэропорт</div>
                        <div class="col-sm-3 col-xs-6" data-bind="text: '{0}, {1} ({2})'.format(Segments[0].DepartureCity.Name,Segments[0].DepartureAirport.Name,Segments[0].DepartureAirport.Code)"></div>
                        <div class="col-sm-3 col-xs-6" data-bind="text: '{0}, {1} ({2})'.format(Segments[0].ArrivalCity.Name,Segments[0].ArrivalAirport.Name,Segments[0].ArrivalAirport.Code)"></div>
                    </div>
                </div>
            </div>
            <!-- /ko -->

            <div class="row price">
                <div class="col-xs-6">
                    <a href="#" data-toggle="modal" data-target="#tariffRule" class="white">Правила тарифа</a>
                </div>
                <div class="col-xs-3">
                    <div class="price" data-bind="text: KX.CustomService.FormatPrice($('#curSel').val(), 'рб', $data)"></div>
                </div>
                <form class="col-xs-3" action="/book" method="post">
                    <input type="hidden" name="offer" data-bind="value: OfferId" />
                    <input type="hidden" name="adultCount" data-bind="value: $('#adult').val()" />
                    <input type="hidden" name="childCount" data-bind="value: $('#child').val()" />
                    <input type="hidden" name="infCount" data-bind="value: $('#inf').val()" />
                    <input type="hidden" name="cur" data-bind="value: $('#curSel').val()" />
                    <button class="btn btn-primary book" type="submit">Выбрать</button>
                </form>
            </div>
        </div>
    </div>
    <!-- /ko -->
</div>

<div class="container results-cnt" id="search-res">
    <div class="prog-cnt">
        <img src="/Images/ajax-loader.gif" id="progress" />
    </div>
</div>

<div class="modal fade" id="tariffRule">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                Условия бронирования и оплаты чартерных рейсов
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            </div>
            <div class="modal-body">
                <p>В стоимость включены все сборы и таксы.</p>
<p>Норма бесплатного провоза багажа: Экономический класс* 20-23 кг, Бизнес класс 30 кг</p>
<p>Багаж для инфанта(0-2) до 10 кг для всех а/к</p>
<p>Билеты на чартерные рейсы выписываются, не позднее, чем за 12 часов до вылета и высылаются на указанный адрес эл. почты.</p>
<p>Пассажир обязан самостоятельно уточнить информацию о времени вылета и возможных изменениях в расписании накануне вылета.</p>
<p>Оплаченные заказы (авиабилеты) на чартерные рейсы и блоки мест на регулярных рейсах обмену и возврату (аннуляции) не подлежат.</p>
<p>*Норма бесплатного провоза багажа / ручной клади в эконом классе:</p>
<p>Nord Star                              основной багаж 20 кг / ручная кладь до 5 кг</p>
<p>Rossiya                                  основной багаж  20 кг / ручная кладь до 5 кг</p>
<p>Red Wings                            основной багаж  23 кг / ручная кладь до 5 кг</p>
<p>Yamal Airlines                      основной багаж  20 кг / ручная кладь до 5 кг</p>
<p>Ural Airlines                         основной багаж  23 кг / ручная кладь до  5 кг</p>
<p>Montenegro airlines          основной багаж  23 кг / ручная кладь до  8 кг</p>
<p>Air Alana                              основной багаж  20 кг / ручная кладь до  5 кг</p>

            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div>





            </div>

<div id="footer" class="container">
    <div class="foot_inner">
        <div class="left_foot">
            <span>© 2009-2018 FunnyTravel</span>
            <div class="">Разработка сайта <a href="http://kelix.ru">Келикс Софт</a></div>
        </div>
        
    </div>
    <div style="margin-top:20px;">
        <a href="/about" style="color: white; font-size: 16px;">О компании</a>
    </div>
    <div>
        <p style="margin-top: 30px; color: white;">
            <img src="/images/logoVisa_Mast_Mir.png" height="100" style="float: left; margin-right: 10px;margin-bottom: 30px; " />
            После бронирования билета, Вы будете перенаправлены на страницу оплаты. Данные вашей банковской карты обрабатываются платежным центром ООО "МФР" и защищены 256-битным шифрованием, обеспеченным компанией RapidSSL. Сайт отвечает стандартам безопасности платёжных систем Visa, MasterCard и МИР.
        </p>
    </div>
</div>
        </section>
    </div>


    <script src="/Scripts/jquery-3.3.1.min.js"></script>
    <script src="/Scripts/bootstrap.min.js"></script>
    <script src="/Scripts/center-modal.min.js"></script>
    <script src="/js/base.min.js?v=635945013078230120"></script>
    <script src="/js/App.min.js?v=636008321533152909"></script>

    
    <script src="/Scripts/select2/select2.full.js"></script>
    <script src="/Scripts/eternicode/bootstrap-datepicker.js"></script>
    <script src="/Scripts/eternicode/locales/bootstrap-datepicker.ru.js"></script>
    <script src="/js/number-functions.min.js?v=636461049247609793"></script>
    <script src="/js/base.min.js?v=635945013078230120"></script>
    <script src="/js/index.min.js?v=636549053889223255"></script>
    <script src="/js/custom services/csconnector.min.js?v=636632873298285464"></script>
    <script src="/js/results.min.js?v=636516579327964378"></script>
    <script src="/js/custom services/ko.matrix.min.js?v=636632873298438274"></script>
    <script src="/Scripts/jquery_bootstrap-touchspin.min.js"></script>
    <script src="/Scripts/bootstrap3-typeahead.min.js"></script>
    <script src="/Scripts/knockout-3.4.2.min.js"></script>
    <script src="/Scripts/moment-with-locales.min.js"></script>
    <script src="/js/kxavia.state.min.js?v=636548526180457785"></script>

    <script type="text/javascript">
        moment.locale('ru');
        var matrix = new KX.CustomService.MatrixResult();
        ko.applyBindings(matrix);

            var currencyConfig = [
{"code":"$","prefix":"$","name":"доллар","variants":",доллар,доллара,долларов","copecksvariants":",цент,цента,центов","format":"### ### ### ### ##0.0","postfix":""},
{"code":"EU","prefix":"€","name":"евро","variants":",евро,евро,евро","copecksvariants":",евроцент,евроцента,евроцентов","format":"### ### ### ### ##0.0","postfix":""},
{"code":"рб","prefix":"?","name":"рубль","variants":",рубль,рубля,рублей","copecksvariants":",копейка,копейки,копеек","format":"### ### ### ### ##0","postfix":""},
{"code":"UA","prefix":"","name":"гривна","variants":",гривна,гривны,гривен","copecksvariants":",копейка,копейки,копеек","format":"### ### ### ### ##0.0","postfix":"грн."},
            ];

            var csconn = new KXCustomService.Connector(
                "/api/Avia/GetProviders",
                "/api/Avia/SearchAvia",
                "",
                "/book",
                "/api/Avia/GetDates"
            );
            csconn.AllowParallel= true;

        $(function () {

            KXMain.InitControls("/searchapi/GetCitiesFrom",
                "/searchapi/GetDatesFrom",
                "/searchapi/GetCitiesTo",
                "/searchapi/GetCountriesTo",
                null,
                null,
    null,
    []);

            $("#curSel").select2({
                width: "100%",
                minimumResultsForSearch: 10
            });

            $("#adult").TouchSpin({
                min: 1,
                max: 9
            });

            $("#child, #inf").TouchSpin({
                min: 0,
                max: 9
            });

            $("#dtFrom").datepicker({
                format: "dd.mm.yyyy",
                language: "ru",
                autoclose: true,
                beforeShowDay: KXMain.isDatesAvailable,
                "segment-idx":   0,
                orientation: "auto"
            }).on("changeDate", KXMain.OnDtFromChange);

            

            $("#cityFrom").parent().find("button.btn").click(function(e){
                e.preventDefault();

                var dep = $("#cityFrom").val();
                $("#cityFrom").val($("#cityTo").val());
                $("#cityTo").val(dep);

                dep = $("input[name=cityFrom]").val();
                $("input[name=cityFrom]").val($("input[name=cityTo]").val());
                $("input[name=cityTo]").val(dep);

                $("#cityTo").prop("disabled", true);
                $("#search-avia").prop("disabled", true);

                $.ajax({
                    url: "/searchapi/GetCitiesTo",
                    data: { cityFrom: $("input[name=cityFrom]").val(), countryTo: null },
                    contentType: "application/json; charset=utf-8",
                    dataType: "jsonp",
                    error: KXMain.OnGetMemberError,
                    success: function (data) {
                        $("#cityTo").typeahead("setSource", data.coll);
                        $("#cityTo").prop("disabled", false);
                        afterCityToSelect({code: dep});
                    },
                    complete: function (){
                        $("#cityTo").prop("disabled", false);
                        $("#search-avia").prop("disabled", false);
                    }
                });
            });

            $("#dtFrom").parent().find("button.btn").click(function(e){
                e.preventDefault();

                $("#dtFrom").datepicker("show");
            });

            $.fn.datepicker.dates.ru.clear="Без обратного перелета";

            $("#dtTo").datepicker({
                format: "dd.mm.yyyy",
                language: "ru",
                autoclose: true,
                beforeShowDay: KXMain.isDatesAvailable,
                "segment-idx": 1,
                orientation: "auto",
                clearBtn: true,
            }).on("changeDate", KXMain.OnDtToChange).on("clearDate", KXMain.OnDtToChange);

            $("#dtTo").parent().find("button.btn").click(function(e){
                e.preventDefault();

                var v = $("#dtTo").val();
                if (v){
                    $("#dtTo").val(null);
                    $("#dtTo").datepicker("clearDates");
                    $("input[name=rt-mode]").val("false");
                    $("#dtTo").parent().find("button.btn").removeClass("glyphicon-remove").addClass("glyphicon-calendar");
                    $("#dtTo").parent().find("button.btn").attr("title", "Обратный перелет");
                }
                else {
                    $("#dtTo").datepicker("show");
                }
            });

            $("#cityFrom").typeahead({
                source: [
                {code: "AAQ", name: "Анапа"},
                {code: "AYT", name: "Анталья"},
                {code: "BKK", name: "Бангкок"},
                {code: "BCN", name: "Барселона"},
                {code: "BEG", name: "Белград"},
                {code: "BXN", name: "Бодрум"},
                {code: "BOJ", name: "Бургас"},
                {code: "VAR", name: "Варна"},
                {code: "DXB", name: "ДУБАЙ"},
                {code: "SVX", name: "Екатеринбург"},
                {code: "HER", name: "Ираклион"},
                {code: "KZN", name: "Казань"},
                {code: "IEV", name: "Киев"},
                {code: "CFU", name: "Корфу"},
                {code: "KGS", name: "Кос"},
                {code: "LCA", name: "Ларнака"},
                {code: "MOW", name: "Москва"},
                {code: "GOJ", name: "Нижний Новгород"},
                {code: "OVB", name: "Новосибирск"},
                {code: "ODS", name: "Одесса"},
                {code: "OMS", name: "Омск"},
                {code: "PFO", name: "Пафос"},
                {code: "PEE", name: "Пермь"},
                {code: "TGD", name: "Подгорица"},
                {code: "PRG", name: "Прага"},
                {code: "PUY", name: "Пула"},
                {code: "PUJ", name: "Пунта Кана"},
                {code: "HKT", name: "Пхукет"},
                {code: "RMI", name: "Римини"},
                {code: "RHO", name: "Родос"},
                {code: "KUF", name: "Самара"},
                {code: "LED", name: "Санкт-Петербург"},
                {code: "SIP", name: "Симферополь"},
                {code: "AER", name: "Сочи"},
                {code: "TIV", name: "Тиват"},
                {code: "TJM", name: "Тюмень"},
                {code: "UFA", name: "Уфа"},
                {code: "HRK", name: "Харьков"},
                {code: "CEK", name: "Челябинск"},
                {code: "NBE", name: "Энфида"},
        ],
                minLength: 0,
                //showHintOnFocus: "all",
                items: "all",
                afterSelect: function(item){
                    $("input[name=cityFrom]").val(item.code);
                    $("#cityTo").prop("disabled", true);
                    $("#search-avia").prop("disabled", true);
                    $("#cityTo").val(null);

                    createStateController().SetState();

                    $.ajax({
                        url: "/searchapi/GetCitiesTo",
                        data: { cityFrom: item.code, countryTo: null },
                        contentType: "application/json; charset=utf-8",
                        dataType: "jsonp",
                        error: KXMain.OnGetMemberError,
                        success: function (data) {
                            $("#cityTo").typeahead("setSource", data.coll);
                            $("#cityTo").prop("disabled", false);
                            $("#cityTo").focus();
                        },
                        complete: function (){
                            $("#cityTo").prop("disabled", false);
                            $("#search-avia").prop("disabled", false);
                        }
                    });
                },
                matcher: function (item) {
                    var q = this.query.toLowerCase();
                    return item.code.toLowerCase().indexOf(q) >= 0 || item.name.toLowerCase().indexOf(q) >= 0;// || queryFromDB(q, item.code);
                }
            });

            $("#cityTo").typeahead({
                source: [
                {code: "AAQ", name: "Анапа"},
                {code: "AYT", name: "Анталья"},
                {code: "BKK", name: "Бангкок"},
                {code: "BCN", name: "Барселона"},
                {code: "BEG", name: "Белград"},
                {code: "BXN", name: "Бодрум"},
                {code: "BOJ", name: "Бургас"},
                {code: "VAR", name: "Варна"},
                {code: "DXB", name: "ДУБАЙ"},
                {code: "SVX", name: "Екатеринбург"},
                {code: "HER", name: "Ираклион"},
                {code: "KZN", name: "Казань"},
                {code: "IEV", name: "Киев"},
                {code: "CFU", name: "Корфу"},
                {code: "KGS", name: "Кос"},
                {code: "LCA", name: "Ларнака"},
                {code: "MOW", name: "Москва"},
                {code: "GOJ", name: "Нижний Новгород"},
                {code: "OVB", name: "Новосибирск"},
                {code: "ODS", name: "Одесса"},
                {code: "OMS", name: "Омск"},
                {code: "PFO", name: "Пафос"},
                {code: "PEE", name: "Пермь"},
                {code: "TGD", name: "Подгорица"},
                {code: "PRG", name: "Прага"},
                {code: "PUY", name: "Пула"},
                {code: "PUJ", name: "Пунта Кана"},
                {code: "HKT", name: "Пхукет"},
                {code: "RMI", name: "Римини"},
                {code: "RHO", name: "Родос"},
                {code: "KUF", name: "Самара"},
                {code: "LED", name: "Санкт-Петербург"},
                {code: "SIP", name: "Симферополь"},
                {code: "AER", name: "Сочи"},
                {code: "TIV", name: "Тиват"},
                {code: "TJM", name: "Тюмень"},
                {code: "UFA", name: "Уфа"},
                {code: "HRK", name: "Харьков"},
                {code: "CEK", name: "Челябинск"},
                {code: "NBE", name: "Энфида"},
        ],
                minLength: 0,
                //showHintOnFocus: "all",
                afterSelect: afterCityToSelect,
                items: "all",
                matcher: function (item) {
                    var q = this.query.toLowerCase();
                    return item.code.toLowerCase().indexOf(q) >= 0 || item.name.toLowerCase().indexOf(q) >= 0;// || queryFromDB(q, item.code);
                }
            });

            $(window).resize(function(e){
                resize();
            });

            $("#search-avia").click(function(e){
                e.preventDefault();

                if ($(this).data("stop")) {
                    csconn.Abort();
                    $(this).html("Найти билеты").data("stop", false);
                    $("#searchresults .progress").hide();
                }
                else
                    startSearch($(this));

                //matrix.ColumnDates.removeAll();
                //matrix.Rows.removeAll();

                //matrix.ColumnDates.push(new Date(2017,7,10));
                //matrix.ColumnDates.push(new Date(2017,7,11));
                //matrix.ColumnDates.push(new Date(2017,7,12));
                //matrix.ColumnDates.push(new Date(2017,7,13));
                //matrix.ColumnDates.push(new Date(2017,7,14));

                //var row = new KX.CustomService.MatrixRow();
                //row.Columns.push(new KX.CustomService.MatrixCell());
                //row.Columns.push(new KX.CustomService.MatrixCell());
                //row.Columns.push(new KX.CustomService.MatrixCell());
                //row.Columns.push(new KX.CustomService.MatrixCell());
                //row.Columns.push(new KX.CustomService.MatrixCell());

                //matrix.Rows.push(row);
            });

            resize();

            KXAvia.СreateSearchFormState = createStateController;



        });

        function resize(){
            App.RaiseEvent(100);
        }

        function afterCityToSelect(item){
            $("input[name=cityTo]").val(item.code);
            $("#dtFrom").prop("disabled", true);
            $("#dtTo").prop("disabled", true);

            createStateController().SetState();
            $.ajax({
                url: "/api/Avia/GetDates",
                data: { seg: "{0}-{1}".format($("input[name=cityFrom]").val(), item.code), "rtmode": $("input[name=rt-mode]").val() },
                contentType: "application/json; charset=utf-8",
                dataType: "jsonp",
                error: KXMain.OnGetMemberError,
                success: function (data) {
                    KXMain.BindDates($("#dtFrom"), data, true, true, KXBase.parseBool($("input[name=rt-mode]").val()), false);
                    $("#dtFrom").focus();
                },
                complete: function (){
                    $("#dtFrom").prop("disabled", false);
                    $("#dtFrom").focus();
                }
            });

            $.ajax({
                url: "/searchapi/GetDates",
                data: { seg: "{1}-{0}".format($("input[name=cityFrom]").val(), item.code), "rt-mode": true },
                contentType: "application/json; charset=utf-8",
                dataType: "jsonp",
                error: KXMain.OnGetMemberError,
                success: function (data) {
                    KXMain.BindDates($("#dtTo"), data, true, false);
                },
                complete: function (){
                    $("#dtTo").prop("disabled", false);
                }
            });
        }

        function createStateController() {
            var sc = new KXAvia.SearchFormState("/search/",
                function () {
                    return {
                        code: $("input[name=cityFrom]").val(),
                        text: $("#cityFrom").val(),
                    };
                },
                function () {
                    var c = $("#cityTo").val();
                    if (c)
                    return {
                        code:   $("input[name=cityTo]").val(),
                            text: c,
                        };
                    else
                    return null;
                }, function () {
                    return moment($("#dtFrom").datepicker("getDate")).format("YYYY-MM-DD");
                }, function () {
                    if (KXBase.parseBool($("input[name=rt-mode]").val()))
                        return moment($("#dtTo").datepicker("getDate")).format("YYYY-MM-DD");
                    else
                        return null;
                }
            );

            return sc;
        }

        function startSearch($btn) {
            //$btn.prop("disabled", true);
            $btn.html("<i class='fa fa-times fa-spin fa-fw'></i>&nbsp;Остановить").data("stop", true);

            $("#searchresults").removeClass("hidden");

            //var request = KXResult.MakeRequest();

            KX.CustomService.StartSearch(csconn, matrix, KXBase.parseBool($("input[name=rt-mode]").val()),
                KXResult.MakeRoutes(), 3, KXResult.MakeRequest,
                function(p){
                    //console.info(p);

                $("#searchresults .progress-bar").width("{0}%".format(p*100));

                if (p == 1){
                    //$btn.prop("disabled", false);
                    $btn.html("Найти билеты").data("stop", false);
                    csconn.Complete();

                    setTimeout(function(){
                        $("#searchresults .progress").fadeOut();
                    }, 500);
                }
                else if(p==0){
                    $("#searchresults .progress").show();

                }
            });
            createStateController().SetState(true);
        }

        function queryFromDB(q, code) {
            var r = false;

            $.ajax({
                url: "/api/Avia/FindCity",
                async: false,
                data: { q: q, city: code },
                success: function (result) {
                    r = result;
                }
            });

            return r;
        }
    </script>


    <script>
        $(function () {
            if (KXBase.hasParameter("iframe")) {
                var url = "http://funny-montenegro.ru";
                parent.postMessage(JSON.stringify({ event: "onload", args: { height: $("#body section").height() } }), url);
            }
        });
    </script>
    <!-- Yandex.Metrika counter --> <script type="text/javascript" > (function (d, w, c) { (w[c] = w[c] || []).push(function() { try { w.yaCounter47539537 = new Ya.Metrika({ id:47539537, clickmap:true, trackLinks:true, accurateTrackBounce:true }); } catch(e) { } }); var n = d.getElementsByTagName("script")[0], s = d.createElement("script"), f = function () { n.parentNode.insertBefore(s, n); }; s.type = "text/javascript"; s.async = true; s.src = "https://mc.yandex.ru/metrika/watch.js"; if (w.opera == "[object Opera]") { d.addEventListener("DOMContentLoaded", f, false); } else { f(); } })(document, window, "yandex_metrika_callbacks"); </script> <noscript><div><img src="https://mc.yandex.ru/watch/47539537" data-cke-saved-src="https://mc.yandex.ru/watch/47539537" style="position:absolute; left:-9999px;" alt="" /></div></noscript> <!-- /Yandex.Metrika counter -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-120365555-1"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-120365555-1');
</script>
</body>
</html>

 

© Copyright 2005 - 18 Funny Travel