 // ---------
 // die gäste. alte version in der das form noch mit namen in der funktion angesprochen wird
 // ---------

function wahl_alle_ich () {

for( var i = 0; i< document.Kommentar_Artikel.elements["Komm_seh_gaeste"+"[]"].length; i++ )  {
document.Kommentar_Artikel.elements["Komm_seh_gaeste"+"[]"][i].checked = false;
document.getElementsByName("Komm_seh_tex_gae")[i].style.color = "#a19e90";                                 }

 for( var j = document.Kommentar_Artikel.elements["Komm_seh_gaeste"+"[]"].length; j< (document.Kommentar_Artikel.elements["Komm_seh_gaeste"+"[]"].length + document.Kommentar_Artikel.elements["Komm_seh_gruppen"+"[]"].length); j++ )  {
/*alert(j);*/
document.Kommentar_Artikel.elements["Komm_seh_gruppen"+"[]"][j-document.Kommentar_Artikel.elements["Komm_seh_gaeste"+"[]"].length].checked = false;
document.getElementsByName("Komm_seh_tex_gae")[j].style.color = "#a19e90";                                 }

document.getElementsByName("Komm_seh_tex_nur_alle")[0].style.color = "#33312c";
document.getElementsByName("Komm_seh_tex_nur_alle")[1].style.color = "#33312c";
                                
                                }
 
 function wahl_gaeste_gruppe () {
 for( var i = 0; i< (document.Kommentar_Artikel.elements["Komm_seh_gaeste"+"[]"].length + document.Kommentar_Artikel.elements["Komm_seh_gruppen"+"[]"].length); i++ )  {
 document.getElementsByName("Komm_seh_tex_gae")[i].style.color = "#33312c";
                                }

document.getElementsByName("Komm_seh_tex_nur_alle")[0].style.color = "#a19e90";
document.getElementsByName("Komm_seh_tex_nur_alle")[1].style.color = "#a19e90";
document.Kommentar_Artikel.elements["Komm_seh_alle"][0].checked = false;
document.Kommentar_Artikel.elements["Komm_seh_alle"][1].checked = false;
                             }
 
 // ---------------
 // die liste der gäste, hier vaiable gehalten für verschiedene form. 
 // ---------------

 function wahl_alle_ich_termine (fn_form) {
/* document[fn_form].elements = document.fn_form.elements nur kann der name in der ersten variante eine variable sein*/
for( var i = 0; i< document[fn_form].elements["Komm_seh_gaeste"+"[]"].length; i++ )  {
document[fn_form].elements["Komm_seh_gaeste"+"[]"][i].checked = false;
document.getElementsByName("Komm_seh_tex_gae")[i].style.color = "#a19e90";                                 }

 for( var j = document[fn_form].elements["Komm_seh_gaeste"+"[]"].length; j< (document[fn_form].elements["Komm_seh_gaeste"+"[]"].length + document[fn_form].elements["Komm_seh_gruppen"+"[]"].length); j++ )  {
document[fn_form].elements["Komm_seh_gruppen"+"[]"][j-document[fn_form].elements["Komm_seh_gaeste"+"[]"].length].checked = false;
document.getElementsByName("Komm_seh_tex_gae")[j].style.color = "#a19e90";                                 }

document.getElementsByName("Komm_seh_tex_nur_alle")[0].style.color = "#33312c";
document.getElementsByName("Komm_seh_tex_nur_alle")[1].style.color = "#33312c";
                                
                                }
 
 function wahl_gaeste_gruppe_termine (fn_form) {
 /*alert(fn_form);*/
 for( var i = 0; i< (document[fn_form].elements["Komm_seh_gaeste"+"[]"].length + document[fn_form].elements["Komm_seh_gruppen"+"[]"].length); i++ )  {
 document.getElementsByName("Komm_seh_tex_gae")[i].style.color = "#33312c";
                                }

document.getElementsByName("Komm_seh_tex_nur_alle")[0].style.color = "#a19e90";
document.getElementsByName("Komm_seh_tex_nur_alle")[1].style.color = "#a19e90";
document[fn_form].elements["Komm_seh_alle"][0].checked = false;
document[fn_form].elements["Komm_seh_alle"][1].checked = false;
                             }
 
 
 // mein_wr: beim löschen von gästen wird die kopfzeile verändert
 
 // VORSICHT name ist in span nicht zugelassen, nur ID. warum das hier funktioniert ist merkwürdig!!!!
 // in einer anderen funktion NUR mit ID - zuweisung möglich!!!!!
 // HIER: name & indice . nur mit span - name geht nicht, wenn das span mit name als array angesprochen wird, schon 
 // geht auch: document.getElementsByName("xy")[0] mit der definition span name='xy' . bleibt aber: in span kein name zugelassen!!!
 
 
 
 
function gast_loeschen(num,  txt_beitr) {

if (document.Gaeste_Gruppen.elements["gast_loesch"+"[]"][num].checked)  {
/*alert(txt_beitr);*/
document.getElementsByName("scb_loe")[num].innerHTML = "wird gel&ouml;scht!"; 
document.getElementsByName("sg_name")[num].style.color = "#9c370e";
document.getElementsByName("sg_beitr")[num].style.color = "#9c370e";
document.getElementsByName("scb_loe")[num].style.color = "#9c370e";
}

if (!document.Gaeste_Gruppen.elements["gast_loesch"+"[]"][num].checked) { 
document.getElementsByName("scb_loe")[num].innerHTML = "l&ouml;schen?"; 
document.getElementsByName("sg_name")[num].style.color = "#a19e90";
document.getElementsByName("sg_beitr")[num].style.color = "#a19e90";
document.getElementsByName("scb_loe")[num].style.color = "#a19e90";

} 
  
 
}
 
 
function gruppe_loeschen(num,  nameGr) {
if (document.Gruppen_gestalten.elements["gruppe_loesch"+"[]"][num].checked)  {
document.getElementsByName("AnzGrName")[num].style.color = "#9c370e";
document.getElementsByName("sg_loe_txt")[num].innerHTML = "wird gel&ouml;scht!"; 
document.getElementsByName("sg_loe_txt")[num].style.color = "#9c370e";
}

if (!document.Gruppen_gestalten.elements["gruppe_loesch"+"[]"][num].checked) { 
document.getElementsByName("AnzGrName")[num].style.color = "#a19e90";
document.getElementsByName("sg_loe_txt")[num].innerHTML = "&nbsp;"; 
} 
}
 
  // termine

 function zuweisen_datum(dat, dat_org) {
document.Termine_gestalten.termin_datum.value = dat;
document.Termine_gestalten.termin_dat_org.value = dat_org;
  }
   
function pruef_std(){
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;
 /*alert(document.Termine_gestalten.termin_uhr.value);*/
   for (i = 0; i < document.Termine_gestalten.termin_uhr.value.length && IsNumber == true; i++)  { 
      Char = document.Termine_gestalten.termin_uhr.value.charAt(i); 
      if (ValidChars.indexOf(Char) == -1 || document.Termine_gestalten.termin_uhr.value >24 || document.Termine_gestalten.termin_uhr.value < 0) {  IsNumber = false; document.Termine_gestalten.termin_uhr.value = 20;    }
      }
   
   }

function pruef_min(){
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;
   for (i = 0; i < document.Termine_gestalten.termin_min.value.length && IsNumber == true; i++)  { 
      Char = document.Termine_gestalten.termin_min.value.charAt(i); 
      if (ValidChars.indexOf(Char) == -1 || document.Termine_gestalten.termin_min.value > 60 || document.Termine_gestalten.termin_min.value < 0) {  IsNumber = false; document.Termine_gestalten.termin_min.value = 15;    }
      }
   
   }



 // ------------------------------------------------------------
 // bilder im menue für die eigenen seiten
 // ------------------------------------------------------------

MRLeer = new Image(); 
MRLeer.src = "/bilder3/seite/leer_mr.gif";    

MRPfeilAend = new Image(); 
MRPfeilAend.src = "/bilder3/seite/pfeil_mr_aend.gif";     

MRPfeilAendAgbl = new Image(); 
MRPfeilAendAgbl.src = "/bilder3/seite/pfeilAgbl_mr_aend.gif";     

MRBildPlus = new Image(); 
MRBildPlus.src = "/bilder3/seite/pfeilBildPlus_mr.gif";    

MRBildPlusAgbl = new Image();
MRBildPlusAgbl.src = "/bilder3/seite/pfeilAgblBildPlus_mr.gif";     

MRPlus = new Image(); 
MRPlus.src = "/bilder3/seite/plus_mr.gif";    

MRPlusAgbl = new Image();
MRPlusAgbl.src = "/bilder3/seite/plusAgbl_mr.gif";     

MRMinus = new Image(); 
MRMinus.src = "/bilder3/seite/minus_mr.gif";     

MRMinusAgbl = new Image(); 
MRMinusAgbl.src = "/bilder3/seite/minusAgbl_mr.gif";     


function ZeileZu (fn_form, thomas, Bildobjekt1, num, Bild2, Bildobjekt2, zeile, feldAktiv, feldPassiv1, feldPassiv2) {
 //alert(fn_form);
 document.images[thomas].src = Bildobjekt1.src;  document.images[Bild2].src = Bildobjekt2.src;
 document.getElementsByName("mr_ueb_tit")[feldAktiv].style.color = "#9c370e";   
 document.getElementsByName("mr_ueb_tit")[feldPassiv1].style.color = "#a19e90";   
 document.getElementsByName("mr_ueb_tit")[feldPassiv2].style.color = "#a19e90";
 document.Form_Eingabe_MS_mr.dummi.value =   document.Form_Eingabe_MS_mr.MS_mr_Ueber.value ;
var Char;
Char = document.Form_Eingabe_MS_mr.dummi.value;
//alert(Char);
  }

var TxtAktUe = "#8b8168";
var TxtIdleUe = "#535149";
var InpAktUe = "#d3e58d";
var InpIdleUe = "#dbd7cb";

var TxtAktOp = "#8b8168";
var TxtIdleOp = "#8b8168";
var InpAktOp= "#d3e58d";
var InpIdleOp = "#d2cec3";

var TxtAktBe = "#8b8168";
var TxtIdleBe = "#8b8168";
var InpAktBe = "#d3e58d";
var InpIdleBe = "#d2cec3";

function MR_ZeileUnten (zeile, typ) {
 //alert(typ);

if (typ == "Ueber") { 
//alert("Thomas");
// zustände: neue zeiel am ende: vaiable zeile aus funktionsaufruf
// neue zeile nach MS_ZeileNrAend: document.Form_Eingabe_MS_mr.MS_mrZeile_aktiv.value = 1;
// neue zeileam edne: document.Form_Eingabe_MS_mr.MS_mrZeile_aktiv.value = 2;
// zeile bearbeiten: document.Form_Eingabe_MS_mr.MS_mrZeile_aktiv.value = 0;
var zeile_akt = document.Form_Eingabe_MS_mr.MS_mrZeile_bearbeitet.value; // in dem wert steht der index der zeile, die angeklickt wurde 
//								document.Form_Eingabe_MS_mr.MS_mrZeile_bearbeitet.value = zeile_index;

document.images["pfeilUeber"].src = MRPfeilAend.src;  document.images["pfeilOption"].src = MRLeer.src; document.images["pfeilBemerkung"].src = MRLeer.src;
document.images["pfeilTitel"].src = MRLeer.src;
document.Form_Eingabe_MS_mr.MS_mr_Ueber.style.color = TxtAktUe;   
document.Form_Eingabe_MS_mr.MS_mr_Ueber.style.backgroundColor = InpAktUe;   

document.Form_Eingabe_MS_mr.MS_mr_Option.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_mr.MS_mr_Option.style.backgroundColor = InpIdleOp;   
document.Form_Eingabe_MS_mr.MS_mr_Angabe.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_mr.MS_mr_Angabe.style.backgroundColor = InpIdleOp;   

document.Form_Eingabe_MS_mr.MS_mr_Beschreibung.style.color = TxtIdleBe;   
document.Form_Eingabe_MS_mr.MS_mr_Beschreibung.style.backgroundColor = InpIdleBe;   

if( document.Form_Eingabe_MS_mr.MS_mrZeile_aktiv.value == 0 && document.Form_Eingabe_MS_mr.MS_ZeileTyp.value == "ueber") {
document.getElementById("head_eingabe_mr").innerHTML =  "Die &Uuml;berschrift &auml;ndern";
document.getElementById("mr_speich_txt").innerHTML =  "Die &Uuml;berschrift";
document.getElementById("form_mr_speich").innerHTML =  "speichern";
}

if( document.Form_Eingabe_MS_mr.MS_mrZeile_aktiv.value == 0 && document.Form_Eingabe_MS_mr.MS_ZeileTyp.value != "ueber") {
document.getElementById("head_eingabe_mr").innerHTML =  "Zeile in eine &Uuml;berschrift &auml;ndern";
document.getElementById("mr_speich_txt").innerHTML =  "Zeile als &Uuml;berschrift";
document.getElementById("form_mr_speich").innerHTML =  "speichern";
document.Form_Eingabe_MS_mr.MS_ZeileTyp.value = "ueber";
}

if( document.Form_Eingabe_MS_mr.MS_mrZeile_aktiv.value == 1 || document.Form_Eingabe_MS_mr.MS_mrZeile_aktiv.value == 2) {
document.getElementById("head_eingabe_mr").innerHTML =  "Eine &Uuml;berschrift einf&uuml;gen";
document.getElementById("mr_speich_txt").innerHTML =  "Die &Uuml;berschrift als";
document.getElementById("form_mr_speich").innerHTML =  "neue Zeile einf&uuml;gen";
}


document.Form_Eingabe_MS_mr.MS_ZeileTyp.value = "ueber";

}

if (typ == "Option") { 
document.images["pfeilUeber"].src = MRLeer.src;  document.images["pfeilOption"].src = MRPfeilAend.src; document.images["pfeilBemerkung"].src = MRLeer.src;
document.images["pfeilTitel"].src = MRLeer.src;
document.Form_Eingabe_MS_mr.MS_mr_Ueber.style.color = TxtIdleUe;   
document.Form_Eingabe_MS_mr.MS_mr_Ueber.style.backgroundColor = InpIdleUe;   

document.Form_Eingabe_MS_mr.MS_mr_Option.style.color = TxtAktOp;   
document.Form_Eingabe_MS_mr.MS_mr_Option.style.backgroundColor = InpAktOp;   
document.Form_Eingabe_MS_mr.MS_mr_Angabe.style.color = TxtAktOp;   
document.Form_Eingabe_MS_mr.MS_mr_Angabe.style.backgroundColor = InpAktOp;   

document.Form_Eingabe_MS_mr.MS_mr_Beschreibung.style.color = TxtIdleBe;   
document.Form_Eingabe_MS_mr.MS_mr_Beschreibung.style.backgroundColor = InpIdleBe;   

if( document.Form_Eingabe_MS_mr.MS_mrZeile_aktiv.value == 0 && document.Form_Eingabe_MS_mr.MS_ZeileTyp.value == "angabe") {
document.getElementById("head_eingabe_mr").innerHTML =  "Die Angabe &auml;ndern";
document.getElementById("mr_speich_txt").innerHTML =  "Die Angabe";
document.getElementById("form_mr_speich").innerHTML =  "speichern";
}

if( document.Form_Eingabe_MS_mr.MS_mrZeile_aktiv.value == 0 && document.Form_Eingabe_MS_mr.MS_ZeileTyp.value != "angabe") {
document.getElementById("head_eingabe_mr").innerHTML =  "Zeile in eine Angabe &auml;ndern";
document.getElementById("mr_speich_txt").innerHTML =  "Zeile als Angabe";
document.getElementById("form_mr_speich").innerHTML =  "speichern";
document.Form_Eingabe_MS_mr.MS_ZeileTyp.value = "angabe";
}

if( document.Form_Eingabe_MS_mr.MS_mrZeile_aktiv.value == 1 || document.Form_Eingabe_MS_mr.MS_mrZeile_aktiv.value == 2) {
document.getElementById("head_eingabe_mr").innerHTML =  "Eine Angabe einf&uuml;gen";
document.getElementById("mr_speich_txt").innerHTML =  "Die Angabe als";
document.getElementById("form_mr_speich").innerHTML =  "neue Zeile einf&uuml;gen";
}

document.Form_Eingabe_MS_mr.MS_ZeileTyp.value = "angabe";

}

if (typ == "Bemerk") { 
document.images["pfeilUeber"].src = MRLeer.src;  document.images["pfeilOption"].src = MRLeer.src; document.images["pfeilBemerkung"].src = MRPfeilAend.src;
document.images["pfeilTitel"].src = MRLeer.src;
document.Form_Eingabe_MS_mr.MS_mr_Ueber.style.color = TxtIdleUe;   
document.Form_Eingabe_MS_mr.MS_mr_Ueber.style.backgroundColor = InpIdleUe;   

document.Form_Eingabe_MS_mr.MS_mr_Option.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_mr.MS_mr_Option.style.backgroundColor = InpIdleOp;   
document.Form_Eingabe_MS_mr.MS_mr_Angabe.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_mr.MS_mr_Angabe.style.backgroundColor = InpIdleOp;   

document.Form_Eingabe_MS_mr.MS_mr_Beschreibung.style.color = TxtAktBe;   
document.Form_Eingabe_MS_mr.MS_mr_Beschreibung.style.backgroundColor = InpAktBe;   

if( document.Form_Eingabe_MS_mr.MS_mrZeile_aktiv.value == 0 && document.Form_Eingabe_MS_mr.MS_ZeileTyp.value == "beschr") {
document.getElementById("head_eingabe_mr").innerHTML =  "Den Text &auml;ndern";
document.getElementById("mr_speich_txt").innerHTML =  "Den Text";
document.getElementById("form_mr_speich").innerHTML =  "speichern";
//document.Form_Eingabe_MS_mr.MS_ZeileNrAend.value = zeile;
}

if( document.Form_Eingabe_MS_mr.MS_mrZeile_aktiv.value == 0 && document.Form_Eingabe_MS_mr.MS_ZeileTyp.value != "beschr") {
document.getElementById("head_eingabe_mr").innerHTML =  "Zeile in einen Text &auml;ndern";
document.getElementById("mr_speich_txt").innerHTML =  "Zeile als Text";
document.getElementById("form_mr_speich").innerHTML =  "speichern";
document.Form_Eingabe_MS_mr.MS_ZeileTyp.value = "beschr";
}

if( document.Form_Eingabe_MS_mr.MS_mrZeile_aktiv.value == 1 || document.Form_Eingabe_MS_mr.MS_mrZeile_aktiv.value == 2) {
document.getElementById("head_eingabe_mr").innerHTML =  "Einen Text einf&uuml;gen";
document.getElementById("mr_speich_txt").innerHTML =  "Den Text als";
document.getElementById("form_mr_speich").innerHTML =  "neue Zeile einf&uuml;gen";
}

document.Form_Eingabe_MS_mr.MS_ZeileTyp.value = "beschr";
}

}
  
function MR_ZeileObenAend (zeile,typ, inhalt, inhalt2) {
var zeile_index 			= zeile -1;
var zeile_index_alt 	= document.Form_Eingabe_MS_mr.MS_mrZeile_bearbeitet.value;
if( zeile_index_alt != "") {
document.getElementsByName("img_zeile_plus")[zeile_index_alt].src = MRPlusAgbl.src;
document.getElementsByName("img_zeile_min")[zeile_index_alt].src = MRMinusAgbl.src;
}

document.getElementsByName("img_zeile_min")[zeile_index].src = MRPfeilAend.src;
document.Form_Eingabe_MS_mr.MS_mr_Ueber.disabled = false;
document.Form_Eingabe_MS_mr.MS_mr_Angabe.disabled = false; 
document.Form_Eingabe_MS_mr.MS_mr_Option.disabled = false;
document.Form_Eingabe_MS_mr.MS_mr_Beschreibung.disabled = false; 
//alert(zeile_index);

if (typ == "Ueber") { 
//alert("Thomas");
document.images["pfeilUeber"].src = MRPfeilAend.src;  document.images["pfeilOption"].src = MRLeer.src; document.images["pfeilBemerkung"].src = MRLeer.src;
document.images["pfeilTitel"].src = MRLeer.src;
document.Form_Eingabe_MS_mr.MS_mr_Ueber.style.color = TxtAktUe;   
document.Form_Eingabe_MS_mr.MS_mr_Ueber.style.backgroundColor = InpAktUe;   

document.Form_Eingabe_MS_mr.MS_mr_Option.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_mr.MS_mr_Option.style.backgroundColor = InpIdleOp;   
document.Form_Eingabe_MS_mr.MS_mr_Angabe.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_mr.MS_mr_Angabe.style.backgroundColor = InpIdleOp;   

document.Form_Eingabe_MS_mr.MS_mr_Beschreibung.style.color = TxtIdleBe;   
document.Form_Eingabe_MS_mr.MS_mr_Beschreibung.style.backgroundColor = InpIdleBe;   

document.getElementById("mr_speich_txt").innerHTML =  "";
document.getElementById("form_mr_speich").innerHTML =   "";
document.getElementById("head_eingabe_mr").innerHTML =  "Die &Uuml;berschrift &auml;ndern";
document.Form_Eingabe_MS_mr.MS_mr_Ueber.value =  inhalt;
document.Form_Eingabe_MS_mr.MS_mr_Option.value = "";
document.Form_Eingabe_MS_mr.MS_mr_Angabe.value =  "";
document.Form_Eingabe_MS_mr.MS_mr_Beschreibung.value = "";
document.Form_Eingabe_MS_mr.MS_ZeileTyp.value = "ueber";

}
if (typ == "Option") { 
document.images["pfeilUeber"].src = MRLeer.src;  document.images["pfeilOption"].src = MRPfeilAend.src; document.images["pfeilBemerkung"].src = MRLeer.src;
document.images["pfeilTitel"].src = MRLeer.src;
document.Form_Eingabe_MS_mr.MS_mr_Ueber.style.color = TxtIdleUe;   
document.Form_Eingabe_MS_mr.MS_mr_Ueber.style.backgroundColor = InpIdleUe;   

document.Form_Eingabe_MS_mr.MS_mr_Option.style.color = TxtAktOp;   
document.Form_Eingabe_MS_mr.MS_mr_Option.style.backgroundColor = InpAktOp;   
document.Form_Eingabe_MS_mr.MS_mr_Angabe.style.color = TxtAktOp;   
document.Form_Eingabe_MS_mr.MS_mr_Angabe.style.backgroundColor = InpAktOp;   

document.Form_Eingabe_MS_mr.MS_mr_Beschreibung.style.color = TxtIdleBe;   
document.Form_Eingabe_MS_mr.MS_mr_Beschreibung.style.backgroundColor = InpIdleBe;   

document.getElementById("mr_speich_txt").innerHTML =  "";
document.getElementById("form_mr_speich").innerHTML =   "";
document.getElementById("head_eingabe_mr").innerHTML =  "Die Angabe &auml;ndern";
document.Form_Eingabe_MS_mr.MS_mr_Ueber.value =  "";
document.Form_Eingabe_MS_mr.MS_mr_Option.value =  inhalt;
document.Form_Eingabe_MS_mr.MS_mr_Angabe.value =  inhalt2;
document.Form_Eingabe_MS_mr.MS_mr_Beschreibung.value = "";
document.Form_Eingabe_MS_mr.MS_ZeileTyp.value = "angabe";

}
if (typ == "Bemerk") { 
document.images["pfeilUeber"].src = MRLeer.src;  document.images["pfeilOption"].src = MRLeer.src; document.images["pfeilBemerkung"].src = MRPfeilAend.src;
document.images["pfeilTitel"].src = MRLeer.src;
document.Form_Eingabe_MS_mr.MS_mr_Ueber.style.color = TxtIdleUe;   
document.Form_Eingabe_MS_mr.MS_mr_Ueber.style.backgroundColor = InpIdleUe;   

document.Form_Eingabe_MS_mr.MS_mr_Option.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_mr.MS_mr_Option.style.backgroundColor = InpIdleOp;   
document.Form_Eingabe_MS_mr.MS_mr_Angabe.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_mr.MS_mr_Angabe.style.backgroundColor = InpIdleOp;   

document.Form_Eingabe_MS_mr.MS_mr_Beschreibung.style.color = TxtAktBe;   
document.Form_Eingabe_MS_mr.MS_mr_Beschreibung.style.backgroundColor = InpAktBe;   

document.getElementById("mr_speich_txt").innerHTML =  "";
document.getElementById("form_mr_speich").innerHTML =   "";
document.getElementById("head_eingabe_mr").innerHTML =  "Den Text &auml;ndern";
document.Form_Eingabe_MS_mr.MS_mr_Beschreibung.value =  inhalt;
document.Form_Eingabe_MS_mr.MS_mr_Ueber.value =  "";
document.Form_Eingabe_MS_mr.MS_mr_Option.value = "";
document.Form_Eingabe_MS_mr.MS_mr_Angabe.value =  "";
document.Form_Eingabe_MS_mr.MS_ZeileTyp.value = "beschr";
}
document.Form_Eingabe_MS_mr.MS_mrZeile_bearbeitet.value = zeile_index;
document.Form_Eingabe_MS_mr.MS_mrZeile_aktiv.value = 0;
document.Form_Eingabe_MS_mr.MS_ZeileNrAend.value = zeile;

}
  
function MR_ZeileObenHinWeg (zeile, steuer) {
 //alert(typ);
//alert(steuer);
var zeile_index 			= zeile -1;
var zeile_index_alt 	= document.Form_Eingabe_MS_mr.MS_mrZeile_bearbeitet.value;
if( zeile_index_alt != "") {
document.getElementsByName("img_zeile_plus")[zeile_index_alt].src = MRPlusAgbl.src;
document.getElementsByName("img_zeile_min")[zeile_index_alt].src = MRMinusAgbl.src;
}

document.images["pfeilUeber"].src = MRLeer.src;  document.images["pfeilOption"].src = MRLeer.src; document.images["pfeilBemerkung"].src = MRLeer.src;
document.Form_Eingabe_MS_mr.MS_mr_Ueber.style.color = TxtIdleUe;   
document.Form_Eingabe_MS_mr.MS_mr_Ueber.style.backgroundColor = InpIdleUe;   

document.Form_Eingabe_MS_mr.MS_mr_Option.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_mr.MS_mr_Option.style.backgroundColor = InpIdleOp;   
document.Form_Eingabe_MS_mr.MS_mr_Angabe.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_mr.MS_mr_Angabe.style.backgroundColor = InpIdleOp;   

document.Form_Eingabe_MS_mr.MS_mr_Beschreibung.style.color = TxtIdleBe;   
document.Form_Eingabe_MS_mr.MS_mr_Beschreibung.style.backgroundColor = InpIdleBe;   

document.Form_Eingabe_MS_mr.MS_mr_Ueber.value =  "";
document.Form_Eingabe_MS_mr.MS_mr_Option.value = "";
document.Form_Eingabe_MS_mr.MS_mr_Angabe.value =  "";
document.Form_Eingabe_MS_mr.MS_mr_Beschreibung.value = "";
document.Form_Eingabe_MS_mr.MS_ZeileTyp.value = "";

if ( steuer == -1) {
document.Form_Eingabe_MS_mr.MS_mr_Ueber.disabled = true;
document.Form_Eingabe_MS_mr.MS_mr_Angabe.disabled = true; 
document.Form_Eingabe_MS_mr.MS_mr_Option.disabled = true;
document.Form_Eingabe_MS_mr.MS_mr_Beschreibung.disabled = true; 
document.getElementById("head_eingabe_mr").innerHTML =  "Die Zeile l&ouml;schen";
document.getElementsByName("img_zeile_min")[zeile_index].src = MRMinus.src;
document.getElementsByName("pfeilTitel").src = MRMinus.src;
document.getElementById("mr_speich_txt").innerHTML =  "Die Zeile";
document.getElementById("form_mr_speich").innerHTML =  "l&ouml;schen";
document.Form_Eingabe_MS_mr.MS_mrZeile_aktiv.value = -1;
document.Form_Eingabe_MS_mr.MS_ZeileNrAend.value = zeile;

}

if ( steuer == 1 || steuer == 2) {
//alert(steuer);
document.Form_Eingabe_MS_mr.MS_mr_Ueber.disabled = false;
document.Form_Eingabe_MS_mr.MS_mr_Angabe.disabled = false; 
document.Form_Eingabe_MS_mr.MS_mr_Option.disabled = false;
document.Form_Eingabe_MS_mr.MS_mr_Beschreibung.disabled = false; 
document.getElementById("head_eingabe_mr").innerHTML =  "Eine Zeile hinzuf&uuml;gen";
document.getElementsByName("img_zeile_plus")[zeile_index].src = MRPlus.src;
document.getElementsByName("pfeilTitel").src = MRPfeilAend.src;
document.getElementById("mr_speich_txt").innerHTML =  "";
document.getElementById("form_mr_speich").innerHTML =  "";

if( steuer == 1 ) {
document.Form_Eingabe_MS_mr.MS_ZeileNrAend.value = zeile; document.Form_Eingabe_MS_mr.MS_mrZeile_aktiv.value = 1; }


if( steuer == 2 ) {document.Form_Eingabe_MS_mr.MS_mrZeile_aktiv.value = 2; }
//var thjjj =  document.Form_Eingabe_MS_mr.MS_ZeileNrAend.value;alert(thjjj);
}

document.Form_Eingabe_MS_mr.MS_mrZeile_bearbeitet.value = zeile_index;

}





// --------------------------------------------------------------------------
// --------------------   funktionen der inhalts menues ---------------------
// --------------------------------------------------------------------------


// ----   die variablen haben ähnliche namen, die struktur der funktionen ist identisch ---------------------
// ----  bei gleicher funktion für beide aufgaben wären viele variablen im aufruf notwendig gewesen und gefahr von verwechslung eher grösser. daher mehr quelltext


function MR_Inhalt_ZeileUnten (zeile, typ) {
 //alert(typ);

if (typ == "InhUeber") { 
//alert("Thomas");
// zustände: neue zeiel am ende: vaiable zeile aus funktionsaufruf
// neue zeile nach MS_ZeileNrAend: document.Form_Eingabe_MS_mr.MS_InhaltZeile_aktiv.value = 1;
// neue zeileam edne: document.Form_Eingabe_MS_mr.MS_InhaltZeile_aktiv.value = 2;
// zeile bearbeiten: document.Form_Eingabe_MS_mr.MS_InhaltZeile_aktiv.value = 0;
//var zeile_akt = document.Form_Eingabe_MS_mr.MS__InhaltZeile_bearbeitet.value; // in dem wert steht der index der zeile, die angeklickt wurde 

document.images["pfeil_InhMenuUeber"].src = MRPfeilAend.src;  document.images["pfeil_InhUeber"].src = MRPfeilAend.src;
document.images["pfeil_InhTitZeile"].src = MRLeer.src;
document.images["pfeil_InhBild"].src = MRLeer.src; document.images["pfeil_InhTitText"].src = MRLeer.src; document.images["pfeil_InhText"].src = MRLeer.src;

document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.style.color = TxtAktUe;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.style.backgroundColor = InpAktUe;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.style.backgroundColor = InpIdleOp;   

document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.style.backgroundColor = InpIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.style.color = TxtIdleBe;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.style.backgroundColor = InpIdleBe;   

if( document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_aktiv.value == 0 && document.Form_Eingabe_MS_inhalt.MS_InhaltZeileTyp.value == "InhUeber") {
document.getElementById("head_eingabe_Inhalt").innerHTML =  "Die &Uuml;berschrift &auml;ndern";
document.getElementById("inhalt_speich_txt").innerHTML =  "Die &Uuml;berschrift";
document.getElementById("form_inhalt_speich").innerHTML =  "speichern";
}

if( document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_aktiv.value == 0 && document.Form_Eingabe_MS_inhalt.MS_InhaltZeileTyp.value != "InhUeber") {
document.getElementById("head_eingabe_Inhalt").innerHTML =  "Zeile in eine &Uuml;berschrift &auml;ndern";
document.getElementById("inhalt_speich_txt").innerHTML =  "Zeile als &Uuml;berschrift";
document.getElementById("form_inhalt_speich").innerHTML =  "speichern";
}

if( document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_aktiv.value == 1 || document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_aktiv.value == 2) {
document.getElementById("head_eingabe_Inhalt").innerHTML =  "Eine &Uuml;berschrift einf&uuml;gen";
document.getElementById("inhalt_speich_txt").innerHTML =  "Die &Uuml;berschrift als";
document.getElementById("form_inhalt_speich").innerHTML =  "neue Zeile einf&uuml;gen";
}


document.Form_Eingabe_MS_inhalt.MS_InhaltZeileTyp.value = "InhUeber";

}

if (typ == "InhUeberText") { 
document.images["pfeil_InhMenuUeber"].src = MRPfeilAend.src;  document.images["pfeil_InhUeber"].src = MRLeer.src;
document.images["pfeil_InhTitZeile"].src = MRPfeilAend.src;
document.images["pfeil_InhBild"].src = MRLeer.src; document.images["pfeil_InhTitText"].src = MRLeer.src; document.images["pfeil_InhText"].src = MRLeer.src;

document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.style.color = TxtIdleUe;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.style.backgroundColor = InpIdleUe;   

document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.style.color = TxtAktOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.style.backgroundColor = InpAktOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.style.backgroundColor = InpIdleOp;   

document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.style.color = TxtIdleBe;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.style.backgroundColor = InpIdleBe;   

if( document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_aktiv.value == 0 && document.Form_Eingabe_MS_inhalt.MS_InhaltZeileTyp.value == "InhUeberText") {
document.getElementById("head_eingabe_Inhalt").innerHTML =  "Die Unterzeile &auml;ndern";
document.getElementById("inhalt_speich_txt").innerHTML =  "Die Zeile";
document.getElementById("form_inhalt_speich").innerHTML =  "speichern";
}

if( document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_aktiv.value == 0 && document.Form_Eingabe_MS_inhalt.MS_InhaltZeileTyp.value != "InhUeberText") {
document.getElementById("head_eingabe_Inhalt").innerHTML =  "Zeile in eine Unterzeile &auml;ndern";
document.getElementById("inhalt_speich_txt").innerHTML =  "Zeile";
document.getElementById("form_inhalt_speich").innerHTML =  "speichern";
document.Form_Eingabe_MS_inhalt.MS_InhaltZeileTyp.value = "InhUeberText";
}

if( document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_aktiv.value == 1 || document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_aktiv.value == 2) {
document.getElementById("head_eingabe_Inhalt").innerHTML =  "Eine Unterzeile einf&uuml;gen";
document.getElementById("inhalt_speich_txt").innerHTML =  "Die Zeile als";
document.getElementById("form_inhalt_speich").innerHTML =  "neue Zeile einf&uuml;gen";
}

document.Form_Eingabe_MS_inhalt.MS_InhaltBildAktiv.value = 3; // festlegung wenn vorher bild eingefügt
document.Form_Eingabe_MS_inhalt.MS_InhaltZeileTyp.value = "InhUeberText";

}


if (typ == "InhBild") { 
if (document.Form_Eingabe_MS_inhalt.MS_InhaltBildPos.value == "") document.Form_Eingabe_MS_inhalt.MS_InhaltBildPos.value = 1;
document.images["pfeil_InhMenuUeber"].src = MRPfeilAend.src;  document.images["pfeil_InhUeber"].src = MRLeer.src;
document.images["pfeil_InhTitZeile"].src = MRLeer.src;
document.images["pfeil_InhBild"].src = MRPfeilAend.src; document.images["pfeil_InhTitText"].src = MRLeer.src; document.images["pfeil_InhText"].src = MRLeer.src;

document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.style.color = TxtIdleUe;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.style.backgroundColor = InpIdleUe;   

document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.style.backgroundColor = InpIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.style.color = TxtAktOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.style.backgroundColor = InpAktOp;   

document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.style.color = TxtIdleBe;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.style.backgroundColor = InpIdleBe;   

if( document.Form_Eingabe_MS_inhalt.MS_InhaltBildAktiv.value == 0 ) {
document.getElementById("head_eingabe_Inhalt").innerHTML =  "Das Bild &auml;ndern";
document.getElementById("inhalt_speich_txt").innerHTML =  "Das geänderte Bild";
document.getElementById("form_inhalt_speich").innerHTML =  "speichern";
}

if( document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_aktiv.value == 0 && document.Form_Eingabe_MS_inhalt.MS_InhaltZeileTyp.value != "InhBild") {
document.getElementById("head_eingabe_Inhalt").innerHTML =  "Zeile in ein Bild &auml;ndern";
document.getElementById("inhalt_speich_txt").innerHTML =  "Zeile als Bild";
document.getElementById("form_inhalt_speich").innerHTML =  "speichern";
document.Form_Eingabe_MS_inhalt.MS_InhaltZeileTyp.value = "InhBild";
}

if( document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_aktiv.value == 1 || document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_aktiv.value == 2) {
document.getElementById("head_eingabe_Inhalt").innerHTML =  "Das Bild als neue Zeile einf&uuml;gen";
document.getElementById("inhalt_speich_txt").innerHTML =  "Das Bild als";
document.getElementById("form_inhalt_speich").innerHTML =  "neue Zeile einf&uuml;gen";
}

// der wert MS_InhaltBildAktiv.value  wird nicht geändert: bei eingabe einer neuen zeile ist er 3 aus "MR_Inhalt_ZeileObenHinWeg"
// wenn ein weiteres / anderes bild in der bildzeile eingefügt wird 1  oder null aus der bildfunktion

document.Form_Eingabe_MS_inhalt.MS_InhaltZeileTyp.value = "InhBild";

}



if (typ == "InhTextTitel") { 
document.images["pfeil_InhMenuUeber"].src = MRPfeilAend.src;  document.images["pfeil_InhUeber"].src = MRLeer.src;
document.images["pfeil_InhTitZeile"].src = MRLeer.src;
document.images["pfeil_InhBild"].src = MRLeer.src; document.images["pfeil_InhTitText"].src = MRPfeilAend.src; document.images["pfeil_InhText"].src = MRLeer.src;

document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.style.color = TxtIdleUe;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.style.backgroundColor = InpIdleUe;   

document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.style.backgroundColor = InpIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.style.color = TxtAktOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.style.backgroundColor = InpAktOp;   

document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.style.color = TxtIdleBe;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.style.backgroundColor = InpIdleBe;   

if( document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_aktiv.value == 0 && document.Form_Eingabe_MS_inhalt.MS_InhaltZeileTyp.value == "InhTextTitel") {
document.getElementById("head_eingabe_Inhalt").innerHTML =  "Die Überschrift &auml;ndern";
document.getElementById("inhalt_speich_txt").innerHTML =  "Die Überschrift";
document.getElementById("form_inhalt_speich").innerHTML =  "speichern";
}

if( document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_aktiv.value == 0 && document.Form_Eingabe_MS_inhalt.MS_InhaltZeileTyp.value != "InhTextTitel") {
document.getElementById("head_eingabe_Inhalt").innerHTML =  "Zeile in eine Überschrift &auml;ndern";
document.getElementById("inhalt_speich_txt").innerHTML =  "Zeile als Überschrift";
document.getElementById("form_inhalt_speich").innerHTML =  "speichern";
document.Form_Eingabe_MS_inhalt.MS_InhaltZeileTyp.value = "InhTextTitel";
}

if( document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_aktiv.value == 1 || document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_aktiv.value == 2) {
document.getElementById("head_eingabe_Inhalt").innerHTML =  "Eine Überschrift einf&uuml;gen";
document.getElementById("inhalt_speich_txt").innerHTML =  "Die Überschrift als";
document.getElementById("form_inhalt_speich").innerHTML =  "neue Zeile einf&uuml;gen";
}

document.Form_Eingabe_MS_inhalt.MS_InhaltZeileTyp.value = "InhTextTitel";

}

if (typ == "InhText") { 
document.images["pfeil_InhMenuUeber"].src = MRPfeilAend.src;  document.images["pfeil_InhUeber"].src = MRLeer.src;
document.images["pfeil_InhTitZeile"].src = MRLeer.src;
document.images["pfeil_InhBild"].src = MRLeer.src; document.images["pfeil_InhTitText"].src = MRLeer.src; document.images["pfeil_InhText"].src = MRPfeilAend.src;

document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.style.color = TxtIdleUe;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.style.backgroundColor = InpIdleUe;   

document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.style.backgroundColor = InpIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.style.backgroundColor = InpIdleOp;   

document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.style.color = TxtAktBe;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.style.backgroundColor = InpAktBe;   

if( document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_aktiv.value == 0 && document.Form_Eingabe_MS_inhalt.MS_InhaltZeileTyp.value == "InhText") {
document.getElementById("head_eingabe_Inhalt").innerHTML =  "Den Text &auml;ndern";
document.getElementById("inhalt_speich_txt").innerHTML =  "Den Text";
document.getElementById("form_inhalt_speich").innerHTML =  "speichern";
//document.Form_Eingabe_MS_inhalt.MS_ZeileNrAend.value = zeile;
}

if( document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_aktiv.value == 0 && document.Form_Eingabe_MS_inhalt.MS_InhaltZeileTyp.value != "InhText") {
document.getElementById("head_eingabe_Inhalt").innerHTML =  "Zeile in einen Text &auml;ndern";
document.getElementById("inhalt_speich_txt").innerHTML =  "Zeile als Text";
document.getElementById("form_inhalt_speich").innerHTML =  "speichern";
document.Form_Eingabe_MS_inhalt.MS_InhaltZeileTyp.value = "InhText";
}

if( document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_aktiv.value == 1 || document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_aktiv.value == 2) {
document.getElementById("head_eingabe_Inhalt").innerHTML =  "Einen Text einf&uuml;gen";
document.getElementById("inhalt_speich_txt").innerHTML =  "Den Text als";
document.getElementById("form_inhalt_speich").innerHTML =  "neue Zeile einf&uuml;gen";
}

document.Form_Eingabe_MS_inhalt.MS_InhaltZeileTyp.value = "InhText";
}

}
  
function MS_Inhalt_ZeileObenAend (zeile,typ, inhalt) {
var zeile_index 			= zeile -1;
var zeile_index_alt 	= document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_bearbeitet.value;
 document.Form_Eingabe_MS_inhalt.MS_InhaltBildAktiv.value = 3; // keine bildbearbeitung wenn texte geändert werden
if( zeile_index_alt != "") {
document.getElementsByName("img_InhaltZeile_plus")[zeile_index_alt].src = MRPlusAgbl.src;
document.getElementsByName("img_InhaltZeile_min")[zeile_index_alt].src = MRMinusAgbl.src;
}

document.getElementsByName("img_InhaltZeile_min")[zeile_index].src = MRPfeilAend.src;
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.disabled = false;
document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.disabled = false; 
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.disabled = false; 
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.disabled = false; 

if (typ == "InhUeber") { 
//alert("Thomas");

document.images["pfeil_InhMenuUeber"].src = MRPfeilAend.src;  document.images["pfeil_InhUeber"].src = MRPfeilAend.src;
document.images["pfeil_InhTitZeile"].src = MRLeer.src;
document.images["pfeil_InhBild"].src = MRLeer.src; document.images["pfeil_InhTitText"].src = MRLeer.src; document.images["pfeil_InhText"].src = MRLeer.src;

document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.style.color = TxtAktUe;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.style.backgroundColor = InpAktUe;   

document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.style.backgroundColor = InpIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.style.backgroundColor = InpIdleOp;   

document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.style.color = TxtIdleBe;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.style.backgroundColor = InpIdleBe;   

document.getElementById("inhalt_speich_txt").innerHTML =  "";
document.getElementById("form_inhalt_speich").innerHTML =   "";
document.getElementById("head_eingabe_Inhalt").innerHTML =  "Die &Uuml;berschrift &auml;ndern";
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.value =  inhalt;
document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.value = "";
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.value =  "";
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.value = "";
document.Form_Eingabe_MS_inhalt.MS_InhaltZeileTyp.value = "InhUeber";

}

if (typ == "InhUeberText") { 

document.images["pfeil_InhMenuUeber"].src = MRPfeilAend.src;  document.images["pfeil_InhUeber"].src = MRLeer.src;
document.images["pfeil_InhTitZeile"].src = MRPfeilAend.src;
document.images["pfeil_InhBild"].src = MRLeer.src; document.images["pfeil_InhTitText"].src = MRLeer.src; document.images["pfeil_InhText"].src = MRLeer.src;

document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.style.color = TxtAktUe;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.style.backgroundColor = InpAktUe;   

document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.style.backgroundColor = InpIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.style.backgroundColor = InpIdleOp;   

document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.style.color = TxtIdleBe;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.style.backgroundColor = InpIdleBe;   

document.getElementById("inhalt_speich_txt").innerHTML =  "";
document.getElementById("form_inhalt_speich").innerHTML =   "";
document.getElementById("head_eingabe_Inhalt").innerHTML =  "Den Untertext neu gestalten";
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.value =  "";
document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.value = inhalt;
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.value =  "";
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.value = "";
document.Form_Eingabe_MS_inhalt.MS_InhaltZeileTyp.value = "InhUeber";

}

if (typ == "InhTextTitel") { 
document.images["pfeil_InhMenuUeber"].src = MRPfeilAend.src;  document.images["pfeil_InhUeber"].src = MRLeer.src;
document.images["pfeil_InhTitZeile"].src = MRLeer.src;
document.images["pfeil_InhBild"].src = MRLeer.src; document.images["pfeil_InhTitText"].src = MRPfeilAend.src; document.images["pfeil_InhText"].src = MRLeer.src;

document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.style.color = TxtIdleUe;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.style.backgroundColor = InpIdleUe;   

document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.style.backgroundColor = InpIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.style.backgroundColor = InpIdleOp;   

document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.style.color = TxtAktBe;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.style.backgroundColor = InpAktBe;   

document.getElementById("inhalt_speich_txt").innerHTML =  "";
document.getElementById("form_inhalt_speich").innerHTML =   "";
document.getElementById("head_eingabe_Inhalt").innerHTML =  "Die &Uuml;berschrift &auml;ndern";
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.value =  "";
document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.value = "";
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.value = inhalt;
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.value =  "";
document.Form_Eingabe_MS_inhalt.MS_InhaltZeileTyp.value = "InhTextTitel";
}
if (typ == "InhText") { 
document.images["pfeil_InhMenuUeber"].src = MRPfeilAend.src;  document.images["pfeil_InhUeber"].src = MRLeer.src;
document.images["pfeil_InhTitZeile"].src = MRLeer.src;
document.images["pfeil_InhBild"].src = MRLeer.src; document.images["pfeil_InhTitText"].src = MRLeer.src; document.images["pfeil_InhText"].src = MRPfeilAend.src;

document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.style.color = TxtIdleUe;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.style.backgroundColor = InpIdleUe;   

document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.style.backgroundColor = InpIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.style.backgroundColor = InpIdleOp;   

document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.style.color = TxtAktBe;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.style.backgroundColor = InpAktBe;   

document.getElementById("inhalt_speich_txt").innerHTML =  "";
document.getElementById("form_inhalt_speich").innerHTML =   "";
document.getElementById("head_eingabe_Inhalt").innerHTML =  "Den Text &auml;ndern";
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.value =  "";
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.value =  "";
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.value = "";
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.value =  inhalt;
document.Form_Eingabe_MS_inhalt.MS_InhaltZeileTyp.value = "InhText";
}

document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_bearbeitet.value = zeile_index;
document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_aktiv.value = 0;
document.Form_Eingabe_MS_inhalt.MS_InhaltZeileNrAend.value = zeile;

}
  
function MR_Inhalt_ZeileObenHinWeg (zeile, steuer) {
// -------------        steuerung ob bild oder zeileneingabe ----------------------
 document.Form_Eingabe_MS_inhalt.MS_InhaltBildAktiv.value = 3; // keine bildbearbeitung wenn texte geändert werden
var zeile_index 			= zeile -1;
var zeile_index_alt 	= document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_bearbeitet.value;
//var thjjj =  document.images["img_InhaltZeile_plus"][zeile_index_alt].src;alert(thjjj);
if( zeile_index_alt != "") {
document.getElementsByName("img_InhaltZeile_plus")[zeile_index_alt].src = MRPlusAgbl.src;
document.getElementsByName("img_InhaltZeile_min")[zeile_index_alt].src = MRMinusAgbl.src;
}

document.images["pfeil_InhMenuUeber"].src = MRLeer.src;  document.images["pfeil_InhUeber"].src = MRLeer.src;
document.images["pfeil_InhTitZeile"].src = MRPfeilAend.src;
document.images["pfeil_InhBild"].src = MRLeer.src; document.images["pfeil_InhTitText"].src = MRLeer.src; document.images["pfeil_InhText"].src = MRLeer.src;

document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.style.color = TxtIdleUe;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.style.backgroundColor = InpIdleUe;   

document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.style.backgroundColor = InpIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.style.backgroundColor = InpIdleOp;   

document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.style.color = TxtIdleBe;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.style.backgroundColor = InpIdleBe;   

document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.value =  "";
document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.value = "";
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.value =  "";
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.value = "";
document.Form_Eingabe_MS_inhalt.MS_InhaltZeileTyp.value = "";

if ( steuer == -1) {
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.disabled = true;
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.disabled = true; 
document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.disabled = true;
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.disabled = true; 
document.getElementById("head_eingabe_Inhalt").innerHTML =  "Die Zeile l&ouml;schen";
document.getElementsByName("img_InhaltZeile_min")[zeile_index].src = MRMinus.src;
document.getElementsByName("pfeil_InhMenuUeber").src = MRMinus.src;
document.getElementById("inhalt_speich_txt").innerHTML =  "Die Zeile";
document.getElementById("form_inhalt_speich").innerHTML =  "l&ouml;schen";
// -------------        steuerung ob bild oder zeileneingabe ----------------------
document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_aktiv.value = -1;
document.Form_Eingabe_MS_inhalt.MS_InhaltZeileNrAend.value = zeile;

}

if ( steuer == 1 || steuer == 2) {
//alert(steuer);
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.disabled = false;
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.disabled = false; 
document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.disabled = false;
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.disabled = false; 
document.getElementById("head_eingabe_Inhalt").innerHTML =  "Eine Zeile hinzuf&uuml;gen";
document.getElementsByName("img_InhaltZeile_plus")[zeile_index].src = MRPlus.src;
document.images["pfeil_InhMenuUeber"].src = MRPfeilAend.src;
document.getElementById("inhalt_speich_txt").innerHTML =  "";
document.getElementById("form_inhalt_speich").innerHTML =  "";

if( steuer == 1 ) {
// -------------        steuerung ob bild oder zeileneingabe ----------------------
document.Form_Eingabe_MS_inhalt.MS_InhaltZeileNrAend.value = zeile; document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_aktiv.value = 1; }


// -------------        steuerung ob bild oder zeileneingabe ----------------------
if( steuer == 2 ) {document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_aktiv.value = 2; }
}

document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_bearbeitet.value = zeile_index;
//var thjjj =  document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_bearbeitet.value ;alert(thjjj);

}

  
function MS_Inhalt_BildZeile (MSmitteID, zeile, position, steuer) {
 //alert(typ);
var zeile_index 			= zeile -1;
var position_index		= position -1;
var zeile_index_alt 	= document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_bearbeitet.value;
var BildPos_alt = document.Form_Eingabe_MS_inhalt.MS_InhaltBildBearbeitet.value; //alert(BildPos_alt);

// -------------        steuerung ob bild oder zeileneingabe ----------------------
 document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_aktiv.value = 3; // die steuerung ist nur für bilder in einer zeile

// ------------------------------------------------------------------------------
 
 if( zeile_index_alt != "") {
document.getElementsByName("img_InhaltZeile_plus")[zeile_index_alt].src = MRPlusAgbl.src;
document.getElementsByName("img_InhaltZeile_min")[zeile_index_alt].src = MRMinusAgbl.src;
}

document.Form_Eingabe_MS_inhalt.MS_InhaltBildPos.value = position;

document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.disabled = true;
document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.disabled = true; 
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.disabled = true; 
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.disabled = true; 


document.images["pfeil_InhMenuUeber"].src = MRLeer.src;  document.images["pfeil_InhUeber"].src = MRLeer.src;
document.images["pfeil_InhTitZeile"].src = MRPfeilAend.src;
document.images["pfeil_InhBild"].src = MRPfeilAend.src; document.images["pfeil_InhTitText"].src = MRLeer.src; document.images["pfeil_InhText"].src = MRLeer.src;

document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.style.color = TxtIdleUe;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.style.backgroundColor = InpIdleUe;   

document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.style.backgroundColor = InpIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.style.color = TxtIdleOp;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.style.backgroundColor = InpIdleOp;   

document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.style.color = TxtIdleBe;   
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.style.backgroundColor = InpIdleBe;   

document.Form_Eingabe_MS_inhalt.MS_Inhalt_Ueber.value =  "";
document.Form_Eingabe_MS_inhalt.MS_Inhalt_ueberText.value = "";
document.Form_Eingabe_MS_inhalt.MS_Inhalt_TitText.value =  "";
document.Form_Eingabe_MS_inhalt.MS_Inhalt_Text.value = "";
document.Form_Eingabe_MS_inhalt.MS_InhaltZeileTyp.value = "";

if ( steuer == -1) {
document.Form_Eingabe_MS_inhalt.my_field.disabled = true; 
document.getElementById("head_eingabe_Inhalt").innerHTML =  "Das Bild l&ouml;schen";
if ( BildPos_alt != "") {

document.getElementsByName("BildUntenPfeilPlus")[BildPos_alt].src = MRBildPlusAgbl.src;
document.getElementsByName("BildUntenPfeilMinus")[BildPos_alt].src = MRMinusAgbl.src;
document.getElementsByName("BildUntenPfeilAend")[BildPos_alt].src = MRPfeilAendAgbl.src;
}

document.getElementsByName("BildUntenPfeilPlus")[position].src = MRBildPlusAgbl.src;
document.getElementsByName("BildUntenPfeilMinus")[position].src = MRMinus.src;
document.getElementsByName("BildUntenPfeilAend")[position].src = MRPfeilAendAgbl.src;

document.images["pfeil_InhMenuUeber"].src = MRPfeilAend.src;
document.getElementById("inhalt_speich_txt").innerHTML =  "Das ausgew&auml;hlte Bild";
document.getElementById("form_inhalt_speich").innerHTML =  "l&ouml;schen";
// -------------        steuerung ob bild oder zeileneingabe ----------------------
document.Form_Eingabe_MS_inhalt.MS_InhaltBildAktiv.value = -1;
document.Form_Eingabe_MS_inhalt.MS_InhaltBildPos.value = position;
//document.Form_Eingabe_MS_inhalt.MS_InhaltZeileNrAend.value = zeile;

}

if ( steuer == 0) {
document.Form_Eingabe_MS_inhalt.my_field.disabled = false; 
document.getElementById("head_eingabe_Inhalt").innerHTML =  "Das  Bild &auml;ndern";
 if ( BildPos_alt != "") {
document.getElementsByName("BildUntenPfeilPlus")[BildPos_alt].src = MRBildPlusAgbl.src;
document.getElementsByName("BildUntenPfeilMinus")[BildPos_alt].src = MRMinusAgbl.src;
document.getElementsByName("BildUntenPfeilAend")[BildPos_alt].src = MRPfeilAendAgbl.src;
}

document.getElementsByName("BildUntenPfeilPlus")[position].src = MRBildPlusAgbl.src;
document.getElementsByName("BildUntenPfeilMinus")[position].src = MRMinusAgbl.src;
document.getElementsByName("BildUntenPfeilAend")[position].src = MRPfeilAend.src;

document.images["pfeil_InhMenuUeber"].src = MRPfeilAend.src;
// -------------        steuerung der bild oder zeileneingabe ----------------------
document.Form_Eingabe_MS_inhalt.MS_InhaltBildAktiv.value = 0;
document.Form_Eingabe_MS_inhalt.MS_InhaltBildPos.value = position;
//document.Form_Eingabe_MS_inhalt.MS_InhaltZeileNrAend.value = zeile;
document.getElementById("inhalt_speich_txt").innerHTML =  "Das ausgew&auml;hlte Bild";
document.getElementById("form_inhalt_speich").innerHTML =  "&auml;ndern";
document.Form_Eingabe_MS_inhalt.MS_InhaltBildPos.value = position;

}

if ( steuer == 1 || steuer == 2) {
document.Form_Eingabe_MS_inhalt.my_field.disabled = false; 
document.getElementById("head_eingabe_Inhalt").innerHTML =  "Ein Bild hinzuf&uuml;gen";
 if( BildPos_alt != "") {
document.getElementsByName("BildUntenPfeilPlus")[BildPos_alt].src = MRPlusAgbl.src;
document.getElementsByName("BildUntenPfeilMinus")[BildPos_alt].src = MRMinusAgbl.src;
document.getElementsByName("BildUntenPfeilAend")[BildPos_alt].src = MRPfeilAendAgbl.src;
}

document.getElementsByName("BildUntenPfeilPlus")[position].src = MRBildPlus.src;
document.getElementsByName("BildUntenPfeilMinus")[position].src = MRMinusAgbl.src;
document.getElementsByName("BildUntenPfeilAend")[position].src = MRPfeilAendAgbl.src;
document.images["pfeil_InhMenuUeber"].src = MRPfeilAend.src;
document.getElementById("inhalt_speich_txt").innerHTML =  "Das ausgew&auml;hlte Bild";
document.getElementById("form_inhalt_speich").innerHTML =  "speichern";

if( steuer == 1 ) {
document.Form_Eingabe_MS_inhalt.MS_InhaltBildPos.value = position;
// -------------        steuerung der bild oder zeileneingabe ----------------------
document.Form_Eingabe_MS_inhalt.MS_InhaltBildAktiv.value = 1;
}


if( steuer == 2 ) {
document.Form_Eingabe_MS_inhalt.MS_InhaltBildAktiv.value = 2; 
// -------------        steuerung der bild oder zeileneingabe ----------------------
document.Form_Eingabe_MS_inhalt.MS_InhaltBildPos.value = position;
}
}

document.Form_Eingabe_MS_inhalt.MS_InhaltBildMSmitteID.value = MSmitteID;
document.Form_Eingabe_MS_inhalt.MS_InhaltBildBearbeitet.value = position;
document.Form_Eingabe_MS_inhalt.MS_InhaltZeile_bearbeitet.value = zeile_index;
//document.Form_Eingabe_MS_inhalt.MS_InhaltZeileNrAend.value = zeile;

}





// --------------------------------------------------------------------------
// --------------------   			karten funktionen				 ---------------------
// --------------------------------------------------------------------------


var geocoder;
var map;
function initialize_ESSAVE() {
geocoder = new google.maps.Geocoder();
var mylatlng = new google.maps.LatLng(51.1973, 7.089500000000044);
var myOptions = { scaleControl: true, zoom: 5,  streetViewControl: false, mapTypeControl: false, center: mylatlng, mapTypeId: google.maps.MapTypeId.ROADMAP }
map = new google.maps.Map(document.getElementById("map_uebersicht"), myOptions);
google.maps.event.addListener(map, 'click', function(event) {placeMarkerDe(event.latLng, map);   });
var marker = new google.maps.Marker({map: map, position: mylatlng, title:"Ihr Ort" });
marker.bindTo('position', map, 'center'); 

var myOptions = {zoom: 12, center: mylatlng, streetViewControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP }
map = new google.maps.Map(document.getElementById("map_detail"), myOptions);
google.maps.event.addListener(map, 'click', function(event) {placeMarkerUe(event.latLng, map);   });
var marker = new google.maps.Marker({map: map, position: mylatlng, title:"Ihr Ort" });
marker.bindTo('position', map, 'center'); 
 }


function initialize_ESWerteOeff(lat, Lng) {
geocoder = new google.maps.Geocoder();
var mylatlng = new google.maps.LatLng(Lng, lat);
//alert(mylatlng);
var myOptions = { scaleControl: true, zoom: 5,  streetViewControl: false, mapTypeControl: false, center: mylatlng, mapTypeId: google.maps.MapTypeId.ROADMAP }
map = new google.maps.Map(document.getElementById("mapOeff_uebersicht"), myOptions);
google.maps.event.addListener(map, 'click', function(event) {placeMarkerDe(event.latLng, map);   });
var marker = new google.maps.Marker({map: map, position: mylatlng });

var myOptions = {zoom: 12, center: mylatlng, streetViewControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP }
map = new google.maps.Map(document.getElementById("mapOeff_detail"), myOptions);
google.maps.event.addListener(map, 'click', function(event) {placeMarkerUe(event.latLng, map);   });
var marker = new google.maps.Marker({map: map, position: mylatlng, title:"Ihr Ort" });
 }


function initialize_ESWerte(lat, Lng) {
geocoder = new google.maps.Geocoder();
var mylatlng = new google.maps.LatLng(Lng, lat);
//alert(mylatlng);
var myOptions = { scaleControl: true, zoom: 5,  streetViewControl: false, mapTypeControl: false, center: mylatlng, mapTypeId: google.maps.MapTypeId.ROADMAP }
map = new google.maps.Map(document.getElementById("map_uebersicht"), myOptions);
google.maps.event.addListener(map, 'click', function(event) {placeMarker(event.latLng, map);   });
var marker = new google.maps.Marker({map: map, position: mylatlng });
marker.bindTo('position', map, 'center'); 

var myOptions = {zoom: 12, center: mylatlng, streetViewControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP }
map = new google.maps.Map(document.getElementById("map_detail"), myOptions);
google.maps.event.addListener(map, 'click', function(event) {placeMarker(event.latLng, map);   });
var marker = new google.maps.Marker({map: map, position: mylatlng, title:"Ihr Ort" });
marker.bindTo('position', map, 'center'); 
 }


function initialize_ES(adresse) {
geocoder = new google.maps.Geocoder();
var mylatlng = new google.maps.LatLng(51.1973, 7.089500000000044);
//var myOptions = { scaleControl: true, zoom: 5,  streetViewControl: false, mapTypeControl: false, center: mylatlng, mapTypeId: google.maps.MapTypeId.ROADMAP }
//map = new google.maps.Map(document.getElementById("map_uebersicht"), myOptions);

//var myOptions = {zoom: 12, center: mylatlng, streetViewControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP }
//map = new google.maps.Map(document.getElementById("map_detail"), myOptions);

if (geocoder) {
geocoder.geocode( { 'address': adresse}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var latlng = results[0].geometry.location;
document.Karte_einfuegen.ESKarte_lat.value = latlng.lat();
document.Karte_einfuegen.ESKarte_Lng.value = latlng.lng();
var myOptions = { zoom: 5,  streetViewControl: false,  mapTypeControl: false, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP   }
map = new google.maps.Map(document.getElementById("map_uebersicht"), myOptions);
google.maps.event.addListener(map, 'click', function(event) {placeMarker(event.latLng, map);   });
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({map: map, position: results[0].geometry.location });
marker.bindTo('position', map, 'center'); 
} else { alert("Google ist ein Fehler passiert: " + status);  }
});
}
	
if (geocoder) {
geocoder.geocode( { 'address': adresse}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var latlng = results[0].geometry.location;
var myOptions = { zoom: 12,  streetViewControl: false, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP   }
map = new google.maps.Map(document.getElementById("map_detail"), myOptions);
google.maps.event.addListener(map, 'click', function(event) {placeMarker(event.latLng, map);   });
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({map: map, position: results[0].geometry.location });
marker.bindTo('position', map, 'center'); 
} else { alert("Google ist ein Fehler passiert: " + status);  }
});
}



 }


function placeMarker(location, map) {
//alert("thommi");
var clickedLocation = new google.maps.LatLng(location);

document.Karte_einfuegen.ESKarte_lat.value = location.lat();
document.Karte_einfuegen.ESKarte_Lng.value = location.lng();
var myOptions = {zoom: 12, center: location, streetViewControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP }
map = new google.maps.Map(document.getElementById("map_detail"), myOptions);
google.maps.event.addListener(map, 'click', function(event) {placeMarker(event.latLng, map);   });
var marker = new google.maps.Marker({ position: location, map: map });
map.setCenter(location);
marker.bindTo('position', map, 'center'); 


var myOptions = { scaleControl: true, zoom: 5, center: location, streetViewControl: false,  mapTypeControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP     }
map = new google.maps.Map(document.getElementById("map_uebersicht"), myOptions);
google.maps.event.addListener(map, 'click', function(event) {placeMarker(event.latLng, map);   });
var marker = new google.maps.Marker({position: location,  map: map });
map.setCenter(location);
marker.bindTo('position', map, 'center'); 

}


function codeAddress() {
//		var address = "Solingen, Brunhildweg 32";
var address = document.getElementById("address").value;
//alert(address);	
if (geocoder) {
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var latlng = results[0].geometry.location;
document.Karte_einfuegen.ESKarte_lat.value = latlng.lat();
document.Karte_einfuegen.ESKarte_Lng.value = latlng.lng();

//alert(latlng);	
var myOptions = { zoom: 5,  streetViewControl: false,  mapTypeControl: false, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP   }
map = new google.maps.Map(document.getElementById("map_uebersicht"), myOptions);
google.maps.event.addListener(map, 'click', function(event) {placeMarker(event.latLng, map);   });
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({map: map, position: results[0].geometry.location });
marker.bindTo('position', map, 'center'); 
} else { alert("Google ist ein Fehler passiert: " + status);  }
});
}
	
if (geocoder) {
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var latlng = results[0].geometry.location;
var myOptions = { zoom: 12,  streetViewControl: false, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP   }
map = new google.maps.Map(document.getElementById("map_detail"), myOptions);
google.maps.event.addListener(map, 'click', function(event) {placeMarker(event.latLng, map);   });
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({map: map, position: results[0].geometry.location });
marker.bindTo('position', map, 'center'); 
} else { alert("Google ist ein Fehler passiert: " + status);  }
});
}
}


// --------------------------------------------------------------------------
// --------------------   			vor jquiry			 ---------------------
// --------------------------------------------------------------------------


function displayElement(name) {
document.getElementById(name).style.display='block';
}

function hideElement(name) {
document.getElementById(name).style.display='none';
}

function AdrBuAend(ID, firma, vorname, name , land, plz, stadt, adresse, hausNr, adresszusatz, Packstation, Postnummer, tel, mobil ) {
//alert("thomas");
document.getElementById("firma").value = firma; 
document.getElementById("vorname").value = vorname;
document.getElementById("name").value = name;
document.getElementById("land").value = land;
document.getElementById("plz").value = plz;
document.getElementById("stadt").value = stadt;
document.getElementById("adresse").value = adresse;
document.getElementById("hausNr").value = hausNr;
document.getElementById("adresszusatz").value = adresszusatz;
if (tel != "" && tel != 0) document.getElementById("tel").value = tel;
if (tel == ""  ||  tel == 0) document.getElementById("tel").value = "";
if (Packstation != "" && Packstation != 0) document.getElementById("packstation").value = Packstation;
if (Packstation == ""  ||  Packstation == 0) document.getElementById("packstation").value = "";
if (Postnummer != "" && Postnummer != 0) document.getElementById("postnummer").value = Postnummer;
if (Postnummer == ""  ||  Postnummer == 0) document.getElementById("postnummer").value = "";
if (mobil != "" && mobil != 0) document.getElementById("mobil").value = mobil;
if (mobil == ""  ||  mobil == 0) document.getElementById("mobil").value = "";

document.PersDatLiefer.var_submit_form.value = "Adresse_Aendern";    // diese ansprache geht nur mit dem name eines form NICHT mit der ID
document.PersDatLiefer.wahl_warenkorb2.value = ID;  

document.getElementById("AdrBuLiEB").innerHTML = "A";
document.getElementById("AdrBuLiReTxt").innerHTML = "dresse &auml;ndern";
document.getElementById("AdrBuAenTit").innerHTML = "Die Adresse &auml;ndern";
//document.getElementsByName("AdrBuLiReTxt")[0].innerHTML = "Die Adresse &auml;ndern";


}



