function stacksize(thearray){ for (i = 0 ; i < thearray.length; i++ ) { if ( (thearray[i] == "") || (thearray[i] == null) || (thearray == 'undefined') ) { return i; } } return thearray.length; } function pushstack(thearray, newval){ arraysize = stacksize(thearray); thearray[arraysize] = newval; } function popstack(thearray){ arraysize = stacksize(thearray); theval = thearray[arraysize - 1]; delete thearray[arraysize - 1]; return theval; } function closeall(){ if (ktags[0]) { while (ktags[0]) { tagRemove = popstack(ktags) document.f.text.value += "[/" + tagRemove + "]"; } } ktags = new Array(); document.f.text.focus(); }