var setcookie = "N"; var doreplace = "N"; var ruleset = "None"; var continueeval = "Y"; var referrer = "Nothing"; var overridevariablevalue = "Nothing"; // Examine cookie var curCookie = document.cookie.split("; "); for (var i=0; i < curCookie.length; i++) { var crumb = curCookie[i].split("="); var name = crumb[0]; var value = crumb[1]; // Found a Cookie if (name == "HubCookie") { // Pull values from the HubCookie var cookvalue = value.split("|"); overridevariablevalue = cookvalue[0]; if (overridevariablevalue != "Nothing") { value = overridevariablevalue; // We found our variable name.. Now look at values. if (name = "PhoneScript") { } } referrer = cookvalue[1]; if (referrer != "Nothing") { var str = referrer; var patt = new RegExp ("google.com","i"); if (patt.test(str)==true) { doreplace = "Y"; setcookie = "Y"; continueeval = "N"; var ruleset = "R"; referrer = str; } var patt = new RegExp ("bing.com","i"); if (patt.test(str)==true) { doreplace = "Y"; setcookie = "Y"; continueeval = "N"; var ruleset = "R"; referrer = str; } var patt = new RegExp ("yahoo.com","i"); if (patt.test(str)==true) { doreplace = "Y"; setcookie = "Y"; continueeval = "N"; var ruleset = "R"; referrer = str; } var patt = new RegExp ("yahoo.com","i"); if (patt.test(str)==true) { doreplace = "Y"; setcookie = "Y"; continueeval = "N"; var ruleset = "R"; referrer = str; } var patt = new RegExp ("bing.com","i"); if (patt.test(str)==true) { doreplace = "Y"; setcookie = "Y"; continueeval = "N"; var ruleset = "R"; referrer = str; } var patt = new RegExp ("google.com","i"); if (patt.test(str)==true) { doreplace = "Y"; setcookie = "Y"; continueeval = "N"; var ruleset = "R"; referrer = str; } } // This was set to Y in the template because that is used later, but we DONT want to rewrite the cookie here. setcookie = "N"; } } // Only do this if HubCookie was NOT found... if (continueeval == "Y") { //Examine URL string var searchString = document.location.search; searchString = searchString.substring(1); var nvPairs = searchString.split("&"); for (i = 0; i < nvPairs.length; i++) { var nvPair = nvPairs[i].split("="); var name = nvPair[0]; var value = nvPair[1]; // We found our variable name.. Now look at values. if (name = "PhoneScript") { } } } // Only do this if HubCookie was NOT found AND URL string evaluation failed to find anything... if (continueeval == "Y") { //Examine referrer var str = document.referrer; var patt = new RegExp ("google.com","i"); if (patt.test(str)==true) { doreplace = "Y"; setcookie = "Y"; continueeval = "N"; var ruleset = "R"; referrer = str; } var patt = new RegExp ("bing.com","i"); if (patt.test(str)==true) { doreplace = "Y"; setcookie = "Y"; continueeval = "N"; var ruleset = "R"; referrer = str; } var patt = new RegExp ("yahoo.com","i"); if (patt.test(str)==true) { doreplace = "Y"; setcookie = "Y"; continueeval = "N"; var ruleset = "R"; referrer = str; } var patt = new RegExp ("yahoo.com","i"); if (patt.test(str)==true) { doreplace = "Y"; setcookie = "Y"; continueeval = "N"; var ruleset = "R"; referrer = str; } var patt = new RegExp ("bing.com","i"); if (patt.test(str)==true) { doreplace = "Y"; setcookie = "Y"; continueeval = "N"; var ruleset = "R"; referrer = str; } var patt = new RegExp ("google.com","i"); if (patt.test(str)==true) { doreplace = "Y"; setcookie = "Y"; continueeval = "N"; var ruleset = "R"; referrer = str; } } // START myscript FUNCTION function myscript() { //Start Rewrite if (document.getElementById('PhoneDiv') != null) { var newtext = document.getElementById('PhoneDiv').innerHTML; if (ruleset == "V") { } if (ruleset == "R") { var patt = new RegExp ("google.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); } var patt = new RegExp ("bing.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); } var patt = new RegExp ("yahoo.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); } var patt = new RegExp ("yahoo.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); } var patt = new RegExp ("bing.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); } var patt = new RegExp ("google.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); } } document.getElementById('PhoneDiv').innerHTML = newtext; } if (document.getElementById('PhoneDiv1') != null) { var newtext = document.getElementById('PhoneDiv1').innerHTML; if (ruleset == "V") { } if (ruleset == "R") { var patt = new RegExp ("google.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); } var patt = new RegExp ("bing.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); } var patt = new RegExp ("yahoo.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); } var patt = new RegExp ("yahoo.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); } var patt = new RegExp ("bing.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); } var patt = new RegExp ("google.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); } } document.getElementById('PhoneDiv1').innerHTML = newtext; } if (document.getElementById('PhoneDiv2') != null) { var newtext = document.getElementById('PhoneDiv2').innerHTML; if (ruleset == "V") { } if (ruleset == "R") { var patt = new RegExp ("google.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); } var patt = new RegExp ("bing.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); } var patt = new RegExp ("yahoo.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); } var patt = new RegExp ("yahoo.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); } var patt = new RegExp ("bing.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); } var patt = new RegExp ("google.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); } } document.getElementById('PhoneDiv2').innerHTML = newtext; } if (document.getElementById('PhoneDiv3') != null) { var newtext = document.getElementById('PhoneDiv3').innerHTML; if (ruleset == "V") { } if (ruleset == "R") { var patt = new RegExp ("google.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); } var patt = new RegExp ("bing.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); } var patt = new RegExp ("yahoo.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); } var patt = new RegExp ("yahoo.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); } var patt = new RegExp ("bing.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); } var patt = new RegExp ("google.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); } } document.getElementById('PhoneDiv3').innerHTML = newtext; } if (document.getElementById('PhoneDiv4') != null) { var newtext = document.getElementById('PhoneDiv4').innerHTML; if (ruleset == "V") { } if (ruleset == "R") { var patt = new RegExp ("google.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); } var patt = new RegExp ("bing.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); } var patt = new RegExp ("yahoo.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); newtext = newtext.replace("652-7737","375-5627"); } var patt = new RegExp ("yahoo.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); } var patt = new RegExp ("bing.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); } var patt = new RegExp ("google.com","i"); if (patt.test(str)==true) { newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); newtext = newtext.replace("652.7737","375.5627"); } } document.getElementById('PhoneDiv4').innerHTML = newtext; } // alert('5'); //End Rewrite if (setcookie == "Y") { // Set cookie // We need to add a PATH substatement here to specify the ROOT directory for landing pages in directories... days=30; // number of days to keep the cookie myDate = new Date(); myDate.setTime(myDate.getTime()+(days*24*60*60*1000)); // Build a HubCookie value that includes the overridevariablevalue | referrer for later processing if they come back. document.cookie = 'HubCookie=' + overridevariablevalue + '|' + referrer + '; path=/; expires=' + myDate.toGMTString(); } } // END myscript function /* function onloadhandler() { window.onLoad = myscript(); } */ if (doreplace == "Y") { //Get browser and Page - Delay if IE and FindaLocation due to Google map conflict var browser=navigator.appName; var sPath = window.location.pathname; var sPage = sPath.substring(sPath.lastIndexOf('/') + 1); if (browser=="Microsoft Internet Explorer" && sPage == "FindaLocation.aspx") { setTimeout('myscript();', 5); } else { setTimeout('myscript();', 5); } } // End If DoReplace is Y