function menuprop(){ loopndx = 0; while(cats > catndx){ //while there are still categories menuhtml += '
' + catarray[catndx] + '
'; menuhtml += ''; menuhtml += ''; menuhtml += ''; catndx++; } //outside loops document.getElementById("sidemenu").innerHTML = menuhtml; //document