// --- Haupt-Seiten ---
//Dropdown-Feld "Standort"
function StandortChange () {

  if (document.Dropdown.Standorte.selectedIndex == 1) {
    document.Dropdown.Standorte.selectedIndex = 0;
  } //if
  else {    
    Fenster = window.open("../" + document.Dropdown.Standorte.options[document.Dropdown.Standorte.selectedIndex].value, "_blank", "toolbar=yes,menubar=yes,scrollbars=yes,status=yes,resizable=yes,location=yes");
	Fenster.window.focus();    	
  } //else	

} //function

//<< Suche-Seite >>
function NiederlassungChange () {

  if (document.fmSuche.Niederlassungen.selectedIndex == 1) {
    document.fmSuche.Niederlassungen.selectedIndex = 0;
  } //if
  
  if (document.fmSuche.Niederlassungen.selectedIndex == 3) {
    document.fmSuche.Niederlassungen.selectedIndex = 0;
  } //if

} //function


//<< Jugendliche-Seite >>
function StartenClick () {

  if (document.Jugend.Ort.options[document.Jugend.Ort.selectedIndex].value != "nahe") {
    Fenster = window.open("../" + document.Jugend.Ort.options[document.Jugend.Ort.selectedIndex].value, "NewWindow", "toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes,location=yes,status=yes");    
  } //if
  
} //function


// --- Luebeck-Seiten ---
//Dropdown-Feld "Ausbildung"
function AusbildungChange (nl_ID, filename) {

  if (document.Dropdown.Ausbildung.selectedIndex == 1) {
    document.Dropdown.Ausbildung.selectedIndex = 0;
  } //if
  
  if (document.Dropdown.Ausbildung.selectedIndex > 1) {    	
    window.location.href = filename + "?nl_ID=" + nl_ID + "&mode=ResultDetail&course_ID=" + document.Dropdown.Ausbildung.options[document.Dropdown.Ausbildung.selectedIndex].value;    
  } //if	

} //function

//Dropdown-Feld "Fortbildung"
function FortbildungChange(nl_ID, filename) {

  if (document.Dropdown.Fortbildung.selectedIndex == 1) {
    document.Dropdown.Fortbildung.selectedIndex = 0;
  } //if
  
  if (document.Dropdown.Fortbildung.selectedIndex > 1) {        
    window.location.href = filename + "?nl_ID=" + nl_ID + "&mode=ResultList&catchword_ID=" + document.Dropdown.Fortbildung.options[document.Dropdown.Fortbildung.selectedIndex].value;
  } //if	

} //function


//Admin-Seiten
function MoveOptions (SelectFrom, SelectTo) {
  
  l = SelectFrom.length; 
  
  //Verschiebt alle markierten Zeilen von einer zur anderen Listbox
  for (i=0; i<l; i++) { 
    if (SelectFrom.options[i].selected) {
      //Einfügen  
      NewEntry = new Option(SelectFrom.options[i].text);
      NewEntry.value = SelectFrom.options[i].value;      
      SelectTo.options[SelectTo.length] = NewEntry;       
    }//if  
  } //for
  
  
  //hier müssen die anderen bereits implemetierten Parameter gesetzt werden
  isIE = ie; //true
  Version = ver; //4
  //bis hier
  
  //Alte Elemente austragen    
  i=0;
  while (i < l) { 
    if (SelectFrom.options[i].selected) {            
      if ( (isIE) && (Version < 5) ) {
        for (j=i+1; j<l; j++) {  //Alle aufrücken
          k = j - 1;
          SelectFrom.options[k].text = SelectFrom.options[j].text;
          SelectFrom.options[k].value = SelectFrom.options[j].value;
          SelectFrom.options[k].selected = SelectFrom.options[j].selected;
        } //for      
        SelectFrom.options[l-1] = null; //letztes Element löschen
      } //if  
      else {
        SelectFrom.options[i] = null; //aktuelles Element löschen
      } //else  
      l--;
    } //if
    else {
      i++;
    } //else  
  } //while   
     
  
  //Neues Array sortieren
  NewEntry = new Option("Dummy");
  l = SelectTo.length;
  for (i=0; i<l; i++) {
    for (j=i+1; j<l; j++) {
      if (SelectTo.options[i].text > SelectTo.options[j].text) {
        NewEntry.text = SelectTo.options[i].text;        
        NewEntry.value = SelectTo.options[i].value;
        SelectTo.options[i].text = SelectTo.options[j].text;
        SelectTo.options[i].value = SelectTo.options[j].value;
        SelectTo.options[j].text = NewEntry.text;      
        SelectTo.options[j].value = NewEntry.value;      
      } //if  
    } //for    
  } //for
         
}//function