/* Copyright: Paul Hanlon Released under the MIT/BSD licence which means you can do anything you want with it, as long as you keep this copyright notice on the page */ (function(jq){ jq.fn.jqTreeTable=function(map, options){ var opts = jq.extend({openImg:"",shutImg:"",leafImg:"",lastOpenImg:"",lastShutImg:"",lastLeafImg:"",vertLineImg:"",blankImg:"",collapse:false,column:0,striped:false,highlight:false,state:true},options), mapa=[],mapb=[],tid=this.attr("id"),collarr=[], stripe=function(){ if(opts.striped){ $("#"+tid+" tr:not(.collapsed)").filter(":even").addClass("even").removeClass("odd").end().filter(":odd").removeClass("even").addClass("odd"); } }, buildText = function(parno, preStr){//Recursively build up the text for the images that make it work var mp=mapa[parno], ro=0, pre="", pref, img; for (var y=0,yl=mp.length;y'; pref = preStr + ''; arguments.callee(ro, pref); }else{//it's a child img = (y==yl-1)? opts.lastLeafImg: opts.leafImg;//It's the last child, It's child will have a blank field behind it mapb[ro-1] = preStr + ''; } } }, expandKids = function(num, last){//Expands immediate children, and their uncollapsed children jq("#"+tid+num).attr("src", (last)? opts.lastOpenImg: opts.openImg);// for (var x=0, xl=mapa[num].length;x