var CategoryArray = [
[0,'Baumaschinen',0],[0,'Baumaterial',1],[0,'Holz',1],[0,'Werkzeug',2],[0,'Sonstige',3],
[1,'Nachhilfe',0],[1,'Kurse',1],[1,'Seminare',2],[1,'Sprachen',3],[1,'Sonstige',4],
[5,'Bücher',0],[5,'Eintrittskarten',1],[5,'Film',2],[5,'Kunst/Kultur',3],[5,'Hobby',4],[5,'Sonstige',5],
[6,'Beauty',0],[6,'Gesundheit',1],[6,'Massage',2],[6,'Wellness',3],[6,'Sonstige',4],
[8,'Bad/WC/Sauna',0],[8,'Garten',1],[8,'Haushaltsgeräte',1],[8,'Küche',2],[8,'Schlafzimmer',3],[8,'Wohnzimmer',4],[8,'Sonstige',5],
[11,'Bekleidung',0],[11,'Moped',1],[11,'Motorrad',2],[11,'Service & Reparatur',3],[11,'Verleih',4],[11,'Sonstige',4],
[12,'Instrumente',0],[12,'Noten',1],[12,'Tonträger',2],[12,'Sonstige',3],
[13,'Auslandsreise',0],[13,'Busreise',1],[13,'Inlandsreise',2],[13,'Kur',3],[13,'Tickets',4],[13,'Sonstige',5],
[14,'Briefmarken',0],[14,'Münzen',0],[14,'Postkarten/Fotos',0],[14,'Sonstige',0],
[15,'Gesellschaftsspiele',0],[15,'Modellauto',0],[15,'Modellbau',0],[15,'Modelleisenbahn',0],[15,'Spielzeug',0],[15,'Sonstige',0],
[16,'Ballsport',0],[16,'Eintrittskarten',0],[16,'Fitness',0],[16,'Flugsport',0],[16,'Golf',0],[16,'Radsport',0],[16,'Reitsport',0],[16,'Wassersport',0],[16,'Wintersport',0],[16,'Sonstige',0],
[17,'Glas/Porzellan',0],[17,'Bilder/Zeichnungen',0],[17,'Schmuck',0],[17,'Skulpturen',0],[17,'Uhren',0],[17,'Sonstige',0]];


function fn_modellist(defaultText, make, model, formObject) {
	
	var sel = formObject.sc;
	var i, j;
	var start = 1;
	var len = sel.options.length;
	
	if (make == -1) {
		make = formObject.c[formObject.c.selectedIndex].value;
	}
	
	// Remove all elements from options
	for (i = len - 1; i >= 0; i--) {
		sel.options[i] = null;
	}
	
	if (defaultText != -1) {
		sel.options[0] = new Option(defaultText, "-1", "true", "true");
	} else {
		start = 0;
	}

	// No make selected
	if (make == -1) {
		return;
	}

	// Fill up model-option
	for (i = 0, j = start; i < CategoryArray.length; i++) {
		var s, k;
		var m = CategoryArray[i];
						
		if (m[0] == make) {
			sel.options[j] = new Option(m[1], m[1], "", "");
			
			if (m[1] == model) {
				sel.options[j].selected = true;
			}
			j++;
		}
	}
}
