- var toggle = 0;
- function replie() {
- if (toggle == 1) return;
- toggle = 2;
- var cat=$.trim($(this).parent().text().replace(/(.*)\([0-9]+\)/, "$1"));
- $("tr[@id^=row/"+cat+"/]").hide();
- $(this).attr('src', 'images/k1.gif').unbind("click", replie).click(deplie);
- setTimeout("toggle = 0;", 10);
- }
- function deplie(image) {
- if (toggle == 2) return;
- toggle = 1;
- var cat=$.trim($(this).parent().text().replace(/(.*)\([0-9]+\)/, "$1"));
- $("tr[@id^=row/"+cat+"/]").show();
- $(this).attr('src', 'images/k2.gif').unbind("click", deplie).click(replie);
- setTimeout("toggle = 0;", 10);
+
+ function toggleCategory(cat)
+ {
+ if ($('#category_' + cat).find('.wiki_root').attr('src') == 'images/k1.gif') {
+ $('#category_' + cat).find('.wiki_root').attr('src', 'images/k2.gif');
+ } else {
+ $('#category_' + cat).find('.wiki_root').attr('src', 'images/k1.gif');
+ }
+
+ var i = 0;
+ while ($('#row_' + cat + '_' + i).length != 0) {
+ $('#row_' + cat + '_' + i).toggle();
+ ++i;
+ }
+ return false;