var timeout = 100; var closetimer = 0; var ddmenuitem = 0; // open hidden layer function mopen(id) { // cancel close timer //mcancelclosetime(); // close old layer if(ddmenuitem) ddmenuitem.style.visibility = 'hidden'; // get new layer and show it ddmenuitem = document.getElementById(id); ddmenuitem.style.visibility = 'visible'; // document.getElementById('facebook_like').style.visibility = 'hidden'; } // close showed layer function mclose() { if(ddmenuitem) ddmenuitem.style.visibility = 'hidden'; // document.getElementById('facebook_like').style.visibility = 'visible'; } // go close timer function mclosetime() { closetimer = window.setTimeout(mclose, timeout); } // cancel close timer function mcancelclosetime() { if(closetimer) { window.clearTimeout(closetimer); closetimer = null; } } function country_sel() { $.post("/includes/ip_country_xml_sel.php?lan=" + $("#lan").val(), {}, function(a) { result = eval("(" + a + ")"), 0 < result.country.length && (select_cbo_by_value("country_user", result.country), 0 < result.country.length && select_cbo_by_value("currency", result.currency)), $("#cntry_name").html(result.country_name_translated), $("#currency_text").html($("#currency option:selected").text()) }) } function select_cbo_by_value(id, v) { var cbo=document.getElementById(id); for(var i=0; i'+$.datepicker.regional[lang].monthNamesShort[i]+''; } str = str + ''; $(".ui-datepicker").each(function(){ //var newday = $("#calendarHeader").html() + $(this).html(); var newday = str + $(this).html(); $(this).html(newday); }); }, 100); //allows calendar to render } function selectMonthCalender(v) { $('.ui-datepicker-month').val(v); $('.ui-datepicker-month').trigger("onchange"); } (function(a) { a.widget("ui.combobox", {_create:function() { var l = this, d = this.element.hide(), g = d.children(":selected"), g = g.val() ? g.text() : "", k = this.input = a('').insertAfter(d).val(g).autocomplete({delay:0, minLength:$("#default_lenth").val(), open:function() { a(this).autocomplete("widget").css("z-index", 1E3); return!1; }, source:function(c, b) { var h = RegExp(a.ui.autocomplete.escapeRegex(c.term), "i"); b(d.find("option").map(function() { var b = a(d).find('option[value="' + this.value + '"]').parent("optgroup").attr("label"), f = a(this).text(); if (this.value) { if (c.term) { if (h.test(f)) { return{label:f.replace(RegExp("(?![^&;]+;)(?!<[^<>]*)(" + a.ui.autocomplete.escapeRegex(c.term) + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "$1"), value:f, category:b.replace(b, b), option:this}; } } else { return{label:f, value:f, category:b.replace(b, b), option:this}; } } })); }, select:function(c, b) { b.item.option.selected = !0; l._trigger("selected", c, {item:b.item.option}); "pickupLocation" == a(this).prev().attr("id") && (a("#dropoffLocation").val(b.item.option.value), a("#dropoffLocation option:selected").val(b.item.option.value), a("#dropoffLocation").next(".ui-autocomplete-input").val(b.item.value), a("#diff_drop").attr("disabled", !1)); }, change:function(c, b) { if (!b.item) { var h = RegExp("^" + a.ui.autocomplete.escapeRegex(a(this).val()) + "$", "i"), e = !1; d.children("option").each(function() { if (a(this).text().match(h)) { return this.selected = e = !0, !1; } }); if (!e) { return a(this).val(""), d.val(""), k.data("autocomplete").term = "", !1; } } }}).addClass("ui-widget ui-widget-content ui-corner-left input").val(a("#default_val").val()).click(function() { "pickupLocation" == a(this).prev().attr("id") ? a(".ui-autocomplete:first").show() : a(".ui-autocomplete:last").show(); }); k.data("autocomplete")._renderItem = function(c, b) { return a("
  • ").data("item.autocomplete", b).append("" + b.label + "").appendTo(c); }; k.data("autocomplete")._renderMenu = function(c, b) { var d = this, e = ""; a.each(b, function(a, b) { 0 != b.category && b.category != e && (c.append("
  • " + b.category + "
  • "), e = b.category); d._renderItem(c, b); }); }; }, destroy:function() { this.input.remove(); this.button.remove(); this.element.show(); a.Widget.prototype.destroy.call(this); }}); })(jQuery); $(function() { $("#pickupLocation").combobox(); $("#dropoffLocation").combobox(); }); function diff_droploc(a) { var str = '
    Loading...
    '; $("#waiting").html(str); drop_newlocation_int($("#pickupLocation").val()); a.checked ? $("#dropoffDiv").show() : $("#dropoffDiv").hide(); } var fullDate = new Date((new Date).getTime() + 864E5); $("#pickupdates").val(("0" + fullDate.getDate()).slice(-2) + "-" + ("0" + (fullDate.getMonth() + 1)).slice(-2) + "-" + fullDate.getFullYear()); fullDate = new Date((new Date).getTime() + 6912E5); $("#dropoffdates").val(("0" + fullDate.getDate()).slice(-2) + "-" + ("0" + (fullDate.getMonth() + 1)).slice(-2) + "-" + fullDate.getFullYear()); $("#pickupLocation").next(".ui-autocomplete-input").trigger("onfocus"); $(".ui-autocomplete:first").hide(); $("#pickupLocation").next(".ui-autocomplete-input").blur(); $(document).ready(function() { $(".ui-autocomplete-input").val($("#default_val").val()); $("#pickupLocation").next(".ui-autocomplete-input").val($("#default_val").val()); }); function emptythis(a) { a = $(a).prev(); $(a).val(""); $(a).autocomplete("search", ""); clicktxt(a); }; country_sel(); /* footer function */ function popitup(url) { newwindow=window.open(url,'name','height=500,width=1050,scrollbars=1,resizable=1,status=1'); if (window.focus) {newwindow.focus()} return false; } var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-317014-1']); _gaq.push(['_setDomainName', 'rentalcargroup.com']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = false; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); $('a').on('click', function(e) { //need to change on everywhere var el = $(this); var link = el.attr('href'); window.location = link; }); /* * Replace all SVG images with inline SVG */ jQuery('img.svg').each(function(){ var $img = jQuery(this); var imgID = $img.attr('id'); var imgClass = $img.attr('class'); var imgURL = $img.attr('src'); jQuery.get(imgURL, function(data) { // Get the SVG tag, ignore the rest var $svg = jQuery(data).find('svg'); // Add replaced image's ID to the new SVG if(typeof imgID !== 'undefined') { $svg = $svg.attr('id', imgID); } // Add replaced image's classes to the new SVG if(typeof imgClass !== 'undefined') { $svg = $svg.attr('class', imgClass+' replaced-svg'); } // Remove any invalid XML tags as per http://validator.w3.org $svg = $svg.removeAttr('xmlns:a'); // Replace image with new SVG $img.replaceWith($svg); }, 'xml'); }); // Sign up newsletter function $( "#subscribe_footer" ).click(function() { jQuery.ajax({ type: "POST", url: "/includes/newsletter.php", data: { lang: $('#lan').val(),email: $('#email_footer').val()}, success: function(theResponse) { var result = eval("("+theResponse+")"); if(result.success==0){ $('#subscribeFail_footer').show(); $('#subscribeSuccess_footer').hide(); } else{ $('#subscribeSuccess_footer').show(); $('#subscribeFail_footer').hide(); } //console.log(result.success); } }); }); $('.currency_flag').click(function(evt) { $(".menu-item2").toggle(); $(".menu-item").hide(); }); $('.nav-toggle').click(function(evt) { $(".menu-item").toggle(); $(".menu-item2").hide(); });