<!--
var infoboxid;
var neu = null;
function popup_einfach (url,windowname,xsize,ysize)
{
    if (neu != null)
    {
        if (neu.closed != true)
        {
            neu.window.close();
        }
    }
    neu = window.open(url,windowname,'scrollbars,resizable,width='+xsize+',height='+ysize+'');
    if (navigator.appName == "Microsoft Internet Explorer")
    neu.moveTo((screen.width-xsize)/2,100);
}
function popup_vollbild (url,windowname,xsize,ysize)
{
    if (neu != null)
    {
        if (neu.closed != true)
        {
            neu.window.close();
        }
    }
    neu = window.open(url,windowname,'scrollbars,resizable,width='+xsize+',height='+ysize+'');
    if (navigator.appName == "Microsoft Internet Explorer")
    neu.moveTo((screen.width-xsize)/2,100);
}
function popup_nocontrol(url,windowname,xsize,ysize)
{
    if (neu != null)
    {
        if (neu.closed != true)
        {
            neu.window.close();
        }
    }
    neu = window.open(url,windowname,'resizable,width='+xsize+',height='+ysize+'');
    if (navigator.appName == "Microsoft Internet Explorer")
    neu.moveTo((screen.width-xsize)/2,100);
}
function popup_scroll(url,windowname,xsize,ysize)
{
    if (neu != null)
    {
        if (neu.closed != true)
        {
            neu.window.close();
        }
    }
    neu = window.open(url,windowname,'scrollbars,resizable=no,width='+xsize+',height='+ysize+'');
    neu.moveTo((screen.width-xsize)/2,100);
}
function popup_fullscreen(url, windowname)
{
var str = "left=0,screenX=0,top=0,screenY=0";
    if (window.screen)
    {
        var ah = screen.availHeight - 30;
        var aw = screen.availWidth - 10;
        str += ",height=" + ah;
        str += ",width=" + aw;
        str += ",scrollbars,resizable,location,menubar,status,tiltebar,toolbar";
    }
    neu =  window.open(url, windowname, str);
    neu.moveTo(0,0);
    neu.focus();
}

function showinfobox(id) {
	if (infoboxid) {
		document.getElementById("infobox"+infoboxid).style.display = "none";
	}
	if (id) {
		document.getElementById("infobox"+id).style.display = "block";
	}
	infoboxid = id;
}

if (!suchfenster) {
	var suchfenster;
}

var changed=false; // Flag, ob die Suchbegriffe veraendert wurden

function suchen() {
	if (!suchfenster || suchfenster.closed || changed) {
		mysuche = escape(document.suche.such_text.value);
		suchfenster = window.open("./pop_suche_fs.php?suchbegriffe="+mysuche,"suchen","width=616,height=550");
		
		if (navigator.appName == "Microsoft Internet Explorer") {
			suchfenster.moveTo((screen.width-616)/2,100);
		}
		if (!suchfenster.opener) {
			suchfenster.opener=window;
		}
	}
	else if (suchfenster.focus) {
		suchfenster.focus();
	}
}

function required (formname) {
    var feldname=new RegExp("^"+formname+"_*","gi");
    var ok=true;
    for (i=0;i<document.formular.length;i++) {
        if (document.formular[i].name.match(feldname)==(formname+"_")) {
            if (document.formular[i].name.match(/_required$/gi)) {
                if (document.formular[i].type=="checkbox") {
                    if (document.formular[i].checked==false) {
                        ok=false;
                    }
                }
                else if (document.formular[i].type=="radio") {
                    var radioname = document.formular[i].name;
                    var radiook = false;
                    var radiolength=eval("document.formular."+radioname+".length");
                    for (i2=0;i2<radiolength;i2++) {
                        radiook = radiook || (eval("document.formular."+radioname+"["+i2+"].checked"));
                    }
                    if (radiook==false) {
                        ok=false;
                    }
                }
                else if (document.formular[i].type.match(/^select/gi)) {
                    if ((document.formular[i].value=="undefined") || (document.formular[i].value=="")) {
                        ok=false;
                    }
                }
				else if (document.formular[i].name.match(/mail/gi) == "mail") {
					 var mail = document.formular[i].value;
					 if (mail.search(/^[_a-z0-9A-Z+-]+(\.[_a-z0-9A-Z+-]+)*@[a-z0-9A-Z-]+(\.[a-z0-9A-Z-]+)$/) == -1) {
						ok = false;
					}
				}
                else {
                    if (document.formular[i].value=="") {
                        ok=false;
                    }
                }
            }
        }
    }
    if (ok==false) {
        alert ("Sie haben leider nicht alle zur Bearbeitung notwendigen Angaben gemacht,\nbitte versuchen Sie es noch einmal.");
    }
    return ok;
}

function formular_auswerten(name) {
    var split=name.split("|");
    for (var i=split.length;i<4;i++) {
        split.push("");
    }
    var formname=split[0];

    if (required(formname)) {
        var empfaenger=split[1];
        var subject=split[2];
        var absender=split[3];

        var feldname=new RegExp("^"+formname+"_*","gi");

        var name;
        var str="formularname="+escape(formname)+"&";
        str += "&empfaenger="+empfaenger;
        str += "&subject="+subject;
        str += "&absender="+absender;
        str += "&";
        for (i=0;i<document.formular.length;i++) {
            if (document.formular[i].name.match(feldname)==(formname+"_")) {

                name=document.formular[i].name.replace(feldname,"");
                name=name.replace(/_required$/gi,"");
                if ((document.formular[i].type=="radio") || (document.formular[i].type=="checkbox")) {
                    if (document.formular[i].checked==true) {
                        str+= name+"="+escape(document.formular[i].value)+"&";
                    }
                }
                else if (document.formular[i].type.match(/^select/gi)) {
                    var selectname = document.formular[i].name;
                    str+= name+"="+escape(eval("document.formular."+selectname+"[document.formular."+selectname+".selectedIndex].value"))+"&";
                }
                else {
                    str+= name+"="+escape(document.formular[i].value)+"&";
                }
            }
        }
        popup_nocontrol ("./formularauswertung.php?"+str,"mail",400,200);
    }
}

function popup_kontakt() {
  window.open('kontakt.php','kontakt','width=794,height=515');
}

function popup_popup(url,windowname,xsize,ysize) {
    var popupwinres;
    if (popupwinres != null) {
        if (popupwinres.closed != true) {
            popupwinres.window.close();
        }
    }
    popupwinres = window.open(url,windowname,'scrollbars=yes,resizable,width='+xsize+',height='+ysize+'');
    popupwinres.moveTo((screen.width-xsize)/2,100);
}

function setcontent(object) {
	if (object) {
		document.getElementById(object).style.visibility="visible";
	}
}

function closecontent (object) {
	if (object) {
		document.getElementById(object).style.visibility="hidden";
	}
}

function eingabefeld_aktion(objekt, wenn, dann) {
	if(objekt.value == wenn) {
		objekt.value = dann;
	}
}

function bild_wechsel(nr, anz) {
	for(i=1; i<=anz; i++) {
		if(nr != i) {
			document.getElementById('bild_vorschau'+i).style.display = 'none';
		}
		else {
			document.getElementById('bild_vorschau'+i).style.display = 'block';
		}
	}
}

function bildwechsel(dateiname, obj_id)
{
	if(obj_id==undefined)
	{
		obj_id = "anfahrt_skizze";
	}
	document.getElementById(obj_id).src = dateiname;
}
//-->