OK, komme nicht weiter !!!
Wie gesagt, das Script bricht meine Kompetenz...
Also, hier ist es mal...
Was soll ich hier ändern ?
Script-open, Script-end und Gruppenauflistung habe ich weggelassen...
**********************************************************
function hasChildren(x) {
var temp = false;
for (y=0;y<menudata.length;y++) {
if (x == menudata[y]["Parent"]) {
temp = true; }}
return temp;
}
function openChildren(x) {
for (z=0;z<menudata.length;z++) {
if (menudata[z]["ID"] == x) {
idx = z;
currentlevel = menudata[idx]["Level"];
showlevel = parseInt(currentlevel) + 1; }}
if (childrenopen(x) == true) {
b = false;
for (t=idx+1;t<menudata.length;t++) {
if (currentlevel == menudata[t]["Level"]) {
b = true;
}
if (b == false) {
menudata[t]["Show"] = false;
}
}
}
else if (childrenopen(x) == false) {
b = false;
for (t=idx+1;t<menudata.length;t++) {
if (currentlevel == menudata[t]["Level"]) {
b = true;
}
if (b == false && menudata[t]["Parent"] == menudata[idx]["ID"]) {
menudata[t]["Show"] = true;
}
}
}
if (menudata[idx]['Items'] == true) {
parent.mainFrame.location.href = 'groups/g_'+menudata[idx]['ID']+'/itemsna1.htm';}
loadmenu();
}
function childrenopen(x) {
var b = false;
for (z=0;z<menudata.length;z++) {
if (menudata[z]["Parent"] == x) {
if (menudata[z]["Show"] == true) {
b = true; } } }
return b;
}
function gotolist(x) {
for (z=0;z<menudata.length;z++) {
if (menudata[z]["ID"] == x) {
if (menudata[z]["Items"] == true) {
parent.mainFrame.location.href = 'groups/g_'+menudata[z]['ID']+'/itemsna1.htm'; }
else {
parent.mainFrame.location.href = 'pages/empty.htm'; }}}
}
function loadmenu() {
header = '<html>\n'
+'<head>\n'
+'<title>Shop<\/title>\n'
+'<link rel="stylesheet" type="text\/css" href="styles\/main.css" \/>\n'
+'<\/head>\n'
+'<body class="bgmenu" style="margin:10px">\n'
+'<table border="0" class="bgwhite" cellpadding="1" cellspacing="0" width="180" style="border:1px solid black;">\n'
+'<tr><th class="bgdark" style="border-bottom:1px solid black;padding:2px;"><p class="fgwhite">Warengruppen<\/p><\/th><\/tr>\n'
footer = '<\/table>\n<\/body>\n<\/html>';
body = '';
for (i=0;i<menudata.length;i++) {
level = '';
for (l=0;l<parseInt(menudata[i]["Level"]);l++) {
level = level + '<img src="images\\clear.gif" border="0" width="12" height="12" alt="">'; }
if (menudata[i]["Parent"] == -1 menudata[i]["Show"] == true) {
if (hasChildren(menudata[i]["ID"]) == true) {
if (childrenopen(menudata[i]["ID"]) == true) { img = 'minus.gif'; }
else { img = 'plus.gif'; }
body = body + '<tr>\n<td><p class="menubutton" onmouseover="this.className=\'menuover\'" onmouseout="this.className=\'menubutton\'" onclick="parent.menudataFrame.openChildren(\''+menudata[i]["ID"]+'\')">'+level+'<img src="images\\'+img+'" border="0" align="bottom" \/> '+menudata[i]["Name"]+'<\/p>\n<\/td><\/tr>\n';
}
else {
body = body + '<tr>\n<td><p class="menubutton" onmouseover="this.className=\'menuover\'" onmouseout="this.className=\'menubutton\'" onclick="parent.menudataFrame.gotolist(\''+menudata[i]["ID"]+'\')">'+level+'<img src="images\\file.gif" border="0" align="bottom" \/> '+menudata[i]["Name"]+'<\/p>\n<\/td><\/tr>\n';
}
}
}
text = header + body + footer;
parent.menuFrame.document.close();
parent.menuFrame.document.open();
parent.menuFrame.document.write(text);
parent.menuFrame.document.close();
}
************************************************************
Danke und Gruss, loddel