var courseFinder_select = new Object();
courseFinder_select["option"] = new Array();
courseFinder_select["option"][0] = "Englisch";
courseFinder_select["option"][1] = "Spanisch";
courseFinder_select["option"][2] = "Deutsch";
courseFinder_select["option"][3] = "Italienisch";
courseFinder_select["option"][4] = "Französisch";
courseFinder_select["option"][5] = "Chinesisch";
courseFinder_select["option"][6] = "Arabisch";
courseFinder_select["option"][7] = "Latein";
courseFinder_select["select2"] = new Array();
courseFinder_select["select2"][0] = new Object();
courseFinder_select["select2"][0]["option"] = new Array();
courseFinder_select["select2"][0]["option"][0] = "England";
courseFinder_select["select2"][0]["option"][1] = "Malta";
courseFinder_select["select2"][0]["option"][2] = "Kanada";
courseFinder_select["select2"][0]["option"][3] = "USA";
courseFinder_select["select2"][0]["option"][4] = "Australien";
courseFinder_select["select2"][0]["option"][5] = "Spanien";
courseFinder_select["select2"][0]["option"][6] = "Deutschland";
courseFinder_select["select2"][0]["select3"] = new Array();
courseFinder_select["select2"][0]["select3"][0] = new Object();
courseFinder_select["select2"][0]["select3"][0]["option"] = new Array();
courseFinder_select["select2"][0]["select3"][0]["option"][0] = "Brighton";
courseFinder_select["select2"][0]["select3"][0]["option"][1] = "Brighton für Schüler";
courseFinder_select["select2"][0]["select3"][0]["option"][2] = "London";
courseFinder_select["select2"][0]["select3"][0]["option"][3] = "London für Schüler";
courseFinder_select["select2"][0]["select3"][0]["option"][4] = "Devon";
courseFinder_select["select2"][0]["select3"][0]["option"][5] = "Devon für Schüler";
courseFinder_select["select2"][0]["select3"][0]["option"][6] = "Bournemouth Kick and Talk für Schüler";
courseFinder_select["select2"][0]["select3"][0]["option"][7] = "Isle of Wight Surf and Talk für Schüler";
courseFinder_select["select2"][0]["select3"][1] = new Object();
courseFinder_select["select2"][0]["select3"][1]["option"] = new Array();
courseFinder_select["select2"][0]["select3"][1]["option"][0] = "St. Julian's";
courseFinder_select["select2"][0]["select3"][1]["option"][1] = "St. Julian's für Schüler";
courseFinder_select["select2"][0]["select3"][1]["option"][2] = "St. Paul's Bay";
courseFinder_select["select2"][0]["select3"][1]["option"][3] = "St. Paul's Bay für Schüler";
courseFinder_select["select2"][0]["select3"][2] = new Object();
courseFinder_select["select2"][0]["select3"][2]["option"] = new Array();
courseFinder_select["select2"][0]["select3"][2]["option"][0] = "Toronto";
courseFinder_select["select2"][0]["select3"][2]["option"][1] = "Toronto für Schüler";
courseFinder_select["select2"][0]["select3"][2]["option"][2] = "Calgary";
courseFinder_select["select2"][0]["select3"][2]["option"][3] = "Vancouver";
courseFinder_select["select2"][0]["select3"][2]["option"][4] = "Montreal";
courseFinder_select["select2"][0]["select3"][2]["option"][5] = "Montreal für Schüler";
courseFinder_select["select2"][0]["select3"][2]["option"][6] = "Ottawa";
courseFinder_select["select2"][0]["select3"][2]["option"][7] = "Victoria";
courseFinder_select["select2"][0]["select3"][3] = new Object();
courseFinder_select["select2"][0]["select3"][3]["option"] = new Array();
courseFinder_select["select2"][0]["select3"][3]["option"][0] = "New York";
courseFinder_select["select2"][0]["select3"][3]["option"][1] = "New York für Schüler";
courseFinder_select["select2"][0]["select3"][3]["option"][2] = "Los Angeles";
courseFinder_select["select2"][0]["select3"][3]["option"][3] = "Orange County";
courseFinder_select["select2"][0]["select3"][3]["option"][4] = "Orange County für Schüler";
courseFinder_select["select2"][0]["select3"][3]["option"][5] = "San Francisco";
courseFinder_select["select2"][0]["select3"][3]["option"][6] = "Boston";
courseFinder_select["select2"][0]["select3"][3]["option"][7] = "Boston für Schüler";
courseFinder_select["select2"][0]["select3"][3]["option"][8] = "Miami";
courseFinder_select["select2"][0]["select3"][4] = new Object();
courseFinder_select["select2"][0]["select3"][4]["option"] = new Array();
courseFinder_select["select2"][0]["select3"][4]["option"][0] = "Sydney";
courseFinder_select["select2"][0]["select3"][5] = new Object();
courseFinder_select["select2"][0]["select3"][5]["option"] = new Array();
courseFinder_select["select2"][0]["select3"][5]["option"][0] = "Mallorca";
courseFinder_select["select2"][0]["select3"][6] = new Object();
courseFinder_select["select2"][0]["select3"][6]["option"] = new Array();
courseFinder_select["select2"][0]["select3"][6]["option"][0] = "Oberwesel für Schüler";
courseFinder_select["select2"][0]["select3"][6]["option"][1] = "Frankfurt für Schüler";
courseFinder_select["select2"][1] = new Object();
courseFinder_select["select2"][1]["option"] = new Array();
courseFinder_select["select2"][1]["option"][0] = "Spanien";
courseFinder_select["select2"][1]["option"][1] = "Kuba";
courseFinder_select["select2"][1]["option"][2] = "Mexiko";
courseFinder_select["select2"][1]["select3"] = new Array();
courseFinder_select["select2"][1]["select3"][0] = new Object();
courseFinder_select["select2"][1]["select3"][0]["option"] = new Array();
courseFinder_select["select2"][1]["select3"][0]["option"][0] = "Barcelona";
courseFinder_select["select2"][1]["select3"][0]["option"][1] = "Barcelona für Schüler";
courseFinder_select["select2"][1]["select3"][0]["option"][2] = "Madrid";
courseFinder_select["select2"][1]["select3"][0]["option"][3] = "Malaga";
courseFinder_select["select2"][1]["select3"][0]["option"][4] = "Malaga für Schüler";
courseFinder_select["select2"][1]["select3"][0]["option"][5] = "Mallorca";
courseFinder_select["select2"][1]["select3"][1] = new Object();
courseFinder_select["select2"][1]["select3"][1]["option"] = new Array();
courseFinder_select["select2"][1]["select3"][1]["option"][0] = "Havana";
courseFinder_select["select2"][1]["select3"][2] = new Object();
courseFinder_select["select2"][1]["select3"][2]["option"] = new Array();
courseFinder_select["select2"][1]["select3"][2]["option"][0] = "Playa del Carmen";
courseFinder_select["select2"][1]["select3"][2]["option"][1] = "Playa del Carmen für Schüler";
courseFinder_select["select2"][2] = new Object();
courseFinder_select["select2"][2]["option"] = new Array();
courseFinder_select["select2"][2]["option"][0] = "Deutschland";
courseFinder_select["select2"][2]["select3"] = new Array();
courseFinder_select["select2"][2]["select3"][0] = new Object();
courseFinder_select["select2"][2]["select3"][0]["option"] = new Array();
courseFinder_select["select2"][2]["select3"][0]["option"][0] = "Frankfurt";
courseFinder_select["select2"][2]["select3"][0]["option"][1] = "Düsseldorf";
courseFinder_select["select2"][3] = new Object();
courseFinder_select["select2"][3]["option"] = new Array();
courseFinder_select["select2"][3]["option"][0] = "Italien";
courseFinder_select["select2"][3]["select3"] = new Array();
courseFinder_select["select2"][3]["select3"][0] = new Object();
courseFinder_select["select2"][3]["select3"][0]["option"] = new Array();
courseFinder_select["select2"][3]["select3"][0]["option"][0] = "Rom";
courseFinder_select["select2"][3]["select3"][0]["option"][1] = "Rom für Schüler";
courseFinder_select["select2"][3]["select3"][0]["option"][2] = "Florenz";
courseFinder_select["select2"][3]["select3"][0]["option"][3] = "Kalabrien";
courseFinder_select["select2"][4] = new Object();
courseFinder_select["select2"][4]["option"] = new Array();
courseFinder_select["select2"][4]["option"][0] = "Frankreich";
courseFinder_select["select2"][4]["option"][1] = "Kanada";
courseFinder_select["select2"][4]["select3"] = new Array();
courseFinder_select["select2"][4]["select3"][0] = new Object();
courseFinder_select["select2"][4]["select3"][0]["option"] = new Array();
courseFinder_select["select2"][4]["select3"][0]["option"][0] = "Paris";
courseFinder_select["select2"][4]["select3"][0]["option"][1] = "Paris für Schüler";
courseFinder_select["select2"][4]["select3"][0]["option"][2] = "Nizza";
courseFinder_select["select2"][4]["select3"][0]["option"][3] = "Nizza für Schüler";
courseFinder_select["select2"][4]["select3"][0]["option"][4] = "Biarritz für Schüler";
courseFinder_select["select2"][4]["select3"][1] = new Object();
courseFinder_select["select2"][4]["select3"][1]["option"] = new Array();
courseFinder_select["select2"][4]["select3"][1]["option"][0] = "Montreal";
courseFinder_select["select2"][4]["select3"][1]["option"][1] = "Montreal für Schüler";
courseFinder_select["select2"][5] = new Object();
courseFinder_select["select2"][5]["option"] = new Array();
courseFinder_select["select2"][5]["option"][0] = "China";
courseFinder_select["select2"][5]["select3"] = new Array();
courseFinder_select["select2"][5]["select3"][0] = new Object();
courseFinder_select["select2"][5]["select3"][0]["option"] = new Array();
courseFinder_select["select2"][5]["select3"][0]["option"][0] = "Peking";
courseFinder_select["select2"][5]["select3"][0]["option"][1] = "Peking für Schüler";
courseFinder_select["select2"][6] = new Object();
courseFinder_select["select2"][6]["option"] = new Array();
courseFinder_select["select2"][6]["option"][0] = "Marokko";
courseFinder_select["select2"][6]["select3"] = new Array();
courseFinder_select["select2"][6]["select3"][0] = new Object();
courseFinder_select["select2"][6]["select3"][0]["option"] = new Array();
courseFinder_select["select2"][6]["select3"][0]["option"][0] = "Rabat";
courseFinder_select["select2"][7] = new Object();
courseFinder_select["select2"][7]["option"] = new Array();
courseFinder_select["select2"][7]["option"][0] = "Deutschland";
courseFinder_select["select2"][7]["select3"] = new Array();
courseFinder_select["select2"][7]["select3"][0] = new Object();
courseFinder_select["select2"][7]["select3"][0]["option"] = new Array();
courseFinder_select["select2"][7]["select3"][0]["option"][0] = "Frankfurt";


			function courseFinder_updateSelects(lev, textLev2, textLev3)
			{
				var sel1 = document.getElementById('sel1');
				var sel2 = document.getElementById('sel2');
				var sel3 = document.getElementById('sel3');
				
				document.getElementById('cf-submit').disabled = true;
				
				if (sel1.length > 0) {
					var selectedValue1 = sel1.options[sel1.selectedIndex].value;
				}
				if (sel2.length > 0) {
					var selectedValue2 = sel2.options[sel2.selectedIndex].value;
				}
				if (sel3.length > 0) {
					var selectedValue3 = sel3.options[sel3.selectedIndex].value;
				}
				
				if (lev == 1) {
					if (selectedValue1 == 999) {
						courseFinder_removeOptions(sel2);
						courseFinder_removeOptions(sel3);
						return;
					}
					else {
						optionsSel2 = courseFinder_select["select2"][selectedValue1]["option"];
	
						courseFinder_removeOptions(sel2);
						courseFinder_removeOptions(sel3);
						courseFinder_addOptions(sel2, optionsSel2, textLev2);
					}
				}
				
				if (lev == 2) {
					if (selectedValue2 == 999) {
						courseFinder_removeOptions(sel3);
						return;
					}
					else {				
						optionsSel3 = courseFinder_select["select2"][selectedValue1]["select3"][selectedValue2]["option"]; 
	
						courseFinder_removeOptions(sel3);
						courseFinder_addOptions(sel3, optionsSel3, textLev3);
					}
				}
			}
			
			function courseFinder_removeOptions(elSel)
			{
			  var i;
			  for (i = elSel.length - 1; i>=0; i--) {
			      elSel.remove(i);
			  }
			  elSel.disabled = true;
			}
			
			function courseFinder_addOptions(elSel, aOpt, chooseText)
			{
			  var i;
			  
			  var elOptNew = document.createElement('option');
			  elOptNew.text = chooseText;
			  elOptNew.value = 999;
			  elOptNew.style.display = "none";
			
			  try {
			    elSel.add(elOptNew, null); // standards compliant; doesn't work in IE
			  }
			  catch(ex) {
			    elSel.add(elOptNew); // IE only
			  }			  
			  
			  for (i=0; i<aOpt.length; i++) {
				  var elOptNew = document.createElement('option');
				  elOptNew.text = aOpt[i];
				  elOptNew.value = i;
				
				  try {
				    elSel.add(elOptNew, null); // standards compliant; doesn't work in IE
				  }
				  catch(ex) {
				    elSel.add(elOptNew); // IE only
				  }
			  }
			  
			  elSel.disabled = false;
			}
