function getUrl() {
	window.location = arguments[0];
}

function flash(strFile, strId, intWidth, intHeight) {
	
	document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" name=\"" + strId + "\" width=\"" + intWidth + "\" height=\"" + intHeight + "\" id=\"" + strId + "\">");
    document.write("<param name=\"movie\" value=\"_swf\/" + strFile + "\" />");
    document.write("<param name=\"quality\" value=\"high\" />");
	document.write("<param name=\"wmode\" value=\"transparent\">");
	document.write("<param name=\"menu\" value=\"false\">");
	document.write("<embed src=\"_swf\/" + strFile + "\" width=\"" + intWidth + "\" height=\"" + intHeight + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" menu=\"false\" name=\"" + strId + "\"></embed></object>");
	
}
	var brands= new Array();
	brands[0]='all'
	brands[74]='AC';
	brands[367]='Aixam';
	brands[1]='Alfa Romeo';
	brands[2]='AMC';
	brands[4]='Aston Martin';
	brands[5]='Audi';
	brands[6]='Austin';
	brands[7]='Bentley';
	brands[8]='BMW';
	brands[9]='Buick';
	brands[10]='Cadillac';
	brands[11]='Chevrolet';
	brands[12]='Chrysler';
	brands[13]='Citroën';
	brands[267]='Clenet';
	brands[14]='Daewoo';
	brands[16]='Daihatsu';
	brands[17]='Daimler';
	brands[313]='DeSoto';
	brands[18]='Dodge';
	brands[499]='Edsel';
	brands[19]='Excalibur';
	brands[20]='Ferrari';
	brands[21]='Fiat';
	brands[22]='Ford';
	brands[23]='Galloper';
	brands[118]='Ginetta';
	brands[24]='GMC';
	brands[515]='Hillman';
	brands[25]='Honda';
	brands[289]='Hummer';
	brands[26]='Hyundai';
	brands[301]='Infiniti';
	brands[28]='Iveco';
	brands[29]='Jaguar';
	brands[30]='JDM';
	brands[31]='Jeep';
	brands[33]='Kia';
	brands[309]='Koenigsegg';
	brands[34]='Lada';
	brands[35]='Lamborghini';
	brands[36]='Lancia';
	brands[37]='Land Rover';
	brands[38]='Lexus';
	brands[39]='Lincoln';
	brands[551]='Lola';
	brands[40]='Lotus';
	brands[353]='Marcos';
	brands[41]='Maserati';
	brands[42]='Mazda';
	brands[43]='Mercedes-Benz';
	brands[429]='Mercury';
	brands[44]='MG';
	brands[336]='Microcar';
	brands[45]='Mini';
	brands[46]='Mitsubishi';
	brands[47]='Morgan';
	brands[48]='Morris';
	brands[49]='Nissan';
	brands[452]='NSU';
	brands[50]='Oldsmobile';
	brands[51]='Opel';
	brands[52]='Peugeot';
	brands[53]='Plymouth';
	brands[54]='Pontiac';
	brands[55]='Porsche';
	brands[56]='Renault';
	brands[57]='Rolls-Royce';
	brands[147]='Rover';
	brands[59]='Saab';
	brands[61]='Seat';
	brands[62]='Skoda';
	brands[63]='smart';
	brands[64]='Ssang Yong';
	brands[312]='Studebaker';
	brands[65]='Subaru';
	brands[66]='Suzuki';
	brands[67]='Think';
	brands[68]='Toyota';
	brands[349]='Trabant';
	brands[69]='Triumph';
	brands[167]='TVR';
	brands[70]='Volkswagen';
	brands[71]='Volvo';
	brands[555]='Wiesmann';
	brands[512]='Willys';

	var brandModels= new Array();
	brandModels[74] = new Array('2996:Cobra','3470:Superblower');
	brandModels[367] = new Array('6185:400','6184:500','6076:A721','6075:A741','6077:Scouty');
	brandModels[1] = new Array('1351:145','1352:146','1353:147','1354:155','1355:156','6237:159','1356:164','1357:166','1358:33','1359:75','6687:Brera','3426:GT','1365:GTV','1366:Spider');
	brandModels[2] = new Array('2997:Pacer');
	brandModels[4] = new Array('1373:DB7','3427:DB9','2441:Lagonda','1376:Virage','1375:Vantage','1374:Vanquish');
	brandModels[5] = new Array('1383:A2','1384:A3','1391:S3','1385:A4','1392:S4','1390:RS4','1386:A6','1393:S6','2927:RS6','1388:Allroad','6192:Q7','1387:A8','7265:R8','1394:S8','1395:TT','1381:80','1382:90','2933:Coupé','2601:Cabrio','2631:S2','1377:100','2689:V8');
	brandModels[6] = new Array('1397:Healey','6239:Seven');
	brandModels[7] = new Array('1399:Continental','3425:Eight','1400:Mulsanne','5913:S1','6119:T1','2928:Turbo R');
	brandModels[8] = new Array('3819:1-serien','2029:3-serien','2032:5-serien','5657:6-serien','2423:7-serien','3429:X-serien','1420:Z-serien','2573:8-serien','6982:3.0','3818:116','3818:118','3819:120','3819:130','2027:316','2027:318','2029:320','2029:323','3547:324','2029:325','2358:328','2027:330','6833:335','1416:M3','3429:X3','2402:518','2032:520','2032:523','2032:525','2032:528','2032:530','2032:535','2035:540','3434:545','2392:550','1417:M5','3429:X5','5382:M6','5657:630','2934:633','2332:635','5657:645','6220:650','2549:728','2423:730','3167:733','2447:735','2403:740','2423:745','2447:750','2447:760','2430:840','2573:850','1420:Z3','1420:Z4','1421:Z8','2938:Alpina','6315:M1');
	brandModels[9] = new Array('1423:Century','3001:Electra','3002:GS','6905:Invicta','1424:Le Sabre','1425:Park Avenue','1426:Regal','2677:Riviera','2478:Roadmaster','3556:Super');
	brandModels[10] = new Array('6326:BLS','3567:Coupe de Ville','3340:CTS','1429:De Ville','2791:Eldorado','2539:Escalade','2366:Fleetwood','3478:Serie 62','1430:Seville','3442:SRX','6089:STS','3441:XLR');
	brandModels[11] = new Array('1431:Alero','1433:Astro','1434:Beauville','3341:Bel Air','1435:Beretta','1436:Blazer','3482:C6','1437:Camaro','1439:Caprice','6756:Captiva','1440:Cavalier','3172:Chevelle','1443:Corsica','3479:Corvair','1444:Corvette','4250:El Camino','6710:Epica','5218:Evanda','3511:Equinox','4247:Fleetline','3173:G20','5836:HHR','2815:Impala','5217:Kalos','5219:Lacetti','1446:Lumina','1447:Malibu','5216:Matiz','1448:Monte Carlo','7209:Nova','5220:Nubira','2941:Prizm','1450:Sport Van','1452:Suburban','5221:Tacuma','1453:Tahoe','2432:TrailBlazer','1454:Trans Sport','5275:Uplander','1455:Van','2943:Venture','5831:Special');
	brandModels[12] = new Array('3443:300-serien','1458:Voyager-serien','4552:300','3443:300C','1456:300M','2945:Cirrus','3432:Crossfire','3174:Imperial','1459:Le Baron','1460:Neon','3464:Newport','1461:New Yorker','3500:Pacifica','3342:Prowler','1464:PT Cruiser','3004:Saratoga','1465:Sebring','1466:Stratus','1458:Town & Country','1467:Vision','1458:Voyager','1458:Grand Voyager');
	brandModels[13] = new Array('1471:AX','1472:Berlingo','1473:BX','6354:C1','3420:C2','1474:C3','5184:C4','1475:C5','6625:C6','2948:C8','1476:CX','1477:Evasion','1479:Jumper','1480:Jumpy','1481:Picasso','3541:Pluriel','3459:Prestige','1482:Saxo','1484:Xantia','1485:XM','1486:Xsara','1487:ZX');
	brandModels[267] = new Array('5108:Cabriolet');
	brandModels[14] = new Array('3234:Evanda','3232:Kalos','3444:Lacetti','1491:Lanos','1492:Leganza','1493:Matiz','1496:Nubira','3233:Tacuma');
	brandModels[16] = new Array('1501:Charade','1506:Terios');
	brandModels[17] = new Array('1509:Doublesix','2960:XJ');
	brandModels[313] = new Array('3487:Firedome','3518:Golden Adventure');
	brandModels[18] = new Array('2966:Avenger','3175:B250','3176:B350','6815:Caliber','2475:Caravan','1514:Grand Caravan','3491:Challenger','3007:Charger','4255:Coronet','6284:Custom Royal','3513:Dart','1513:Durango','2965:Intrepid','4534:Luxery Line','4271:Magnum','7074:Nitro','3509:Polara','6454:Standard','2655:Van','2788:Viper');
	brandModels[499] = new Array('6269:Pacer');
	brandModels[19] = new Array('3177:Roadster');
	brandModels[20] = new Array('1519:308','1520:328','6505:330','1521:348','1522:355','1523:360','2974:400','1525:456','1526:512','1527:550','2978:575','7053:599','3445:612','2971:F40','4559:F430','2968:F50','4427:Dino','2977:Enzo','2970:Mondial','3503:Testarossa');
	brandModels[21] = new Array('7027:124','3009:127','3010:128','3345:130','5285:600','1532:Barchetta','1534:Brava','1535:Bravo','2984:Cinquecento','1536:Coupé','1537:Croma','1538:Doblo','1539:Ducato','6666:Grande Punto','3446:Idea','1540:Marea','1541:Multipla','2981:Palio','1542:Panda','1543:Punto','1546:Scudo','2980:Seicento','2985:Stilo','2983:Strada','1548:Tipo','2982:Ulysse');
	brandModels[22] = new Array('6822:A-Ford','1551:Aerostar','2801:Anglia','1554:Cougar','4562:Country','1555:Courier','3013:Crown Victoria','1558:Escort','1559:Excursion','1560:Expedition','2661:Express','1561:Explorer','3465:Fairlane','3401:Falcon','1564:Fiesta','1565:Focus','5506:Focus C-Max','3517:Fordor','3456:Freestar','5328:Freestyle','2931:Fusion','6916:Galaxie','1566:Galaxy','1567:Granada','5172:GT','1568:Ka','2990:Maverick','3179:Mercury','1569:Mondeo','1570:Mustang','1571:Orion','1572:Probe','1573:Puma','6320:S-Max','1575:Scorpio','1576:Sierra','3447:StreetKa','7557:Super','3180:T-Ford','1578:Taurus','1579:Thunderbird','6099:Torino','2988:Tourneo','1580:Transit','6665:Tudor','1581:Van','2453:Windstar','7321:Zephyr');
	brandModels[23] = new Array('1583:Exceed');
	brandModels[118] = new Array('4527:G34');
	brandModels[24] = new Array('2991:Envoy','1589:Typhoon','3018:Van','1591:Yukon');
	brandModels[515] = new Array('6456:Super Minx');
	brandModels[25] = new Array('1592:Accord','1594:Civic','2454:Concerto','1595:CR-V','1596:CRX','3516:Del Sol','5564:FR-V','1597:HR-V','3882:Integra','1599:Jazz','1600:Legend','1601:Logo','1602:NSX','1603:Prelude','1605:S2000','1606:Shuttle','1607:Stream');
	brandModels[289] = new Array('3265:H1','3266:H2','5729:H3');
	brandModels[26] = new Array('1608:Accent','1610:Atos','5096:Centennial','1611:Coupé','1612:Elantra','5078:Galloper','2770:Getz','6877:Grandeur','1614:H-1','7623:i30','1617:Matrix','1618:Pony','1619:Santa Fe','1621:Sonata','3463:Starex','1622:Terracan','1623:Trajet','4396:Tucson','1624:XG');
	brandModels[301] = new Array('3414:G35','3415:FX35','3416:FX45','4124:QX56');
	brandModels[28] = new Array('2688:35-10','1628:Daily');
	brandModels[29] = new Array('1631:Daimler','3024:E-Type','3507:MK II','3508:MK VII','1632:S-Type','3023:X-Type','1634:XJ','1638:XK');
	brandModels[30] = new Array('5434:Abaca');
	brandModels[31] = new Array('1648:Wrangler','7077:Wrangler Unlimited','1644:Cherokee','1646:Grand Cherokee','6114:Commander','1645:Comanche','7079:Compass','7078:Patriot');
	brandModels[33] = new Array('3181:Carens','1653:Carnival','7048:Cee´d','4509:Cerato','1654:Clarus','1656:Magentis','3431:Opirus','3448:Picanto','1657:Pregio','1658:Pride','7354:Retona','1659:Rio','1660:Sephia','1661:Shuma','3026:Sorento','1662:Sportage');
	brandModels[309] = new Array('3450:CC');
	brandModels[34] = new Array('3028:111','3029:112','6087:Kalina','1668:Niva');
	brandModels[35] = new Array('1671:Countach','3032:Diablo','3182:Espada','3033:Gallardo','3034:Murciélago');
	brandModels[36] = new Array('1672:A112','1674:Dedra','1676:Kappa','1678:Thema','3038:Thesis','3037:Y');
	brandModels[37] = new Array('1682:Defender','1683:Discovery','1684:Freelander','1685:Range Rover','7013:Range Rover Sport');
	brandModels[38] = new Array('2264:GS','2266:IS','1690:LS','4252:LX','6590:GX','2268:RX','2773:SC');
	brandModels[39] = new Array('3041:Continental','3042:LS','2444:Mark','2540:Navigator','1694:Town Car');
	brandModels[551] = new Array('6848:T70');
	brandModels[40] = new Array('4397:Eclat','1696:Elise','2553:Esprit','3043:Excel');
	brandModels[353] = new Array('4403:Coupe');
	brandModels[41] = new Array('1698:222','3350:228','1699:3200','1702:Biturbo','3045:Coupé','1703:Ghibli','5674:Gran Sport','1707:Spyder','1706:Quattroporte');
	brandModels[42] = new Array('1708:121','3049:2','3419:3','1709:323','5722:5','1717:6','1710:626','1711:929','6627:CX-7','1715:Demio','1716:E2000','3046:E2200','3575:Miata','1718:MPV','1719:MX-3','1720:MX-5','1721:MX-6','1722:Premacy','1724:RX-7','3047:RX-8','1725:Tribute','1726:Xedos 6','3048:Xedos 9');
	brandModels[43] = new Array('2312:A-Klass','2037:C-Klass','2290:E-Klass','2468:S-Klass','2312:A','5521:B','2037:C','1731:CL','2037:CLK','4359:CLS','2290:E','1734:G','6487:GL','2469:ML','6202:R','2468:S','2468:SL','2468:SLK','2468:SLR','2528:V','1739:Sprinter','2464:Vaneo','3492:Viano','1741:Vito','3481:113','4259:170','3552:180','1727:190','2324:200','2467:220','2294:230','3052:240','2434:250','3053:260','3560:270','2466:280','2531:290','2319:300','2313:320','3054:350','3055:380','3056:400','2678:420','2785:450','2485:500','2810:560','2749:600','3489:100');
	brandModels[429] = new Array('5700:Grand Marquis','6155:Monterey','7548:Park Lane');
	brandModels[44] = new Array('3057:MGA','3058:MGB','3059:MGC','1743:MGF','3062:TF','3060:ZR','3061:ZT');
	brandModels[336] = new Array('4138:MC1');
	brandModels[45] = new Array('1745:Cooper','1746:One');
	brandModels[46] = new Array('1761:Space-serien','1747:3000 GT','1749:Carisma','1750:Colt','4208:Pinin','1751:Eclipse','1752:Galant','3473:Grandis','3812:L300','1756:Lancer','3263:Outlander','1757:Pajero','1759:Sigma','3064:Space Gear','1760:Space Runner','1761:Space Star','1761:Space Wagon');
	brandModels[47] = new Array('3067:4/4','1765:Plus 4','1766:Plus 8');
	brandModels[48] = new Array('1768:Minor','6618:Eight');
	brandModels[49] = new Array('1770:200 SX','1773:300 ZX','3068:350 Z','1774:Almera','1776:Bluebird','3502:Kubistar','1780:Maxima','1781:Micra','3488:Murano','6330:Note','3455:Pathfinder','1782:Patrol','1783:Prairie','1784:Primera','4123:Primastar','1785:Serena','3070:Silvia','3069:Skyline','1787:Sunny','1788:Terrano','7100:Qashqai','5875:Quest','1789:X-Trail');
	brandModels[452] = new Array('6821:1200');
	brandModels[50] = new Array('3510:98','5309:Custom Cruise','1792:Cutlass','1793:Delta','6910:Dynamic 88','6904:Ninety-Eight','3073:Silhouette','6069:Super 88');
	brandModels[51] = new Array('5602:4-14','1795:Agila','7043:Antara','1797:Ascona','1798:Astra','1799:Calibra','1800:Campo','1801:Combo','1803:Corsa','1804:Frontera','4626:GT','1805:Kadett','3077:Meriva','1807:Monterey','1809:Movano','1810:Omega','1811:Rekord','1812:Senator','3076:Signum','1813:Sintra','1814:Speedster','1815:Tigra','1816:Vectra','2329:Vivaro','1817:Zafira');
	brandModels[52] = new Array('1818:106','6287:107','1819:205','1820:206','6486:207','1822:306','1823:307','1824:309','1825:405','1826:406','4272:407','2696:504','1828:605','1829:607','1830:806','3078:807','5583:1007','1832:Boxer','2442:Expert','1833:Partner','3157:J5');
	brandModels[53] = new Array('4537:Coupe','6043:Fury','3079:Prowler','7210:Road Runner','4402:Special Deluxe','1835:Grand Voyager');
	brandModels[54] = new Array('1838:Bonneville','4239:Catalina','3436:Chieftain','1839:Fiero','1840:Firebird','3082:Grand Am','3506:Grand Le Mans','2255:Grand Prix','4254:GTO','5828:Le Mans','6167:Solstice','3081:Sunfire','5206:Starchief','3866:Streamline','1841:Trans Am','1842:Trans Sport');
	brandModels[55] = new Array('1853:911-serien','1843:356','1844:911','1847:924','1848:928','1850:944','3187:959','3528:964','1851:968','1852:993','1853:996','4376:997','1855:Boxster','6193:Cayman','5931:Carrera','3083:Cayenne');
	brandModels[56] = new Array('1868:Clio','1869:Espace','1870:Express','1872:Kangoo','1873:Laguna','1874:Master','1875:Mégane','5574:Modus','3084:Safrane','1876:Scénic','3351:Spider','1877:Trafic','1878:Twingo','3130:4','1866:5','1861:17','1863:19');
	brandModels[57] = new Array('3086:Corniche','3190:Phantom','3188:Silver Cloud','1880:Silver Shadow','3088:Silver Spirit','3089:Silver Spur');
	brandModels[147] = new Array('2852:25','2853:45','2854:75','3977:Streetwise','2851:Tourer','2840:200','2838:214','2839:216','3093:400','2842:416','2843:420','2845:620','3091:820','2847:825','6513:3500');
	brandModels[59] = new Array('1889:9-3','6034:93','1890:9-5','5734:9-7X','2435:90','3191:96','1893:99','1891:900','1892:9000','5969:Sonett');
	brandModels[61] = new Array('1896:Alhambra','3474:Altea','7191:Altea XL','1898:Arosa','1899:Cordoba','1901:Ibiza','1902:Inca','1903:Leon','1904:Toledo');
	brandModels[62] = new Array('2695:130','1906:Fabia','1908:Felicia','1909:Octavia','6796:Roomster','2316:Superb');
	brandModels[63] = new Array('3097:Cabriolet','3096:Coupé','3098:crossblade','3475:forfour','3498:fortwo','3550:Passion','3551:Pulse','3099:roadster');
	brandModels[64] = new Array('7004:Actyon','6318:Kyron','1914:Musso','1915:Rexton','7002:Rexton II','6319:Rodius');
	brandModels[312] = new Array('4539:Avanti','3467:Hawk');
	brandModels[65] = new Array('3762:1800','1918:Forester','1919:Impreza','1921:Legacy','2563:SVX','6907:Tribeca','3461:Outback','3102:XT');
	brandModels[66] = new Array('1923:Alto','1925:Baleno','1927:Ignis','1928:Jimny','1929:Liana','1930:SJ Samurai','1932:Swift','6508:SX4','1933:Vitara','1926:Grand Vitara','7362:Grand Vitara XL-7','1934:Wagon R+');
	brandModels[67] = new Array('1936:City');
	brandModels[68] = new Array('MG19:Land Cruiser-serien','1937:4-Runner','7322:Auris','1939:Avensis','2277:Avensis Verso','6166:Aygo','1940:Camry','1941:Carina','1942:Celica','1943:Corolla','2279:Corolla Verso','1945:Dyna','6346:FJ Cruiser','1946:Hiace','525232:Highlander','1999:HILUX','526353:iQ','1949:Land Cruiser','2284:Model F','1950:MR2','3505:Paseo','1951:Picnic','1952:Previa','1953:Prius','1954:RAV4','4125:Sienna','1955:Starlet','1956:Supra','526355:Urban Cruiser','6570:Verso','1958:Yaris','2278:Yaris Verso','610068:Övrigt');
	brandModels[349] = new Array('4366:P60');
	brandModels[69] = new Array('3270:TR');
	brandModels[167] = new Array('3105:350i','7026:2500M','3107:Chimaera');
	brandModels[70] = new Array('1964:New Beetle','1965:Bora','1966:Bubbla','1967:Caddy','1968:Caravelle','6552:Eos','6298:Fox','1971:Golf','1972:Jetta','1974:Lupo','2448:Multivan','1975:Passat','3109:Phaeton','1976:Polo','1979:Sharan','2697:Taro','3110:Touareg','3111:Touran','1980:Transporter','3779:Variant','1982:Vento');
	brandModels[71] = new Array('1983:100-serien','1991:200-serien','3590:300-serien','1998:400-serien','2001:700-serien','2007:800-serien','2571:900-serien','2015:XC-serien','5998:C30','2018:S40','2023:V40','3476:V50','2019:S60','2020:S70','2024:V70','3484:V70XC','2015:XC70','2014:C70','2021:S80','2022:S90','2025:V90','2015:XC90','1983:142','1984:144','1985:145','1988:240','1989:242','1990:244','1991:245','3590:300','1997:360','1998:440','2567:445','1998:460','2000:480','2001:740','2002:744','2003:745','2004:760','2005:780','2006:850','2006:854','2007:855','2571:940','2571:944','2010:945','2571:960','2009:964','2571:965','2012:Amazon','3192:P 1800','2017:PV');
	brandModels[555] = new Array('6888:MF3');
	brandModels[512] = new Array('6380:Jeep','6384:Knight');
	var ModelTypes= new Array();


function check_submit(form) {
   if (form.model_id[form.model_id.selectedIndex].value.length > 0) {
	   form.model.value=form.model_id[form.model_id.selectedIndex].text;
   } else {
 		form.model.value = "";
}
  return true;
}

function selectBrand(brand_id)
{
var model_def = "Alla modeller";



// Sätter märkesnamnet
  document.carform.marke.value=brands[brand_id];
  // Markera det valda märket
  for(i = 0; i < document.carform.brand_id.length; i++) {
    if (document.carform.brand_id.options[i].value==brand_id) {
      document.carform.brand_id.selectedIndex=i;
      break;
    }
  }

  // Plocka fram alla modeller som det märket har
  var models=brandModels[brand_id]
  if (models) {
    document.carform.model_id.options.length = models.length+1;
    document.carform.model_id.options[0].text=model_def;
    document.carform.model_id.options[0].value="";
    for(i = 0; i < models.length; i++) {
      document.carform.model_id.options[i+1].value = models[i].substr(0,models[i].indexOf(':'));
      document.carform.model_id.options[i+1].text  = models[i].substr(models[i].indexOf(':')+1,models[i].length);
    }
    document.carform.model_id.options.selectedIndex = 0;
  } else {
    document.carform.model_id.options.length = 1;
    document.carform.model_id.options[0].text = model_def;
    document.carform.model_id.options[0].value = "";
  }
   if (document.carform.model.value.length > 0) {
	   selectModel(document.carform.model.value);
	}
}

function selectBrandName(brand)
// Letar reda på namnet väljer den och anropar sedan selectBrand
{
  for(i = 0; i < document.carform.brand_id.length; i++) {
    if (document.carform.brand_id.options[i].text==brand) {
      document.carform.brand_id.selectedIndex=i;
      selectBrand(document.carform.brand_id.options[i].value);
      return;
    }
  }
  // Om den inte hittade någon
  document.carform.brand_id.selectedIndex=0;
  selectBrand(0);
}

function selectModelId(model_id)
{
  //alert("SelectModelId:"+model_id);
  if (document.carform.model_type_id) {
    // Plocka fram alla modell beteckningar som det märket har
    var model_types=ModelTypes[model_id];
    if (model_types) {
      document.carform.model_type_id.options.length = model_types.length+1;
      document.carform.model_type_id.options[0].text=modeltype_line;
      document.carform.model_type_id.options[0].value=modeltype_line_value;
      for(i = 0; i < model_types.length; i++) {
        document.carform.model_type_id.options[i+1].value = model_types[i].substr(0,model_types[i].indexOf(':'));
		document.carform.model_type_id.options[i+1].text  = model_types[i].substr(model_types[i].indexOf(':')+1,model_types[i].length)
      }
    } else {
      document.carform.model_type_id.options.length = 1;
      document.carform.model_type_id.options[0].text=modeltype_line;
      document.carform.model_type_id.options[0].value=modeltype_line_value;
    }
  }
}

function selectModel(model_name)
// Letar reda på namnet väljer den och anropar sedan selectModelId
{
  re = /(.*)\(.*\)/;
  for(i = 0; i < document.carform.model_id.length; i++) {
    
    if (document.carform.model_id.options[i].text.replace(re,"$1").replace(/\s*$/,"")==model_name) {
      document.carform.model_id.selectedIndex=i;
      selectModelId(document.carform.model_id.options[i].value);
      return;
    }
  }
  // Om det inte hittade någon
  document.carform.model_id.selectedIndex=0;
  selectModelId(0);
}

function selectModelType(model_type_name)
{
  for(i = 0; i < document.carform.model_type_id.length; i++) {
    if (document.carform.model_type_id.options[i].text==model_type_name) {
      document.carform.model_type_id.options[i].selected=1;
      return;
    }
  }
  document.carform.model_type_id.selectedIndex=0;
}

try { 
  if (document.carform.brand_id.selectedIndex <1) {
    selectBrandName(document.carform.marke.value);
} else {
    selectBrand(document.carform.brand_id.value);
}
} catch(e) {
  try {
    selectBrand(document.carform.brand_id.value);
  } catch(e) {
  }
}


try { // Back-knappen
  //alert("Model_strict:"+document.carform.model_strict.value);
  //alert("Model_only:"+document.carform.model_only.value);
  //alert("Model_temp:"+document.carform.model_temp.value);
  selectModel(document.carform.model.value);
} catch(e) {
}

// try {
//   if (document.carform.model_id.selectedIndex <1)
//     selectModel(document.carform.model_strict.value);
//   else
//     selectModelId(document.carform.model_id.value);
// } catch(e) {
//   try {
//     selectModelId(document.carform.model_id.value);
//   } catch(e) {
//     try {
//       selectModel(document.carform.model.value);
//     } catch(e) {
//     }
//   }
// }

// Markera den valda modellen beteckningen
try {
  selectModelType(document.carform.model.value);
} catch(e) {
}
