var main_cat = ""; var arr_main_cats = Array(); arr_main_cats[1] = Array("1", "BILD"); arr_main_cats[2] = Array("2", "VIDEO"); arr_main_cats[3] = Array("3", "MUSIK"); arr_main_cats[4] = Array("4", "TEXT"); //-------------------------------------------------------------------- function change_main_cat(fieldname, formname, thevalue) { if (thevalue == "") { main_cat = thevalue; fill_option('0', formname); } else { var itemvalues = document[formname][fieldname]; var iv_len = (itemvalues.length == undefined) ? 1 : itemvalues.length; for (var i = 0; i < iv_len; i++) { if (itemvalues[i].value == thevalue) { itemvalues[i].checked = true; if (thevalue != main_cat) { main_cat = thevalue; fill_option('0', formname); } } else { } } } } //-------------------------------------------------------------------- function fill_option(changed_option, formname) { if (arr_main_cats[main_cat] == undefined) { document[formname]["cat_1"].options.length = 0; document[formname]["cat_2"].options.length = 0; document[formname]["cat_3[]"].options.length = 0; } else { // Kategorien zu dieser Hauptkategorie auslesen: arr_optionvalues = arr_optionvalues_master[arr_main_cats[main_cat][0]][0]["subcat"]; var cat_1 = document[formname]["cat_1"]; if ((cat_1.selectedIndex == undefined) || (cat_1.selectedIndex < 0) || (changed_option == "0")) { document[formname]["cat_1"].options.length = arr_optionvalues.length; for (var c1 = 0; c1 < arr_optionvalues.length; c1++) { document[formname]["cat_1"].options[c1].value = arr_optionvalues[c1]["value"]; document[formname]["cat_1"].options[c1].text = arr_optionvalues[c1]["title"]; document[formname]["cat_1"].options[c1].selected = false; } document[formname]["cat_2"].options.length = 0; document[formname]["cat_3[]"].options.length = 0; } else { var cat_1_value = cat_1[cat_1.selectedIndex].value; for (var c1 = 0; c1 < arr_optionvalues.length; c1++) { var arr_c1_data = arr_optionvalues[c1]; if (cat_1_value == arr_c1_data["value"]) { if (changed_option == 1) { document[formname]["cat_2"].options.length = 0; if (arr_c1_data["subcat"] != undefined) { document[formname]["cat_2"].options.length = arr_c1_data["subcat"].length; for (var c2 = 0; c2 < arr_c1_data["subcat"].length; c2++) { document[formname]["cat_2"].options[c2].value = arr_c1_data["subcat"][c2]["value"]; document[formname]["cat_2"].options[c2].text = arr_c1_data["subcat"][c2]["title"]; document[formname]["cat_2"].options[c2].selected = false; } } document[formname]["cat_3[]"].options.length = 0; //bilder -> 3.Spalte füllen if (arr_c1_data["value"] == '5' || arr_c1_data["value"] == '6') { arr_c2_data = arr_c1_data["subcat"]; for (var i = 0; i < arr_c2_data.length; i++) { if (arr_c2_data[i]["value"] == '28') { arr_c3_data = arr_c2_data[i]["subcat"]; } if (arr_c2_data[i]["value"] == '33') { arr_c3_data = arr_c2_data[i]["subcat"]; } } document[formname]["cat_3[]"].options.length = arr_c3_data.length; for (var c3 = 0; c3 < arr_c3_data.length; c3++) { document[formname]["cat_3[]"].options[c3].value = arr_c3_data[c3]["value"]; document[formname]["cat_3[]"].options[c3].text = arr_c3_data[c3]["title"]; document[formname]["cat_3[]"].options[c3].selected = false; } } } /* if (changed_option == 2) { var cat_2 = document[formname]["cat_2"]; var cat_2_index = cat_2.selectedIndex; var cat_2_value = cat_2[cat_2.selectedIndex].value; for (var c2 = 0; c2 < arr_c1_data["subcat"].length; c2++) { var arr_c2_data = arr_c1_data["subcat"][c2]; if (cat_2_value == arr_c2_data["value"]) { document[formname]["cat_3[]"].options.length = 0; if (arr_c2_data["subcat"] != undefined) { document[formname]["cat_3[]"].options.length = arr_c2_data["subcat"].length; for (var c3 = 0; c3 < arr_c2_data["subcat"].length; c3++) { document[formname]["cat_3[]"].options[c3].value = arr_c2_data["subcat"][c3]["value"]; document[formname]["cat_3[]"].options[c3].text = arr_c2_data["subcat"][c3]["title"]; document[formname]["cat_3[]"].options[c3].selected = false; } } } } } */ } } } } } //-------------------------------------------------------------------- var arr_optionvalues_master = Array(); arr_optionvalues_master[1] = [ { "value": "1", "title": "Pictures", "subcat": [ { "value": "5", "title": "2-Dimensional", "subcat": [ { "value": "22", "title": "Painting" } , { "value": "23", "title": "Drawing" } , { "value": "24", "title": "Printmaking" } , { "value": "25", "title": "Photography" } , { "value": "26", "title": "Graphic Design" } , { "value": "27", "title": "Illustration" } , { "value": "28", "title": "Other", "subcat": [ { "value": "34", "title": "Figurative" } , { "value": "35", "title": "Abstract" } , { "value": "36", "title": "Landscape" } , { "value": "37", "title": "Portrait" } , { "value": "38", "title": "Black&White" } , { "value": "39", "title": "Minimalism" } , { "value": "40", "title": "Poster" } , { "value": "41", "title": "Typography" } , { "value": "42", "title": "Live-drawing" } , { "value": "43", "title": "Digital" } , { "value": "44", "title": "Web Design" } ] } ] } , { "value": "6", "title": "3-Dimensional", "subcat": [ { "value": "29", "title": "Sculpture" } , { "value": "30", "title": "Installation" } , { "value": "31", "title": "Fashion" } , { "value": "32", "title": "Architecture" } , { "value": "33", "title": "Other", "subcat": [ { "value": "45", "title": "Figurative" } , { "value": "46", "title": "Abstract" } , { "value": "47", "title": "Model" } , { "value": "48", "title": "Interior" } , { "value": "49", "title": "Exterior" } , { "value": "50", "title": "Womenswear" } , { "value": "51", "title": "Menswear" } , { "value": "52", "title": "Assessoires" } , { "value": "53", "title": "Jewellery" } , { "value": "54", "title": "Beauty" } , { "value": "55", "title": "Object" } ] } ] } ] } ]; arr_optionvalues_master[2] = [ { "value": "2", "title": "Video", "subcat": [ { "value": "7", "title": "Film" } , { "value": "8", "title": "Clip" } , { "value": "9", "title": "Animation" } , { "value": "10", "title": "Documentation" } , { "value": "11", "title": "Performance" } , { "value": "12", "title": "Other", "subcat": [ { "value": "56", "title": "Abstract" } , { "value": "57", "title": "Stop-Motion" } , { "value": "58", "title": "Dia-Show" } , { "value": "59", "title": "Digital" } , { "value": "60", "title": "Trailer" } , { "value": "61", "title": "Teaser" } , { "value": "62", "title": "TV Spot" } , { "value": "63", "title": "Amateur" } , { "value": "64", "title": "HD (High Definition)" } , { "value": "65", "title": "Ego Perspective" } , { "value": "66", "title": "Theatre" } , { "value": "67", "title": "Screensaver" } ] } ] } ]; arr_optionvalues_master[3] = [ { "value": "3", "title": "Audio", "subcat": [ { "value": "13", "title": "Music", "subcat": [ { "value": "68", "title": "Alternative" } , { "value": "69", "title": "Blues" } , { "value": "70", "title": "Country" } , { "value": "71", "title": "Dance" } , { "value": "72", "title": "Electronic" } , { "value": "73", "title": "Folk" } , { "value": "74", "title": "Hip Hop" } , { "value": "75", "title": "Jazz" } , { "value": "76", "title": "Classic" } , { "value": "77", "title": "Latino" } , { "value": "78", "title": "Metal" } , { "value": "79", "title": "Pop" } , { "value": "80", "title": "R&B" } , { "value": "81", "title": "Reggae" } , { "value": "82", "title": "Rock" } , { "value": "83", "title": "Vocal" } , { "value": "84", "title": "World" } , { "value": "85", "title": "Other" } ] } , { "value": "14", "title": "Sound" } , { "value": "15", "title": "Report" } ] } ]; arr_optionvalues_master[4] = [ { "value": "4", "title": "Literature", "subcat": [ { "value": "16", "title": "Novel" } , { "value": "17", "title": "Poem" } , { "value": "18", "title": "Drama" } , { "value": "19", "title": "Short story" } , { "value": "20", "title": "Novella" } , { "value": "21", "title": "Other" } ] } ];