[NAME]
[TITLE]
[BIO]
'; var html = ""; var decodeEntities = function (s) { return $("").html(s == null ? "" : String(s)).text(); }; var esc = function (s) { return $("
").text(s == null ? "" : String(s)).html(); }; $.each(list, function (_, m) { var img = (m.userImgURL || "").toString().replace(/'/g, "%27"); var name = decodeEntities(m.userName); var title = decodeEntities(m.userTitle); var bio = decodeEntities(m.userBio); var memberHtml = template .replace(/\[USERIMGURL\]/g, img) .replace(/\[NAME\]/g, esc(name)) .replace(/\[TITLE\]/g, esc(title)) .replace(/\[BIO\]/g, esc(bio)); html += memberHtml; }); var ourstaffHeader = ""; if (html != '') { ourstaffHeader = "

Our Staff

"; } $("#managementBox").html(ourstaffHeader + html); var RecaptchaOptions = { theme : 'clean', custom_theme_widget: 'recaptcha_widget' }; var captchaContainer = null; var loadCaptcha = function() { captchaContainer = grecaptcha.render('captcha_container', { 'sitekey' : '6LfJ2UgUAAAAAEaPGknuuBWvQdqVldeOmo4Tzr8_', 'callback' : function(response) { } }); }; function vehicleUrl(id) { return "/vehicle.php?id=" + encodeURIComponent(id); } function norm(v) { return String(v == null ? "" : v).toLowerCase().trim(); } function formatMoney(n) { n = parseInt(n, 10); if (!n || isNaN(n)) return ""; return "$" + n.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); } function searchableText(v) { var cyl = norm(v.Cylinders); var cylAliases = []; if (cyl) { cylAliases.push(cyl + " cyl"); cylAliases.push(cyl + " cylinder"); cylAliases.push(cyl + " cylinders"); if (cyl === "8") cylAliases.push("v8"); if (cyl === "6") cylAliases.push("v6"); if (cyl === "4") cylAliases.push("i4"); } var stock = norm(v.StockNumber); var stockAliases = []; if (stock) { stockAliases.push(stock); stockAliases.push("#" + stock); stockAliases.push("stock " + stock); stockAliases.push("stock#" + stock); } return [ v.Year, v.Make, v.Model, v.Trim, v.Mileage, v.BodyStyle, v.Price, v.SpecialPrice, v.Engine, v.Cylinders, cylAliases.join(" "), v.ExColor, v.InColor, v.TitleStatus, v.StockNumber, stockAliases.join(" ") ].map(norm).join(" "); } function escapeHtml(s) { return String(s).replace(/[&<>"']/g, function (m) { return ({ "&":"&","<":"<",">":">",'"':""","'":"'" })[m]; }); } function highlight(text, tokens) { tokens.forEach(function (t) { if (!t) return; var re = new RegExp("(" + t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + ")", "ig"); text = text.replace(re, "$1"); }); return text; } function getVehicleSource() { if (Array.isArray(window.availableVehicles)) return window.availableVehicles; if (window.availableVehicles && typeof window.availableVehicles === "object") return Object.values(window.availableVehicles).filter(Boolean); return []; } if ($("#searchInput").length && $.fn.autocomplete) { var $si = $("#searchInput"); console.log("searchInput exists:", $si.length);console.log("availableVehicles type:", typeof window.availableVehicles);console.log("availableVehicles isArray:", Array.isArray(window.availableVehicles));console.log("availableVehicles length:", Array.isArray(window.availableVehicles) ? window.availableVehicles.length : "n/a");console.log("sample vehicle 0:", Array.isArray(window.availableVehicles) ? window.availableVehicles[0] : null); $("#searchInput").autocomplete({ minLength: 1, delay: 0, source: function (request, response) { var q = norm(request.term); if (!q) return response([]); var tokens = q.split(/\s+/).filter(Boolean); var results = []; var vehicleSource = getVehicleSource(); for (var i = 0; i < vehicleSource.length; i++) { var v = vehicleSource[i]; var s = searchableText(v); var hits = 0; var ok = true; for (var t = 0; t < tokens.length; t++) { if (s.indexOf(tokens[t]) === -1) { ok = false; break; } hits++; } if (!ok) continue; results.push({ value: v.Year + " " + v.Make + " " + v.Model, label: v.Year + " " + v.Make + " " + v.Model, vehicle: v, tokens: tokens, score: hits }); } results.sort(function (a, b) { if (b.score !== a.score) return b.score - a.score; return (a.vehicle.Mileage || 0) - (b.vehicle.Mileage || 0); }); response(results.slice(0, 25)); }, open: function () { var $menu = $(this).autocomplete("widget"); $menu.outerWidth($(this).outerWidth()); }, focus: function(event, ui) { event.preventDefault(); }, select: function (event, ui) { var v = ui.item.vehicle; window.location.href = vehicleUrl(v.ID); return false; } }); $("#searchInput").on("focus click", function () { var v = $(this).val(); if (v && v.length) $(this).autocomplete("search", v); }); var ac = $("#searchInput").data("ui-autocomplete") || $("#searchInput").data("autocomplete"); if (ac) ac._renderItem = function (ul, item) { var v = item.vehicle; var title = v.Year + " " + v.Make + " " + v.Model + (v.Trim ? " " + v.Trim : ""); var price = ""; if (v.SpecialPrice && v.SpecialPrice > 0) { price = formatMoney(v.SpecialPrice); if (v.Price && v.Price > 0 && v.Price != v.SpecialPrice) { price += ' ' + formatMoney(v.Price) + ''; } } else if (v.Price && v.Price > 0) { price = formatMoney(v.Price); } var sub = [ escapeHtml(v.BodyStyle), (v.Mileage && v.Mileage > 0 ? (v.Mileage.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + " mi") : ""), escapeHtml(v.Engine), (v.Cylinders ? (escapeHtml(v.Cylinders) + " cyl") : ""), (v.ExColor ? ("Ext: " + escapeHtml(v.ExColor)) : ""), (v.InColor ? ("Int: " + escapeHtml(v.InColor)) : ""), (v.TitleStatus ? ("Title: " + escapeHtml(v.TitleStatus)) : ""), (v.StockNumber ? ("Stock: #" + escapeHtml(v.StockNumber)) : ""), price ].filter(Boolean).join(" • "); var html = '
' + '' + '
' + '
' + highlight(title, item.tokens) + '
' + '
' + highlight(sub, item.tokens) + '
' + '
' + '
'; return $("
  • ") .append($("").html(html)) .appendTo(ul); }; } function responsivemenu(){ if ($('#gt-dsk-menu').is(':visible')) { var i = 0; var ih = 0; $('#gt-dsk-menu > a').each(function(){ $(this).show(); i++; var optoffset = $(this).offset().top; if (i == 1) { window.menuoffset = optoffset; } if (i != 1 && optoffset != window.menuoffset) { $(this).hide(); ih++; } }).promise().done(function(){ }); } } function responsiveslidwshows(){ $('.gp-slider-message-text').each(function(){ window.slideshowid = $(this).closest('.royalSlider').attr('id'); window.slideshowidmaxheight = $(this).closest('.royalSlider').attr('max-height'); window.slideshowheight = $(this).closest('.royalSlider').innerHeight(); var frameheight = $(this).innerHeight(); if (window.slideshowid != window.lastslideshowid || frameheight > window.maxframeheight) { window.maxframeheight = $(this).innerHeight(); window.lastslideshowid = window.slideshowid; } /*console.log('frameheight: ' + frameheight + ', slideshowheight: ' + window.maxframeheight + ', slideshowid: ' + window.slideshowid);*/ }).promise().done(function(){ $('#' + window.slideshowid).css('height',(window.maxframeheight) + 'px'); }); } function renderdim() { var vss = $(window).width(); if ($('.gp-veh-tabs').length > 0) { $('#gt-header-container-spacer').show(); $('#gt-header-container').addClass('gt-header-container-scrolled'); } else if ($('.gt-ss-1').is(':visible') || $('#slider-hd').is(':visible')) { $('#gt-header-container-spacer').hide(); } else { /*DONOTHING*/ } if (!$('.gt-ss-1').is(':visible') && !$('#slider-hd').is(':visible')) { $('#gt-header-container').addClass('gt-header-container-scrolled'); } $('.gt-flsc-m').css({'width':'100%'}); if ($('.g-userbarmenu-td').is(':visible')) { $('.gt-flsc-m').height($(window).height() - $('#gt-header-container').height() - $('.g-userbarmenu-td').height()); } else { $('.gt-flsc-m').height($(window).height() - $('#gt-header-container').height()); } $('.gt-flsc').css({'width':'100%'}); if ($('.g-userbarmenu-td').is(':visible')) { $('.gt-flsc').height($(window).height() - $('.g-userbarmenu-td').height()); } else { $('.gt-flsc').height($(window).height()); } if ($(window).width() <= 1024) { $('.gp-search-menu').hide(); } else { $('.gp-search-menu').show(); } var vfv_h = Math.round($(window).width() * 0.7643312101910828); /*if ($(window).width() < $(window).height()) { $('#slider-hd').css('max-height',vfv_h + 'px'); } else { $('#slider-hd').css('max-height','100%'); }*/ responsivemenu(); } function flowmenus() { if ($('.g-userbarmenu-td').is(':visible')) { headerheight = $('.g-userbarmenu-td').height() + $('#gt-header-container').height(); } else { headerheight = $('#gt-header-container').height(); } $(".gp-search-menu-container").css({"top":headerheight + "px"}); if ($('.gp-veh-tabs').length > 0) { if ($(window).width() < $(window).height()) { $('.gp-veh-tabs').css('margin-bottom','-' + $('.gp-veh-tabs').height() + 'px'); $('.gp-veh-tabs-spacer').css('height','0px'); $('.gp-veh-tabs').addClass('gp-veh-tabs-static'); } else { $('.gp-veh-tabs').css('margin-bottom','0'); $('.gp-veh-tabs-spacer').css('height','0'); $('.gp-veh-tabs').removeClass('gp-veh-tabs-static'); } $(".gp-veh-tabs").css('top',headerheight + 'px'); vehiclemenusposition = ($('.gp-veh-tabs').offset().top - headerheight); $(document).on('scroll', function(){ $(".gp-veh-tabs").css('top',headerheight + 'px'); }); /*console.log('scrollTop: ' + $(document).scrollTop() + ', VehMenuOffset: ' + $('.gp-veh-tabs').offset().top + ', VehMenuPos: ' + $('.gp-veh-tabs').position().top + ', DivHeight: ' + $('.gp-veh-tabs').height() + ', HeaderHeight: ' + $('#gt-header-container').height() + ', DocumentHeight: ' + $(window).height());*/ } $(document).on('scroll', function(){ if (!$('#gt-header-container-spacer').is(':visible')) { if ($(document).scrollTop() > 50) { $('#gt-header-container').addClass('gt-header-container-scrolled'); } else { $('#gt-header-container').removeClass('gt-header-container-scrolled'); } } }); } function loopslider(thisitems,delayvar,fadeinvar) { if (thisitems.hasClass('runanimation')) { $(thisitems).find(".pitem1").delay(delayvar).animate({opacity: 1}, fadeinvar).promise().done(function(){ $(thisitems).find(".pitem2").delay(delayvar).animate({opacity: 1}, fadeinvar).promise().done(function(){ $(thisitems).find(".pitem3").delay(delayvar).animate({opacity: 1}, fadeinvar).promise().done(function(){ $(thisitems).find(".pitem4").delay(delayvar).animate({opacity: 1}, fadeinvar).promise().done(function(){ $(thisitems).find(".pitem1,.pitem2,.pitem3").animate({opacity: 0}, 0); $(thisitems).find(".pitem4").delay(delayvar).animate({opacity: 0}, fadeinvar).promise().done(function(){ loopslider(thisitems,delayvar,fadeinvar); }); }); }); }); }); } } function pickmodels(makeid){ var mid = $('#midsel').children("option:selected").text(); $('select[name=moid] option').hide(); $('select[name=moid] option[makeid=' + makeid + ']').show(); } $(document).on('click','.viewinventorybut',function(){ window.location.replace("/inventory.php"); }); $(document).on('click','.mycarsmannotbut',function(){ $('#mycarsmannotdialog').dialog("open"); }); $('.gp-item,.gp-item-small,.gp-item-large').hover(function(e) { var thisitems = $(this); $(this).addClass('runanimation'); var delayvar = 1400; var fadeinvar = 300; var totalofitems = thisitems.find(".gp-item-pic-hover").length; var timerforphotos = (delayvar + fadeinvar) * totalofitems; thisitems.find(".gp-item-pic-hover").each(function() { var thisitem = $(this); if (thisitem.attr('imgurl')) { thisitem.css({'background-image':'url(' + thisitem.attr('imgurl') + ')'}).removeAttr("imgurl"); } }); $(thisitems).find(".pitem1,.pitem2,.pitem3,.pitem4,.pitem5,.gp-item-pic-hover").stop(true); if (!$(this).hasClass('gp-item-static')) { loopslider(thisitems,delayvar,fadeinvar); } }, function() { var thisitems = $(this); $(this).removeClass('runanimation'); $(thisitems).find(".pitem1,.pitem2,.pitem3,.pitem4,.pitem5,.gp-item-pic-hover").stop(true); }); $(window).on('resize',function() { renderdim(); flowmenus(); responsiveslidwshows(); }); renderdim(); flowmenus(); responsiveslidwshows(); $(".required-input-phone").mask("(999) 999-9999"); $("#textusdialog").dialog({ title: 'Text Us', autoOpen: false, width: 'auto', height: 'auto', autoResize:true, modal: true, resizable: false, stack: false, draggable: false, zIndex:'1001', buttons: { "Submit" : { text: "Submit", id: "textussend", click : function() { var cinputs = '#textusform .required-input:visible,#textusform .required-input-phone:visible'; var counterrors = 0; var totalofinputs = 0; var totalofinputsfinished = 0; $(cinputs).each(function () { totalofinputs++; }).promise().done(function(){ $(cinputs).each(function () { var cinput = $(this); CheckInputsOverall(cinput.attr('id')).promise().done(function(){ totalofinputsfinished++; if (cinput.hasClass('input-warning')) { counterrors++; } if (totalofinputs == totalofinputsfinished && counterrors == 0) { $("#textusdialog").dialog('close'); loadnotipopup('Sending, Please Wait...'); $.ajax({ type:"POST", url: '/contact.php', data: $("#textusform").serialize(), success: function(data){ if (data == '2') { fadeallnotipopup(); $("#textusdialog").dialog('open'); if ($('#sectrts').is(':visible')) { Recaptcha.reload(); } $('#sectrts').show(); } else if (data == '1') { notipopup('Messsage Sent'); } else { /*DONOTHING*/ } } }); } else { $('.input-warning:visible').first().focus(); } }); }); }); } }, "Cancel" : { text: "Close", id: "textuscancel", click : function() { $("#textusdialog").dialog('close'); } } }, open: function() { $(".ui-dialog-titlebar-close").hide(); $('.ui-dialog :button,input,select').blur(); $('.ui-dialog-buttonpane').find('button').removeClass().addClass('subbut-gra-lightgray'); $('.ui-dialog-buttonpane').find('button:first').removeClass().addClass('subbut-gra-blue'); $('.input-warning').removeClass('input-warning'); $('.warning-mess').remove(); $("body").css("overflow-y", "hidden"); }, close: function() { $("body").css("overflow-y", "auto"); }, create: function( event, ui ) { $(this).css("maxWidth","580px"); } }); $("#mycarsmannotdialog").dialog({ title: 'Price-Drops Alerts', autoOpen: false, width: '360px', height: 'auto', autoResize:true, modal: true, resizable: false, stack: false, draggable: false, zIndex:'1001', buttons: { "Submitmycars" : { text: "Save", id: "mycarsmannotsend", click : function() { var cinputs = '#mycarsmannotform .required-input-phone:visible'; var counterrors = 0; var totalofinputs = 0; var totalofinputsfinished = 0; $(cinputs).each(function () { totalofinputs++; }).promise().done(function(){ $(cinputs).each(function () { var cinput = $(this); CheckInputsOverall(cinput.attr('id')).promise().done(function(){ totalofinputsfinished++; if (cinput.hasClass('input-warning')) { counterrors++; } if (totalofinputs == totalofinputsfinished && counterrors == 0) { $("#mycarsmannotdialog").dialog('close'); loadnotipopup('Sending, Please Wait...'); $.ajax({ type:"POST", url: '/contact.php', data: $("#mycarsmannotform").serialize(), success: function(data){ if (data == '2') { fadeallnotipopup(); $("#mycarsmannotdialog").dialog('open'); if ($('#mycarssectrts').is(':visible')) { Recaptcha.reload(); } $('#mycarssectrts').show(); } else if (data == '1') { notipopup('Changes has been saved!'); } else { /*DONOTHING*/ } } }); } else { $('.input-warning:visible').first().focus(); } }); }); }); } }, "Cancelmycars" : { text: "Cancel", id: "mycarsmannotcancel", click : function() { $("#mycarsmannotdialog").dialog('close'); } } }, open: function() { $(".ui-dialog-titlebar-close").hide(); $('.ui-dialog :button,input,select').blur(); $('.ui-dialog-buttonpane').find('button').removeClass().addClass('subbut-gra-lightgray'); $('.ui-dialog-buttonpane').find('button:first').removeClass().addClass('subbut-gra-blue'); $('.input-warning').removeClass('input-warning'); $('.warning-mess').remove(); $("body").css("overflow-y", "hidden"); }, close: function() { $("body").css("overflow-y", "auto"); }, create: function( event, ui ) { $(this).css("maxWidth","580px"); } }); $(document).on('click','.textusbut',function(){ $("#textusdialog").dialog("open"); fbq('track', 'Contact'); }); $(document).on('click','.mycarsbut',function(){ window.location.replace("/mycars.php"); }); $(document).on('click','.gt-mobmenu-menu',function(){ if ($('.gt-mainmenu-mobile').is(':visible')) { $('.gt-mainmenu-mobile').hide(); } else { $('.gt-mainmenu-mobile').show(); $('.gt-mainmenu-mobile').css('top',$('#gt-header-container').height() + 'px'); } }); $(document).on('click','.textusoption',function(){ var textusmessage = $('#textusmessage').val().trim(); $('#textusmessage').val("I'd like to " + $(this).text()); }); $('#textusphone').on('focus',function(){ $('#emtufield').val('tih'); }); $(document).on('click','.gp-veh-shortbut-heart-like,.gp-veh-shortbut-heart-unlike',function(e) { var vehid = $(this).attr('vehid'); var mccounter = Number($('.gt-widgets-mycars-icon-header-counter:first div').text()); if ($(this).hasClass('gp-veh-shortbut-heart-like')) { var sendlikestatus = 1; $(this).removeClass('gp-veh-shortbut-heart-like').addClass('gp-veh-shortbut-heart-unlike'); $('.gt-widgets-mycars-icon-header-counter div').text(mccounter + 1).fadeOut(150).fadeIn(400); if (mccounter == '0' && $('#mycarsphone').val() == '') { $('#mycarsmannotdialog').dialog('open'); } fbq('track', 'AddToWishlist'); } else { var sendlikestatus = 2; $(this).removeClass('gp-veh-shortbut-heart-unlike').addClass('gp-veh-shortbut-heart-like'); $('.gt-widgets-mycars-icon-header-counter div').text(mccounter - 1); if (mccounter == 1) { $('.gt-widgets-mycars-icon-header-counter div').hide(); } else { $('.gt-widgets-mycars-icon-header-counter div').fadeOut(150).fadeIn(400); } } $.post("/", { vehid: vehid, vehlikestatus: sendlikestatus }, function(data, status){ }); e.preventDefault(); return false; }); $(document).on('click','.gp-item-video,.gp-inveh-videobut',function(e){ $('.tipsy').remove(); var videourl = $(this).attr('videourl'); $.colorbox({href:videourl, iframe:true,transition:"fade", width:"650px", maxWidth:"100%", height:"440px", fixed:true, onOpen:function(){ $('#cboxClose').remove(); $("body").css("overflow", "hidden"); }, onClosed:function(){ $("body").css("overflow", "auto"); }}); e.preventDefault(); return false; }); $(document).on('change','#midsel',function(){ pickmodels($(this).val()); }); $.fn.isOnScreen = function(){ var win = $(window); var viewport = { top : win.scrollTop(), left : win.scrollLeft() }; viewport.right = viewport.left + win.width(); viewport.bottom = viewport.top + win.height(); var bounds = this.offset(); bounds.right = bounds.left + this.outerWidth(); bounds.bottom = bounds.top + this.outerHeight(); return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom)); }; function lazyloadimg() { $('.gp-item-pic-ll').each(function(){ if ($(this).isOnScreen()) { $(this).css('background','url(' + $(this).attr('imgurl') + ')').removeClass('gp-item-pic-ll'); } }); } $(window).on('scroll touchstart touchend',function(){ lazyloadimg(); }); lazyloadimg(); var slider2 = $('#slideshow-2').royalSlider({ fullscreen: { enabled: false, nativeFS: true }, transitionType: 'fade', controlNavigation: 'none', autoScaleSlider: false, autoScaleSliderWidth: '100%', autoScaleSliderHeight: '700', loop: true, imageScaleMode: 'fill', navigateByClick: true, numImagesToPreload:3, arrowsNav:true, arrowsNavAutoHide: true, arrowsNavHideOnTouch: true, keyboardNavEnabled: true, fadeinLoadedSlide: true, globalCaption: false, globalCaptionInside: false, thumbs: { appendSpan: true, firstMargin: true, paddingBottom: 0 }, autoplay: { enabled: true, pauseOnHover: false, delay: 3000 }, video: { autoHideBlocks: true, autoHideArrows: false, youTubeCode: '' } }); };
    (520) 518-3338
    300 West Grant Rd, Tucson, AZ 85705

    Welcome to Levels Auto

    Retail Motor Vehicle Dealer
    WE OFFER THE BEST PRICES IN AMERICA!

    We Love What We Do.
    We Want You To Love Your Next Vehicle.
    We are Celebrating our 8th Year in Business! 
    BEST PRICING IN AMERICA!

    ALL PRICES ARE MARKED DOWN!
    300 W GRANT RD TUCSON AZ 85705

     
     
     
     
    TEXT US
    MY CARS