// // // Costco Features // // window.Costco1 = {}; // // window.Costco1.sortRegions = function (a, b) { // return a.isocodeShort - b.isocodeShort; // }; // // var toASCII = function(chars) { // var ascii = ''; // for(var i=0, l=chars.length; i= 0xFF00 && c <= 0xFFEF) { // c = 0xFF & (c + 0x20); // } // // ascii += String.fromCharCode(c); // } // // return ascii; // }; // // window.Costco1.sortAddresses = function (a, b) { // // var aTextAndInts = toASCII(a.homeAddress1).match(/[0-9.]+|[^0-9.]+/gi); // var bTextAndInts = toASCII(b.homeAddress1).match(/[0-9.]+|[^0-9.]+/gi); // // var comp0 = 0; // var comp1 = 0; // var comp2 = 0; // var comp3 = 0; // var comp4 = 0; // var comp5 = 0; // // if (aTextAndInts[0] !== undefined && bTextAndInts[0] !== undefined && // isNaN(+aTextAndInts[0]) && isNaN(+bTextAndInts[0]) ) { // comp0 = aTextAndInts[0].localeCompare(bTextAndInts[0]) // } // if (aTextAndInts[1] !== undefined && bTextAndInts[1] !== undefined && // !isNaN(+aTextAndInts[1]) && !isNaN(+bTextAndInts[1]) ) { // comp1 = aTextAndInts[1] - bTextAndInts[1] // } // if (aTextAndInts[2] !== undefined && bTextAndInts[2] !== undefined && // isNaN(+aTextAndInts[2]) && isNaN(+bTextAndInts[2]) ) { // comp2 = aTextAndInts[2].localeCompare(bTextAndInts[2]) // } // if (aTextAndInts[3] !== undefined && bTextAndInts[3] !== undefined && // !isNaN(+aTextAndInts[3]) && !isNaN(+bTextAndInts[3]) ) { // comp3 = aTextAndInts[3] - bTextAndInts[3] // } // if (aTextAndInts[4] !== undefined && bTextAndInts[4] !== undefined && // isNaN(+aTextAndInts[4]) && isNaN(+bTextAndInts[4]) ) { // comp4 = aTextAndInts[4].localeCompare(bTextAndInts[4]) // } // if (aTextAndInts[5] !== undefined && bTextAndInts[5] !== undefined && // !isNaN(+aTextAndInts[5]) && !isNaN(+bTextAndInts[5]) ) { // comp5 = aTextAndInts[5] - bTextAndInts[5] // } // // return ( // comp0 || comp1 || comp2 || comp3 || comp4 || comp5 || // toASCII(a.city).localeCompare(toASCII(b.city)) || toASCII(a.postalCode).replace(/\D/g, '') - toASCII(b.postalCode).replace(/\D/g, '') // ); // // }; // // // $(document).ready(function() { // // var slider = document.getElementById("myRange"); // var slider2 = document.getElementById("myRange2"); // var output = document.getElementById("costcoSpending"); // var output2 = document.getElementById("nonCostcoSpending"); // output.innerHTML = slider.value; // output.innerHTML2 = slider.value; // // slider.oninput = function() { // output.innerHTML = this.value; // totalRewards.innerHTML = ((slider.value *0.015) + (slider2.value *0.01))*12 ; // } // // slider2.oninput = function() { // output2.innerHTML = this.value; // totalRewards.innerHTML = ((slider.value *0.015) + (slider2.value *0.01))*12 ; // } // // // // });