var CarRental; (function () { "use strict"; var isSafari = /Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor), loadCssHack = function(url, callback){ var link = document.createElement('link'); link.type = 'text/css'; link.rel = 'stylesheet'; link.href = url; document.getElementsByTagName('head')[0].appendChild(link); var img = document.createElement('img'); img.onerror = function(){ if (callback && typeof callback === "function") { callback(); } }; img.src = url; }, loadRemote = function(url, type, callback) { if (type === "css" && isSafari) { loadCssHack(url, callback); return; } var _element, _type, _attr, scr, s, element; switch (type) { case 'css': _element = "link"; _type = "text/css"; _attr = "href"; break; case 'js': _element = "script"; _type = "text/javascript"; _attr = "src"; break; } scr = document.getElementsByTagName(_element); s = scr[scr.length - 1]; element = document.createElement(_element); element.type = _type; if (type == "css") { element.rel = "stylesheet"; } if (element.readyState) { element.onreadystatechange = function () { if (element.readyState == "loaded" || element.readyState == "complete") { element.onreadystatechange = null; if (callback && typeof callback === "function") { callback(); } } }; } else { element.onload = function () { if (callback && typeof callback === "function") { callback(); } }; } element[_attr] = url; s.parentNode.insertBefore(element, s.nextSibling); }, loadScript = function (url, callback) { loadRemote(url, "js", callback); }, loadCss = function (url, callback) { loadRemote(url, "css", callback); }, options = { folder: "http://mavcars.gr/httpdocs", validation: { error_hours: "We do not accept reservations for less than 2 hour(s).", error_dates: "You can only rent a car at least 2 day(s).", error_invalid: "Invalid pick-up and return date and time.", error_title: "You failed to correctly fill in the form:", error_email: "E-Mail is invalid", error_length: "We do not accept reservations for less than 2 day(s).", }, booking_periods: "both", min_hour: "2", message_1: "Booking has been added. Redirecting to PayPal...", message_2: "Booking has been added. Redirection to Authorize...", message_3: "Booking has been successfully added.", message_4: "Reservation failed to save", dateFormat: "d-m-Y", momentDateFormat: "DD-MM-YYYY", startDay: 1, dayNames: ["S","M","T","W","T","F","S"], monthNamesFull: ["January","February","March","April","May","June","July","August","September","October","November","December"], closeButton: "Close", action: "pjActionIndex", contact_lat: 51.50722, contact_lng: -0.1275, website_seo: "Yes", goto_step: 1, type_id: 0, }; loadScript("core/third-party/jquery/1.11.3/jquery.min.js", function () { loadScript("core/third-party/validate/1.14.0/jquery.validate.min.js", function () { loadScript("core/third-party/bootstrap/3.3.5/js/bootstrap.min.js", function () { loadScript("core/libs/jabb/jabb-0.4.3.js", function () { loadScript("core/libs/datejs/date.js", function () { loadScript("core/third-party/owlcarousel/2.0.0/owl.carousel.min.js", function () { loadScript("core/third-party/moment/2.10.6/moment.min.js", function () { loadScript("core/third-party/bootstrap_datetimepicker/4.17.37/build/js/bootstrap-datetimepicker.min.js", function () { loadScript("mavcars/website/js/website.js", function () { loadCss("core/third-party/bootstrap_datetimepicker/4.17.37/build/css/bootstrap-datetimepicker.min.css"); CarRental = new CarRental(options); }); }); }); }); }); }); }); }); }); })();