// TQS Code
function verifyUserIsInOurTerritory(clubNumber) { /* verify client is in our territory via ZCG, must escape the rurl for proper processing by browsers */ window.location = "http://www.aaa.com/?rclub=" + clubNumber + "&rurl=" + escape(window.location); }

function validateUserInClub(clubNumber) { 
/* This method should be used by clubs hosting pages on aaa.com that are referenced under the domains ww1.aaa.com, ww2.aaa.com and www.aaa.com since these pages will have access to the zipcode cookie written under aaa.com. */
var ourUser = false; var foundAssociation = ""; var foundClub = ""; var startIndex = 0; var pipe = ""; var cookieData = getZipCookie("zipcode"); var foundZipCode = ""; if(cookieData > "") { 
// get the zipcode 
pipe = cookieData.indexOf("|"); 
if(pipe > 4) { foundZipCode = cookieData.substring(startIndex, pipe); 
// find association 
startIndex = pipe + 1; pipe = cookieData.indexOf("|", startIndex); if(pipe > 8) {foundAssociation = cookieData.substring(startIndex, pipe); 
// get the club 
startIndex = pipe + 1; if(cookieData.length > startIndex) { foundClub = cookieData.substring(startIndex); } 
} } } 
if(foundZipCode > "" && foundAssociation > "" && foundClub > "") { 
// we have valid data 
if(foundClub == clubNumber) { 
// this is our user, keep them here. 
ourUser = true; 
}} return ourUser; } 

function validateUserInAssoc(association) { 
/* This method should be used by clubs hosting pages on aaa.com that are referenced under the domains ww1.aaa.com, ww2.aaa.com and www.aaa.com since these pages will have access to the zipcode cookie written under aaa.com. */
var ourUser = false; var foundAssociation = ""; var foundClub = ""; var startIndex = 0; var pipe = ""; var cookieData = getZipCookie("zipcode"); var foundZipCode = ""; if(cookieData > "") { 
// get the zipcode 
pipe = cookieData.indexOf("|"); 
if(pipe > 4) { foundZipCode = cookieData.substring(startIndex, pipe); 
// find association 
startIndex = pipe + 1; pipe = cookieData.indexOf("|", startIndex); if(pipe > 8) {foundAssociation = cookieData.substring(startIndex, pipe); 
// get the club 
startIndex = pipe + 1; if(cookieData.length > startIndex) { foundClub = cookieData.substring(startIndex); } 
} } } 
if(foundZipCode > "" && foundAssociation > "" && foundClub > "") { 
// we have valid data 
if(foundAssociation == association) { 
// this is our user, keep them here. 
ourUser = true; 
}} return ourUser; } 

function ACAverify(clubNumber) {
acaClub=false; if(clubNumber=="002" || clubNumber=="2" || clubNumber=="023" || clubNumber=="23" || clubNumber=="066" || clubNumber=="66" || clubNumber=="241" || clubNumber=="176" || clubNumber=="164"){ acaClub = true; } return acaClub; }
