var rootel = 'solidBookingEng'; var jqfrm = "\u003ciframe width=\"100%\" id=\"wheelscars\" src=\"https://solid-web.wheelsys.io/$wsid$reservations/?caller=$abcd$\u0026lang=en\" frameborder=\"0\" scrollong=\"no\" allowtransparency=\"true\" onload=\"resizeIframe(this)\"\u003e\u003c/iframe\u003e"; var url1 = "https://solid-web.wheelsys.io/public/css/wheels.css"; var ifrurl = "http://solid.cr.wheelsys.com/"; var ifr = ifrurl.split("/"); ifrurl = ifr[0] + "//" + ifr[2]; var oper = 'step2'; (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()); $("#" + rootel).css("position", "relative"); $("#" + rootel).css("z-index", "100"); var initWidth = $("#" + rootel).width(); //$("#" + rootel).width(initWidth + 100); $("#" + rootel).css("min-height", "230px"); if (oper == "step2") { if (window.outerWidth > 768) { $("#" + rootel).css("padding-bottom", "60%"); } } else { if (window.outerWidth > 1024) { $("#" + rootel).css("height", "120px"); } else { if (window.outerWidth > 768) { $("#" + rootel).css("height", "180px"); } } $("#" + rootel).css("overflow-y", "hidden"); } }); }); })(); 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; } function resizeIframe(obj) { obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px'; }