var ctlist=document.Quicksearch.ct
var subcatlist=document.Quicksearch.subcat

var subcats=new Array()
subcats[0]=""
subcats[1]=["Boats","Cars","Equipment","Motorcycles","RVs","SUVs","Trucks","Vans","Other"]
subcats[2]=["Apartments","Commercial","Condos","Duplexes","Foreclosures","Homes","Land","Lofts","Studios","Other"]
subcats[3]=["Apartment","Commercial Space","Condo/Townhouse","Cabin","Duplex","House","Studio","Loft","Other"]
subcats[4]=["Appliances","Backyard Items","Beds","Bicycles","Cameras","Chairs","Clothes","Collectables/Art","Computers","Craft Supplies","Desks","Electronics","Furniture","Jewelry","Lamps","Musical Instruments","Nutritional Items","Pets","Pool Tables","Refrigerators","Sofas","Sound Systems","Sporting Goods","Tables","Tvs","Tickets","Toys","Trading Cards","Video Games","Video Recorders","Washers and Dryers","Watches","Wanted Items","Other"]
subcats[5]=["Computer","Creative","Crew","Domestic","Event","Labor","Talent","Writing"]
subcats[6]=["Accounting/Auditing",
"Administrative and Support Services",
"Advertising/Marketing/Public Relations",
"Agriculture, Forestry, & Fishing",
"Architectural Services",
"Arts, Entertainment, and Media",
"Banking",
"Biotechnology and Pharmaceutical",
"Community, Social Services, and Nonprofit",
"Construction, Mining and Trades",
"Consulting Services",
"Customer Service and Call Center",
"Education, Training, and Library",
"Employment Placement Agencies",
"Engineering",
"Finance/Economics",
"Financial Services",
"Government and Policy",
"Healthcare, Other",
"Healthcare, Practitioner and Technician",
"Hospitality/Tourism",
"Human Resources",
"Information Technology",
"Installation, Maintenance, and Repair",
"Insurance",
"Internet/E-Commerce",
"Law Enforcement, and Security",
"Legal",
"Manufacturing and Production",
"Military",
"Other",
"Personal Care and Service",
"Real Estate",
"Restaurant and Food Service",
"Retail/Wholesale",
"Sales",
"Science",
"Sports and Recreation",
"Telecommunications",
"Transportation and Warehousing"]
subcats[7]=[]
subcats[8]=["Activity Partners","Artists","Childcare","Classes/Workshops","Events/Entertainment","Garage/Moving Sales","General Community","Musicians","Pets","Ridesharing/Carpool","Volunteers"]
subcats[9]=["Women seeking Men","Men seeking Women","Women seeking Women","Men seeking Men","Casual Encounters","Missed Connections"]
subcats[10]=["Automotive","Computer","Creative","Event","Financial","Household","Labor/Move","Legal","Lessons","Real Estate","Skilled Trade","Small Biz Ads","Therapeutic"]

function updatesubcats(selection){
    subcatlist.options.length=0
    subcatlist.options[0]=new Option("Choose a Subcategory", "")
    selectedgroup=parseInt("0x"+ctlist.options[selection].value)
    if (selectedgroup>0){
        if(0==subcats[selectedgroup].length)
            subcatlist.options[0]=new Option("No Subcategories Here", "")
        for (i=0; i<subcats[selectedgroup].length; i++)
            subcatlist.options[subcatlist.options.length]=new Option(subcats[selectedgroup][i], subcats[selectedgroup][i])
    }
}

function addchoices(selection){
    if(subcatlist.options.length>1)
        return
    selectedgroup=parseInt("0x"+ctlist.options[selection].value)
    if(!selectedgroup)
        return
    if(0==subcats[selectedgroup].length){
        subcatlist.options=[new Option("No Subcategories Here", "")]
        return
    }
    for (i=0; i<subcats[selectedgroup].length; i++)
        subcatlist.options[subcatlist.options.length]=new Option(subcats[selectedgroup][i], subcats[selectedgroup][i])
}

addchoices(ctlist.selectedIndex)

