

function load_mapo() {
  if (GBrowserIsCompatible()) {
    var baseIcon = new GIcon();
         baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
         baseIcon.iconSize = new GSize(20, 34);
         baseIcon.shadowSize = new GSize(37, 34);
         baseIcon.iconAnchor = new GPoint(9, 34);
         baseIcon.infoWindowAnchor = new GPoint(9, 2);
         baseIcon.infoShadowAnchor = new GPoint(18, 25);


    var map = new GMap2(document.getElementById("map"));
        map.setCenter(new GLatLng(49.630899,10.630642 ), 13);
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());


    ort="Gutenstetten";
    x=49.617801;
    y=10.630345 ;
    var point=new GLatLng(x,y );
    var letteredIcon = new GIcon(baseIcon);
    letteredIcon.image = "http://www.google.com/mapfiles/markerA.png";
    markerOptions = { icon:letteredIcon };
    var marker = new GMarker(point, markerOptions);
    GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml("Ortsteil: <b>"+ort+"</b>");});
    map.addOverlay(marker);

    ort="Reinhardshofen";
    x=49.626044;
    y=10.652812;
    var point=new GLatLng(x,y );
    var letteredIcon = new GIcon(baseIcon);
    letteredIcon.image = "http://www.google.com/mapfiles/markerB.png";
    markerOptions = { icon:letteredIcon };
    var marker = new GMarker(point, markerOptions);
    map.addOverlay(marker);

    ort="Bergtheim";
    x=49.645777;
    y=10.643349;
    var point=new GLatLng(x,y );
    var letteredIcon = new GIcon(baseIcon);
    letteredIcon.image = "http://www.google.com/mapfiles/markerC.png";
    markerOptions = { icon:letteredIcon };
    var marker = new GMarker(point, markerOptions);
    map.addOverlay(marker);


    ort="Pahres";
    x=49.62165;
    y=10.656524;
    var point=new GLatLng(x,y );
    var letteredIcon = new GIcon(baseIcon);
    letteredIcon.image = "http://www.google.com/mapfiles/markerD.png";
    markerOptions = { icon:letteredIcon };
    var marker = new GMarker(point, markerOptions);
    map.addOverlay(marker);

    ort="Rockenbach";
    x=49.644791;
    y=10.635881;
    var point=new GLatLng(x,y );
    var letteredIcon = new GIcon(baseIcon);
    letteredIcon.image = "http://www.google.com/mapfiles/markerE.png";
    markerOptions = { icon:letteredIcon };
    var marker = new GMarker(point, markerOptions);
    map.addOverlay(marker);


    ort="Kleinsteinach gehört zum Gemeindeteil Gutenstetten";
    x=49.627691;
    y=10.610881;
    var point=new GLatLng(x,y );
    var letteredIcon = new GIcon(baseIcon);
    letteredIcon.image = "http://www.google.com/mapfiles/markerF.png";
    markerOptions = { icon:letteredIcon };
    var marker = new GMarker(point, markerOptions);
    map.addOverlay(marker);

    ort="Haag gehört zum Gemeindeteil Gutenstetten";
    x=49.62691;
    y=10.630881;
    var point=new GLatLng(x,y );
    var letteredIcon = new GIcon(baseIcon);
    letteredIcon.image = "http://www.google.com/mapfiles/markerG.png";
    markerOptions = { icon:letteredIcon };
    var marker = new GMarker(point, markerOptions);
    map.addOverlay(marker);


  }
}
function load_map(x,y) {
  if (GBrowserIsCompatible()) {
    var map = new GMap2(document.getElementById("map"));

    map.setCenter(new GLatLng(x,y ), 15);
    var point=new GLatLng(x,y );
    map.addControl(new GLargeMapControl());
    map.addControl(new GMapTypeControl());
    map.addOverlay(new GMarker(point));
  }
}


function formtest_amtsblatt(){
var Text="";
if (document.formular.inhalt1.value==""){
         Text+='    Ihr Name fehlt!\n';
         document.formular.inhalt1.focus();
         document.getElementById("inhalt1").className='ftext';
}else{
         document.getElementById("inhalt1").className='itext';
}
if (document.formular.inhalt6.value=="" || document.formular.inhalt6.value=="*Bitte hier die Meldung eingeben" ){
         Text+='    Ihr Meldungstext fehlt!\n';
         document.formular.inhalt6.focus();
         document.getElementById("inhalt6").className='ftext';
}else{
         document.getElementById("inhalt6").className='itext';
}

if (Text!=""){
         alert('Vervollständigen Sie:\n'+Text);
         return false;
}
}

function formtest_register(){

var Text="";
 //alert(document.formular.inhalt10[0].checked);
 //alert(document.formular.inhalt10[1].checked);
if (document.formular.inhalt0.value==""){
         Text+='    Ihr Name, Vorname fehlt!\n';
         document.formular.inhalt0.focus();
         document.getElementById("inhalt0").className='ftext';
}else{
         document.getElementById("inhalt0").className='itext';
}

if (document.formular.inhalt1.value==""){
         Text+='    Ihre Straße, Hausnummer fehlt!\n';
         document.formular.inhalt1.focus();
         document.getElementById("inhalt1").className='ftext';
}else{
         document.getElementById("inhalt1").className='itext';
}

if (document.formular.inhalt2.value==""){
         Text+='    Ihre Postleitzahl, Ort fehlt!\n';
         document.formular.inhalt2.focus();
         document.getElementById("inhalt2").className='ftext';
}else{
         document.getElementById("inhalt2").className='itext';
}
if (document.formular.inhalt3.value==""){
         Text+='    ihr Staat fehlt!\n';
         document.formular.inhalt3.focus();
         document.getElementById("inhalt3").className='ftext';
}else{
         document.getElementById("inhalt3").className='itext';
}

if (document.formular.inhalt6.value==""){
         Text+='    Personen Name fehlt!\n';
         document.formular.inhalt6.focus();
         document.getElementById("inhalt6").className='ftext';
}else{
         document.getElementById("inhalt6").className='itext';
}
if (document.formular.inhalt8.value==""){
         Text+='    Personen Vorname fehlt!\n';
         document.formular.inhalt8.focus();
         document.getElementById("inhalt8").className='ftext';
}else{
         document.getElementById("inhalt8").className='itext';
}
if (document.formular.inhalt9.value==""){
         Text+='    Personen Geburtsdatum fehlt!\n';
         document.formular.inhalt9.focus();
         document.getElementById("inhalt9").className='ftext';
}else{
         document.getElementById("inhalt9").className='itext';
}

if (document.formular.inhalt10[0].checked == false && document.formular.inhalt10[1].checked == false ){
         Text+='    Personen Geschlecht fehlt!\n';
         document.getElementById("inhalt100").focus();
         document.getElementById("inhalt100").className='ftext';
}else{
         document.getElementById("inhalt100").className='itext';
}




if (Text!=""){
         alert('Vervollständigen Sie:\n'+Text);
         return false;
}
}
function formtest_steuerkarte(){
var Text="";
//alert(document.getElementById("inhalt1").className);
if (document.formular.inhalt1.value==""){
         Text+='    Name, Vorname fehlt!\n';
         document.formular.inhalt1.focus();
         document.getElementById("inhalt1").className='ftext';
}else{
         document.getElementById("inhalt1").className='itext';
}

if (document.formular.inhalt2.value==""){
         Text+='    Straße, Hausnummer fehlt!\n';
         document.formular.inhalt2.focus();
         document.getElementById("inhalt2").className='ftext';
}else{
         document.getElementById("inhalt2").className='itext';
}
if (document.formular.inhalt3.value==""){
         Text+='    Postleitzahl, Ort fehlt!\n';
         document.formular.inhalt3.focus();
         document.getElementById("inhalt3").className='ftext';
}else{
         document.getElementById("inhalt3").className='itext';
}

if (document.formular.inhalt8.value=="20.."){
         Text+='    Gültigkeitsjahr fehlt!\n';
         document.formular.inhalt8.focus();
         document.getElementById("inhalt8").className='ftext';
}else{
         document.getElementById("inhalt8").className='itext';
}

if (Text!=""){
         alert('Vervollständigen Sie:\n'+Text);
         return false;
}
return true;
}
function formulartest_gaestebuch(){
var Text="";
if (document.formular.name.value==""){
         Text+='    Name, Vorname fehlt!\n';
         document.formular.name.focus();
         document.getElementById("name").className='ftext';
}else{
         document.getElementById("name").className='itext';
}


if (document.formular.text.value.length<=3  ){
         Text+='    Ihr Text fehlt!\n';
         document.formular.text.focus();
         document.getElementById("text").className='ftext';
}else{
         document.getElementById("text").className='itext';
}
if (Text!=""){
         alert('Vervollständigen Sie:\n'+Text);
         return false;
}
return true;
}
function formulartest_gewerbe(){
var Text="";
if( typeof document.formular.besucher == 'undefined')return false;
if (document.formular.ge_name.value==""){
         Text+='    Firmenname fehlt!\n';
         document.formular.ge_name.focus();
         document.getElementById("ge_name").className='ftext';
}else{
         document.getElementById("ge_name").className='itext';
}
if (Text!=""){
         alert('Vervollständigen Sie:\n'+Text);
         return false;
}


return true;
}
function formulartest_card(){
         var Text="";
         if( typeof document.formular.besucher == 'undefined')return false;

         if (document.formular.name.value==""){
                  Text+='    Bezeichner fehlt!\n';
                  document.formular.name.focus();
                  document.getElementById("name").className='ftext';
         }else{
                  document.getElementById("name").className='itext';
         }
         if (Text!=""){
                  alert('Vervollständigen Sie:\n'+Text);
                  return false;
         }
         return true;
}
function formulartest_vcard(){
        var Text="";
        if( typeof document.formular.besucher == 'undefined')return false;

        if (document.formular.name.value==""){
                 Text+='    Bezeichner fehlt!\n';
                 document.formular.name.focus();
                 document.getElementById("name").className='ftext';
        }else{
                 document.getElementById("name").className='itext';
        }
        if (Text!=""){
                 alert('Vervollständigen Sie:\n'+Text);
                 return false;
        }
        return true;
}
function formulartest_galerie(){

    if (document.formular.codeneu.value.length != 8 ){
      var Text="";
      if (document.formular.autor.value==""){
               Text+='    Autorenname fehlt!\n';
               document.formular.autor.focus();
               document.getElementById("autor").className='ftext';
      }else{
               document.getElementById("autor").className='itext';
      }


      if (document.formular.o_recht.checked != true){
      Text+='    Bilderrecht fehlt!\n';
                document.formular.o_recht.focus();
                document.getElementById("o_recht").className='ftext';
      }else {
                document.getElementById("o_recht").className='itext';
      }
      if (document.formular.meinbild.value=="" && document.formular.nr.value == 0){
               Text+='    Bild fehlt!\n';
               document.formular.meinbild.focus();
               document.getElementById("meinbild").className='ftext';
      }else{
               document.getElementById("meinbild").className='itext';
      }




      if (Text!=""){
               alert('Vervollständigen Sie:\n'+Text);
               return false;
      }
    }else{
         document.formular.nr.value    = 0;
         document.formular.autor.value = "";
    }
    return true;
}
function formulartest_sitemap(){
     var Text="";
     if( typeof document.formular.besucher == 'undefined')return false;

     if (document.formular.nav_name.value==""){
         Text+='    Beschreibung fehlt!\n';
         document.formular.nav_name.focus();
         document.getElementById("nav_name").className='ftext';
     }else{
         document.getElementById("nav_name").className='itext';
     }
     if (document.formular.nav_nic.value==""){
         Text+='    Navigationtext fehlt!\n';
         document.formular.nav_nic.focus();
         document.getElementById("nav_nic").className='ftext';
     }else{
         document.getElementById("nav_nic").className='itext';
     }
     if (document.formular.nav_ebene.value==""){
         Text+='    Navigationsebene nicht ausgewählt!\n';
         document.formular.nav_nic.focus();
         document.getElementById("nav_nic").className='ftext';
     }else{
         document.getElementById("nav_nic").className='itext';
     }



     if (document.formular.nav_ebene.value >= '2' && document.formular.navigation.value== 0  ){
         Text+='   übergeordneter Navigations Punkt fehlt!\n';
         document.formular.navigation.focus();
         document.getElementById("navigation").className='ftext';
     }else{
         document.getElementById("navigation").className='itext';
     }
     if (document.formular.nav_typ.value == '0'  ){
         Text+='   Navigations Typ Punkt fehlt!\n';
         document.formular.nav_typ.focus();
         document.getElementById("nav_typ").className='ftext';
     }else{
         document.getElementById("nav_typ").className='itext';
     }
     if (document.formular.nav_order.value==""){
         Text+='    Reihenfolge fehlt!\n';
         document.formular.nav_order.focus();
         document.getElementById("nav_order").className='ftext';
     }else{
         document.getElementById("nav_order").className='itext';
     }
     if (document.formular.nav_typ.value== 3 && document.formular.nav_modul.value == 0 ){
         Text+='    Modulnahme fehlt!\n';
         document.formular.nav_modul.focus();
         document.getElementById("nav_modul").className='ftext';
     }else{
         document.getElementById("nav_modul").className='itext';
     }
     if ( document.formular.nav_template.value == 0 ){
         Text+='    Template nahme fehlt!\n';
         document.formular.nav_template.focus();
         document.getElementById("nav_template").className='ftext';
     }else{
         document.getElementById("nav_template").className='itext';
     }
     if (document.formular.nav_typ.value== 3 && document.formular.nav_thema.value== ""  ){
         Text+='    Thema Kurzbez. fehlt!\n';
         document.formular.nav_thema.focus();
         document.getElementById("nav_thema").className='ftext';
     }else{
         document.getElementById("nav_thema").className='itext';
     }



     if (document.formular.nav_typ.value== 3 && document.formular.nav_bildpfad.value== "0"  ){
         Text+='    Speicherpfad fehlt!\n';
         document.formular.nav_bildpfad.focus();
         document.getElementById("nav_bildpfad").className='ftext';
     }else{
         document.getElementById("nav_bildpfad").className='itext';
     }
     if ( document.formular.betreuer.value == "0"  ){
         Text+='    Verantwortlicher dieses Navig.P. fehlt!\n';
         document.formular.betreuer.focus();
         document.getElementById("betreuer").className='ftext';
     }else{
         document.getElementById("betreuer").className='itext';
     }


     if (Text!=""){
         alert('Vervollständigen Sie:\n'+Text);
         return false;
}


return true;
}
function zeige_veranstaltungen(){
         myajax2('inhalt','veranstaltungen.php');
         alert();
         return false;

}

/****    Ajax zum Bild nachladen  *************************/

var req;
var allid;
     function iniAjax() {


               if( window.XMLHttpRequest ) {
                    req = new XMLHttpRequest();
               } else if( window.ActiveXObject ) {
                    req = new ActiveXObject( "Microsoft.XMLHTTP" );
               } else {
                    alert( "Ihr Webbrowser unterstuetzt leider kein Ajax!" );
               }
     }
     function myajax(nr,url){
           if(document.getElementById(nr).innerHTML == '&nbsp;'){
           allid=nr;
           req.open( "GET", url, true );
           //alert('')  ;
           req.onreadystatechange = neuerInhalt;
           req.send( null );
           }else{
           allid=nr;
           document.getElementById(nr).innerHTML= '&nbsp;';
           }

     }
     function myajax1(nr,url){
           allid=nr;
           req.open( "GET", url, true );
           req.onreadystatechange = neuerInhalt;
           req.send( null );


     }
     function myajax2(nr,url){
           allid=nr;
           if(document.forms.ovk){
           //alert(document.forms.ovk.elements.length);
               get='?';
              for (var i = 0; i < document.forms.ovk.elements.length; i++){
                  if(document.forms.ovk.elements[i].value!="" && document.forms.ovk.elements[i].type !="submit" ){
                  if(get!="?")get+="&";
                  get+=document.forms.ovk.elements[i].name+"="+ document.forms.ovk.elements[i].value;
                  }
              }
           }
           url+=get;
           req.open( "GET", url, true );
           req.onreadystatechange = neuerInhalt;
           req.send( null );


     }
     function neuerInhalt(){
       //alert(req.responseText+allid)  ;
       //if(req.responseText.length > 0){
       if(typeof( req.responseText)!='undefined'&& typeof( req.responseText)!='unknown'  ){
       //alert(typeof( req.responseText)+"|");
       document.getElementById(allid).innerHTML= req.responseText;
       }
     }

    /*****       Navigation **********************************************/
     var aki_nav=1;   // Zweite E
     var aki_nav1=1;  // Dritte E
     var aki_nav2=1;  // Vierte E
     var aki_nav3=1;
     function load_navi(a,b,c){
          aki_nav=a;
          aki_nav1=b;
          aki_nav2=c;
     }

     function mausover(nav){
         //alert(nav+"|"+aki_nav+"|"+aki_nav1+"|"+aki_nav2+"|");
         if(nav<=9 && aki_nav1<=9){

               //document.getElementById("n"+akt_nav).className='navi1p' ;
               if(document.getElementById("n"+aki_nav)){
               document.getElementById("n"+aki_nav).className='navi1p' ;
               }
         }
         if(nav<=9 && aki_nav1>=9){
               //alert("löschen 1u2u3.E"+aki_nav1);
               if(document.getElementById("n"+aki_nav)){
               document.getElementById("n"+aki_nav).className='navi1p' ;
               }
               if(document.getElementById("n"+aki_nav1)){
               document.getElementById("n"+aki_nav1).className='navi1p' ;
               }
               if(document.getElementById("n"+aki_nav2)){
               document.getElementById("n"+aki_nav2).className='navi1p' ;
               }
         }
         if(nav<=999 && aki_nav2>=100){
               //alert("löschen 3.E"+aki_nav2);
               if(document.getElementById("n"+aki_nav2)){
               document.getElementById("n"+aki_nav2).className='navi1p' ;
               }
         }

         if( nav>=10 && nav<=99 && aki_nav1>=10){
               //alert('Löschen 2 Ebene'+aki_nav1)
               if(document.getElementById("n"+aki_nav1)){
               document.getElementById("n"+aki_nav1).className='navi1p' ;
               }
         }
         if(nav>=10){

               if(nav>=1000){
                    aki_nav3=nav;
               }else if(nav>=100){
                    aki_nav2=nav;
                    if(document.getElementById("n"+aki_nav2)){
                    document.getElementById("n"+aki_nav2).className='navi1a' ;
                    }
               }else{
                    aki_nav1=nav;
                    if(document.getElementById("n"+aki_nav1)){
                    document.getElementById("n"+aki_nav1).className='navi1a' ;
                    }
               }
         }else{

              aki_nav=nav;
              aki_nav1=nav;
              aki_nav2=nav;
              if(document.getElementById("n"+aki_nav)){
              document.getElementById("n"+aki_nav).className='navi1a' ;
              }
         }
     }
function verstecken(){
     document.getElementById('f1').className = 'verstecken';
     document.getElementById('f2').className = 'sehen';

}
function sehen(){
     document.getElementById('f1').className = 'sehen';
     document.getElementById('f2').className = 'verstecken';

}
function login(){

     name="?nana="+document.login.nana.value+"&passw="+document.login.pass.value ;
     if(typeof document.formular.s != 'undefined'){
         name=name + "&s="+document.formular.s.value ;
     }
     if(typeof document.formular.besucher == 'undefined'){
     myajax1('Log1','login.php'+name);
     }


     if(typeof document.formular.besucher != 'undefined'){
          sehen();
     }
}
function suchinhalt(y,a){
     s= document.suche.suchinfo.value ;
     myajax1('l1','get_liste.php?seite='+y+'&tabelle=gewerbe&a='+a+'&suche='+s );
     document.getElementById('l1').innerHTML="<h2> Moment bitte - Start suche </h2>";
}
function suchbild(y,a,thema){
     s= document.suche.suchinfo.value ;
     myajax1('l1','get_liste.php?seite='+y+'&tabelle=bilder&a='+a+'&suche='+s+'&thema='+thema );
     document.getElementById('l1').innerHTML="<h2> Moment bitte - Start suche </h2>";
}
function is_Admin(){
 if(document.getElementById('f2')){
     if(document.getElementById('f2').className == 'sehen'){
          document.getElementById('f2').className = 'verstecken';
     }else{
          document.getElementById('f2').className = 'sehen';
          document.getElementById('nana').focus();
     }
 }
}
function get_nav(type,quelle){

     d=document.getElementById(quelle).value;
     name='?d='+d+'&q='+type;
     myajax1(type,'get_nav.php'+name);
}
function suchpdf(){
     s= document.suche.suchinfo.value ;
     //myajax1('l2','get_pdf.php?suche='+s );
     if(document.all){
     document.getElementById('l1').innerHTML="<h2> Moment bitte - PDF Datei wird geladen!</h2>";
     document.getElementById('l1').innerHTML=htlm='<embed name="pdf" id="pdf" src="'+s+'" width="749" height="100%" url="'+s+'">';
     }else{
     document.getElementById('pdf').src= s;
     }
}