var rootel = 'bookEng'; var jqfrm = "\u003ciframe width=\"100%\" id=\"wheelsiframe\" src=\"https://booking.starrent.gr/default.aspx?caller=$abcd$\u0026lang=el\" frameborder=\"0\" scrollong=\"no\" allowtransparency=\"true\"\u003e\u003c/iframe\u003e"; var url1 = "https://booking.starrent.gr/public/css/wheels.css"; var ifrurl = "https://booking.starrent.gr/"; var ifr = ifrurl.split("/"); ifrurl = ifr[0] + "//" + ifr[2]; var oper = ''; (function() { // Poll for jQuery to come into existance var checkReady = function(callback) { if (window.jQuery) { callback(jQuery); } else { window.setTimeout(function() { checkReady(callback); }, 20); } }; // Start polling... checkReady(function($) { $(function() { if (document.createStyleSheet) { document.createStyleSheet(url1); } else { jQuery('').appendTo('head'); } //CALL CREATION SCRIPT jqfrm = jqfrm.replace('$abcd$', encodeURIComponent(window.location.hostname)).replace("$wsid$", "(S(" + WsParam("WSID") + "))/"); $("#" + rootel).html(jqfrm); //alert(jQuery("#" + rootel).html()); if (oper != "step2") { $("#" + rootel).css("position", "absolute"); $("#" + rootel).css("width", "80%"); $("#" + rootel).css("top", "80px"); $("#" + rootel).css("left", "10%"); $("#" + rootel).css("z-index", "99"); $("#" + rootel).css("background-color", "transparent"); var initWidth = $("#" + rootel).width(); if(window.innerWidth < 858 && window.innerWidth > 770) { $("#" + rootel).css("height", "500px"); $("#" + rootel).parent().css("height", 500); } else { $("#" + rootel).css("height", "400px"); $("#" + rootel).parent().css('height', 450); } $("#" + rootel).css("padding-left", "10px"); $("#" + rootel).css("padding-right", "10px"); //$("#" + rootel).width(initWidth + 100); $("#" + rootel).fadeIn('slow'); if (window.innerWidth < 800) { //tablet vert if (window.innerWidth < 420) { $("#" + rootel).parent().css('height', 540); $(".swiper-wrapper").css('height', 540); $("#" + rootel).css("top", "110px"); $(".swiper-button-prev").css('top', '15%'); $(".swiper-button-next").css('top', '15%'); $("#" + rootel).css("left", 0); $("#" + rootel).css("width", "100%"); } else { $(".swiper-wrapper").css('height', 450); } } } if (oper == "step2") { $(".form-box").removeClass("form-box").addClass("formBox") $(".formBox form").remove(); $("#" + rootel).css("position", "relative"); var wdth = window.outerWidth; if (wdth == 0) { wdth = window.innerWidth; } if (wdth > 768) { $("#" + rootel).css("padding-bottom", "60%"); } } else { $("#" + rootel).css("overflow-y", "hidden"); } setTimeout(function() { document.getElementById("wheelsiframe").contentWindow.postMessage(window.location.href, ifrurl);}, 1200); }); }); })(); window.addEventListener("message", receiveMessage, false); function WsParam(name) { name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(location.search); return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); } function receiveMessage(event) { if (event.origin !== ifrurl) { // alert(event.origin); return; } targurl = event.data; if (!isNaN(parseFloat(targurl)) && isFinite(targurl)) { //alert(targurl); $("#wheelscars").parent().height(targurl); $("#wheelscars").height(targurl); window.scrollTo(0, 0); return; } targurl = targurl.replace("$wsid$", WsParam("WSID")); window.location.href = targurl; }