1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<!--[if IE 7]> <html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" class="ie7"> <![endif]--> 3<!--[if IE 8]> <html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" class="ie8"> <![endif]--> 4<!--[if IE 9]> <html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" class="ie9"> <![endif]--> 5<!--[if IE 10]> <html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" class="ie10"> <![endif]--> 6<!--[if gt IE 10]><!--> <html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"> <!--<![endif]--> 7<head> 8<link rel="canonical" href="http://plymouthrockinsurance.net/discounts">
9<script type="text/javascript"> 10 // TAG MANAGER VARIABLE DECLARATIONS. 11 // PURPOSE: Pulls vars out of PHP and cookies, and places them into a JS array so they will be in scope for Google Tag Manager. 12 // USAGE: Include in the HEAD, before the Tag Manger script. 13 14 15 var cl_gtm = {}; 16 cl_gtm.promoCode = '80233'; 17 cl_gtm.requestID = '24581|58489|6ac1e0c38dfc9'; 18 //cl_gtm.clientID = '6ac1e0c38dfc9'; 19 cl_gtm.historicalPromos; 20 21 window.dataLayer = window.dataLayer || []; 22 23 window.dataLayer.push({ 24 requestID: '24581|58489|6ac1e0c38dfc9', 25 requestIDEncoded: '24581%7C58489%7C6ac1e0c38dfc9', 26 marketingChannel: 'SEO', 27 utm_channel: '', 28 utm_source: '' 29 }); 30 31 32 // Read the cookies, and find the historical promo code values. Define the values to the cl_gtm array. 33 var ca = document.cookie.split(';'); 34 for(var i=0; i<ca.length; i++) { 35 var c = ca[i]; 36 while (c.charAt(0)==' ') c = c.substring(1); 37 if (c.indexOf('historical_promo_codes=') == 0){ 38 cl_gtm.historicalPromos = c.substring("historical_promo_codes=".length,c.length); 39 } 40 } 41</script>
41 42 43<title>Get New Jersey Auto Insurance Discounts</title> 44<meta name="description" content="Find discounts on Plymouth Rock auto insurance in New Jersey. Call 855-206-7718 to see what savings you are eligible for when you get your free quote." /> 45<meta name="keywords" content="" /> 46<meta name="robots" content="noindex, nofollow" /> 47 48<meta http-equiv="content-type" content="text/html; charset=utf-8" /> 49<link rel='icon' href='/images/favicons/plymouth-rock.ico'><link href="/css/plymouth-rock.css" rel="stylesheet" type="text/css" /> 50<style type="text/css">#other-options{max-width:100%;width:1200px;margin:auto;}#other-options h1,#other-options h2{display:none;}</style> 51 52
52<script type="text/javascript"> 53 window.dataLayer = window.dataLayer || []; 54 window.rotationEnabled = false; 55 56 window.dataLayer.push({ 57 requestID: '24581|58489|6ac1e0c38dfc9', 58 requestIDEncoded: '24581%7C58489%7C6ac1e0c38dfc9', 59 marketingChannel: 'SEO', 60 rotationEnabled: window.rotationEnabled 61 }); 62 </script>
62 63 </head> 64<body id="construct" class="discounts"> 65 <!-- Google Tag Manager -->
vendor: 66 bytes, lines 65-66
65 66 <noscript><iframe src="//www.googletagmanager.com/ns.html?id=
66GTM-P7SJKR
vendor: 91 bytes, lines 66-68
66" 67 height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> 68
68<script>
vendor: 337 bytes, lines 68-72
68(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 69 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 70 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 71 '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 72 })(window,document,'script','dataLayer','
72GTM-P7SJKR
vendor: 3 bytes, line 72
72');
72</script>
72 73 <!-- End Google Tag Manager --> 74 <div id="extHeader"> 75
75<script src='//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'></script>
75 76<header class='row'> 77 <div class="columns medium-4 logo"> 78 <a href="/"> 79 <img src="/images/plymouth-rock/header-logo.png"> 80 </a> 81 </div> 82 <div class="columns medium-8 hide-for-small text"> 83 <div class="columns"> 84 <div class="right cs-link"> 85 <a href="http://www.plymouthrocknj.com/customer-care" target="blank">Customer Service</a> 86 </div> 87 </div> 88 <div class="attention"> 89 <span>Time left to call today: </span> 90 <span class="timer"><span class="hours">00</span> : <span class="minutes">00</span> : <span class="seconds">00</span></span> 91 <span class="top-phone">CALL 855-206-7714</span> 92 </div> 93 </div> 94 <nav class='columns medium-12'> 95 <a href="/auto" class="auto">AUTO INSURANCE</a> 96 <a href="/discounts" class="discounts">DISCOUNTS</a> 97 <a href="/about" class="about">ABOUT US</a> 98 </nav> 99 <div class="show-for-small mobile-nav"> 100 <a href="#" class="nav-icon"> 101 <span></span> 102 </a> 103 </div> 104</header> 105 106</div> 107<div id="container"> 108 <section class="focus"> 109 <div class="row"> 110 <div class="columns medium-12"> 111 <h1><span>Drivers who switch to Plymouth Rock</span>save an average of <sup>$</sup>423<sup>^</sup> a year<span></h1> 112 <div class='columns medium-7 large-5 zip-box' id="quotebox"> 113 <p class='top'>Enter your zip code to get started.</p> 114 <form id="quoteform" name="quoteform"> 115 <div class="formrow hideRow"> 116 117 <input type="text" name="username" id="username" value="Full name" onfocus="if(this.value == 'Full name') { this.value = ''; }" onblur="if(this.value == '') { this.value = 'Full name'; }"> 118 </div> 119 <div class="formrow hideRow"> 120 121 <input type="text" name="phonenumber" id="phonenumber" value="Phone" placeholder='Phone' onfocus="if(this.value == 'Phone') { this.value = ''; }" onblur="if(this.value == '') { this.value = 'Phone'; }"> 122 </div> 123 <div class="formrow"> 124 125 <input type="text" class="stepone zip" name="zipcode" id="zipcode" value="Zip Code" maxlength="5" > 126 <input type="hidden" name="providertype" id="providertype" value="plymouth"> 127 <input type="hidden" name="promo_code" class="promo" value="80233"> 128 <input type="submit" name="getstarted" id="getstarted" class="stepone" value="Get my quote" > 129 <div class="arrow"></div> 130 </div> 131 <p>or call <a href='tel:855-206-7714'>855-206-7714</a></p> 132 <div class="formrow hideRow" id="tcpaNotice"> 133 <p class="formdisclaimer" style="font-size: .6em; padding: 0 25px;">All fields required. By pressing the “Get my quote” button, you give a Plymouth Rock authorized representative your consent to use automated technology to call, or text, you at the phone number(s) above, including your wireless number if provided. We will never sell your information to third parties. You are not required to provide this consent to make a purchase from us.</p> 134 </div> 135 136 <div id="nameError" style="display:none;"> 137 <p>Please enter your full name</p> 138 </div> 139 <div id="zipError" style="display:none;"> 140 <p>Please enter correct zip code</p> 141 </div> 142 <div id="phoneError" style="display:none;"> 143 <p>Please enter your phone number</p> 144 </div> 145 </form> 146 </div> 147 148 149 </div> 150 </div> 151 </section> 152 <div id="other-options" class='content row'></div> 153 <section class='content row'> 154 <div class="columns medium-12 show-for-small padding0"> 155 <a href="tel:1-855-206-7714" class="mobile-cta"> <span> CLICK TO CALL NOW!</span><br /> CALL 855-206-7714 </a> 156 <div class="attention"> 157 <span>Time left to call today: </span>
158 <span class="timer"><span class="hours">00</span> : <span class="minutes">00</span> : <span class="seconds">00</span></span> 159 </div> 160 </div> 161 <div class="columns medium-12 center text"> 162 <h2>Plymouth Rock Gives You Ways to Save</h2> 163 <div class="columns medium-12 disc-items"> 164 <div class="columns medium-4 multi"> 165 <span class="sprite"></span> 166 <h4><span>5-Year Claims-Free</span> Discount</h4> 167 <p>Save up to 5% when your policy is clear of claims over a five-year period.</p> 168 </div> 169 <div class="columns medium-4 home"> 170 <span class="sprite"></span> 171 <h4><span>Homeownership</span> Discount</h4> 172 <p>If you own your own home or condominium, you may qualify for this discount and save big.</p> 173 </div> 174 <div class="columns medium-4 safe"> 175 <span class="sprite"></span> 176 <h4><span>Safety Pledge</span> Discount</h4> 177 <p>Drivers who sign Plymouth Rock's Safety Pledge will receive an extra discount for their commitment to safety behind the wheel.</p> 178 </div> 179 </div> 180 <div class="columns medium-12 disc-items"> 181 <div class="columns medium-4 student"> 182 <span class="sprite"></span> 183 <h4><span>Good Student</span> Discount</h4> 184 <p>You could be rewarded for your good grades with approximately 8% savings on your car insurance.</p> 185 </div> 186 <div class="columns medium-4 combo"> 187 <span class="sprite"></span> 188 <h4><span>Companion Home Policy</span> Discount</h4> 189 <p>You could save big when bundling your homeowners insurance or renters insurance with your car insurance.</p> 190 </div> 191 <div class="columns medium-4 theft"> 192 <span class="sprite"></span> 193 <h4><span>Anti-Theft</span> Discount</h4> 194 <p>You could save up to 25% if your vehicle is armed with a qualified anti-theft device.*</p> 195 </div> 196 </div> 197 </div> 198 <div class="columns medium-12 save-box"> 199 <img src="/images/plymouth-rock/pig.png" class="show-for-small"> 200 <div class="columns right text"> 201 <h2>Plymouth Rock Gives You Ways to Save</h2> 202 <div class="disc-table"> 203 <div class="header-row"> 204 205 <div class="col1"> 206 <h5>DISCOUNT</h5> 207 </div> 208 <div class="col2"> 209 <h5>YOU SAVE</h5> 210 </div> 211 212 </div> 213 214 <div class="table-row"> 215 216 <div class="col1"> 217 <p>Safety Pledge</p> 218 </div> 219 <div class="col2"> 220 <p>Up to <span>5%</span></p> 221 </div> 222 </div> 223 <div class="table-row"> 224 225 <div class="col1"> 226 <p>Anti-Theft</p> 227 </div> 228 <div class="col2"> 229 <p>Up to <span>25%*</span></p> 230 </div> 231 </div> 232 <div class="table-row"> 233 234 <div class="col1"> 235 <p>5-Year Claims-Free</p> 236 </div> 237 <div class="col2"> 238 <p>Up to <span>5%</span></p> 239 </div> 240 </div> 241 </div> 242 243 </div> 244 </div> 245 <div class="columns medium-12 show-for-small padding0"> 246 <a href="tel:1-855-206-7714" class="mobile-cta"> Call today for your free quote!<br /> <span>855-206-7714</span> </a> 247 </div> 248 </section> 249 <section class='cta hide-for-small'> 250 <div class="row"> 251 <div class="columns medium-12"> 252 Call today for your free quote! 855-206-7714 253 </div> 254 </div> 255 </section> 256 257</div> 258<div id="extFooter"> 259 <footer> 260 <div class="row"> 261 <div class="columns medium-3"> 262 <div class='logo'> 263 <img src="/images/plymouth-rock/footer-logo.png"> 264 </div> 265 <div class='disclaimers'> 266 <p class='disc'>©2026 Plymouth Rock Management Company of New Jersey. All rights reserved.</p> 267 </div> 268 </div> 269 <div class="columns medium-9 text"> 270 <div class="footer-nav"> 271 <a href="/auto" class="auto">AUTO INSURANCE</a> 272 <a href="/discounts" class="discounts">DISCOUNTS</a> 273 <a href="/about" class="about">ABOUT US</a> 274 <a href="/privacy-policy" class="privacy">PRIVACY POLICY</a> 275 <a href="/terms-and-conditions" class="conditions">TERMS AND CONDITIONS</a> 276 </div> 277 <div class='disclaimers'> 278 <p class='disc'>Plymouth Rock Assurance is a marketing name used by a group of separate companies that write and manage property and casualty insurance in multiple states. Insurance in New Jersey is offered by Plymouth Rock Management Company of New Jersey on behalf of Palisades Insurance Company and its affiliates. Each company is financially responsible only for its own insurance products. Actual coverage is subject to the language of the policies as issued by each company. Certain restrictions and limitations apply. For a full description of the programs, features, and coverages, please visit PlymouthRock.com.</p> 279 <p class='disc'>^Annual average Savings as reported to Plymouth Rock by policyholders who switched to Plymouth Rock from January 2015 to November 2015. Your premium may vary due to available discounts, eligibility requirements, driving record, and other factors. Applicants are individually underwritten and s
279ome may not qualify.</p> 280 <p class='disc'>*Anti-Theft Discount applies to the comprehensive coverage premium.</p> 281 </div> 282 </div> 283 </div> 284</footer> 285<div id='theoverlay' style="display: none;"> 286<a href="#thepopupbox" id='tpb_link' class="fancybox">Link</a> 287 <div id='thepopupbox'> 288 <h2 style="padding-bottom:20px;">Are you a current Plymouth Rock customer?</h2> 289 <div style='display: block; width: 100%; text-align: center; margin: 0 auto;'> 290 <a href='#nextbox' class='fancybox'>yes</a> 291 <a href='#' onclick='event.preventDefault();$.fancybox.close();'>no</a> 292 </div> 293 </div> 294 295 <div id='nextbox'> 296 <div class='nextLeft'> 297 <h3>Manage your account</h3> 298 <ul> 299 <li>View policy documents</li> 300 <li>Track claims</li> 301 <li>Make payments</li> 302 </ul> 303 <a href=' http://www.plymouthrocknj.com/customer-care/manage-policy ' class='account'>Manage account</a> 304 </div> 305 <div class='middle'> 306 <div class='show-for-small'> 307 <p>or</p> 308 </div> 309 </div> 310 311 <div class='nextRight'> 312 <p>To become a new Plymouth Rock<br /> customer or get a FREE quote,</p> 313 <p class='phone'>CALL<span> <a href='tel:855-206-7714'>855-206-7714</a></span></p> 314 </div> 315 </div> 316</div> 317 318</div>
319<script src="//cdn.clear.link/mapi/1.0.0/mapi-full.min.js"></script>
vendor: 1 bytes, line 319
319
320<script type='text/javascript' src='/js/fancybox/jquery.fancybox-1.3.4.pack.js'></script>
320 321<link rel='stylesheet' href='/js/fancybox/jquery.fancybox-1.3.4.css' type='text/css' media='screen'/>
322<script type='text/javascript' src='/js/jquery.maskedinput-1.3.1.min.js'></script>
vendor: 1 bytes, line 322
322
323<script src="//use.typekit.net/szl5njj.js"></script>
vendor: 1 bytes, line 323
323
324<script>try{Typekit.load();}catch(e){}</script>
324 325<meta name="viewport" content="width=device-width, initial-scale=1.0" />
326<script> 327 $(window).load(function(){ 328 $('.fancybox').fancybox(); 329 $.ajax({ 330 type: 'POST', 331 url: '/includes/infinityinsurancequotes/session-handler.php', 332 data: {action: 'setSession'} 333 }); 334 checkForZip(); 335 }); 336 337 $('#quoteform').each(function(){ 338 var $this = $(this), 339 zipfield = $this.find('#zipcode'); 340 341 var input = zipfield; 342 343 input.focus(function() { 344 var zip = $(this).val(); 345 if ( zip = 'Enter Zip') { 346 $(this).val(''); 347 var zip = ''; 348 } 349 }); 350 351 input.blur(function() { 352 var zip = $(this).val(); 353 if ( zip == '') { 354 $(this).val('Enter Zip'); 355 } 356 }); 357 358 }); 359function checkForZip() { 360 var zip = $.getUrlVar('zip'); 361 362 // Zip present in URL sctructure. Ready page two function. 363 if(typeof(zip) !== 'undefined' && isNaN(zip) == false) { 364 // Populate the zip field with the zip found in the URL paramter. Adjust classes. 365 $('#zipcode').addClass('steptwo').removeClass('stepone').val(zip); 366 $('.zip-box').addClass('steptwo'); 367 $('.arrow, #getstarted').addClass('steptwo'); 368 $('#quotebox').css('top', '-20px'); 369 $('.hideRow').show(); 370 $('#zipcodeLabel').show(); 371 $('h1').html('You're almost done!'); 372 $('.top').html('Finalize your details.'); 373 374 // Bind the form submit. 375 $('#quoteform').on('submit', function(event) { 376 // Prevent the natural form submit action. 377 event.preventDefault(); 378 // Remove any existing error states. 379 $('#formError').hide(); 380 // Run the form validation function. 381 validateFormInput(); 382 var elem = document.getElementById("getstarted"); 383 if (elem.value=="Get my quote") 384 { 385 elem.value = "please wait..."; 386 } 387 else 388 { 389 elem.value = "please wait..."; 390 } 391 }); 392 } else { 393 // Zip is not present. Ready page one functions. 394 // Force a click to show the "Are you a customer?" box. 395 $('#tpb_link').click(); 396 // Bind the form submit, navigate the new window to the zip code page. 397 $('#quoteform').on('submit', function(event) { 398 event.preventDefault(); 399 var zip = $('#zipcode').val(); 400 if (zip.length == "5" & isNaN(zip) == false) { 401 // Valid zip code found in the field, set the new window location, taking any other URL parameters into account. 402 if(window.location.href.indexOf("?") > -1) { 403 // Other parameters present, use ampersand separator. 404 var newLoc = window.location.href + "&zip=" + zip; 405 } else { 406 // No other parameters present, use question mark. 407 var newLoc = window.location.href + "?zip=" + zip; 408 } 409 // Open the new window with the specified location and URL parameters. 410 window.open(newLoc); 411 } else { 412 // Invalid zipcode found. Add error class. 413 $('.zip').addClass('error'); 414 $('#zipError').show(); 415 } 416 }); 417 } 418} 419 420 421 function validateFormInput() { 422 // Get the form values. 423 var formFullName = $('#username').val(); 424 var formPhone = $('#phonenumber').val(); 425 var formZip = $('#zipcode').val(); 426 // Ensure all the fields have appropriate data. 427 if (formZip.length != 5) { 428 $('#zipcode').addClass('error'); 429 430 return false; 431 } else if (formFullName.length == "" || formFullName.length < 5) { 432 $('#username').addClass('error'); 433 $('#nameError').show(); 434 return false;
435 } else if (formPhone.length == "" || formPhone.length < 10) { 436 $('#phonenumber').addClass('error'); 437 $('#phoneError').show(); 438 console.log(formPhone); 439 return false; 440 } else { 441 // All fields pass the checks, prepare the data and do the AJAX submit. 442 443 // Try to split the first and last name. 444 var formFirstName = formFullName.split(' ').slice(0, -1).join(' '); 445 var formLastName = formFullName.split(' ').slice(-1).join(' '); 446 447 // Assign the temp vars into the array format used by the handler. 448 var formValues = {}; 449 formValues.first_name = formFirstName; 450 formValues.last_name = formLastName; 451 formValues.phone = formPhone; 452 formValues.zip = formZip; 453 formValues.type = 'auto'; 454 formValues.source = 'plymouthrock-ins'; 455 formValues.promo_code = $('.promo').val(); 456 formValues.requestID = cl_gtm.requestID; 457 458 // Submit the values to the handler via ajax, and then show the success message. 459 460 //disbles button from mutiple entries 461 $('#getstarted').prop('disabled',true); 462 463 // var request = $.ajax({ 464 // url: "/includes/plymouth-rock/quote-ajax.php", 465 // dataType: 'json', 466 // type: 'POST', 467 // data: {'customer':formValues} 468 // }); 469 470 // request.done(function(data){ 471 // if(data.success == true) { 472 // console.log('Submit Success, No Errors'); 473 // $('#quotebox').addClass('thankYou').html('<h2 style="color:#fff;">Thank you!</h2><p style="color:#fff; font-size: 1.7em; line-height: 1.1em;">Your information has been sent. A Plymouth Rock representative will call you shortly. If you have any questions please call <br /> 1-855-206-7714</p>'); 474 // //window.optimizely.push(["trackEvent", "get_quote_submission"]); 475 // } else { 476 // //re-enable button after errors are corrected 477 // $('#getstarted').prop('disabled',false); 478 // console.log('Submit Success, With Errors'); 479 // console.log(data.classes); 480 // $('#nameError').show(); 481 // } 482 // }); 483 484 // request.fail(function(data){ 485 // console.log('Submit Failure'); 486 // }); 487 488 //new ajax 489 $.ajax({ 490 type: 'GET', 491 url: 'https://aim.clearlink.com/echo/clearlink/v1/lead', 492 data: formValues, 493 dataType: "jsonp", 494 jsonp: "callback", 495 cache: false, 496 success: function(result){ 497 console.log('success'); 498 $('#quotebox').addClass('thankYou').html('<h2 style="color:#fff;">Thank you!</h2><p style="color:#fff; font-size: 1.7em; line-height: 1.1em;">Your information has been sent. A Plymouth Rock representative will call you shortly. If you have any questions please call <br /> 1-855-206-7714</p>'); 499 MediaAlphaExchange = { 500 "type": "ad_unit", 501 "placement_id": "o5GOR5gyB1LMMbIyNyR65GFItNhaEg", 502 "version": "17", 503 "sub_1": cl_gtm.promoCode, 504 "sub_2": "plymouthrockinsurance.net/discounts", 505 "data": 506 { "zip": window.location.search.slice(5) } 507 }; 508 509 MediaAlphaExchange__load('other-options'); 510 }, 511 error: function(x, t, m) { 512 if(t==="timeout") { 513 //re-enable button after errors are corrected 514 $('#getstarted').prop('disabled',false); 515 console.log('Submit Success, With Errors'); 516 console.log(data.classes); 517 $('#nameError').show(); 518 } 519 } 520 }); 521 } 522 } 523 524 $.extend({ 525 getUrlVars: function(){ 526 var vars = [], hash; 527 var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); 528 for(var i = 0; i < hashes.length; i++) 529 { 530 hash = hashes[i].split('='); 531 vars.push(hash[0]); 532 vars[hash[0]] = hash[1]; 533 } 534 return vars; 535 }, 536 getUrlVar: function(name){ 537 return $.getUrlVars()[name]; 538 } 539}); 540$(function() { 541 //masking phone input field on focus form. 542 $("#phonenumber").mask("(999) 999-9999"); 543 }); 544 545$('.nav-icon').click(function() { 546 $('nav').slideToggle(); 547 }); 548</script>
vendor: 1 bytes, line 548
548
549<script src="//insurance.mediaalpha.com/js/serve.js"></script>
vendor: 1 bytes, line 549
549
550<script> 551// Customer Service Countdown Script 552// Purpose: Creates a date object with the desired offset, and counts down to the specified times. Includes adjustments for DST and user time zones. 553 554 555// Define the target page element to update and the operating hours. If closed for weekends, use 25 for start and end hours. 556// Note: Set time in 24 hour format in Mountain time zone. 557// Note: To avoid flash of default content, it's recommended that the target element be empty on page load. 558var cs_timer = {} 559 cs_timer.targetNode = '.timer'; 560 cs_timer.useSeconds = true; 561 cs_timer.isDST = isDST(); 562 cs_timer.weekDayStartHour = 9; 563 cs_timer.weekDayEndHour = 17; 564 cs_timer.satStartHour = 25; 565 cs_timer.satEndHour = 25; 566 cs_timer.sunStartHour = 25; 567 cs_timer.sunEndHour = 25; 568 cs_timer.hasMidDayCutoff = false; 569 cs_timer.midDayCutoff = 12; 570 571// Define the counter messages. Must include SPANs classed with 'hours' and 'minutes'. 'seconds' is optional. 572// Example: '<p>Call within the next <span class="color-blue"><span class="count hours">00</span>:<span class="count minutes">00</span>:<span class="count seconds">00</span></span> for same-day installation!<sup>^</sup></p>' 573 cs_timer.messages = {}; 574// cs_timer.messages.weekEndMessage = '<p> Call during office hours on <span class="color-blue">Monday</span> for our best rates!<sup>^</sup></p>'; 575// cs_timer.messages.weekDayMessage = '<p>Call within the next <span class="color-blue"><span class="count hours">00</span>:<span class="count minutes">00</span>:<span class="count seconds">00</span></span>
575 for next-day installation!<sup>^</sup></p>'; 576// cs_timer.messages.AfterHoursMessage = '<p>Call between <span class="color-blue">8am</span> and <span class="color-blue">Noon</span> CST for same-day installation!<sup>^</sup></p>'; 577// cs_timer.messages.weekDayBeforeCutoff = '<p>Call within the next <span class="color-blue"><span class="count hours">00</span>:<span class="count minutes">00</span>:<span class="count seconds">00</span></span> for same-day installation!<sup>^</sup></p>'; 578// cs_timer.messages.weekDayAfterCutoff = '<p>Call within the next <span class="color-blue"><span class="count hours">00</span>:<span class="count minutes">00</span>:<span class="count seconds">00</span></span> for next-day installation!<sup>^</sup></p>'; 579// cs_timer.messages.genericMessage = '<p>Call during office hours for quick installation!<sup>^</sup></p>'; 580 581 582 583function isDST(){ 584 // Purpose: Determines if user is currently in daylight savings time. 585 var arr = []; 586 for (var i = 0; i < 365; i++) { 587 var d = new Date(); 588 d.setDate(i); 589 newoffset = d.getTimezoneOffset(); 590 arr.push(newoffset); 591 } 592 DST = Math.min.apply(null, arr); 593 nonDST = Math.max.apply(null, arr); 594 if (DST == nonDST) { 595 return true; 596 } else { 597 return false; 598 } 599} 600 601function getOffsetDate(offsetInMinutes) { 602 // Purpose: Get local date object, offset for time zone difference.
603 // Inputs: offsetInMinutes is the time (in minutes) that must be added to local time to get UTC, so if time zone is -6hrs, offset is +360. If time zone is +10hrs, offset is -600. 604 605 var d = new Date(); 606 // Add local time zone offset to get UTC and subtract offset to get desired zone 607 d.setMinutes(d.getMinutes() + d.getTimezoneOffset() - offsetInMinutes); 608 return d; 609} 610 611function zeroTimer() { 612 // Purpose: Stop the counter, clear the numbers. 613 // Note: clearInterval and resetting the numbers creates a race condition, so delay the numbers by 1 second. 614 console.log('Zeroing Timer'); 615 clearInterval(cs_timer.cs_counterInit); 616 setTimeout(function() { 617 $('.hours').text('00'); 618 $('.minutes').text('00'); 619 $('.seconds').text('00'); 620 },1001); 621} 622 623function updateCountDown() { 624 // Purpose: Update the DOM message with the time remaining in the period. 625 626 // Mountain time is -6 (300) GMT when in DST, and -7 (360) when in standard time. 627 if (cs_timer.isDST) { 628 // In DST, Off
628set is GMT -6. 629 var mountainDate = getOffsetDate(360); 630 } else { 631 // Not in DST, Offset is GMT -7. 632 var mountainDate = getOffsetDate(420); 633 } 634 // Get the offset time and date from the user's clock. 635 var month = mountainDate.getMonth(); 636 var day = mountainDate.getDate(); 637 var dayOfWeek = mountainDate.getDay(); 638 var hours = {start: new Date(mountainDate.getFullYear(), month, day), end: new Date(mountainDate.getFullYear(), month, day)}; 639 var sameDay = {start: new Date(mountainDate.getFullYear(), month, day), end: new Date(mountainDate.getFullYear(), month, day)}; 640 var isWeekend = false; 641 var isWeekday = false; 642 643 // Determine the day of the week, and set hours of operation, and some BOOLs. 644 if(dayOfWeek >= 1 && dayOfWeek <= 5){ 645 hours.start.setHours(cs_timer.weekDayStartHour); 646 hours.end.setHours(cs_timer.weekDayEndHour); 647 sameDay.start.setHours(cs_timer.weekDayStartHour); 648 sameDay.end.setHours(cs_timer.midDayCutoff); 649 isWeekend = false; 650 isWeekday = true 651 } 652 else if(dayOfWeek == 6){ 653 // Saturday 654 hours.start.setHours(cs_timer.satStartHour); 655 hours.end.setHours(cs_timer.satEndHour); 656 isWeekend = true; 657 isWeekday = false; 658 } else if(dayOfWeek == 0){ 659 // Sunday 660 hours.start.setHours(cs_timer.sunStartHour); 661 hours.end.setHours(cs_timer.sunEndHour); 662 isWeekend = true; 663 isWeekday = false; 664 } else { 665 // Unable to determine time for some reason. 666 hours.start.setHours(0); 667 hours.end.setHours(0); 668 } 669 670 671 // Set the time-dependent messaging. 672 if (isWeekend) { 673 // Weekend Messaging 674 if (dayOfWeek == 6) { 675 // Saturday Messaging 676 if (mountainDate.getHours() >= cs_timer.satStartHour && mountainDate.getHours() < cs_timer.satEndHour) { 677 // Weekend business hours message. 678 //$(cs_timer.targetNode).replaceWith(cs_timer.messages.weekendMessage); 679 } else if (mountainDate.getHours() >= cs_timer.satEndHour || isWeekday && mountainDate.getHours() < cs_timer.satStartHour) { 680 // Weekend after hours message. 681 //$(cs_timer.targetNode).replaceWith(cs_timer.messages.weekendAfterHoursMessage); 682 clearInterval(cs_timer.cs_counterInit); 683 zeroTimer(); 684 } else { 685 // Generic weekend message. 686 //$(cs_timer.targetNode).replaceWith(cs_timer.messages.genericMessage); 687 zeroTimer(); 688 } 689 } else if (dayOfWeek == 0) { 690 // Sunday Messaging 691 if (mountainDate.getHours() >= cs_timer.sunStartHour && mountainDate.getHours() < cs_timer.sunEndHour) { 692 // Weekend business hours message. 693 //$(cs_timer.targetNode).replaceWith(cs_timer.messages.weekendMessage); 694 } else if (mountainDate.getHours() >= cs_timer.sunEndHour || isWeekday && mountainDate.getHours() < cs_timer.sunStartHour) { 695 // Weekend after hours message. 696 //$(cs_timer.targetNode).replaceWith(cs_timer.messages.weekendAfterHoursMessage); 697 } else { 698 // Generic weekend message. 699 //$(cs_timer.targetNode).replaceWith(cs_timer.messages.genericMessage); 700 } 701 } 702 703 // Weekend Days 704 $(cs_timer.targetNode).replaceWith(cs_timer.messages.weekEndMessage); 705 706 } else if (isWeekday) { 707 // Weekday Messaging 708 if (mountainDate.getHours() >= cs_timer.weekDayEndHour || isWeekday && mountainDate.getHours() < cs_timer.weekDayStartHour) { 709 // After Hours Weekday 710 //$(cs_timer.targetNode).replaceWith(cs_timer.messages.AfterHoursMessage); 711 // Timer not running after hours so stop the script from running. 712 zeroTimer(); 713 714 } else if (cs_timer.hasMidDayCutoff && mountainDate.getHours() >= cs_timer.weekDayStartHour && mountainDate.getHours() < cs_timer.midDayCutoff) { 715 // Business Hours before cutoff 716 //$(cs_timer.targetNode).replaceWith(cs_timer.messages.weekDayBeforeCutoff); 717 718 } else if (cs_timer.hasMidDayCutoff && mountainDate.getHours() >
718= cs_timer.midDayCutoff && mountainDate.getHours() < cs_timer.weekDayEndHour) { 719 // Business hours after cutoff. 720 //$(cs_timer.targetNode).replaceWith(cs_timer.messages.weekDayAfterCutoff); 721 } else if (!cs_timer.hasMidDayCutoff && mountainDate.getHours() >= cs_timer.weekDayStartHour && mountainDate.getHours() < cs_timer.weekDayEndHour) { 722 // No cutoff, all weekday message. 723 //$(cs_timer.targetNode).replaceWith(cs_timer.messages.weekDayMessage); 724 } 725 726 } else { 727 // Unknown state. Display generic message. 728 //$(cs_timer.targetNode).replaceWith(cs_timer.messages.genericMessage ); 729 // Timer not present so stop the script from running. 730 zeroTimer(); 731 } 732 733 734 // Do the time calculations. 735 var hourDiff = hours.end.getHours() - mountainDate.getHours(); 736 // Adjust for partial hours by subtracting one. 737 hourDiff = hourDiff - 1; 738 // Convert to string and add leading zeros when required. 739 if(hourDiff <= 9){ 740 hourDiff = hourDiff.toString(); 741 hourDiff = '0' + hourDiff; 742 } 743 var minDiff = 59 - mountainDate.getMinutes(); 744 // Convert to string and add leading zeros when required. 745 if(minDiff <= 9){ 746 minDiff = minDiff.toString(); 747 minDiff = '0' + minDiff; 748 } 749 if(cs_timer.useSeconds) { 750 var secDiff = 59 - mountainDate.getSeconds(); 751 // Convert to string and add leading zeros when required. 752 if(secDiff <= 9){ 753 secDiff = secDiff.toString(); 754 secDiff = '0' + secDiff; 755 } 756 } 757 758 // Same day install calculation. Adjust the hours remaining if it's before noon. 759 if (cs_timer.hasMidDayCutoff && mountainDate.getHours() < cs_timer.midDayCutoff) { 760 var endHour = sameDay.end.getHours() -1; 761 var currentHour = mountainDate.getHours(); 762 var hourDiff = endHour - currentHour; 763 // Convert to string and add leading zeros when required. 764 if(hourDiff <= 9){ 765 hourDiff = hourDiff.toString(); 766 hourDiff = '0' + hourDiff; 767 } 768 } 769 770 // Update the display. 771 $('.hours').text(hourDiff); 772 $('.minutes').text(minDiff); 773 if(cs_timer.useSeconds) { $('.seconds').text(secDiff); } 774} 775 776 777 778// Start the timer to repeat every 1 second. 779cs_timer.cs_counterInit = setInterval('updateCountDown()', 1000); 780</script>
780 781
781<script type="text/javascript"> 782 var _optimizelyPhone = '855-206-7714'; 783 784 </script>
784 785 <!--My Pingdom for a horse--> 786</body> 787</html> 788<!--Runtime: 0.0232 s -->
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.