// main category list
var topTreeArr = new Array();
topTreeArr[0] = "Community"; // legacy setting. Should be [4]
topTreeArr[1] = "Services";
topTreeArr[2] = "Jobs";
topTreeArr[3] = "For Sale";
topTreeArr[4] = "Community";
var catgTreeArr = new Array();
catgTreeArr[0] = "Auto";
catgTreeArr[1] = "Business to Business";
catgTreeArr[2] = "Community Services";
catgTreeArr[3] = "Fun & Entertainment";
catgTreeArr[4] = "Family";
catgTreeArr[5] = "Food & Dining";
catgTreeArr[6] = "Finance & Insurance";
catgTreeArr[7] = "Government";
catgTreeArr[8] = "Health";
catgTreeArr[9] = "Home Improvements";
catgTreeArr[10] = "Legal";
catgTreeArr[11] = "Personal Life Style";
catgTreeArr[12] = "Real Estate & Rentals";
catgTreeArr[13] = "Technology & Computers";
catgTreeArr[14] = "Travel";
catgTreeArr[15] = "Yard";
// sub-category list
var sp = new Array();
sp[0] = new Array(); // catgTreeArr[1] = "Auto";
sp[0][0] = "New & Used Dealerships";
sp[0][1] = "Insurance";
sp[0][2] = "Repairs";
sp[0][3] = "Driving Schools";
sp[0][4] = "Parts and Accessories";
sp[0][5] = "RV, Motocycles, etc.";
sp[0][6] = "Boats";
sp[1] = new Array();  // catgTreeArr[2] = "Business to Business";
sp[1][0] = "Advertising";
sp[1][1] = "Alarms & Security Protection";
sp[1][2] = "Business Associations";
sp[1][3] = "Business Consulting";
sp[1][4] = "Engineering Consulting";
sp[1][5] = "Financial Services";
sp[1][6] = "Jobs & Employment Services";
sp[1][7] = "Marketing";
sp[1][8] = "Office Supplies";
sp[1][9] = "Office & Facility Management";
sp[1][10] = "Shipping & Cargo Services";
sp[1][11] = "Technology Development";
sp[1][12] = "Web Design";
sp[2] = new Array(); // catgTreeArr[4] = "Community Services";
sp[2][0] = "Social Clubs";
sp[2][1] = "Business Associations";
sp[2][2] = "Government Agencies";
sp[2][3] = "Religious Organizations";
sp[2][4] = "Jobs & Employment Services";
sp[2][5] = "Training & Education";
sp[2][6] = "News & Media";
sp[2][7] = "Social Services";
sp[2][8] = "Environment & Hazard Ctrl";
sp[3] = new Array(); // catgTreeArr[5] = "Fun & Entertainment";
sp[3][0] = "Theaters";
sp[3][1] = "Sound & Video Editing";
sp[3][2] = "Multimedia Home Theaters";
sp[3][3] = "Games";
sp[3][4] = "Taxi, Bus & Limousines";
sp[3][5] = "Video Rentals";
sp[3][6] = "TV, Video & Audio Systems";
sp[3][7] = "Casinos";
sp[3][8] = "Sports & Recreation";
sp[3][9] = "Pets and animals";
sp[3][10] = "Event Organizers";
sp[3][11] = "Live Entertainment";
sp[3][12] = "Parks & Museums";
sp[4] = new Array();  // "Family Activities";
sp[4][0] = "Religious Organizations";
sp[4][1] = "Parks & Museums";
sp[4][2] = "Art & Antiques";
sp[4][3] = "Floral & Decorations";
sp[4][4] = "Gifts & Weddings";
sp[4][5] = "Gas Stations & Small Shops";
sp[4][6] = "Dry Cleaning";
sp[4][7] = "Kitchen Supplies";
sp[4][8] = "Childcare & Activities";
sp[4][9] = "Cosmetics & Beauty Shops";
sp[4][10] = "Family Counseling";
sp[4][11] = "Health Counseling";
sp[4][12] = "Engraving & Printing";
sp[4][13] = "Video & Audio Editing ";
sp[4][14] = "Office Supplies";
sp[4][15] = "Sports & Recreation";
sp[4][16] = "Pet Supplies";
sp[4][17] = "Pets Care & Veterinarians";
sp[4][18] = "Banking";
sp[4][19] = "House Keeping";
sp[4][20] = "Personal & Senior Assist.";
sp[4][21] = "Shopping";
sp[5] = new Array(); // catgTreeArr[7] = "Food & Dining";
sp[5][0] = "Restaurants";
sp[5][1] = "Catering";
sp[5][2] = "Coffee & Bakery Shops";
sp[5][3] = "Grocery Stores";
sp[5][4] = "Beer, Wine & Liquor";
sp[5][5] = "Ice Cream & Snacks";
sp[5][6] = "Pets and Animal Supplies";
sp[5][7] = "Water & Soft Drinks";
sp[6] = new Array(); // catgTreeArr[9] = "Finance & Insurance";
sp[6][0] = "Taxes, Accounting & Auditing";
sp[6][1] = "Banks & Loans";
sp[6][2] = "Billing & Asset Management";
sp[6][3] = "Insurance Agencies";
sp[6][4] = "Investment Advisors";
sp[6][5] = "Mortgage Brokers";
sp[6][6] = "Title Companies";
sp[7] = new Array();  // catgTreeArr[15] = "Government";
sp[7][0] = "Schools, K-12";
sp[7][1] = "Military";
sp[7][2] = "Universities";
sp[7][3] = "Political Consultants";
sp[7][4] = "Research Institutes";
sp[7][5] = "Federal Agencies";
sp[7][6] = "Cities & Counties";
sp[8] = new Array();  // catgTreeArr[8] = "Health";
sp[8][0] = "Healthcare Management";
sp[8][1] = "Cosmetics & Skincare";
sp[8][2] = "Dental Care";
sp[8][3] = "Family Doctors";
sp[8][4] = "Hospitals & Rapid Care";
sp[8][5] = "Internal Medicine";
sp[8][6] = "Life Style Consulting";
sp[8][7] = "Medical Labs";
sp[8][8] = "Medical Specialists";
sp[8][9] = "Pets & Veterinarians";
sp[8][10] = "Pharmacies";
sp[8][11] = "Physical Therapy";
sp[8][12] = "Sports Medicine";
sp[8][13] = "Vision Care";
sp[8][14] = "Home Health Care";
sp[9] = new Array();  // catgTreeArr[3] = "Home Improvements";
sp[9][0] = "Building Materials";
sp[9][1] = "Roofing";
sp[9][2] = "Plumbing";
sp[9][3] = "Electricity";
sp[9][4] = "Gas & Utilities";
sp[9][5] = "Irrigation";
sp[9][6] = "Collections & Antiques";
sp[9][7] = "Tiles & Floors";
sp[9][8] = "Home & Interior Design";
sp[9][9] = "General Construction";
sp[9][10] = "Carpenters";
sp[9][11] = "Landscaping";
sp[9][12] = "Furniture";
sp[9][13] = "Alarms & Security";
sp[9][14] = "Air/Water Purification";
sp[9][15] = "Pest Control";
sp[9][16] = "House Keeping";
sp[9][17] = "Appraisal & Inspection";
sp[10] = new Array(); // catgTreeArr[0] = "Legal";
sp[10][0] = "General Attorneys";
sp[10][1] = "Business Litigation";
sp[10][2] = "Building & Construction";
sp[10][3] = "Family Law";
sp[10][4] = "Real Estate";
sp[10][5] = "Taxes";
sp[10][6] = "Other Legal Services";
sp[11] = new Array(); // catgTreeArr[10] = "Personal Life Style";
sp[11][0] = "Fitness and Nutrition";
sp[11][1] = "Apparel";
sp[11][2] = "Art, Books, Music & Antiques";
sp[11][3] = "Floral & Decorations";
sp[11][4] = "Gifts & Weddings";
sp[11][5] = "Gas Stations & Small Shops";
sp[11][6] = "Dry Cleaning";
sp[11][7] = "Cosmetics & Beauty Shops";
sp[11][8] = "Family & Personal Counseling";
sp[11][9] = "Life Style";
sp[11][10] = "Engraving & Printing";
sp[11][11] = "Travel & Exploration";
sp[11][12] = "Imaging, Video & Multimedia";
sp[11][13] = "Taxi, Bus & Limousines";
sp[11][14] = "Sports & Gaming";
sp[11][15] = "Pets and animals";
sp[11][16] = "Training & Education";
sp[11][17] = "House Keeping";
sp[11][18] = "Auction";
sp[12] = new Array(); // catgTreeArr[11] = "Real Estate & Rentals";
sp[12][0] = "Realtors";
sp[12][1] = "Property Management";
sp[12][2] = "Property Developers";
sp[12][3] = "Business Parks";
sp[12][4] = "Apartments";
sp[12][5] = "Property Builders";
sp[13] = new Array(); // catgTreeArr[12] = "Computers & Technology";
sp[13][0] = "Internet & Web Services";
sp[13][1] = "Telecom & Networking";
sp[13][2] = "Computers & Electronics";
sp[13][3] = "Digital Media Services";  // sound video editing
sp[13][4] = "Engineering";
sp[13][5] = "Medicine & Biology";
sp[14] = new Array();  // catgTreeArr[13] = "Treval";
sp[14][0] = "Hotels & Motels";
sp[14][1] = "Travel Agencies";
sp[14][2] = "Bed & Breakfast";
sp[14][3] = "Restaurants";
sp[14][4] = "Taxi, Bus & Limousines";
sp[14][5] = "Tours & Attractions";
sp[14][6] = "Equipment & Car Rental";
sp[15] = new Array();  // catgTreeArr[14] = "Yard & Garden";
sp[15][0] = "Lawn Care";
sp[15][1] = "Tree Care";
sp[15][2] = "Seeds & Feeds";
sp[15][3] = "Landscaping";
sp[15][4] = "Garden Supplies";
sp[15][5] = "Pool and Spa";
sp[15][6] = "Pest Control";
// re-direct the tree structure
var mapArr = new Array();
mapArr[0] = new Array();  // for topTreeArr[0],  community
mapArr[1] = new Array();  // for topTreeArr[1],   services
mapArr[2] = new Array();  // for topTreeArr[2],  jobs
mapArr[3] = new Array();  // for topTreeArr[3],  Stuff for sale
mapArr[1][0] = new Array();  // for catgTreeArr[0] = "Attorneys";
mapArr[1][1] = new Array();  // for catgTreeArr[1] = "Automobiles";
mapArr[1][2] = new Array();  // for catgTreeArr[2] = "Business Services";
mapArr[1][3] = new Array();  // for catgTreeArr[3] = "Home Improvements";
mapArr[1][4] = new Array();  // for catgTreeArr[4] = "Community Services";
mapArr[1][5] = new Array();  // for catgTreeArr[5] = "Fun & Entertainment";
mapArr[1][6] = new Array();  // for catgTreeArr[6] = "Family Activities";
mapArr[1][7] = new Array();  // for catgTreeArr[7] = "Food & Restaurants";
mapArr[1][8] = new Array();  // for catgTreeArr[8] = "Finance & Insurance";
mapArr[1][9] = new Array();  // for catgTreeArr[9] = "Health Care";
mapArr[1][10] =new Array();  // for catgTreeArr[10] = "Personal Life Style";
mapArr[1][11] =new Array();  // for catgTreeArr[11] = "Real Estate & Rentals";
mapArr[1][12] =new Array();  // for catgTreeArr[12] ="Computers & Technologies";
mapArr[1][13] =new Array();  // for catgTreeArr[13] = "Treval & Hotels";
mapArr[1][14] =new Array();  // for catgTreeArr[13] = "Treval & Hotels";
mapArr[1][15] =new Array();  // for catgTreeArr[13] = "Treval & Hotels";
// note: when mapping the categories, don't map any sub-index [0]
//       because [0] is the default su-catg for all main categories.
//       If it gets remapped, the main category will never be selected
// Also check the %ctgMapHash_1 in gt_zip.pl
mapArr[1][0][1]   = "1, 6, 3";   //  auto insurance
mapArr[1][1][5]   = "1, 6, 2";   //  financial service
mapArr[1][1][6]   = "1, 2, 4";   //  jobs & employment
mapArr[1][1][11]  = "1,13, 2";   //  technologies
mapArr[1][1][12]  = "1,13, 0";   //  Web design
mapArr[1][2][1]   = "1, 1, 2";   // "Business associations"
mapArr[1][2][2]   = "1, 7, 6";   //  gov agencies
mapArr[1][2][3]   = "1, 4, 0";   // churches
mapArr[1][3][1]   = "1,13, 3";   // "Sound & Video Editing"
mapArr[1][3][8]   = "1, 4,15";   // "Sports & Recreations"
mapArr[1][3][9]   = "1, 4,16";   // "Pets and animals"
mapArr[1][3][12]  = "1, 4, 1";   // "Park & Museum"
mapArr[1][4][2]   = "1,11, 2";
mapArr[1][4][13]  = "1,13, 3";   // "Sound & Video Editing"
mapArr[1][4][14]  = "1, 1, 8";   //  office supply
mapArr[1][4][18]  = "1, 6, 1";   //  banking
mapArr[1][4][19]  = "1, 9,16";   //  House keeping
mapArr[1][5][6]   = "1, 4,16";   // "Pets and animals"
mapArr[1][8][9]   = "1, 4,17";   // "pets care"
mapArr[1][9][6]   = "1,11, 2";   // "art & collection"
mapArr[1][11][3]  = "1, 4, 3";   //  Florist & Decoration
mapArr[1][11][4]  = "1, 4, 4";   //  gifts & Weddings
mapArr[1][11][5]  = "1, 4, 5";   //  Gas Stations
mapArr[1][11][6]  = "1, 4, 6";   //  dry cleaning
mapArr[1][11][7]  = "1, 4, 9";   // "Cosmetics";
mapArr[1][11][8]  = "1, 4,10";   // "Family Counseling";
mapArr[1][11][10] = "1, 4,12";   // "Engraving & Printing";
mapArr[1][11][11] = "1,14, 1";   //  travel
mapArr[1][11][12] = "1,13, 3";   // "Sound & Video Editing"
mapArr[1][11][14] = "1, 4,15";   // "Sports & Recreations"
mapArr[1][11][15] = "1, 4,16";   // "Pets and animals"
mapArr[1][11][17] = "1, 9,16";   //  House keeping
mapArr[1][14][3]  = "1, 5, 0";   // "Restaurants"
mapArr[1][15][6]  = "1, 9,15";   // "Pest Control"
