<!--Popup Bildergalerie
function popup (img,sx,sy,num) {
		 var winl = (screen.width-sx)/2;
		 var wint = (screen.height-sy)/2;
    image = "<a href='javascript:self.close()'><img src=" + img + " border=0 alt='Click to Close'></a>";
    popupwin=window.open("","photo"+num,"toolbar=no,location=no,directories=no,status=no,menubar=no,top="+wint+",left="+winl+",width="+sx+",height="+sy+"");
    popupwin.document.write("<HTML><HEAD><TITLE>Bildergalerie</TITLE><BASE HREF=\http://zum-strandkorb/\></HEAD><BODY BGCOLOR=#FFFFFF><CENTER>" + image + "</CENTER></BODY></HTML>");
    popupwin.document.close();
}

function go_menu(menu) {
    choice = menu.selectedIndex;
    if (menu.options[choice].value != "") {
        window.location.href = menu.options[choice].value;
    }
}
// -->






<!-- zum Springen eines Spungmenüs
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->

<!-- für den Admin-Bereich
function HTMLCode(form,field,v)
 {
 if (document.selection) // for IE
   {
    var str = document.selection.createRange().text;
    document.forms[form].elements[field].focus();
    var sel = document.selection.createRange();
    sel.text = "<" + v + ">" + str + "</" + v + ">";
    return;
   }
  else if ((typeof document.forms[form].elements[field].selectionStart) != 'undefined') // for Mozilla
   {
    var txtarea = document.forms[form].elements[field];
    var selLength = txtarea.textLength;
    var selStart = txtarea.selectionStart;
    var selEnd = txtarea.selectionEnd;
    var oldScrollTop = txtarea.scrollTop;
    var s1 = (txtarea.value).substring(0,selStart);
    var s2 = (txtarea.value).substring(selStart, selEnd)
    var s3 = (txtarea.value).substring(selEnd, selLength);
    txtarea.value = s1 + '[' + v + ']' + s2 + '[/' + v + ']' + s3;
    txtarea.selectionStart = s1.length;
    txtarea.selectionEnd = s1.length + 5 + s2.length + v.length * 2;
    txtarea.scrollTop = oldScrollTop;
    txtarea.focus();
    return;
   }
  else insert(form,field,'<' + v + '></' + v + '> ');
 }

//-->



// Drehregler (plus und minus)
function minus(Name , Startwert  , Schrittweite){
 var nWert = parseInt(document.Form.elements[Name].value)
 if(nWert > Startwert) {
  nWert -= Schrittweite;
 }
  document.Form.elements[Name].value=nWert;
}

function plus(Name , Endwert , Schrittweite){
 var nWert = parseInt(document.Form.elements[Name].value)
 if(nWert < Endwert) {
  nWert += Schrittweite;
 }
  document.Form.elements[Name].value=nWert;
}


// Formular-Überprüfungen
  function kontrolle()
{
  var temp=1;
  for(var i=0;i<window.document.formular.elements.length-1;i++)
  {
  if(window.document.formular.elements[i].value=="")
  {temp=-1;}
  }
  if(temp>0){document.formular.submit();}else{alert("Bitte füllen Sie alle Felder aus...");}
}
  
  function knewsschreiben()
{
  var temp=1;

  if(window.document.newsschreiben.Titel.value=="")
  {
    temp=-1;
  }
  if(window.document.newsschreiben.Text.value=="")
  {
    temp=-1;
  } 
  if(temp>0)
  {
    document.newsschreiben.submit();
  }
  else
  {
    alert("Titel und Text müssen ausgefüllt sein...");
  }
}

  function kspeichern()
{
  var temp=1;

  if(window.document.speichern.Titel.value=="")
  {
    temp=-1;
  }
  if(window.document.speichern.Text.value=="")
  {
    temp=-1;
  } 
  if(temp>0)
  {
    document.speichern.submit();
  }
  else
  {
    alert("Titel und Text müssen ausgefüllt sein...");
  }
}

  function newsverschicken()
{
  var temp=1;

  if(window.document.formular.absendername.value=="" || 
     window.document.formular.adressatname.value=="" || 
	 window.document.formular.absenderemail.value=="" || 
	 window.document.formular.adressatemail.value=="")
  {
    temp=-1;
  } 
  if(temp>0)
  {
    document.formular.submit();
  }
  else
  {
    alert("Alle Felder müssen ausgefüllt sein...");
  }
}

  function newsaendern()
{
  document.newsvorschau.action="newsschreiben.php";
  document.newsvorschau.submit();
}

  function newsabschicken()
{
  document.newsvorschau.action="newsabschicken.php";
  document.newsvorschau.submit();
}




// Navigation -- Switch Menu

var persistmenu="yes" 
var persisttype="sitewide" 

if (document.getElementById){ 
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("box").getElementsByTagName("span"); 
		if(el.style.display != "block"){ 
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu") 
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function onloadfunction(){
if (persistmenu=="yes"){
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=get_cookie(cookiename)
if (cookievalue!="")
document.getElementById(cookievalue).style.display="block"
}
}

function savemenustate(){
var inc=1, blockid=""
while (document.getElementById("sub"+inc)){
if (document.getElementById("sub"+inc).style.display=="block"){
blockid="sub"+inc
break
}
inc++
}
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
document.cookie=cookiename+"="+cookievalue
}

if (window.addEventListener)
window.addEventListener("load", onloadfunction, false)
else if (window.attachEvent)
window.attachEvent("onload", onloadfunction)
else if (document.getElementById)
window.onload=onloadfunction

if (persistmenu=="yes" && document.getElementById)
window.onunload=savemenustate

