hs_CategoryID_6001 = {
"6001":"-"
}
hs_CategoryID_5330 = {
"5330":"-",
"5332":"CL",
"5335":"Integra",
"5336":"Legend",
"42600":"MDX",
"5337":"NSX",
"5334":"RL",
"31827":"RSX",
"5331":"SLX",
"5333":"TL",
"84153":"TSX",
"5338":"Vigor",
"5339":"Other Models"
}
hs_CategoryID_5340 = {
"5340":"-",
"84154":"Spider",
"5356":"Other Models"
}
hs_CategoryID_5357 = {
"5357":"-"
}
hs_CategoryID_5358 = {
"5358":"-"
}
hs_CategoryID_6002 = {
"6002":"-",
"6003":"A4",
"6004":"A6",
"6005":"A8",
"80731":"Allroad",
"43901":"Cabriolet",
"43902":"S4",
"5345":"TT",
"6055":"Other Models"
}
hs_CategoryID_6126 = {
"6126":"-"
}
hs_CategoryID_6023 = {
"6023":"-"
}
hs_CategoryID_6118 = {
"6118":"-"
}
hs_CategoryID_6006 = {
"6006":"-",
"42601":"2002",
"6007":"3-Series",
"6008":"5-Series",
"6129":"6-Series",
"6009":"7-Series",
"6130":"8-Series",
"6131":"M-Series",
"15282":"X-Series",
"36468":"Z3",
"36469":"Z4",
"36470":"Z8",
"6056":"Other Models"
}
hs_CategoryID_6135 = {
"6135":"-",
"6136":"Century",
"80732":"Electra",
"6137":"Grand National",
"6138":"LeSabre",
"6139":"Park Avenue",
"6140":"Reatta",
"6141":"Regal",
"80733":"Rendezvous",
"6142":"Riviera",
"6143":"Roadmaster",
"16124":"Skylark",
"6144":"Other Models"
}
hs_CategoryID_5347 = {
"5347":"-",
"5349":"Allante",
"43903":"CTS",
"6145":"Catera",
"6146":"DeVille",
"6147":"Eldorado",
"6148":"Escalade",
"6149":"Fleetwood",
"6151":"Seville",
"6152":"Other Models"
}
hs_CategoryID_5346 = {
"5346":"-",
"6159":"Astro",
"34429":"Avalanche",
"6160":"Bel Air/150/210",
"6154":"Blazer",
"39409":"C-10",
"6161":"Camaro",
"6162":"Caprice",
"6163":"Cavalier",
"6164":"Chevelle",
"39410":"Cheyenne",
"90965":"C/K Pickup 1500",
"90966":"C/K Pickup 2500",
"90967":"C/K Pickup 3500",
"90968":"Colorado",
"6166":"Corsica",
"6167":"Corvair",
"6168":"Corvette",
"6153":"El Camino",
"6158":"Express",
"39411":"G20 Van",
"6169":"Impala",
"6157":"Lumina",
"6170":"Malibu",
"6171":"Monte Carlo",
"6172":"Nova",
"5348":"Other pickups",
"13488":"S-10",
"13487":"Silverado 1500",
"90969":"Silverado 2500",
"90970":"Silverado 3500",
"90971":"SSR",
"6155":"Suburban",
"6156":"Tahoe",
"43904":"Tracker",
"34430":"Trailblazer",
"39412":"Venture",
"6173":"Other Models"
}
hs_CategoryID_5351 = {
"5351":"-",
"6175":"300 Series",
"6174":"Cirrus",
"31828":"Concorde",
"80734":"Crossfire",
"43905":"Imperial",
"6177":"Lebaron",
"6176":"LHS",
"43906":"Newport",
"6178":"New Yorker",
"15284":"Prowler",
"15285":"PT Cruiser",
"6179":"Royal",
"6180":"Sebring",
"5352":"Town & Country",
"6181":"Other Models"
}
hs_CategoryID_6183 = {
"6183":"-"
}
hs_CategoryID_6185 = {
"6185":"-"
}
hs_CategoryID_12478 = {
"12478":"-"
}
hs_CategoryID_6186 = {
"6186":"-",
"6187":"Z-series",
"6188":"Other Models"
}
hs_CategoryID_31830 = {
"31830":"-"
}
hs_CategoryID_6190 = {
"6190":"-"
}
hs_CategoryID_6191 = {
"6191":"-",
"43907":"Avenger",
"6193":"Caravan",
"6198":"Challenger",
"6199":"Charger",
"6200":"Coronet",
"6196":"Dakota",
"6201":"Dart",
"6192":"Durango",
"6194":"Grand Caravan",
"6202":"Intrepid",
"6203":"Lancer",
"84155":"Magnum",
"6204":"Neon",
"39413":"Power Wagon",
"31831":"Ram",
"6195":"Ram Van",
"6205":"Shadow",
"6206":"Stealth",
"6207":"Stratus",
"6209":"Viper",
"6197":"Other Pickups",
"6210":"Other Models"
}
hs_CategoryID_6214 = {
"6214":"-"
}
hs_CategoryID_6216 = {
"6216":"-"
}
hs_CategoryID_6211 = {
"6211":"-",
"84156":"360",
"6212":"Other Models"
}
hs_CategoryID_6218 = {
"6218":"-"
}
hs_CategoryID_6010 = {
"6010":"-",
"6223":"Aerostar",
"6226":"Aspire",
"6222":"Bronco",
"50065":"Bronco II",
"31832":"Contour",
"6227":"Crown Victoria",
"6224":"E-Series Van",
"31833":"Escape",
"6229":"Escort",
"31834":"Excursion",
"6011":"Expedition",
"6012":"Explorer",
"43908":"Explorer Sport",
"43909":"Explorer Sport Trac",
"6230":"Fairlane",
"6231":"Fairmont",
"6232":"Falcon",
"39414":"F-100",
"6219":"F-150",
"39415":"F-250",
"39416":"F-350",
"31835":"Focus",
"6233":"Galaxie",
"6234":"Model A",
"6235":"Model T",
"6236":"Mustang",
"6237":"Probe",
"6220":"Ranchero",
"5350":"Ranger",
"6238":"Taurus",
"6239":"Tempo",
"6240":"Thunderbird",
"31836":"Torino",
"6225":"Windstar",
"6221":"Pickups",
"6057":"Other Models"
}
hs_CategoryID_6243 = {
"6243":"-",
"43912":"Envoy",
"6246":"Jimmy",
"31837":"Safari",
"6250":"Savana",
"6244":"Sierra 1500",
"90981":"Sierra 2500",
"90982":"Sierra 3500",
"31838":"Sonoma",
"6247":"Suburban",
"6248":"Typhoon",
"6249":"Yukon",
"6251":"Other Models"
}
hs_CategoryID_6242 = {
"6242":"-"
}
hs_CategoryID_6252 = {
"6252":"-",
"6254":"Accord",
"6256":"Civic",
"6255":"CRX",
"16120":"CR-V",
"6257":"Del Sol",
"80742":"Element",
"31839":"Insight",
"6258":"Odyssey",
"31840":"Passport",
"80743":"Pilot",
"6259":"Prelude",
"6253":"S2000",
"6260":"Other Models"
}
hs_CategoryID_5342 = {
"5342":"-",
"5360":"H1",
"43913":"H2"
}
hs_CategoryID_6261 = {
"6261":"-",
"80744":"Accent",
"80745":"Elantra",
"80746":"Santa Fe",
"80747":"Sonata",
"80748":"Tiburon",
"6262":"Other Models"
}
hs_CategoryID_6263 = {
"6263":"-",
"80749":"FX",
"31841":"G20",
"43914":"G35",
"31842":"I30",
"31843":"J30",
"6264":"Q45",
"31844":"QX4",
"6265":"Other Models"
}
hs_CategoryID_31845 = {
"31845":"-",
"84157":"Scout",
"31846":"Other Models"
}
hs_CategoryID_6266 = {
"6266":"-",
"6267":"Amigo",
"6268":"Rodeo",
"6269":"Trooper",
"6270":"VehiCROSS",
"6271":"Other Models"
}
hs_CategoryID_6272 = {
"6272":"-",
"6273":"S-type",
"6274":"XJ6",
"31847":"XJ8",
"31848":"XJR",
"6275":"XJS",
"6276":"XK8",
"6277":"XKE",
"43915":"X-Type",
"6278":"Other Models"
}
hs_CategoryID_6279 = {
"6279":"-",
"6281":"Cherokee",
"6280":"CJ",
"6282":"Commando",
"6947":"Grand Cherokee",
"43916":"Liberty",
"6283":"Renegade",
"6284":"Wagoneer",
"6285":"Wrangler",
"6286":"Other Models"
}
hs_CategoryID_6289 = {
"6289":"-"
}
hs_CategoryID_6290 = {
"6290":"-"
}
hs_CategoryID_6292 = {
"6292":"-"
}
hs_CategoryID_6293 = {
"6293":"-",
"31849":"Defender",
"6294":"Discovery",
"6295":"Range Rover",
"6296":"Other Models"
}
hs_CategoryID_6297 = {
"6297":"-",
"6298":"ES",
"6299":"GS",
"43917":"GX",
"43918":"IS",
"6300":"SC",
"14240":"LS",
"13473":"LX",
"13474":"RX",
"6301":"Other Models"
}
hs_CategoryID_6302 = {
"6302":"-",
"6304":"Continental",
"31850":"LS",
"6305":"Mark Series",
"6303":"Navigator",
"31851":"Town Car",
"6306":"Other Models"
}
hs_CategoryID_6312 = {
"6312":"-"
}
hs_CategoryID_6308 = {
"6308":"-",
"80750":"MGA",
"31857":"MGB",
"31859":"Midget",
"31858":"T-Series",
"6314":"Other Models"
}
hs_CategoryID_6313 = {
"6313":"-"
}
hs_CategoryID_6310 = {
"6310":"-",
"6319":"323",
"6320":"626",
"6321":"929",
"6317":"B-Series Pickups",
"84158":"Mazda3",
"84159":"Mazda6",
"6324":"Miata",
"6325":"Millenia",
"6318":"MPV",
"6322":"MX-3",
"6323":"MX-6",
"6326":"Protege",
"6327":"RX-7",
"84160":"RX-8",
"84161":"Tribute",
"6316":"Other Models"
}
hs_CategoryID_6311 = {
"6311":"-",
"6328":"190-Series",
"6329":"200-Series",
"6330":"300-Series",
"6331":"400-Series",
"6332":"500-Series",
"6333":"600-Series",
"6334":"C-Class",
"31852":"CL-Class",
"31853":"CLK-Class",
"6335":"E-Class",
"31854":"G-Class",
"6337":"M-Class",
"6336":"S-Class",
"6338":"SL-Class",
"31855":"SLK-Class",
"6315":"Other Models"
}
hs_CategoryID_5363 = {
"5363":"-",
"5366":"Capri",
"5367":"Comet",
"6339":"Cougar",
"6340":"Grand Marquis",
"6341":"Montego",
"31856":"Monterey",
"5364":"Mountaineer",
"6342":"Mystique",
"6343":"Sable",
"6344":"Tracer",
"5365":"Villager",
"6882":"Other Models"
}
hs_CategoryID_31860 = {
"31860":"-",
"107007":"Classic Mini",
"107008":"Mini Cooper (2002-Present)",
"107009":"Mini Cooper S (2002-Present)",
"31861":"Other"
}
hs_CategoryID_6348 = {
"6348":"-",
"6350":"3000GT",
"6351":"Diamante",
"6352":"Eclipse",
"6353":"Galant",
"43919":"Lancer",
"6354":"Mirage",
"6349":"Montero",
"6355":"Other Models"
}
hs_CategoryID_31863 = {
"31863":"-"
}
hs_CategoryID_6371 = {
"6371":"-",
"6395":"200SX",
"6396":"240SX",
"6397":"280ZX",
"6398":"300ZX",
"31864":"350Z",
"6399":"Altima",
"84162":"Armada",
"6393":"Frontier",
"6400":"Maxima",
"84163":"Murano",
"6394":"Pathfinder",
"11304":"Quest",
"6401":"Sentra",
"6402":"Stanza",
"84164":"Titan",
"6403":"Xterra",
"84165":"Other Pickups",
"6392":"Other Models"
}
hs_CategoryID_6372 = {
"6372":"-",
"11305":"Alero",
"6404":"Aurora",
"11306":"Bravada",
"6405":"Cutlass",
"15287":"442",
"6406":"Eighty-Eight",
"12476":"Intrigue",
"6407":"Ninety-Eight",
"13478":"Silhouette",
"31865":"Toronado",
"6391":"Other Models"
}
hs_CategoryID_6390 = {
"6390":"-"
}
hs_CategoryID_6389 = {
"6389":"-"
}
hs_CategoryID_6388 = {
"6388":"-"
}
hs_CategoryID_6376 = {
"6376":"-",
"43920":"Acclaim",
"6409":"Barracuda",
"6410":"Duster",
"6411":"Fury",
"39417":"Grand Voyager",
"6412":"GTX",
"6413":"Neon",
"6414":"Prowler",
"43921":"Road Runner",
"6415":"Satellite",
"6416":"Sundance",
"6408":"Voyager",
"6387":"Other Models"
}
hs_CategoryID_6377 = {
"6377":"-",
"6417":"Bonneville",
"6418":"Catalina",
"6419":"Fiero",
"6420":"Firebird",
"6421":"Grand Am",
"6422":"Grand Prix",
"7244":"GTO",
"6424":"Le Mans",
"13481":"Montana",
"6425":"Sunbird",
"43922":"Sunfire",
"6426":"Tempest",
"6427":"Trans Am",
"6386":"Other Models"
}
hs_CategoryID_6013 = {
"6013":"-",
"6428":"356",
"10156":"911",
"6429":"912",
"6430":"914",
"6431":"924",
"6432":"928",
"6433":"930",
"6434":"944",
"6435":"968",
"6015":"Boxster",
"43923":"Cayenne",
"6058":"Other Models"
}
hs_CategoryID_6385 = {
"6385":"-"
}
hs_CategoryID_6384 = {
"6384":"-"
}
hs_CategoryID_6380 = {
"6380":"-",
"31866":"9-3",
"31867":"9-5",
"6383":"900",
"6437":"9000",
"6438":"Other Models"
}
hs_CategoryID_6381 = {
"6381":"-",
"80751":"L-Series",
"80752":"S-Series",
"80753":"Vue",
"6382":"Other Models"
}
hs_CategoryID_80755 = {
"80755":"-"
}
hs_CategoryID_6465 = {
"6465":"-"
}
hs_CategoryID_6466 = {
"6466":"-"
}
hs_CategoryID_6452 = {
"6452":"-",
"13484":"Forester",
"31868":"Impreza",
"31869":"Legacy",
"31870":"Outback",
"31871":"SVX",
"6467":"Other Models"
}
hs_CategoryID_6468 = {
"6468":"-"
}
hs_CategoryID_6016 = {
"6016":"-",
"6442":"4Runner",
"6444":"Avalon",
"6017":"Camry",
"6445":"Corolla",
"15288":"Celica",
"43924":"Highlander",
"6443":"Land Cruiser",
"15289":"MR2",
"6446":"Paseo",
"6440":"Previa",
"43925":"Prius",
"31872":"RAV4",
"31873":"Sequoia",
"31874":"Sienna",
"84166":"Solara",
"6447":"Supra",
"6439":"Tacoma",
"39418":"Tundra",
"6448":"Tercel",
"6059":"Other Models"
}
hs_CategoryID_6449 = {
"6449":"-",
"80756":"Spitfire",
"80757":"TR-6",
"6469":"Other Models"
}
hs_CategoryID_6018 = {
"6018":"-",
"6019":"Beetle (Pre-1998)",
"15291":"Bus/Vanagon",
"31875":"Cabrio",
"15296":"EuroVan",
"15292":"Golf",
"6021":"Jetta",
"15293":"Karmann Ghia",
"31876":"New Beetle (1998-present)",
"6020":"Passat",
"15294":"Rabbit",
"15295":"Thing",
"84167":"Touareg",
"6060":"Other Models"
}
hs_CategoryID_6454 = {
"6454":"-",
"31877":"240",
"6459":"740",
"31878":"850",
"6460":"940",
"31879":"C70",
"6461":"S40",
"47588":"S60",
"6462":"S70",
"6463":"S80",
"6464":"V70",
"31880":"XC (Cross Country)",
"6458":"Other Models"
}
hs_CategoryID_6470 = {
"6470":"-"
}
hs_CategoryID_7251 = {
"7251":"-"
}
hs_CategoryID_6472 = {
"6472":"-"
}
function swapOptions(frm, grpName, eleIndex, nbElements, arName)
{
    var n = "";
    var ctl;

    for (var i = 0; i < nbElements; i++) {
        ctl = frm.form[grpName+'['+i+']'];
        if (!ctl) {
            ctl = frm.form[grpName+'['+i+'][]'];
        }
        if (i <= eleIndex) {
            n += "_"+ctl.value;
        } else {
            ctl.length = 0;
        }
    }

    var t = eval("typeof("+arName + n +")");
    if (t != 'undefined') {
        var the_array = eval(arName+n);
        var j = 0;
        n = eleIndex + 1;
        ctl = frm.form[grpName+'['+ n +']'];
        if (!ctl) {
            ctl = frm.form[grpName+'['+ n +'][]'];
        }
        for (var i in the_array) {
            opt = new Option(the_array[i], i, false, false);
            ctl.options[j++] = opt;
        }
    }
    if (eleIndex+1 < nbElements) {
        swapOptions(frm, grpName, eleIndex+1, nbElements, arName);
    }
}

function setFieldsOnSearchForm(carBrand,carModel,distance,zipcode,submitForm)
{
	frm = document.getElementById('ebay');
	selectIndex = getIndexFromOptionValue(frm,'CategoryID[0]',carBrand);
	frm.elements['CategoryID[0]'].selectedIndex = selectIndex;
	swapOptions(frm.elements['CategoryID[0]'], 'CategoryID', 0, 2, 'hs_CategoryID');
	selectIndex = getIndexFromOptionValue(frm,'CategoryID[1]',carModel);
	frm.elements['CategoryID[1]'].selectedIndex = selectIndex;
	//selectIndex = getIndexFromOptionValue(frm,'MaxDistance',distance);
	//frm.MaxDistance.selectedIndex = selectIndex;
	//frm.PostalCode.value = zipcode;
	if(submitForm)
	{
		search(frm);
	}
}

function setCarBrandOnForm(carBrand)
{
	setFieldsOnSearchForm(carBrand,0,100,'',0);
	document.getElementById('model').className += ' error';
}

function getIndexFromOptionValue(frm,elementName,value)
{
	for (var i = 0;i<frm.elements[elementName].options.length;i++)
	{
		if (frm.elements[elementName].options[i].value == value) return i;
	}
	return 0;
}

