function PrimaryBodyStyle(id, name) {this.ID = id;this.Name = name;this.sb = null;} function SecondaryBodyStyle(id, name) {this.ID = id;this.Name = name;} function BodyStyle(){this.pb = new Array(12);this.pb[0] = new PrimaryBodyStyle(1,"Bus");this.pb[0].sb = new SecondaryBodyStyle("","");this.pb[1] = new PrimaryBodyStyle(2,"Convertible");this.pb[1].sb = new SecondaryBodyStyle("","");this.pb[2] = new PrimaryBodyStyle(11,"Coupe");this.pb[2].sb = new SecondaryBodyStyle("","");this.pb[3] = new PrimaryBodyStyle(3,"Hatchback");this.pb[3].sb = new SecondaryBodyStyle("","");this.pb[4] = new PrimaryBodyStyle(4,"Machinery");this.pb[4].sb = new SecondaryBodyStyle("","");this.pb[4].sb.ID = "1,2,3,4,5,6,9,7,8";this.pb[4].sb.Name = "Aerial Platform,Asphalt Finisher,Carrier,Dozer,Excuvator,Forklift,Other,Roller,Wheel Loader";this.pb[5] = new PrimaryBodyStyle(5,"Mini Vehicle");this.pb[5].sb = new SecondaryBodyStyle("","");this.pb[6] = new PrimaryBodyStyle(6,"Sedan");this.pb[6].sb = new SecondaryBodyStyle("","");this.pb[7] = new PrimaryBodyStyle(7,"SUV");this.pb[7].sb = new SecondaryBodyStyle("","");this.pb[8] = new PrimaryBodyStyle(8,"Truck");this.pb[8].sb = new SecondaryBodyStyle("","");this.pb[8].sb.ID = "10,11,12,13,14,15,16,17,18,28,29,19,20,21,22,23,24,25,26,27";this.pb[8].sb.Name = "Aerial Platform,Car Carrier,Concrete Pumping Truck,Crane,Dump,Flatbody,Garbage Truck,Hook Lift,Mixer,Other,Pickup,Refrigerated Van,Sefl Loader / Safty Loader,Tanker,Tractor,Trailer / Trailer Set,Vaccum Truck,Van,Wing,Wrecker";this.pb[9] = new PrimaryBodyStyle(12,"Unspecified");this.pb[9].sb = new SecondaryBodyStyle("","");this.pb[10] = new PrimaryBodyStyle(9,"Van / Minivan");this.pb[10].sb = new SecondaryBodyStyle("","");this.pb[11] = new PrimaryBodyStyle(10,"Wagon");this.pb[11].sb = new SecondaryBodyStyle("","");} var BodyStyleList = new BodyStyle(); function ChangeBodyStyle( src, target) { var primaryBodyStyleID = src.options[src.selectedIndex].value; while( target.options.length > 0 ) { target.options.length = 0; } if( primaryBodyStyleID == 0 ) { target.options.add(new Option( "- All BodyStyle2 -", 0 )); target.disabled = true; return; } else { var i; var selectedIndex_PrimaryBodyStyle = 0; for(i = 0; i < BodyStyleList.pb.length; i++) { if(BodyStyleList.pb[i].ID == primaryBodyStyleID) selectedIndex_PrimaryBodyStyle = i; } if ( BodyStyleList.pb[selectedIndex_PrimaryBodyStyle].sb.ID == '' ) { target.options.add(new Option( "- All BodyStyle2 -", 0 )); target.disabled = true; return; } target.options.add(new Option( "- All BodyStyle2 -", 0 )); target.disabled = false; } var id = BodyStyleList.pb[selectedIndex_PrimaryBodyStyle].sb.ID.split(","); var name = BodyStyleList.pb[selectedIndex_PrimaryBodyStyle].sb.Name.split(","); for(i = 0; i < id.length; i++) { target.options.add(new Option( name[i], id[i] )); } }