var __w = window; var __d = __w.document; // handleChildren - A method to handle child selection/deselection // in the category tree. // Inputs: // s - The sibling of the DOM node you clicked. // m - 0 or 2 (deselection or selection) // // Outputs: // None function handleChildren(s,m) { var e; try { var n = s.getElementsByTagName("DIV"); } catch(e) { return; } for(var i=0;i -1) { handleParent(node.parentNode,method,1,which); } var e; try { window.frames["welcome"].updateCaption("Fetching Results..."); } catch(e) {} doSearchEvent(select, selected); // doCatEvent(selected); // window.frames["welcome"].location="search/searchtree.php?select="+select+"&selected="+selected; } function toggleNode(n) { if (n.className == "empty") { return; } var d = n.parentNode.nextSibling; if(d.style.display == "none") { d.style.display = "block"; n.className = "open"; } else { d.style.display = "none"; n.className = "closed"; } } function addUuid(uuid) { if(_search_uuids.length < 5) { _search_uuids.push(""); } for(var i=(_search_count-1); i>0; i--) { _search_uuids[i] = _search_uuids[i-1]; } _search_uuids[0] = uuid; } function setUuid(which,uuid) { _search_uuids[which] = uuid; } function checkRoot() { var x = 0; for(var i=0; i<_selections.length; i++) { x+= _selections[i]; } var t = __d.getElementById("items2").firstChild; if(x == (255 * _selections.length)) { t.childNodes[2].className="fullbox"; } else if(x == 0) { t.childNodes[2].className="chkbox"; } else { t.childNodes[2].className="halfbox"; } } /* * setStatus will be used to allow an item to unclip/toggle. * Parameters: which tree value (0-5), mode (0-1) - 1 being open */ function setStatus(w,o) { var t = __d.getElementById("items2"); var n=t.firstChild.nextSibling.childNodes[w]; // If the div doesn't have children, // don't bother doing a toggle. if (n.className == "item") {return;} if(o==1) { n.childNodes[0].className = "open"; n.nextSibling.style.display="block"; } else { n.childNodes[0].className = "closed"; n.nextSibling.style.display="none"; } } /* * setNode should be used to change the text/checkbox configuration of a given * member of the * */ function setNode(w, text, value) { _searches[w] = text; _selections[w] = value; var vclass="fullbox"; if(value == 255) { vclass="fullbox"; } else if(value == 0) { vclass="chkbox"; } else { vclass="halfbox"; } var t=__d.getElementById("items2"); var node=t.firstChild.nextSibling.childNodes[w]; node.style.display="block"; node.childNodes[1].innerHTML = text node.childNodes[2].className = vclass; } /* * addNode used to be for the purpose of adding a node, and moving all state * from the previous one. * I want this to purely handle adding an additional node, * and setting it's value. */ function isUpperCase(str, pos) { try { var x = str.charCodeAt(pos); if((x >= 48) && (x <= 57)) { return 0.5; } // support for numbers if((x >= 65) && (x <= 90)) { return 0.5; } if(x== 32) { return 1.5; } else if ((x == 109) || (x == 119) || (x==45)) { return 1.5; } return 0; } catch (e) { alert("SEND IN THE CLONE! "+str[pos]); } }; function truncateString(str, maxlen) { if (str == "") return ""; var length = str.length; if(length < 10) return str; var length2 = 0; var fin_i = 0; var x; var i; for(i=0; i < length-1; i++) { x = isUpperCase(str,i); length2 += (x+1.0); if(length2 <= maxlen) { fin_i = i; } } if((length-2) == fin_i) { return str; } switch(str[fin_i]) { case ",": case ".": case "?": case "/": case "\\": case ";": case ":": case " ": case "'": fin_i -=1; break; default: break; } return str.substring(0,fin_i-3)+"..."; } function addNode(text,value) { var x = window.document.getElementById("collections"); if(_search_count == 0) { x.firstChild.style.display="block"; } var nodes = x.firstChild; var top = nodes.childNodes[0]; nodes = top.nextSibling; var vclass="fullbox"; if(value == 255) { vclass="fullbox"; } else if(value == 0) { vclass="chkbox"; } else { vclass="halfbox"; } if(_search_count == 0) { top.style.display="block"; nodes.style.display="block"; _searches.push(text); _selections.push(value); setNode(0,text,value); _search_count++; } else { top.childNodes[2].className= "halfbox"; if(_search_count < 5) { _searches.push(""); _selections.push(255); _search_count++; } for(var i=(_search_count-1); i>0; i--) { setNode(i, _searches[i-1], 0); } setNode(0, text, value); } } var _searches = []; var _selections = []; var _search_uuids = []; var _search_count = 0;