1<!doctype html><html lang="en-US" prefix="og: https://ogp.me/ns#"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="profile" href="https://gmpg.org/xfn/11">
1<script>Object.defineProperty(window,"angiePlugin",{value:{"schemaVersion":1,"available":true,"version":"1.1.18"},writable:false,configurable:false});</script>
1
1<script id="google_gtagjs-js-consent-mode-data-layer">window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);} 2gtag('consent', 'default', {"ad_personalization":"denied","ad_storage":"denied","ad_user_data":"denied","analytics_storage":"denied","functionality_storage":"denied","security_storage":"denied","personalization_storage":"denied","region":["AT","BE","BG","CH","CY","CZ","DE","DK","EE","ES","FI","FR","GB","GR","HR","HU","IE","IS","IT","LI","LT","LU","LV","MT","NL","NO","PL","PT","RO","SE","SI","SK"],"wait_for_update":500}); 3window._googlesitekitConsentCategoryMap = {"statistics":["analytics_storage"],"marketing":["ad_storage","ad_user_data","ad_personalization"],"functional":["functionality_storage","security_storage"],"preferences":["personalization_storage"]}; 4window._googlesitekitConsents = {"ad_personalization":"denied","ad_storage":"denied","ad_user_data":"denied","analytics_storage":"denied","functionality_storage":"denied","security_storage":"denied","personalization_storage":"denied","region":["AT","BE","BG","CH","CY","CZ","DE","DK","EE","ES","FI","FR","GB","GR","HR","HU","IE","IS","IT","LI","LT","LU","LV","MT","NL","NO","PL","PT","RO","SE","SI","SK"],"wait_for_update":500};</script>
4 <link media="all" href="https://topeventrental.com/wp-content/cache/autoptimize/css/autoptimize_60d11909cba514db10a9c328f4ccba9d.css" rel="stylesheet"><title>About Us - Top Event Rentals Phoenix AZ</title><meta name="robots" content="follow, index, max-snippet:-1, max-video-preview:-1, max-image-preview:large"/><link rel="canonical" href="https://topeventrental.com/about-us/" /><meta property="og:locale" content="en_US" /><meta property="og:type" content="article" /><meta property="og:title" content="About Us - Top Event Rentals Phoenix AZ" /><meta property="og:description" content="About Top Event Rentals Weâve earned our reputation as the most reliable and experienced event rental and party rental partner in Arizona. With great passion, we have the inventory and logistics expertise to furnish large music festivals, Parks and Recreation events, corporate parties â but we also love to make an intimate backyard event unforgettable […]" /><meta property="og:url" content="https://topeventrental.com/about-us/" /><meta property="og:site_name" content="Top Event Rentals Phoenix AZ" /><meta property="og:updated_time" content="2026-08-28T22:09:24+00:00" /><meta property="article:published_time" content="2020-02-03T17:53:04+00:00" /><meta property="article:modified_time" content="2026-08-28T22:09:24+00:00" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="About Us - Top Event Rentals Phoenix AZ" /><meta name="twitter:description" content="About Top Event Rentals Weâve earned our reputation as the most reliable and experienced event rental and party rental partner in Arizona. With great passion, we have the inventory and logistics expertise to furnish large music festivals, Parks and Recreation events, corporate parties â but we also love to make an intimate backyard event unforgettable […]" /><meta name="twitter:label1" content="Time to read" /><meta name="twitter:data1" content="1 minute" />
4<script type="application/ld+json" class="rank-math-schema">{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://topeventrental.com/#organization","name":"Top Event Rentals Phoenix AZ","url":"https://topeventrental.com","email":"[email protected]","logo":{"@type":"ImageObject","@id":"https://topeventrental.com/#logo","url":"https://topeventrental.com/wp-content/uploads/2020/02/TER-Main-Logo-1-150x150.png","contentUrl":"https://topeventrental.com/wp-content/uploads/2020/02/TER-Main-Logo-1-150x150.png","caption":"Top Event Rentals Phoenix AZ","inLanguage":"en-US"},"legalName":"io"},{"@type":"WebSite","@id":"https://topeventrental.com/#website","url":"https://topeventrental.com","name":"Top Event Rentals Phoenix AZ","publisher":{"@id":"https://topeventrental.com/#organization"},"inLanguage":"en-US"},{"@type":"BreadcrumbList","@id":"https://topeventrental.com/about-us/#breadcrumb","itemListElement":[{"@type":"ListItem","position":"1","item":{"@id":"https://topeventrental.com","name":"Home"}},{"@type":"ListItem","position":"2","item":{"@id":"https://topeventrental.com/about-us/","name":"About Us"}}]},{"@type":"AboutPage","@id":"https://topeventrental.com/about-us/#webpage","url":"https://topeventrental.com/about-us/","name":"About Us - Top Event Rentals Phoenix AZ","datePublished":"2020-02-03T17:53:04+00:00","dateModified":"2026-08-28T22:09:24+00:00","isPartOf":{"@id":"https://topeventrental.com/#website"},"inLanguage":"en-US","breadcrumb":{"@id":"https://topeventrental.com/about-us/#breadcrumb"}},{"@type":"Person","@id":"https://topeventrental.com/author/io/","name":"io","url":"https://topeventrental.com/author/io/","image":{"@type":"ImageObject","@id":"https://secure.gravatar.com/avatar/20a54a484f544a58a679526732ee558eaba712ea1a3cc1a2e3e9bf2729bdb5ef?s=96&d=mm&r=g","url":"https://secure.gravatar.com/avatar/20a54a484f544a58a679526732ee558eaba712ea1a3cc1a2e3e9bf2729bdb5ef?s=96&d=mm&r=g","caption":"io","inLanguage":"en-US"},"worksFor":{"@id":"https://topeventrental.com/#organization"}},{"headline":"About Us - Top Event Rentals Phoenix AZ","@type":"Article","author":{"@id":"https://topeventrental.com/author/io/","name":"io"},"datePublished":"2020-02-03T17:53:04+00:00","dateModified":"2026-08-28T22:09:24+00:00","name":"About Us - Top Event Rentals Phoenix AZ","@id":"https://topeventrental.com/about-us/#schema-20753","isPartOf":{"@id":"https://topeventrental.com/about-us/#webpage"},"publisher":{"@id":"https://topeventrental.com/#organization"},"inLanguage":"en-US","mainEntityOfPage":{"@id":"https://topeventrental.com/about-us/#webpage"}}]}</script>
4 <link rel='dns-prefetch' href='//cdnjs.cloudflare.com' /><link rel='dns-prefetch' href='//www.googletagmanager.com' /><link rel="alternate" type="application/rss+xml" title="Top Event Rentals Phoenix AZ » Feed" href="https://topeventrental.com/feed/" /><link rel="alternate" type="application/rss+xml" title="Top Event Rentals Phoenix AZ » Comments Feed" href="https://topeventrental.com/comments/feed/" /><link rel="alternate" title="oEmbed (JSON)" type="application/json+oembed" href="https://topeventrental.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Ftopeventrental.com%2Fabout-us%2F" /><link rel="alternate" title="oEmbed (XML)" type="text/xml+oembed" href="https://topeventrental.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Ftopeventrental.com%2Fabout-us%2F&format=xml" /><style id="wp-img-auto-sizes-contain-inline-css">img:is([sizes=auto i],[sizes^="auto," i]){contain-intrinsic-size:3000px 1500px} 5/*# sourceURL=wp-img-auto-sizes-contain-inline-css */</style><style id="classic-theme-styles-inline-css">/*! This file is auto-generated */ 6.wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none} 7/*# sourceURL=/wp-includes/css/classic-themes.min.css */</style><style id="global-styles-inline-css">:root{--wp--preset--aspect-ratio--square: 1;--wp--preset--aspect-ratio--4-3: 4/3;--wp--preset--aspect-ratio--3-4: 3/4;--wp--preset--aspect-ratio--3-2: 3/2;--wp--preset--aspect-ratio--2-3: 2/3;--wp--preset--aspect-ratio--16-9: 16/9;--wp--preset--aspect-ratio--9-16: 9/16;--wp--preset--color--black: #000000;--wp--preset--color--cyan-bluish-gray: #abb8c3;--wp--preset--color--white: #ffffff;--wp--preset--color--pale-pink: #f78da7;--wp--preset--color--vivid-red: #cf2e2e;--wp--preset--color--luminous-vivid-orange: #ff6900;--wp--preset--color--luminous-vivid-amber: #fcb900;--wp--preset--color--light-green-cyan: #7bdcb5;--wp--preset--color--vivid-green-cyan: #00d084;--wp--preset--color--pale-cyan-blue: #8ed1fc;--wp--preset--color--vivid-cyan-blue: #0693e3;--wp--preset--color--vivid-purple: #9b51e0;--wp--preset--gradient--vivid-cyan-blue-to-vivid-purple: linear-gradient(135deg,rgb(6,147,227) 0%,rgb(155,81,224) 100%);--wp--preset--gradient--light-green-cyan-to-vivid-green-cyan: linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%);--wp--preset--gradient--luminous-vivid-amber-to-luminous-vivid-orange: linear-gradient(135deg,rgb(252,185,0) 0%,rgb(255,105,0) 100%);--wp--preset--gradient--luminous-vivid-orange-to-vivid-red: linear-gradient(135deg,rgb(255,105,0) 0%,rgb(207,46,46) 100%);--wp--preset--gradient--very-light-gray-to-cyan-bluish-gray: linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%);
7--wp--preset--gradient--cool-to-warm-spectrum: linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%);--wp--preset--gradient--blush-light-purple: linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%);--wp--preset--gradient--blush-bordeaux: linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%);--wp--preset--gradient--luminous-dusk: linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%);--wp--preset--gradient--pale-ocean: linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%);--wp--preset--gradient--electric-grass: linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%);--wp--preset--gradient--midnight: linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%);--wp--preset--font-size--small: 13px;--wp--preset--font-size--medium: 20px;--wp--preset--font-size--large: 36px;--wp--preset--font-size--x-large: 42px;--wp--preset--spacing--20: 0.44rem;--wp--preset--spacing--30: 0.67rem;--wp--preset--spacing--40: 1rem;--wp--preset--spacing--50: 1.5rem;--wp--preset--spacing--60: 2.25rem;--wp--preset--spacing--70: 3.38rem;--wp--preset--spacing--80: 5.06rem;--wp--preset--shadow--natural: 6px 6px 9px rgba(0, 0, 0, 0.2);--wp--preset--shadow--deep: 12px 12px 50px rgba(0, 0, 0, 0.4);--wp--preset--shadow--sharp: 6px 6px 0px rgba(0, 0, 0, 0.2);--wp--preset--shadow--outlined: 6px 6px 0px -3px rgb(255, 255, 255), 6px 6px rgb(0, 0, 0);--wp--preset--shadow--crisp: 6px 6px 0px rgb(0, 0, 0);}.wp-block-button{--wp--preset--dimension--25: 25%;--wp--preset--dimension--50: 50%;--wp--preset--dimension--75: 75%;--wp--preset--dimension--100: 100%;}:where(body) { margin: 0; }:where(.is-layout-flex){gap: 0.5em;}:where(.is-layout-grid){gap: 0.5em;}body .is-layout-flex{display: flex;}.is-layout-flex{flex-wrap: wrap;align-items: center;}.is-layout-flex > :is(*, div){margin: 0;}body .is-layout-grid{display: grid;}.is-layout-grid > :is(*, div){margin: 0;}body{padding-top: 0px;padding-right: 0px;padding-bottom: 0px;padding-left: 0px;}:root :where(.wp-element-button, .wp-block-button__link){background-color: #32373c;border-width: 0;color: #fff;font-family: inherit;font-size: inherit;font-style: inherit;font-weight: inherit;letter-spacing: inherit;line-height: inherit;padding-top: calc(0.667em + 2px);padding-right: calc(1.333em + 2px);padding-bottom: calc(0.667em + 2px);padding-left: calc(1.333em + 2px);text-decoration: none;text-transform: inherit;}.has-black-color{color: var(--wp--preset--color--black) !important;}.has-cyan-bluish-gray-color{color: var(--wp--preset--color--cyan-bluish-gray) !important;}.has-white-color{color: var(--wp--preset--color--white) !important;}.has-pale-pink-color{color: var(--wp--preset--color--pale-pink) !important;}.has-vivid-red-color{color: var(--wp--preset--color--vivid-red) !important;}.has-luminous-vivid-orange-color{color: var(--wp--preset--color--luminous-vivid-orange) !important;}.has-luminous-vivid-amber-color{color: var(--wp--preset--color--luminous-vivid-amber) !important;}.has-light-green-cyan-color{color: var(--wp--preset--color--light-green-cyan) !important;}.has-vivid-green-cyan-color{color: var(--wp--preset--color--vivid-green-cyan) !important;}.has-pale-cyan-blue-color{color: var(--wp--preset--color--pale-cyan-blue) !important;}.has-vivid-cyan-blue-color{color: var(--wp--preset--color--vivid-cyan-blue) !important;}.has-vivid-purple-color{color: var(--wp--preset--color--vivid-purple) !important;}.has-black-background-color{background-color: var(--wp--preset--color--black) !important;}.has-cyan-bluish-gray-background-color{background-color: var(--wp--preset--color--cyan-bluish-gray) !important;}.has-white-background-color{background-color: var(--wp--preset--color--white) !important;}.has-pale-pink-background-color{background-color: var(--wp--preset--color--pale-pink) !important;}.has-vivid-red-background-color{background-color: var(--wp--preset--color--vivid-red) !important;}.has-luminous-vivid-orange-background-color{background-color: var(--wp--preset--color--luminous-vivid-orange) !important;}.has-luminous-vivid-amber-background-color{background-color: var(--wp--preset--color--luminous-vivid-amber) !important;}.has-light-green-cyan-background-color{background-color: var(--wp--preset--color--light-green-cyan) !important;}.has-vivid-green-cyan-background-color{background-color: var(--wp--preset--color--vivid-green-cyan) !important;}.has-pale-cyan-blue-background-color{background-color: var(--wp--preset--color--pale-cyan-blue) !important;}.has-vivid-cyan-blue-background-color{background-color: var(--wp--preset--color--vivid-cyan-blue) !important;}.has-vivid-purple-background-color{background-color: var(--wp--preset--color--vivid-purple) !important;}.has-black-border-color{border-color: var(--wp--preset--color--black) !important;}.has-cyan-bluish-gray-border-color{border-color: var(--wp--preset--color--cyan-bluish-gray) !important;}.has-white-border-color{border-color: var(--wp--preset--color--white) !important;}.has-pale-pink-border-color{border-color: var(--wp--preset--color--pale-pink) !important;}.has-vivid-red-border-color{border-color: var(--wp--preset--color--vivid-red) !important;}.has-luminous-vivid-orange-border-color{border-color: var(--wp--preset--color--luminous-vivid-orange) !important;}.has-luminous-vivid-amber-border-color{border-color: var(--wp--preset--color--luminous-vivid-amber) !important;}.has-light-green-cyan-border-color{border-color: var(--wp--preset--color--light-green-cyan) !important;}.has-vivid-green-cyan-border-color{border-color: var(--wp--preset--color--vivid-green-cyan) !important;}.has-pale-cyan-blue-border-color{border-color: var(--wp--preset--color--pale-cyan-blue) !important;}.has-vivid-cyan-blue-border-color{border-color: var(--wp--preset--color--vivid-cyan-blue) !important;}.has-vivid-purple-border-color{border-color: var(--wp--preset--color--vivid-purple) !important;}.has-vivid-cyan-blue-to-vivid-purple-gradient-background{background: var(--wp--preset--gradient--vivid-cyan-blue-to-vivid-purple) !important;}.has-light-green-cyan-to-vivid-green-cyan-gradient-background{background: var(--wp--preset--gradient--light-green-cyan-to-vivid-green-cyan) !important;}.has-luminous-vivid-amber-to-luminous-vivid-orange-gradient-background{background: var(--wp--preset--gradient--luminous-vivid-amber-to-luminous-vivid-orange) !important;}.has-luminous-vivid-orange-to-vivid-red-gradient-background{background: var(--wp--preset--gradient--luminous-vivid-orange-to-vivid-red) !important;}
7.has-very-light-gray-to-cyan-bluish-gray-gradient-background{background: var(--wp--preset--gradient--very-light-gray-to-cyan-bluish-gray) !important;}.has-cool-to-warm-spectrum-gradient-background{background: var(--wp--preset--gradient--cool-to-warm-spectrum) !important;}.has-blush-light-purple-gradient-background{background: var(--wp--preset--gradient--blush-light-purple) !important;}.has-blush-bordeaux-gradient-background{background: var(--wp--preset--gradient--blush-bordeaux) !important;}.has-luminous-dusk-gradient-background{background: var(--wp--preset--gradient--luminous-dusk) !important;}.has-pale-ocean-gradient-background{background: var(--wp--preset--gradient--pale-ocean) !important;}.has-electric-grass-gradient-background{background: var(--wp--preset--gradient--electric-grass) !important;}.has-midnight-gradient-background{background: var(--wp--preset--gradient--midnight) !important;}.has-small-font-size{font-size: var(--wp--preset--font-size--small) !important;}.has-medium-font-size{font-size: var(--wp--preset--font-size--medium) !important;}.has-large-font-size{font-size: var(--wp--preset--font-size--large) !important;}.has-x-large-font-size{font-size: var(--wp--preset--font-size--x-large) !important;} 8:root :where(.wp-block-icon svg){width: 24px;} 9:where(.wp-block-gallery.is-layout-flex){gap: var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) );}:where(.wp-block-gallery.is-layout-grid){gap: var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) );} 10:where(.wp-block-latest-posts.is-layout-flex){gap: 1.25em;}:where(.wp-block-latest-posts.is-layout-grid){gap: 1.25em;} 11:where(.wp-block-post-template.is-layout-flex){gap: 1.25em;}:where(.wp-block-post-template.is-layout-grid){gap: 1.25em;} 12:where(.wp-block-term-template.is-layout-flex){gap: 1.25em;}:where(.wp-block-term-template.is-layout-grid){gap: 1.25em;} 13:where(.wp-block-columns.is-layout-flex){gap: 2em;}:where(.wp-block-columns.is-layout-grid){gap: 2em;} 14:root :where(.wp-block-pullquote){font-size: 1.5em;line-height: 1.6;} 15/*# sourceURL=global-styles-inline-css */</style><link rel='stylesheet' id='slick-carousel-css-css' href='https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.css?ver=7.1.2' media='all' /><link rel='stylesheet' id='slick-carousel-theme-css-css' href='https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick-theme.min.css?ver=7.1.2' media='all' />
15<script id="jquery-core-js" src="https://topeventrental.com/wp-includes/js/jquery/jquery.min.js?ver=3.7.1"></script>
15
15<script id="io-scripts-js-extra">var io_scripts_vars = {"io_username":"TopEventRentals","io_locationid":"0","io_phonenumber":"(602) 566-1560","io_emailaddress":"[email protected]","io_businesshours":"","io_facebooklink":"https://www.facebook.com/","io_twitterlink":"https://twitter.com/","io_instagramlink":"https://www.instagram.com/","io_youtubelink":"","io_fpnumber":"","io_companyname":"Top Event Rentals Phoenix AZ"}; 16//# sourceURL=io-scripts-js-extra</script>
vendor: 83 bytes, line 16
16 <script id="google_gtagjs-js" src="https://www.googletagmanager.com/gtag/js?id=
16GT-M6JG3G6X
vendor: 18 bytes, line 16
16" async></script>
16<script id="google_gtagjs-js-after">window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);} 17gtag("set","linker",{"domains":["topeventrental.com"]}); 18gtag("js", new Date()); 19gtag("set", "developer_id.dZTNiMT", true); 20gtag("config", "GT-M6JG3G6X"); 21gtag("config", "AW-17323078635"); 22 window._googlesitekit = window._googlesitekit || {}; window._googlesitekit.throttledEvents = []; window._googlesitekit.gtagEvent = (name, data) => { var key = JSON.stringify( { name, data } ); if ( !! window._googlesitekit.throttledEvents[ key ] ) { return; } window._googlesitekit.throttledEvents[ key ] = true; setTimeout( () => { delete window._googlesitekit.throttledEvents[ key ]; }, 5 ); gtag( "event", name, { ...data, event_source: "site-kit" } ); }; 23//# sourceURL=google_gtagjs-js-after</script>
23 <link rel="https://api.w.org/" href="https://topeventrental.com/wp-json/" /><link rel="alternate" title="JSON" type="application/json" href="https://topeventrental.com/wp-json/wp/v2/pages/479" /><link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://topeventrental.com/xmlrpc.php?rsd" /><link rel='shortlink' href='https://topeventrental.com/?p=479' /><meta name="generator" content="Site Kit by Google 1.189.0" />
23<script>
vendor: 327 bytes, lines 23-27
23(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 24new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 25j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 26'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 27})(window,document,'script','dataLayer','
27GTM-NXW3QDCS
vendor: 3 bytes, line 27
27');
27</script>
27 <meta name="generator" content="Elementor 4.3.4; features: additional_custom_breakpoints; settings: css_print_method-external, google_font-enabled, font_display-auto"><style>.e-con.e-parent:nth-of-type(n+4):not(.e-lazyloaded):not(.e-no-lazyload), 28 .e-con.e-parent:nth-of-type(n+4):not(.e-lazyloaded):not(.e-no-lazyload) * { 29 background-image: none !important; 30 } 31 @media screen and (max-height: 1024px) { 32 .e-con.e-parent:nth-of-type(n+3):not(.e-lazyloaded):not(.e-no-lazyload), 33 .e-con.e-parent:nth-of-type(n+3):not(.e-lazyloaded):not(.e-no-lazyload) * { 34 background-image: none !important; 35 } 36 } 37 @media screen and (max-height: 640px) { 38 .e-con.e-parent:nth-of-type(n+2):not(.e-lazyloaded):not(.e-no-lazyload), 39 .e-con.e-parent:nth-of-type(n+2):not(.e-lazyloaded):not(.e-no-lazyload) * { 40 background-image: none !important; 41 } 42 }</style><link rel="icon" href="https://topeventrental.com/wp-content/uploads/2020/02/TER-Icon-Logo-1NEW-1-150x150.png" sizes="32x32" /><link rel="icon" href="https://topeventrental.com/wp-content/uploads/2020/02/TER-Icon-Logo-1NEW-1-300x300.png" sizes="192x192" /><link rel="apple-touch-icon" href="https://topeventrental.com/wp-content/uploads/2020/02/TER-Icon-Logo-1NEW-1-300x300.png" /><meta name="msapplication-TileImage" content="https://topeventrental.com/wp-content/uploads/2020/02/TER-Icon-Logo-1NEW-1-300x300.png" /><style id="wp-custom-css">.grecaptcha-badge { visibility: hidden; } 43 44.search-submit{display:none;} 45 46.cartInfo{ 47 display:none !important; 48} 49.io-footer-link a { 50color: var(--e-global-color-accent, orange); 51} 52 53.catDescriptionIO.catDescriptionIO_small.elementor-widget-text-editor { 54 padding: 10px; 55 font-size: small; 56 text-align: left; 57} 58 59.io_brand { 60 margin-bottom: 20px; 61} 62 63.mega-block-title{ 64 display: none !important; 65} 66 67div.elementor-button, a.elementor-button, .io_item2_list div.view-product-button,.view-product-button { 68 background-color: var(--e-global-color-primary, green) !important; 69} 70 71.io_cat_description *, .io_landingpages{ 72 background:transparent !important; 73 background-color:transparent !important; 74 color:black !important; 75 font-family: var( --e-global-typography-text-font-family ), Sans-serif !important; 76} 77 78#cartPopover { 79 font-family:var(--e-global-typography-primary-font-family) !important; 80} 81 82#cartPopover .elementor-widget-button .elementor-button{ 83 border-radius:0; 84} 85 86#cartCustomMessage{ 87 padding:10px !important; 88 background:red; 89 margin-bottom:10px; 90} 91 92#cartCustomMessage a{ 93 color:white; 94} 95#cartWarning{text-shadow:none;font-weight:600;} 96 97#cartPopover{ 98 background:#261e1e; 99 box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px; 100 border:none; 101 border-radius:0; 102} 103#cartPopover th{ 104 color:white; 105} 106 107.accTextName{ 108 white-space:unset !important; 109 max-width: 83px !important ; 110} 111 112div[ID^='ioAccButtonWrapper_']{ 113 vertical-align:top; 114} 115 116.io_item2_list div.view-product-button:hover{ 117 color:white !important; 118}</style></head><body class="wp-singular page-template-default page page-id-479 wp-custom-logo wp-theme-io-kenos angie-default mega-menu-max-mega-menu-4 mega-menu-max-mega-menu-5 mega-menu-max-mega-menu-6 mega-menu-max-mega-menu-7 mega-menu-max-mega-menu-8 mega-menu-max-mega-menu-9 mega-menu-max-mega-menu-10 elementor-default elementor-kit-812 elementor-page elementor-page-479"><header data-elementor-type="header" data-elementor-id="4254" class="elementor elementor-4254 elementor-location-header" data-elementor-post-type="elementor_library"><section class="elementor-section elementor-top-section elementor-element elementor-element-9e87b57 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="9e87b57" data-element_type="section" data-e-type="section" data-settings="{"background_background":"classic"}"><div class="elementor-container elementor-column-gap-default"><div class="elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-b118f21" data-id="b118f21" data-element_type="column" data-e-type="column"><div class="elementor-widget-wrap elementor-element-populated"><div class="elementor-element elementor-element-4c9622c elementor-widget elementor-widget-wp-widget-searchio_live_search" data-id="4c9622c" data-element_type="widget" data-e-type="widget" data-widget_type="wp-widget-searchio_live_search.default"><div class="elementor-widget-container"><form role="search" method="get" class="searchio-live-search-widget-search-form" action="https://topeventrental.com"> <label> <span class="screen-reader-text">Search for:</span> <input type="search" class="search-field" style="width: 220px" placeholder="Search for..." value="" name="s" data-swplive="true" data-swpengine="default" data-swpconfig="default" autocomplete="off"> </label> <input type="submit" class="search-submit" value="Search"></form></div></div></div></div><div class="elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-57457f3" data-id="57457f3" data-element_type="column" data-e-type="column" data-settings="{"background_background":"classic"}"><div class="elementor-widget-wrap elementor-element-populated"><div class="elementor-element elementor-element-3475cc6 ioCart elementor-view-default elementor-widget elementor-widget-icon" data-id="3475cc6" data-element_type="widget" data-e-type="widget" data-widget_type="icon.default"><div class="elementor-widget-container"><div class="elementor-icon-wrapper"><div class="elementor-icon"> <i aria-hidden="true" class="fas fa-shopping-basket"></i></div></div></div></div></div></div></div></section><section class="elementor-section elementor-top-section elementor-element elementor-element-590b6de4 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="590b6de4" data-element_type="section" data-e-type="section" data-settings="{"background_background":"classic"}"><div class="elementor-container elementor-column-gap-default"><div class="elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-5a4807a3" data-id="5a4807a3" data-element_type="column" data-e-type="column"><div class="elementor-widget-wrap elementor-element-populated"><div class="elementor-element elementor-element-5dc4feb6 elementor-widget elementor-widget-theme-site-logo elementor-widget-image" data-id="5dc4feb6" data-element_type="widget" data-e-type="widget" data-widget_type="theme-site-logo.default"><div class="elementor-widget-container"> <a href="https://topeventrental.com"> <img width="2560" height="2411" src="https://topeventrental.com/wp-content/uploads/2020/02/TER-Main-Logo-1-scaled.png" class="attachment-full size-full wp-image-5575" alt="" srcset="https://topeventrental.com/wp-content/uploads/2020/02/TER-Main-Logo-1-scaled.png 2560w, https://topeventrental.com/wp-content/uploads/2020/02/TER-Main-Logo-1-300x283.png 300w, https://topeventrental.com/wp-content/uploads/2020/02/TER-Main-Logo-1-1024x964.png 1024w, https://topeventrental.com/wp-content/uploads/2020/02/TER-Main-Logo-1-768x723.png 768w, https://topeventrental.com/wp-content/uploads/2020/02/TER-Main-Logo-1-1536x1447.png 1536w, https://topeventrental.com/wp-content/uploads/2020/02/TER-Main-Logo-1-2048x1929.png 2048w" sizes="(max-width: 2560px) 100v
118w, 2560px" /> </a></div></div></div></div><div class="elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-226653fc" data-id="226653fc" data-element_type="column" data-e-type="column"><div class="elementor-widget-wrap elementor-element-populated"><div class="elementor-element elementor-element-08de256 elementor-widget__width-initial elementor-widget elementor-widget-maxmegamenu" data-id="08de256" data-element_type="widget" data-e-type="widget" data-widget_type="maxmegamenu.default"><div class="elementor-widget-container"><div id="mega-menu-wrap-max_mega_menu_8" class="mega-menu-wrap"><div class="mega-menu-toggle"><div class="mega-toggle-blocks-left"></div><div class="mega-toggle-blocks-center"><div class='mega-toggle-block mega-menu-toggle-block mega-toggle-block-1' id='mega-toggle-block-1'><button aria-controls="mega-menu-max_mega_menu_8" aria-expanded="false" aria-haspopup="true" class='mega-toggle-standard mega-toggle-label'><span class='mega-toggle-label-closed'></span><span class='mega-toggle-label-open'></span></button></div></div><div class="mega-toggle-blocks-right"></div></div><ul id="mega-menu-max_mega_menu_8" class="mega-menu max-mega-menu mega-menu-horizontal mega-no-js" data-event="hover_intent" data-effect="fade_up" data-effect-speed="200" data-effect-mobile="disabled" data-effect-speed-mobile="0" data-mobile-force-width="body" data-second-click="go" data-document-click="collapse" data-vertical-behaviour="standard" data-breakpoint="600" data-unbind="true" data-mobile-state="collapse_all" data-mobile-direction="vertical"><li class="mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-menu-item-home mega-menu-item-3808" id="mega-menu-item-3808"><a class="mega-menu-link" href="https://topeventrental.com/">Home</a></li><li class="mega-menu-item mega-menu-item-type-custom mega-menu-item-object-custom mega-menu-megamenu mega-menu-item-has-children mega-align-bottom-left mega-menu-item-3814" id="mega-menu-item-3814"><a class="mega-menu-link" href="#" aria-expanded="false" aria-controls="mega-sub-menu-3814">Products<span class="mega-indicator" aria-hidden="true"></span></a><ul class="mega-sub-menu" id='mega-sub-menu-3814'><li class="mega-menu-item mega-menu-item-type-widget widget_elementor-library mega-menu-column-standard mega-menu-columns-6-of-6 mega-menu-item-elementor-library-2" style="--columns:6; --span:6" id="mega-menu-item-elementor-library-2"><h4 class="mega-block-title">menu</h4><div data-elementor-type="page" data-elementor-id="5911" class="elementor elementor-5911" data-elementor-post-type="elementor_library"><section class="elementor-section elementor-top-section elementor-element elementor-element-974aa8f elementor-section-full_width elementor-section-height-default elementor-section-height-default" data-id="974aa8f" data-element_type="section" data-e-type="section"><div class="elementor-container elementor-column-gap-default"><div class="elementor-column elementor-col-25 elementor-top-column elementor-element elementor-element-55e31b2" data-id="55e31b2" data-element_type="column" data-e-type="column" data-settings="{"background_background":"slideshow","background_slideshow_gallery":[{"id":6055,"url":"https:\/\/topeventrental.com\/wp-content\/uploads\/2025\/06\/Scottsdale-Culinary-Festival.jpg"},{"id":6059,"url":"https:\/\/topeventrental.com\/wp-content\/uploads\/2025\/06\/Festival-of-the-Arts.jpg"},{"id":5760,"url":"https:\/\/topeventrental.com\/wp-content\/uploads\/2025\/06\/ASU-Homecoming-Aerial.png"},{"id":5733,"url":"https:\/\/topeventrental.com\/wp-content\/uploads\/2025\/06\/Mavericks-Obstacle-Course.jpg"},{"id":5764,"url":"https:\/\/topeventrental.com\/wp-content\/uploads\/2025\/06\/Baby-Shower.jpg"}],"background_slideshow_slide_duration":2000,"background_slideshow_loop":"yes","background_slideshow_slide_transition":"fade","background_slideshow_transition_duration":500}"><div class="elementor-widget-wrap elementor-element-populated"><div class="elementor-element elementor-element-40ab092 elementor-widget elementor-widget-spacer" data-id="40ab092" data-element_type="widget" data-e-type="widget" data-widget_type="spacer.default"><div class="elementor-widget-container"><div class="elementor-spacer"><div class="elementor-spacer-inner"></div></div></div></div></div></div><div class="elementor-column elementor-col-25 elementor-top-column elementor-element elementor-element-3288904" data-id="3288904" data-element_type="column" data-e-type="column"><div class="elementor-widget-wrap elementor-element-populated"><div class="elementor-element elementor-element-9a72de1 elementor-icon-list--layout-traditional elementor-list-item-link-full_width elementor-widget elementor-widget-icon-list" data-id="9a72de1" data-element_type="widget" data-e-type="widget" data-widget_type="icon-list.default"><div class="elementor-widget-container"><ul class="elementor-icon-list-items"><li class="elementor-icon-list-item"> <a href="https://topeventrental.com/rentals/tables/"> <span class="elementor-icon-list-text">Tables</span> </a></li><li class="elementor-icon-list-item"> <a href="https://topeventrental.com/rentals/chairs/"> <span class="elementor-icon-list-text">Chairs</span> </a></li><li class="elementor-icon-list-item"> <a href="https://topeventrental.com/rentals/linens/"> <span class="elementor-icon-list-text">Linens</span> </a></li><li class="elementor-icon-list-item"> <a href="https://topeventrental.com/rentals/tents-and-accessories/"> <span class="elementor-icon-list-text">Tents and Accessories</span> </a></li><li class="elementor-icon-list-item"> <a href="https://topeventrental.com/inflatables/"> <span class="elementor-icon-list-text">Inflatables</span> </a></li></ul></div></div></div></div><div class="elementor-column elementor-col-25 elementor-top-column elementor-element elementor-element-6af5ccb" data-id="6af5ccb" data-element_type="column" data-e-type="column"><div class="elementor-widget-wrap elementor-element-populated"><div class="elementor-element elementor-element-ed2a941 elementor-icon-list--layout-traditional elementor-list-item-link-full_width elementor-widget elementor-widget-icon-list" data-id="ed2a941" data-element_type="widget" data-e-type="widget" data-widget_type="icon-list.default"><div class="elementor-widget-container"><ul class="elementor-icon-list-items"><li class="elementor-icon-list-item"> <a href="https://topeventrental.com/rentals/marquee-letters/"> <span class="elementor-icon-list-text">Marquee Letters</span> </a></li><li class="elementor-icon-list-item"> <a href="https://topeventrental.com/rentals/dance-floors-and-stages/"> <span class="elementor-icon-list-text">Dance Floor and Stages</span> </a></li><li class="elementor-icon-list-item"> <a href="https://topeventrental.com/rentals/games/"> <span class="elementor-icon-list-text">Games</span> </a></li><li class="elementor-icon-list-item"> <a href="https://topeventrental.com/rentals/food/"> <span class="elementor-icon-list-text">Concessions</span> </a></li></ul></div></div></div></div><div class="elementor-column elementor-col-25 elementor-top-column elementor-element elementor-element-66a0183" data-id="66a0183" data-element_type="column" data-e-type="column"><div class="elementor-widget-wrap elementor-element-populated"><div class="elementor-element elementor-element-fae961b elementor-icon-list--layout-traditional elementor-list-item-link-full_width elementor-widget elementor-widget-icon-list" data-id="fae961b" data-element_type="widget" data-e-type="widget" data-widget_type="icon-list.default"><div class="elementor-widget-container"><ul class="elementor-icon-list-items"><li class="elementor-icon-list-item"> <a href="https://topeventrental.com/rentals/air-conditioning-heating-and-power/"> <span class="elementor-icon-list-text">AC, Heating, Power</span> </a></li><li class="elementor-icon-list-item"> <a href="https://topeventrental.com/rentals/ice-chest-and-sanitary/"> <span class="elementor-icon-list-text">Ice Chest and Sanitary</span> </a></li><li class="elementor-icon-list-item"> <a href="https://topeventrental.com/rentals/audio/"> <span class="elementor-icon-list-text">Podiums & Sound</span> </a></li><li class="elementor-icon-list-item"> <a href="https://topeventrental.com/rentals/crowd-control/"> <span class="elementor-icon-list-text">Crowd Control</span> </a></li><li class="elementor-icon-list-item"> <a href="https://topeventrental.com/rentals/misc/"> <span class="elementor-icon-list-text">Misc</span> </a></li></ul></div></div></div></div></div></section></div></li></ul></li><li class="mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-menu-item-18682" id="mega-menu-item-18682"><a class="mega-menu-link" href="https://topeventrental.com/resources/">Resources</a></li><li class="mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-current-menu-item mega-page_item mega-page-item-479 mega-current_page_item mega-menu-item-3810" id="mega-menu-item-3810"><a class="mega-menu-link" href="https://topeventrental.com/about-us/" aria-current="page">About Us</a></li><li class="mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-menu-item-3811" id="mega-menu-item-3811"><a class="mega-menu-link" href="https://topeventrental.com/contact-us/">Contact Us</a></li></ul></div></div></div></div></div></div></section></header><main id="main" class="site-main" role="main"><header class="page-header io_phshow"><div class ="elementor-widget-heading"><p id="breadcrumbs" class="io-entry-title elementor-heading-title"><a href="https://topeventrental.com">Home</a><span class="separator"> » </span><span class="last">About Us</span></p></div></header><div class="page-content"><div data-elementor-type="wp-page" data-elementor-id="479" class="elementor elementor-479" data-elementor-post-type="page"><section class="elementor-section elementor-top-section elementor-element elementor-element-c145572 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="c145572" data-element_type="section" data-e-type="section" data-settings="{"background_background":"classic"}"><div class="elementor-container elementor-column-gap-default"><div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-4eb2cdf" data-id="4eb2cdf" data-element_type="column" data-e-type="column"><div class="elementor-widget-wrap elementor-element-populated"><div class="elementor-element elementor-element-2b6d8f4 elementor-widget elementor-widget-spacer" data-id="2b6d8f4" data-element_type="widget" data-e-type="widget" data-widget_type="spacer.default"><div class="elementor-widget-container"><div class="elementor-spacer"><div class="elementor-spacer-inner"></div></div></div></div></div></div></div></section><section class="elementor-section elementor-top-section elementor-element elementor-element-4492794 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="4492794" data-element_type="section" data-e-type="section" data-settings="{"shape_divider_bottom":"curve"}"><div class="elementor-shape elementor-shape-bottom" aria-hidden="true" data-negative="false"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none"> <path class="elementor-shape-fill" d="M1000,4.3V0H0v4.3C0.9,23.1,126.7,99.2,500,100S1000,22.7,1000,4.3z"/> </svg></div><div class="elementor-container elementor-column-gap-default"><div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-d38d21b" data-id="d38d21b" data-element_type="column" data-e-type="column"><div class="elementor-widget-wrap elementor-element-populated"><div class="elementor-element elementor-element-c88343b elementor-invisible elementor-widget elementor-widget-heading" data-id="c88343b" data-element_type="widget" data-e-type="widget" data-settings="{"_animation":"fadeInDown"}" data-widget_type="heading.default"><div class="elementor-widget-container"><h2 class="elementor-heading-title elementor-size-default">About Top Event Rentals</h2></div></div><div class="elementor-element elementor-element-cfe88eb elementor-invisible elementor-widget elementor-widget-text-editor" data-id="cfe88eb" data-element_type="widget" data-e-type="widget" data-settings="{"_animation":"fadeIn"}" data-widget_type="text-editor.default"><div class="elementor-widget-container"><p data-renderer-start-pos="3450">Weâve earned our reputation as the most reliable and experienced event rental and party rental partner in Arizona. With great passion, we have the inventory and logistics expertise to furnish large music festivals, Parks and Recreation events, corporate parties â but we also love to make an intimate backyard event unforgettable with one-of-a-kind event styling! Our pricing is competitive, allowing us to bring your vision to life â all within your budget! </p><p data-renderer-start-pos="3894">
118Discover your perfect event in our collection of tents, tables, chairs, linen, dance floors, staging, bounce houses, marquee letters, lawn games, heaters and more for rent. We stay on top of trends, bringing the freshest looks to Metro Phoenix without breaking your budget. We can work together with your design team to bring your event vision to life, or we can meet with you one-on-one at your event site to help you ï¬nd just the right items to make your event unforgettable. Something as simple as bounce house rentals at a Phoenix birthday party to an event as complex as tent rentals in <a href="https://www.scottsdaleaz.gov/parks" target="_blank" rel="noopener">Scottsdale</a>; we are your trusted event rental and party rental experts.</p><p data-renderer-start-pos="4312">Our rental process is hassle-free: book online for backyard parties or work with a TOP event consultant to custom-build your larger scale event rental order. Our professional team is passionate about the event industry. The Top Event Rentals staff has provided event rentals for Phoenix, Arizona events such as <a href="https://www.asu.edu/" target="_blank" rel="noopener">Arizona State University</a> Homecoming, <a href="https://pattillmanfoundation.org/" target="_blank" rel="noopener">Pat’s Run</a> in Tempe, <a href="https://www.phoenix.gov/administration/departments/parks.html" target="_blank" rel="noopener">Fabulous Phoenix 4th</a>, <a href="https://eoss.asu.edu/pab/devilpalooza" target="_blank" rel="noopener">Devilpalooza</a>, <a href="https://www.nike.com/" target="_blank" rel="noopener">Nike</a> shows and more. Our bounce houses, tents, tables, chairs, linens, stages, marquee letter rentals have been in beautiful venues such as <a href="https://www.maricopacountyparks.net/park-locator/estrella-mountain-regional-park/" target="_blank" rel="noopener">Estrella Regional Park</a>, <a href="https://www.desertdiamondarena.com/" target="_blank" rel="noopener">Desert Diamond Arena</a>, <a href="https://saltriverfields.com/" target="_blank" rel="noopener">Salt River Fields of Phoenix</a>, and more!</p><p data-renderer-start-pos="4618">Top Event Rentals is ready to make your next event perfect! You can trust Top Event Rentals with your event rental needs in Arizona!</p></div></div></div></div></div></section><section class="elementor-section elementor-top-section elementor-element elementor-element-bdbe203 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="bdbe203" data-element_type="section" data-e-type="section" data-settings="{"background_background":"classic"}"><div class="elementor-container elementor-column-gap-default"><div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-3d60974" data-id="3d60974" data-element_type="column" data-e-type="column"><div class="elementor-widget-wrap elementor-element-populated"><div class="elementor-element elementor-element-a304257 elementor-widget elementor-widget-gallery" data-id="a304257" data-element_type="widget" data-e-type="widget" data-settings="{"gallery_layout":"justified","ideal_row_height":{"unit":"px","size":262,"sizes":[]},"lazyload":"yes","ideal_row_height_tablet":{"unit":"px","size":150,"sizes":[]},"ideal_row_height_mobile":{"unit":"px","size":150,"sizes":[]},"gap":{"unit":"px","size":10,"sizes":[]},"gap_tablet":{"unit":"px","size":10,"sizes":[]},"gap_mobile":{"unit":"px","size":10,"sizes":[]},"link_to":"file","content_hover_animation":"fade-in"}" data-widget_type="gallery.default"><div class="elementor-widget-container"><div class="elementor-gallery__container"> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/Festival-of-the-Arts.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/Festival-of-the-Arts-300x176.jpg" data-width="300" data-height="176" aria-label="Tent rentals phoenix event rentals phoenix, arizona party rentals near me" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/Scottsdale-Culinary-Festival.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/Scottsdale-Culinary-Festival-300x200.jpg" data-width="300" data-height="200" aria-label="Tents for rent scottsdale Tents for rent near me Event rentals Scottsdale, Arizona" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2026/01/2025-12-26.webp"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2026/01/2025-12-26-300x160.webp" data-width="300" data-height="160" aria-label="Tables and chairs for rent table and chair rentals party rentals phoenix" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/Tempe-Town-Lake.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/Tempe-Town-Lake-300x200.jpg" data-width="300" data-height="200" aria-label="Party rentals tempe event rentals tempe tent rentals tempe, arizona" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/Anthem-Water-Slides-scaled.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/Anthem-Water-Slides-300x225.jpg" data-width="300" data-height="225" aria-label="water slide rentals near me water slide rentals anthem arizona water slide rentals" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/Mesa-High-School-Graduation.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/Mesa-High-School-Graduation-300x269.jpg" data-width="300" data-height="269" aria-label="Chair rentals mesa arizona event rentals mesa party rentals phoenix" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/ASU-Homecoming-Aerial.png"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/ASU-Homecoming-Aerial-300x231.png" data-width="300" data-height="231" aria-label="event rentals tempe tent rentals tempe party rentals tempe" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2026/07/Crybaby-watch-party-tent-rental-phoenix-arizona.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2026/07/Crybaby-watch-party-tent-rental-phoenix-arizona-300x221.jpg" data-width="300" data-height="221" aria-label="Tent Rentals phoenix Party rentals phoenix" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/Mavericks-Obstacle-Course.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/Mavericks-Obstacle-Course-300x262.jpg" data-width="300" data-height="262" aria-label="bounce house rentals goodyear arizona bounce house for rent near me obstacle course for rent" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2026/01/2025-12-02.webp"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2026/01/2025-12-02-300x206.webp" data-width="300" data-height="206" aria-label="Tent Rentals Phoenix Tent rentals near me festival event rentals in arizona" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/ASU-Inflatables-scaled.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/ASU-Inflatables-225x300.jpg" data-width="225" data-height="300" aria-label="Bounce house rental tempe arizona bounce house rental near me event rentals tempe" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2026/01/2025-12-30.webp"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2026/01/2025-12-30-300x167.webp" data-width="300" data-height="167" aria-label="Tents for rent phoenix, Arizona Tent rentals glendale party rentals near me" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2026/05/DJI_202
11860403192633_0628_D-scaled-e1781643694116.jpeg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2026/05/DJI_20260403192633_0628_D-scaled-e1781643694116-300x225.jpeg" data-width="300" data-height="225" aria-label="Bounce House Rental Goodyear, Az Tent Rental Goodyear, Az Party Rentals Goodyear, Arizona" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/Goodyear-Lakeside-Music-Festival.png"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/Goodyear-Lakeside-Music-Festival-300x199.png" data-width="300" data-height="199" aria-label="Tent rentals goodyear arizona event rentals goodyear party rentals phoenix" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/Sedona-White-Resin-Chairs.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/Sedona-White-Resin-Chairs-200x300.jpg" data-width="200" data-height="300" aria-label="chair rentals sedona sedona event rentals sedona party rentals" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2026/01/Biltomore-Chairs.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2026/01/Biltomore-Chairs-300x200.jpg" data-width="300" data-height="200" aria-label="Chair rentals scottsdale Table and chair rentals scottsdale" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2026/01/Tent-Rental-Tempe.png"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2026/01/Tent-Rental-Tempe-300x209.png" data-width="300" data-height="209" aria-label="tent rentals phoenix table and chair rentals event rentals phoenix, arizona" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2026/01/Festival-Tents.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2026/01/Festival-Tents-300x210.jpg" data-width="300" data-height="210" aria-label="Tent rentals phoenix tent rentals scottsdale festival rentals event rentals near me" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/Goodyear-Beer-Garden-w_-tables.png"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/Goodyear-Beer-Garden-w_-tables-300x214.png" data-width="300" data-height="214" aria-label="table and chair rentals party rentals goodyear table and chair rentals goodyear arizona" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/Goodyear-Combo-Line-scaled.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/Goodyear-Combo-Line-300x225.jpg" data-width="300" data-height="225" aria-label="bounce house rentals bounce house rentals goodyear bounce house rentals phoenix party rentals" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2026/01/Resin-Chair-Rental-Tempe.png"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2026/01/Resin-Chair-Rental-Tempe-277x300.png" data-width="277" data-height="300" aria-label="Wedding Rentals Near Me, Wedding Rentals Phoenix, Wedding Rentals Glendale" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/Scottsdale-Speech.png"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/Scottsdale-Speech-300x210.png" data-width="300" data-height="210" aria-label="Chair Rentals Phoenix Chair Rentals Near Me Chairs for Rent Glendale" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2026/01/Chairs-at-concert-2.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2026/01/Chairs-at-concert-2-300x225.jpg" data-width="300" data-height="225" aria-label="Chair Rentals Phoenix Table and chair rentals near me" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/JD-Vance-Rally.png"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/JD-Vance-Rally-244x300.png" data-width="244" data-height="300" aria-label="chairs for rent near me chair rentals phoenix party rentals scottsdale" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/Firefighter-Christmas-Party.png"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/Firefighter-Christmas-Party-234x300.png" data-width="234" data-height="300" aria-label="table and chair rentals phoenix table and chair rentals near me party rentals phoenix" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2026/01/Satyr-Entertainment-
118x-Top-Event-Rentals-Tent.webp"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2026/01/Satyr-Entertainment-x-Top-Event-Rentals-Tent-300x162.webp" data-width="300" data-height="162" aria-label="tents for rent near me tent rentals scottsdale party rentals scottsdale" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/4020Water20Slide20Scottsdale_1751311895_big.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/4020Water20Slide20Scottsdale_1751311895_big-300x286.jpg" data-width="300" data-height="286" aria-label="water slide rentals phoenix arizona water slides for rent water slide rental near me" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/Devilpalooza-2.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/Devilpalooza-2-300x167.jpg" data-width="300" data-height="167" aria-label="event rentals tempe tempe party rentals stage rentals tempe" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/Graduation-Event.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/Graduation-Event-172x300.jpg" data-width="172" data-height="300" aria-label="tents for rent near me tent rentals phoenix tent rental arizona" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/27ft20H20Patriot20Water20Slide_1750655916_big.png"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/27ft20H20Patriot20Water20Slide_1750655916_big-300x225.png" data-width="300" data-height="225" aria-label="water slide rentals water slide for rent near me water slide rentals phoenix arizona" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/Pat-Tillman-Run-Hospitality-Tent.png"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/Pat-Tillman-Run-Hospitality-Tent-300x206.png" data-width="300" data-height="206" aria-label="tent rentals tempe tents for rent in tempe arizona event rentals tempe, arizona" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/Memorial-Day-Tents.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/Memorial-Day-Tents-170x300.jpg" data-width="170" data-height="300" aria-label="Tent rentals near me event rentals near me tent rentals Mesa, Arizona" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/ASU-Homecoming-Inflatables-scaled.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/ASU-Homecoming-Inflatables-225x300.jpg" data-width="225" data-height="300" aria-label="Bounce house rentals near me Bounce house rentals Tempe, Arizona Party rentals near me" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/Goodyear-Sign-Tents-scaled.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/Goodyear-Sign-Tents-225x300.jpg" data-width="225" data-height="300" aria-label="Tent rentals Goodyear Table and chair rentals Goodyear Table and chair rentals near me" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/Gilbert-High-School-Chairs.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/Gilbert-High-School-Chairs-225x300.jpg" data-width="225" data-height="300" aria-label="Chair rentals near me Chair rentals gilbert Table and chair rentals Gilbert, Arizona" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/Bellair-Golf-Park-Water-Slides.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/Bellair-Golf-Park-Water-Slides-300x169.jpg" data-width="300" data-height="169" aria-label="Water Slide Rentals Phoenix Water Slide Rentals Near Me Water slide for rent Scottsdale" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/Dobson-High-School-Graduation.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/Dobson-High-School-Graduation-300x135.jpg" data-width="300" data-height="135" aria-label="Chair rentals near me Chair rentals mesa Table and chair rentals Mesa, Arizona" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2025/06/Goodyear-Employee-Picnic.png"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2025/06/Goodyear-Employee-Picnic-300x186.png" data-width="300" data-height="186" aria-label="Tent rentals near me Table and chairs for rent event rentals near me" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2026/04/IMG_3034-scaled.jpeg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2026/04/IMG_3034-225x300.jpeg" data-width="225" data-height="300" aria-label="Dance floor rentals phoenix, Az Dance floor rentals Glendale, Az Event Rentals Arizona" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2026/04/IMG_0383-scaled.jpeg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2026/04/IMG_0383-225x300.jpeg" data-width="225" data-height="300" aria-label="Tent Rental Tempe, Az Tent Rentals Phoenix, Az Event Rentals Phoenix" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2026/04/IMG_1854-scaled.jpeg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2026/04/IMG_1854-169x300.jpeg" data-width="169" data-height="300" aria-label="Dance Floor Mesa, Arizona Dance Floor Phoenix, Arizona Event Rentals Phoenix" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2026/08/DEVILPALOOZA2025-071-scaled.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2026/08/DEVILPALOOZA2025-071-300x200.jpg" data-width="300" data-height="200" aria-label="Tempe event rentals Tempe party rentals Tempe tent rentals" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2026/08/Goodyear-event-rentals-1.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2026/08/Goodyear-event-rentals-1-300x172.jpg" data-width="300" data-height="172" aria-label="Chair Rentals Goodyear" role="img" ></div> </a> <a class="e-gallery-item elementor-gallery-item elementor-animated-content" href="https://topeventrental.com/wp-content/uploads/2026/08/Phoenix-Event-Rentals.jpg"><div class="e-gallery-image elementor-gallery-item__image" data-thumbnail="https://topeventrental.com/wp-content/uploads/2026/08/Phoenix-Event-Rentals-300x296.jpg" data-width="300" data-height="296" aria-label="Phoenix tent rentals phoenix chair rentals phoenix party rentals" role="img" ></div> </a></div></div></div></div></div></div></section></div></div></main><footer data-elementor-type="footer" data-elementor-id="4256" class="elementor elementor-4256 elementor-location-footer" data-elementor-post-type="elementor_library"><section class="elementor-section elementor-top-section elementor-element elementor-element-3824a239 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="3824a239" data-element_type="section" data-e-type="section" id="io_contactform" data-settings="{"background_background":"classic","shape_divider_top":"curve"}"><div class="elementor-background-overlay"></div><div class="elementor-shape elementor-shape-top" aria-hidden="true" data-negative="false"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none"> <path class="elementor-shape-fill" d="M1000,4.3V0H0v4.3C0.9,23.1,126.7,99.2,500,100S1000,22.7,1000,4.3z"/> </svg></div><div class="elementor-container elementor-column-gap-default"><div class="elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-39040316" data-id="39040316" data-element_type="column" data-e-type="column"><div class="elementor-widget-wrap elementor-element-populated"><div class="elementor-element elementor-element-52043b3 elementor-widget elementor-widget-heading" data-id="52043b3" data-element_type="widget" data-e-type="widget" data-widget_type="heading.default"><div class="elementor-widget-container"><h2 class="elementor-heading-title elementor-size-default">Company Hours of Operation</h2></div></div><div class="elementor-element elementor-element-0df5016 elementor-widget elementor-widget-text-editor" data-id="0df5016" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><p data-renderer-start-pos="75">M-F: 9AM-5PM</p><p data-renderer-start-pos="75">Saturday: 9AM-1PM</p><p data-renderer-start-pos="106">Sunday: Closed</p></div></div><div class="elementor-element elementor-element-424d5493 elementor-widget elementor-widget-heading" data-id="424d5493" data-element_type="widget" data-e-type="widget" data-widget_type="heading.default"><div class="elementor-widget-container"><h2 class="elementor-heading-title elementor-size-xxl">Contact Us</h2></div></div><div class="elementor-element elementor-element-2e77964c elementor-icon-list--layout-traditional elementor-list-item-link-full_width elementor-widget elementor-widget-icon-list" data-id="2e77964c" data-element_type="widget" data-e-type="widget" data-widget_type="icon-list.default"><div class="elementor-widget-container"><ul class="elementor-icon-list-items"><li class="elementor-icon-list-item"> <a href="tel:(602)%20566-1560"> <span class="elementor-icon-list-text">(602) 566-1560</span> </a></li><li class="elementor-icon-list-item"> <a href="mailto:[email protected]"> <span class="elementor-icon-list-text">[email protected]</span> </a></li><li class="elementor-icon-list-item"> <span class="elementor-icon-list-text">5755 N 51st Ave STE #11 Glendale, AZ 85301</span></li></ul></div></div><div class="elementor-element elementor-element-eea76c5 e-grid-align-left elementor-shape-rounded elementor-grid-0 elementor-widget elementor-widget-social-icons" data-id="eea76c5" data-element_type="widget" data-e-type="widget" data-widget_type="social-icons.default"><div class="elementor-widget-container"><div class="elementor-social-icons-wrapper elementor-grid" role="list"> <span class="elementor-grid-item" role="listitem"> <a class="elementor-icon elementor-social-icon elementor-social-icon-facebook elementor-repeater-item-35553f6" href="https://www.facebook.com/share/1TwEonfZMs/?mibextid=wwXIfr" target="_blank"> <span class="elementor-screen-only">Facebook</span> <i aria-hidden="true" class="fab fa-facebook"></i> </a> </span> <span class="elementor-grid-item" role="listitem"> <a class="elementor-icon elementor-social-icon elementor-social-icon-instagram elementor-repeater-item-a3365d7" href="https://www.instagram.com/topeventrentals?igsh=MTFnYmNwa2ZvNG1lbw==" target="_blank"> <span class="elementor-screen-only">Instagram</span> <i aria-hidden="true" class="fab fa-instagram"></i> </a> </span> <span class="elementor-grid-item" role="listitem"> <a class="elementor-icon elementor-social-icon elementor-social-icon-youtube elementor-repeater-item-ab7e814" href="http://www.youtube.com/@topeventrentalsaz" target="_blank"> <span class="elementor-screen-only">Youtube</span> <i aria-hidden="true" class="fab fa-youtube"></i> </a> </span> <span class="elementor-grid-item" role="listitem"> <a class="elementor-icon elementor-social-icon elementor-social-icon-linkedin elementor-repeater-item-e1b3715" href="https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://www.linkedin.com/company/top-event-rentals&ved=2ahUKEwj505CIwYmUAxV4le4BHZ_bJ-cQ9zB6BAg2EAc&usg=AOvVaw25hAClKutewZy4XJD84jQW" target="_blank"> <span class="elementor-screen-only">Linkedin</span> <i aria-hidden="true" class="fab fa-linkedin"></i> </a> </span> <span class="elementor-grid-item" role="listitem"> <a class="elementor-icon elementor-social-icon elementor-social-icon-tiktok elementor-repeater-item-95d73bb" href="https://www.tiktok.com/@topeventrentals?_t=ZP-8xAEKeiwgtr&_r=1" target="_blank"> <span class="elementor-screen-only">Tiktok</span> <i aria-hidden="true" class="fab fa-tiktok"></i> </a> </span></div></div></div></div></div><div class="elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-5ba8a1eb" data-id="5ba8a1eb" data-element_type="column" data-e-type="column"><div class="elementor-widget-wrap elementor-element-populated"><div class="elementor-element elementor-element-5440d2e elementor-button-align-stretch elementor-widget elementor-widget-global elementor-global-4706 elementor-widget-form" data-id="5440d2e" data-element_type="widget" data-e-type="widget" data-settings="{"step_next_label":"Next","step_previous_label":"Previous","button_width":"100","step_type":"number_text","step_icon_shape":"circle"}" data-widget_type="form.default"><div class="elementor-widget-container"><form class="elementor-form" method="post" id="io_contactusform" name="Request Call Back" aria-label="Request Call Back"> <input type="hidden" name="post_id" value="4256"/> <input type="hidden" name="form_id" value="5440d2e"/> <input type="hidden" name="referer_title" value="About Us - Top Event Rentals Phoenix AZ" /> <input type="hidden" name="queried_id" value="479"/><div class="elementor-form-fields-wrapper elementor-labels-"><div class="elementor-field-type-text elementor-field-group elementor-column elementor-field-group-firstandlastname elementor-col-33"> <label for="form-field-firstandlastname" class="elementor-field-label elementor-screen-only"> Name </label> <input size="1" type="text" name="form_fields[firstandlastname]" id="form-field-firstandlastname" class="elementor-field elementor-size-sm elementor-field-textual" placeholder="Name"></div><div class="elementor-field-type-email elementor-field-group elementor-column elementor-field-group-email elementor-col-33 elementor-field-required"> <label for="form-field-email" clas
118s="elementor-field-label elementor-screen-only"> Email </label> <input size="1" type="email" name="form_fields[email]" id="form-field-email" class="elementor-field elementor-size-sm elementor-field-textual" placeholder="Email" required="required"></div><div class="elementor-field-type-tel elementor-field-group elementor-column elementor-field-group-cellphone elementor-col-33"> <label for="form-field-cellphone" class="elementor-field-label elementor-screen-only"> Phone </label> <input size="1" type="tel" name="form_fields[cellphone]" id="form-field-cellphone" class="elementor-field elementor-size-sm elementor-field-textual" placeholder="Phone" pattern="[0-9()#&+*-=.]+" title="Only numbers and phone characters (#, -, *, etc) are accepted."></div><div class="elementor-field-type-textarea elementor-field-group elementor-column elementor-field-group-notes elementor-col-100"> <label for="form-field-notes" class="elementor-field-label elementor-screen-only"> Message </label><textarea class="elementor-field-textual elementor-field elementor-size-sm" name="form_fields[notes]" id="form-field-notes" rows="3" placeholder=""I need help from a human sales rep.""></textarea></div><div class="elementor-field-type-recaptcha_v3 elementor-field-group elementor-column elementor-field-group-field_1a42aac elementor-col-100 recaptcha_v3-bottomright"><div class="elementor-field" id="form-field-field_1a42aac"><div class="elementor-g-recaptcha" data-sitekey="6LcSNw8eAAAAAN1cy4N20ZlzWX4YetiG7zmLXN_f" data-type="v3" data-action="Form" data-badge="bottomright" data-size="invisible"></div></div></div><div class="elementor-field-type-text"> <input size="1" type="text" name="form_fields[website_url]" id="form-field-website_url" class="elementor-field elementor-size-sm " style="display:none !important;"></div><div class="elementor-field-group elementor-column elementor-field-type-submit elementor-col-100 e-form__buttons"> <button class="elementor-button elementor-size-sm elementor-animation-grow" type="submit" id="io_cub"> <span class="elementor-button-content-wrapper"> <span class="elementor-button-icon"> <i aria-hidden="true" class="far fa-paper-plane"></i> </span> <span class="elementor-button-text">Send</span> </span> </button></div></div></form></div></div><div class="elementor-element elementor-element-73102690 elementor-widget elementor-widget-text-editor" data-id="73102690" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><p>This site is protected by reCAPTCHA and the Google<br /><a href="https://policies.google.com/privacy">Privacy Policy</a> and<br /><a href="https://topeventrental.com/terms-of-service/">Terms of Service</a> apply.</p></div></div></div></div></div></section><section class="elementor-section elementor-top-section elementor-element elementor-element-71ceb709 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="71ceb709" data-element_type="section" data-e-type="section" data-settings="{"background_background":"classic"}"><div class="elementor-container elementor-column-gap-default"><div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-421e5842" data-id="421e5842" data-element_type="column" data-e-type="column"><div class="elementor-widget-wrap elementor-element-populated"><div class="elementor-element elementor-element-41e89b5 elementor-widget elementor-widget-global elementor-global-4780 elementor-widget-text-editor" data-id="41e89b5" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default"><div class="elementor-widget-container"><p>Copyright © Top Event Rentals Glendale AZ All Rights Reserved | <a href="https://topeventrental.com/privacy/">Privacy Policy</a> | Rental Software Powered By <a href="https://eventoffice.io/" target="_blank" rel="noopener">EventOffice</a></p></div></div></div></div></div></section></footer>
118<script type="speculationrules">{"prefetch":[{"source":"document","where":{"and":[{"href_matches":"/*"},{"not":{"href_matches":["/wp-*.php","/wp-admin/*","/wp-content/uploads/*","/wp-content/*","/wp-content/plugins/*","/wp-content/themes/io-kenos/*","/*\\?(.+)"]}},{"not":{"selector_matches":"a[rel~=\"nofollow\"]"}},{"not":{"selector_matches":".no-prefetch, .no-prefetch a"}}]},"eagerness":"conservative"}]}</script>
118 <img src="https://rental.software/include/iotracking.php" style="display:none;" importance="low" alt="dynamic io trk code" /><style>.io_product_price_4h,.io_product_price_8h,.io_product_price_24h,.io_product_price_additionalday{display:none}.io_product_price_24h{display: grid !important}.io_product_price_0h_3337147,.io_product_price_0h_3337149,.io_product_price_0h_3337153,.io_product_price_0h_3337155,.io_product_price_0h_2925103,.io_product_price_0h_3181471,.io_product_price_0h_2882737,.io_product_price_0h_2883153,.io_product_price_0h_2883155,.io_product_price_0h_2880767,.io_product_price_0h_2930193,.io_product_price_0h_2930191,.io_product_price_0h_3215923,.io_product_price_0h_2971845,.io_product_price_0h_2882725{display: grid !important}.io_product_price_24h_3337147,.rentNameIO_price_3337147,.io_product_price_24h_3337149,.rentNameIO_price_3337149,.io_product_price_24h_3337153,.rentNameIO_price_3337153,.io_product_price_24h_3337155,.rentNameIO_price_3337155,.io_product_price_24h_2925103,.rentNameIO_price_2925103,.io_product_price_24h_3181471,.rentNameIO_price_3181471,.io_product_price_24h_2882737,.rentNameIO_price_2882737,.io_product_price_24h_2883153,.rentNameIO_price_2883153,.io_product_price_24h_2883155,.rentNameIO_price_2883155,.io_product_price_24h_2880767,.rentNameIO_price_2880767,.io_product_price_24h_2930193,.rentNameIO_price_2930193,.io_product_price_24h_2930191,.rentNameIO_price_2930191,.io_product_price_24h_3215923,.rentNameIO_price_3215923,.io_product_price_24h_2971845,.rentNameIO_price_2971845,.io_product_price_24h_2882725,.rentNameIO_price_2882725{display: none !important} 119 .io_product_cust_price 120 { 121 display: none !important; 122 } 123 #item_live_price_time_set_message 124 { 125 display: none !important; 126 } 127 128 /* ALWAYS hide toggle buttons and list view on inventory/all-items pages (no category ID) */ 129 body.io-no-category-id .io_view_toggle_container, 130 body.io-no-category-id .io_list_view_content 131 { 132 display: none !important; 133 } 134 135 /* Force grid/tile layout on pages without category IDs */ 136 body.io-no-category-id .io_catdiv2.list-view { 137 display: grid !important; 138 grid-template-columns: repeat(auto-fit, minmax(250px, 350px)) !important; 139 grid-gap: 10px !important; 140 margin: 50px !important; 141 max-width: none !important; 142 justify-content: space-evenly !important; 143 } 144 body.io-no-category-id .io_catdiv2.list-view .io_item2_list { 145 display: block !important; 146 flex-direction: column !important; 147 margin-bottom: 0 !important; 148 padding: 0 !important; 149 align-items: initial !important; 150 text-align: center !important; 151 } 152 body.io-no-category-id .io_catdiv2.list-view .cat_div { 153 flex: initial !important; 154 margin-right: 0 !important; 155 position: relative !important; 156 } 157 body.io-no-category-id .io_catdiv2.list-view .cat_img { 158 width: 100% !important; 159 height: auto !important; 160 object-fit: cover !important; 161 } 162 body.io-no-category-id .io_catdiv2.list-view .io_item2_list_inner { 163 flex: initial !important; 164 margin-top: initial !important; 165 display: block !important; 166 flex-direction: initial !important; 167 justify-content: initial !important; 168 min-height: auto !important; 169 height: auto !important; 170 } 171 172 .io_all_item_cat{ 173 display:none; 174 float:none; 175 width:100%; 176 margin-top:20px; 177 }</style>
177<script>var io_wp_local_path = ""; 178 var io_checkavail = "warn"; 179 var io_hidetimes = "off"; 180 var io_user_country = "US"; 181 var io_user_currency = "USD"; 182 var io_default_start_time = "11:00 am"; 183 var io_default_end_time = "3:00 pm"; 184 var io_default_duration = 4.00; 185 var io_force_blank_timepickers = "off"; 186 var io_hide_end_time = "off"; 187 var io_cart_date_format = "m/d/yy"; 188 var io_cart_message = "Non-residential orders please email <a href=\"mailto:[email protected]\">[email protected]</a> or call our office to reserve"; 189 var io_cart_time_format = "g:i a"; 190 var io_multidayquote = "on"; 191 var io_cartdayselect = "dropdown_options"; 192 var io_cartAllowSameDay = "off"; 193 var io_overnightPickupTime = "10:00 am"; 194 var io_incartupsell = "on"; 195 var io_distancecharge = "off"; 196 var io_deliverymethod = "off"; 197 var io_brand = "IO"; 198 var io_restrict_times = "on"; 199 var io_restrict_time_start = "8:00 am"; 200 var io_restrict_time_end = "9:00 pm"; 201 var io_default_state = "AZ"; 202 var io_hide_zero = "1"; 203 var io_weekEndPrice = "off"; 204 var io_weekDayText = "Weekday price."; 205 var io_weekEndText = "Weekend price."; 206 var io_weekendDefine = "friday-sunday"; 207 var io_accessory_price = "off"; 208 var io_accessory_select = "off"; 209 var io_upsell_price = "off"; 210 var io_cart_party_planner_email = "off"; 211 var io_cart_party_planner_destination = "https://topeventrental.com/plan-a-party/"; 212 var io_hideQuantityAvail = "off"; 213 var io_company_timeslots = []; 214 var io_info_required = "off"; 215 var io_always_display_live_price = "off"; 216 var io_default_delivery_method = "Fully Staffed"; 217 var io_hide_live_prices = 1; 218 var io_info_required_data = []; 219 var io_prices = {"0":"isset","override_groups":{"713018":{"3337147":1,"3337149":1,"3337153":1,"3337155":1,"2925103":1,"3181471":1,"2882737":1,"2883153":1,"2883155":1,"2880767":1,"2930193":1,"2930191":1,"3215923":1,"2971845":1,"2882725":1}},"1":"io_product_price_24h","2":"io_product_price_0h_3337147","3":"io_product_price_0h_3337149","4":"io_product_price_0h_3337153","5":"io_product_price_0h_3337155","6":"io_product_price_0h_2925103","7":"io_product_price_0h_3181471","8":"io_product_price_0h_2882737","9":"io_product_price_0h_2883153","10":"io_product_price_0h_2883155","11":"io_product_price_0h_2880767","12":"io_product_price_0h_2930193","13":"io_product_price_0h_2930191","14":"io_product_price_0h_3215923","15":"io_product_price_0h_2971845","16":"io_product_price_0h_2882725"}; 220 var io_delivery_prices = {"default":[],"override":[]}; 221 var io_custom_prices = {"default":[],"override":[]}; 222 var io_delivery_methods = {"Personal Backyard Drop Off":{"restricted":"[]","id":"115711"},"Non Residential Drop-Off":{"restricted":"[]","id":"131727"},"Customer Pick-Up":{"restricted":"[]","id":"115709"}}; 223 var io_customer_geolocation = "off"; 224 var io_customer_ip = "5.77.194.31"; 225 var io_delivery_methods_restrict = null; 226 var io_pagename = "Top Event Rentals_1"; 227 var io_categoryVariantImages = "off"; 228 //var io_seocitylinktext = " Professional delivery to <span class=\"io_city_list\">%%landing_pages%%</span> and surrounding areas. We do travel out of state for larger events! Please submit a quote or contact us to be sure we service your area. "; 229 jQuery( document ).ready(function() { 230 231 //force all quote form links to use cart data 232 //removing back to cart shortcode as this needs to only be done if cart is not empty IO-22561 233 /* 234 let headerBookButton = jQuery("a[href$='io_quoteform/']"); 235 headerBookButton.addClass("ioCart_link"); 236 headerBookButton.attr("href", "javascript:;"); 237 */ 238 239 240 let last_cat_name = ""; 241 let ioTrigger = false; 242 jQuery(".io_all_item_cat").each(function() { 243 current_cat_name = jQuery(this).html(); 244 if(last_cat_name !== current_cat_name) { 245 jQuery(this).show(); 246 ioTrigger = true; 247 } 248 last_cat_name = current_cat_name; 249 }); 250 251 // Setup gen page blocks 252 let io_divs = document.querySelectorAll(".io_item2_list, .io_item2_listcat, .io_item2_listrent, .io_all_item_cat"); 253 let io_divscat = document.querySelectorAll(".io_item2_listcat"); 254 let io_divsrent = document.querySelectorAll(".io_item2_listrent"); 255 let io_divcat = document.querySelector(".io_catdiv2"); 256 let io_pcc = document.querySelector(".page-content"); 257 let io_html; 258 259 if (io_divs.length > 0) { 260 for (let i of io_divs) { 261 if(i.parentNode.className.indexOf("io_mm_") === -1){ 262 io_divcat.appendChild(i); 263 } 264 } 265 if(io_divcat!==null) io_divcat.style.display = "grid"; 266 } 267 268 if (ioTrigger) { 269 let pageBlock = document.querySelector(".io_catdiv2"); 270 pageBlock.classList.add("elementor-widget-heading"); 271 let scanRes = pageBlock.querySelectorAll(".io_item2_listrent"); 272 pageBlock.style.display = "block"; 273 pageBlock.style.margin = "auto"; 274 pageBlock.style.textAlign = "center"; 275 pageBlock.style.marginLeft = "5px"; 276 pageBlock.style.marginRight = "5px"; 277 for (let i of scanRes) { 278 i.style.display = "inline-block"; 279 i.style.marginLeft = "5px"; 280 i.style.marginRight = "5px"; 281 } 282 } 283 284 /* fix font color on older sites */ 285 if(jQuery("#cartData").css("background-color")=="rgb(35, 36, 37)"){ 286 jQuery("#cartData").css("color","white"); 287 } 288 });</script>
288<style>.ui-datepicker-trigger{display:none}</style><div id="cartPopover"><div id="ioCartLoadingOverlay" aria-hidden="true"><div class="io-spinner" role="status" aria-live="polite" aria-label="Loading"></div></div><div id="triangle"></div><div id="cartCalendarTimePickerContainer"><div id="cartCalendar"></div><div id="cartTimePicker"><div id="div-overnight"> Days <select style="color:black;" name="whatday" id="whatday" onchange="endDisplay();"><option value="Same Day" selected="selected">Single Day</option><option value="Overnight">Overnight</option><option value="Multi-Day">Multi-Day</option> </select></div> <br><div id="ioCartTimeSelectContainer"><div> <span class="calTimeLabel calTimeLabelStart">Start</span> <i class="fas fa-calendar-check"></i> <input type="text" name="dateStart" class="ioCartDateInput" readonly="readonly" /> <i class="fas fa-clock"></i> <input type="text" name="timeStart" class="timepicker" style="width:75px;" /></div><div> <span class="calTimeLabel calTimeLabelEnd">End</span> <i class="fas fa-calendar-check"></i> <input type="text" name="dateEnd" class="ioCartDateInput" readonly="readonly" /> <i class="fas fa-clock"></i> <input type="text" name="timeEnd" class="timepicker" style="width:75px;" /></div></div> <br><div id="ioDeliveryMethodContainer" style="display:none; text-align: center;"></div> <br><div id="ioAdditonalInformationContainer" style="display:none; text-align: center;"><div class="io_info_modal_data_container" id="io_info_modal_address"> <label for="address" id="io_iml_address_label" style="width:105px"> Street Address </label> <input class="io_modal_input_address" style="margin-left:5px" id="io_im_address" name="address" type="text"></input> <br></div><div class="io_info_modal_data_container" id="io_info_modal_city"> <label for="city" id="io_iml_city_label" style="width:105px"> City </label> <input class="io_modal_input_city" style="margin-left:5px" id="io_im_city" name="city" type="text"></input> <br></div><div class="io_info_modal_data_container" id="io_info_modal_zip"> <label for="zip" id="io_iml_zip_label" style="width:105px"> Zip Code </label> <input class="io_modal_input_zip" id="io_im_zip" style="margin-left:5px" name="zip" type="text"></input></div></div> <br><div class="elementor-widget-button" style="padding:10px;display:inline-block;"> <a onclick="calApply()" href="javascript:;" 289 class="elementor-button-link elementor-button elementor-size-sm elementor-animation-grow" 290 style="text-decoration: none;">Apply</a></div><div class="elementor-widget-button" style="padding:10px;display:inline-block;"> <a onclick="calCancel()" href="javascript:;" 291 class="elementor-button-link elementor-button elementor-size-sm elementor-animation-grow simpleCart_cancel" 292 style="text-decoration: none;">Cancel</a></div></div><div id="cartDateRange" class="ioDateRange" onclick="calSetDateRange(1)" style="display:none;"></div><div class="changeDateLinkWrapper elementor-widget-button"><div id="changeDateLink" onclick="calSetDateRange(1)" class="elementor-button elementor-animation-grow">Change Date</div></div></div><div id="cartPartyBuilderEmailContainer" style="display:none;text-align:center"><p>Provide an email address here to recieve our free party planner!</p> <input type="text" id="cartPartyBuilderEmailInput"><div class="elementor-widget-button" style="display:inline-block;"> <a onclick="io_party_planner_email_submit()" href="javascript:;" class="elementor-button-link elementor-button elementor-size-sm" style="padding: 6px 15px;text-decoration: none;">Go</a></div><div id="cartPartyBuilderEmailWarning" style="display:none">Pleave provide a valid email address.</div> <br><br></div><div id="cartCustomMessage" style="display:none;text-align:center"></div><div id="cartWarning" class="clearfix"></div><div id="deliveryMethodWarning" class="clearfix">Some items are not available for the selected delivery method.</div> <span class="io_locationRedirectLink">You may not be on the correct site. Click here to change location.</span><div id="cartData" class="clearfix"><div class="simpleCart_items"></div></div><div class="cartSubtotalBox"> Subtotal (estimate):<div id="cartSubtotal"></div></div><div class="checkDeliveryCartContainer"><div id="checkDeliveryMessage" class="cartDeliverytotalBox"><a class="cartLink" href="javascript:;" onClick="showAddressEntry(true)">Check Delivery</a></div><div id="deliverSubtotalContainer" class="cartDeliverytotalBox"> Delivery Fee (<span><a class="cartLink" href="javascript:;" onClick="showAddressEntry(true)">Change Address</a></span>):<div id="deliverySubtotal"></div></div></div><div id="cartCheckoutButton" class="clearfix"><div class="elementor-widget-button"> <a href="javascript:cartHide();
292" class="simpleCart_continue elementor-button elementor-size-sm elementor-animation-grow io_button">Continue Shopping</a> <a href="javascript:;" class="simpleCart_checkout elementor-button elementor-size-sm elementor-animation-grow io_button">Checkout</a></div><div id="cart-carousel-container" style="display:none"> <label> Some items you may be interested in: </label> <br><div class="cart-carousel"></div></div><div class="ioLink"><a href="https://www.inflatableoffice.com" target="_blank">powered by io</a></div></div></div>
292<script>/* configurable globals */ 293 var start_default = "11:00 am"; 294 if(io_default_start_time != "") start_default = io_default_start_time; 295 var end_default = "3:00 pm"; 296 if(io_default_end_time != "") end_default = io_default_end_time; 297 298 if(io_user_currency){ 299 var currency = io_user_currency; 300 } else{ 301 var currency = "USD"; 302 } 303 304 if(io_user_country){ 305 var country = io_user_country; 306 } else{ 307 var country = "US"; 308 } 309 310 311 var timeFormat = "g:i a"; 312 if(io_cart_time_format != "") timeFormat = io_cart_time_format; 313 var dateFormat = "m/d/yy"; 314 if(io_cart_date_format != "") dateFormat = io_cart_date_format; 315 316 var restrictTimes = false; 317 if(io_restrict_times === "on") restrictTimes = true; 318 var restrictTimeStart = start_default; 319 if(io_restrict_time_start != "") restrictTimeStart = io_restrict_time_start; 320 var restrictTimeEnd = end_default; 321 if(io_restrict_time_end != "") restrictTimeEnd = io_restrict_time_end; 322 323 324 var multi_day = true; 325 if(io_multidayquote === "off" || io_cartdayselect == "Single Day") multi_day = false; 326 var in_cart_upsell = false; 327 if(io_incartupsell === "on") in_cart_upsell = true; 328 var io_distance_charge = false; 329 if(io_distancecharge === "on") io_distance_charge = true; 330 331 /* other globals */ 332 var pallet_color1 = ""; /* set in onready */ 333 /* track the date start/end of calendar clicking */ 334 var click_count = 0; 335 336 /* for configuring upsell carosel in cart */ 337 var cart_carousel_set = false; 338 339 /* for checking when we remove an item from the cart */ 340 var last_remove = 0; 341 var last_upsell_call = 0; 342 343 /* for buffering cart qty changes checkAvail calls for qty change only */ 344 var last_checkAvail_call = 0; 345 346 /* for cart loading animation */ 347 var io_cart_loading_active = false; 348 var io_cart_loading_count = 0; 349 var io_cart_loading_fallback_timer = null; 350 351 /*var start_default = "11:00"; 352 var end_default = "15:00"; 353 var currency = "EUR"; 354 var timeFormat = "G:i"; 355 var dateFormat = "d/m/yy";*/ 356 357 358 /* For weekday weekend pricing */ 359 var use_weekday_weekend = false; 360 if(io_weekEndPrice == "on") use_weekday_weekend = true; 361 362 /* Accessory and Upsell Prices */ 363 var show_accessory_price = false; 364 if(io_accessory_price == "on") show_accessory_price = true; 365 var show_upsell_price = false; 366 if(io_upsell_price == "on") show_upsell_price = true; 367 368 /* For customer geolocation shortcode */ 369 var storage_key = 'io_customer_location'; 370 371 /*<editor-fold defaultstate="collapsed" desc="On Ready">*/ 372 jQuery(document).ready(function () { 373 pallet_color1 = "var( --e-global-color-accent,green )"; 374 if(pallet_color1=="rgba(0, 0, 0, 0)" || pallet_color1=="rgb(255, 255, 255)") pallet_color1="rgb(25, 147, 35)"; 375 376 /*<editor-fold defaultstate="collapsed" desc="SimpleCart Init">*/ 377 simpleCart({ 378 currency: currency, 379 cartColumns: [{ 380 view: "image", 381 attr: "image", 382 label: "Image" 383 }, 384 { 385 attr: "name", 386 label: "Name" 387 }, 388 { 389 attr: "encoded", 390 label: false 391 }, 392 { 393 attr: "rentalid", 394 label: false 395 }, 396 { 397 attr: "availability", 398 label: false 399 }, 400 { 401 view: "decrement", 402 label: false, 403 text: "<i class='fas far fa-minus-square' style='color:" + pallet_color1 + "'></i>" 404 }, 405 { 406 view: "calculate_area", 407 label: false 408 }, 409 { 410 view:"input", 411 attr:"quantity" 412 413 }, 414 { 415 attr: "qtyincrement", 416 label: false 417 }, 418 { 419 attr: "inputtype", 420 label: false 421 }, 422 { 423 attr: "qtytype", 424 label: false 425 }, 426 { 427 attr: "vendorid", 428 label: false 429 }, 430 { 431 view: "increment", 432 label: false, 433 text: "<i class='fas far fa-plus-square' style='color:" + pallet_color1 + "'></i>" 434 }, 435 { 436 attr: "price", 437 label: "Price", 438 view: 'currency' 439 }, 440 { 441 view: "remove", 442 label: false,
443 text: "<i class='fas fa-trash' style='color:" + pallet_color1 + "'></i>" 444 }, 445 { 446 attr: "total", 447 label: "SubTotal", 448 view: 'currency' 449 }, 450 { 451 attr: "timeslots", 452 label: false 453 }, 454 { 455 attr: "timeslots-orig", 456 label: false 457 }, 458 { 459 attr: "href", 460 label: false 461 }, 462 { 463 attr: "linkqty", 464 label: false 465 }, 466 { 467 attr: "acc_dd_parent_limit", 468 label: false 469 } 470 ], 471 checkout: { 472 type: "SendForm", 473 method: "GET", 474 url: io_wp_local_path+"/io_quoteform/", 475 extra_data: { 476 /* name: decodeURIComponent("Top Event Rentals_1".replace(/[+]/gi, " ")), */ 477 clear_rentals: "1", 478 selected_only: "1", 479 wp_checkout: "1", 480 startdate: "", 481 enddate: "", 482 starttime: "", 483 endtime: "", 484 io_custguid: "" 485 } 486 } 487 }); 488 489 simpleCart.bind('update', cart_onUpdate); 490 simpleCart.bind('beforeSave', cart_hideTimepickerWrapper); 491 simpleCart.bind('beforeRemove', cart_beforeRemove); 492 simpleCart.bind('afterRemove', cart_afterRemove); 493 simpleCart.bind('afterQtyChange', cart_afterQtyChange); 494 simpleCart.bind('beforeCheckout', cart_beforeCheckout); 495 simpleCart.bind('afterAdd', cart_afterAdd); 496 simpleCart.bind('beforeAdd', cart_beforeAdd); 497 simpleCart.bind('load', cart_afterLoad) 498 /*</editor-fold>*/ 499 500 /* showAvail(""); */ 501 let io_star_pic = document.querySelector("#io_star_pic"); 502 if (io_star_pic != null) { 503 let io_star_src = io_star_pic.src; 504 if (io_star_src.indexOf("0star") > -1 || io_star_src.indexOf("1star") > -1 || io_star_src.indexOf("2star") > -1 || 505 io_star_src.indexOf("3star") > -1) { 506 io_star_pic.style.display = "none"; 507 } 508 } 509 510 /*<editor-fold desc="Build Thumb Images">*/ 511 /* build multiple thumb images */ 512 513 /*</editor-fold>*/ 514 515 /*<editor-fold desc="Set up Accessories">*/ 516 /* Add Add To Cart Buttons */ 517 let button_add = document.querySelector("#bookNowBtn"); 518 var main_id = 0; 519 if(jQuery(".io_product_container .item_rentalid")){ 520 main_id = jQuery(".io_product_container .item_rentalid").first().text(); 521 } 522 /* if main item is dd but not pkg (linen code) */ 523 if(jQuery(".io_acc_accessorydd").text()==1 && jQuery(".io_acc_ispackage").text()!=1){ 524 /* if order is defined, then reorder here. */ 525 var acc_cls = jQuery('.io_product_accessories') 526 acc_cls.hide(); 527 let pkg = document.querySelector(".io_product_acc_pkg"); 528 if(pkg==undefined){ 529 pkg = document.createElement("div"); 530 pkg.classList.add("io_product_acc_pkg"); 531 pkg.style.textAlign = "center"; 532 acc_cls.after(pkg); 533 } 534 for (let [key, value] of acc_obj_relate) { 535 elem = getAccElem(key,main_id); 536 if(elem){ 537 btn = makeAccBtn(elem,main_id); 538 pkg.append(btn); 539 } 540 541 } 542 let line = document.createElement("div"); 543 line.innerHTML = "<br>"; 544 pkg.append(line.cloneNode(true)); 545 for (let [key, value] of acc_obj_relate) { 546 for (key2 in acc_obj_relate.get(key)) { 547 if(Object.keys(value[key2]).length > 0){ 548 /* 3rd level */ 549 pkg.append(line.cloneNode(true)); 550 for (key3 in acc_obj_relate.get(key)[key2]) { 551 elem = getAccElem(key3,key2); 552 if(elem){ 553 btn = makeAccBtn(elem,key2); 554 btn.style.display = "none"; 555 pkg.append(btn); 556 } 557 } 558 }else{ 559 elem = getAccElem(key2,key); 560 if(elem){ 561 btn = makeAccBtn(elem,key); 562 btn.style.display = "none"; 563 pkg.append(btn); 564 } 565 566 } 567 } 568 } 569 }else { 570 let access_array = document.querySelectorAll(".io_acc_li"); 571 let count = 0; 572 for (let i of access_array) { 573 let path = i.id.replace("io_acc_",""); 574 count++; 575 let newButton = button_add.cloneNode(true); 576 newButton.id = button_add.id + count; 577 newButton.classList.remove("elementor-animation-grow"); 578 newButton.classList.add("elementor-animation-shrink"); 579 580 let path_arr = path.split("_"); 581 let pid = parseInt(path_arr[0]); 582 let this_id = parseInt(path_arr[1]); 583 if(path_arr.length==1) pid=0; 584 585 if(jQuery("#io_acc_accessorydd_"+path).first().text()==1){ 586 /* display different to provide choices in dd */ 587 //main_id = pid; 588 }else{ 589 /* hide accessories inside a pkg when under an accessory choice item until clicked */ 590 if(jQuery("#io_acc_accessorydd_"+main_id+"_"+pid).first().text()==1){ 591 }else{ 592 /* jpa - not finished/tested yet */ 593 /*jQuery("#io_acc_"+path).hide();*/ 594 } 595 /* Fix broken images for accessories. */ 596 let img_box = document.querySelectorAll(".io_acc_li_img_thumb"); 597 let firstImg = true; 598 let lastAcc = ""; 599 for (let i of img_box) { 600 if(lastAcc=="") lastAcc = i.id;
601 if(lastAcc!=i.id){ 602 lastAcc = i.id; 603 firstImg = true; 604 } 605 let io_img_src = i.src; 606 if(io_img_src!==null) io_img_src = io_img_src.toLowerCase(); 607 let io_img_datasrc = i.getAttribute("data-src"); 608 if(io_img_datasrc===null){ 609 io_img_datasrc = ""; 610 }else{ 611 io_img_datasrc = io_img_datasrc.toLowerCase(); 612 } 613 if ((io_img_src.indexOf("io_noimage.png") >= 0 || io_img_datasrc.indexOf("io_noimage.png") >= 0) || (io_img_src.indexOf(".jpg") == -1 && io_img_src.indexOf(".jpe") == -1 && io_img_src.indexOf(".png") == -1 && io_img_src.indexOf(".gif") == -1 && io_img_src.indexOf(".tif") == -1 && io_img_src.indexOf(".webp") == -1)){ 614 i.style.display = "none"; 615 }else if(!firstImg && jQuery("#io_acc_accessorydd_"+main_id+"_"+pid).first().text()!=1){ 616 i.style.display = "none"; 617 } 618 firstImg = false; 619 } 620 if(jQuery("#io_acc_accessorydd_"+main_id+"_"+pid).first().text()==1){ 621 /* Make the accessory category look more mike a label. */ 622 jQuery("#iothumb_"+main_id+"_"+pid).hide(); 623 jQuery("#io_acc_"+main_id+"_"+pid).css("border", "none"); 624 jQuery("#io_acc_"+main_id+"_"+pid).css("width", "100%"); 625 jQuery("#io_acc_"+main_id+"_"+pid).css("margin-bottom", "5vh"); 626 jQuery("#io_acc_"+main_id+"_"+pid).css("box-shadow", "none"); 627 jQuery("#io_acc_shortname_"+pid).css("font-weight", "bold"); 628 jQuery("#io_acc_shortname_"+pid).css("position", "absolute"); 629 /* Make this auto selected to fix an issue where we can not add to cart if this item is 630 a child of another hidden accessory on screen */ 631 jQuery("#io_acc_"+main_id+"_"+pid).prop("selected", true); 632 accessory_cat_text = jQuery("#io_acc_shortname_"+pid).first().text(); 633 /* This is necessary to make sure there are not multiple colons. */ 634 if(!accessory_cat_text.includes(":")){ 635 jQuery("#io_acc_shortname_"+pid).text(accessory_cat_text+":"); 636 } 637 /* Remove Href so we do not open images on click for dd accessories. */ 638 jQuery("[id^=io_acc_imgbig_"+pid+"_]").removeAttr("href"); 639 640 /* Get the accessory limit for this set of acessories, then set up click events. */ 641 /* Unbind is used to prevent cascading calls. */ 642 accLmt = parseInt(jQuery("#io_acc_accessorylimit_"+main_id+"_"+pid).prop("textContent")); 643 jQuery("[id^=io_acc_"+pid+"_]").unbind("click").click({pid: pid, accLmt: accLmt}, accDDClicked); 644 jQuery("[id^=io_acc_"+pid+"_]").css("cursor", "pointer"); 645 /* Set up the slected property of all children accessories. Default to false. */ 646 jQuery("[id^=io_acc_"+pid+"_]").prop("selected", false); 647 /* We need to add a hidden button so we can simulate a click on add_item for the cart. */ 648 let newButton = button_add.cloneNode(true); 649 newButton.id = button_add.id + count; 650 newButton.classList.remove("elementor-animation-grow"); 651 newButton.setAttribute("style", "display: none !important"); 652 i.appendChild(newButton); 653 }else{ 654 let button_wrap = document.createElement("div"); 655 button_wrap.classList.add("elementor-widget-button"); 656 button_wrap.classList.add("io_access_button"); 657 button_wrap.appendChild(newButton); 658 let req = false; 659 if(jQuery("#io_acc_required_"+path).first().text()>0) req = true; 660 if(!req){ 661 i.appendChild(button_wrap); 662 }else{ 663 var textnode = document.createTextNode("Included"); 664 i.appendChild(textnode); 665 } 666 } 667 } 668 } 669 } 670 /*</editor-fold>*/ 671 672 let upsell_array = document.querySelectorAll(".io_upsell_li"); 673 count = 0; 674 for (let i of upsell_array) { 675 count++; 676 let newButton = button_add.cloneNode(true); 677 newButton.id = button_add.id + count; 678 newButton.classList.remove("elementor-animation-grow"); 679 newButton.classList.add("elementor-animation-shrink"); 680 681 let button_wrap = document.createElement("div"); 682 button_wrap.classList.add("elementor-widget-button"); 683 button_wrap.classList.add("io_upsell_button"); 684 button_wrap.appendChild(newButton); 685 i.appendChild(button_wrap); 686 } 687 688 if(io_deliverymethod == "on" && jQuery(".calDeliveryMethodLabel").length==0){ 689 let delivery_method_container = jQuery("#ioDeliveryMethodContainer").first(); 690 delivery_method_container.append('<span class="calDeliveryMethodLabel">Select Delivery Method</span>'); 691 let delivery_method_html = '<select class="ioDeliveryMethods" onchange="deliveryMethodSelected()">'; 692 let delivery_methods = Object.keys(io_delivery_methods) 693 for(const index in delivery_methods){ 694 if(!io_delivery_methods_restrict){ 695 delivery_method_html += '<option value="'+delivery_methods[index]+'">'+delivery_methods[index]+'</option>'; 696 if(index == 0 && !getCookie("io_delivery_method")) setCookie("io_delivery_method", delivery_methods[index], 14); 697 }else if( !io_delivery_methods_restrict.includes( io_delivery_methods[ delivery_methods[index] ]["id"] ) ){ 698 delivery_method_html += '<option value="'+delivery_methods[index]+'">'+delivery_methods[index]+'</option>'; 699 if(index == 0 && !getCookie("io_delivery_method")) setCookie("io_delivery_method", delivery_methods[index], 14); 700 } 701 } 702 delivery_method_container.append(delivery_method_html); 703 delivery_method_container.show(); 704 if(getCookie("io_delivery_method")){ 705 jQuery(".ioDeliveryMethods").val(getCookie("io_delivery_method")); 706 } 707 }else{
708 setCookie("io_delivery_method", "", 14); 709 } 710 711 let allow_same_day = 1; 712 if(io_cartAllowSameDay == "on"){ 713 allow_same_day = 0; 714 } 715 716 /*<editor-fold desc="Cart Calandar and Time Settings Setup">*/ 717 //var fullmonth_array = jQuery.datepicker.regional["en"].monthNames; 718 jQuery("#cartCalendar").datepicker({ 719 changeMonth: true, 720 changeYear: true, 721 //monthNamesShort : fullmonth_array, 722 dateFormat: dateFormat, 723 rangeSelect: true, 724 numberOfMonths: 1, 725 stepMonths: 1, 726 prevText: "<< Previous Months", 727 nextText: "Next Months >>", 728 speed: "fast", 729 showOn: "both", 730 onChangeMonthYear: cal_onChangeMonthYear, 731 onSelect: cal_onSelect, 732 buttonText: "Calendar", 733 minDate: allow_same_day, 734 firstDay: 0 735 }); 736 jQuery(".ui-datepicker-trigger").hide(); 737 if(restrictTimes){ 738 jQuery(".timepicker").timepicker({ 739 startTime: new Date(0, 0, 10, 0, 0, 0), 740 endTime: new Date(0, 0, 0, 20, 0, 0, 0), 741 minTime:restrictTimeStart, 742 maxTime:restrictTimeEnd, 743 /*show24Hours: $show24Hours,*/ 744 timeFormat: timeFormat, 745 separator: ":", 746 className: "elementor-widget-text-editor", 747 step: 15, 748 disableTouchKeyboard: true 749 }).keypress(function(e){ 750 e.preventDefault(); 751 }); 752 } else{ 753 jQuery(".timepicker").timepicker({ 754 startTime: new Date(0, 0, 10, 0, 0, 0), 755 endTime: new Date(0, 0, 0, 20, 0, 0, 0), 756 /*show24Hours: $show24Hours,*/ 757 timeFormat: timeFormat, 758 separator: ":", 759 className: "elementor-widget-text-editor", 760 step: 15, 761 disableTouchKeyboard: true 762 }); 763 } 764 765 /* if we have company wide timeslots, alter time select in cart. Do this only if we are set to single day only */ 766 if(io_company_timeslots.length != 0 && io_cartdayselect == "single_day"){ 767 let time_select_container = jQuery("#ioCartTimeSelectContainer").first(); 768 time_select_container.empty(); 769 let selected_date_html = '<span style="margin-right: 5px !important" class="calTimeLabel">Date</span><i class="fas fa-calendar-check"></i><input style="margin-left: 5px !important" type="text" name="dateStart" class="ioCartDateInput" readonly="readonly" /><input style="display: none !important" type="text" name="dateEnd" class="ioCartDateInput" readonly="readonly" />' 770 time_select_container.append(selected_date_html); 771 time_select_container.append("<br>") 772 time_select_container.append('<span class="calTimeLabel">Select Timeslot</span>'); 773 let timeslot_html = '<select class="ioCartCompanyTimeslots">'; 774 for(i=0; i<io_company_timeslots.length; ++i){ 775 timeslot_html += io_company_timeslots[i]; 776 } 777 timeslot_html += "</select>" 778 time_select_container.append(timeslot_html); 779 780 } 781 782 // Timeslot element on Quote Form 783 const timeslotSelectElement = jQuery(".controls select[name=timeslot]"); 784 785 /* jQuery( ".datepicker" ).datepicker({dateFormat: "m/d/yy",minDate:0}); */ 786 /* jQuery( ".datepicker" ).val(getCookie("checkDate")); */ 787 start_date = getCookie("io_dateStart"); 788 end_date = getCookie("io_dateEnd"); 789 start_time = getCookie("io_timeStart"); 790 end_time = getCookie("io_timeEnd"); 791 jQuery("input[name=dateStart]").val(start_date); 792 jQuery("input[name=dateEnd]").val(end_date); 793 if(io_company_timeslots.length != 0 && io_cartdayselect == "single_day" && getCookie("io_company_timeslot_selected")){ 794 jQuery(".ioCartCompanyTimeslots").val(getCookie("company_timeslot_selected")); 795 // Set it on the quote page too. 796 timeslotSelectElement.val(getCookie("io_company_timeslot_selected")); 797 } else{ 798 jQuery("input[name=timeStart]").val(start_time); 799 jQuery("input[name=timeEnd]").val(end_time); 800 } 801 802 timeslotSelectElement.on('change', function() { 803 // IO-31167: Upon timeslot change on Quote Form, 804 // update timeslot cookie value for persistence 805 if(this.value) { 806 setCookie('io_company_timeslot_selected', this.value, 14); 807 } 808 }); 809 810 if (jQuery("input[name=dateEnd]").val() != "") {
811 setCalBackground(); 812 jQuery("#cartSubtotal").html(simpleCart.toCurrency(simpleCart.total())); 813 if(getCookie("io_dateApplied") === "true") calCancel(); 814 else { 815 jQuery("input[name=dateStart]").val(getCookie("io_dateStart")); 816 jQuery("input[name=dateEnd]").val(getCookie("io_dateEnd")); 817 if(io_company_timeslots.length != 0 && io_cartdayselect == "single_day" && getCookie("io_company_timeslot_selected")){ 818 jQuery(".ioCartCompanyTimeslots").val(getCookie("io_company_timeslot_selected")); 819 } 820 else if(io_force_blank_timepickers == "on") 821 { 822 setCookie("io_timeStart", "", 14); 823 setCookie("io_timeEnd", "", 14); 824 jQuery('[name=timeStart]').val(""); 825 jQuery('[name=timeEnd]').val(""); 826 } 827 else{ 828 jQuery("input[name=timeStart]").val(getCookie("io_timeStart")); 829 jQuery("input[name=timeEnd]").val(getCookie("io_timeEnd")); 830 } 831 832 jQuery(".changeDateLinkWrapper").hide(); 833 } 834 } 835 /*</editor-fold>*/ 836 837 jQuery("#io-dialog").dialog({ 838 autoOpen: false, 839 resizable: false, 840 modal: true, 841 dialogClass: "noTitleStuff", 842 width: 350, 843 open: function () { 844 jQuery(".ui-widget-overlay").bind("click", function () { 845 jQuery("#io-dialog").dialog("close"); 846 }) 847 } 848 }); 849 850 /* change jquery calendar next/prev buttons to fa arrows w/matching site color */ 851 jQuery("#cartCalendar .ui-datepicker-prev").addClass("fas fa-arrow-left").css("color", pallet_color1); 852 jQuery("#cartCalendar .ui-datepicker-next").addClass("fas fa-arrow-right").css("color", pallet_color1); 853 854 /* hide sections if not set */ 855 if(jQuery(".io_product_circuits_right").first().text()=="0"){jQuery(".io_product_circuits_right,.io_product_circuits_left").hide();} 856 if(jQuery(".io_city_list").html()==""){jQuery(".io_landingpages").hide();} 857 /* using this instead as it will handle custom ones added */ 858 let io_field_valbox = document.querySelector(".io_product_infobox"); 859 if (io_field_valbox != null || io_field_valbox != undefined) { 860 let io_field_valarr = io_field_valbox.querySelectorAll(".io_product_detail_box"); 861 for (let i of io_field_valarr) { 862 let check = i.querySelector("p:nth-child(2)"); 863 if (check != null && check.innerText == "") i.style.display = "none"; 864 } 865 } 866 867 /* Hide description if there is no description */ 868 desc_box = document.querySelector(".io_product_desc") 869 if(desc_box != null && desc_box.innerText.length == 0 && desc_box.innerHTML.length == 0){ 870 desc_detail_box = desc_box.parentElement; 871 desc_detail_box.style.display = "none"; 872 } 873 874 if(document.querySelector(".io_product_reviewbox")!=null){ 875 if (document.querySelector(".io_product_reviewbox").innerText == "") { 876 if(document.querySelector(".io_star_rating")!=null) document.querySelector(".io_star_rating a").style.display = "none"; 877 } 878 } 879 880 let rid = jQuery(".io_product_container .item_rentalid").first().text(); 881 let regex = new RegExp("^io_product_price_.*_" + rid + "$"); 882 for (const price_index in io_prices){ 883 if(regex.test(io_prices[price_index])){ 884 use_weekday_weekend = false; 885 } 886 } 887 888 /* hide end date input. */ 889 if(!multi_day){ 890 /* TODO: Need to wait and see if this is necessary. If so needs to be more involved than this. */ 891 /* jQuery("input[name=dateEnd]").style("visibility", "hidden"); */ 892 } 893 /* Call page avail now so we can display live price if its enabled */ 894 setTimeout(function(){ 895 if(jQuery(".io_acc_accessorydd").text()==1 && jQuery(".io_acc_ispackage").text()!=1){ 896 jQuery("#bookNowBtn").removeClass("item_add").addClass("item_add_off").trigger("classChange"); 897 checkAvailPageOnly(); 898 }else{ 899 checkAvailPageOnly(); 900 } 901 },50); 902 903 /* Adjust picbox for header heights */ 904 setTimeout(adjustPicBoxForHeader,500); 905 906 /* Show buttons for distance charge check if the setting is on. Hide or show map button if applicable*/ 907 if(io_distance_charge){ 908 jQuery(".delivery_charge_check_container").show(); 909 jQuery(".calc_price_with_map_container").hide(); 910 jQuery(".checkDeliveryCartContainer").show(); 911 } else { 912 jQuery(".delivery_charge_check_container").hide(); 913 jQuery(".calc_price_with_map_container").hide(); 914 jQuery(".checkDeliveryCartContainer").hide(); 915 } 916 if(io_brand=="EH"){ 917 jQuery(".delivery_charge_check_container").hide(); 918 jQuery(".eh_additional_description").show(); 919 } 920 if(jQuery(".io_product_infobox .item_inputtype").text() === "Map"){ 921 jQuery(".delivery_charge_check_container").hide(); 922 jQuery(".checkDeliveryCartContainer").hide(); 923 jQuery(".calc_price_with_map_container").show(); 924 } 925 926 /* If we have delivery set in cookie, be sure to show the charge in the cart. */ 927 if(getCookie("io_deliveryFee") && simpleCart.items().length > 0) { 928 setDeliverySubtotal(getCookie("io_deliveryFee")); 929 jQuery("#deliverSubtotalContainer").show(); 930 jQuery("#checkDeliveryMessage").hide(); 931 } else{ 932 jQuery("#deliverSubtotalContainer").hide(); 933 } 934 935 /* moved back here for IO-22561 */ 936 if(simpleCart.items().length > 0){ 937 let headerBookButton = jQuery("a[href$='io_quoteform/']"); 938 headerBookButton.addClass("ioCart_link"); 939 headerBookButton.attr("href", "javascript:;"); 940 } 941 jQuery(".cartInfo").unbind("click").one("click", function(event){ 942 event.stopPropagation(); 943 event.stopImmediatePropagation(); 944 cartShow(); 945 }); 946 jQuery(".ioCart,.ioCart_link").unbind("click").one("click", function(event){ 947 event.stopPropagation(); 948 event.stopImmediatePropagation(); 949 cartShow(); 950 }); 951 952 /* hide if click outside cart */ 953 jQuery(document).mouseup(function(e){ 954 var container = jQuery("#cartPopover"); 955 var cartButton = jQuery(".cartInfo, .ioCart, .ioCart_link"); 956 var addButton = jQuery(".item_add"); 957 var timePicker = jQuery(".ui-timepicker-wrapper"); 958 959 if(jQuery(".cartInfo, .ioCart, .ioCart_link").hasClass("open")){ 960 if(!container.is(e.target) && container.has(e.target).length === 0 && !cartButton.is(e.target) && cartButton.has(e.target).length === 0 && !addButton.is(e.target) && addButton.has(e.target).length === 0 && !timePicker.is(e.target) && timePicker.has(e.target).length === 0 && !jQuery(".address_entry").is(e.target) && jQuery(".address_entry").has(e.target).length === 0){ 961 cartHide(); 962 } 963 } 964 }); 965 966 if(!getCookie("io_state") && io_default_state){
967 setCookie("io_state", io_default_state, 14); 968 } 969 if(country != "US") { 970 jQuery("#io_cd_state").replaceWith('<input id="io_cd_state" style="display: table-cell" name="state" type="text"></input>'); 971 jQuery("#io_cdl_zip_label").text("Postal code"); 972 if(country == "CA"){ 973 jQuery("#io_cdl_state_label").text("Province"); 974 } else if(country == "AU"){ 975 jQuery("#io_cdl_city_label").text("Suburb"); 976 } 977 } else{ 978 jQuery("#io_cd_zip").attr("type", "number"); 979 } 980 /* Set up on change events to stop end timepickers from allowing users to pick times before start time */ 981 setTimeout(restrictEndTimepickers, 500); 982 if(io_hide_end_time == "on" && io_default_duration > 0){ 983 jQuery('[name="timeEnd"]').parent().hide(); 984 // Hide end time stuff on checkout page and in the text. 985 jQuery(".io_event_body_time .control-group:nth-child(2)").hide(); 986 jQuery(".io_event_body_time_display_text").text(jQuery(".io_event_body_time_display_text").text().replace(/\s*â.*/, "")) 987 jQuery('[name="timeStart"]').change(function(){ 988 const regex = /^(\d{1,2}):(\d{2})(?:\s*([AP]M))?$/i; 989 const match = this.value.match(regex); 990 991 let hours = parseInt(match[1], 10); 992 const minutes = parseInt(match[2], 10); 993 const period = match[3] ? match[3].toUpperCase() : null; 994 995 if (period) { 996 if (period === "PM" && hours !== 12) hours += 12; 997 if (period === "AM" && hours === 12) hours = 0; 998 } 999 1000 const baseDate = new Date(1970, 0, 1, hours, minutes); 1001 const newTime = new Date(baseDate.getTime() + io_default_duration * 3600000); 1002 1003 if (period) { 1004 // 12-hour 1005 let newHours = newTime.getHours(); 1006 const newMinutes = newTime.getMinutes(); 1007 const newPeriod = newHours >= 12 ? "PM" : "AM"; 1008 newHours = newHours % 12; 1009 if (newHours === 0) newHours = 12; 1010 let end_time = `${newHours}:${newMinutes.toString().padStart(2, "0")} ${newPeriod}`; 1011 jQuery('[name="timeEnd"]').val(end_time); 1012 } else { 1013 // 24 hour 1014 let end_time = `${newTime.getHours().toString().padStart(2, "0")}:${newTime.getMinutes().toString().padStart(2, "0")}`; 1015 jQuery('[name="timeEnd"]').val(end_time); 1016 } 1017 }); 1018 } 1019 1020 /* If we have a custom message in cart, display it. */ 1021 if(io_cart_message){ 1022 show_cart_message(); 1023 } 1024 1025 /* code for day select in cart */ 1026 if(io_cartdayselect == "dropdown_options" && io_multidayquote === "on"){ 1027 saved_whatday = getCookie("io_whatday"); 1028 if(saved_whatday) jQuery("#whatday").val(saved_whatday); 1029 endDisplay(); 1030 setCalBackground(); 1031 } else{ 1032 jQuery("#div-overnight").hide(); 1033 jQuery("#whatday").val(""); 1034 } 1035 1036 checkRestrictedDeliveries() 1037 /* If we are using the information gathering tool, we do not want to show this message. */ 1038 if( live_pricing_is_on() && io_info_required == "off" ){ 1039 if(!event_time_set() && io_always_display_live_price != "on"){ 1040 jQuery("#item_live_price_time_set_message").show(); 1041 }else{ 1042 jQuery("#item_live_price_time_set_message").hide(); 1043 } 1044 } 1045 1046 1047 /* Check if information gathering header exists. If it does, Remove set even button and add some classes on onclicks */ 1048 if(jQuery("#ioInfoHeader").length){ 1049 remove_set_event_buttton(); 1050 add_classes_and_onClicks(); 1051 header_increment_step(); 1052 } 1053 1054 jQuery(".io_acc_li").each(function() { 1055 if(jQuery(this).find(".item_required").first().text() > 0 && jQuery(this).find(".item_accessorydd").first().text() == 1){ 1056 jQuery(jQuery(jQuery(this).parent()).prev()).appendTo(".io_product_requiredDD_accessories"); 1057 jQuery(jQuery(this).parent()).appendTo(".io_product_requiredDD_accessories"); 1058 jQuery(".io_product_requiredDD_accessories").show(); 1059 } 1060 }); 1061 1062 if(jQuery(".io_product_accessories .io_acc_li").length == 0) jQuery(".io_product_accessories").hide(); 1063 1064 /* Hide the cart add button for items with required accessories on category page */ 1065 jQuery(".item_hasRequiredAcc").each(function() { 1066 if (this.innerText == '1') { 1067 let rental_id_element = jQuery(this).parent().find(".item_rentalid")[0]; 1068 let addCartButton = jQuery(".io_item2_list_inner .add_cart_" + rental_id_element.innerText).find('.io_button'); 1069 addCartButton.removeClass("item_add"); 1070 addCartButton.html('<i class="fas fa-arrow-right"></i>'); 1071 1072 let itemHref = jQuery(this).parent().find(".item_href").text(); 1073 addCartButton.attr('href', itemHref); 1074 } 1075 }); 1076 1077 1078 /* If they have same day selection allowed, need to update checkout page datepicker on delay to make sure it works */ 1079 if(io_cartAllowSameDay == "on"){ 1080 setTimeout(allow_same_day_select_on_checkout, 500); 1081 } 1082 1083 if(io_info_required_data && io_info_required == "on"){ 1084 let io_required_data = io_info_required_data; 1085 jQuery("#ioAdditonalInformationContainer").show(); 1086 for (const [data, value] of Object.entries(io_required_data)) { 1087 if(value == 1){ 1088 jQuery("#io_info_modal_"+data).css("display", "inline-flex") 1089 jQuery("#io_im_"+data).val(getCookie(data)); 1090 } 1091 } 1092 show_or_hide_required_info_message() 1093 } 1094 if(jQuery(".bootstrap-timepicker").length == 0) { 1095 if (!/Mobi|Android/i.test(navigator.userAgent)) { 1096 jQuery("#cartPopover").scroll(function () { 1097 jQuery("[name=timeStart]").timepicker("hide"); 1098 jQuery("[name=timeEnd]").timepicker("hide"); 1099 }); 1100 jQuery(window).scroll(function () { 1101 jQuery("#cartPopover [name=timeStart]").timepicker("hide"); 1102 jQuery("#cartPopover [name=timeEnd]").timepicker("hide"); 1103 }); 1104 } 1105 } 1106 1107 if(jQuery(".io_product_infobox .item_inputtype").text() == "Map"){
1108 simpleCart.items().forEach(function (item, index){ 1109 if(item.get("rentalid") === jQuery(".io_product_infobox .item_rentalid").text()){ 1110 if(item.get("quantity") > 1){ 1111 let units; 1112 if(jQuery(".io_product_infobox .item_qtytype").text() == "Area"){ 1113 units = "sq meters" 1114 if(country === "US") units = "sq feet" 1115 }else if(jQuery(".io_product_infobox .item_qtytype").text() == "Perimeter"){ 1116 units = "meters" 1117 if(country === "US") units = "feet" 1118 } 1119 set_price_on_item_page(units, item.get("quantity")); 1120 } 1121 } 1122 }); 1123 } 1124 /* IO-21808 */ 1125 jQuery(".io_product_price_box").each(function() { 1126 let classes = jQuery(this).attr("class"); 1127 jQuery(this).attr("class", classes.replace(":", "_")); 1128 }); 1129 1130 /* Set time instructions (IO-21496) */ 1131 set_cart_time_instructions(); 1132 1133 if(io_accessory_select === "on"){ 1134 if(jQuery(".io_product_acc_pkg").children().length > 0){ 1135 let main_rental_id = jQuery(".item_rentalid").text(); 1136 let sel_div = jQuery("<div class=\"io_product_acc_pkg\" style=\"display:flex; margin-top:10px;\"></div>"); 1137 let sel = jQuery("<select class=\"io_product_acc_pkg\" onchange=\"accOnClick(this)\" />"); 1138 sel.append("<option value=\"\" selected=\"selected\" style=\"display:none\" disabled>Select one..</option>") 1139 jQuery("[id^=io_acc_shortname_"+main_rental_id+"]").each(function(){ 1140 sel.append("<option value="+this.id+">"+this.innerHTML+"</option>") 1141 if(this.id.split("_").length > 4){ 1142 let split_id = this.id.split("_"); 1143 let option_rental_id = split_id[split_id.length - 1]; 1144 let sel2 = jQuery("<select id=\"io_product_acc_pkg_sel_"+option_rental_id+"\" style=\"display:none; margin-left:5px;\" onchange=\"accOnClick(this)\" />"); 1145 sel2.append("<option value=\"\" selected=\"selected\" style=\"display:none\" disabled>Select one..</option>") 1146 jQuery("[id^=io_acc_shortname_"+option_rental_id+"_]").each(function(){ 1147 sel2.append("<option value="+this.id+">"+this.innerHTML+"</option>") 1148 }); 1149 sel_div.append(sel2); 1150 } 1151 }); 1152 sel_div.prepend(sel); 1153 jQuery(".io_product_acc_pkg").replaceWith(sel_div); 1154 } 1155 } 1156 if(io_cart_party_planner_email === "on" && io_cart_party_planner_destination){ 1157 jQuery("#cartPartyBuilderEmailContainer").show() 1158 if(getCookie("io_email")){ 1159 jQuery("#cartPartyBuilderEmailInput").val(getCookie("io_email")); 1160 } 1161 } 1162 1163 if(io_brand == "PW"){ 1164 jQuery(".io_product_price_box").attr("style", "display: none !important;"); 1165 jQuery(".io_product_price_sqfoot").attr("style", "display: grid !important;"); 1166 } 1167 1168 setTimeout(simpleCart.init, 100); 1169 if(io_hide_zero == 1){ 1170 jQuery(".io_product_price_top_left").each(function (){ 1171 if(Number(this.innerText.replace(/[^0-9.-]+/g,"")) == 0){ 1172 jQuery(this).parent().attr('style','display:none !important'); 1173 } 1174 }); 1175 jQuery(".io_product_price_left").each(function (){ 1176 if(Number(this.innerText.replace(/[^0-9.-]+/g,"")) == 0){ 1177 jQuery(this).parent().attr('style','display:none !important'); 1178 } 1179 }); 1180 } 1181 if (io_categoryVariantImages == 'on'){ 1182 jQuery(".io_category_thumbox").show(); 1183 jQuery('.view-product-button').addClass('view-product-button2') 1184 } 1185 let giftcard_value = jQuery(".item_giftcardvalue"); 1186 if(giftcard_value && giftcard_value.text()){ 1187 jQuery(".delivery_charge_check_container").hide(); 1188 } 1189 1190 if (io_customer_geolocation == 'on') initializeGeolocation(); 1191 }); /*end of on-ready*/ 1192 /*</editor-fold>*/ 1193 1194 /*<editor-fold defaultstate="collapsed" desc="Helper Functions">*/ 1195 function phraseUpdateCount(inputElement) 1196 { 1197 //read the text and strip out spaces 1198 const fullText = inputElement.value; 1199 const lettersOnly = fullText.replace(/\s+/g, ""); 1200 const count = lettersOnly.length; 1201 1202 const cookieKey = inputElement.classList[0]; 1203 1204 document.querySelector(".item_quantity").textContent = count; 1205
1206 setCookie(cookieKey, fullText, 45); 1207 } 1208 function io_party_planner_email_submit(){ 1209 let valid_regex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; 1210 let email = jQuery("#cartPartyBuilderEmailInput").val(); 1211 if(email){ 1212 if(email.match(valid_regex)){ 1213 setCookie("io_email", email, 14); 1214 window.open(io_cart_party_planner_destination, '_blank').focus(); 1215 }else{ 1216 jQuery("#cartPartyBuilderEmailWarning").show(); 1217 } 1218 }else{ 1219 jQuery("#cartPartyBuilderEmailWarning").show(); 1220 } 1221 } 1222 1223 function rid_in_batch(rid, batch_ids){ 1224 let result = batch_ids.filter(function(batch){ 1225 if(batch.includes(this)) return true; 1226 }, rid); 1227 return result 1228 } 1229 1230 function set_cart_time_instructions(){ 1231 /* Making it clearer that customers need to set the time in order to see pricing and availability. */ 1232 let instructions_container = jQuery("<p id=\"ioCartTimeInstructions\"></p>"); 1233 let instructions = ""; 1234 1235 if(multi_day){ 1236 instructions += "Select the event date or date range using the calendar"; 1237 }else{ 1238 instructions += "Select the event date using the calendar"; 1239 } 1240 instructions += "."; 1241 instructions_container.text(instructions); 1242 jQuery("#cartCalendar").append(instructions_container); 1243 } 1244 1245 function live_pricing_is_on(){ 1246 /* 1247 Checks to see if live pricing is on. Assumes it is on unless one of the following conditions: 1248 The setting Hide Live Price is off. 1249 The setting Show Weekend/Weekday Pricing is off. 1250 Delivery method pricing is enabled by default. 1251 We are on an item page that uses delivery method pricing. 1252 */ 1253 if(io_hide_live_prices != 1 || io_weekEndPrice != "on" || 1254 io_delivery_prices["default"].length != 0 || jQuery(".io_product_infobox .item_rentalid").innerText in io_delivery_prices["override"] || 1255 io_custom_prices["default"].length != 0 || jQuery(".io_product_infobox .item_rentalid").innerText in io_delivery_prices["override"]){ 1256 return false; 1257 } 1258 return true; 1259 } 1260 1261 function allow_same_day_select_on_checkout(){ 1262 jQuery(".jquery-datepicker").datepicker("option", "minDate", 0); 1263 } 1264 1265 function show_or_hide_required_info_message(){ 1266 if(io_info_required == "on"){ 1267 if(!all_info_provided()){ 1268 jQuery("#io_all_prices").hide(); 1269 jQuery("#item_additonal_info_open_message").show(); 1270 }else{ 1271 jQuery("#io_all_prices").show(); 1272 jQuery("#item_additonal_info_open_message").hide(); 1273 } 1274 } 1275 } 1276 1277 function all_info_provided(){ 1278 /* This is used for when the "Hide all pricing on page until information is provided" setting is on price settings. */ 1279 let all_data_provided = true; 1280 let io_required_data = io_info_required_data; 1281 for (const [data, value] of Object.entries(io_required_data)) { 1282 if(value == 1){ 1283 if(!getCookie(data)){ 1284 all_data_provided = false 1285 } 1286 } 1287 } 1288 1289 if(live_pricing_is_on() && !event_time_set()) { 1290 all_data_provided = false; 1291 } 1292 1293 return all_data_provided; 1294 } 1295 1296 function event_time_set(){ 1297 if(getCookie("io_timeStart") && 1298 getCookie("io_timeEnd") && 1299 getCookie("io_dateStart") && 1300 getCookie("io_dateEnd")){ 1301 return true; 1302 } else{ 1303 return false 1304 } 1305 } 1306 1307 function show_cart_message(){ 1308 message_container = jQuery("#cartCustomMessage"); 1309 message_container.html(io_cart_message); 1310 message_container.show(); 1311 } 1312 1313 function deliveryMethodSelected(){ 1314 setCookie("io_delivery_method", jQuery(".ioDeliveryMethods option:selected").text(), 14); 1315 checkRestrictedDeliveries(); 1316 } 1317 1318 function adjustPicBoxForHeader(){ 1319 /* For some reason its hard to get css with querySelector so we use jQuery to get the picbox. */ 1320 pic_box = jQuery(".io_product_picbox"); 1321 io_header = document.querySelector(".io_header"); 1322 if(pic_box != null && pic_box.css("position") == "sticky"){ 1323 if(io_header != null){ 1324 header_height = io_header.offsetHeight; 1325 pic_box.css("top", (10+header_height).toString()+"px"); 1326 } 1327 else{ 1328 possible_headers = document.querySelectorAll("header,section")
1329 possible_headers.forEach((ele) =>{ 1330 if(ele.style.top == "0px" && (ele.style.position == "fixed" || ele.style.position == "sticky")){ 1331 header = ele; 1332 header_height = header.offsetHeight; 1333 pic_box.css("top", (10+header_height).toString()+"px"); 1334 1335 } 1336 }); 1337 } 1338 } 1339 } 1340 function cart_times_all_set(){ 1341 if(jQuery("#ioCartTimeSelectContainer [name=dateStart]").val() == ""){ 1342 return false; 1343 } 1344 if(io_hidetimes === "off" || io_hidetimes === ""){ 1345 if(jQuery("#ioCartTimeSelectContainer [name=timeStart]").val() == ""){ 1346 return false; 1347 } 1348 if(jQuery("#ioCartTimeSelectContainer [name=timeEnd]").val() == ""){ 1349 return false; 1350 } 1351 } 1352 1353 return true; 1354 } 1355 function checkRestrictedDeliveries(){ 1356 let items = simpleCart.items() 1357 let restrictions_found = false; 1358 for(i in items){ 1359 let rid = items[i].get("rentalid"); 1360 if(typeof jQuery(".ioDeliveryMethods").val() != "undefined"){ 1361 if(io_delivery_methods[jQuery(".ioDeliveryMethods").val()]["restricted"].includes(rid)){ 1362 jQuery("#deliveryMethodWarning").show(); 1363 restrictions_found = true; 1364 } 1365 } 1366 } 1367 if(!restrictions_found){ 1368 jQuery("#deliveryMethodWarning").hide(); 1369 } 1370 } 1371 1372 function display_cart_warning(item){ 1373 let cart_warning_container = jQuery("#cartWarning"); 1374 1375 // Check if an event date if not we should tell them to set it. 1376 event_times = getAvailTimes(); 1377 if(!event_times[0] || !event_times[1]){ 1378 cart_warning_container.text("Please set the date and time for your event above."); 1379 cart_warning_container.show(); 1380 return false; 1381 } 1382 1383 let item_name = item.get("name"); 1384 let item_timeslots = item.get("timeslots"); 1385 let timeslot_name = getTimeslotName(item_timeslots); 1386 1387 let stop_loop = false; 1388 if(item_timeslots){ 1389 if(jQuery(item_timeslots).nodeName == "SELECT"){ 1390 /* NOTE: It should not be possible for timeslots to be empty. 1391 But in the event they somehow are, we should have this here. */ 1392 /* timeslots */ 1393 var timeslot_sel_range = jQuery(".item-timeslots [name=\""+timeslot_name+"\"] option:selected").val(); 1394 if(typeof timeslot_sel_range != "undefined"){ 1395 var [start_time, end_time] = break_timeslot_sel_range(timeslot_sel_range); 1396 } 1397 }else{ 1398 /* timepickers */ 1399 let [start_timepicker, end_timepicker] = get_cart_timepickers(timeslot_name); 1400 var start_time = start_timepicker.value; 1401 var end_time = end_timepicker.value; 1402 } 1403 if(!start_time || !end_time){ 1404 cart_warning_container.text("Please select a time range for the following item: " + item_name); 1405 cart_warning_container.show() 1406 stop_loop = true; 1407 } 1408 } else{ 1409 cart_warning_container.text("Some items are not available on this date."); 1410 cart_warning_container.show() 1411 } 1412 return stop_loop 1413 } 1414 1415 const io_personal_cookie_keys = ["io_email", "io_phone", "io_address", "io_city", "io_state", "io_zip"]; 1416 1417 function ioHasMarketingConsent(){ 1418 if(typeof cmplz_has_consent !== 'function'){ 1419 return true; 1420 } 1421 return cmplz_has_consent('marketing'); 1422 } 1423 1424 function ioUnwrapStoredValue(raw) { 1425 // Fully peel any {v,e} wrapper layers that may have accumulated when an 1426 // older plugin version re-saved an already-wrapped value (IO-36799). Cart 1427 // values (dates, times, addresses) are never JSON objects, so any layer 1428 // that parses to a {v,...} object is a wrapper to unwrap. Returns 1429 // { value, expired, malformed } describing the innermost stored string. 1430 var value = (raw == null) ? "" : String(raw); 1431 for (var depth = 0; depth < 25; depth++) { 1432 var trimmed = value.trim(); 1433 if (trimmed.charAt(0) !== '{') break; // plain value -> done 1434 var obj; 1435 try { 1436 obj = JSON.parse(trimmed); 1437 } catch (e) { 1438 break; // not parseable -> stop, keep value 1439 } 1440 if (!obj || typeof obj !== 'object' || !('v' in obj)) break; // not our wrapper 1441 if (obj.e && Date.now() > obj.e) { 1442 return { value: "", expired: true, malformed: false }; 1443 } 1444 value = (obj.v != null) ? String(obj.v) : ""; 1445 } 1446 // Only flag as malformed if what remains still looks like our own broken 1447 // {"v":...} wrapper (e.g. truncated) -- never an ordinary value that just 1448 // happens to start with "{", which must be preserved untouched. 1449 var malformed = /^\s*\{\s*"v"\s*:/.test(value); 1450 return { value: value, expired: false, malformed: malformed }; 1451 } 1452 1453 function setCookie(cname, cvalue, exdays) { 1454 if(io_personal_cookie_keys.indexOf(cname) !== -1 && !ioHasMarketingConsent()){ 1455 return; 1456 } 1457 // Store values in localStorage with an io_ prefix for uniqueness and emulate expiration
1458 try { 1459 // Unwrap first so an already-wrapped value can never be re-wrapped and 1460 // compound into nested {v,e} layers (IO-36799). 1461 var clean = ioUnwrapStoredValue(cvalue).value; 1462 var expiresAt = (typeof exdays === 'number' && exdays > 0) 1463 ? Date.now() + (exdays * 24 * 60 * 60 * 1000) 1464 : null; 1465 var payload = JSON.stringify({ v: clean, e: expiresAt }); 1466 window.localStorage.setItem(cname, payload); 1467 } catch (e) { 1468 // Swallow errors to keep behavior similar to cookie writes silently failing 1469 console.log(e); 1470 } 1471 } 1472 1473 function getCookie(cname) { 1474 // Read values from localStorage honoring expiration; return empty string if missing/expired 1475 try { 1476 var raw = window.localStorage.getItem(cname); 1477 if (!raw) return ""; 1478 var result = ioUnwrapStoredValue(raw); 1479 if (result.expired || result.malformed) { 1480 // Drop expired or corrupted entries so they self-heal instead of being 1481 // rendered as raw JSON in the date/time fields (IO-36799). 1482 try { window.localStorage.removeItem(cname); } catch (e) {} 1483 return ""; 1484 } 1485 return result.value; 1486 } catch (e) { 1487 return ""; 1488 } 1489 } 1490 async function fetchAndSetCookie(name) { 1491 var requestInit = { credentials: "include" }; 1492 fetch("https://rental.software/include/get_cookie.php?name=" + name, requestInit).then(function (response) { 1493 return response.json(); 1494 }).then(function (response) { 1495 return handleResponse(name, response); 1496 }); 1497 } 1498 1499 function handleResponse(name, response) { 1500 var currentCookieValue = getCookie(name); 1501 if (!!response.value && currentCookieValue !== response.value) { 1502 setCookie(name, response.value, 14); 1503 } 1504 return response.value; 1505 } 1506 1507 function clearIoPersonalDataForNoConsent(){ 1508 io_personal_cookie_keys.forEach(function(key){ 1509 try { 1510 window.localStorage.removeItem(key); 1511 } catch (e) { 1512 console.log(e); 1513 } 1514 }); 1515 1516 var trackingUrl = (window.location.href.indexOf("localhost") > -1) 1517 ? "http://localhost/io/bugs/include/iotracking.php" 1518 : "https://rental.software/include/iotracking.php"; 1519 var clearImg = new Image(); 1520 clearImg.src = trackingUrl + "?action=remove&nocache=" + Math.random(); 1521 } 1522 1523 document.addEventListener("cmplz_status_change", function (e) { 1524 if (e.detail.category === 'marketing' && e.detail.value === 'deny') { 1525 clearIoPersonalDataForNoConsent(); 1526 } 1527 }); 1528 1529 function break_timeslot_sel_range(timeslot_sel_range){ 1530 /* Takes a time range given by selected timeslot and gets the start and end time removing meridiem.*/ 1531 timeslot_sel_arr = timeslot_sel_range.split(" - "); 1532 var start_time = timeslot_sel_arr[0].replace("am"," am").replace("pm"," pm").replace(" "," "); 1533 var end_time = timeslot_sel_arr[1].replace("am"," am").replace("pm"," pm").replace(" "," "); 1534 1535 return Array(start_time, end_time); 1536 } 1537 function getAvailTimes(){ 1538 /* 1539 Commonly used helper function. Accomplishes two things: 1540 Returns an array containing start_date, start_time, and event duration. 1541 Sets cookies for start and end date, and start and end time. 1542 1543 Uses the inputs available in the cart if they are filled out, so dateStart, dateEnd, timeStart, and timeEnd. 1544 If timeslots are being used in cart it chooses the selected timeslot and breaks it on - and gets the start ane end time from that. 1545 */ 1546 let start_date = jQuery("input[name=dateStart]").val(); 1547 let end_date = jQuery("input[name=dateEnd]").val(); 1548 if(io_company_timeslots.length != 0 && io_cartdayselect == "single_day"){ 1549 let cart_company_timeslot_selected = jQuery(".ioCartCompanyTimeslots option:selected").first().val(); 1550 if(cart_company_timeslot_selected){ 1551 setCookie("io_company_timeslot_selected", cart_company_timeslot_selected, 14); 1552 cart_company_timeslot_selected = cart_company_timeslot_selected.split("-"); 1553 var start_time = cart_company_timeslot_selected[0].trim(); 1554 var end_time = cart_company_timeslot_selected[1].trim(); 1555 } 1556 } else { 1557 var start_time = jQuery("input[name=timeStart]").val(); 1558 var end_time = jQuery("input[name=timeEnd]").val(); 1559 } 1560 1561 if (start_date.length == 0) { 1562 start_date = getCookie("io_dateStart"); 1563 end_date = getCookie("io_dateEnd"); 1564 start_time = getCookie("io_timeStart"); 1565 end_time = getCookie("io_timeEnd"); 1566 } 1567 1568 const has_selected_company_timeslot = io_company_timeslots.length != 0 1569 && io_cartdayselect == "single_day" 1570 && jQuery(".ioCartCompanyTimeslots option:selected").first().val(); 1571 1572 if(io_hidetimes === "on" 1573 && io_force_blank_timepickers != "on" 1574 && !has_selected_company_timeslot) { 1575 start_time = start_default; 1576 end_time = end_default; 1577 jQuery("input[name=timeStart]").val(start_time); 1578 jQuery("input[name=timeEnd]").val(end_time); 1579 } 1580 1581 if(io_force_blank_timepickers != "on") 1582 { 1583 if(start_time.length == 0) 1584 { 1585 start_time = start_default; 1586 } 1587 if(end_time.length == 0) 1588 { 1589 end_time = end_default; 1590 } 1591 } 1592 1593 1594 /* no past dates */ 1595 if(start_date.length != 0 && convertDateStringtoDateObject(start_date, start_time) < new Date()){ 1596 start_date=""; 1597 end_date=""; 1598 } 1599 /* setCookie("checkDate", start_date, 14); */
1600 setCookie("io_dateStart", start_date, 14); 1601 setCookie("io_dateEnd", end_date, 14); 1602 setCookie("io_timeStart", start_time, 14); 1603 setCookie("io_timeEnd", end_time, 14); 1604 /* If we are using the information gathering tool, we do not want to show this message.*/ 1605 if( live_pricing_is_on() && io_info_required == "off" ){ 1606 if(!event_time_set() && io_always_display_live_price != "on"){ 1607 jQuery("#item_live_price_time_set_message").show(); 1608 }else{ 1609 jQuery("#item_live_price_time_set_message").hide(); 1610 } 1611 } 1612 1613 var newDate1 = convertDateStringtoDateObject(start_date, start_time); 1614 var newDate2 = convertDateStringtoDateObject(end_date, end_time); 1615 let time_duration = ((newDate2 - newDate1) / 3600) / 1000; 1616 return [start_date,start_time,time_duration]; 1617 } 1618 1619 function getAllRentalIDsFromCart(){ 1620 let rental_ids = ""; 1621 jQuery("[id^='cartItem_']").each(function(){ 1622 children = this.children 1623 for(let i = 0; i < children.length; ++i){ 1624 if(children[i].className == "item-rentalid") { 1625 rental_ids += children[i].innerText + "|"; 1626 break; 1627 } 1628 } 1629 }); 1630 return rental_ids 1631 } 1632 /*</editor-fold>*/ 1633 1634 /*<editor-fold defaultstate="collapsed" desc="Info Header Functions">*/ 1635 function init_date_timepicker_for_info_header(){ 1636 jQuery(".ioInfoDatepicker").datepicker({ 1637 changeMonth: true, 1638 changeYear: true, 1639 dateFormat: dateFormat, 1640 rangeSelect: true, 1641 numberOfMonths: 1, 1642 stepMonths: 1, 1643 speed: "fast", 1644 showOn: "both", 1645 onChangeMonthYear: cal_onChangeMonthYear, 1646 buttonText: "Calendar", 1647 minDate: 1, 1648 firstDay: 0 1649 }); 1650 jQuery("#ioHeaderDateStart").datepicker("option", { onSelect: function() { 1651 set_info_header_end_date(); 1652 saveInfoHeader(); 1653 // Add more functions if needed 1654 } 1655 }); 1656 1657 if(restrictTimes){ 1658 jQuery(".ioInfoTimepicker").timepicker({ 1659 startTime: new Date(0, 0, 10, 0, 0, 0), 1660 endTime: new Date(0, 0, 0, 20, 0, 0, 0), 1661 minTime:restrictTimeStart, 1662 maxTime:restrictTimeEnd, 1663 /*show24Hours: $show24Hours,*/ 1664 timeFormat: timeFormat, 1665 separator: ":", 1666 className: "elementor-widget-text-editor", 1667 step: 15, 1668 disableTouchKeyboard: true 1669 }); 1670 } else{ 1671 jQuery(".ioInfoTimepicker").timepicker({ 1672 startTime: new Date(0, 0, 10, 0, 0, 0), 1673 endTime: new Date(0, 0, 0, 20, 0, 0, 0), 1674 /*show24Hours: $show24Hours,*/ 1675 timeFormat: timeFormat, 1676 separator: ":", 1677 className: "elementor-widget-text-editor", 1678 step: 15, 1679 disableTouchKeyboard: true 1680 }); 1681 } 1682 setTimeout(setUpTimeRestrictions_infoHeaderTimepickers, 500); 1683 } 1684 1685 function saveInfoHeader(){ 1686 let info_header_start_date = jQuery("[id$=ioHeaderDateStart]"); 1687 let info_header_end_date = jQuery("[id$=ioHeaderDateEnd]"); 1688 let info_header_start_time = jQuery("[id$=ioHeaderTimeStart]"); 1689 let info_header_end_time = jQuery("[id$=ioHeaderTimeEnd]"); 1690 let info_header_address = jQuery("[id$=ioHeaderAddress]"); 1691 let info_header_city = jQuery("[id$=ioHeaderCity]"); 1692 let info_header_state = jQuery("[id$=ioHeaderState]"); 1693 let info_header_zip = jQuery("[id$=ioHeaderZipCode]"); 1694 let info_header_phone = jQuery("[id$=ioHeaderPhone]"); 1695 let info_header_email = jQuery("[id$=ioHeaderEmail]"); 1696 1697 if(info_header_start_time.val()) setCookie("io_timeStart", info_header_start_time.val(), 14); 1698 if(info_header_end_time.val()) setCookie("io_timeEnd", info_header_end_time.val(), 14); 1699 if(info_header_start_date.val()) setCookie("io_dateStart", info_header_start_date.val(), 14); 1700 if(info_header_end_date.val()) setCookie("io_dateEnd", info_header_end_date.val(), 14); 1701 if(info_header_address.val()) setCookie("io_address", info_header_address.val(), 14); 1702 if(info_header_city.val()) setCookie("io_city", info_header_city.val(), 14); 1703 if(info_header_state.val()) setCookie("io_state", info_header_state.val(), 14); 1704 if(info_header_zip.val()) setCookie("io_zip", info_header_zip.val(), 14); 1705 if(info_header_phone.val()) setCookie("io_phone", info_header_phone.val(), 14); 1706 if(info_header_email.val()) setCookie("io_email", info_header_email.val(), 14); 1707 1708 /* Set information in the cart. */ 1709 calCancel(); 1710 1711 header_increment_step(); 1712 1713 /* Stop form from doing anything else for elementor */ 1714 // jpa - still allow, turn off actions in form if wanted. to turn off io lead submission use the plugin settings 1715 //event.preventDefault(); 1716 //event.stopPropagation(); 1717 return true; 1718 } 1719 1720 function set_info_header_values(){ 1721 let info_header_start_date = jQuery("[id$=ioHeaderDateStart]"); 1722 let info_header_end_date = jQuery("[id$=ioHeaderDateEnd]"); 1723 let info_header_start_time = jQuery("[id$=ioHeaderTimeStart]"); 1724 let info_header_end_time = jQuery("[id$=ioHeaderTimeEnd]"); 1725 let info_header_street = jQuery("[id$=ioHeaderAddress]"); 1726 let info_header_city = jQuery("[id$=ioHeaderCity]"); 1727 let info_header_state = jQuery("[id$=ioHeaderState]"); 1728 let info_header_zip = jQuery("[id$=ioHeaderZipCode]"); 1729 let info_header_phone = jQuery("[id$=ioHeaderPhone]"); 1730 let info_header_email = jQuery("[id$=ioHeaderEmail]"); 1731 1732 if(getCookie("io_timeStart")) info_header_start_time.val(getCookie("io_timeStart")); 1733 if(getCookie("io_timeEnd")) info_header_end_time.val(getCookie("io_timeEnd")); 1734 if(getCookie("io_dateStart")) info_header_start_date.val(getCookie("io_dateStart")); 1735 if(getCookie("io_dateEnd")) info_header_end_date.val(getCookie("io_dateEnd")); 1736 if(getCookie("io_address")) info_header_street.val(getCookie("io_address")); 1737 if(getCookie("io_city")) info_header_city.val(getCookie("io_city")); 1738 if(getCookie("io_state")) info_header_state.val(getCookie("io_state")); 1739 if(getCookie("io_zip")) info_header_zip.val(getCookie("io_zip")); 1740 if(getCookie("io_phone")) info_header_phone.val(getCookie("io_phone")); 1741 if(getCookie("io_email")) info_header_email.val(getCookie("io_email")); 1742 } 1743 1744 function add_classes_and_onClicks(){ 1745 1746 /* First set up for dates */ 1747 let info_header_start_date = jQuery("#ioHeaderDateStart"); 1748 let info_header_end_date = jQuery("#ioHeaderDateEnd"); 1749 info_header_start_date.addClass("ioInfoDatepicker"); 1750 info_header_end_date.addClass("ioInfoDatepicker"); 1751 1752 /* Now Timepickers */ 1753 let info_header_start_time = jQuery("#ioHeaderTimeStart"); 1754 let info_header_end_time = jQuery("#ioHeaderTimeEnd"); 1755 info_header_start_time.addClass("ioInfoTimepicker"); 1756 info_header_end_time.addClass("ioInfoTimepicker"); 1757 1758 /* Add the onClick to the button */ 1759 let button = jQuery("#ioInfoHeaderSubmit"); 1760 button.click(saveInfoHeader); 1761 button.css("cursor", "pointer"); 1762 1763 /* Init datepicker and timepickers */ 1764 init_date_timepicker_for_info_header(); 1765 1766 /* Lastly set the values if they are set already */ 1767 set_info_header_values(); 1768 } 1769 1770 function remove_set_event_buttton(){ 1771 let set_event_button = jQuery(".pageDateRangeWrapper"); 1772 if(set_event_button.length > 0) set_event_button.hide(); 1773 } 1774 1775 function set_info_header_end_date(){ 1776 if(!jQuery("#ioHeaderDateEnd").val()){ 1777 jQuery("#ioHeaderDateEnd").val(jQuery("#ioHeaderDateStart").val()) 1778 } 1779 jQuery("#ioHeaderDateEnd").datepicker("option", { minDate: new Date(jQuery("#ioHeaderDateStart").val()) }); 1780 } 1781 1782 function header_increment_step(){ 1783 let active = jQuery(".io-step-active"); 1784 1785 switch(active.attr("id")){ 1786 case "io-step-1": 1787 if (/Mobi|Android/i.test(navigator.userAgent)) { 1788 jQuery("#io-step-2,#io-step-3,#io-step-4").hide(); 1789 } 1790 if(check_header_step_one(active)){ 1791 active.removeClass("io-step-active"); 1792 active.addClass("io-step-done") 1793 jQuery("#io-step-2").addClass("io-step-active") 1794 header_increment_step(); 1795 } 1796 break; 1797 case "io-step-2": 1798 if (/Mobi|Android/i.test(navigator.userAgent)) { 1799 jQuery("#io-step-2,#io-step-3,#io-step-4").show(); 1800 } 1801 if(simpleCart.items().length > 0){ 1802 active.removeClass("io-step-active"); 1803 active.addClass("io-step-done") 1804 jQuery("#io-step-3").addClass("io-step-active") 1805 header_increment_step(); 1806 } 1807 break; 1808 case "io-step-3": 1809 if (/Mobi|Android/i.test(navigator.userAgent)) { 1810 jQuery("#io-step-2,#io-step-3,#io-step-4").show(); 1811 } 1812 if(document.location.href.indexOf("io_quoteconfirm") >= 0){ 1813 active.removeClass("io-step-active"); 1814 active.addClass("io-step-done") 1815 jQuery("#io-step-4").addClass("io-step-active") 1816 header_increment_step(); 1817 } 1818 break; 1819 case "io-step-4": 1820 if (/Mobi|Android/i.test(navigator.userAgent)) { 1821 jQuery("#io-step-2,#io-step-3,#io-step-4").show(); 1822 } 1823 break; 1824 } 1825 } 1826 1827 function check_header_step_one(active) { 1828 var allInputs = active.find('input'); 1829 1830 for (var i = 0; i < allInputs.length; i++) { 1831 if (jQuery(allInputs[i]).val() === "") { 1832 return false; // Return false if any input is empty 1833 } 1834 } 1835 return true; // Return true if all inputs have a value 1836 } 1837 1838 /*</editor-fold>*/ 1839 1840 /*<editor-fold defaultstate="collapsed" desc="Accessory Click Functions">*/ 1841 function accDDClicked(event){ 1842 this_element = jQuery(this) 1843 if(!this_element.prop("selected")){ 1844 pid = event.data.pid 1845 accLmt = event.data.accLmt 1846 all_elements = jQuery("[id^=io_acc_"+pid+"_]") 1847 let count = 0; 1848 /* Tried using .filter and .length to get the count of selected items but could not make it work. */ 1849 for(i = 0; i < all_elements.length; ++i){ 1850 if(all_elements[i].selected){ 1851 ++count; 1852 } 1853 } 1854 if(accLmt == 0){ 1855 this_element.css("border", "5px solid #bbb"); 1856 this_element.prop("selected", true); 1857 } else if(count >= accLmt){ 1858 let selected_value = jQuery("[id^=io_acc_"+pid+"_]").filter(function() { 1859 return this["selected"]; 1860 }); 1861 /* be sure to unselect other slected values if our acc limit has been reached. */ 1862 selected_value.prop("selected", false); 1863 selected_value.css("border", "1px solid #bbb"); 1864 } 1865 this_element.css("border", "5px solid #bbb"); 1866 this_element.prop("selected", true); 1867 } else{ 1868 this_element.prop("selected", false); 1869 this_element.css("border", "1px solid #bbb"); 1870 } 1871 } 1872 1873 /* when accessory choice is clicked */ 1874 function accOnClick(acc_select=null){ 1875 /* set name/img back to original main in case they are just clicking on a 1st level size option */ 1876 jQuery("#bookNowBtn").removeClass("item_add").addClass("item_add_off").trigger("classChange"); 1877 jQuery(".io_product_title.item_name").html(main_name_orig); 1878 jQuery(".io_product_container .item_image").first().attr("src",main_img_src); 1879 jQuery(".io_product_container .item_image").first().attr("data-src",main_img_src); 1880 jQuery(".io_product_container .item_encoded").first().html(main_encoded); 1881 jQuery(".io_product_container .io_image_big").first().attr("src",main_img_src); 1882 jQuery(".io_product_container .io_image_big").first().attr("data-src",main_img_src); 1883 let main_id = jQuery(".io_product_container .item_rentalid").first().text();
1884 let main_id_arr = main_id.split(":") 1885 jQuery(".io_product_container .item_rentalid").html(main_id_arr[0]); 1886 let clk_id; 1887 if(jQuery(acc_select).find(":selected").val()){ 1888 clk_id = jQuery(acc_select).find(":selected").val().replace("io_acc_shortname_",""); 1889 }else{ 1890 clk_id = this.id.replace("io_acc_shortname_",""); 1891 } 1892 clk_id = clk_id.replace("iothumb_",""); 1893 let click_id_arr = clk_id.split("_"); 1894 /* let pid = main_id; */ 1895 /* if(main_id.split("_").length>1) pid = parseInt(click_id_arr[0]); */ 1896 let acc_obj_relate_is_map = acc_obj_relate instanceof Map; 1897 let acc_obj_relate_entries = acc_obj_relate_is_map ? acc_obj_relate.entries() : Object.entries(acc_obj_relate); 1898 for (let [key, value] of acc_obj_relate_entries) { 1899 let id = key; 1900 let children = acc_obj_relate_is_map ? acc_obj_relate.get(key) : value; 1901 if(Object.keys(children).length>0){ 1902 for (key2 in children) { 1903 if(Object.keys(children[key2]).length > 0){ 1904 /* 3rd level */ 1905 for (key3 in children[key2]) { 1906 displayPackageChoices(clk_id,key2,key3,children[key2]); 1907 } 1908 }else{ 1909 displayPackageChoices(clk_id,key,key2,children); 1910 } 1911 } 1912 }else{ 1913 displayPackageChoices(clk_id,0,id,acc_obj_relate); 1914 } 1915 } 1916 } 1917 1918 /* show/hide accessory levels as needed */ 1919 /* clk_id: one they clicked on, pid: parentid, id: iterator, arr: relationship array */ 1920 function displayPackageChoices(clk_id,pid,id,arr){ 1921 let main_id = jQuery(".io_product_container .item_rentalid").first().text(); 1922 let main_arr = main_id.split("_"); 1923 if(main_arr.length>1) main_id = parseInt(main_arr[0]); 1924 let click_id_arr = clk_id.split("_"); 1925 elem = getAccElem(id,pid); 1926 if(click_id_arr[0]==pid || click_id_arr[1]==pid || pid==0){ 1927 elem.style.display="inline-block"; 1928 }else{ 1929 elem.style.display="none"; 1930 } 1931 if(click_id_arr[1]==id && (click_id_arr[0]==pid || (pid==0 && click_id_arr[0]==main_id) ) || (click_id_arr.length==1 && click_id_arr[0]==id)){ 1932 jQuery("#bookNowBtn").removeClass("item_add_off").addClass("item_add").trigger("classChange"); 1933 updateMainItem(id,pid); 1934 } 1935 } 1936 1937 /* update it with accessory data for choices */ 1938 var main_img_src = jQuery("#single_image").first().attr("href"); 1939 var main_name_orig = jQuery(".io_product_title.item_name").html(); 1940 var main_encoded = jQuery(".io_product_container .item_encoded").html(); 1941 var main_desc = jQuery(".io_product_detailbox .io_product_desc").html(); 1942 function updateMainItem(id,pid){ 1943 /* update add to cart btn, name, img, desc */ 1944 let name = ""; 1945 let name_enc = ""; 1946 let main_id = jQuery(".io_product_container .item_rentalid").first().text(); 1947 let main_arr = main_id.split(":"); 1948 if(main_arr.length>1) main_id = main_arr[0]; 1949 if(pid!=0){ 1950 name += jQuery("#io_acc_itemname_"+pid).html()+":"; 1951 name_enc += jQuery("#io_acc_itemname_"+pid).html()+":"; 1952 name += jQuery("#io_acc_shortname_"+id).html(); 1953 name_enc += jQuery("#io_acc_itemname_"+id).html(); 1954 }else{ 1955 pid = main_id; 1956 name += jQuery("#io_acc_itemname_"+id).html(); 1957 name_enc += jQuery("#io_acc_itemname_"+id).html(); 1958 } 1959 jQuery(".io_product_container .item_encoded").html(encodeURIComponent(name_enc.replace(/[\u2032\u2019]+/ig,"'"))); 1960 jQuery(".io_product_container .item_rentalid").html(main_id+":"+pid+"_"+id); 1961 jQuery(".io_product_title.item_name").html(name); 1962 // Make sure the description actually displays text. 1963 let acc_desc = jQuery("#io_acc_desc_"+pid+"_"+id).first(); 1964 if(acc_desc.length>0 && acc_desc.text()){ 1965 jQuery(".io_product_container .io_product_desc").first().html(jQuery("#io_acc_desc_"+pid+"_"+id).first()[0].innerHTML); 1966 } 1967 1968 /* swap accessory image with main image pic for drop-down type items (linens) */ 1969 let img = jQuery("#io_acc_imgbig_"+pid+"_"+id).first().attr("href"); 1970 if(img==null) img = jQuery("#iothumb_"+pid+"_"+id).first().attr("src") 1971 if(img==null){ 1972 }else{ 1973 if(img.length==0 && pid==main_id){ 1974 /* for 1 level dd items that have no img, use the main img */ 1975 img = main_img_src; 1976 } 1977 jQuery(".io_product_container .io_image_big").first().attr("src",img); 1978 jQuery(".io_product_container .io_image_big").first().attr("data-src",
1978img); 1979 jQuery(".io_product_container .item_image").first().attr("src",jQuery("#iothumb_"+pid+"_"+id).first().attr("src")); 1980 jQuery(".io_product_container .item_image").first().attr("data-src",jQuery("#iothumb_"+pid+"_"+id).first().attr("src")); 1981 1982 jQuery("#single_image").first().attr("href",img).show(); 1983 } 1984 checkAvailFilter(); 1985 } 1986 1987 /* get either img or text for accessory choices */ 1988 function getAccElem(id,pid){ 1989 let path =pid+"_"+id; 1990 if(pid==0){ 1991 path=id; 1992 } 1993 let elem = null; 1994 try{ 1995 elem = document.querySelector("#ioAccButtonWrapper_"+path); 1996 }catch(e){} 1997 if(elem == null){ 1998 try{ 1999 elem = document.querySelector("#iothumb_"+path); 2000 }catch(e){} 2001 } 2002 if(elem==null){ 2003 try{ 2004 elem = document.querySelector("#io_product_acc_pkg_sel_"+pid); 2005 }catch(e){} 2006 if(elem!=null) return elem; 2007 }else{ return elem; } 2008 if(elem == null){ 2009 try{ 2010 elem = document.querySelector("#io_acc_shortname_"+path); 2011 }catch(e){} 2012 }else if(elem.src=="" | elem.getAttribute("data-src")==""){ 2013 try{ 2014 elem = document.querySelector("#io_acc_shortname_"+path); 2015 }catch(e){} 2016 }else if(elem.src.substr(-1)=="/"){ 2017 try{ 2018 elem = document.querySelector("#io_acc_shortname_"+path); 2019 }catch(e){} 2020 } 2021 if(elem==null){ 2022 try{ 2023 elem = document.querySelector("#io_acc_shortname_"+id); 2024 }catch(e){} 2025 } 2026 return elem; 2027 } 2028 2029 /* create the accessory choice btn (img/text) */ 2030 function makeAccBtn(button_add,pid){ 2031 let newButton; 2032 if(button_add.nodeName=="IMG"){ 2033 newButton = button_add; 2034 let id = newButton.id.replace("iothumb_"+pid,""); 2035 var wrapper = document.createElement("div"); 2036 wrapper.setAttribute("id", "ioAccButtonWrapper_"+pid+id); 2037 wrapper.style.display = "inline-block"; 2038 wrapper.appendChild(newButton); 2039 let acc_name = document.createElement("span"); 2040 acc_name.style.overflow = "hidden"; 2041 acc_name.style.textOverflow = "ellipsis"; 2042 acc_name.style.maxWidth = "80px"; 2043 acc_name.style.display = "block"; 2044 acc_name.style.whiteSpace = "nowrap"; 2045 acc_name.textContent = jQuery("#io_acc_shortname"+id).text(); 2046 acc_name.classList.add("accTextName"); 2047 acc_name.setAttribute("id", "io_acc_shortname_"+pid+id); 2048 wrapper.appendChild(document.createElement("br")); 2049 wrapper.appendChild(acc_name); 2050 2051 }else{ 2052 newButton = button_add.cloneNode(true); 2053 let id = newButton.id.replace("io_acc_shortname_",""); 2054 newButton.id = "io_acc_shortname_" + pid + "_" + id; 2055 } 2056 newButton.classList.add("elementor-animation-grow"); 2057 newButton.classList.remove("item_image"); 2058 newButton.style="cursor:pointer;border: solid 1px grey"; 2059 newButton.classList.add("io_access_button"); 2060 newButton.style.display = "inline-block"; 2061 newButton.style.verticalAlign = "top"; 2062 newButton.onclick=accOnClick; 2063 if(newButton.nodeName=="IMG"){ 2064 newButton.style.minWidth = "80px"; 2065 newButton.style.width = "80px"; 2066 newButton.style.margin = "2px"; 2067 newButton.style.height = "80px"; 2068 }else{ 2069 newButton.style.margin = "0px 2px 0px 2px"; 2070 } 2071 if(button_add.nodeName=="IMG"){ 2072 return wrapper 2073 } 2074 2075 return newButton; 2076 } 2077 /* when clicking the thumb swatches under main image (2nd image for an item) */ 2078 function updateMainPic(img) { 2079 let container = img.parentElement; 2080 while (container && !container.querySelector(".io_image_big")) { 2081 container = container.parentElement; 2082 } 2083 2084 const main_img = container ? container.querySelector(".io_image_big") : null; 2085 if (!main_img) return; 2086 2087 const dataBigSrc = img.getAttribute("data-big-src"); 2088 if (dataBigSrc) { 2089 main_img.src = dataBigSrc; 2090 return; 2091 } 2092 2093 let thumb_id = img.id; 2094 let big_id = thumb_id.replace("thumb", "big"); 2095 const img_big = document.getElementById(big_id); 2096 2097 if (img_big && img_big.href) { 2098 main_img.src = img_big.href; 2099 } 2100 } 2101 /*</editor-fold>*/ 2102 2103 /*<editor-fold defaultstate="collapsed" desc="Calendar Functions">*/ 2104 function calApply() { 2105 /* reset timeslots if filtering is on */ 2106 filterTimeslotsByDay_itemTimeslots();
2107 simpleCart.update(); 2108 2109 /* Prevent zero-duration selection: disallow identical start and end date/time */ 2110 try 2111 { 2112 var ds = jQuery("input[name=dateStart]").val(); 2113 var de = jQuery("input[name=dateEnd]").val(); 2114 var ts = jQuery("input[name=timeStart]").val(); 2115 var te = jQuery("input[name=timeEnd]").val(); 2116 if(ts && te && ds && de) 2117 { 2118 var s24 = convert12HourTo24Hour(ts); 2119 var e24 = convert12HourTo24Hour(te); 2120 var sObj = buildDateObj(ds.split("/"), s24); 2121 var eObj = buildDateObj(de.split("/"), e24); 2122 if(sObj && eObj && typeof sObj.getTime === 'function' && typeof eObj.getTime === 'function') 2123 { 2124 if(eObj.getTime() === sObj.getTime()) 2125 { 2126 alert("Please choose an end time that's after the start time."); 2127 jQuery("input[name=timeEnd]").val(""); 2128 return false; 2129 } 2130 } 2131 } 2132 }catch(e){} 2133 2134 if(cart_times_all_set()){ 2135 ioCartLoaderActivate(); 2136 setCookie("io_dateApplied", "true", 1) 2137 checkAvailAll(); 2138 // If no availability calls were made, hide loader shortly after 2139 setTimeout(function() 2140 { 2141 if(io_cart_loading_active && io_cart_loading_count === 0) 2142 { 2143 io_cart_loading_active = false; 2144 ioCartShowOverlay(false); 2145 } 2146 }, 300); 2147 calCancel(); 2148 } 2149 2150 2151 let io_required_data = io_info_required_data; 2152 for (const [data, value] of Object.entries(io_required_data)) { 2153 if(value == 1){ 2154 setCookie(data, jQuery("#io_im_"+data).val(), 14); 2155 } 2156 } 2157 2158 /* Check if information gathering header exists. If it does, update the times on there. */ 2159 if(jQuery("#ioInfoHeader").length){ 2160 jQuery("#ioHeaderTimeStart").val(jQuery("[name=timeStart]").val()); 2161 jQuery("#ioHeaderTimeEnd").val(jQuery("[name=timeEnd]").val()); 2162 jQuery("#ioHeaderDateStart").val(jQuery("[name=dateStart]").val()); 2163 jQuery("#ioHeaderDateEnd").val(jQuery("[name=dateEnd]").val()); 2164 header_increment_step(); 2165 } 2166 2167 show_or_hide_required_info_message() 2168 /* if(!cartStayOpen) cartHide(); */ 2169 } 2170 2171 function calCancel() { 2172 click_count = 0; 2173 start_date = getCookie("io_dateStart"); 2174 end_date = getCookie("io_dateEnd"); 2175 start_time = getCookie("io_timeStart"); 2176 end_time = getCookie("io_timeEnd"); 2177 jQuery("input[name=dateStart]").val(start_date); 2178 jQuery("input[name=dateEnd]").val(end_date); 2179 if(io_company_timeslots.length != 0 && io_cartdayselect == "single_day" && getCookie("io_company_timeslot_selected")){ 2180 jQuery(".ioCartCompanyTimeslots").val(getCookie("io_company_timeslot_selected")); 2181 } else{ 2182 jQuery("input[name=timeStart]").val(start_time); 2183 jQuery("input[name=timeEnd]").val(end_time); 2184 } 2185 setCalBackground(); 2186 2187 jQuery(".ioDateRange").html(smartFormatDateRange()) 2188 jQuery("#cartCalendar, #cartTimePicker").hide(); 2189 jQuery(".ioDateRange").show(); 2190 jQuery(".changeDateLinkWrapper").show(); 2191 } 2192 2193 /* var cartStayOpen = false; */ 2194 function calSetDateRange(stayOpen) { 2195 /* 2196 if(stayOpen==1){ 2197 cartStayOpen = true; 2198 }else{ 2199 cartStayOpen = false; 2200 } 2201 */ 2202 jQuery(".changeDateLinkWrapper").hide(); 2203 jQuery("#cartCalendar, #cartTimePicker").show(); 2204 jQuery("#cartDateRange").hide(); 2205 } 2206 2207 function smartFormatDateRange() { 2208 let start_date = jQuery("input[name=dateStart]").val(); 2209 let end_date = jQuery("input[name=dateEnd]").val(); 2210 if(io_company_timeslots.length != 0 && io_cartdayselect == "single_day"){ 2211 let cart_company_timeslot_selected = jQuery(".ioCartCompanyTimeslots option:selected").first().val(); 2212 if(cart_company_timeslot_selected){ 2213 setCookie("io_company_timeslot_selected", cart_company_timeslot_selected, 14); 2214 cart_company_timeslot_selected = cart_company_timeslot_selected.split("-"); 2215 var start_time = cart_company_timeslot_selected[0].trim(); 2216 var end_time = cart_company_timeslot_selected[1].trim(); 2217 } 2218 } else { 2219 var start_time = jQuery("input[name=timeStart]").val(); 2220 var end_time = jQuery("input[name=timeEnd]").val(); 2221 } 2222 2223 let text = ""; 2224 text = start_date; 2225 if(io_hidetimes!="on") text += " " + start_time; 2226 2227 if (start_date == end_date) { 2228 if(io_hidetimes!="on"){ 2229 text += " <i class='fas fa-arrow-right' style='padding:5px;'></i> "; 2230 text += end_time; 2231 } 2232 } else { 2233 text += " <i class='fas fa-arrow-right' style='padding:5px;'></i> "; 2234 text += end_date; 2235 if(io_hidetimes!="on") text += " " + end_time; 2236 } 2237 /* text += " <i class='fas fa-pencil-alt' style='margin-left:9px;color:"+pallet_color1+";'></i> "; */ 2238 2239 return text; 2240 } 2241 2242 2243 function resetCalButtons() { 2244 jQuery("#cartCalendar .ui-datepicker-prev").addClass("fas fa-arrow-left").css("color", pallet_color1); 2245 jQuery("#cartCalendar .ui-datepicker-next").addClass("fas fa-arrow-right").
2245css("color", pallet_color1); 2246 } 2247 2248 function cal_onChangeMonthYear(year, month, obj) { 2249 setTimeout(resetCalButtons, 10); 2250 setTimeout(setCalBackground, 10); 2251 } 2252 2253 function cal_onSelect(dateText, obj) { 2254 setTimeout(resetCalButtons, 10); 2255 let whatday_choice = ""; 2256 if(io_cartdayselect === "dropdown_options" && io_multidayquote === "on"){ 2257 let choice_obj = jQuery("#whatday"); 2258 if(choice_obj){ 2259 whatday_choice = choice_obj.val(); 2260 } 2261 } 2262 2263 click_count++; 2264 end_timepicker = jQuery("input[name=timeEnd]"); 2265 let timeStart = jQuery("input[name=timeStart]").val(); 2266 if(io_force_blank_timepickers != "on") 2267 { 2268 if (timeStart == "") { 2269 jQuery("input[name=timeStart]").val(start_default); 2270 jQuery("input[name=timeEnd]").val(end_default); 2271 } 2272 } 2273 2274 if (click_count == 1 || !multi_day || whatday_choice==="Same Day" || whatday_choice==="Overnight") { 2275 jQuery("input[name=dateStart]").val(dateText); 2276 jQuery("input[name=dateEnd]").val(dateText) 2277 end_timepicker.timepicker("option",{"minTime": jQuery("input[name=timeStart]").val()}); 2278 if(EndTimeLessThanStartTime( 2279 jQuery("input[name=timeStart]").val(), 2280 end_timepicker.val(), 2281 jQuery("[name='dateStart']").val(), 2282 jQuery("[name='dateEnd']").val() ) ) { 2283 end_timepicker.val(""); 2284 } 2285 if(io_cartAllowSameDay == "on"){ 2286 restrictStartTimepickerOnSameDaySelect(dateText, jQuery("input[name=timeStart]"), end_timepicker); 2287 } 2288 } else if (click_count == 2) { 2289 jQuery("input[name=dateEnd]").val(dateText); 2290 let start_date_str = jQuery("input[name=dateStart]").val(); 2291 let start_date_obj = convertDateStringtoDateObject(start_date_str); 2292 let end_date_obj = convertDateStringtoDateObject(dateText); 2293 if(end_date_obj < start_date_obj){ 2294 jQuery("input[name=dateStart]").val(dateText); 2295 if(io_cartAllowSameDay == "on"){ 2296 restrictStartTimepickerOnSameDaySelect(dateText, jQuery("input[name=timeStart]"), end_timepicker); 2297 } 2298 } else{ 2299 end_timepicker.timepicker("option",{"minTime": io_restrict_time_start}); 2300 } 2301 click_count = 0; 2302 } else { 2303 click_count = 0; 2304 } 2305 //custom code for suncoast_event 2306 if(io_cartdayselect === "dropdown_options" && io_multidayquote === "on"){ 2307 endDisplay(); 2308 //daysSelect(); 2309 } 2310 filterTimeslotsByDay_companyTimeslots(); 2311 2312 setTimeout(setCalBackground, 10); 2313 } 2314 2315 function endDisplay(){ 2316 //todo: need to figure out if these work and set triggers 2317 // trigger enddisplay after date is selected or possibly when dateEnd changes? 2318 let choice = jQuery("#whatday").val(); 2319 2320 setCookie("io_whatday", choice, 14); 2321 let dateStart = jQuery("[name=dateStart]"); 2322 let timeStart = jQuery("[name=timeStart]"); 2323 let dateEnd = jQuery("[name=dateEnd]"); 2324 let timeEnd = jQuery("[name=timeEnd]"); 2325 if(choice==='Overnight'){ 2326 let startdate = dateStart.val(); 2327 let starttime = io_overnightPickupTime; 2328 let endcalc_date_obj = new Date(buildDateobjectstring(startdate,dateFormat,starttime)); 2329 let duration_hrs = 24; 2330 let end_date_obj = new Date(endcalc_date_obj.getTime()+duration_hrs*60*60*1000); 2331 if(!isNaN(end_date_obj)){ 2332 dateEnd.val(getFormatteddate(end_date_obj)); 2333 timeEnd.val(getFormattedtime(end_date_obj)); 2334 timeEnd.attr('readonly','readonly'); 2335 } 2336 }else if(choice==='Multi-Day'){ 2337 let startdate = dateStart.val(); 2338 let starttime = timeStart.val() || start_default; 2339 let start_date_obj = new Date(buildDateobjectstring(startdate, dateFormat, starttime)); 2340 if(!isNaN(start_date_obj)){ 2341 //dateEnd.val(getFormatteddate(start_date_obj)); 2342 let cal = jQuery("#cartCalendar"); 2343 let origOnSelect = cal.datepicker("option", "onSelect"); 2344 cal.datepicker("option", "onSelect", null); 2345 cal.datepicker("setDate", start_date_obj); 2346 cal.datepicker("option", "onSelect", origOnSelect); 2347 } 2348 timeEnd.removeAttr('readonly'); 2349 if(io_force_blank_timepickers == "on" && !timeEnd.val()){ 2350 timeEnd.val(""); 2351 } else if(!timeEnd.val()){ 2352 timeEnd.val(end_default); 2353 } 2354 }else{ 2355 let startdate = dateStart.val(); 2356 let starttime = timeStart.val() || start_default; 2357 let start_date_obj = new Date(buildDateobjectstring(startdate, dateFormat, starttime)); 2358 if(!isNaN(start_date_obj)){ 2359 dateEnd.val(getFormatteddate(start_date_obj)); 2360 let cal = jQuery("#cartCalendar"); 2361 let origOnSelect = cal.datepicker("option", "onSelect"); 2362 cal.datepicker("option", "onSelect", null); 2363 cal.datepicker("setDate", start_date_obj); 2364 cal.datepicker("option", "onSelect", origOnSelect); 2365 } 2366 timeEnd.removeAttr('readonly'); 2367 if(io_force_blank_timepickers == "on" && !timeEnd.val()){ 2368 timeEnd.val(""); 2369 } else if(!timeEnd.val()){ 2370 timeEnd.val(end_default); 2371 } 2372 click_count = 0; 2373 }
2374 setTimeout(setCalBackground, 10); 2375 } 2376 function setCalBackground() { 2377 let dateStart_string = jQuery("input[name=dateStart]").val(); 2378 let dateEnd_string = jQuery("input[name=dateEnd]").val(); 2379 2380 if (dateFormat == "d/m/yy") { 2381 let dateStartArray = dateStart_string.split("/"); 2382 let dateEndArray = dateEnd_string.split("/"); 2383 var dateStart = new Date(dateStartArray[2], Number(dateStartArray[1])-1, dateStartArray[0]); 2384 var dateEnd = new Date(dateEndArray[2], Number(dateEndArray[1])-1, dateEndArray[0]); 2385 } else { 2386 var dateStart = new Date(dateStart_string); 2387 var dateEnd = new Date(dateEnd_string); 2388 } 2389 2390 2391 let sday = dateStart.getDate(); 2392 let smonth = dateStart.getMonth(); 2393 let syear = dateStart.getFullYear(); 2394 2395 let eday = dateEnd.getDate(); 2396 let emonth = dateEnd.getMonth(); 2397 let eyear = dateEnd.getFullYear(); 2398 2399 /* clear any (in case of cancel) */ 2400 jQuery(".ui-datepicker-calendar [data-handler=selectDay]").css("background-color","initial"); 2401 2402 /* set the selected ones */ 2403 jQuery("#cartCalendar [data-month=" + smonth + "][data-year=" + syear + "], #cartCalendar [data-month=" + 2404 emonth + "][data-year=" + eyear + "]").each(function (i) { 2405 let cday = jQuery(this).find("a").first().text(); 2406 let cmonth = jQuery(this).attr("data-month"); 2407 let cyear = jQuery(this).attr("data-year"); 2408 /* let dateCurrent = new Date(Date.UTC(cyear,cmonth,cday,12)); */ 2409 let dateCurrent = new Date(cyear, cmonth, cday); 2410 if (click_count == 1 && dateEnd_string.length == 0) dateEnd = dateStart; 2411 if (dateCurrent.getTime() == dateStart.getTime() && dateCurrent.getTime() == dateEnd.getTime()) { 2412 jQuery(this).css("border-radius", "6px 6px 6px 6px"); 2413 } else if (dateCurrent.getTime() == dateStart.getTime()) { 2414 jQuery(this).css("border-radius", "6px 0 0 6px"); 2415 } else if (dateCurrent.getTime() == dateEnd.getTime()) { 2416 jQuery(this).css("border-radius", "0 6px 6px 0"); 2417 } 2418 2419 if (dateCurrent >= dateStart && dateCurrent <= dateEnd) { 2420 jQuery(this).css("background-color", pallet_color1); 2421 } 2422 2423 2424 }); 2425 } 2426 /*</editor-fold>*/ 2427 2428 /*<editor-fold defaultstate="collapsed" desc="Timeslot/Timepicker Functions">*/ 2429 /* called from simplecart */ 2430 function timeslotChange(){ 2431 checkAvailCartTimeslots(); 2432 } 2433 function filterTimeslotsByDay_companyTimeslots(){ 2434 var weekday = new Array(); 2435 weekday[0] = "Sunday"; 2436 weekday[1] = "Monday"; 2437 weekday[2] = "Tuesday"; 2438 weekday[3] = "Wednesday"; 2439 weekday[4] = "Thursday"; 2440 weekday[5] = "Friday"; 2441 weekday[6] = "Saturday"; 2442 2443 let times = getAvailTimes(); 2444 let start_date = times[0]; 2445 var newDate1 = convertDateStringtoDateObject(start_date); 2446 let day = weekday[new Date(newDate1).getDay()]; 2447 2448 let selected_option_label = jQuery(".ioCartCompanyTimeslots option:selected").first().text().toLowerCase(); 2449 if(optionHasDay(weekday, selected_option_label)){ 2450 if(selected_option_label.indexOf(day.toLowerCase()) === -1){ 2451 jQuery(".ioCartCompanyTimeslots").val(""); 2452 } 2453 } 2454 if(io_company_timeslots.length != 0 && io_cartdayselect == "single_day"){ 2455 jQuery(".ioCartCompanyTimeslots > option").each(function() { 2456 if(optionHasDay(weekday, this.text.toLowerCase())){ 2457 for(i=0; i<weekday.length; ++i){ 2458 if(day.toLowerCase() == weekday[i].toLowerCase() && this.text.toLowerCase().indexOf(day.toLowerCase()) !== -1){ 2459 jQuery(this).show(); 2460 day_missing = false; 2461 } else if(day.toLowerCase() != weekday[i].toLowerCase() && this.text.toLowerCase().indexOf(day.toLowerCase()) === -1){ 2462 jQuery(this).hide(); 2463 } 2464 } 2465 } 2466 }); 2467 } 2468 } 2469 2470 function filterTimeslotsByDay_itemTimeslots(){ 2471 var weekday = new Array(); 2472 weekday[0] = "Sunday"; 2473 weekday[1] = "Monday"; 2474 weekday[2] = "Tuesday"; 2475 weekday[3] = "Wednesday"; 2476 weekday[4] = "Thursday"; 2477 weekday[5] = "Friday"; 2478 weekday[6] = "Saturday"; 2479 2480 let times = getAvailTimes(); 2481 let start_date = times[0]; 2482 var newDate1 = convertDateStringtoDateObject(start_date); 2483 let day = weekday[new Date(newDate1).getDay()]; 2484 2485 simpleCart.each(function (item, x) { 2486 var timeslots_html = item.get('timeslots'); 2487 if(typeof timeslots_html != "undefined" && jQuery.parseHTML(timeslots_html)[0].nodeName == "SELECT"){ 2488 if(timeslots_html.length > 0){ 2489 var timeslot_name = getTimeslotName(timeslots_html); 2490 if(typeof item.get("timeslots-orig") == "undefined"){ 2491 var timeslots_obj = jQuery.parseHTML(timeslots_html); 2492 } else{ 2493 var timeslots_obj = jQuery.parseHTML(item.get('timeslots-orig')); 2494 } 2495 jQuery(timeslots_obj).find("option").each(function(){ 2496 if(optionHasDay(weekday, this.text.toLowerCase())){ 2497 for(i=0; i<weekday.length; ++i){ 2498 if(day.toLowerCase() == weekday[i].toLowerCase() && this.text.toLowerCase().indexOf(day.toLowerCase()) !== -1){ 2499 /* jQuery(this).show(); */ 2500 } else if(day.toLowerCase() != weekday[i].toLowerCase() && this.text.toLowerCase().indexOf(day.toLowerCase()) === -1){ 2501 jQuery(this).remove(); 2502 } 2503 } 2504 } 2505 }); 2506 if(typeof item.get("timeslots-orig") == "undefined") item.set("timeslots-orig",item.get("timeslots")); 2507 item.set("timeslots",'<select class="simpleCart_timeslots" name="'+timeslot_name+'">'+jQuery(timeslots_obj).html()+'</select>'); 2508 } 2509 } 2510 }); 2511 } 2512 2513 function optionHasDay(weekdays, option_label){ 2514 for(i=0; i<weekdays.length; ++i){ 2515 if(option_label.indexOf(weekdays[i].toLowerCase()) !== -1){ 2516 return true; 2517 } 2518 } 2519 return false;
2520 } 2521 2522 function getTimeslotName(timeslots_html){ 2523 if(typeof timeslots_html=="undefined") return ""; 2524 var timeslot_name_s = timeslots_html.indexOf('name="'); 2525 timeslot_name_s += 6; 2526 var timeslot_name_e = timeslots_html.indexOf('"',timeslot_name_s); 2527 var timeslot_name = timeslots_html.substr(timeslot_name_s,timeslot_name_e-timeslot_name_s); 2528 return timeslot_name; 2529 } 2530 function setTimeslotSelected(item, timeslot_name){ 2531 jQuery(".item-timeslots [name=\""+timeslot_name+"\"] option").not(":selected").removeAttr("selected"); 2532 jQuery(".item-timeslots [name=\""+timeslot_name+"\"] option:selected").attr("selected","selected"); 2533 if(jQuery(".item-timeslots [name=\""+timeslot_name+"\"]").length>0){ 2534 item.set("timeslots",jQuery(".item-timeslots [name=\""+timeslot_name+"\"]")[0].outerHTML); 2535 } 2536 2537 /* set on quote page */ 2538 jQuery(".controls [name=\""+timeslot_name+"\"] option").not(":selected").removeAttr("selected"); 2539 jQuery(".controls [name=\""+timeslot_name+"\"] option[value='"+jQuery(".item-timeslots [name=\""+timeslot_name+"\"] option:selected").val()+"']").attr("selected","selected"); 2540 } 2541 2542 function setTimePicker(item, timepicker_name){ 2543 let [start_timepicker, end_timepicker] = get_cart_timepickers(timepicker_name); 2544 let start_time = start_timepicker.value; 2545 let end_time = end_timepicker.value; 2546 2547 if(!start_time){ 2548 start_timepicker.style.borderColor = "red"; 2549 } else{ 2550 start_timepicker.style.borderColor = ""; 2551 } 2552 if(!end_time){ 2553 end_timepicker.style.borderColor = "red"; 2554 } else{ 2555 end_timepicker.style.borderColor = ""; 2556 } 2557 2558 let start_timepicker_html = start_timepicker.outerHTML; 2559 let end_timepicker_html = end_timepicker.outerHTML; 2560 if(document.querySelectorAll(".item-timeslots [name=\""+timepicker_name+"\"]").length>0){ 2561 start_timepicker_html = addOrReplaceValueInTimepicker(start_timepicker_html, start_time); 2562 end_timepicker_html = addOrReplaceValueInTimepicker(end_timepicker_html, end_time); 2563 item.set("timeslots", '<div name="'+timepicker_name+'"> Start: '+start_timepicker_html+' End: '+end_timepicker_html+'</div>'); 2564 } 2565 /* set on quote page */ 2566 /* For linen type items with timepickers */ 2567 let rental_id = item.get("rentalid"); 2568 let split_on_colon = rental_id.split(":"); 2569 if(split_on_colon.length > 1){ 2570 fix_time_name_for_linen_rid(timepicker_name, split_on_colon, start_time, end_time, rental_id) 2571 }else{ 2572 let quote_page_start_timepicker = document.querySelectorAll(".controls [name=\""+timepicker_name.replace("io_timepicker_", "starttime_")+"\"]")[0]; 2573 let quote_page_end_timepicker = document.querySelectorAll(".controls [name=\""+timepicker_name.replace("io_timepicker_", "endtime_")+"\"]")[0]; 2574 if(quote_page_start_timepicker != null && quote_page_end_timepicker != null){ 2575 quote_page_start_timepicker.value = start_time; 2576 quote_page_end_timepicker.value = end_time; 2577 } 2578 } 2579 } 2580 2581 function fix_time_name_for_linen_rid(time_name, split_rid, start_time, end_time, rental_id){ 2582 for(let x = 0; x < split_rid.length; x++){ 2583 temp_timepicker_name = time_name.replace(rental_id, split_rid[x]); 2584 let quote_page_start_timepicker = document.querySelectorAll(".controls [name=\""+temp_timepicker_name.replace("io_timepicker_", "starttime_")+"\"]")[0]; 2585 let quote_page_end_timepicker = document.querySelectorAll(".controls [name=\""+temp_timepicker_name.replace("io_timepicker_", "endtime_")+"\"]")[0]; 2586 if(quote_page_start_timepicker != null && quote_page_end_timepicker != null){ 2587 quote_page_start_timepicker.value = start_time; 2588 quote_page_end_timepicker.value = end_time; 2589 } 2590 } 2591 } 2592 2593 function addOrReplaceValueInTimepicker(timepicker_html, time_value){ 2594 if(timepicker_html.includes("value=")){ 2595 timepicker_html = [timepicker_html.slice(0, timepicker_html.indexOf("value=")), 'value="'+time_value+'"', timepicker_html.slice(timepicker_html.length-1)].join(""); 2596 }else{ 2597 /* No value defined. Add it at the end of the outer html. */ 2598 let position = timepicker_html.lastIndexOf(">"); 2599 timepicker_html = [timepicker_html.slice(0, position), ' value="'+time_value+'"', timepicker_html.slice(position)].join(""); 2600 } 2601 return timepicker_html 2602 } 2603 2604 function restrictEndTimepickers(){ 2605 setUpTimeRestrictions_cartTimepickers() 2606 setUpTimeRestrictions_timeBasedItems() 2607 } 2608 2609 function setUpTimeRestrictions_timeBasedItems(){ 2610 jQuery("input[name^=start_timeslot_]").change(function() 2611 { 2612 end_timepicker = jQuery("input[name='"+this.name.replace("start", "end")+"']"); 2613 end_timepicker = jQuery(end_timepicker[end_timepicker.length - 1]); 2614 end_timepicker.timepicker("option",{"minTime": jQuery(this).val()}); 2615 if( EndTimeLessThanStartTime( jQuery(this).val(), end_timepicker.val(), "0/0/0", "0/0/0" ) ){ 2616 end_timepicker.val(""); 2617 } 2618 }); 2619 } 2620 2621 function setUpTimeRestrictions_cartTimepickers(){ 2622 jQuery("input[name=timeStart]").change(function() 2623 { 2624 end_timepicker = jQuery("[name='"+this.name.replace("Start", "End")+"']"); 2625 if(jQuery("[name='dateStart']").val() === jQuery("input[name='dateEnd']").val()){ 2626 end_timepicker.timepicker("option",{"minTime": jQuery(this).val()}); 2627 if(EndTimeLessThanStartTime( 2628 jQuery(this).val(), 2629 end_timepicker.val(), 2630 jQuery("[name='dateStart']").val(), 2631 jQuery("[name='dateEnd']").val() ) ) { 2632 end_timepicker.val(""); 2633 } 2634 } 2635 }); 2636 } 2637 2638 function setUpTimeRestrictions_infoHeaderTimepickers(){ 2639 jQuery("#ioHeaderTimeStart").change(function() 2640 { 2641 end_timepicker = jQuery("#ioHeaderTimeEnd"); 2642 if(jQuery("#ioHeaderDateStart").val() === jQuery("#ioHeaderDateEnd").val()){ 2643 end_timepicker.timepicker("option",{"minTime": jQuery(this).val()}); 2644 if(EndTimeLessThanStartTime( 2645 jQuery(this).val(), 2646 end_timepicker.val(), 2647 jQuery("#ioHeaderDateStart").val(), 2648 jQuery("#ioHeaderDateEnd").val() ) ) { 2649 end_timepicker.val(""); 2650 } 2651 } 2652 }); 2653 } 2654 2655 /* 2656 helper function to see if the value from a start timepicker is less than the string value of an end timepicker. 2657 2658 param start_time: string representation of the start time picker. 12hr or 24hr. 2659 param end_time: string representation of the end time picker. 12hr or 24hr. 2660 param start_date: string representation of the start date, seperated by "/". Can be wither d/m/y or m/d/y. Pass "0/0/0" if dates do not matter. 2661 param end_date: string representation of the end date, seperated by "/". Can be wither d/m/y or m/d/y. Pass "0/0/0" if dates do not matter. 2662 2663 */ 2664 function EndTimeLessThanStartTime(start_time, end_time, start_date, end_date){ 2665 if(!start_time || !end_time) return false;
2666 start_time = convert12HourTo24Hour(start_time); 2667 end_time = convert12HourTo24Hour(end_time); 2668 var split_start_date = start_date.split("/"); 2669 var split_end_date = end_date.split("/"); 2670 var startDate = buildDateObj(split_start_date, start_time); 2671 var endDate = buildDateObj(split_end_date, end_time); 2672 if(endDate < startDate){ 2673 return true; 2674 } else { 2675 return false; 2676 } 2677 } 2678 function get_cart_timepickers(timepicker_name){ 2679 let start_timepicker = document.getElementsByName(timepicker_name.replace("io_timepicker_", "start_timeslot_")); 2680 let end_timepicker = document.getElementsByName(timepicker_name.replace("io_timepicker_", "end_timeslot_")); 2681 start_timepicker = start_timepicker[start_timepicker.length-1]; 2682 end_timepicker = end_timepicker[end_timepicker.length-1]; 2683 return Array(start_timepicker, end_timepicker); 2684 } 2685 function restrictStartTimepickerOnSameDaySelect(start_date_str, start_timepicker, end_timepicker){ 2686 let selected_date_obj = convertDateStringtoDateObject(start_date_str); 2687 let current_date_obj = new Date(); 2688 if(current_date_obj.getDate() == selected_date_obj.getDate() && 2689 current_date_obj.getMonth() == selected_date_obj.getMonth() && 2690 current_date_obj.getYear() == selected_date_obj.getYear()){ 2691 let next_hour_time_stamp = current_date_obj.setMinutes(60); 2692 let next_hour_str = getFormattedtime(new Date(next_hour_time_stamp)) 2693 start_timepicker.timepicker("option",{"minTime": next_hour_str}); 2694 2695 /* If the time in the input box is less than the time we just restricted too, then clear time inputs */ 2696 restricted_time_obj = convertDateStringtoDateObject(start_date_str, next_hour_str); 2697 currently_selected_time_obj = convertDateStringtoDateObject(start_date_str, start_timepicker.val()); 2698 if(currently_selected_time_obj < restricted_time_obj){ 2699 start_timepicker.val(next_hour_str); 2700 end_timepicker.val(""); 2701 end_timepicker.timepicker("option",{"minTime": next_hour_str}); 2702 } 2703 }else{ 2704 start_timepicker.timepicker("option",{"minTime": restrictTimeStart}); 2705 } 2706 } 2707 /*</editor-fold>*/ 2708 2709 /*<editor-fold defaultstate="collapsed" desc="Simple Cart Bound Functions">*/ 2710 function cart_onUpdate() { 2711 /* need slight delay so simplecart updates before this runs */ 2712 setTimeout(cart_onUpdate2, 500); 2713 try{ 2714 for(var i=0;i<document.getElementsByClassName("ioCart").length;i++){ 2715 document.getElementsByClassName("ioCart")[i].setAttribute("cnt", simpleCart.items().length); 2716 } 2717 }catch(e){} 2718 } 2719 2720 function cart_onUpdate2() { 2721 jQuery("#cartSubtotal").html(simpleCart.toCurrency(simpleCart.total())); 2722 if(io_checkavail=="off") return; 2723 jQuery("#cartWarning").hide(); 2724 let hasUnavail = false; 2725 gift_cards_only = false; 2726 simpleCart.each(function (item, x) { 2727 let item_id = item.get("id"); 2728 var giftCardValue = item.get("giftcardvalue"); 2729 if (giftCardValue && giftCardValue.trim()) { 2730 gift_cards_only = true; 2731 } 2732 let avail = 0; 2733 let stop_loop = false; 2734 if (item.get("availability") != null) avail = item.get("availability").replace(" available", ""); 2735 let quantity = Number(item.get("quantity")); 2736 if(item.get("inputtype") == "Map"){ 2737 quantity = 1 2738 } 2739 if(typeof item.get("availability") != 'undefined'){ 2740 if (quantity > Number(avail) || avail == "not") { 2741 /* item.set("availability","<span style=color:red>"+item.get("availability")+"</span>"); */ 2742 setTimeout(function () { 2743 jQuery("#cartItem_" + item_id + " .item-availability").css("color", "red") 2744 }, 10); 2745 //jQuery("#cartWarning").show(); 2746 stop_loop = display_cart_warning(item); 2747 hasUnavail = true; 2748 } else { 2749 jQuery("#cartItem_" + item_id + " .item-availability").css("color", "inherit"); 2750 } 2751 }else{ 2752 event_times = getAvailTimes(); 2753 if(!event_times[0] || !event_times[1]){ 2754 jQuery("#cartWarning").text("Please set the date and time for your event above."); 2755 jQuery("#cartWarning").show() 2756 } 2757 } 2758 2759 var timeslots_html = item.get("timeslots"); 2760 if(typeof timeslots_html != "undefined"){ 2761 if(timeslots_html.length > 0){ 2762 var timeslot_name = getTimeslotName(timeslots_html); 2763 if(timeslots_html.indexOf("<select") >= 0){ 2764 setTimeslotSelected(item, timeslot_name); 2765 }else{ 2766 setTimePicker(item, timeslot_name); 2767 } 2768 } 2769 } 2770 if(stop_loop){ 2771 return false;
2772 } 2773 }); 2774 2775 if(gift_cards_only){ 2776 jQuery("#cartCalendarTimePickerContainer").hide(); 2777 }else{ 2778 jQuery("#cartCalendarTimePickerContainer").show(); 2779 } 2780 2781 if(hasUnavail && io_checkavail!="off"){ 2782 jQuery(".simpleCart_checkout").removeClass("simpleCart_checkout").addClass("simpleCart_checkout_off").trigger("classChange").click(cartShow); 2783 }else if(io_checkavail!="off"){ 2784 jQuery(".simpleCart_checkout_off").removeClass("simpleCart_checkout_off").addClass("simpleCart_checkout").trigger("classChange"); 2785 } 2786 2787 add_cart_buttons = document.querySelectorAll("[class*=add_cart_]"); 2788 if(add_cart_buttons){ 2789 for(let i = 0; i < add_cart_buttons.length; ++i){ 2790 add_cart_buttons[i].innerHTML = add_cart_buttons[i].innerHTML.replace("fa-cart-arrow-down", "fa-shopping-cart"); 2791 add_cart_buttons[i].innerHTML = add_cart_buttons[i].innerHTML.replace("Added to Cart", "Add to Cart"); 2792 add_cart_buttons[i].style.filter = "brightness(100%)"; 2793 simpleCart.each(function (item, x) { 2794 if( add_cart_buttons[i].className.includes( item.get("rentalid") ) ){ 2795 add_cart_buttons[i].innerHTML = add_cart_buttons[i].innerHTML.replace("fa-shopping-cart", "fa-cart-arrow-down"); 2796 add_cart_buttons[i].innerHTML = add_cart_buttons[i].innerHTML.replace("Add to Cart", "Added to Cart"); 2797 add_cart_buttons[i].style.filter = "brightness(90%)"; 2798 } 2799 }); 2800 } 2801 } 2802 2803 /* init time-based items */ 2804 if(document.location.href.indexOf("io_quoteform") == -1){ 2805 let today = new Date(); 2806 let io_dd = today.getDate(); 2807 let io_mm = today.getMonth() + 1; 2808 let io_yyyy = today.getFullYear(); 2809 if(restrictTimes){ 2810 jQuery(".item-timeslots .timepicker").each( function() { 2811 if(this.name.includes("end")){ 2812 start_timepicker = jQuery("input[name='"+this.name.replace("end", "start")+"']"); 2813 start_timepicker = jQuery(start_timepicker[start_timepicker.length - 1]); 2814 2815 if (io_force_blank_timepickers == "on") 2816 { 2817 start_timepicker.val(""); 2818 jQuery(this).timepicker({ 2819 startTime: "", 2820 endTime: "", 2821 minTime: restrictTimeStart, 2822 maxTime: restrictTimeEnd, 2823 timeFormat: timeFormat, 2824 separator: ":", 2825 className: "elementor-widget-text-editor", 2826 step: 15, 2827 disableTouchKeyboard: true 2828 }); 2829 } 2830 else 2831 { 2832 // Existing logic if "force blank" is not active 2833 if (start_timepicker.val() != "") { 2834 jQuery(this).timepicker({ 2835 startTime: new Date(io_mm+"/"+io_dd+"/"+io_yyyy + " " + start_default), 2836 endTime: new Date(io_mm+"/"+io_dd+"/"+io_yyyy + " " + end_default), 2837 minTime: start_timepicker.val(), 2838 maxTime: restrictTimeEnd, 2839 timeFormat: timeFormat, 2840 separator: ":", 2841 className: "elementor-widget-text-editor", 2842 step: 15, 2843 disableTouchKeyboard: true 2844 }); 2845 } else { 2846 jQuery(this).timepicker({ 2847 startTime: new Date(io_mm+"/"+io_dd+"/"+io_yyyy + " " + start_default), 2848 endTime: new Date(io_mm+"/"+io_dd+"/"+io_yyyy + " " + end_default), 2849 minTime: restrictTimeStart, 2850 maxTime: restrictTimeEnd, 2851 timeFormat: timeFormat, 2852 separator: ":", 2853 className: "elementor-widget-text-editor", 2854 step: 15, 2855 disableTouchKeyboard: true 2856 }); 2857 } 2858 } 2859 2860 } 2861 else { 2862 if (io_force_blank_timepickers == "on") 2863 { 2864 start_timepicker.val(""); 2865 jQuery(this).timepicker({ 2866 startTime: "", 2867 endTime: "", 2868 minTime: restrictTimeStart, 2869 maxTime: restrictTimeEnd, 2870 timeFormat: timeFormat, 2871 separator: ":", 2872 className: "elementor-widget-text-editor", 2873 step: 15, 2874 disableTouchKeyboard: true 2875 }); 2876 } 2877 else 2878 { 2879 jQuery(this).timepicker({ 2880 startTime: new Date(io_mm+"/"+io_dd+"/"+io_yyyy + " " + start_default), 2881 endTime: new Date(io_mm+"/"+io_dd+"/"+io_yyyy + " " + end_default), 2882 minTime:restrictTimeStart, 2883 maxTime:restrictTimeEnd, 2884 timeFormat: timeFormat, 2885 separator: ":", 2886 className: "elementor-widget-text-editor", 2887 step: 15, 2888 disableTouchKeyboard: true 2889 }); 2890 } 2891 } 2892 }); 2893 } else{ 2894 jQuery(".item-timeslots .timepicker").each( function() { 2895 if(this.name.includes("end") != -1){ 2896 start_timepicker = jQuery("input[name='"+this.name.replace("end", "start")+"']"); 2897 start_timepicker = jQuery(start_timepicker[start_timepicker.length - 1]); 2898 if (io_force_blank_timepickers == "on") 2899 { 2900 start_timepicker.val(""); 2901 jQuery(this).timepicker({ 2902 startTime: "", 2903 endTime: "", 2904 minTime: restrictTimeStart, 2905 maxTime: restrictTimeEnd, 2906 timeFormat: timeFormat, 2907 separator: ":", 2908 className: "elementor-widget-text-editor", 2909 step: 15, 2910 disableTouchKeyboard: true 2911 }); 2912 } 2913 else 2914 { 2915 if (start_timepicker.val() != "") { 2916 jQuery(this).timepicker({ 2917 startTime: new Date(io_mm + "/" + io_dd + "/" + io_yyyy + " " + start_default), 2918 endTime: new Date(io_mm + "/" + io_dd + "/" + io_yyyy + " " + end_default), 2919 minTime: start_timepicker.val(), 2920 timeFormat: timeFormat, 2921 separator: ":", 2922 className: "elementor-widget-text-editor", 2923 step: 15, 2924 disableTouchKeyboard: true 2925 }); 2926 } else { 2927 jQuery(this).timepicker({ 2928 startTime: new Date(io_mm + "/" + io_dd + "/" + io_yyyy + " " + start_default), 2929 endTime: new Date(io_mm + "/" + io_dd + "/" + io_yyyy + " " + end_default), 2930 timeFormat: timeFormat, 2931 separator: ":", 2932 className: "elementor-widget-text-editor", 2933 step: 15, 2934 disableTouchKeyboard: true 2935 }); 2936 } 2937 } 2938 } 2939 else 2940 { 2941 if (io_force_blank_timepickers == "on") 2942 { 2943 start_timepicker.val(""); 2944 jQuery(this).timepicker({ 2945 startTime: "", 2946 endTime: "", 2947 minTime: restrictTimeStart, 2948 maxTime: restrictTimeEnd, 2949 timeFormat: timeFormat, 2950 separator: ":", 2951 className: "elementor-widget-text-editor", 2952 step: 15, 2953 disableTouchKeyboard: true 2954 }); 2955 } 2956 else 2957 { 2958 jQuery(this).timepicker({ 2959 startTime: new Date(io_mm + "/" + io_dd + "/" + io_yyyy + " " + start_default), 2960 endTime: new Date(io_mm + "/" + io_dd + "/" + io_yyyy + " " + end_default), 2961 timeFormat: timeFormat, 2962 separator: ":", 2963 className: "elementor-widget-text-editor", 2964 step: 15, 2965 disableTouchKeyboard: true 2966 }); 2967 } 2968 } 2969 }); 2970 } 2971 setUpTimeRestrictions_timeBasedItems(); 2972 if(!event_time_set()){ 2973 jQuery(".itemRow .item-total").hide(); 2974 }else{ 2975 jQuery(".itemRow .item-total").show(); 2976 } 2977 } 2978 } 2979 function cart_beforeCheckout(data) { 2980 data.startdate = jQuery("input[name=dateStart]").val(); 2981 data.enddate = jQuery("input[name=dateEnd]").val(); 2982 if(getCookie("guid")){ 2983 data.guid = getCookie("guid"); 2984 }else{ 2985 data.io_custguid = fetchAndSetCookie("guid"); 2986 } 2987 if(io_company_timeslots.length != 0 && io_cartdayselect == "single_day"){ 2988 let cart_company_timeslot_selected = jQuery(".ioCartCompanyTimeslots option:selected").first().val(); 2989 if(cart_company_timeslot_selected){
2990 setCookie("io_company_timeslot_selected", cart_company_timeslot_selected, 14); 2991 cart_company_timeslot_selected = cart_company_timeslot_selected.split("-"); 2992 data.starttime = cart_company_timeslot_selected[0]; 2993 data.endtime = cart_company_timeslot_selected[1]; 2994 } 2995 } else { 2996 data.starttime = jQuery("input[name=timeStart]").val(); 2997 data.endtime = jQuery("input[name=timeEnd]").val(); 2998 } 2999 } 3000 function cart_beforeAdd(item) { 3001 var main_id = jQuery(".io_product_container .item_rentalid").first().text(); 3002 var item_id = item.get("rentalid"); 3003 3004 timeslots = item.get("timeslots"); 3005 if(timeslots){ 3006 if(timeslots.indexOf("<select") !== -1){ 3007 timeslot_name_id_start_pos = timeslots.lastIndexOf('name="timeslot_') + 'name="timeslot_'.length; 3008 timeslot_name_id_end_pos = timeslots.indexOf('"', timeslot_name_id_start_pos); 3009 new_timeslots = [timeslots.slice(0, timeslot_name_id_start_pos), item_id, timeslots.slice(timeslot_name_id_end_pos,timeslots.length)] 3010 new_timeslots = new_timeslots.join("") 3011 item.set("timeslots", new_timeslots); 3012 }else if(timeslots.indexOf("<div name=\"io_timepicker_") !== -1){ 3013 timeslot_name_id_start_pos = timeslots.lastIndexOf('name="io_timepicker_') + 'name="io_timepicker_'.length; 3014 timeslot_name_id_end_pos = timeslots.indexOf('"', timeslot_name_id_start_pos); 3015 new_timeslots = [timeslots.slice(0, timeslot_name_id_start_pos), item_id, timeslots.slice(timeslot_name_id_end_pos,timeslots.length)] 3016 new_timeslots = new_timeslots.join("") 3017 3018 timeslot_name_id_start_pos = new_timeslots.lastIndexOf('name="start_timeslot_') + 'name="start_timeslot_'.length; 3019 timeslot_name_id_end_pos = new_timeslots.indexOf('"', timeslot_name_id_start_pos); 3020 new_timeslots = [new_timeslots.slice(0, timeslot_name_id_start_pos), item_id, new_timeslots.slice(timeslot_name_id_end_pos,new_timeslots.length)] 3021 new_timeslots = new_timeslots.join("") 3022 3023 timeslot_name_id_start_pos = new_timeslots.lastIndexOf('name="end_timeslot_') + 'name="end_timeslot_'.length; 3024 timeslot_name_id_end_pos = new_timeslots.indexOf('"', timeslot_name_id_start_pos); 3025 new_timeslots = [new_timeslots.slice(0, timeslot_name_id_start_pos), item_id, new_timeslots.slice(timeslot_name_id_end_pos,new_timeslots.length)] 3026 new_timeslots = new_timeslots.join("") 3027 3028 item.set("timeslots", new_timeslots); 3029 } 3030 3031 } 3032 /* Here we are checking if we are on an item page and if we are adding the main item. 3033 If this is not true, we do not want to continue. Bail here. */ 3034 if((!main_id || !item_id)){ 3035 return true; 3036 }else if (item_id != main_id){ 3037 /* we are adding an accessory, We want to forcibly add the main item first. */ 3038 /* IO-26864 */ 3039 jQuery("#bookNowBtn").click(); 3040 } 3041 let required_dropdown_values = jQuery(".io_acc_li").filter(function() { 3042 let required_ele = jQuery(this).find(".item_required"); 3043 let required = 0; 3044 if(required_ele[0]){ 3045 required = required_ele[0].outerText; 3046 } 3047 let dropdown_ele = jQuery(this).find(".item_accessorydd"); 3048 let dropdown = 0; 3049 if(dropdown_ele[0]){ 3050 dropdown = dropdown_ele[0].outerText; 3051 } 3052 return (required > 0 && dropdown == 1) 3053 }); 3054 var required_selected = true; 3055 required_dropdown_values.each(function() { 3056 required_value_id = jQuery(this).find(".item_rentalid")[0].outerText; 3057 required_value_id = required_value_id.split("_"); 3058 required_value_id = required_value_id[required_value_id.length-1]; 3059 3060 let selected = jQuery("[id^='io_acc_"+required_value_id+"']").filter(function() { 3061 return this["selected"]; 3062 }); 3063 3064 //IO-22431 - This wasnt catching if [0] was undefined 3065 if(jQuery(this).find(".io_acc_li_name")[0] != undefined){ 3066 required_value_name = jQuery(this).find(".io_acc_li_name")[0].outerText ? jQuery(this).find(".io_acc_li_name")[0].outerText : ""; 3067 } 3068 if(selected.length < jQuery(this).find(".item_required")[0].outerText){ 3069 if(item_id == main_id){ 3070 alert(required_value_name+" is a required field."); 3071 } 3072 required_selected = false;
3073 } 3074 3075 if(!required_selected){ 3076 return false; 3077 } 3078 return true; 3079 }); 3080 if(!required_selected){ 3081 return false; 3082 } 3083 3084 /* IO-14857 */ 3085 if(jQuery(".io_product_measurement_price").length > 0){ 3086 let units; 3087 if(jQuery(".io_product_infobox .item_qtytype").text() == "Area"){ 3088 units = "sq meters" 3089 if(country === "US") units = "sq feet" 3090 }else if(jQuery(".io_product_infobox .item_qtytype").text() == "Perimeter"){ 3091 units = "meters" 3092 if(country === "US") units = "feet" 3093 } 3094 item.set("units", units); 3095 item.set("quantity", jQuery(".io_measure_price_raw_measurement").text()); 3096 } 3097 } 3098 function cart_afterAdd(item) { 3099 /*loading animation*/ 3100 ioCartLoaderActivate(); 3101 setTimeout(function(){ if(io_cart_loading_active && io_cart_loading_count === 0){ io_cart_loading_active=false; ioCartShowOverlay(false);} }, 300); 3102 3103 /* Add required Accessories */ 3104 let required_accs = jQuery("[id^=io_acc_required_]").filter(function() { 3105 return parseInt(this["outerText"]) > 0 && this.parentElement.style['display'] != 'none'; 3106 }); 3107 required_accs.each(function(index) { 3108 simpleCart.parse_html_and_add(this, true); 3109 }); 3110 3111 3112 let selected_values = jQuery("[id^=io_acc_]").filter(function() { 3113 return this["selected"]; 3114 }); 3115 3116 selected_values.each(function() { 3117 let info = {}; 3118 let rid = jQuery(this).find(".item_rentalid")[0].outerText; 3119 let split_rid = rid.split("_"); 3120 if(split_rid.length == 3){ 3121 let parent_rid = split_rid[1]; 3122 let main_item_rid = split_rid[0]; 3123 info["acc_dd_parent_limit"] = jQuery("#io_acc_accessorylimit_"+main_item_rid+"_"+parent_rid)[0].outerText; 3124 }else{ 3125 info["acc_dd_parent_limit"] = "0"; 3126 } 3127 info["name"] = jQuery(this).find(".io_acc_li_name")[0].outerText 3128 info["qtyincrement"] = jQuery(this).find(".item_qtyincrement")[0].outerText 3129 info["quantity"] = jQuery(this).find(".item_required")[0].outerText > 0 ? jQuery(this).find(".item_required")[0].outerText : 1; 3130 info["rentalid"] = jQuery(this).find(".item_rentalid")[0].outerText 3131 info["linkqty"] = jQuery(this).find(".item_linkqty")[0].outerText 3132 info["pagename"] = io_pagename; 3133 if(jQuery(this).find(".io_acc_li_img_thumb")[0]){ 3134 info["image"] = jQuery(this).find(".io_acc_li_img_thumb")[0].src 3135 } 3136 let already_added = simpleCart.items().filter((item) => item.get("rentalid").startsWith(split_rid[0]+"_"+split_rid[1])); 3137 if(jQuery(this).find(".item_accessorydd")[0].outerText != 1 && 3138 (info["acc_dd_parent_limit"] == "0" || already_added.length < info["acc_dd_parent_limit"]) ){ 3139 simpleCart.add(info, true); 3140 } 3141 }); 3142 3143 checkAvailCartOnly(true); 3144 3145 let last_upsell_call_time = Date.now() - last_upsell_call; 3146 if(in_cart_upsell && last_upsell_call_time > 2000){ 3147 let rental_ids = ""; 3148 3149 /* Get the last element in the cart. This is the last item added. */ 3150 last_added = jQuery("[id^='cartItem_']").last(); 3151 if(last_added.length){ 3152 last_added_children = last_added.children(); 3153 for(let i = 0; i < last_added_children.length; ++i){ 3154 if(last_added_children[i].className == "item-rentalid") { 3155 rental_ids += last_added_children[i].innerText + "|"; 3156 } 3157 } 3158 } 3159 3160 if(rental_ids.length>0 && jQuery("#cartPopover").attr("class") == "cartIn"){ 3161 var times = getAvailTimes(); 3162 last_upsell_call = Date.now(); 3163 getUpsellsCall(times[0],times[1],times[2],rental_ids,updateCartUpsell); 3164 } 3165 else{ 3166 jQuery("#cart-carousel-container").hide(); 3167 } 3168 } 3169 3170 if(io_company_timeslots.length != 0 && io_cartdayselect == "single_day"){ 3171 filterTimeslotsByDay_itemTimeslots(); 3172 simpleCart.update(); 3173 } 3174 3175 if (jQuery(".cartInfo.open,.ioCart.open, .ioCart_link.open").length == 0) { 3176 setTimeout(function () { 3177 cartShow(); 3178 }, 100); 3179 } 3180 3181 if(simpleCart.items().length==0){
3182 jQuery(".simpleCart_checkout").hide() 3183 }else{ 3184 jQuery(".simpleCart_checkout").show(); 3185 } 3186 3187 if(simpleCart.items().length > 0){ 3188 let headerBookButton = jQuery("a[href$='io_quoteform/']"); 3189 headerBookButton.addClass("ioCart_link"); 3190 headerBookButton.attr("href", "javascript:;"); 3191 } 3192 3193 checkRestrictedDeliveries() 3194 3195 if(jQuery("#ioInfoHeader").length){ 3196 header_increment_step(); 3197 } 3198 } 3199 function cart_afterQtyChange(){ 3200 let last_checkAvail_call_time = Date.now() - last_checkAvail_call; 3201 if(last_checkAvail_call_time > 2000){ 3202 /*loading animation*/ 3203 ioCartLoaderActivate(); 3204 setTimeout(function(){ if(io_cart_loading_active && io_cart_loading_count === 0){ io_cart_loading_active=false; ioCartShowOverlay(false);} }, 300); 3205 last_checkAvail_call = Date.now(); 3206 checkAvailCart(); 3207 checkAvailCartTimeslots(); 3208 } 3209 } 3210 function cart_hideTimepickerWrapper(){ 3211 jQuery(".ui-timepicker-wrapper").hide(); 3212 } 3213 function cart_beforeRemove() { 3214 last_remove = Date.now(); 3215 } 3216 function cart_afterRemove(removed_item){ 3217 checkAvailCart(); 3218 last_upsell_call_time = Date.now() - last_upsell_call; 3219 if(in_cart_upsell && last_upsell_call_time > 2000){ 3220 rental_ids = getAllRentalIDsFromCart(); 3221 if(rental_ids.length>0 && jQuery("#cartPopover").attr("class") == "cartIn"){ 3222 var times = getAvailTimes(); 3223 last_upsell_call = Date.now(); 3224 getUpsellsCall(times[0],times[1],times[2],rental_ids,updateCartUpsell); 3225 } 3226 else{ 3227 jQuery("#cart-carousel-container").hide(); 3228 } 3229 } 3230 3231 /* IO-24060 */
3232 simpleCart.items().forEach(function (item, index) { 3233 let expression = '^' + removed_item.get('rentalid') + '(?:[_:]\\d+)*'; 3234 if(item.get("rentalid").match(expression)){ 3235 item.remove(); 3236 } 3237 }); 3238 3239 3240 checkAvailCartTimeslots(); 3241 checkRestrictedDeliveries(); 3242 if(simpleCart.items().length==0){ 3243 jQuery(".simpleCart_checkout").hide() 3244 }else{ 3245 jQuery(".simpleCart_checkout").show(); 3246 } 3247 3248 if(jQuery("#ioInfoHeader").length && simpleCart.items().length == 0){ 3249 jQuery("#io-step-3").removeClass("io-step-active"); 3250 jQuery("#io-step-2").addClass("io-step-active"); 3251 jQuery("#io-step-2").removeClass("io-step-done") 3252 } 3253 } 3254 function cart_afterLoad(){ 3255 var items_removed = false; 3256 simpleCart.items().forEach(function(item){ 3257 if(item.get("pagename") != io_pagename){ 3258 item.remove() 3259 items_removed = true; 3260 } 3261 }) 3262 if(items_removed){ 3263 alert("Some items in the cart are from a different location and have been removed."); 3264 } 3265 } 3266 /*</editor-fold>*/ 3267 3268 /*<editor-fold defaultstate="collapsed" desc="Date/Time Object/String Conversion Functions">*/ 3269 function getFormatteddate(date_obj){ 3270 if(dateFormat.substring(0,1)=='d'){ 3271 let month = date_obj.getMonth() + 1; 3272 formatteddate = date_obj.getDate()+'/'+month+'/'+date_obj.getFullYear(); 3273 }else{ 3274 let month = date_obj.getMonth() + 1; 3275 formatteddate = month+'/'+date_obj.getDate()+'/'+date_obj.getFullYear(); 3276 } 3277 return formatteddate; 3278 } 3279 3280 function getFormattedtime(date_obj){ 3281 var hour24 = false;
3282 var ampm = 'am'; 3283 var starttime = jQuery('[name=timeStart]').val(); 3284 if(starttime.length>0 && starttime.indexOf('m')==-1) hour24 = true; 3285 if(hour24){ //24 hour return 3286 return date_obj.getHours()+':'+pad(date_obj.getMinutes(),2); 3287 }else{ //12 hour return 3288 var hour = date_obj.getHours(); 3289 if(hour==12) ampm='pm'; 3290 if(hour==0) hour=12; 3291 if(hour>12){ 3292 hour-=12; 3293 ampm='pm'; 3294 } 3295 return hour+':'+pad(date_obj.getMinutes(),2)+' '+ampm; 3296 } 3297 } 3298 3299 function buildDateobjectstring(date,dateformat,time){ 3300 var ampm = 'am'; 3301 var hour24 = false; 3302 if(typeof date == "undefined") return; 3303 if(typeof dateformat == "undefined") return; 3304 var start_arr = date.split('/'); 3305 if(dateformat.substring(0,1)=='d'){ 3306 date = start_arr[2]+'/'+pad(start_arr[1],2)+'/'+pad(start_arr[0],2); 3307 }else{ 3308 date = start_arr[2]+'/'+pad(start_arr[0],2)+'/'+pad(start_arr[1],2); 3309 } 3310 if(time.length>0 && time.indexOf('m')==-1) hour24 = true; 3311 if(hour24){ 3312 try{ 3313 var time_arr = time.split(':'); 3314 var hour = parseInt(time_arr[0]); 3315 var min = pad(time_arr[1], 2); 3316 time = hour + ':' + min + ':00'; 3317 }catch(err){ 3318 time = ""; 3319 } 3320 }else { 3321 try { 3322 time = time.replace('am', "").replace(' ', ""); 3323 if (time.indexOf('pm') != -1) ampm = 'pm'; 3324 time = time.replace('pm', "").replace(' ', ""); 3325 var time_arr = time.split(':'); 3326 var hour = parseInt(time_arr[0]); 3327 var min = pad(time_arr[1], 2); 3328 if (ampm == 'pm') { 3329 if (hour < 12) hour += 12; 3330 } else if (ampm == 'am' && hour == 12) { 3331 hour -= 12; 3332 } 3333 hour = pad(hour, 2); 3334 time = hour + ':' + min + ':00'; 3335 } catch (err) { 3336 time = ""; 3337 } 3338 } 3339 return date+' '+time; 3340 } 3341 3342 function pad(num, size) { 3343 var s = num+""; 3344 while (s.length < size) s = "0" + s; 3345 return s; 3346 } 3347 function convertDateStringtoDateObject(date_str, time_str=null){ 3348 if(date_str){ 3349 split_date_str = date_str.split("/"); 3350 /* Parse start and end time. */ 3351 if(time_str){ 3352 /* Check and see if we are in 12 hour format, if so convert it to 24 hour format. */ 3353 split_time_str = convert12HourTo24Hour(time_str); 3354 }else{ 3355 /* If we do not have a time, then default to zeros */ 3356 split_time_str = [0, 0]; 3357 } 3358 /* Create date object based off our set date format. */ 3359 date_obj = buildDateObj(split_date_str, split_time_str); 3360 return date_obj; 3361 }else{ 3362 return new Date(); 3363 } 3364 } 3365 3366 function buildDateObj(split_date_str, split_time_str){ 3367 if (dateFormat == "d/m/yy"){ 3368 return new Date(split_date_str[2], (+split_date_str[1] - 1).toString(), split_date_str[0], 3369 split_time_str[0], split_time_str[1]); 3370 }else{ 3371 return new Date(split_date_str[2], (+split_date_str[0] - 1).toString(), split_date_str[1], 3372 split_time_str[0], split_time_str[1]); 3373 } 3374 } 3375 3376 function convert12HourTo24Hour(time_str){ 3377 /* This function returns an array containing hours and minutes of provided string in 24 hour format. */ 3378 /* This is primarily used for creating JS Date objects */ 3379 split_time = time_str.split(":"); 3380 3381 /* We are in 12 hour format if there is an "m" attached to minutes portion. */ 3382 if(split_time[1].toLowerCase().search("m") != -1) { 3383 let separated_minutes = split_time[1].split(" "); 3384 if(separated_minutes.length==1){ 3385 split_time[1] = split_time[1].replace("am"," am"); 3386 split_time[1] = split_time[1].replace("pm"," pm"); 3387 separated_minutes = split_time[1].split(" "); 3388 } 3389 let minutes = separated_minutes[0]; 3390 let modifier = separated_minutes[1]; 3391 split_time[1] = minutes; 3392 3393 /* First assume that if the hours are 12, then its midnight. */ 3394 if(split_time[0] == "12"){ 3395 split_time[0] = "00"; 3396 } 3397 /* Second if there is a "p" in the modifier, then add twelve to the hours. */ 3398 if(typeof modifier != "undefined"){ 3399 if(modifier.toLowerCase().search("p") != -1){ 3400 split_time[0] = (parseInt(split_time[0], 10) + 12); 3401 } 3402 } 3403 } 3404 return split_time; 3405 } 3406 /*</editor-fold>*/ 3407 3408 /*<editor-fold defaultstate="collapsed" desc="Cart Show and Hide">*/ 3409 function cartShow() { 3410 jQuery("#cartPopover").show(); 3411 jQuery("#cartPopover").removeClass("cartOut"); 3412 jQuery("#cartPopover").addClass("cartIn"); 3413 jQuery(".cartInfo,.ioCart,.ioCart_link").addClass("open"); 3414 if (/Mobi|Android/i.test(navigator.userAgent)) { 3415 document.body.style.overflow = "hidden"; 3416 } 3417 /* jQuery(this).one("click", cartHide); */ 3418 jQuery(".cartInfo").unbind("click").one("click", function(event){ 3419 event.stopPropagation(); 3420 event.stopImmediatePropagation(); 3421 cartHide(); 3422 }); 3423 jQuery(".ioCart, .ioCart_link").unbind("click").one("click", function(event){ 3424 event.stopPropagation(); 3425 event.stopImmediatePropagation(); 3426 cartHide(); 3427 }); 3428 jQuery(".cartIcon").removeClass("fa-shopping-cart").addClass("fa-close"); 3429 if(simpleCart.items().length==0){
3430 jQuery(".simpleCart_checkout").hide() 3431 }else{ 3432 jQuery(".simpleCart_checkout").show(); 3433 } 3434 3435 checkAvailCartOnly(); 3436 3437 last_upsell_call_time = Date.now() - last_upsell_call; 3438 if(in_cart_upsell && last_upsell_call_time > 2000){ 3439 rental_ids = getAllRentalIDsFromCart(); 3440 if(rental_ids.length>0 && jQuery("#cartPopover").attr("class") == "cartIn"){ 3441 var times = getAvailTimes(); 3442 last_upsell_call = Date.now(); 3443 getUpsellsCall(times[0],times[1],times[2],rental_ids,updateCartUpsell); 3444 } 3445 else{ 3446 jQuery("#cart-carousel-container").hide(); 3447 } 3448 } 3449 } 3450 3451 function cartHide() { 3452 jQuery("#cartPopover").removeClass("cartIn"); 3453 jQuery("#cartPopover").addClass("cartOut"); 3454 if (/Mobi|Android/i.test(navigator.userAgent)) { 3455 document.body.style.overflow = "auto"; 3456 } 3457 /* jQuery("#cartPopover").hide(); */ 3458 jQuery(".cartInfo,.ioCart, .ioCart_link").removeClass("open"); 3459 /* jQuery(this).one("click", cartShow); */ 3460 jQuery(".cartInfo").unbind("click").one("click", function(event){ 3461 event.stopPropagation(); 3462 event.stopImmediatePropagation(); 3463 cartShow(); 3464 }); 3465 jQuery(".ioCart, .ioCart_link").unbind("click").one("click", function(event){ 3466 event.stopPropagation(); 3467 event.stopImmediatePropagation(); 3468 cartShow(); 3469 }); 3470 jQuery(".cartIcon").removeClass("fa-close").addClass("fa-shopping-cart"); 3471 } 3472 /* 3473 function set_date_cookie(){ 3474 if(this.id.indexOf("start_") !== -1){ 3475 setCookie("dateStart", this.value, 14); 3476 } else if(this.id.indexOf("end_") !== -1){ 3477 setCookie("dateEnd", this.value, 14); 3478 } 3479 } 3480 */ 3481 jQuery(document).ready(function () {setTimeout(simpleCart.init, 3);}); 3482 /*</editor-fold>*/ 3483 3484 /*<editor-fold defaultstate="collapsed" desc="Check Avail All Call">*/ 3485 function checkAvailAll(){ 3486 checkAvailCart(); 3487 checkAvailCartTimeslots(); 3488 checkAvailFilter(); 3489 } 3490 /*</editor-fold>*/ 3491 3492 /*<editor-fold defaultstate="collapsed" desc="Check Avail - Page">*/ 3493 /* for items on page not in cart */ 3494 function checkAvailFilter() { 3495 let rental_names = ""; 3496 let rental_ids = ""; 3497 let batch_ids = []; 3498 let cart_rental_names = ""; 3499 let cart_rental_ids = ""; 3500 let item_id = ""; 3501 let main_id = ""; 3502 jQuery(".item_encoded").each(function(){ 3503 rental_names += this.innerText + "|"; 3504 }); 3505 jQuery(".io_product_infobox .item_rentalid").each(function(){ 3506 rental_ids += this.innerText + "|"; 3507 item_id = this.innerText; 3508 main_id = this.innerText; 3509 }); 3510 let batch_count = 0; 3511 let batch_index = 0; 3512 // If we have rental id string set, then we don't want to include availability checking for fpw items in header 3513 // IO-31498 3514 if(!rental_ids) { 3515 jQuery(".io_item2_list_inner .item_rentalid, .io_item2_listrent .item_rentalid").each(function () { 3516 /* 3517 if(rental_ids.indexOf(this.innerText+"|") == -1){ 3518 rental_ids += this.innerText + "|"; 3519 } 3520 */ 3521 if (batch_count < 9) { 3522 if (!batch_ids.length) batch_ids.push("") 3523 if (!rid_in_batch(this.innerText + "|", batch_ids).length) { 3524 batch_ids[batch_index] += this.innerText + "|"; 3525 batch_count++; 3526 } 3527 } else { 3528 if (!rid_in_batch(this.innerText + "|", batch_ids).length) { 3529 batch_ids[batch_index] += this.innerText + "|"; 3530 batch_index++; 3531 batch_count = 0; 3532 batch_ids.push(""); 3533 } 3534 } 3535 }); 3536 } 3537 simpleCart.each(function (item, x) { 3538 var cart_name = item.get("encoded"); 3539 if(cart_name==null){ 3540 cart_name = encodeURIComponent(item.get("name")); 3541 cart_name = encodeURIComponent(decodeURIComponent(cart_name).replace(/[\u2032\u2019]+/ig,"'")); 3542 } 3543 let quantity = item.get("quantity"); 3544 if(item.get("inputtype") == "Map"){ 3545 quantity = 1 3546 } 3547 cart_rental_names += cart_name + "-" + quantity + "|"; 3548 var cart_id = item.get("rentalid"); 3549 cart_rental_ids += cart_id + "-" + quantity + "|"; 3550 }); 3551 /* #14494 IO-13779 */ 3552 let delivery_methods_arr = []; 3553 var delivery_prices = []; 3554 if(io_delivery_prices){ 3555 if(Object.keys(io_delivery_prices["override"]).includes(item_id)){ 3556 delivery_prices = io_delivery_prices["override"][item_id] 3557 }else{ 3558 if(!item_is_in_overrride_group(main_id)){ 3559 delivery_prices = io_delivery_prices["default"] 3560 } 3561 } 3562 for(item in io_delivery_methods){ 3563 if(delivery_prices.includes(io_delivery_methods[item]["id"])){ 3564 delivery_methods_arr.push(item); 3565 } 3566 } 3567 } 3568
3569 let custom_prices_arr = []; 3570 if(io_custom_prices){ 3571 if(Object.keys(io_custom_prices["override"]).includes(item_id.replace(":", '_'))){ 3572 custom_prices_arr = io_custom_prices["override"][item_id.replace(":", '_')] 3573 }else{ 3574 if(!item_is_in_overrride_group(main_id)){ 3575 custom_prices_arr = io_custom_prices["default"] 3576 } 3577 } 3578 } 3579 3580 /* IO-13548 */ 3581 if(io_accessory_price == "on"){ 3582 let times = getAvailTimes(); 3583 let acc_rental_id_str = getAccIDforPrice(); 3584 let return_id = 0; 3585 if(acc_rental_id_str != ""){ 3586 checkAvailCall(times[0],times[1],times[2],rental_names,acc_rental_id_str,displayAccessoryPrices,0,[],[],return_id,0,null,1,"",1); 3587 } 3588 } 3589 3590 let times = getAvailTimes(); 3591 if(rental_names.length>0){ 3592 if(use_weekday_weekend && rental_ids && !item_is_in_overrride_group(main_id)){ 3593 let return_id = 0; 3594 let week_weekend = ""; 3595 if(rental_ids != ""){ 3596 return_id = 1; 3597 week_weekend = get_week_weekend_times(times, main_id); 3598 checkAvailCall(week_weekend["weekday"][0],week_weekend["weekday"][1],week_weekend["weekday"][2],rental_names,rental_ids,updatePageAvail_weekday,0,cart_rental_ids,cart_rental_names,return_id,1); 3599 checkAvailCall(week_weekend["weekend"][0],week_weekend["weekend"][1],week_weekend["weekend"][2],rental_names,rental_ids,updatePageAvail_weekend,0,cart_rental_ids,cart_rental_names,return_id,1); 3600 } 3601 } 3602 let return_id = 0; 3603 if(rental_ids != "" || batch_ids.length){ 3604 return_id = 1; 3605 } 3606 if(delivery_methods_arr && rental_ids){ 3607 delivery_methods_arr.forEach(function(delivery_method){ 3608 checkAvailCall(times[0],times[1],times[2],rental_names,rental_ids,updatePageAvail_delivery_method,0,cart_rental_ids,cart_rental_names,return_id,1,delivery_method); 3609 }); 3610 } 3611 if(custom_prices_arr && rental_ids){ 3612 custom_prices_arr.forEach(function(custom_price){ 3613 let start_date = times[0]; 3614 let start_time = times[1]; 3615 if(!start_date){ 3616 start_date = getFormatteddate(new Date()); 3617 } 3618 if(!start_time){ 3619 start_time = io_default_start_time; 3620 } 3621 checkAvailCall(start_date,start_time,custom_price['duration'],rental_names,rental_ids,updatePageAvail_custom_price,0,cart_rental_ids,cart_rental_names,return_id,1,"",1,custom_price['name']); 3622 }); 3623 } 3624 3625 if(batch_ids.length){ 3626 batch_ids.forEach(function(rids){ 3627 return checkAvailCall(times[0],times[1],times[2],"",rids,updatePageAvail,0,cart_rental_ids,cart_rental_names,return_id,1,null,1,"",1); 3628 }); 3629 }else{ 3630 return checkAvailCall(times[0],times[1],times[2],rental_names,rental_ids,updatePageAvail,0,cart_rental_ids,cart_rental_names,return_id,1,null,1); 3631 } 3632 } 3633 } 3634 3635 function item_is_in_overrride_group(item_id){ 3636 for(const group_id in io_prices['override_groups']){ 3637 for(const search_id in io_prices['override_groups'][group_id]){ 3638 if(search_id == item_id){ 3639 return true; 3640 } 3641 } 3642 } 3643 return false 3644 } 3645 3646 function get_week_weekend_times(times, rid){ 3647 /* Create a copy instead of reference.*/ 3648 let temp_times = JSON.parse(JSON.stringify(times)); 3649 let start_date = temp_times[0]; 3650 if(!start_date){ 3651 start_date = getFormatteddate(new Date()); 3652 temp_times[0] = start_date; 3653 } 3654 temp_times[1] = io_default_start_time 3655 var newDate1 = convertDateStringtoDateObject(start_date, io_default_start_time); 3656 var newDate2 = convertDateStringtoDateObject(start_date, io_default_end_time); 3657 let time_duration = ((newDate2 - newDate1) / 3600) / 1000; 3658 temp_times[2] = time_duration; 3659 let day = new Date(newDate1).getDay(); //IO-28150 - Other countries put the date dd/mm/yy so using the formatted newDate1 instead of start_date accounts for this 3660 let weekday_weekend = {}; 3661 weekday_weekend["rid"] = rid; 3662 if(io_weekendDefine == "friday-sunday"){ 3663 if(day == 5 || day == 6 || day == 0){ 3664 weekday_weekend["weekend"] = JSON.parse(JSON.stringify(temp_times)); 3665 temp_times[0] = getNextMonday(temp_times[0]); 3666 weekday_weekend["weekday"] = JSON.parse(JSON.stringify(temp_times)); 3667 }else if(day == 1 || day == 2 || day == 3 || day == 4){ 3668 weekday_weekend["weekday"] = JSON.parse(JSON.stringify(temp_times)); 3669 temp_times[0] = getNextSaturday(temp_times[0]); 3670 weekday_weekend["weekend"] = JSON.parse(JSON.stringify(temp_times)); 3671 } 3672 }else if(io_weekendDefine == "saturday-sunday") { 3673 if (day == 6 || day == 0) { 3674 weekday_weekend["weekend"] = JSON.parse(JSON.stringify(temp_times)); 3675 temp_times[0] = getNextMonday(temp_times[0]); 3676 weekday_weekend["weekday"] = JSON.parse(JSON.stringify(temp_times)); 3677 } else if (day == 1 || day == 2 || day == 3 || day == 4 || day == 5) { 3678 weekday_weekend["weekday"] = JSON.parse(JSON.stringify(temp_times)); 3679 temp_times[0] = getNextSaturday(temp_times[0]); 3680 weekday_weekend["weekend"] = JSON.parse(JSON.stringify(temp_times)); 3681 } 3682 }else if (io_weekendDefine == "friday-monday"){ 3683 if(day == 5 || day == 6 || day == 0 || day == 1){ 3684 weekday_weekend["weekend"] = JSON.parse(JSON.stringify(temp_times)); 3685 temp_times[0] = getNextTuesday(temp_times[0]); 3686 weekday_weekend["weekday"] = JSON.parse(JSON.stringify(temp_times)); 3687 }else if(day == 2 || day == 3 || day == 4){ 3688 weekday_weekend["weekday"] = JSON.parse(JSON.stringify(temp_times)); 3689 temp_times[0] = getNextSaturday(temp_times[0]); 3690 weekday_weekend["weekend"] = JSON.parse(JSON.stringify(temp_times)); 3691 } 3692 } 3693 return weekday_weekend; 3694 } 3695 3696 /* 3697 helper function found here: 3698 https://bobbyhadz.com/blog/javascript-get-date-of-next-monday#:~:text=To%20get%20the%20next%20Monday%2C%20we%3A&text=If%20the%20remainder%20is%20equal,month%20for%20the%20next%20Monday. 3699 */ 3700 function getNextMonday(date_str) { 3701 const date_obj = parseDate(date_str, dateFormat); 3702 3703 const nextMonday = new Date( 3704 date_obj.setDate( 3705 date_obj.getDate() + ((7 - date_obj.getDay() + 1) % 7 || 7), 3706 ), 3707 ); 3708 3709 return getFormatteddate(nextMonday); 3710 } 3711 3712 function getNextTuesday(date_str) { 3713 const date_obj = parseDate(date_str, dateFormat); 3714 3715 const nextMonday = new Date( 3716 date_obj.setDate( 3717 date_obj.getDate() + ((7 - date_obj.getDay() + 2) % 7 || 7), 3718 ), 3719 ); 3720 3721 return getFormatteddate(nextMonday); 3722 } 3723 3724 function parseDate(date_str, format) { 3725 var parts = date_str.split(/[/.-]/); 3726 var day, month, year; 3727 3728 if (format === "m/d/yy") {
3729 month = parseInt(parts[0]) - 1; 3730 day = parseInt(parts[1]); 3731 year = parseInt(parts[2]) + (parts[2].length === 2 ? 2000 : 0); 3732 } else if (format === "d/m/yy") { 3733 day = parseInt(parts[0]); 3734 month = parseInt(parts[1]) - 1; 3735 year = parseInt(parts[2]) + (parts[2].length === 2 ? 2000 : 0); 3736 } else if (format === "yy/m/d") { 3737 year = parseInt(parts[0]) + (parts[0].length === 2 ? 2000 : 0); 3738 month = parseInt(parts[1]) - 1; 3739 day = parseInt(parts[2]); 3740 } else { 3741 throw new Error("Unsupported date format"); 3742 } 3743 3744 return new Date(year, month, day); 3745 } 3746 3747 /* modified from function above */ 3748 function getNextSaturday(date_str) { 3749 const date_obj = parseDate(date_str, dateFormat); 3750 3751 const next_friday = new Date( 3752 date_obj.setDate( 3753 date_obj.getDate() + ((7 - date_obj.getDay() + 6) % 7 || 7), 3754 ), 3755 ); 3756 3757 return getFormatteddate(next_friday); 3758 } 3759 3760 function updatePageAvail(data){ 3761 let use_id = data["return_id"] 3762 delete data["return_id"]; 3763 if(use_id == 1){ 3764 updatePageAvail_itemIDs(data) 3765 }else{ 3766 updatePageAvail_itemNames(data); 3767 } 3768 } 3769 function updatePageAvail_weekday(data){ 3770 jQuery.each(data, function (rental_id, qty){ 3771 if (rental_id == "price") { 3772 var prices = qty; 3773 jQuery.each(prices, function (price_id, amt) { 3774 let cust_price = document.querySelector(".io_product_cust_price_weekday"); 3775 if(cust_price==undefined){ 3776 var first_price = document.querySelector(".io_product_price_box"); 3777 if(first_price != null){ 3778 cust_price = first_price.cloneNode(true); 3779 /* clear all classes */ 3780 cust_price.className = ""; 3781 cust_price.classList.add("io_product_price_box"); 3782 cust_price.classList.add("io_product_cust_price_weekday"); 3783 cust_price.style.display = "none"; 3784 first_price.before(cust_price); 3785 } 3786 } 3787 3788 main_item_id = jQuery(".io_product_infobox .item_rentalid").first().text(); 3789 if(main_item_id == price_id && cust_price!=undefined){ 3790 if(typeof amt == "string") amt = Number(amt.replace(",","")); 3791 cust_price.querySelector("p:nth-child(1)").innerHTML=simpleCart.toCurrency(amt); 3792 let times = getAvailTimes(); 3793 cust_price.querySelector("p:nth-child(2)").innerHTML = io_weekDayText; 3794 if(amt>0){ 3795 cust_price.style.display = "grid"; 3796 }else{ 3797 cust_price.style.display = "none"; 3798 } 3799 } 3800 }); 3801 } 3802 }); 3803 } 3804 function updatePageAvail_delivery_method(data){ 3805 var delivery_method = data["delivery_method"] 3806 jQuery.each(data, function (rental_id, qty){ 3807 if (rental_id == "price") { 3808 var prices = qty; 3809 jQuery.each(prices, function (price_id, amt) { 3810 let cust_price = document.querySelector(".io_product_cust_price_delivery_method"+io_delivery_methods[delivery_method]["id"]); 3811 let rid = jQuery(".io_product_container .item_rentalid").first().text(); 3812 if(cust_price==undefined && !io_delivery_methods[delivery_method]["restricted"].includes(rid)){ 3813 var first_price = document.querySelector(".io_product_price_box"); 3814 if(first_price != null){ 3815 cust_price = first_price.cloneNode(true); 3816 /* clear all classes */ 3817 cust_price.className = ""; 3818 cust_price.classList.add("io_product_price_box"); 3819 cust_price.classList.add("io_product_cust_price_delivery_method"+io_delivery_methods[delivery_method]["id"]); 3820 cust_price.style.display = "none"; 3821 first_price.before(cust_price); 3822 } 3823 } 3824 3825 main_item_id = jQuery(".io_product_infobox .item_rentalid").first().text(); 3826 if(main_item_id == price_id && cust_price!=undefined){ 3827 if(typeof amt == "string") amt = Number(amt.replace(",","")); 3828 cust_price.querySelector("p:nth-child(1)").innerHTML=simpleCart.toCurrency(amt); 3829 let times = getAvailTimes(); 3830 cust_price.querySelector("p:nth-child(2)").innerHTML = make_live_price_editable_time(times, delivery_method); 3831 if(amt>0 && event_time_set()){ 3832 cust_price.style.display = "grid"; 3833 }else{ 3834 cust_price.style.display = "none"; 3835 } 3836 } 3837 }); 3838 } 3839 }); 3840 } 3841 function updatePageAvail_custom_price(data, custom_price_name){
3842 let custom_price_class_name = custom_price_name.replace(/[\s:./()!]/g, '_'); 3843 jQuery.each(data, function (rental_id, qty){ 3844 if (rental_id == "price") { 3845 var prices = qty; 3846 jQuery.each(prices, function (price_id, amt) { 3847 let cust_price = document.querySelector(".io_product_cust_price_"+custom_price_class_name); 3848 let rid = jQuery(".io_product_container .item_rentalid").first().text(); 3849 if(cust_price==undefined){ 3850 var first_price = document.querySelector(".io_product_price_box"); 3851 if(first_price != null){ 3852 cust_price = first_price.cloneNode(true); 3853 /* clear all classes */ 3854 cust_price.className = ""; 3855 cust_price.classList.add("io_product_price_box"); 3856 cust_price.classList.add("io_product_cust_price_"+custom_price_class_name); 3857 cust_price.style.display = "none"; 3858 first_price.before(cust_price); 3859 } 3860 } 3861 3862 main_item_id = jQuery(".io_product_infobox .item_rentalid").first().text(); 3863 if(main_item_id == price_id && cust_price!=undefined){ 3864 if(typeof amt == "string") amt = Number(amt.replace(",","")); 3865 cust_price.querySelector("p:nth-child(1)").innerHTML=simpleCart.toCurrency(amt); 3866 cust_price.querySelector("p:nth-child(2)").innerHTML = "for " + custom_price_name; 3867 if(amt>0){ 3868 cust_price.style.display = "grid"; 3869 }else{ 3870 cust_price.style.display = "none"; 3871 } 3872 } 3873 }); 3874 } 3875 }); 3876 } 3877 function updatePageAvail_weekend(data){ 3878 jQuery.each(data, function (rental_id, qty){ 3879 if (rental_id == "price") { 3880 var prices = qty; 3881 jQuery.each(prices, function (price_id, amt) { 3882 let cust_price = document.querySelector(".io_product_cust_price_weekend"); 3883 if(cust_price==undefined){ 3884 var first_price = document.querySelector(".io_product_price_box"); 3885 if(first_price != null){ 3886 cust_price = first_price.cloneNode(true); 3887 /* clear all classes */ 3888 cust_price.className = ""; 3889 cust_price.classList.add("io_product_price_box"); 3890 cust_price.classList.add("io_product_cust_price_weekend"); 3891 cust_price.style.display = "none"; 3892 first_price.before(cust_price); 3893 } 3894 } 3895 3896 main_item_id = jQuery(".io_product_infobox .item_rentalid").first().text(); 3897 if(main_item_id == price_id && cust_price!=undefined){ 3898 if(typeof amt == "string") amt = Number(amt.replace(",","")); 3899 cust_price.querySelector("p:nth-child(1)").innerHTML=simpleCart.toCurrency(amt); 3900 let times = getAvailTimes(); 3901 cust_price.querySelector("p:nth-child(2)").innerHTML = io_weekEndText; 3902 if(amt>0){ 3903 cust_price.style.display = "grid"; 3904 }else{ 3905 cust_price.style.display = "none"; 3906 } 3907 } 3908 }); 3909 } 3910 }); 3911 } 3912 function updatePageAvail_itemIDs(data){ 3913 jQuery.each(data, function (rental_id, qty){ 3914 if (rental_id == "price" && jQuery(".io_product_infobox .item_inputtype").text() != "Map") { 3915 var prices = qty; 3916 jQuery.each(prices, function (price_id, amt) { 3917 let cust_price = document.querySelector(".io_product_cust_price"); 3918 if(cust_price==undefined){ 3919 var first_price = document.querySelector(".io_product_price_box"); 3920 if(first_price != null){ 3921 cust_price = first_price.cloneNode(true); 3922 /* clear all classes */ 3923 cust_price.className = ""; 3924 cust_price.classList.add("io_product_price_box"); 3925 cust_price.classList.add("io_product_cust_price"); 3926 cust_price.style.display = "none"; 3927 first_price.before(cust_price); 3928 } 3929 } 3930 main_item_id = jQuery(".io_product_infobox .item_rentalid").first().text(); 3931 if(main_item_id == price_id && cust_price!=undefined){ 3932 if(typeof amt == "string") amt = Number(amt.replace(",","")); 3933 cust_price.querySelector("p:nth-child(1)").innerHTML=simpleCart.toCurrency(amt); 3934 let times = getAvailTimes(); 3935 cust_price.querySelector("p:nth-child(2)").innerHTML = make_live_price_editable_time(times); 3936 if(amt>0 && (event_time_set() || io_always_display_live_price == "on")){ 3937 cust_price.style.display = "grid"; 3938 }else{ 3939 cust_price.style.display = "none"; 3940 } 3941 } 3942 }); 3943 } 3944 3945 if(qty<=0 && rental_id != "delivery_method"){ 3946 /* cat,all-item,widget */ 3947 if(io_checkavail=="warn"){ 3948 jQuery(".add_cart_"+rental_id.replace(":", "\\\:")+" .item_add").removeClass("item_add").addClass("item_add_off").trigger("classChange"); 3949 jQuery(".unavailable_message_"+rental_id.replace(":", "\\\:")).show(); 3950 }
3951 if(io_checkavail=="hide") jQuery(".add_cart_"+rental_id).parent().parent().parent().hide(); 3952 3953 /* product page */ 3954 if(jQuery(".io_product_container").length && io_checkavail!="off" && jQuery(".io_product_container .item_rentalid").first().text() === rental_id){ 3955 jQuery(".add_cart_"+rental_id.replace(":", "\\\:")+" .item_add").first().removeClass("item_add").addClass("item_add_off").trigger("classChange"); 3956 jQuery(".io_product_container .unavailable_message").show(); 3957 } 3958 }else if(qty>0){ 3959 if(io_checkavail=="warn"){ 3960 jQuery(".add_cart_"+rental_id.replace(":", "\\\:")+" .item_add_off").removeClass("item_add_off").addClass("item_add").trigger("classChange"); 3961 jQuery(".unavailable_message_"+rental_id.replace(":", "\\\:")).hide(); 3962 } 3963 if(io_checkavail=="hide") jQuery(".add_cart_"+rental_id).parent().parent().parent().show(); 3964 3965 /* product page */ 3966 if(jQuery(".io_product_container").length && io_checkavail!="off" && jQuery(".io_product_container .item_rentalid").first().text() === rental_id){ 3967 jQuery(".add_cart_"+rental_id.replace(":", "\\\:")+" .item_add_off").removeClass("item_add_off").addClass("item_add").trigger("classChange"); 3968 jQuery(".io_product_container .unavailable_message").hide(); 3969 } 3970 } 3971 }); 3972 } 3973 function updatePageAvail_itemNames(data){ 3974 jQuery.each(data, function (rental_name, qty) { 3975 rental_name = rental_name.replace(/[\u2032\u2019]+/ig,"'"); 3976 var main_name_temp = ""; 3977 if(typeof main_name_orig != "undefined"){ 3978 main_name_temp = main_name_orig.replace(/[\u2032\u2019]+/ig,"'"); 3979 } 3980 rental_name_esc = rental_name.replace(/'/g, "\\\\'"); 3981 if (rental_name == "price") { 3982 var prices = qty; 3983 jQuery.each(prices, function (price_name, amt) { 3984 /* var prices = document.querySelector(".io_product_price_box:not(.io_product_cust_price)"); */ 3985 /* if(prices != null) prices.remove(); */ 3986 let cust_price = document.querySelector(".io_product_cust_price"); 3987 if(cust_price==undefined){ 3988 var first_price = document.querySelector(".io_product_price_box"); 3989 if(first_price != null){ 3990 cust_price = first_price.cloneNode(true); 3991 /* clear all classes */ 3992 cust_price.className = ""; 3993 cust_price.classList.add("io_product_price_box"); 3994 cust_price.classList.add("io_product_cust_price"); 3995 cust_price.style.display = "none"; 3996 first_price.before(cust_price); 3997 } 3998 } 3999 try{ 4000 var main_name = decodeURIComponent(jQuery(".io_product_container .item_encoded").first().html().replace(/[+]/gi, "%20")); 4001 }catch(e){main_name=""} 4002 var i = main_name.lastIndexOf(":"); 4003 let acc_name = ""; 4004 let rental_name = ""; 4005 var i = main_name.lastIndexOf(":"); 4006 if(i>0){ 4007 rental_name = main_name.substring(0, i); 4008 acc_name = main_name.substring(i+1); 4009 } 4010 if (acc_name.toUpperCase() == price_name.toUpperCase() && cust_price!=undefined){ 4011 var rental_id = document.querySelector(".item_rentalid").innerText; 4012 if(rental_id != null){ 4013 rid_arr = rental_id.split(":"); 4014 /* ignore the main id for this */ 4015 rental_id = rid_arr[rid_arr.length-1]; 4016 if(jQuery("#io_acc_overrideprice_"+rental_id).first().text()>0){ 4017 amt = prices[acc_name]; 4018 }else{ 4019 let item_price = Number(prices[rental_name].replace(",","")); 4020 amt = Number(amt.replace(",","")) + item_price; 4021 amt = simpleCart.toCurrency(amt, {symbol:""}) 4022 } 4023 } 4024 cust_price.querySelector("p:nth-child(1)").innerText="$"+amt; 4025 if(typeof amt == "string") amt = Number(amt.replace(",","")); 4026 let times = getAvailTimes(); 4027 cust_price.querySelector("p:nth-child(2)").innerHTML = make_live_price_editable_time(times); 4028 if(amt>0 && (event_time_set() || io_always_display_live_price == "on")){ 4029 cust_price.style.display = "grid"; 4030 }else{ 4031 cust_price.style.display = "none"; 4032 } 4033 4034 }else if(!rental_name && !acc_name && cust_price!=undefined){ 4035 amt = prices[main_name]; 4036 cust_price.querySelector("p:nth-child(1)").innerText="$"+amt; 4037 if(typeof amt == "string") amt = Number(amt.replace(",","")); 4038 let times = getAvailTimes(); 4039 cust_price.querySelector("p:nth-child(2)").innerHTML = make_live_price_editable_time(times); 4040 if(amt>0 && (event_time_set() || io_always_display_live_price == "on")){ 4041 cust_price.style.display = "grid"; 4042 }else{ 4043 cust_price.style.display = "none"; 4044 } 4045 } 4046 4047 }); 4048 } 4049 4050 if(qty<=0){ 4051 /* cat,all-item,widget */ 4052 if(io_checkavail=="warn"){ 4053 jQuery("div[name='maindiv_"+rental_name_esc+"'] .item_add").removeClass("item_add").addClass("item_add_off").trigger("classChange"); 4054 jQuery("div[name='maindiv_"+rental_name_esc+"'] .unavailable_message").show(); 4055 }
4056 if(io_checkavail=="hide") jQuery("div[name='maindiv_"+rental_name_esc+"']").hide(); 4057 4058 /* product page */ 4059 if(jQuery(".io_product_container").length && io_checkavail!="off"){ 4060 if(main_name_temp==rental_name){ 4061 jQuery(".io_product_container .item_add").first().removeClass("item_add").addClass("item_add_off").trigger("classChange"); 4062 jQuery(".io_product_container .unavailable_message").show(); 4063 } 4064 } 4065 }else if(qty>0){ 4066 /* console.log("good"); */ 4067 if(io_checkavail=="warn"){ 4068 jQuery("div[name='maindiv_"+rental_name_esc+"'] .item_add_off").removeClass("item_add_off").addClass("item_add").trigger("classChange"); 4069 jQuery("div[name='maindiv_"+rental_name_esc+"'] .unavailable_message").hide(); 4070 } 4071 if(io_checkavail=="hide") jQuery("div[name='maindiv_"+rental_name_esc+"']").show(); 4072 4073 /* product page */ 4074 if(jQuery(".io_product_container").length && io_checkavail!="off"){ 4075 if(main_name_temp==rental_name){ 4076 jQuery(".io_product_container .item_add_off").removeClass("item_add_off").addClass("item_add").trigger("classChange"); 4077 jQuery(".io_product_container .unavailable_message").hide(); 4078 } 4079 } 4080 } 4081 }); 4082 } 4083 function displayAccessoryPrices(data) { 4084 if (data.price) { 4085 let acc_prices = data.price; 4086 for (const [key, value] of Object.entries(acc_prices)) { 4087 let new_key = key; 4088 if ((key.match(/_/g) || []).length > 1) { 4089 let split_key = key.split("_"); 4090 let second_to_last = split_key[split_key.length - 2]; 4091 let last = split_key[split_key.length - 1]; 4092 new_key = second_to_last + "_" + last; 4093 } 4094 if (io_hide_zero == 1 && value > 0) { 4095 let id_string = "#io_acc_desc_" + new_key; 4096 let formatted_price = simpleCart.toCurrency(value); 4097 if (jQuery("#io_acc_" + new_key + " .io_acc_price").length > 0) { 4098 jQuery("#io_acc_" + new_key + " .io_acc_price").html(formatted_price); 4099 } else { 4100 let price_display = '<span class="io_acc_price"> ' + formatted_price + ' </span>'; 4101 jQuery(id_string).after(price_display); 4102 } 4103 } else if (io_hide_zero == 0) { 4104 let id_string = "#io_acc_desc_" + new_key; 4105 let formatted_price = simpleCart.toCurrency(value); 4106 if (jQuery("#io_acc_" + new_key + " .io_acc_price").length > 0) { 4107 jQuery("#io_acc_" + new_key + " .io_acc_price").html(formatted_price); 4108 } else { 4109 let price_display = '<span class="io_acc_price"> ' + formatted_price + ' </span>'; 4110 jQuery(id_string).after(price_display); 4111 } 4112 } 4113 } 4114 } 4115 } 4116 function make_live_price_editable_time(times, delivery_method=null) { 4117 if(!delivery_method) delivery_method = getCookie("io_delivery_method"); 4118 let ele_text = ""; 4119 if(times[0]) ele_text = "on " + times[0] + " "; 4120 if(times[2] === 0) times[2] = 1; 4121 if(io_hidetimes!="on" && !isNaN(times[2])) ele_text += "for "+times[2]+" hours "; 4122 if(delivery_method) ele_text += "for " + delivery_method + ". "; 4123 ele_text += '<span style="cursor:pointer; color:blue; text-decoration:underline;" onclick=checkAvailDateClick()>edit</span>'; 4124 return ele_text; 4125 } 4126 function checkAvailDateClick(){ 4127 cartShow(); 4128 /* expand the date picker */ 4129 setTimeout(calSetDateRange,100); 4130 } 4131 function checkAvailPageOnly(){ 4132 checkAvailFilter(); 4133 if(addressCookiesSet() && io_distance_charge){ 4134 runDeliveryCall(true); 4135 } 4136 } 4137 function getAccIDforPrice(){ 4138 let accessory_arr = jQuery(".io_acc_li").toArray(); 4139 let acc_rental_id_str = ""; 4140 for(let current_accessory = 0; current_accessory < accessory_arr.length; current_accessory++){ 4141 let required_tag = jQuery(accessory_arr[current_accessory]).find(".item_required"); 4142 if(required_tag.length > 0){ 4143 if(required_tag[0].innerText == 0){ 4144 acc_rental_id_str += jQuery(accessory_arr[current_accessory]).find(".item_rentalid")[0].innerText +"|"; 4145 } 4146 } 4147 } 4148 return acc_rental_id_str; 4149 } 4150 function getUpsellIDforPrice(){ 4151 let upsell_arr = jQuery(".page-carousel-rid").toArray(); 4152 let upsell_rental_id_str = ""; 4153 for(let current_upsell = 0; current_upsell < upsell_arr.length; current_upsell++){ 4154 upsell_rental_id_str +=upsell_arr[current_upsell].innerText+"|"; 4155 } 4156 return upsell_rental_id_str; 4157 } 4158 function displayUpsellPrices(data){ 4159 if(data.price){ 4160 let upsell_prices = data.price; 4161 for (const [key, value] of Object.entries(upsell_prices)) { 4162 if(io_hide_zero == 1 && value > 0){ 4163 let id_string = "#rid"+ key; 4164 let formatted_price = simpleCart.toCurrency(value); 4165 let price_display ='<span class="page-carousel-price"> '+formatted_price+' </span>'; 4166 jQuery(id_string).after(price_display); 4167 }else if(io_hide_zero == 0){ 4168 let id_string = "#rid"+ key; 4169 let formatted_price = simpleCart.toCurrency(value); 4170 let price_display ='<span class="page-carousel-price"> '+formatted_price+' </span>'; 4171 jQuery(id_string).after(price_display); 4172 } 4173 } 4174 pageFlickityRefresh(); 4175 } 4176 } 4177 /*</editor-fold>*/ 4178 4179 /*<editor-fold defaultstate="collapsed" desc="Check Avail - Cart">*/ 4180 function checkAvailCartOnly(skip_timer=false){ 4181 checkAvailCart(); 4182 checkAvailCartTimeslots(); 4183 } 4184 4185 function checkAvailCartTimeslots(){ 4186 let rental_names = ""; 4187 let rental_ids = "";
4188 let cart_rental_names = ""; 4189 let cart_rental_ids = ""; 4190 let times = getAvailTimes(); 4191 let start_date = times[0]; 4192 let event_duration = times[2]; 4193 let end_date = start_date; 4194 var event_start_time = getCookie("io_timeStart"); 4195 simpleCart.each(function (item, x) { 4196 var timeslots_html = item.get('timeslots'); 4197 if(typeof timeslots_html == "undefined") return; 4198 if(timeslots_html.length == 0) return; 4199 var cart_name = item.get("encoded"); 4200 if(cart_name==null) { 4201 cart_name = encodeURIComponent(item.get("name")); 4202 cart_name = encodeURIComponent(decodeURIComponent(cart_name).replace(/[\u2032\u2019]+/ig,"'")); 4203 } 4204 rental_id = item.get("rentalid"); 4205 4206 var timeslot_name = getTimeslotName(timeslots_html); 4207 var timeslot_sel_range = jQuery(".item-timeslots [name=\""+timeslot_name+"\"] option:selected").val(); 4208 if(typeof timeslot_sel_range != "undefined"){ 4209 /* timeslots */ 4210 setTimeslotSelected(item, timeslot_name); 4211 }else{ 4212 /* timepickers */ 4213 setTimePicker(item, timeslot_name); 4214 let start_timepicker = document.getElementsByName(timeslot_name.replace("io_timepicker_", "start_timeslot_")); 4215 let end_timepicker = document.getElementsByName(timeslot_name.replace("io_timepicker_", "end_timeslot_")); 4216 timeslot_sel_range = start_timepicker[start_timepicker.length-1].value; 4217 timeslot_sel_range += " - " + end_timepicker[end_timepicker.length-1].value; 4218 } 4219 4220 var timeslot_sel_arr = ""; 4221 if(typeof timeslot_sel_range != "undefined"){ 4222 var [start_time, end_time] = break_timeslot_sel_range(timeslot_sel_range); 4223 if(start_time && end_time){ 4224 let newDate1 = convertDateStringtoDateObject(start_date, start_time); 4225 let newDate2 = convertDateStringtoDateObject(end_date, end_time); 4226 let time_duration = ((newDate2 - newDate1) / 3600) / 1000; 4227 let quantity = item.get("quantity"); 4228 if(item.get("inputtype") == "Map"){ 4229 quantity = 1 4230 } 4231 rental_names += cart_name + "-" + quantity+"|"; 4232 rental_ids += rental_id+"-"+quantity+"-"+start_time+"-"+time_duration+"|"; 4233 cart_rental_names = rental_names; 4234 cart_rental_ids = rental_ids; 4235 } 4236 } 4237 }); 4238 if(rental_ids || rental_names){ 4239 checkAvailCall(start_date,event_start_time,event_duration,rental_names,rental_ids,updateCartAvail,1,cart_rental_ids,cart_rental_names,1); 4240 } 4241 return true; 4242 } 4243 4244 function checkAvailCart(){ 4245 let rental_names = ""; 4246 let rental_ids = ""; 4247 let cart_rental_names = ""; 4248 let cart_rental_ids = ""; 4249 simpleCart.each(function (item, x) { 4250 if(typeof item.get('timeslots') != "undefined"){ 4251 if(item.get('timeslots').length > 0){ 4252 return; 4253 } 4254 } 4255 var cart_name = item.get("encoded"); 4256 if(cart_name==null){ 4257 cart_name = encodeURIComponent(item.get("name")); 4258 cart_name = encodeURIComponent(decodeURIComponent(cart_name).replace(/[\u2032\u2019]+/ig,"'")); 4259 } 4260 let quantity = item.get("quantity"); 4261 if(item.get("inputtype") == "Map"){ 4262 quantity = 1 4263 } 4264 rental_names += cart_name + "-" + quantity + "|"; 4265 cart_rental_names += cart_name + "-" + quantity + "|"; 4266 var cart_id = item.get("rentalid"); 4267 rental_ids += cart_id + "-" + quantity + "|"; 4268 cart_rental_ids += cart_id + "-" + quantity + "|"; 4269 }); 4270 var times = getAvailTimes(); 4271 let return_id = 0; 4272 if(rental_ids != ""){ 4273 return_id = 1; 4274 } 4275 if(rental_ids != "" || rental_names != ""){ 4276 return checkAvailCall(times[0],times[1],times[2],rental_names,rental_ids,updateCartAvail,1,cart_rental_ids,cart_rental_names,return_id); 4277 } 4278 return true; 4279 } 4280 function updateCartAvail(data){ 4281 let use_id = data["return_id"] 4282 delete data["return_id"]; 4283 if(use_id == 1){ 4284 updateCartAvail_itemIDs(data) 4285 }else{ 4286 updateCartAvail_itemNames(data); 4287 } 4288 console.log("cart update"); 4289 if(addressCookiesSet() && io_distance_charge){ 4290 runDeliveryCall(true); 4291 } 4292 /* simpleCart.trigger("update"); */
4293 simpleCart.update(); 4294 /* jQuery("#avail").html(output); */ 4295 } 4296 4297 function updateCartAvail_itemIDs(data){ 4298 jQuery.each(data, function (rental_id, qty){ 4299 simpleCart.each(function (item, x) { 4300 if(rental_id == item.get("rentalid")){ 4301 if(io_hideQuantityAvail == "off"){ 4302 if(qty>=9999 || item.get("inputtype") == "Map" || (item.get("giftcardvalue") && item.get("giftcardvalue").trim())){ 4303 item.set("availability", "available"); 4304 }else{ 4305 item.set("availability", qty + " available"); 4306 } 4307 }else if(io_hideQuantityAvail == "on"){ 4308 if(qty<=0 || qty < item.get("quantity")){ 4309 item.set("availability", "not available"); 4310 }else{ 4311 item.set("availability", "available"); 4312 } 4313 } 4314 var vendorid = item.get("vendorid"); 4315 if(vendorid && vendorid.trim()){ 4316 item.set("availability", "availability must be verified"); 4317 } 4318 } 4319 if (rental_id == "price") { 4320 var prices = qty; 4321 jQuery.each(prices, function (price_name, amt) { 4322 if(price_name == item.get("rentalid")){ 4323 if (typeof amt == "string" || amt instanceof String){ 4324 if(amt != "TBD"){ 4325 if(typeof amt == "string") amt = Number(amt.replace(",","")); 4326 } 4327 } 4328 item.set("price", amt); 4329 } 4330 }); 4331 } 4332 }); 4333 }); 4334 } 4335 4336 function updateCartAvail_itemNames(data){ 4337 jQuery.each(data, function (rental_name, qty) { 4338 rental_name = rental_name.replace(/[\u2032\u2019]+/ig,"'"); 4339 simpleCart.each(function (item, x) { 4340 try{ 4341 var cart_name = decodeURIComponent(item.get("encoded").replace(/[+]/gi, "%20")); 4342 }catch(e){cart_name=null} 4343 if(cart_name==null) cart_name = item.get("name") 4344 cart_name = cart_name.replace(/[\u2032\u2019]+/ig,"'"); 4345 var i = cart_name.lastIndexOf(":"); 4346 if(i>0 && cart_name.toUpperCase() != rental_name.toUpperCase() && rental_name!="price"){cart_name = cart_name.substring(i+1)} 4347 if (cart_name.toUpperCase() == rental_name.toUpperCase()) { 4348 if(qty>9999){ 4349 item.set("availability", "available"); 4350 }else{ 4351 item.set("availability", qty + " available"); 4352 } 4353 } 4354 if (rental_name == "price") { 4355 var prices = qty; 4356 jQuery.each(prices, function (price_name, amt) { 4357 price_name = price_name.replace(/[\u2032\u2019]+/ig,"'"); 4358 let acc_name = ""; 4359 let rental_name = ""; 4360 var i = cart_name.lastIndexOf(":"); 4361 if(i>0){ 4362 rental_name = cart_name.substring(0, i); 4363 acc_name = cart_name.substring(i+1); 4364 } 4365 if (acc_name === price_name) { 4366 var rental_id = item.get("rentalid"); 4367 if(rental_id != null){ 4368 rid_arr = rental_id.split(":"); 4369 /* ignore the main id for this */ 4370 rental_id = rid_arr[rid_arr.length-1]; 4371 if(jQuery("#io_acc_overrideprice_"+rental_id).first().text()>0){ 4372 amt = prices[acc_name]; 4373 }else{ 4374 let item_price = Number(prices[rental_name].replace(",","")); 4375 amt = Number(amt.replace(",","")) + item_price; 4376 item.set("price", amt); 4377 return; 4378 } 4379 } 4380 if(amt==null){ 4381 amt = "0"; 4382 } 4383 /* returned price is per unit */ 4384 if(typeof amt == "string") amt = Number(amt.replace(",","")); 4385 item.set("price", amt); 4386 }else if(!rental_name && !acc_name){ 4387 amt = Number(prices[cart_name].replace(",","")); 4388 item.set("price", amt); 4389 } 4390 }); 4391 } 4392 }); 4393 }); 4394 } 4395 /*</editor-fold>*/ 4396 4397 /*<editor-fold defaultstate="collapsed" desc="Upsell Carousels">*/ 4398 function updateCartUpsell(data){ 4399 let cart_carousel = jQuery(".cart-carousel"); 4400 viewport = jQuery(".cart-carousel .flickity-viewport"); 4401 if(viewport.length > 0){ 4402 cart_carousel.flickity("destroy"); 4403 } 4404 cart_carousel.empty(); 4405 data.forEach(function(upsell){ 4406 cell = createCartCarouselCell(upsell["image"], upsell["name"], upsell["page"]); 4407 cart_carousel.append(cell); 4408 }); 4409 makeCarousel(cart_carousel); 4410 jQuery("#cart-carousel-container").show(); 4411 setTimeout(cartFlickityRefresh, 500); 4412 } 4413 4414 function cartFlickityRefresh(){ 4415 jQuery(".cart-carousel").flickity("resize"); 4416 } 4417 4418 //IO-14031 4419 function isMobile() 4420 { 4421 // Modern detection 4422 if (navigator.userAgentData && navigator.userAgentData.mobile !== undefined) { 4423 return navigator.userAgentData.mobile; 4424 } 4425 4426 // Fallback for older browsers 4427 return /Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent) || 4428 ('ontouchstart' in window && navigator.maxTouchPoints > 0); 4429 } 4430 4431 function makeCarousel(cart_carousel) 4432 { 4433 cart_carousel.flickity({ 4434 wrapAround: true, 4435 draggable: isMobile(), 4436 cellAlign: 'left', 4437 //autoPlay: 3000, 4438 groupCells: true, 4439 resize: true 4440 }); 4441 cart_carousel_set = true; 4442 } 4443 4444 function createCartCarouselCell(image, name, page){ 4445 cell = '<div class="io_cart_carousel_cell"> <a href='+page+' class="cart-carousel-link"> <img class="cart-carousel-image" src='+image+'> <p class="cart-carousel-name"> '+name+' </p> </a> </div>'; 4446 return cell; 4447 } 4448 /*</editor-fold>*/ 4449 4450 /*<editor-fold defaultstate="collapsed" desc="Ajax Calls">*/ 4451 function checkAvailCall(start_date,start_time,time_duration,rental_names,rental_ids,returnFunc,singleCart,cart_rental_ids,cart_rental_names,return_id,temp=0,delivery_method=null,price_only=0,custom_price_name="", skip_hidden_lead = 0) { 4452 /*
4453 IO-21459 If we have no duration set (event not set in cart), and we are doing the call for the page live 4454 price, and we have the setting on where we want to display this price even if the event date is not set: 4455 4456 We set the time_duration to 1 hour. This defaults the start date to January 1, 1970 with duration of 4457 1 hour in the lead meaning it will be available and we have the one hour price. 4458 */ 4459 if((isNaN(time_duration) || time_duration===0) && price_only==1 && io_always_display_live_price == "on"){ 4460 time_duration = 1; 4461 if(!start_date){ 4462 start_date = getFormatteddate(new Date()); 4463 } 4464 if(!start_time){ 4465 start_time = getFormattedtime(new Date()); 4466 } 4467 }else if((isNaN(time_duration) || time_duration===0) && price_only==0 && io_hidetimes === "on"){ 4468 /* IO-22689 if they have times hidden, and happen to have the same default start and end time, we still want to do the call. */ 4469 time_duration = 1; 4470 }else if(isNaN(time_duration) || time_duration===0){ 4471 return; 4472 } 4473 url = "https://rental.software/quotes/check_availability_v2.php?callback=?"; 4474 if(window.location.href.indexOf("localhost") > -1){ 4475 //url = "http://localhost/bugs/quotes/check_availability_v2.php?callback=?"; 4476 url = "http://localhost/io/bugs/quotes/check_availability_v2.php?callback=?"; 4477 //url = "http://localhost/jbug/trunk/quotes/check_availability_v2.php?callback=?"; 4478 } 4479 if(!delivery_method) delivery_method = getCookie("io_delivery_method"); 4480 let address_data = { 4481 "address": getCookie("io_address"), 4482 "state": getCookie("io_state"), 4483 "city": getCookie("io_city"), 4484 "zip": getCookie("io_zip") 4485 }; 4486 if(!ioHasMarketingConsent()){ 4487 address_data = {"address":"", "state":"", "city":"", "zip":""}; 4488 } 4489 url += 4490 "&name=" + encodeURIComponent("Top Event Rentals_1") + 4491 "&startdate=" + start_date + 4492 "&starttime=" + start_time + 4493 "&duration=" + time_duration + 4494 "&street=" + encodeURIComponent(address_data["address"]) + 4495 "&city=" + encodeURIComponent(address_data["city"]) + 4496 "&state=" + encodeURIComponent(address_data["state"]) + 4497 "&zip=" + encodeURIComponent(address_data["zip"]) + 4498 "&single_cart=" + singleCart + 4499 "&usecushion=1" + 4500 "&include_price=1" + 4501 "&showlocations=0" + 4502 "&rental_names=" + rental_names + 4503 "&rental_ids=" + rental_ids + 4504 "&cart_rental_names=" + cart_rental_names + 4505 "&cart_rental_ids=" + cart_rental_ids + 4506 "&return_id=" + return_id + 4507 "&delivery_method=" + delivery_method + 4508 "&temp=" + temp + 4509 "&skip_hidden_lead="+ skip_hidden_lead; 4510 if (custom_price_name) 4511 { 4512 ioCartLoaderIncrement(); 4513 jQuery.getJSON(url, function (data) 4514 { 4515 try 4516 { 4517 returnFunc(data, custom_price_name); 4518 } 4519 finally 4520 { 4521 ioCartLoaderDecrement(); 4522 } 4523 }); 4524 } 4525 else 4526 { 4527 ioCartLoaderIncrement(); 4528 jQuery.getJSON(url, function (data) 4529 { 4530 try 4531 { 4532 returnFunc(data); 4533 } 4534 finally 4535 { 4536 ioCartLoaderDecrement(); 4537 } 4538 }); 4539 } 4540 } 4541 4542 function getUpsellsCall(start_date,start_time,time_duration,rental_ids,returnFunc) { 4543 if(rental_ids.replace(/[|]/g,"").length==0){return;} 4544 url = "https://rental.software/quotes/in_cart_upsell.php?callback=?"; 4545 if(window.location.href.indexOf("localhost") > -1){ 4546 //url = "http://localhost/bugs/quotes/in_cart_upsell.php?callback=?" 4547 url = "http://localhost/io/bugs/quotes/in_cart_upsell.php?callback=?" 4548 } 4549 url += 4550 "&name=" + encodeURIComponent("Top Event Rentals_1") + 4551 "&startdate=" + start_date + 4552 "&starttime=" + start_time + 4553 "&duration=" + time_duration + 4554 "&usecushion=1" + 4555 "&include_price=1" + 4556 "&showlocations=0" + 4557 "&rental_ids=" + rental_ids; 4558 //IO-25557 4559 if(window.location.href.indexOf("dev.rental.software") > -1)//if it is a dev site, we need to send 4560 { 4561 let pattern = /(https:\/\/dev\.rental\.software\/[^\/]+\/)/; 4562 let matches = window.location.href.match(pattern); 4563 matches && matches.length > 0 ? url += "&site=" + matches[0]:0; 4564 } 4565 else 4566 { 4567 url += "&site=" + window.location.host; 4568 } 4569 jQuery.getJSON(url, returnFunc); 4570 } 4571 /*</editor-fold>*/ 4572 4573 /*<editor-fold defaultstate="collapsed" desc="Customer Geolocation Functions">*/ 4574 function setLocationInLocalStorage(city) 4575 {
4576 try 4577 { 4578 const location_data = 4579 { 4580 city: city, 4581 timestamp: Date.now() 4582 }; 4583 localStorage.setItem(storage_key, JSON.stringify(location_data)); 4584 return true; 4585 } 4586 catch (e) 4587 { 4588 console.warn('Failed to save location to localStorage:', e); 4589 return false; 4590 } 4591 } 4592 4593 function getLocationFromLocalStorage() 4594 { 4595 try 4596 { 4597 const location_data = localStorage.getItem(storage_key); 4598 if (location_data) 4599 { 4600 return JSON.parse(location_data); 4601 } 4602 4603 } 4604 catch (e) 4605 { 4606 console.warn('Failed to retrieve location from localStorage:', e); 4607 } 4608 return null; 4609 } 4610 4611 function displayLocation(city) 4612 { 4613 const location_element = jQuery('.io_geo_city'); 4614 const container_element = jQuery('#io_customer_geolocation'); 4615 4616 if (location_element.length && container_element.length) 4617 { 4618 location_element.text(`${city}`); 4619 container_element.show(); 4620 return true; 4621 } 4622 return false; 4623 } 4624 4625 function getCityFromIO(returnFunc) 4626 { 4627 var url = "https://rental.software/include/geolocation_handler.php?callback=?"; 4628 if(window.location.href.indexOf("localhost") > -1) 4629 { 4630 url = "http://localhost//features//include/geolocation_handler.php?callback=?"; 4631 } 4632 url += 4633 "&name=" + encodeURIComponent("Top Event Rentals_1") + 4634 "&ip=" + encodeURIComponent(io_customer_ip); 4635 4636 jQuery.getJSON(url, returnFunc); 4637 } 4638 4639 function initializeGeolocation() 4640 { 4641 try 4642 { 4643 // Check local storage first 4644 const cached_location = getLocationFromLocalStorage(); 4645 if (cached_location && cached_location.city) 4646 { 4647 if (displayLocation(cached_location.city)) 4648 { 4649 return; 4650 } 4651 } 4652 4653 // If no cached location, call the handler to get location 4654 getCityFromIO(function(location_data) 4655 { 4656 if (location_data && location_data.city && !location_data.error) 4657 { 4658 // Display and store the location 4659 if (displayLocation(location_data.city)) 4660 { 4661 setLocationInLocalStorage(location_data.city); 4662 } 4663 } 4664 else 4665 { 4666 console.warn('Failed to get location:', location_data ? location_data.error : 'Unknown error'); 4667 } 4668 }); 4669 } 4670 catch (error) 4671 { 4672 console.error('Geolocation initialization failed:', error); 4673 } 4674 } 4675 /*</editor-fold>*/ 4676 4677 /*<editor-fold defaultstate="collapsed" desc="Loading Animation Helpers">*/ 4678 4679 /** 4680 * Toggles the visibility of the cart loading overlay. 4681 * 4682 * @param {boolean} show - A boolean value to determine whether to show or hide the overlay. 4683 * If true, the overlay becomes visible; if false, it is hidden. 4684 * @return {void} This function does not return a value. 4685 */ 4686 function ioCartShowOverlay(show) 4687 { 4688 try 4689 { 4690 var overlay = document.getElementById('ioCartLoadingOverlay'); 4691 if (!overlay) return; 4692 if (show) 4693 { 4694 overlay.style.display = 'flex'; 4695 overlay.setAttribute('aria-hidden', 'false'); 4696 } 4697 else 4698 { 4699 overlay.style.display = 'none'; 4700 overlay.setAttribute('aria-hidden', 'true'); 4701 } 4702 } 4703 catch (e) 4704 {} 4705 } 4706 4707 /** 4708 * Activates the cart loader by setting the loading state to active, initializing the loading count, 4709 * and displaying the overlay. Includes a fallback to deactivate the loader if no response is received 4710 * within a specified timeout period. 4711 * 4712 * @return {void} This method does not return a value. 4713 */ 4714 function ioCartLoaderActivate() 4715 { 4716 io_cart_loading_active = true; 4717 io_cart_loading_count = 0; 4718 ioCartShowOverlay(true); 4719 4720 //fallback in case the availability call doesn't come back 4721 if (io_cart_loading_fallback_timer) clearTimeout(io_cart_loading_fallback_timer); 4722 io_cart_loading_fallback_timer = setTimeout(function () { 4723 if (io_cart_loading_active) { 4724 io_cart_loading_active = false;
4725 io_cart_loading_count = 0; 4726 ioCartShowOverlay(false); 4727 } 4728 }, 15000); 4729 } 4730 4731 /** 4732 * Increments the count of active cart loading operations and ensures the cart overlay is displayed. 4733 * 4734 * This method increases the `io_cart_loading_count` if the `io_cart_loading_active` flag is set to true. 4735 * It also calls the `ioCartShowOverlay` function with a true value to show the overlay. 4736 * 4737 * @return {void} This function does not return any value. 4738 */ 4739 function ioCartLoaderIncrement() 4740 { 4741 if (io_cart_loading_active) 4742 { 4743 io_cart_loading_count++; 4744 ioCartShowOverlay(true); 4745 } 4746 } 4747 4748 /** 4749 * Decrements the `io_cart_loading_count` if `io_cart_loading_active` is true. 4750 * If the count reaches zero, it deactivates the loader, removes the overlay, 4751 * and clears the fallback timer 4752 */ 4753 function ioCartLoaderDecrement() 4754 { 4755 if (io_cart_loading_active) 4756 { 4757 io_cart_loading_count = Math.max(0, io_cart_loading_count - 1); 4758 4759 if (io_cart_loading_count === 0) 4760 { 4761 io_cart_loading_active = false; 4762 ioCartShowOverlay(false); 4763 4764 if (io_cart_loading_fallback_timer) 4765 { 4766 clearTimeout(io_cart_loading_fallback_timer); 4767 io_cart_loading_fallback_timer = null; 4768 } 4769 } 4770 } 4771 } 4772 4773 /*</editor-fold>*/</script>
4773 <div class="address_entry elementor-widget-text-editor"><table><tr><td> <label for="address" id="io_cdl_address_label" style="display: table-cell"> Street Address </label></td><td> <input id="io_cd_address" style="display: table-cell" name="address" type="text"></input></td></tr><tr><td> <label for="city" id="io_cdl_city_label" style="display: table-cell"> City </label></td><td> <input id="io_cd_city" style="display: table-cell" name="city" type="text"></input></td></tr><tr id="us-state-select"><td> <label for="state" id="io_cdl_state_label" style="display: table-cell"> State </label></td><td> <select name="state" id="io_cd_state" style="display: table-cell" class="input-mini"><option value=""></option><option value="AK">AK</option><option value="AL">AL</option><option value="AR">AR</option><option value="AZ">AZ</option><option value="CA">CA</option><option value="CO">CO</option><option value="CT">CT</option><option value="DC">DC</option><option value="DE">DE</option><option value="FL">FL</option><option value="GA">GA</option><option value="HI">HI</option><option value="IA">IA</option><option value="ID">ID</option><option value="IL">IL</option><option value="IN">IN</option><option value="KS">KS</option><option value="KY">KY</option><option value="LA">LA</option><option value="MA">MA</option><option value="MD">MD</option><option value="ME">ME</option><option value="MI">MI</option><option value="MN">MN</option><option value="MO">MO</option><option value="MS">MS</option><option value="MT">MT</option><option value="NC">NC</option><option value="ND">ND</option><option value="NE">NE</option><option value="NH">NH</option><option value="NJ">NJ</option><option value="NM">NM</option><option value="NV">NV</option><option value="NY">NY</option><option value="OH">OH</option><option value="OK">OK</option><option value="OR">OR</option><option value="PA">PA</option><option value="RI">RI</option><option value="SC">SC</option><option value="SD">SD</option><option value="TN">TN</option><option value="TX">TX</option><option value="UT">UT</option><option value="VA">VA</option><option value="VT">VT</option><option value="WA">WA</option><option value="WI">WI</option><option value="WV">WV</option><option value="WY">WY</option> </select></td></tr><tr><td> <label for="zip" id="io_cdl_zip_label" style="display: table-cell"> Zip Code </label></td><td> <input id="io_cd_zip" style="display: table-cell" name="zip" type="text"></input></td></tr></table> <a class="elementor-button elementor-size-sm io_button" 4774 id="address_entry_submit" 4775 href="javascript:;"> Save Address </a><div id="delivery_charge_info_box"><hr><h3 id="info_box_header"></h3><p id="info_box_information"></p> <a href="javascript:;" onClick="closeAddressEntry()" class="delivery_info_continue elementor-button elementor-size-sm io_button">Continue Shopping</a></div></div>
4775<script>/* for checking delivery */ 4776 function runDeliveryCall(cart_only = false){ 4777 let address_fields = jQuery("[id^='io_cd_']"); 4778 let address_data = { 4779 "address": getCookie("io_address"), 4780 "state": getCookie("io_state"), 4781 "city": getCookie("io_city"), 4782 "zip": getCookie("io_zip") 4783 }; 4784 4785 let times = getAvailTimes(); 4786 4787 let start_date = times[0]; 4788 let end_date = start_date; 4789 let start_time = times[1]; 4790 let duration = times[2]; 4791 4792 let rental_ids = ""; 4793 simpleCart.each(function (item, x) { 4794 if(typeof item.get('timeslots') != "undefined"){ 4795 if(item.get('timeslots').length > 0){ 4796 var timeslots_html = item.get('timeslots'); 4797 var rental_id = item.get('rentalid'); 4798 if(typeof timeslots_html == "undefined") return; 4799 if(timeslots_html.length == 0) return; 4800 4801 var timeslot_name = getTimeslotName(timeslots_html); 4802 var timeslot_sel_range = jQuery(".item-timeslots [name=\""+timeslot_name+"\"] option:selected").val(); 4803 if(typeof timeslot_sel_range != "undefined"){ 4804 /* timeslots */ 4805 setTimeslotSelected(item, timeslot_name); 4806 }else{ 4807 /* timepickers */ 4808 setTimePicker(item, timeslot_name);//todo? 4809 let start_timepicker = document.getElementsByName(timeslot_name.replace("io_timepicker_", "start_timeslot_")); 4810 let end_timepicker = document.getElementsByName(timeslot_name.replace("io_timepicker_", "end_timeslot_")); 4811 timeslot_sel_range = start_timepicker[start_timepicker.length-1].value; 4812 timeslot_sel_range += " - " + end_timepicker[end_timepicker.length-1].value; 4813 } 4814 4815 var timeslot_sel_arr = ""; 4816 if(typeof timeslot_sel_range != "undefined"){ 4817 timeslot_sel_arr = timeslot_sel_range.split(" - "); 4818 var timeslot_start_time = timeslot_sel_arr[0].replace("am"," am").replace("pm"," pm").replace(" "," "); 4819 var timeslot_end_time = timeslot_sel_arr[1].replace("am"," am").replace("pm"," pm").replace(" "," "); 4820 if(timeslot_start_time && timeslot_end_time){ 4821 let newDate1 = convertDateStringtoDateObject(start_date, timeslot_start_time); 4822 let newDate2 = convertDateStringtoDateObject(end_date, timeslot_end_time); 4823 let timeslot_duration = ((newDate2 - newDate1) / 3600) / 1000; 4824 rental_ids += rental_id+"-"+item.get("quantity")+"-"+timeslot_start_time+"-"+timeslot_duration+"|"; 4825 } 4826 } 4827 } 4828 } 4829 else{ 4830 var cart_id = item.get("rentalid"); 4831 rental_ids += cart_id + "-" + item.get("quantity") + "|"; 4832 } 4833 }); 4834 4835 address_fields.each(function() { 4836 let field = this.id.split("_")[2]; 4837 value = this.value; 4838 if(!value && !address_data[field]){ 4839 jQuery(this).addClass("invalid_address_field") 4840 } 4841 else if(value){ 4842 jQuery(this).removeClass("invalid_address_field") 4843 address_data[field] = this.value; 4844 } 4845 }); 4846 if(jQuery(".invalid_address_field").length > 0){ 4847 return; 4848 } 4849 let delivery_method = "" 4850 if(io_default_delivery_method) 4851 { 4852 delivery_method = io_default_delivery_method; 4853 } 4854 else if(getCookie("io_delivery_method")) 4855 { 4856 delivery_method = getCookie("io_delivery_method"); 4857 } 4858 4859 4860 setCookie("io_address", address_data["address"], 14); 4861 setCookie("io_city", address_data["city"], 14); 4862 setCookie("io_state", address_data["state"], 14); 4863 setCookie("io_zip", address_data["zip"], 14); 4864 4865 cart_total = simpleCart.total(); 4866 if(cart_total === "TBD") cart_total = 0; 4867 url = "https://rental.software/quotes/get_delivery_info.php?callback=?"; 4868 if(window.location.href.indexOf("localhost") > -1){ 4869 //url = "http://localhost/bugs/quotes/get_delivery_info.php?callback=?"; 4870 url = "http://localhost/io/bugs/quotes/get_delivery_info.php?callback=?"; 4871 } 4872 url += 4873 "&name=" + encodeURIComponent("Top Event Rentals_1") + 4874 "&rental_ids=" + rental_ids + 4875 "&street=" + encodeURIComponent(address_data["address"]) + 4876 "&city=" + encodeURIComponent(address_data["city"]) + 4877 "&state=" + encodeURIComponent(address_data["state"]) + 4878 "&zip=" + encodeURIComponent(address_data["zip"]) + 4879 "&startdate=" + start_date + 4880 "&starttime=" + start_time + 4881 "&duration=" + duration + 4882 "&delivery_method=" + encodeURIComponent(delivery_method) + 4883 "&total=" + cart_total + 4884 "&cart_only=" + cart_only; 4885 jQuery.getJSON(url, function(data){ 4886 if(data["delivery_restrict"] === 1){ 4887 data["charge"] = 0; 4888 }
4889 handleDeliveryInfo(data, cart_only); 4890 }); 4891 } 4892 4893 function handleDeliveryInfo(data, cart_only = false){ 4894 jQuery("#deliverSubtotalContainer").show(); 4895 jQuery("#checkDeliveryMessage").hide(); 4896 let info_box = jQuery("#delivery_charge_info_box"); 4897 if(data["delivery_restrict"] == 1){ 4898 jQuery("#info_box_header").text("Sorry..."); 4899 jQuery("#info_box_information").text(data["error"]) 4900 setDeliverySubtotal(data["charge"], true) 4901 } 4902 else{ 4903 setDeliverySubtotal(data["charge"]) 4904 jQuery("#info_box_header").text("Success!"); 4905 if(data["charge"] > 0){ 4906 jQuery("#info_box_information").html("We are able to deliver to your location with a " + simpleCart.toCurrency(data["charge"]) +" fee!"); 4907 } 4908 else{ 4909 jQuery("#info_box_information").html("We are able to deliver to your location with no charge!"); 4910 } 4911 } 4912 if(simpleCart.items().length == 0 && cart_only){ 4913 jQuery("#info_box_header").text("Items Required."); 4914 jQuery("#info_box_information").html("There needs to be items in your cart to check for delivery fees. But we will save the address information so you don't have to enter it again!") 4915 } 4916 info_box.show(); 4917 jQuery.fancybox.update(jQuery(".address_entry")); 4918 } 4919 function showAddressEntry(cart_only=false){ 4920 cartHide(); 4921 jQuery(".invalid_address_field").removeClass("invalid_address_field") 4922 jQuery("#delivery_charge_info_box").hide(); 4923 jQuery("#io_cd_address").val(getCookie("io_address")); 4924 jQuery("#io_cd_state").val(getCookie("io_state")); 4925 jQuery("#io_cd_city").val(getCookie("io_city")); 4926 jQuery("#io_cd_zip").val(getCookie("io_zip")); 4927 if(!cart_only){ 4928 jQuery("#address_entry_submit").on("click", null, function(){ runDeliveryCall(); }); 4929 } else{ 4930 jQuery("#address_entry_submit").on("click", null, function(){ runDeliveryCall(cart_only); }); 4931 } 4932 jQuery.fancybox.open(jQuery(".address_entry")); 4933 } 4934 4935 function closeAddressEntry(){ 4936 jQuery.fancybox.close(); 4937 } 4938 4939 function setDeliverySubtotal(amount, unavailable=false){ 4940 if(unavailable){ 4941 jQuery("#deliverySubtotal").html("Unavailable"); 4942 } else{ 4943 jQuery("#deliverySubtotal").html(simpleCart.toCurrency(amount)); 4944 } 4945 } 4946 4947 function addressCookiesSet(){ 4948 if(getCookie("address") && getCookie("state") && getCookie("city") && getCookie("zip")){ 4949 return true; 4950 } else{ 4951 return false 4952 } 4953 }</script>
vendor: 1 bytes, line 4953
4953
4954<script>let map; 4955 let geocoder; 4956 let item_id_map; 4957 let drawingManager; 4958 let drawingListener; 4959 4960 let polygons = new Array(); 4961 4962 let polyline_markers = new Array(); 4963 let polylines = new Array(); 4964 let previous_marker; 4965 current_polyline = undefined; 4966 let previous_map_height = ""; 4967 4968 function initMap() { 4969 map = new google.maps.Map(document.getElementById("map_container"), { 4970 center: { lat: -34.397, lng: 150.644 }, 4971 zoom: 8, 4972 mapTypeId: "hybrid", 4973 disableDefaultUI: true, 4974 tilt: 0 4975 }); 4976 drawingManager = new google.maps.drawing.DrawingManager({ 4977 drawingControl: true, 4978 drawingControlOptions: { 4979 position: google.maps.ControlPosition.TOP_CENTER, 4980 drawingModes: [ 4981 google.maps.drawing.OverlayType.POLYGON, 4982 ], 4983 } 4984 }); 4985 4986 geocoder = new google.maps.Geocoder(); 4987 } 4988 4989 function io_geocode(){ 4990 let prefix = "#io_mc_" 4991 let request = "" 4992 let address_value = ""; 4993 if(jQuery(prefix+"address").length) { 4994 address_value = jQuery(prefix+"address").val(); 4995 if(address_value) setCookie("address", jQuery("#io_mc_address").val(), 14); 4996 } 4997 let city_value = ""; 4998 if(jQuery(prefix+"city").length){ 4999 city_value = jQuery(prefix+"city").val(); 5000 if(city_value) setCookie("city", jQuery("#io_mc_city").val(), 14); 5001 } 5002 let state_value = ""; 5003 if(jQuery(prefix+"state").length){ 5004 state_value = jQuery(prefix+"state").val(); 5005 if(state_value) setCookie("state", jQuery("#io_mc_state").val(), 14); 5006 } 5007 let zip_value = ""; 5008 if(jQuery(prefix+"zip").length){ 5009 zip_value = jQuery(prefix+"zip").val(); 5010 if(zip_value) setCookie("zip", jQuery("#io_mc_zip").val(), 14); 5011 } 5012 5013 request = address_value + " " + city_value + " " + state_value + " " + zip_value; 5014 if(request){ 5015 geocoder.geocode({address:request}).then((result) => { 5016 const { results } = result; 5017 map.setCenter(results[0].geometry.location); 5018 map.setZoom(24); 5019 return results; 5020 }); 5021 5022 } 5023 5024 if(!addressProvided()) { 5025 jQuery("#io_map_address_entry").attr("open", "open"); 5026 }else{ 5027 jQuery("#io_map_address_entry").removeAttr("open"); 5028 } 5029 } 5030 5031 function openMap(element){ 5032 cartHide() 5033 io_map_clear() 5034 let unit = "meters" 5035 if(country === "US") unit = "feet" 5036 polygons = new Array(); 5037 polyline_marker_sets = new Array(); 5038 polylines = new Array(); 5039 previous_marker = undefined; 5040 current_polyline = undefined; 5041 5042 jQuery("#io_mc_address").val(getCookie("address")); 5043 jQuery("#io_mc_state").val(getCookie("state")); 5044 jQuery("#io_mc_city").val(getCookie("city")); 5045 jQuery("#io_mc_zip").val(getCookie("zip")); 5046 io_geocode(); 5047 5048 google.maps.event.removeListener(drawingListener); 5049 5050 if(element.id == "calcPriceOpenMap"){ 5051 item_id_map = jQuery(".io_product_infobox .item_rentalid").text(); 5052 if(jQuery(".io_product_infobox .item_qtytype").text() == "Area"){ 5053 setMapTools_Area(unit, true) 5054 }else if(jQuery(".io_product_infobox .item_qtytype").text() == "Perimeter"){ 5055 setMapTools_Perimeter(unit, true) 5056 } 5057 } 5058 else{ 5059 item_id_map = jQuery(element).parent().parent().find(".item-rentalid").text(); 5060 if(jQuery(element).parent().parent().find(".item-qtytype").text() == "Area"){ 5061 setMapTools_Area(unit) 5062 }else if(jQuery(element).parent().parent().find(".item-qtytype").text() == "Perimeter"){ 5063 setMapTools_Perimeter(unit) 5064 } 5065 } 5066 } 5067 5068 function addressProvided(){ 5069 if(jQuery("#io_mc_address").val() && jQuery("#io_mc_state").val() && 5070 jQuery("#io_mc_city").val() && jQuery("#io_mc_zip").val() ){ 5071 return true; 5072 } 5073 return false; 5074 } 5075 5076 function setMapTools_Area(unit, item_page=false){ 5077 jQuery.fancybox.open(jQuery(".map_fancybox")); 5078 drawingManager.setOptions({ 5079 drawingControlOptions: { 5080 drawingModes: [google.maps.drawing.OverlayType.POLYGON] 5081 }, 5082 drawingMode: google.maps.drawing.OverlayType.POLYGON, 5083 polygonOptions: { 5084 fillColor: "#0191fc", 5085 strokeColor: "#0113fc" 5086 }, 5087 }); 5088 let units = "meters" 5089 if(country === "US") units = "feet" 5090 5091 jQuery("#io_measurement_input_label").text("Approximate area in "+units+": "); 5092 jQuery("#io_map_manual_input").off("click"); 5093 jQuery("#io_map_manual_input").on("click", function(){manual_calc_price("Area", item_page)}); 5094 jQuery("#io_perimeter_options_container").hide(); 5095 jQuery("#io_map_new_line_container").hide(); 5096 jQuery("#io_map_instructions").html("Use the map below to take measurements by clicking on each corner of the area y
5096ou want to measure. <span id=\"io_map_additional_instructions\">You can draw multiple polygons to include multiple separate surfaces in the total area. Press Clear to remove all polygons and start again. Alternatively if you know the approximate area in "+units+" you can enter the measurement manually below. When finished press Done and the price of the item will be updated </span><i id=\"io_show_more_instructions\" onClick=\"show_more_instruct_click(this)\">(more)</i>") 5097 5098 drawingListener = google.maps.event.addListener(drawingManager, "polygoncomplete", function(polygon) { 5099 polygons.push(polygon); 5100 let convert_feet = 1; 5101 if(country === "US") convert_feet = 10.764; 5102 let approx_area = 0; 5103 polygons.forEach(function(polygon) { 5104 approx_area += google.maps.geometry.spherical.computeArea(polygon.getPath()) * convert_feet; 5105 }); 5106 calcprice_approx_area(Math.round(approx_area)); 5107 }); 5108 drawingManager.setMap(map); 5109 } 5110 5111 function setMapTools_Perimeter(unit, item_page=false){ 5112 jQuery.fancybox.open(jQuery(".map_fancybox")); 5113 drawingManager.setOptions({ 5114 drawingControlOptions: { 5115 drawingModes: [google.maps.drawing.OverlayType.MARKER] 5116 }, 5117 drawingMode: google.maps.drawing.OverlayType.MARKER 5118 }); 5119 let height = jQuery("#perimeter_height").val(); 5120 let units = ""; 5121 if(height){ 5122 units = "sq meters" 5123 if(country === "US") units = "sq feet" 5124 jQuery("#io_measurement_input_label").text("Approximate surface area in "+units+": "); 5125 jQuery("#io_map_instructions").html("Use the map below to take measurements by clicking on each corner of the area you want to measure. <span id=\"io_map_additional_instructions\">You can add additional lines by clicking Add New Line button to include more structures into the total. Press Clear to remove all lines and start again. Alternatively if you know the approximate surface area in "+units+" you can enter the measurement manually below. When finished press Done and the price of the item will be updated </span><i id=\"io_show_more_instructions\" onClick=\"show_more_instruct_click(this)\">(more)</i>") 5126 5127 }else{ 5128 units = "meters" 5129 if(country === "US") units = "feet" 5130 jQuery("#io_measurement_input_label").text("Approximate perimeter in "+units+": "); 5131 jQuery("#io_map_instructions").html("Use the map below to take measurements by clicking on each corner of the area you want to measure. <span id=\"io_map_additional_instructions\">You can add additional lines by clicking Add New Line button to include more structures into the total. Press Clear to remove all lines and start again. Alternatively if you know the approximate perimeter in "+units+" you can enter the measurement manually below. When finished press Done and the price of the item will be updated </span><i id=\"io_show_more_instructions\" onClick=\"show_more_instruct_click(this)\">(more)</i>") 5132 5133 } 5134 5135 jQuery("#io_map_manual_input").off("click"); 5136 jQuery("#io_map_manual_input").bind("click", function(){manual_calc_price("Perimeter", item_page)}); 5137 jQuery("#perimeter_height").bind("change", function(){change_perimeter_instructions()}); 5138 jQuery("#io_perimeter_options_container").show(); 5139 jQuery("#io_map_clear_container").show(); 5140 jQuery("#io_map_new_line_container").show(); 5141 5142 current_polyline = new google.maps.Polyline({ 5143 map: map, 5144 path: [], 5145 strokeColor: "#0113fc", 5146 strokeOpacity: 1.0, 5147 strokeWeight: 2 5148 }) 5149 drawingListener = google.maps.event.addListener(drawingManager, "markercomplete", function(marker) { 5150 polyline_markers.push(marker) 5151 marker.setVisible(false); 5152 current_polyline.getPath().push(marker.getPosition()) 5153 if(previous_marker){ 5154 let convert_feet = 1; 5155 if(country === "US") convert_feet = 3.281; 5156 let approx_perimeter = 0; 5157 polylines.forEach(function(polyline) { 5158 if(convert_feet > 1) convert_feet = 10.764 5159 approx_perimeter += google.maps.geometry.spherical.computeArea(polyline.getPath()) * convert_feet; 5160 }); 5161 approx_perimeter += google.maps.geometry.spherical.computeLength(current_polyline.getPath()) * convert_feet; 5162 calcprice_approx_perimeter(Math.round(approx_perimeter)); 5163 } 5164 previous_marker = marker; 5165 }); 5166 5167 jQuery("#perimeter_height_contianer").show(); 5168
5169 drawingManager.setMap(map); 5170 } 5171 5172 function change_perimeter_instructions(){ 5173 let height = jQuery("#perimeter_height").val(); 5174 if(height){ 5175 units = "sq meters" 5176 if(country === "US") units = "sq feet" 5177 jQuery("#io_measurement_input_label").text("Approximate surface area in "+units+": "); 5178 jQuery("#io_map_instructions").html("Use the map below to take measurements by clicking on each corner of the area you want to measure. <span id=\"io_map_additional_instructions\">You can add additional lines by clicking Add New Line button to include more structures into the total. Press Clear to remove all lines and start again. Alternatively if you know the approximate surface area in "+units+" you can enter the measurement manually below. When finished press Done and the price of the item will be updated </span><i id=\"io_show_more_instructions\" onClick=\"show_more_instruct_click(this)\">(more)</i>") 5179 }else { 5180 units = "meters" 5181 if(country === "US") units = "feet" 5182 jQuery("#io_measurement_input_label").text("Approximate perimeter in "+units+": "); 5183 jQuery("#io_map_instructions").html("Use the map below to take measurements by clicking on each corner of the area you want to measure. <span id=\"io_map_additional_instructions\">You can add additional lines by clicking Add New Line button to include more structures into the total. Press Clear to remove all lines and start again. Alternatively if you know the approximate perimeter in "+units+" you can enter the measurement manually below. When finished press Done and the price of the item will be updated </span><i id=\"io_show_more_instructions\" onClick=\"show_more_instruct_click(this)\">(more)</i>") 5184 } 5185 } 5186 5187 function manual_calc_price(method, item_page){ 5188 let approx_measurement = parseInt(jQuery("#io_measurement_input").val()); 5189 let units = ""; 5190 if(approx_measurement){ 5191 if(method == "Area"){ 5192 units = "sq meters" 5193 if(country === "US") units = "sq feet" 5194 }else if(method == "Perimeter"){ 5195 let height = jQuery("#perimeter_height").val(); 5196 if(height){ 5197 units = "sq meters" 5198 if(country === "US") units = "sq feet" 5199 }else{ 5200 units = "meters" 5201 if(country === "US") units = "feet" 5202 } 5203 }
5204 simpleCart.items().forEach(function (item, index){ 5205 if(item.get("rentalid") === item_id_map){ 5206 item.set("units", units); 5207 item.set("quantity", approx_measurement); 5208 } 5209 }); 5210 5211 simpleCart.update(); 5212 5213 if(item_page || jQuery(".io_product_infobox .item_rentalid").text() == item_id_map) set_price_on_item_page(units, approx_measurement); 5214 if(!item_page) cartShow(); 5215 } 5216 jQuery.fancybox.close(); 5217 } 5218 5219 function calcprice_approx_area(approx_area){ 5220 jQuery("#io_measurement_input").val(approx_area); 5221 } 5222 5223 function calcprice_approx_perimeter(approx_perimeter){ 5224 let height = jQuery("#perimeter_height").val(); 5225 if(height && height > 0) approx_perimeter *= parseInt(height); 5226 5227 jQuery("#io_measurement_input").val(approx_perimeter); 5228 } 5229 5230 function set_price_on_item_page(units, measurement){ 5231 let measurement_price = document.querySelector(".io_product_measurement_price"); 5232 if(measurement_price==undefined){ 5233 var first_price = document.querySelector(".io_product_price_box"); 5234 if(first_price != null){ 5235 measurement_price = first_price.cloneNode(true); 5236 /* clear all classes */ 5237 measurement_price.className = ""; 5238 measurement_price.classList.add("io_product_price_box"); 5239 measurement_price.classList.add("io_product_measurement_price"); 5240 measurement_price.style.display = "grid"; 5241 /* Make a hidden data span for when adding to cart */ 5242 raw_measurement = document.createElement("span"); 5243 raw_measurement.classList.add("io_measure_price_raw_measurement"); 5244 raw_measurement.style.display = "none"; 5245 raw_measurement.textContent = measurement; 5246 measurement_price.appendChild(raw_measurement); 5247 first_price.before(measurement_price); 5248 } 5249 } 5250 var price_1h = Number(jQuery(".io_product_price_1h_"+jQuery(".io_product_infobox .item_rentalid").text()).text().replace(/[^0-9.-]+/g,"")); 5251 measurement_price.querySelector("p:nth-child(1)").innerHTML = simpleCart.toCurrency(price_1h*measurement); 5252 measurement_price.querySelector("p:nth-child(2)").innerHTML = "For approximately "+measurement+" "+units; 5253 } 5254 5255 function io_map_clear() { 5256 if(drawingManager.getDrawingMode() == "polygon"){ 5257 drawingManager.setDrawingMode("polygon"); 5258 } 5259 5260 if(polygons) polygons.forEach(function(polygon) { 5261 polygon.setMap(null); 5262 }); 5263 if(current_polyline) current_polyline.setMap(null); 5264 if(polylines) polylines.forEach(function(polyline) { 5265 polyline.setMap(null); 5266 }); 5267 if(polyline_markers) polyline_markers.forEach(function(marker) { 5268 marker.setMap(null); 5269 }); 5270 5271 current_polyline = new google.maps.Polyline({ 5272 map: map, 5273 path: [], 5274 strokeColor: "#0113fc", 5275 strokeOpacity: 1.0, 5276 strokeWeight: 2 5277 }); 5278 polygons = new Array(); 5279 polylines = new Array(); 5280 polyline_markers = new Array(); 5281 previous_marker = undefined; 5282 } 5283 5284 function io_map_new_line() { 5285 polylines.push(new google.maps.Polyline({ 5286 map: map, 5287 path: current_polyline.getPath(), 5288 strokeColor: "#0113fc", 5289 strokeOpacity: 1.0, 5290 strokeWeight: 2 5291 }) 5292 ); 5293 previous_marker = undefined; 5294 current_polyline.setMap(null); 5295 current_polyline = new google.maps.Polyline({ 5296 map: map, 5297 path: [], 5298 strokeColor: "#0113fc", 5299 strokeOpacity: 1.0, 5300 strokeWeight: 2 5301 }); 5302 } 5303 5304 function show_more_instruct_click(show_more_button) { 5305 if(show_more_button.textContent == "(more)") { 5306 show_more_button.textContent = "(hide)"; 5307 jQuery("#io_map_additional_instructions").show(); 5308 }else if(show_more_button.textContent == "(hide)") { 5309 show_more_button.textContent = "(more)"; 5310 jQuery("#io_map_additional_instructions").hide(); 5311 } 5312 } 5313 5314 function perimeter_height_changed(){ 5315 let current_map_height = jQuery("#perimeter_height").val(); 5316 if(current_map_height && current_map_height > 0){ 5317 if(jQuery("#io_measurement_input").val() && !previous_map_height){ 5318 let measurement = jQuery("#io_measurement_input").val(); 5319 jQuery("#io_measurement_input").val(measurement * current_map_height); 5320 }else if(jQuery("#io_measurement_input").val() && previous_map_height){ 5321 let measurement = jQuery("#io_measurement_input").val(); 5322 if(previous_map_height > 0){ 5323 measurement = measurement / previous_map_height; 5324 } 5325 jQuery("#io_measurement_input").val(measurement * current_map_height); 5326 } 5327 }else if (!current_map_height || current_map_height == 0){ 5328 if(jQuery("#io_measurement_input").val() && previous_map_height){ 5329 let measurement = jQuery("#io_measurement_input").val(); 5330 if(previous_map_height > 0){ 5331 measurement = measurement / previous_map_height; 5332 } 5333 jQuery("#io_measurement_input").val(measurement); 5334 } 5335 } 5336 previous_map_height = current_map_height; 5337 } 5338 5339 window.initMap = initMap;</script>
5339 <div class="map_fancybox"><div class="elementor-widget-text-editor"><div> <details id="io_map_address_entry"> <summary style = "cursor:pointer">Enter Address Information (edit)</summary><table style="margin-left: 10px"><tr><td> <label for="address" id="io_mcl_address_label" style="display: table-cell"> Street Address </label></td><td> <input id="io_mc_address" style="display: table-cell" name="address" type="text"></input></td></tr><tr><td> <label for="city" id="io_mcl_city_label" style="display: table-cell"> City </label></td><td> <input id="io_mc_city" style="display: table-cell" name="city" type="text"></input></td></tr><tr id="io_mc_us-state-select"><td> <label for="state" id="io_mcl_state_label" style="display: table-cell"> State </label></td><td> <select name="state" id="io_mc_state" style="display: table-cell" class="input-mini"><option value=""></option><option value="AK">AK</option><option value="AL">AL</option><option value="AR">AR</option><option value="AZ">AZ</option><option value="CA">CA</option><option value="CO">CO</option><option value="CT">CT</option><option value="DC">DC</option><option value="DE">DE</option><option value="FL">FL</option><option value="GA">GA</option><option value="HI">HI</option><option value="IA">IA</option><option value="ID">ID</option><option value="IL">IL</option><option value="IN">IN</option><option value="KS">KS</option><option value="KY">KY</option><option value="LA">LA</option><option value="MA">MA</option><option value="MD">MD</option><option value="ME">ME</option><option value="MI">MI</option><option value="MN">MN</option><option value="MO">MO</option><option value="MS">MS</option><option value="MT">MT</option><option value="NC">NC</option><option value="ND">ND</option><option value="NE">NE</option><option value="NH">NH</option><option value="NJ">NJ</option><option value="NM">NM</option><option value="NV">NV</option><option value="NY">NY</option><option value="OH">OH</option><option value="OK">OK</option><option value="OR">OR</option><option value="PA">PA</option><option value="RI">RI</option><option value="SC">SC</option><option value="SD">SD</option><option value="TN">TN</option><option value="TX">TX</option><option value="UT">UT</option><option value="VA">VA</option><option value="VT">VT</option><option value="WA">WA</option><option value="WI">WI</option><option value="WV">WV</option><option value="WY">WY</option> </select></td></tr><tr><td> <label for="zip" id="io_mcl_zip_label" style="display: table-cell"> Zip Code </label></td><td> <input id="io_mc_zip" style="display: table-cell" name="zip" type="text"></input></td></tr></table> <a class="elementor-button elementor-size-sm io_button" 5340 id="map_geocode_submit" 5341 onClick="io_geocode()" 5342 href="javascript:;"> Locate </a> </details><div id="perimeter_height_contianer"><p>If you are taking measurements for a structure such as a building or fence, please provide the height of the structure here. If height does not apply to the wash, for instance for a gutter wash, leave this field empty. <strong> Please note if you enter a value here after taking measurements, you will need to take measurements again. </strong></p> <label> Height of structure: </label> <input type="number" id="perimeter_height" onChange="perimeter_height_changed()"/></div><div><p id="io_map_instructions"></p></div><div id="io_measurement_input_container"> <label id="io_measurement_input_label"> </label> <input type="number" id="io_measurement_input"/> <a class="elementor-button elementor-size-sm io_button" 5343 id="io_map_manual_input" 5344 href="javascript:;"> Done </a></div><div style="display: inline-flex"><div id="io_map_clear_container"> <a class="elementor-button elementor-size-sm io_button" 5345 id="io_map_clear_btn" 5346 onClick="io_map_clear()" 5347 href="javascript:;"> Clear </a></div><div id="io_map_new_line_container" style="margin-left:5px"> <a class="elementor-button elementor-size-sm io_button" 5348 id="io_map_new_line_btn" 5349 onClick="io_map_new_line()" 5350 href="javascript:;"> Add New Line </a></div></div></div></div> <br><div id="map_container">
5350<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDEuvvqefKaUABPvydm00SV8Fr8tQeGVcw&libraries=drawing&callback=initMap" defer></script>
5350 </div></div>
5350<script>jQuery(".io_testimonials, #io_testimonials").each(function(){ 5351 io_get_reviews(this); 5352 }) 5353 setTimeout(function(){ 5354 jQuery(".io_testimonials .w3-ul li p").each(function(){ 5355 const container = jQuery(this).parent() 5356 const element = jQuery(this); 5357 5358 if (element[0].scrollHeight > container[0].clientHeight) { 5359 5360 jQuery(this).parent().parent().append(create_read_more()); 5361 } 5362 }); 5363 }, 500); 5364 5365 function create_read_more(){ 5366 let html = "<p class=\"io_review_readmore\" onClick=\"review_readmore_clicked(this)\">read more</p>" 5367 return html; 5368 } 5369 5370 function review_readmore_clicked(element){ 5371 let review_li = jQuery(element).parent().find("li:eq(3)"); 5372 new_height = jQuery(review_li).find("p").height() + 16; 5373 jQuery(review_li).height(new_height); 5374 jQuery(element).hide(); 5375 } 5376 5377 function io_get_reviews(element){ 5378 let io_un = "TopEventRentals"; 5379 let io_loc = "0"; 5380 let io_url1 = 'https://rental.software/testimonials_iframe.php?user='; 5381 if (location.hostname === "localhost"){ 5382 io_url1 = 'http://localhost/io/bugs/testimonials_iframe.php?user='; 5383 //io_url1 = 'http://localhost/jbug/trunk/testimonials_iframe.php?user='; 5384 } 5385 let io_url2 = '&location_id='; 5386 let io_url3 = '&width=100%&number_of_reviews=10&show_average_rating=1&show_stars=1&show_date=&show_reviewer_name=1&orderby=time&iframe=0'; 5387 let io_url_c = io_url1 + io_un + io_url2 + io_loc + io_url3; 5388 fetch(io_url_c, { 5389 method: 'get' 5390 }).then( 5391 function(response){ 5392 return response.json(); 5393 } 5394 ).then(function(data) { 5395 5396 5397 5398 //let element = document.getElementById("io_testimonials"); 5399 //DOM-built on purpose: literal markup in this inline script lands in the raw page 5400 //source and SEO crawlers read it as page content (IO-37932). 5401 element.textContent = ""; 5402 let review_cnt=0; 5403 let rating_sum = 0; 5404 data.forEach((user) => { 5405 const { name, review, rating, time } = user; 5406 rating_sum += Number(rating); 5407 review_cnt++; 5408 let review_div = document.createElement("div"); 5409 let review_list = document.createElement("ul"); 5410 review_list.className = "w3-ul"; 5411 let name_li = document.createElement("li"); 5412 name_li.textContent = name; 5413 let rating_li = document.createElement("li"); 5414 rating_li.textContent = rating + " "; 5415 let date_li = document.createElement("li"); 5416 date_li.textContent = time; 5417 let review_li = document.createElement("li"); 5418 let review_p = document.createElement("p"); 5419 review_p.textContent = review; 5420 review_li.appendChild(review_p); 5421 let img_star = Math.round(parseFloat(rating)); 5422 let star_img = document.createElement("img"); 5423 star_img.className = "review_img"; 5424 star_img.src = "https://rental.software/images/" + img_star + "star.png"; 5425 rating_li.appendChild(star_img); 5426 review_list.appendChild(name_li); 5427 review_list.appendChild(rating_li); 5428 review_list.appendChild(date_li); 5429 review_list.appendChild(review_li); 5430 review_div.appendChild(review_list); 5431 element.appendChild(review_div); 5432 }); 5433 let avg = (parseFloat(rating_sum)/parseFloat(review_cnt)).toFixed(1); 5434 let avg_img = Math.round(avg); 5435 let head = document.createElement("div"); 5436 let head_h2 = document.createElement("h2"); 5437 head_h2.textContent = "Avg Rating: " + avg; 5438 let head_img = document.createElement("img"); 5439 head_img.className = "review_avg_img"; 5440 head_img.src = "https://rental.software/images/" + avg_img + "star.png"; 5441 head.appendChild(head_h2); 5442 head.appendChild(head_img); 5443 element.prepend(head); 5444 }).catch(function(err) { 5445 console.log(err); 5446 }); 5447}</script>
5447 <style type="text/css">.searchio-live-search-results { 5448 opacity: 0; 5449 transition: opacity .25s ease-in-out; 5450 -moz-transition: opacity .25s ease-in-out; 5451 -webkit-transition: opacity .25s ease-in-out; 5452 height: 0; 5453 overflow: hidden; 5454 z-index: 9999995; /* Exceed searchIO Modal Search Form overlay. */ 5455 position: absolute; 5456 display: none; 5457 } 5458 5459 .searchio-live-search-results-showing { 5460 display: block; 5461 opacity: 1; 5462 height: auto; 5463 overflow: auto; 5464 } 5465 5466 .searchio-live-search-no-results { 5467 padding: 3em 2em 0; 5468 text-align: center; 5469 } 5470 5471 .searchio-live-search-no-min-chars:after { 5472 content: "Continue typing"; 5473 display: block; 5474 text-align: center; 5475 padding: 2em 2em 0; 5476 }</style>
5476<script>var _searchIO_LIVE_AJAX_SEARCH_BLOCKS = true; 5477 var _searchIO_LIVE_AJAX_SEARCH_ENGINE = 'default'; 5478 var _searchIO_LIVE_AJAX_SEARCH_CONFIG = 'default';</script>
5478
5478<script>( () => { 5479 const lazyloadRunObserver = () => { 5480 const lazyloadBackgrounds = document.querySelectorAll( `.e-con.e-parent:not(.e-lazyloaded)` ); 5481 const lazyloadBackgroundObserver = new IntersectionObserver( ( entries ) => { 5482 entries.forEach( ( entry ) => { 5483 if ( entry.isIntersecting ) { 5484 let lazyloadBackground = entry.target; 5485 if( lazyloadBackground ) { 5486 lazyloadBackground.classList.add( 'e-lazyloaded' ); 5487 } 5488 lazyloadBackgroundObserver.unobserve( entry.target ); 5489 } 5490 }); 5491 }, { rootMargin: '200px 0px 200px 0px' } ); 5492 lazyloadBackgrounds.forEach( ( lazyloadBackground ) => { 5493 lazyloadBackgroundObserver.observe( lazyloadBackground ); 5494 } ); 5495 }; 5496 const events = [ 5497 'DOMContentLoaded', 5498 'elementor/lazyload/observe', 5499 ]; 5500 events.forEach( ( event ) => { 5501 document.addEventListener( event, lazyloadRunObserver ); 5502 } ); 5503 } )();</script>
5503
5503<script id="jquery-ui-core-js-before">jQuery.uiBackCompat = true; 5504//# sourceURL=jquery-ui-core-js-before</script>
5504
5504<script id="jquery-ui-datepicker-js-after">jQuery(function(jQuery){jQuery.datepicker.setDefaults({"closeText":"Close","currentText":"Today","monthNames":["January","February","March","April","May","June","July","August","September","October","November","December"],"monthNamesShort":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"nextText":"Next","prevText":"Previous","dayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"dayNamesShort":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"dayNamesMin":["S","M","T","W","T","F","S"],"dateFormat":"MM d, yy","firstDay":1,"isRTL":false});}); 5505//# sourceURL=jquery-ui-datepicker-js-after</script>
5505
5505<script id="slick-carousel-js-js" src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js?ver=1.8.1"></script>
5505
5505<script id="angie-canvas-template-js-before">angieCanvasTemplateData = {"templateSlug":"angie-canvas"}; 5506//# sourceURL=angie-canvas-template-js-before</script>
5506
5506<script id="elementor-frontend-js-before">var elementorFrontendConfig = {"environmentMode":{"edit":false,"wpPreview":false,"isScriptDebug":false},"i18n":{"shareOnFacebook":"Share on Facebook","shareOnX":"Share on X","pinIt":"Pin it","download":"Download","downloadImage":"Download image","fullscreen":"Fullscreen","zoom":"Zoom","share":"Share","playVideo":"Play Video","previous":"Previous","next":"Next","close":"Close","a11yCarouselPrevSlideMessage":"Previous slide","a11yCarouselNextSlideMessage":"Next slide","a11yCarouselFirstSlideMessage":"This is the first slide","a11yCarouselLastSlideMessage":"This is the last slide","a11yCarouselPaginationBulletMessage":"Go to slide"},"is_rtl":false,"breakpoints":{"xs":0,"sm":480,"md":768,"lg":1025,"xl":1440,"xxl":1600},"responsive":{"breakpoints":{"mobile":{"label":"Mobile Portrait","value":767,"default_value":767,"direction":"max","is_enabled":true},"mobile_extra":{"label":"Mobile Landscape","value":880,"default_value":880,"direction":"max","is_enabled":false},"tablet":{"label":"Tablet Portrait","value":1024,"default_value":1024,"direction":"max","is_enabled":true},"tablet_extra":{"label":"Tablet Landscape","value":1200,"default_value":1200,"direction":"max","is_enabled":false},"laptop":{"label":"Laptop","value":1366,"default_value":1366,"direction":"max","is_enabled":false},"widescreen":{"label":"Widescreen","value":2400,"default_value":2400,"direction":"min","is_enabled":false}},"hasCustomBreakpoints":false},"version":"4.3.4","is_static":false,"experimentalFeatures":{"additional_custom_breakpoints":true,"theme_builder_v2":true,"import-export-customization":true,"e_pro_atomic_form":true,"e_pro_collection_loop":true,"e_pro_variables":true,"e_pro_interactions":true},"urls":{"assets":"https:\/\/topeventrental.com\/wp-content\/plugins\/elementor\/assets\/","ajaxurl":"https:\/\/topeventrental.com\/wp-admin\/admin-ajax.php","uploadUrl":"https:\/\/topeventrental.com\/wp-content\/uploads"},"nonces":{"floatingButtonsClickTracking":"82eecb4df6","atomicFormsSendForm":"3f08e021e8"},"swiperClass":"swiper","settings":{"page":[],"editorPreferences":[]},"kit":{"body_background_background":"classic","active_breakpoints":["viewport_mobile","viewport_tablet"],"lightbox_enable_counter":"yes","lightbox_enable_fullscreen":"yes","lightbox_enable_zoom":"yes","lightbox_enable_share":"yes","lightbox_title_src":"title","lightbox_description_src":"description"},"post":{"id":479,"title":"About%20Us%20-%20Top%20Event%20Rentals%20Phoenix%20AZ","excerpt":"","featuredImage":false}}; 5507//# sourceURL=elementor-frontend-js-before</script>
5507
5507<script id="swp-live-search-client-js-extra">var searchio_live_search_params = []; 5508searchio_live_search_params = {"ajaxurl":"https:\/\/topeventrental.com\/wp-admin\/admin-ajax.php","origin_id":479,"config":{"default":{"engine":"default","input":{"delay":300,"min_chars":3},"results":{"position":"bottom","width":"auto","offset":{"x":0,"y":5}},"spinner":{"lines":12,"length":8,"width":3,"radius":8,"scale":1,"corners":1,"color":"#424242","fadeColor":"transparent","speed":1,"rotate":0,"animation":"searchio-spinner-line-fade-quick","direction":1,"zIndex":2000000000,"className":"spinner","top":"50%","left":"50%","shadow":"0 0 1px transparent","position":"absolute"}}},"msg_no_config_found":"No valid searchIO Live Search configuration found!","aria_instructions":"When autocomplete results are available use up and down arrows to review and enter to go to the desired page. Touch device users, explore by touch or with swipe gestures.","io_search_results_same_width":"1","io_search_results_width":"400","io_search_results_align":"right"};; 5509//# sourceURL=swp-live-search-client-js-extra</script>
5509
5509<script id="googlesitekit-events-provider-content-events-js-before">window._googlesitekit = window._googlesitekit || {}; 5510window._googlesitekit.contentEvents = {"postID":479,"isReadableSinglePost":false,"hasVimeoEmbed":false,"wordCount":0,"estimatedReadTimeSeconds":0,"isLastPageOfMultiPagePost":false,"readTimeThresholdPercent":85,"minimumReadTimeSeconds":5}; 5511//# sourceURL=googlesitekit-events-provider-content-events-js-before</script>
vendor: 131 bytes, line 5511
5511 <script id="elementor-recaptcha_v3-api-js" src="https://www.google.com/recaptcha/api.js?render=explicit&ver=4.2.2"></script>
5511<script id="wp-hooks-js" src="https://topeventrental.com/wp-includes/js/dist/hooks.min.js?ver=f0f188028580e8dc1255"></script>
5511
5511<script id="wp-i18n-js" src="https://topeventrental.com/wp-includes/js/dist/i18n.min.js?ver=1dfe7db3940c23ea9216"></script>
5511
5511<script id="wp-i18n-js-after">wp.i18n.setLocaleData( { 'text direction\u0004ltr': [ 'ltr' ] } ); 5512//# sourceURL=wp-i18n-js-after</script>
5512
5512<script id="elementor-pro-frontend-js-before">var ElementorProFrontendConfig = {"ajaxurl":"https:\/\/topeventrental.com\/wp-admin\/admin-ajax.php","nonce":"81add16754","urls":{"assets":"https:\/\/topeventrental.com\/wp-content\/plugins\/elementor-pro\/assets\/","rest":"https:\/\/topeventrental.com\/wp-json\/"},"settings":{"lazy_load_background_images":true},"popup":{"hasPopUps":true},"shareButtonsNetworks":{"facebook":{"title":"Facebook","has_counter":true},"twitter":{"title":"Twitter"},"linkedin":{"title":"LinkedIn","has_counter":true},"pinterest":{"title":"Pinterest","has_counter":true},"reddit":{"title":"Reddit","has_counter":true},"vk":{"title":"VK","has_counter":true},"odnoklassniki":{"title":"OK","has_counter":true},"tumblr":{"title":"Tumblr"},"digg":{"title":"Digg"},"skype":{"title":"Skype"},"stumbleupon":{"title":"StumbleUpon","has_counter":true},"mix":{"title":"Mix"},"telegram":{"title":"Telegram"},"pocket":{"title":"Pocket","has_counter":true},"xing":{"title":"XING","has_counter":true},"whatsapp":{"title":"WhatsApp"},"email":{"title":"Email"},"print":{"title":"Print"},"x-twitter":{"title":"X"},"threads":{"title":"Threads"}},"facebook_sdk":{"lang":"en_US","app_id":""},"lottie":{"defaultAnimationUrl":"https:\/\/topeventrental.com\/wp-content\/plugins\/elementor-pro\/modules\/lottie\/assets\/animations\/default.json"}}; 5513//# sourceURL=elementor-pro-frontend-js-before</script>
5513
5513<script defer src="https://topeventrental.com/wp-content/cache/autoptimize/js/autoptimize_cd08ea8b3f62e8968fd5790078b2cf1e.js"></script>
5513</body></html> 5514<!-- Cached by WP-Optimize (gzip) - https://teamupdraft.com/wp-optimize/ - Last modified: October 6, 2026 4:19 pm (UTC:0) -->
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.