function bildwechsel(bildname,zustand)
  {
  bildwechsel_skript(bildname,zustand,"../images/");
  }

function bildwechsel_root(bildname,zustand)
  {
  bildwechsel_skript(bildname,zustand,"images/");
  }

function bildwechsel_skript(bildname,zustand,imagepath)
  {
  bildsrc = document.images[bildname].src;
  bildsrc_slash = bildsrc.lastIndexOf("/")+1;
  bildsrc_punkt = bildsrc.lastIndexOf(".")+1;
  if (zustand == 1)
    {
    bildsrc_0 = (bildsrc.substr(bildsrc_slash));
    document.images[bildname].src=imagepath + bildsrc.substr(bildsrc_slash,bildsrc_punkt - bildsrc_slash - 2) + zustand + bildsrc.substr(bildsrc_punkt - 1);
    }
  else if (zustand == 0)
    {
    document.images[bildname].src=imagepath + bildsrc_0;
    }
  }
/*
function popup(docname,breite,hoehe,e)
  {
  if (parseInt(navigator.appVersion) >= 4 && navigator.appName.indexOf("Microsoft") != -1)
    {
    winposstring=",left="+(window.event.clientX+window.screenLeft-breite/2)+",top="+(window.event.clientY+window.screenTop-200);
    }
  else if (parseInt(navigator.appVersion) >= 4)
    {
    winposstring=",left="+(screen.availWidth/2-breite/2)+",top="+(screen.availHeight/2-hoehe/2);
    }
  else
    {
    winposstring=",left=400,top="+((800-hoehe)/2);
    }
//alert("einkaufswagen=window.open('"+docname+"','einkaufswagen','width="+breite+",height="+hoehe+winposstring+"')");
  if (docname.indexOf("cart_pop_info.php") == -1)
    {
	eval("einkaufswagen=window.open('"+docname+"','einkaufswagen','width="+breite+",height="+hoehe+winposstring+"')");
    einkaufswagen.focus();
	}
  else
    {
    if (parseInt(navigator.appVersion) >= 4)
      {
      winposstring=",left="+(screen.availWidth/2-breite/2)+",top="+(screen.availHeight/2-hoehe/2);
      }
	eval("infofenster=window.open('"+docname+"','infofenster','width="+breite+",height="+hoehe+winposstring+",scrollbars=yes')");
    infofenster.focus();
	}
  }
function aktualisieren(bestnr,bestnr_kurz)
  {
  if (document.location.href.indexOf("?") != -1)
    {
    doku_url = document.location.href.substr(0,document.location.href.indexOf("?"));
    } 
  else
    {
    doku_url = document.location.href;
    } 
  document.location.href=doku_url+"?chg:"+bestnr+":"+document.form1["anzahl_"+bestnr_kurz].value;
  }
function menuselect(spannz_typ,spannz_select)
  {
  spannz_select_list = document.tab_form.spannz_select_list.value.split(",");

  //alert (spannz_typ+"-"+spannz_gr_81+"-"+spannz_gr_82);
  //alert (spannz_select);

//  eval("for (i=0;i<document.tab_form.select"+spannz_select+".length;++i) if(document.tab_form.select"+spannz_select+".options[i].selected == true) spannz_gr_neu = document.tab_form.select"+spannz_select+".options[i].value");

  fragezeichenpos = document.location.href.indexOf("?");
  if (fragezeichenpos != -1)
    {
    sprungziel = document.location.href.substring(0,fragezeichenpos);
	}
  else
    {
	sprungziel = document.location.href;
	}
  for (j=0;j<spannz_select_list.length-1;j++)
    {
	eval("for (k=0;k<document.tab_form.select"+spannz_select_list[j]+".length;++k) if(document.tab_form.select"+spannz_select_list[j]+".options[k].selected == true) spannz_gr_neu = document.tab_form.select"+spannz_select_list[j]+".options[k].value");
	
	if (j == 0)
	  {
	  sprungziel += "?";
	  }
	else
	  {
	  sprungziel += "&";
	  }

	sprungziel += "sz"+spannz_select_list[j]+"="+spannz_gr_neu;
    }
  document.location.href = sprungziel+"#spannz";
  }
*/

////////////////////////////////////// pdmenu
var pdvisibleflag = new Array();
pdvisibleflag["pdmenu1"] = 0;
function menucontrol(menuname,menuflag)
  {
  if (document.getElementById)
    {
    menuname_mother = menuname.substring(0,menuname.indexOf("-"));
    menuname_vorne = menuname_mother+"-";
    if (menuflag == 1)
      {
      if (menuname.indexOf("-") == -1)
        {
        for (i=0;i<100;i++)
          {
          if("pdmenu"+i != menuname)
            {
            if(document.getElementById("pdmenu"+i))
              {
              document.getElementById("pdmenu"+i).style.visibility = "hidden";
              }
            }
          }
/////////////////////////////////////////////
//        for (i=1;i<=30;i++)
//          {
//          j=1;
////          for (j=1;i<=3;j++)
//            {
//            if(document.getElementById("pdmenu"+j+"-"+i))
//              {
//              document.getElementById("pdmenu"+j+"-"+i).style.visibility = "hidden";
//              }
//            }
//          }
/////////////////////////////////////////////
        }
      else
        {
        for (i=1;i<=100;i++)
          {
          if(menuname_vorne+i != menuname && document.getElementById(menuname_vorne+i))
            {
//alert (menuname_vorne+i);
            document.getElementById(menuname_vorne+i).style.visibility = "hidden";
            }
          }
        pdvisibleflag[menuname_mother] = 1;
        }
      pdvisibleflag[menuname] = 1;
      if (menuname != "")
	    {
        document.getElementById(menuname).style.visibility = "visible";
        }
      }
    else if (menuflag == 0)
      {
      if (menuname.indexOf("-") != -1)
        {
        pdvisibleflag[menuname_mother] = 0;
        setTimeout("pdmenuclose(\""+menuname_mother+"\")",1000);
        }
      pdvisibleflag[menuname] = 0;
      setTimeout("pdmenuclose(\""+menuname+"\")",1000);
      }
    }
  }
function pdmenuclose(menuname)
  {
  if (pdvisibleflag[menuname] == 0 && menuname != "")
    {
    document.getElementById(menuname).style.visibility = "hidden";  
    }
  }
////////////////////////////////////// pdmenu

function uebergabe(varname,varwert)
  {
  document.varform.varnamewert.value=varname+"#"+varwert;
//alert(varname+"#"+varwert);
  setTimeout("document.varform.submit();",1000);
  }
