"function toggleVisibility(linkObj)\n"
"{\n"
" var base = $(linkObj).attr('id');\n"
" var summary = $('#'+base+'-summary');\n"
" var content = $('#'+base+'-content');\n"
" var trigger = $('#'+base+'-trigger');\n"
" var src=$(trigger).attr('src');\n"
" if (content.is(':visible')===true) {\n"
"   content.hide();\n"
"   summary.show();\n"
"   $(linkObj).addClass('closed').removeClass('opened');\n"
"   $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png');\n"
" } else {\n"
"   content.show();\n"
"   summary.hide();\n"
"   $(linkObj).removeClass('closed').addClass('opened');\n"
"   $(trigger).attr('src',src.substring(0,src.length-10)+'open.png');\n"
" } \n"
" return false;\n"
"}\n"
"\n"
"function updateStripes()\n"
"{\n"
"  $('table.directory tr').\n"
"       removeClass('even').filter(':visible:even').addClass('even');\n"
"}\n"
"function toggleLevel(level)\n"
"{\n"
"  $('table.directory tr').each(function(){ \n"
"    var l = this.id.split('_').length-1;\n"
"    var i = $('#img'+this.id.substring(3));\n"
"    var a = $('#arr'+this.id.substring(3));\n"
"    if (l<level+1) {\n"
"      i.attr('src','ftv2folderopen.png');\n"
"      a.attr('src','ftv2mnode.png');\n"
"      $(this).show();\n"
"    } else if (l==level+1) {\n"
"      i.attr('src','ftv2folderclosed.png');\n"
"      a.attr('src','ftv2pnode.png');\n"
"      $(this).show();\n"
"    } else {\n"
"      $(this).hide();\n"
"    }\n"
"  });\n"
"  updateStripes();\n"
"}\n"
"\n"
"function toggleFolder(id)\n"
"{\n"
"  //The clicked row\n"
"  var currentRow = $('#row_'+id);\n"
"  var currentRowImages = currentRow.find(\"img\");\n"
"\n"
"  //All rows after the clicked row\n"
"  var rows = currentRow.nextAll(\"tr\");\n"
"\n"
"  //Only match elements AFTER this one (can't hide elements before)\n"
"  var childRows = rows.filter(function() {\n"
"    var re = new RegExp('^row_'+id+'\\\\d+_$', \"i\"); //only one sub\n"
"    return this.id.match(re);\n"
"  });\n"
"\n"
"  //First row is visible we are HIDING\n"
"  if (childRows.filter(':first').is(':visible')===true) {\n"
"    currentRowImages.filter(\"[id^=arr]\").attr('src', 'ftv2pnode.png');\n"
"    currentRowImages.filter(\"[id^=img]\").attr('src', 'ftv2folderclosed.png');\n"
"    rows.filter(\"[id^=row_\"+id+\"]\").hide();\n"
"  } else { //We are SHOWING\n"
"    //All sub images\n"
"    var childImages = childRows.find(\"img\");\n"
"    var childImg = childImages.filter(\"[id^=img]\");\n"
"    var childArr = childImages.filter(\"[id^=arr]\");\n"
"\n"
"    currentRow.find(\"[id^=arr]\").attr('src', 'ftv2mnode.png'); //open row\n"
"    currentRow.find(\"[id^=img]\").attr('src', 'ftv2folderopen.png'); //open row\n"
"    childImg.attr('src','ftv2folderclosed.png'); //children closed\n"
"    childArr.attr('src','ftv2pnode.png'); //children closed\n"
"    childRows.show(); //show all children\n"
"  }\n"
"  updateStripes();\n"
"}\n"
"\n"
"\n"
"function toggleInherit(id)\n"
"{\n"
"  var rows = $('tr.inherit.'+id);\n"
"  var img = $('tr.inherit_header.'+id+' img');\n"
"  var src = $(img).attr('src');\n"
"  if (rows.filter(':first').is(':visible')===true) {\n"
"    rows.css('display','none');\n"
"    $(img).attr('src',src.substring(0,src.length-8)+'closed.png');\n"
"  } else {\n"
"    rows.css('display','table-row'); // using show() causes jump in firefox\n"
"    $(img).attr('src',src.substring(0,src.length-10)+'open.png');\n"
"  }\n"
"}\n"
"\n"
