var models_array = [];models_array[77] = '1275: Regular Size Car:0*1280:All Other Freight:1*1277:Atv:0*1281:Boat:1*1279:Golf Cart:0*1282:Heavy Equipment:1*1278:Motorcycle:0*1284:R/V Motorhome:1*1283:Specialized Quote Request:1';
models_array[81] = '1297:Cobra:0';
models_array[1] = '1204: Regular Size Car:0*2:2.2CL:0*3:2.3CL:0*8:2.5TL:0*4:3.0CL:0*5:3.2CL:0*9:3.2TL:0*6:3.5RL:0*1369:CL:0*11:Integra:0*12:Legend:0*13:MDX:0*14:NSX:0*15:RDX:0*7:RL:0*16:RSX:0*17:SLX:0*10:TL:0*18:TSX:0*19:Vigor:0';
models_array[2] = '1205: Regular Size Car:0*20:164:0*21:GTV:0*22:GTV-6:0*23:Milano:0*24:Spider:0*25:Spider Veloce:0';
models_array[3] = '1206: Regular Size Vehicle:0*30:Cherokee:0*28:CJ5:0*29:CJ7:0*31:Comanche:0*32:Concord:0*33:Eagle:0*35:Grand Wagoneer:0*1285:Javelin:0*1288:Rambler:0*38:Scrambler:0*40:Wagoneer:0*41:Wrangler:0';
models_array[4] = '1207: Regular Size Car:0*42:DB7:0*1374:DB7 Vantage:0*43:DB9:0*44:DBS:0*1376:V12 Vanquish:0*1377:V8 Vantage:0*45:Vanquish:0*1375:Vanquish S:0*46:Vantage:0*47:Virage:0';
models_array[5] = '1208: Regular Size Car:0*48:100:0*49:200:0*50:4000:0*51:5000:0*52:80:0*53:90:0*54:A3:0*55:A4:0*1380:A4 (Early 2005):0*1378:A4 Avant:0*1379:A4 Avant (Early 2005):0*56:A5:0*57:A6:0*1381:A6 Avant:0*58:A8:0*1382:A8 L:0*1384:allroad:0*1385:Allroad:0*1383:allroad quatro:0*59:Allroad Quattro:0*60:Cabriolet:0*61:Coupe:0*1386:Q5:0*62:Q7:0*63:Quattro:0*64:R8:0*65:RS 4:0*66:RS 6:0*1387:RS6:0*67:S4:0*1390:S4 (Early 2005):0*1388:S4 Avant:0*1389:S4 Avant (Early 2005):0*68:S5:0*69:S6:0*1391:S6 Avant:0*70:S8:0*71:TT:0*1392:TTS:0*72:V8 Quattro:0';
models_array[82] = '1302:All Cars:0';
models_array[78] = '1287:All Cars:0';
models_array[6] = '1209: Regular Size Car:0*73:Convertible:0*74:Coupe:0*75:Sedan:0';
models_array[7] = '1210: Car:0*76:Arnage:0*77:Azure:0*78:Bentley:0*79:Brooklands:0*80:Continental:0*1363:Continental Flying Spur:0*1394:Continental GTC:0*1393:Continetal GT:0*81:Corniche:0*82:Mulsanne:0*1286:R Type:0';
models_array[8] = '1211: Regular Size Car:0*1395:1-Series:0*84:128i:0*85:135i:0*1306:3-Series:0*1396:3-Series Sports Wagon:0*87:318i:0*88:318iC:0*89:318iS:0*90:318ti:0*91:320i:0*92:323ci:0*93:323i:0*95:323ic:0*96:323is:0*94:323iT:0*97:325:0*98:325Ci:0*99:325e:0*100:325i:0*101:325iC:0*104:325is:0*102:325iT:0*103:325iX:0*105:325xi:0*106:325xiT:0*107:328Ci:0*108:328i:0*109:328iC:0*110:328iS:0*111:328xi:0*112:330Ci:0*113:330i:0*114:330xi:0*115:335i:0*116:335xi:0*1307:5-Series:0*1397:5-Series Sports Wagon:0*118:524td:0*119:525i:0*120:525iT:0*121:525xi:0*122:528e:0*123:528i:0*124:528iT:0*125:528xi:0*126:530i:0*127:530iT:0*128:530xi:0*129:533i:0*130:535i:0*131:535xi:0*132:540i:0*133:540iT:0*134:545i:0*135:550I:0*1308:6-Series:0*137:633CSi:0*138:635CSi:0*139:645Ci:0*140:650CI:0*141:650CIC:0*1309:7-Series:0*143:733i:0*144:735i:0*145:735iL:0*146:740i:0*147:740iL:0*149:745i:0*148:745Li:0*151:750i:0*152:750iL:0*150:750Li:0*154:760i:0*153:760Li:0*1359:8-Series:0*156:840Ci:0*158:850Ci:0*157:850CSi:0*159:850i:0*161:L6:0*162:L7:0*164:M Coupe:0*165:M Roadster:0*167:M3:0*168:M5:0*169:M6:0*171:X3:0*1398:X3-Series:0*172:X5:0*1399:X5-Series:0*173:X6:0*1400:X6-Series:0*1335:Z-4 Series:0*175:Z3-Series:0*176:Z4:0*1402:Z4 M:0*1401:Z4-Series:0*177:Z8:0*1403:Z8-Series:0';
models_array[9] = '1212: Regular Size Car:0*178:Century:0*179:Electra:0*180:Enclave:0*182:Grand National:0*183:LaCrosse:0*184:LeSabre:0*185:Lucerne:0*186:Park Avenue:0*187:Rainier:0*188:Reatta:0*189:Regal:0*190:Rendezvous:0*191:Riviera:0*192:Roadmaster:0*193:Skyhawk:0*194:Skylark:0*195:Somerset:0*196:Terraza:0';
models_array[10] = '1213: Regular Size Car:0*197:Allante:0*198:Brougham:0*200:Catera:0*201:Cimarron:0*199:CTS:0*1404:CTS-V:0*203:DeVille:0*1406:DeVille DHS:0*1405:DeVille DTS:0*202:DTS:0*204:Eldorado:0*205:Escalade:0*206:Escalade ESV:0*207:Escalade EXT:0*1407:Escalade Hybrid:0*208:Fleetwood:0*211:Seville:0*209:SRX:0*210:STS:0*1408:STS-V:0*212:XLR:0*1409:XLR-V:0';
models_array[11] = '1214: Regular Size Car:0*213:Astro:0*1410:Astro Cargo Van:0*1411:Astro Passenger:0*214:Avalanche:0*215:Aveo:0*1412:Aveo5:0*216:Beretta:0*217:Blazer:0*1413:C 3500 HD:0*1423:C/K 2500:0*1424:C/K 3500:0*218:Camaro:0*219:Caprice:0*1351:Caprice Classic:0*220:Cavalier:0*221:Celebrity:0*1686:Chevelle:0*222:Chevette:0*223:Citation:0*224:Cobalt:0*1120:Colorado:0*1122:Colorado Crew Cab:0*1121:Colorado Ext Cab:0*226:Corsica:0*227:Corvette:0*228:El Camino:0*229:Equinox:0*1417:Express:0*1418:Express Cargo Van:0*1420:Express Commercial Cutaway:0*1419:Express Passenger:0*1421:Express RV Cutaway:0*1422:Express Van:0*1124:Express Van Ext:0*1123:Express Van Reg:0*232:HHR:0*233:Impala:0*235:Lumina:0*236:Lumina APV:0*234:LUV:0*237:Malibu:0*1415:Malibu Classic:0*1414:Malibu Hybrid:0*1416:Malibu Maxx:0*238:Metro:0*239:Monte Carlo:0*1427:New Tahoe:0*240:Nova:0*1135:Pickup crew cab long bed:0*1136:Pickup crew cab short bed:0*1140:Pickup Dually crew cab:0*1141:Pickup Dually reg cab:0*1134:Pickup ext cab long bed:0*1133:Pickup ext cab short bed:0*1132:Pickup reg cab long bed:0*1131:Pickup reg cab short bed:0*242:Prizm:0*1425:S-10:0*243:S10 Blazer:0*244:S10 Pickup:0*249:Spectrum:0*250:Sprint:0*245:SSR:0*1687:Suburban:0*1137:Suburban 1500:0*1138:Suburban 2500:0*1139:Suburban 3500:0*252:Tahoe:0*1426:Tahoe Hybrid:0*253:Tracker:0*254:TrailBlazer:0*255:TrailBlazer EXT:0*1428:Traverse:0*256:Uplander:0*1430:Uplander Cargo Van:0*1292:Van Extended Length:0*1291:Van Regular Length:0*257:Venture:0*1429:Venture Cargo Van:0';
models_array[12] = '1215: Regular Size Car:0*258:300:0*1431:300-Series:0*259:300M:0*260:Aspen:0*261:Caravan:0*262:Cirrus:0*263:Concorde:0*264:Conquest:0*265:Cordoba:0*266:Crossfire:0*269:Fifth Avenue:0*270:Imperial:0*271:Intrepid:0*273:LeBaron:0*272:LHS:0*274:Neon:0*275:New Yorker:0*278:Pacifica:0*279:Prowler:0*277:PT Cruiser:0*280:Sebring:0*1433:Sebring Conv:0*1434:Sebring Cpe:0*1432:Sebring Sdn:0*281:Town & Country:0*1436:Town & Country LWB:0*1435:Town & Country SWB:0*282:Voyager:0';
models_array[13] = '1216: Regular Size Car:0*283:Lanos:0*284:Leganza:0*285:Nubira:0';
models_array[14] = '1217: Regular Size Car:0*286:Charade:0';
models_array[15] = '1218: Regular Size Car:0*288:200SX:0*289:210:0*290:280 ZX:0*291:300 ZX:0*292:310:0*293:510:0*294:720:0*295:810:0*296:Maxima:0*297:Pickup:0*298:Pulsar:0*299:Sentra:0*300:Stanza:0';
models_array[16] = '301:DMC-12:0*1219:Regular Size Car:0';
models_array[17] = '1220: Regular Size Car:0*302:400:0*303:600:0*1350:Aires K:0*304:Aries:0*305:Avenger:0*306:Caliber:0*307:Caravan:0*1437:Caravan C/V:0*308:Challenger:0*309:Charger:0*310:Colt:0*311:Conquest:0*313:Dakota:0*314:Daytona:0*315:Diplomat:0*316:Durango:0*317:Dynasty:0*318:Grand Caravan:0*1438:Grand Caravan C/V:0*319:Intrepid:0*320:Journey:0*321:Lancer:0*322:Magnum:0*323:Mirada:0*324:Monaco:0*325:Neon:0*326:Nitro:0*327:Omni:0*1148:Pickup crew cab long bed:0*1149:Pickup crew cab short bed:0*1142:Pickup Dually crew cab:0*1143:Pickup Dually reg cab:0*1147:Pickup ext cab long bed:0*1146:Pickup ext cab short bed:0*1145:Pickup reg cab long bed:0*1144:Pickup reg cab short bed:0*328:Raider:0*1439:Ram 3500:0*1676:Ram 4500:0*1677:Ram 5500:0*1443:Ram BR2500:0*1444:Ram BR3500:0*1440:Ram SRT-10:0*1151:Ram SRT-10 crew cab:0*1150:Ram SRT-10 reg cab:0*1441:Ram Van:0*1153:Ram Van Extended:0*1152:Ram Van Regular:0*1442:Ram Wagon:0*337:Rampage:0*339:Shadow:0*340:Spirit:0*338:SRT-4:0*343:Stealth:0*344:Stratus:0*1445:Stratus Cpe:0*1360:Stratus Sdn:0*1290:Van Extended Length:0*1289:Van Regular Length:0*345:Viper:0';
models_array[18] = '1221: Regular Size Car:0*346:Medallion:0*347:Premier:0*348:Summit:0*349:Talon:0*350:Vision:0';
models_array[19] = '1222: Regular Size Car:0*351:308 GTB:0*352:308 GTBI:0*353:308 GTS:0*354:308 GTSI:0*355:328 GTB:0*356:328 GTS:0*357:348 GTB:0*358:348 GTS:0*359:348 Spider:0*360:348 TB:0*361:348 TS:0*362:360:0*1446:360 Modena:0*1447:430:0*363:456 GT:0*1448:456M:0*364:512TR:0*1451:550 Maranello:0*1453:575 M Maranello:0*1452:575M:0*365:599 GTB Fiorano:0*1449:612:0*366:612 Scaglietti:0*367:Enzo:0*1450:ENZO:0*368:F131:0*369:F355:0*370:F40:0*371:F430:0*372:F50:0*373:F550:0*374:F575:0*375:Mondial:0*1454:Superamerica:0*376:Testarossa:0';
models_array[20] = '1223: Regular Size Car:0*377:124:0*378:Bertone:0*379:Brava:0*380:Pininfarina:0*381:Strada:0*382:X1/9:0';
models_array[21] = '1224: Regular Size Car:0*1154:Aerostar:0*1155:Aerostar Extended:0*384:Aspire:0*385:Bronco:0*386:Bronco II:0*387:Club Wagon:0*388:Contour:0*390:Crown Victoria:0*1157:E-150/Econoline ext:0*1156:E-150/Econoline reg:0*1159:E-250/Econoline ext:0*1158:E-250/Econoline reg:0*1161:E-350/Econoline ext:0*1160:E-350/Econoline reg:0*1455:Econoline Commercial Chassis:0*1456:Econoline Commercial Cutaway:0*395:Edge:0*396:Escape:0*1372:Escape Hybrid:0*397:Escort:0*398:Excursion:0*394:EXP:0*399:Expedition:0*400:Expedition EL:0*401:Explorer:0*1457:Explorer Sport:0*402:Explorer Sport Trac:0*1458:F-150 SuperCrew:0*1460:F-250 Super Duty:0*1167:F150 crew cab long bed:0*1166:F150 crew cab short bed:0*1165:F150 ext cab long bed:0*1164:F150 ext cab short bed:0*1163:F150 reg cab long bed:0*1162:F150 reg cab short bed:0*1173:F250 crew cab long bed:0*1172:F250 crew cab short bed:0*1171:F250 ext cab long bed:0*1170:F250 ext cab short bed:0*1169:F250 reg cab long bed:0*1168:F250 reg cab short bed:0*1179:F350 crew cab long bed:0*1178:F350 crew cab short bed:0*1180:F350 Dually crew cab:0*1181:F350 Dually reg cab:0*1177:F350 ext cab long bed:0*1176:F350 ext cab short bed:0*1175:F350 reg cab long bed:0*1174:F350 reg cab short bed:0*407:Fairmont:0*408:Festiva:0*409:Five Hundred:0*410:Flex:0*411:Focus:0*1461:Focus Wagon:0*412:Freestar:0*1462:Freestar Cargo Van:0*1342:Freestar Wagon:0*413:Freestyle:0*414:Fusion:0*415:GT:0*1298:GT 40:0*417:LTD:0*419:Mustang:0*421:Probe:0*422:Ranger:0*1463:Shelby GT500:0*1678:Super Duty E-550 Cutaway:0*1459:Super Duty F-250:0*1682:Super Duty F-450:0*1679:Super Duty F-450 DRW:0*1683:Super Duty F-550:0*1680:Super Duty F-550 DRW:0*1684:Super Duty F-650:0*1685:Super Duty F-750:0*1681:Super Duty F450:0*423:Taurus:0*1464:Taurus Wagon:0*424:Taurus X:0*425:Tempo:0*426:Thunderbird:0*1465:Transit Connect:0*1466:Transit Connect Wagon:0*1294:Van Extended Length:0*1293:Van Regular Length:0*427:Windstar:0*1467:Windstar Cargo Van:0*1343:Windstar Wagon:0*1468:ZX2:0*428:ZX2 Escort:0';
models_array[22] = '1225: Regular Size Car:0*429:Metro:0*430:Prizm:0*431:Spectrum:0*432:Storm:0*433:Tracker:0';
models_array[23] = '434:Acadia:0*435:Caballero:0*436:Canyon:0*1472:Classic Sierra 2500:0*1473:Classic Sierra 3500:0*1474:Classic Sierra 3500 HD:0*437:Envoy:0*438:Envoy XL:0*439:Envoy XUV:0*440:Jimmy:0*1475:New Sierra 1500:0*1476:New Sierra 2500:0*1189:Pickup crew cab long bed:0*1188:Pickup crew cab short bed:0*1191:Pickup Dually crew cab:0*1190:Pickup Dually reg cab:0*1187:Pickup ext cab long bed:0*1186:Pickup ext cab short bed:0*1185:Pickup reg cab long bed:0*1184:Pickup reg cab short bed:0*443:S15 Pickup:0*444:Safari:0*1470:Safari Cargo Van:0*1469:Safari Passenger:0*1471:Savana:0*1477:Savana Camper Special:0*1478:Savana Cargo Van:0*1479:Savana Commercial Cutaway:0*1480:Savana Cutaway:0*1183:Savana Extended:0*1481:Savana Passenger:0*1182:Savana Regular:0*1482:Savana RV Cutaway:0*1483:Savana Special:0*1491:Sierra 1500:0*1493:Sierra 1500 Classic:0*1495:Sierra 1500 Classic Hybrid:0*1496:Sierra 1500 Hybrid:0*1492:Sierra 1500HD:0*1494:Sierra 1500HD Classic:0*1497:Sierra 2500:0*1498:Sierra 2500 HD:0*1499:Sierra 2500HD:0*1500:Sierra 2500HD Classic:0*1503:Sierra 3500:0*1504:Sierra 3500 Classic:0*1501:Sierra 3500 HD:0*1502:Sierra 3500HD:0*1487:Sierra Classic 1500:0*1489:Sierra Classic 2500:0*1488:Sierra Classic 2500HD:0*1490:Sierra Classic 3500:0*1485:Sierra Denali:0*1486:Sierra Denali Classic:0*1484:Sierra Hybrid:0*450:Sonoma:0*1192:Suburban 1500:0*1193:Suburban 2500:0*1194:Suburban 3500:0*453:Typhoon:0*1305:Van Extended Length:0*1304:Van Regular Length:0*454:Vandura:0*455:Yukon:0*1365:Yukon Denali:0*1366:Yukon Denali XL:0*1367:Yukon Hybrid:0*1506:Yukon Hybrid Denali:0*456:Yukon XL:0*1505:Yukon XL Denali:0';
models_array[24] = '1226: Regular Size Car:0*457:Accord:0*1370:Accord Cpe:0*1507:Accord Hybrid:0*1508:Accord Sdn:0*460:Civic:0*1511:Civic Cpe:0*1344:Civic del Sol:0*1510:Civic Hybrid:0*1509:Civic Sdn:0*1512:Civic Si:0*458:CR-V:0*459:CRX:0*461:Del Sol:0*463:Element:0*464:Fit:0*465:Insight:0*1264:Motorcycle:0*466:Odyssey:0*467:Passport:0*468:Pilot:0*469:Prelude:0*470:Ridgeline:0*471:S2000:0';
models_array[25] = '472:H1:0*1513:H1 Alpha:0*473:H2:0*474:H3:0*1514:H3 SUV:0*1515:H3T:0';
models_array[26] = '1227: Regular Size Car:0*475:Accent:0*476:Azera:0*477:Elantra:0*1516:Elantra Wagon:0*478:Entourage:0*479:Excel:0*1517:Genesis:0*1518:Genesis Coupe:0*480:Pony:0*481:Santa Fe:0*482:Scoupe:0*483:Sonata:0*484:Tiburon:0*485:Tucson:0*486:Veracruz:0*487:XG300:0*488:XG350:0';
models_array[27] = '1228: Regular Size Car:0*503:EX35:0*1524:FX:0*489:FX35:0*490:FX45:0*504:FX50:0*491:G20:0*492:G35:0*1525:G35 Coupe:0*1358:G35 Sedan:0*493:G37:0*1526:G37 Convertible:0*1527:G37 Coupe:0*1528:G37 Sedan:0*494:I30:0*495:I35:0*496:J30:0*1529:M:0*497:M30:0*498:M35:0*499:M45:0*502:Q45:0*500:QX4:0*501:QX56:0';
models_array[28] = '1229: Regular Size Car:0*505:Amigo:0*506:Ascender:0*507:Axiom:0*508:Hombre:0*518:i-280:0*519:i-290:0*520:i-350:0*521:i-370:0*510:Impulse:0*511:Oasis:0*512:Pickup:0*513:Rodeo:0*1530:Rodeo Sport:0*514:Stylus:0*515:Trooper:0*516:Trooper II:0*1531:Truck:0*517:VehiCROSS:0';
models_array[29] = '1230: Regular Size Car:0*522:S-Type:0*1532:S-TYPE:0*523:Vanden Plas:0*524:X-Type:0*1533:X-TYPE:0*1534:X-TYPE Sportwagon:0*1535:X-Type Sportwagon:0*525:XF:0*1339:XJ:0*1340:XJ Sedan:0*526:XJ Series:0*527:XJ12:0*528:XJ6:0*529:XJ8:0*530:XJR:0*531:XJS:0*532:XK:0*1536:XK Series:0*533:XK8:0*534:XKE Series:0*535:XKR:0';
models_array[30] = '537:Cherokee:0*536:CJ:0*538:Comanche:0*539:Commander:0*540:Compass:0*541:Grand Cherokee:0*542:Grand Wagoneer:0*543:Liberty:0*544:Patriot:0*545:Pickup:0*546:Wagoneer:0*547:Wrangler:0*1537:Wrangler Unlimited:0';
models_array[31] = '1231: Regular Size Car:0*548:Amanti:0*1538:Borrego:0*1541:Forte:0*549:Optima:0*1539:Optima - Early 2006:0*550:Rio:0*1540:Rio Cinco:0*551:Rio5:0*552:Rondo:0*553:Sedona:0*554:Sephia:0*555:Sorento:0*1542:Soul:0*556:Spectra:0*1543:Spectra (2004.5):0*557:Spectra5:0*558:Sportage:0';
models_array[32] = '1232: Regular Size Car:0*559:Countach:0*560:Diablo:0*561:Gallardo:0*562:Jalpa:0*563:LM:0*564:LM002:0*565:Murcielago:0*1544:Murcielago LP640:0';
models_array[33] = '1233: Regular Size Car:0*566:Beta:0*567:Zagato:0';
models_array[34] = '568:Defender:0*569:Discovery:0*1545:Discovery Series II:0*570:Freelander:0*573:Land Rover:0*571:LR2:0*572:LR3:0*574:Range Rover:0*575:Range Rover Sport:0';
models_array[35] = '1234: Regular Size Car:0*1310:ES 250:0*1311:ES 300:0*1312:ES 330:0*576:ES 350:0*1546:GS:0*1313:GS 300:0*1547:GS 300/400:0*1314:GS 350:0*1315:GS 400:0*1316:GS 430:0*1317:GS 450H:0*1548:GS 450h:0*1318:GS 460:0*1319:GX 470:0*1549:IS:0*587:IS 250:0*1550:IS 250C:0*1320:IS 300:0*1551:IS 300 SportCross:0*588:IS 350:0*1552:IS 350C:0*589:IS F:0*1321:LS 400:0*1322:LS 430:0*1323:LS 460:0*1324:LS 600H:0*1553:LS 600h L:0*1325:LX 450:0*1326:LX 470:0*1327:LX 570:0*1328:RX 300:0*1329:RX 330:0*1330:RX 350:0*598:RX 400h:0*1554:RX 450h:0*1331:SC 300:0*1555:SC 300/400:0*1332:SC 400:0*1333:SC 430:0';
models_array[36] = '1235: Regular Size Car:0*605:Aviator:0*606:Blackwood:0*607:Continental:0*608:LS:0*612:Mark LT:0*613:Mark VI:0*614:Mark VII:0*615:Mark VIII:0*609:MKS:0*1556:MKT:0*610:MKX:0*611:MKZ:0*616:Navigator:0*1557:Navigator L:0*617:Town Car:0*618:Zephyr:0';
models_array[37] = '1236: Regular Size Car:0*619:Elan:0*620:Elise:0*621:Esprit:0*1558:Evora:0*622:Exige:0';
models_array[38] = '1237: Regular Size Car:0*623:425:0*624:430:0*625:Biturbo:0*626:Coupe:0*627:GranSport:0*628:GranTurismo:0*629:Quattroporte:0*630:Spyder:0';
models_array[39] = '631:57:0*1560:57S:0*1561:57s:0*632:62:0*1562:62S:0*1563:62s:0*1559:Landaulet:0*1238:Maybach:0';
models_array[40] = '1239: Regular Size Car:0*633:323:0*634:626:0*635:929:0*1347:B-Series:0*1565:B-Series 2WD Truck:0*1566:B-Series 4WD Truck:0*636:B-Series Pickup:0*1564:B-Series Truck:0*637:CX-7:0*638:CX-9:0*639:GLC:0*1567:MAZDA3:0*645:Mazda3:0*646:Mazda5:0*1568:MAZDA5:0*647:Mazda6:0*1569:MAZDA6:0*1570:Mazda6 Sport Wagon:0*640:MAZDASPEED3:0*641:MAZDASPEED6:0*648:Miata MX5:0*649:Millenia:0*642:MPV:0*1353:MX-5 Miata:0*643:MX3:0*644:MX6:0*650:Navajo:0*651:Protege:0*652:Protege5:0*653:RX-7:0*654:RX-8:0*655:Tribute:0*1572:Tribute SUV:0*1571:Truck:0';
models_array[41] = '1240: Regular Size Car:0*657:190D 2.2:0*658:190D 2.5:0*659:190DT:0*660:190E 2.3:0*661:190E 2.6:0*663:240D:0*1361:260:0*708:260E:0*709:280CE:0*710:280E:0*665:300CD:0*666:300CDT:0*667:300CE:0*668:300D:0*669:300DT:0*670:300E:0*767:300SD:0*768:300SDL:0*769:300SE:0*770:300SEL:0*753:300SL:0*671:300TD:0*672:300TDT:0*673:300TE:0*771:350SD:0*772:350SDL:0*773:380SE:0*774:380SEC:0*775:380SEL:0*754:380SL:0*755:380SLC:0*711:400E:0*776:400SE:0*777:400SEL:0*778:420SEL:0*712:500E:0*779:500SEC:0*780:500SEL:0*781:500SL:0*1352:560:0*782:560SEC:0*783:560SEL:0*756:560SL:0*784:600SEC:0*785:600SEL:0*757:600SL:0*1573:C Class:0*694:C-Class:0*1574:C-Class Wagon:0*695:C220:0*696:C230:0*697:C240:0*698:C280:0*699:C300:0*700:C32 AMG:0*701:C320:0*702:C350:0*703:C36 AMG:0*704:C43:0*705:C55 AMG:0*706:C63 AMG:0*1575:CL Class:0*687:CL-Class:0*688:CL500:0*689:CL55 AMG:0*690:CL550:0*691:CL600:0*692:CL63 AMG:0*693:CL65 AMG:0*674:CLK:0*1576:CLK Class:0*1577:CLK-Class:0*675:CLK320:0*676:CLK350:0*677:CLK430:0*678:CLK500:0*679:CLK55 AMG:0*680:CLK550:0*681:CLK63 AMG:0*682:CLS Class:0*1578:CLS-Class:0*683:CLS500:0*684:CLS55 AMG:0*685:CLS550:0*686:CLS63 AMG:0*1579:E Class:0*707:E-Class:0*1580:E-Class Wagon:0*713:E300:0*714:E320:0*715:E320 CDI:0*716:E350:0*717:E420:0*718:E430:0*719:E500:0*720:E55 AMG:0*721:E550:0*722:E63 AMG:0*1588:G Class:0*727:G-Class:0*728:G500:0*729:G55 AMG:0*723:GL-Class:0*724:GL320 CDI:0*725:GL450:0*726:GL550:0*1581:GLK-Class:0*1582:M Class:0*1583:M-Class:0*730:ML-Class:0*731:ML320:0*732:ML320 CDI:0*733:ML350:0*734:ML430:0*735:ML500:0*736:ML55 AMG:0*737:ML550:0*738:ML63 AMG:0*739:R-Class:0*740:R320 CDI:0*741:R350:0*742:R500:0*743:R63 AMG:0*766:S-Class:0*786:S320:0*787:S350:0*788:S350D:0*789:S420:0*790:S430:0*791:S500:0*792:S55 AMG:0*793:S550:0*794:S600:0*795:S63 AMG:0*796:S65 AMG:0*1584:SL Class:0*752:SL-Class:0*758:SL320:0*759:SL500:0*760:SL55 AMG:0*761:SL550:0*762:SL600:0*763:SL63 AMG:0*764:SL65 AMG:0*1585:SLK:0*1586:SLK Class:0*744:SLK-Class:0*745:SLK230:0*746:SLK280:0*747:SLK300:0*748:SLK32 AMG:0*749:SLK320:0*750:SLK350:0*751:SLK55 AMG:0*765:SLR:0*1587:SLR McLaren:0';
models_array[42] = '1241: Regular Size Car:0*797:Capri:0*798:Cougar:0*799:Grand Marquis:0*800:Lynx:0*801:Marauder:0*802:Mariner:0*1589:Mariner Hybrid:0*803:Marquis:0*804:Milan:0*805:Montego:0*806:Monterey:0*807:Mountaineer:0*808:Mystique:0*809:Sable:0*1590:Sable Wagon:0*810:Topaz:0*811:Tracer:0*812:Villager:0*813:Zephyr:0';
models_array[43] = '1242: Regular Size Car:0*814:Scorpio:0*815:XR4TI:0';
models_array[44] = '1243: Mini:0*1301:Clubman:0*816:Cooper:0*1593:Cooper Clubman:0*1592:Cooper Convertible:0*1591:Cooper Hardtop:0';
models_array[45] = '1244: Regular Size Car:0*817:3000GT:0*818:Cordia:0*819:Diamante:0*820:Eclipse:0*821:Endeavor:0*822:Expo:0*823:Galant:0*824:Lancer:0*1594:Lancer Sportback:0*825:Mirage:0*826:Montero:0*827:Montero Sport:0*828:Outlander:0*829:Pickup:0*830:Precis:0*831:Raider:0*832:Sapporo:0*833:Sigma:0*834:Starion:0*835:Tredia:0';
models_array[79] = '1295:All Cars:0';
models_array[72] = '1117:All:0';
models_array[46] = '1200: Regular Car:0*836:200SX:0*837:240SX:0*838:280ZX:0*839:300ZX:0*840:350Z:0*1595:370Z:0*841:Altima:0*1596:Altima Hybrid:0*842:Armada:0*843:Frontier:0*1597:Frontier 2WD:0*1364:Frontier 4WD:0*844:GT-R:0*845:Maxima:0*846:Murano:0*847:NX:0*849:Pathfinder:0*1598:Pathfinder Armada:0*848:PICKUP:0*850:Pulsar:0*851:Quest:0*852:Rogue:0*853:SE-R:0*854:Sentra:0*855:Stanza:0*856:Titan:0*1599:Titan (2008.5):0*858:Versa:0*859:Xterra:0';
models_array[47] = '1245: Regular Size Car:0*860:88:0*862:Achieva:0*863:Alero:0*864:Aurora:0*865:Bravada:0*866:Calais:0*867:Ciera:0*868:Cutlass:0*1341:Cutlass Ciera:0*869:Cutlass Supreme:0*870:Firenza:0*871:Intrigue:0*872:Ninety-Eight:0*873:Omega:0*874:Regency:0*875:Silhouette:0*876:Toronado:0';
models_array[48] = '1246: Regular Size Car:0*877:405:0*878:504:0*879:505:0*880:604:0';
models_array[49] = '1247: Regular Size Car:0*881:Acclaim:0*882:Arrow:0*883:Breeze:0*884:Caravelle:0*885:Champ:0*886:Colt:0*887:Conquest:0*888:Gran Fury:0*889:Grand Voyager:0*890:Horizon:0*891:Laser:0*892:Neon:0*893:Prowler:0*894:Reliant:0*895:Sapporo:0*896:Scamp:0*897:Sundance:0*898:Trailduster:0*899:Voyager:0';
models_array[50] = '1248: Regular Size Car:0*900:6000:0*901:Aztek:0*902:Bonneville:0*903:Catalina:0*904:Fiero:0*905:Firebird:0*906:Firebird Formula:0*1600:G3:0*907:G5:0*908:G6:0*909:G8:0*911:Grand Am:0*912:Grand Prix:0*910:GTO:0*913:J2000:0*914:Le Mans:0*915:Montana:0*1601:Montana SV6:0*916:Parisienne:0*917:Phoenix:0*919:Solstice:0*920:Sunbird:0*921:Sunfire:0*1602:SV6:0*922:T-1000:0*923:Torrent:0*924:Trans Am:0*925:Trans Sport:0*926:Vibe:0';
models_array[51] = '1249: Regular Size Car:0*927:911:0*1603:911 Carrera:0*928:911 Turbo:0*1334:912:0*929:924:0*930:928:0*931:944:0*932:968:0*933:Boxster:0*934:Carrera GT:0*935:Cayenne:0*936:Cayman:0*1604:Panamera:0';
models_array[52] = '1250: Regular Size Car:0*937:181:0*938:18I:0*939:Fuego:0*940:Le Car:0*941:R18:0*942:R5:0*943:Sportwagon:0';
models_array[53] = '944:Camargue:0*945:Corniche:0*946:Park Ward:0*947:Phantom:0*1605:Phantom Coupe:0*1606:Phantom Drophead Coupe:0*948:Silver Dawn:0*949:Silver Seraph:0*950:Silver Spirit:0*951:Silver Spur:0';
models_array[54] = '1251: Regular Size Car:0*952:9-2X:0*953:9-3:0*1607:9-3 SportCombi:0*954:9-5:0*1608:9-5 SportCombi:0*1609:9-5 SportWagon:0*1354:9-5 Wagon:0*955:9-7x:0*1610:9-7X:0*956:900:0*957:9000:0';
models_array[55] = '1252: Regular Size Car:0*958:Astra:0*959:Aura:0*1611:Aura Green Line Hybrid:0*1612:Aura Hybrid:0*960:ION:0*1613:Ion:0*1614:L-Series:0*1615:L-Series Sedan:0*1616:L-Series Wagon:0*961:L100:0*962:L200:0*963:L300:0*1617:L300 Sedan:0*1618:L300 Wagon:0*964:LS:0*1619:LW:0*965:LW1:0*966:LW2:0*967:LW200:0*968:LW300:0*969:Outlook:0*970:Relay:0*1620:SC:0*1621:SC 3dr:0*971:SC1:0*972:SC2:0*978:Sky:0*973:SL:0*974:SL1:0*975:SL2:0*1346:SW:0*1622:SW RHD:0*976:SW1:0*977:SW2:0*979:Vue:0*1623:VUE:0*1624:Vue Green Line Hybrid:0*1625:VUE Hybrid:0*1626:Vue Hybrid:0';
models_array[56] = '1253: Regular Size Car:0*980:tC:0*981:xA:0*982:xB:0*983:xD:0';
models_array[80] = '1296:All Cars:0';
models_array[57] = '1254: Regular Size Car:0*984:fortwo:0';
models_array[58] = '1255: Regular Size Car:0*985:825:0*986:827:0';
models_array[59] = '1256: Regular Size Car:0*1362:B9 Tribeca:0*987:Baja:0*1627:Baja (Natl):0*988:Brat:0*989:DL:0*990:Forester:0*1355:Forester (Natl):0*1628:Forester (NY/NJ):0*991:GL:0*992:Impreza:0*1629:Impreza Coupe:0*1368:Impreza Sedan:0*1632:Impreza Sedan (Natl):0*1631:Impreza Sedan (NY/NJ):0*1630:Impreza Sedan WRX:0*1356:Impreza Wagon:0*1635:Impreza Wagon (Natl):0*1634:Impreza Wagon (NY/NJ):0*1633:Impreza Wagon WRX:0*993:Justy:0*994:Legacy:0*1636:Legacy (NY/NJ):0*1337:Legacy Sedan:0*1637:Legacy Sedan (Natl):0*1638:Legacy Sedan (NY/NJ):0*1336:Legacy Wagon:0*1640:Legacy Wagon (Natl):0*1639:Legacy Wagon (NY/NJ):0*995:Loyale:0*1338:Loyale Wagon:0*996:Outback:0*1642:Outback (Natl):0*1641:Outback (NY/NJ):0*997:RX:0*998:SVX:0*999:Tribeca:0*1644:Tribeca (Natl):0*1643:Tribeca (NY/NJ):0*1000:XT:0';
models_array[60] = '1257: Regular Size Car:0*1001:Aerio:0*1645:Aerio SX:0*1646:Equator:0*1002:Esteem:0*1647:Esteem Wagon:0*1003:Forenza:0*1648:Forenza Wagon:0*1004:Grand Vitara:0*1649:Grand Vitara XL-7:0*1258:Motorcycle:0*1005:Reno:0*1007:Samurai:0*1008:Sidekick:0*1009:Swift:0*1006:SX4:0*1010:Verona:0*1011:Vitara:0*1650:Vitara V6:0*1012:X-90:0*1651:XL-7:0*1013:XL7:0';
models_array[61] = '1259: Regular Size Car:0*1014:4Runner:0*1015:Avalon:0*1016:Camry:0*1652:Camry Hybrid:0*1653:Camry Solara:0*1371:Camry Wagon:0*1017:Celica:0*1018:Corolla:0*1019:Corona:0*1020:Cressida:0*1021:Echo:0*1654:ECHO:0*1022:FJ Cruiser:0*1023:Highlander:0*1655:Highlander Hybrid:0*1024:Land Cruiser:0*1027:Matrix:0*1025:MR2:0*1026:MR2 Spyder:0*1028:Paseo:0*1029:Pickup:0*1030:Previa:0*1031:Prius:0*1032:RAV4:0*1033:Sequoia:0*1034:Sienna:0*1035:Solara:0*1036:Starlet:0*1037:Supra:0*1038:T100:0*1039:Tacoma:0*1040:Tercel:0*1041:Tundra:0*1657:Tundra 2WD Truck:0*1656:Tundra 4WD Truck:0*1658:Venza:0*1043:Yaris:0';
models_array[62] = '1260: Regular Size Car:0*1299:Spitfire:0*1044:TR-7:0*1045:TR-8:0*1300:Vitesse:0';
models_array[63] = '1261: Regular Size Car:0*1197:Beetle:0*1196:Bus:0*1046:Cabrio:0*1047:Cabriolet:0*1659:CC:0*1048:Corrado:0*1049:Dasher:0*1050:Eos:0*1195:Eurovan:0*1660:EuroVan:0*1052:Fox:0*1053:GLI:0*1055:Golf:0*1054:GTI:0*1661:GTI (Early 2006):0*1056:Jetta:0*1662:Jetta (Early 2005):0*1345:Jetta Sedan:0*1665:Jetta Sedan A5:0*1663:Jetta SportWagen:0*1664:Jetta Wagon:0*1057:New Beetle:0*1667:New Beetle Convertible:0*1666:New Beetle Coupe:0*1668:New GTI:0*1669:New Passat:0*1058:Passat:0*1670:Passat Sedan:0*1357:Passat Wagon:0*1059:Phaeton:0*1060:Pickup:0*1061:Quantum:0*1062:R32:0*1063:Rabbit:0*1671:Routan:0*1064:Scirocco:0*1065:Tiguan:0*1066:Touareg:0*1672:Touareg 2:0*1067:Vanagon:0';
models_array[64] = '1262: Regular Size Car:0*1068:240:0*1069:240 DL:0*1070:240 GL:0*1071:240 GLT:0*1072:240 SE:0*1073:244 GL:0*1074:260:0*1075:260 GLE:0*1076:740:0*1077:740 GL:0*1078:740 GLE:0*1079:740 SE:0*1080:760:0*1081:760 GLE:0*1082:765 GLE:0*1083:780:0*1084:850:0*1085:850 GLT:0*1086:850 T-5:0*1087:850 T-5R:0*1088:940:0*1089:940 GL:0*1090:940 GLE:0*1091:940 SE:0*1092:960:0*1349:960 Wagon:0*1093:C30:0*1094:C70:0*1674:Cross Country:0*1106:DL:0*1107:GL:0*1108:GLT:0*1095:S40:0*1673:S40 (2004.5):0*1096:S60:0*1097:S70:0*1098:S80:0*1099:S90:0*1100:V40:0*1101:V50:0*1102:V70:0*1104:V70 Cross Country:0*1103:V90:0*1675:XC60:0*1348:XC70:0*1105:XC90:0';
models_array[65] = '1263: Regular Size Car:0*1109:GV:0*1110:GVC:0*1111:GVL:0*1112:GVS:0*1113:GVX:0';
var datePickerDivID = "datepicker";
var iFrameDivID = "datepickeriframe";
var just_set = false;
var dayArrayShort = new Array('Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa');
var dayArrayMed = new Array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
var dayArrayLong = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
var monthArrayShort = new Array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
var monthArrayMed = new Array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec');
var monthArrayLong = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
// these variables define the date formatting we're expecting and outputting.
// If you want to use a different format by default, change the defaultDateSeparator
// and defaultDateFormat variables either here or on your HTML page.
var defaultDateSeparator = "-"; // common values would be "/" or "."
var defaultDateFormat = "ymd" // valid values are "mdy", "dmy", and "ymd"
var dateSeparator = defaultDateSeparator;
var dateFormat = defaultDateFormat;
function update_model_index()
{
// alert('update_model_index : ' + document.getElementById('VehicleModelID').selectedIndex);
var car_make_index_for_model = document.getElementById('car_make_id').selectedIndex;
Set_Cookie(car_make_index_for_model + '_car_model_index', document.getElementById('VehicleModelID').selectedIndex, '', '/', '', '');
update_hidden_model();
}
function update_hidden_model()
{
if (document.getElementById('VehicleModelID') && document.getElementById('hidden_model_id'))
{
var model_index = document.getElementById('VehicleModelID').selectedIndex;
document.getElementById('hidden_model_id').value = document.getElementById('VehicleModelID').options[model_index].value;
var model_index_value = eval(document.getElementById('VehicleModelID').options[model_index].value);
var required_specialized = 'requires_special_' + model_index_value
if (document.getElementById(required_specialized))
{
if (document.getElementById(required_specialized).value == 1) location.href='http://www.nationaltransportllc.com/request-specialized-quote.php';
}
else if (model_index_value > 1279) location.href='http://www.nationaltransportllc.com/request-specialized-quote.php';
}
else if (document.getElementById('VehicleModelID'))
{
model_index_value = eval(document.getElementById('VehicleModelID').options[model_index].value)
if (document.getElementById(required_specialized))
{
if (document.getElementById(required_specialized).value == 1) location.href='http://www.nationaltransportllc.com/request-specialized-quote.php';
}
else if (eval(document.getElementById('VehicleModelID').options[model_index].value) > 1279) location.href='http://www.nationaltransportllc.com/request-specialized-quote.php';
}
}
function y2k(number) { return (number < 1000) ? number + 1900 : number; }
function check_clear(input_control,default_name)
{
if (input_control.value == document.getElementById(default_name).value) input_control.value = '';
}
function check_fill(input_control,default_name)
{
if (input_control.value == '') input_control.value = document.getElementById(default_name).value;
input_control.value = trim(input_control.value);
}
function validateDate(newstring)
{
if (!newstring)
{
return false;
}
//valid characters for a Date
var Chars = "0123456789/";
for (var i = 0; i < newstring.length; i++)
{
if (Chars.indexOf(newstring.charAt(i)) == -1)
{
return false;
}
}
if(countInstances(newstring,'/')!=2)
{
return false;
}
var substrings = newstring.split('/');
if(!isDate(substrings[1],substrings[0],substrings[2]) )
{
return false;
}
if(substrings[0].length<1 || substrings[1].length<1 || substrings[2].length<1 )
{
return false;
}
return true;
}
function isDate (day,month,year) {
// checks if date passed is valid
// will accept dates in following format:
// isDate(dd,mm,ccyy), or
// isDate(dd,mm) - which defaults to the current year, or
// isDate(dd) - which defaults to the current month and year.
// Note, if passed the month must be between 1 and 12, and the
// year in ccyy format.
var today = new Date();
year = ((!year) ? y2k(today.getYear()):year);
month = ((!month) ? today.getMonth():month-1);
if (!day) return false;
if(year < 1900 ) return false;
if(year> 9999) return false;
var test = new Date(year,month,day);
if ( (y2k(test.getYear()) == year) &&
(month == test.getMonth()) &&
(day == test.getDate()) )
return true;
else
return false
}
function Message_window_popup(MessageText) {
window.open('Window_message_popup.asp?'+MessageText,'MessageWindow','width=250,height=150,toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,left=200,top=200');
}
function ConfirmMe(Prompt_displayed) {
Responseval = window.showModalDialog('Window_confirm_popup.asp?'+Prompt_displayed,'WindowName',"dialogHeight:150px; dialogWidth:250px; dialogTop:200px; dialogLeft:200px; edge:Raised; center:Yes; help: No; resizable: No; status: No;");
return Responseval;
}
function noenter() {
// disallows form submission if enter is pressed in a text box
return !(window.event && window.event.keyCode == 13);
}
function validEmail(str) {
// validates email
var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)
if (str.indexOf(at)==-1){return false}
if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){return false}
if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){return false}
if (str.indexOf(at,(lat+1))!=-1){return false}
if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){return false}
if (str.indexOf(dot,(lat+2))==-1){return false}
if (str.indexOf(" ")!=-1){return false}
return true
}
function isValidEmail(str) {
// validates email ...in another way
var at="@"
var dot="."
var lat=str.indexOf(at)
var lstr=str.length
var ldot=str.indexOf(dot)
if (str.indexOf(at)==-1){
alert("Invalid E-mail ID")
return false
}
if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
alert("Invalid E-mail ID")
return false
}
if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
alert("Invalid E-mail ID")
return false
}
if (str.indexOf(at,(lat+1))!=-1){
alert("You Have Entered an Invalid E-mail ID")
return false
}
if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
alert("Invalid E-mail ID")
return false
}
if (str.indexOf(dot,(lat+2))==-1){
alert("Invalid E-mail ID")
return false
}
if (str.indexOf(" ")!=-1){
alert("Invalid E-mail ID")
return false
}
return true
}
var newwindow;
function openNewWin(url)
// defines the parameters of a popup when a popup is utilized
{
newwindow=window.open(url,'name','scrollbars=yes,menubar=yes,height=600,width=800,resizable=yes');
if (window.focus) {newwindow.focus()}
}
function toggleElement(strParentId ,strId, strState) // 1 visible, 0 hidden
{
if(document.getElementById){
var elementRef = document.getElementById(strId);
var x =document.getElementById(strParentId);
var tt =findPosX(x) ;
var ww =findPosY(x)+20;
if((elementRef.style)&& (elementRef.style.visibility!=null)){
elementRef.style.visibility = strState;
elementRef.style.left = tt + 'px';
elementRef.style.top = ww + 'px';
//adjustiFrame(strId);
}
}
}
function openWin4(URL,winName, intWidth, intHeight) {
window.open(URL,"thewindow","toolbar=no,width=" + intWidth + ",height=" + intHeight + ",status=no,scrollbars=yes,resize=no,menubar=no");
}
function adjustiFrame(layerName)
// iframe code related to the javascript drop down menu
{
if (!document.getElementById(layerName + "-iframe")) {
try{
var newNode = document.createElement("iFrame");
//newNode.injectInside(layerName + "-iframe");
newNode.setAttribute("id", layerName + "-iframe");
//newNode.setAttribute("src", "javascript:false;");
newNode.setAttribute("scrolling", "no");
newNode.setAttribute("frameborder", "0");
newNode.style.filter += "progid:DXImageTransform.Microsoft.dropshadow(OffX=5, OffY=4, Color='black', Positive='true')";
document.body.appendChild(newNode);
}
catch(e){}
}
iFrameDiv = document.getElementById(layerName + "-iframe");
var div = document.getElementById(layerName);
try {
iFrameDiv.style.position = "absolute";
iFrameDiv.style.width = div.offsetWidth;
iFrameDiv.style.height = div.offsetHeight;
iFrameDiv.style.top = div.style.top;
iFrameDiv.style.left = div.style.left;
iFrameDiv.style.zIndex = div.style.zIndex - 1;
iFrameDiv.style.visibility = div.style.visibility;
} catch(e) {
}
}
function findPosX(obj)
// code related to the javascript drop down menu that finds the position of a cell
{
var curleft = 0;
if (obj.offsetParent)
{
while (obj.offsetParent)
{
curleft += obj.offsetLeft
obj = obj.offsetParent;
}
}
else if (obj.x)
curleft += obj.x;
return curleft;
}
function findPosY(obj)
// code related to the javascript drop down menu that finds the position of a cell
{
var curtop = 0;
if (obj.offsetParent)
{
while (obj.offsetParent)
{
curtop += obj.offsetTop
obj = obj.offsetParent;
}
}
else if (obj.y)
curtop += obj.y;
return curtop;
}
function showThisId(str)
// shows a hidden object
{
if (document.getElementById(str)) document.getElementById(str).style.display = 'inline';
}
function hideThisId(str)
// hides a hidden object
{
if (document.getElementById(str)) document.getElementById(str).style.display = 'none';
}
function getCheckedValue( strRB ){
var strTemp, i;
i = 0;
while (i < strRB.length ) {
if ( strRB[i].checked )
strTemp = strRB[i].value;
i++;
}
return strTemp;
}
function roundNum(num, dec) {
var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
return result;
}
function stripCharsInBag (s, bag)
{
var i;
var returnString = "";
for (i = 0; i < s.length; i++)
{
var c = s.charAt(i);
if (bag.indexOf(c) == -1) returnString += c;
}
return returnString;
}
function stripCharsNotInBag (s, bag)
{ var i;
var returnString = "";
for (i = 0; i < s.length; i++)
{
// Check that current character isn't whitespace.
var c = s.charAt(i);
if (bag.indexOf(c) != -1) returnString += c;
}
return returnString;
}
function countInstances(string, word) {
var substrings = string.split(word);
return substrings.length - 1;
}
var fNames = new Array('GetYourQuote','GetYourQuote2');
// Preload
if (document.graphics) {
var fFlipped = new Array();
for(i=0; i< fNames.length; i++) {
fFlipped[i] = new Image();
fFlipped[i].src = "graphics/"+ fNames[i]+".gif";
}
}
function swap(s,n){
var el;
if( n && document.graphics && document.graphics[n] )
el = document.graphics[n];
else if( event.srcElement && event.srcElement.src )
el = event.srcElement;
if( el )
el.src = s;
}
function showMsg(str)
{
var strResponse;
var strMsg = 'Please submit a custom quote request';
if(str == '1'){strMsg = 'You WILL qualify for a discount on multiple units, please call 1-800-665-5022 or submit an online quote request by clicking OK below.';}
if(str == '2'){location.href='http://www.nationaltransportllc.com/request-specialized-quote.php';}
if(str == '3'){strMsg = 'Because of the many variables connected with shipping your selection, we must give you a custom quote. Please call us at 1-800-665-5022, or submit an online quote by clicking OK below.';}
//alert(strMsg);
//strResponse= ConfirmThis(strMsg);
// return(ConfirmThis(strMsg));
/*
if(strResponse=='submit'){
return true;
}
else{
return false;
}
*/
}
function checkVehicle(str)
{
//Certain vehicle types require custom quotes
var vehicleIndex = document.getElementById('reqdTypeOfVehicle').selectedIndex;
var strVehicle = document.getElementById('reqdTypeOfVehicle').options[vehicleIndex].value;
if(Right(strVehicle,1) == 0)
{
customQuote('2');
}
}
function ConfirmThis(Prompt_displayed) {
//alert(Prompt_displayed);
// Responseval = window.showModalDialog('custom_popup.php?'+Prompt_displayed,'WindowName',"dialogHeight:160px; dialogWidth:350px; dialogTop:200px; dialogLeft:200px; edge:Raised; center:Yes; help: No; resizable: No; status: No;");
//return Responseval;
return(confirm(Prompt_displayed));
}
function showThisId(str)
{
document.getElementById(str).style.display = 'inline';
}
function hideThisId(str)
{
document.getElementById(str).style.display = 'none';
}
function getUserSelections(str)
{
//This function will not
var eleLoaded = document.getElementById("txtIsRunning");
//if form is not postback then these elements will exist
if (eleLoaded != null){
if(getCheckedValue(document.forms[0].elements['vehicleRunning']) == 'No')
{showThisId('txtIsRunning')}
if(getCheckedValue(document.forms[0].elements['trailerType']) == 'Enclosed')
{showThisId('txtTrailerType')}
}
}
function resetSelections()
{
//will not run if form after form is submitted
if (document.getElementById('car_make_id'))
{
if (document.getElementById('car_make_id').selectedIndex != 0) sendRequest();
update_hidden_model();
}
if(document.getElementById('trailerTypeEnclosed')){
//document.getElementById('TypeOfVehicle').selectedIndex = 0;
//document.getElementById('reqdFromLocationZip').value = document.getElementById('pickup_zip_default').value;
//document.getElementById('reqdToLocationZip').value = document.getElementById('delivery_zip_default').value;
if (document.getElementById('trailerTypeEnclosed').checked){showThisId('txtTrailerType')}
if (document.getElementById('vehicleRunningNo').checked) {showThisId('txtIsRunning')}
}
}
function set_model_cookie()
{
if (document.getElementById('car_make_id') && document.getElementById('VehicleModelID'))
{
var car_make_index_for_model = document.getElementById('car_make_id').selectedIndex;
// alert('set_model_cookie : ' + document.getElementById('VehicleModelID').selectedIndex);
Set_Cookie(car_make_index_for_model + '_car_model_index', document.getElementById('VehicleModelID').selectedIndex, '', '/', '', '');
// var divModels = document.getElementById("models_div");
// var car_model_select = divModels.innerHTML;
// Set_Cookie(car_make_index_for_model + '_car_model_select', car_model_select, '', '/', '', '');
// alert(car_make_index_for_model + '-car_model_select');
// alert(car_model_select);
// alert('cookies' + document.cookie)
}
}
function init_NatStorage()
{
NatStorage = new Persist.Store('NatStore', { swf_path: 'flashStorage/persist.swf' });
}
function check_cookie_values()
{
//will not run if form after form is submitted
clearTimeout(loadTimeout);
// if (Cookies == 'undefined' || Cookies == 'null') loadTimeout = setTimeout("check_cookie_values()",300);
// alert('check_cookies');
try
{
if (document.getElementById('car_make_id'))
{
var car_make_index = Get_Cookie( 'car_make_index' );
if (car_make_index != null && car_make_index != 'undefined' && car_make_index != 'null')
{
//alert(car_make_index);
document.getElementById('car_make_id').selectedIndex = car_make_index;
if (document.getElementById('models_div'))
{
var car_model_select = Get_Cookie(car_make_index + '_car_model_select');
//alert(car_make_index + '-car_model_select');
//alert(car_model_select);
if(car_model_select != null && car_model_select != 'undefined' && car_model_select != 'null')
{
var divModels = document.getElementById("models_div");
var divModelsSelect = divModels.innerHTML;
var car_model_select_html = create_model_html(car_model_select)
//alert(divModelsSelect);
//alert(car_model_select_html);
if (divModelsSelect != car_model_select_html) divModels.innerHTML = car_model_select_html;
var car_model_index = Get_Cookie( car_make_index + '_car_model_index' );
//alert(car_model_index);
if (car_model_index != null && car_model_index != 'undefined' && car_model_index != 'null')
{
//alert(car_make_index);
if (document.getElementById('VehicleModelID') && document.getElementById('VehicleModelID').selectedIndex != car_model_index)
{
document.getElementById('VehicleModelID').selectedIndex = car_model_index;
}
}
else
{
if (document.getElementById('VehicleModelID')) document.getElementById('VehicleModelID').selectedIndex = 0;
}
update_hidden_model();
//alert(car_model_select);
sendRequestNoUpdate();
}
else
{
// alert('sendRequest');
sendRequest();
}
}
}
}
}
catch(e)
{
alert('check_cookie_values : ' + e.message);
}
if (document.getElementById('reqdFromLocationZip'))
{
var pickup_zip_value = Get_Cookie( 'pickup_zip' );
if (pickup_zip_value != null && pickup_zip_value != 'undefined' && pickup_zip_value != 'null')
{
//alert(car_make_index);
document.getElementById('reqdFromLocationZip').value = pickup_zip_value;
}
}
if (document.getElementById('FromCity'))
{
var pickup_city_value = Get_Cookie( 'pickup_city' );
if (pickup_city_value != null && pickup_city_value != 'undefined' && pickup_city_value != 'null')
{
//alert(car_make_index);
document.getElementById('FromCity').value = pickup_city_value;
}
}
if (document.getElementById('FromState'))
{
var pickup_state_index = Get_Cookie( 'pickup_state_index' );
if (pickup_state_index != null && pickup_state_index != 'undefined' && pickup_state_index != 'null')
{
//alert(car_make_index);
document.getElementById('FromState').selectedIndex = pickup_state_index;
}
}
if (document.getElementById('reqdToLocationZip'))
{
var delivery_zip_value = Get_Cookie( 'delivery_zip' );
if (delivery_zip_value != null && delivery_zip_value != 'undefined' && delivery_zip_value != 'null')
{
//alert(car_make_index);
document.getElementById('reqdToLocationZip').value = delivery_zip_value;
}
}
if (document.getElementById('ToCity'))
{
var delivery_city_value = Get_Cookie( 'delivery_city' );
if (delivery_city_value != null && delivery_city_value != 'undefined' && delivery_city_value != 'null')
{
//alert(car_make_index);
document.getElementById('ToCity').value = delivery_city_value;
}
}
if (document.getElementById('ToState'))
{
var delivery_state_index = Get_Cookie( 'delivery_state_index' );
if (delivery_state_index != null && delivery_state_index != 'undefined' && delivery_state_index != 'null')
{
//alert(car_make_index);
document.getElementById('ToState').selectedIndex = delivery_state_index;
}
}
if (document.getElementById('vehicleRunningNo'))
{
var running_check_value = Get_Cookie( 'running_check' );
if (running_check_value != null && running_check_value != 'undefined' && running_check_value != 'null')
{
//alert(car_make_index);
if (running_check_value == 1)
{
document.getElementById('vehicleRunningNo').checked = 1;
document.getElementById('vehicleRunningYes').checked = 0;
showThisId('txtIsRunning');
}
else
{
document.getElementById('vehicleRunningNo').checked = 0;
document.getElementById('vehicleRunningYes').checked = 1;
hideThisId('txtIsRunning');
}
}
}
if (document.getElementById('trailerTypeOpen'))
{
var trailerType_value = Get_Cookie( 'enclosed_check' );
if (trailerType_value != null && trailerType_value != 'undefined' && trailerType_value != 'null')
{
//alert(car_make_index);
if (trailerType_value == 1)
{
document.getElementById('trailerTypeEnclosed').checked = 1;
document.getElementById('trailerTypeOpen').checked = 0;
showThisId('txtTrailerType');
}
else
{
document.getElementById('trailerTypeEnclosed').checked = 0;
document.getElementById('trailerTypeOpen').checked = 1;
hideThisId('txtTrailerType');
}
}
}
}
function setCheckedValue(radioObj, newValue) {
if(!radioObj)
return;
var radioLength = radioObj.length;
if(radioLength == undefined) {
radioObj.checked = (radioObj.value == newValue.toString());
return;
}
for(var i = 0; i < radioLength; i++) {
radioObj[i].checked = false;
if(radioObj[i].value == newValue.toString()) {
radioObj[i].checked = true;
}
}
}
function getCheckedValue( strRB ){
var strTemp, i;
i = 0;
while (i < strRB.length ) {
if ( strRB[i].checked )
strTemp = strRB[i].value;
i++;
}
return strTemp;
}
function specialRedirect()
{
location.href='http://www.nationaltransportllc.com/request-specialized-quote.php';
}
function internationalRedirect()
{
location.href='http://www.nationaltransportllc.com/international-shipping.php';
}
function customQuote(str)
// if the user selects a specialized quote vehicle from the short quote form, a msg will popup.
// clicking OK makes the message go away and load the request-specialized-quote.php page
// clicking CANCEL makes the message go away and resets the short quote form.
{
if(showMsg(str) == true)
{
document.forms[0].action = 'http://www.nationaltransportllc.com/request-specialized-quote.php';
document.forms[0].submit();
}
else{
hideThisId('txtIsrunning');
hideThisId('txtTrailerType');
resetSelections(str)}
}
function clearForm()
{
for (var i = 0; i-1)
{
if( strValue.length == 0 )
{
alert("Please complete all required fields");
document.forms[1].elements[strName].focus();
isValidForm = false;
return(isValidForm)
}
}
}
if (isValidEmail(emailID.value)==false){
emailID.value=""
emailID.focus()
isValidForm = false
}
if(isValidForm)
{
document.forms[1].submit();
}
}
function validateInternationalForm()
{
if (document.getElementById('TypeOfVehicle').value == '')
{
alert('Vehical Type Required');
document.getElementById('TypeOfVehicle').focus();
return(false);
}
if (document.getElementById('fromZip').value == '')
{
alert('From Zip Code Required');
document.getElementById('fromZip').focus();
return(false);
}
if (document.getElementById('toPort').value == '')
{
alert('To Country/Port Required');
document.getElementById('toPort').focus();
return(false);
}
if (document.getElementById('EmailAddress').value == '')
{
alert('Email Address Required');
document.getElementById('EmailAddress').focus();
return(false);
}
return(true);
}
function validateShortForm()
// checks if the required fields have input on the short quote form.
// if not, displays a message and puts the cursor in the missing field.
// if so, submits the information and redirects to the online-instant-quote.php page
{
var customQuote = '';
try
{
if (document.getElementById('reqdTypeOfVehicle'))
{
var vehicleIndex = document.getElementById('reqdTypeOfVehicle').selectedIndex;
if(vehicleIndex == 0)
{
alert('Please select a vehicle type');
document.getElementById('reqdTypeOfVehicle').focus();
isValidForm = false;
return(isValidForm)
}
}
if (document.getElementById('car_make_id'))
{
var car_makeIndex = document.getElementById('car_make_id').selectedIndex;
if(car_makeIndex == 0)
{
alert('Please Select a Make');
document.getElementById('car_make_id').focus();
isValidForm = false;
return(isValidForm)
}
}
if (document.getElementById('VehicleModelID'))
{
var VehicleModelIndex = document.getElementById('VehicleModelID').selectedIndex;
if(VehicleModelIndex == 0)
{
alert('Please Select a Model');
document.getElementById('VehicleModelID').focus();
isValidForm = false;
return(isValidForm)
}
}
var fromStateIndex = document.getElementById('FromState').selectedIndex;
var strFromState = document.getElementById('FromState').options[fromStateIndex].value;
var toStateIndex = document.getElementById('ToState').selectedIndex;
var strToState = document.getElementById('ToState').options[toStateIndex].value;
var toLocValue = trim(document.getElementById('reqdToLocationZip').value);
var fromLocValue = trim(document.getElementById('reqdFromLocationZip').value);
var toCity = trim(document.getElementById('ToCity').value);
var fromCity = trim(document.getElementById('FromCity').value);
}
catch(e)
{
alert(e.message);
}
if(fromStateIndex == 0 && (!IsInt(fromLocValue) || fromLocValue.length != 5))
{
alert('You must enter a valid 5 digit pickup zip code OR city AND state.');
document.getElementById('reqdFromLocationZip').focus();
isValidForm = false;
return(isValidForm)
}
if(toStateIndex == 0 && (!IsInt(toLocValue) || toLocValue.length != 5))
{
alert('You must enter a valid 5 digit delivery zip code OR city AND state.');
document.getElementById('reqdToLocationZip').focus();
isValidForm = false;
return(isValidForm)
}
/*
else if (toLocValue == fromLocValue)
{
alert('Please call us at 1-800-665-5022 to get this rate quote.');
return(false);
}
else if(fromLocValue == '' || fromLocValue == document.getElementById('pickup_zip_default').value)
{
alert('Please enter pickup location zip code');
document.getElementById('reqdFromLocationZip').focus();
isValidForm = false;
return(isValidForm)
}
else if(toLocValue == '' || toLocValue == document.getElementById('delivery_zip_default').value)
{
alert('Please enter delivery location zip code');
document.getElementById('reqdToLocationZip').focus();
isValidForm = false;
return(isValidForm)
}
else if (!IsInt(fromLocValue) || fromLocValue.length != 5)
{
alert('Please enter a valid zip code');
document.getElementById('reqdFromLocationZip').focus();
isValidForm = false;
return(isValidForm)
}
else if (!IsInt(toLocValue) || toLocValue.length != 5)
{
alert('Please enter a valid zip code');
document.getElementById('reqdToLocationZip').focus();
isValidForm = false;
return(isValidForm)
}
*/
else
{
//document.forms[0].action = 'online-instant-quote.php';
document.forms[0].submit();
return(true)
}
if(strVehicle.indexOf('All Other') == 0)
{
// if(showMsg('2') == false)
// {
// return(false)
// }
// else
// {
location.href='http://www.nationaltransportllc.com/request-specialized-quote.php';
return(false)
// }
}
else if(toLocVehicle.indexOf('Region') == 0 || fromLocVehicle.indexOf('Region') == 0)
{
// if(showMsg('3') == false)
// {
// return(false)
// }
// else
// {
location.href='http://www.nationaltransportllc.com/request-specialized-quote.php';
return(false)
// }
}
else
{
document.forms[0].action = 'http://www.nationaltransportllc.com/online-instant-quote.php';
document.forms[0].submit();
}
}
function Right(str, n)
{
if (n <= 0)
return "";
else if (n > String(str).length)
return str;
else {
var iLen = String(str).length;
return String(str).substring(iLen, iLen - n);
}
}
function IsNumeric(sText)
{
var ValidChars = "0123456789.";
var IsNumber=true;
var Char;
for (i = 0; i < sText.length && IsNumber == true; i++)
{
Char = sText.charAt(i);
if (ValidChars.indexOf(Char) == -1)
{
IsNumber = false;
}
}
return IsNumber;
}
function IsInt(sText)
{
var ValidChars = "0123456789";
var IsNumber=true;
var Char;
for (i = 0; i < sText.length && IsNumber == true; i++)
{
Char = sText.charAt(i);
if (ValidChars.indexOf(Char) == -1)
{
IsNumber = false;
}
}
return IsNumber;
}
function trim(stringToTrim) {
return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function ltrim(stringToTrim) {
return stringToTrim.replace(/^\s+/,"");
}
function rtrim(stringToTrim) {
return stringToTrim.replace(/\s+$/,"");
}
/**
This is the main function you'll call from the onClick event of a button.
Normally, you'll have something like this on your HTML page:
Start Date:
That will cause the datepicker to be displayed beneath the StartDate field and
any date that is chosen will update the value of that field. If you'd rather have the
datepicker display beneath the button that was clicked, you can code the button
like this:
So, pretty much, the first argument (dateFieldName) is a string representing the
name of the field that will be modified if the user picks a date, and the second
argument (displayBelowThisObject) is optional and represents an actual node
on the HTML document that the datepicker should be displayed below.
In version 1.1 of this code, the dtFormat and dtSep variables were added, allowing
you to use a specific date format or date separator for a given call to this function.
Normally, you'll just want to set these defaults globally with the defaultDateSeparator
and defaultDateFormat variables, but it doesn't hurt anything to add them as optional
parameters here. An example of use is:
This would display the datepicker beneath the StartDate field (because the
displayBelowThisObject parameter was false), and update the StartDate field with
the chosen value of the datepicker using a date format of dd.mm.yyyy
*/
function displayDatePicker(dateFieldName, displayBelowThisObject, dtFormat, dtSep)
{
var targetDateField = document.getElementById(dateFieldName);
var body_element = document.getElementById('main_body');
just_set = true;
body_element.onclick = close_date;
// if we weren't told what node to display the datepicker beneath, just display it
// beneath the date field we're updating
if (!displayBelowThisObject)
displayBelowThisObject = targetDateField;
// if a date separator character was given, update the dateSeparator variable
if (dtSep)
dateSeparator = dtSep;
else
dateSeparator = defaultDateSeparator;
// if a date format was given, update the dateFormat variable
if (dtFormat)
dateFormat = dtFormat;
else
dateFormat = defaultDateFormat;
var x = displayBelowThisObject.offsetLeft;
var y = displayBelowThisObject.offsetTop + displayBelowThisObject.offsetHeight ;
// deal with elements inside tables and such
var parent = displayBelowThisObject;
while (parent.offsetParent) {
parent = parent.offsetParent;
x += parent.offsetLeft;
y += parent.offsetTop ;
}
drawDatePicker(targetDateField, x, y);
}
/**
Draw the datepicker object (which is just a table with calendar elements) at the
specified x and y coordinates, using the targetDateField object as the input tag
that will ultimately be populated with a date.
This function will normally be called by the displayDatePicker function.
*/
function drawDatePicker(targetDateField, x, y)
{
var dt = getFieldDate(targetDateField.value );
// the datepicker table will be drawn inside of a
with an ID defined by the
// global datePickerDivID variable. If such a div doesn't yet exist on the HTML
// document we're working with, add one.
if (!document.getElementById(datePickerDivID)) {
// don't use innerHTML to update the body, because it can cause global variables
// that are currently pointing to objects on the page to have bad references
//document.body.innerHTML += "";
var newNode = document.createElement("div");
newNode.setAttribute("id", datePickerDivID);
newNode.setAttribute("class", "dpDiv");
newNode.setAttribute("style", "visibility: hidden;");
document.body.appendChild(newNode);
}
// move the datepicker div to the proper x,y coordinate and toggle the visiblity
var pickerDiv = document.getElementById(datePickerDivID);
pickerDiv.style.position = "absolute";
pickerDiv.style.left = x + "px";
pickerDiv.style.top = y + "px";
pickerDiv.style.visibility = (pickerDiv.style.visibility == "visible" ? "hidden" : "visible");
pickerDiv.style.display = (pickerDiv.style.display == "block" ? "none" : "block");
pickerDiv.style.zIndex = 10000;
// draw the datepicker table
refreshDatePicker(targetDateField.name, dt.getFullYear(), dt.getMonth(), dt.getDate());
}
/**
This is the function that actually draws the datepicker calendar.
*/
function refreshDatePicker(dateFieldName, year, month, day)
{
// if no arguments are passed, use today's date; otherwise, month and year
// are required (if a day is passed, it will be highlighted later)
var thisDay = new Date();
if ((month >= 0) && (year > 0)) {
thisDay = new Date(year, month, 1);
} else {
day = thisDay.getDate();
thisDay.setDate(1);
}
// the calendar will be drawn as a table
// you can customize the table elements with a global CSS style sheet,
// or by hardcoding style and formatting elements below
var crlf = "\r\n";
var TABLE = "
" + crlf;
var xTABLE = "
" + crlf;
var TR = "
";
var TR_title = "
";
var TR_days = "
";
var TR_todaybutton = "
";
var xTR = "
" + crlf;
var TD = "
";
if (dayNum == day)
html += TD_selected + TD_onclick + DIV_selected + dayNum + xDIV + xTD;
else
html += TD + TD_onclick + dayNum + xTD;
// if this is a Saturday, start a new row
if (thisDay.getDay() == 6)
html += xTR + TR;
// increment the day
thisDay.setDate(thisDay.getDate() + 1);
} while (thisDay.getDate() > 1)
// fill in any trailing blanks
if (thisDay.getDay() > 0) {
for (i = 6; i > thisDay.getDay(); i--)
html += TD + " " + xTD;
}
html += xTR;
// add a button to allow the user to easily return to today, or close the calendar
var today = new Date();
var todayString = "Today is " + dayArrayMed[today.getDay()] + ", " + monthArrayMed[ today.getMonth()] + " " + today.getDate();
html += TR_todaybutton + TD_todaybutton;
html += " ";
html += "";
html += xTD + xTR;
// and finally, close the table
html += xTABLE;
document.getElementById(datePickerDivID).innerHTML = html;
// add an "iFrame shim" to allow the datepicker to display above selection lists
//adjustiFrame();
}
/**
Convenience function for writing the code for the buttons that bring us back or forward
a month.
*/
function getButtonCode(dateFieldName, dateVal, adjust, label)
{
var newMonth = (dateVal.getMonth () + adjust) % 12;
var newYear = dateVal.getFullYear() + parseInt((dateVal.getMonth() + adjust) / 12);
if (newMonth < 0) {
newMonth += 12;
newYear += -1;
}
return "";
}
/**
Convert a JavaScript Date object to a string, based on the dateFormat and dateSeparator
variables at the beginning of this script library.
*/
function getDateString(dateVal)
{
var dayString = "00" + dateVal.getDate();
var monthString = "00" + (dateVal.getMonth()+1);
dayString = dayString.substring(dayString.length - 2);
monthString = monthString.substring(monthString.length - 2);
switch (dateFormat) {
case "dmy" :
return dayString + dateSeparator + monthString + dateSeparator + dateVal.getFullYear();
case "ymd" :
return dateVal.getFullYear() + dateSeparator + monthString + dateSeparator + dayString;
case "mdy" :
default :
return monthString + dateSeparator + dayString + dateSeparator + dateVal.getFullYear();
}
}
/**
Convert a string to a JavaScript Date object.
*/
function getFieldDate(dateString)
{
var dateVal;
var dArray;
var d, m, y;
try {
dArray = splitDateString(dateString);
if (dArray) {
switch (dateFormat) {
case "dmy" :
d = parseInt(dArray[0], 10);
m = parseInt(dArray[1], 10) - 1;
y = parseInt(dArray[2], 10);
break;
case "ymd" :
d = parseInt(dArray[2], 10);
m = parseInt(dArray[1], 10) - 1;
y = parseInt(dArray[0], 10);
break;
case "mdy" :
default :
d = parseInt(dArray[1], 10);
m = parseInt(dArray[0], 10) - 1;
y = parseInt(dArray[2], 10);
break;
}
dateVal = new Date(y, m, d);
} else if (dateString) {
dateVal = new Date(dateString);
} else {
dateVal = new Date();
}
} catch(e) {
dateVal = new Date();
}
return dateVal;
}
/**
Try to split a date string into an array of elements, using common date separators.
If the date is split, an array is returned; otherwise, we just return false.
*/
function splitDateString(dateString)
{
var dArray;
if (dateString.indexOf("/") >= 0)
dArray = dateString.split("/");
else if (dateString.indexOf(".") >= 0)
dArray = dateString.split(".");
else if (dateString.indexOf("-") >= 0)
dArray = dateString.split("-");
else if (dateString.indexOf("\\") >= 0)
dArray = dateString.split("\\");
else
dArray = false;
return dArray;
}
/**
Update the field with the given dateFieldName with the dateString that has been passed,
and hide the datepicker. If no dateString is passed, just close the datepicker without
changing the field value.
Also, if the page developer has defined a function called datePickerClosed anywhere on
the page or in an imported library, we will attempt to run that function with the updated
field as a parameter. This can be used for such things as date validation, setting default
values for related fields, etc. For example, you might have a function like this to validate
a start date field:
function datePickerClosed(dateField)
{
var dateObj = getFieldDate(dateField.value);
var today = new Date();
today = new Date(today.getFullYear(), today.getMonth(), today.getDate());
if (dateField.name == "StartDate") {
if (dateObj < today) {
// if the date is before today, alert the user and display the datepicker again
alert("Please enter a date that is today or later");
dateField.value = "";
document.getElementById(datePickerDivID).style.visibility = "visible";
adjustiFrame();
} else {
// if the date is okay, set the EndDate field to 7 days after the StartDate
dateObj.setTime(dateObj.getTime() + (7 * 24 * 60 * 60 * 1000));
var endDateField = document.getElementsByName ("EndDate").item(0);
endDateField.value = getDateString(dateObj);
}
}
}
*/
function updateDateField(dateFieldName, dateString)
{
var targetDateField = document.getElementsByName (dateFieldName).item(0);
if (dateString)
targetDateField.value = dateString;
var pickerDiv = document.getElementById(datePickerDivID);
pickerDiv.style.visibility = "hidden";
pickerDiv.style.display = "none";
//adjustiFrame();
targetDateField.focus();
// after the datepicker has closed, optionally run a user-defined function called
// datePickerClosed, passing the field that was just updated as a parameter
// (note that this will only run if the user actually selected a date from the datepicker)
if ((dateString) && (typeof(datePickerClosed) == "function"))
datePickerClosed(targetDateField);
}
/**
Use an "iFrame shim" to deal with problems where the datepicker shows up behind
selection list elements, if they're below the datepicker. The problem and solution are
described at:
http://dotnetjunkies.com/WebLog/jking/archive/2003/07/21/488.aspx
http://dotnetjunkies.com/WebLog/jking/archive/2003/10/30/2975.aspx
*/
function adjustiFrame(pickerDiv, iFrameDiv)
{
// we know that Opera doesn't like something about this, so if we
// think we're using Opera, don't even try
var is_opera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1);
if (is_opera)
return;
// put a try/catch block around the whole thing, just in case
try {
if (!document.getElementById(iFrameDivID)) {
// don't use innerHTML to update the body, because it can cause global variables
// that are currently pointing to objects on the page to have bad references
//document.body.innerHTML += "