var mainArray = new Array(); var helperArray = new Array(); var mainArrayBegin = new Array(); var mainArrayEnd = new Array(); var nextSiblings = new Array(); var myHelpString = new String(); var ChildArray = new Array(); var LastParent = new Number(); var GotoElement = new String(); var yPos = new Number(); var yPosMain = new Number(); var v_element = new String(); var indexOpenNodes = 0; var openNodesArray = new Array(); var lastRecord; var ApplPath = new String(); var DaBa = new Number(); var BrowseLev = new Number(); var pick_rn = new Number(); var FullTree = 1; // Vars for manipulatings descs in tree var MouseSel = new Number(0); var Arc_Picked_Desc = new Number(0); ParentLev = 0; var TreeSel = new Number(0); var TreeCut = new Number(0); // Vars for values browsing OPAC-URL v_lan = new String(); v_seop = new Number(); v_sele = new Number(); v_sepa = new Number(); v_sest = new String(); v_senu = 0; v_dbnu = new Number(); v_rqdb = new String(); function nodeDataArray(recnumm, description, nodeType, indexVal, numChildren, lev, m773w) { this.recnumm = recnumm this.description = description this.nodeType = nodeType this.indexVal = indexVal this.numChildren = numChildren this.lev = lev this.m773w = m773w; } // f_geticon gives the right icon, given the type (FO, DO, ST, etc) and the state (0: closed, 1: open) // function f_geticon(type, state) { var icon = new String() if (state==0) { if (type=='GR'){ icon ='groupC.gif'; } else if (type =='DO'){ icon ='fileC.gif'; } else if (type=='SE'){ icon ='seriesC.gif'; } else if (type =='FO'){ icon ='fondsC.gif'; } else if (type=='ST'){ icon ='item.gif'; } else{ icon ='item.gif'; } } else if (state==1) { if (type=='GR'){ icon ='groupO.gif'; } else if (type =='DO'){ icon ='fileO.gif'; } else if (type=='SE'){ icon ='seriesO.gif'; } else if (type =='FO'){ icon ='fondsO.gif'; } else if (type=='ST'){ icon ='item.gif'; } else{ icon ='item.gif'; } } icon ='http://pallas.cegesoma.be/images/'+ icon; return icon; } function getChildren(id, i){ // --------METHOD-------: // Slice the mainArray in two sub-arrays, namely: mainArrayBegin and mainArrayEnd. The cut point is the index that has been clicked // Destroy mainArray, helperArray // Call the server, and get the new helperArray, that contains the children of the id corresponding to this index that has been clicked // Slice the mainArray into two sub-arrays. helperArray = new Array(); mainArrayBegin = new Array(); mainArrayEnd = new Array(); yPos = window.frames["leftFrame"].document.body.scrollTop; // openNodesArray for storing this open node // if (helperArray.length > 0) // if it has been filled, a node at least has been open openNodesArray[openNodesArray.length] = id; // else // this should not happen. Database to be corrected! // alert ('Error: node is marked as having children in the DB, but has no children! Please reload the page!') for (var j = 0; j < i+1; j++) { mainArrayBegin[j] = mainArray[j]; } for (var k = i+1; k < mainArray.length; k++) { mainArrayEnd[k - i -1] = mainArray[k]; } // mainArray can now be safely destroyed mainArray=new Array(); // Here goes the UPDATED helperArray // Use "anotherFrame" to get the new data in it, method will also call "addChildren" if (document.DBData.db.value != "0") { window.frames["anotherFrame"].location.href = "http://pallas.cegesoma.be/pls/" + ApplPath + "/arctree.jsdatachild?p_lan=N&p_ID=" + id + "&p_i=" + i + "&p_db=" + document.DBData.db.value; } else { window.frames["anotherFrame"].location.href = "http://pallas.cegesoma.be/pls/" + ApplPath + "/arctree.jsdatachild?p_lan=N&p_ID=" + id + "&p_i=" + i; } } function addChildren(id, i){ // id = recnumm, i= index in mainArray // --------METHOD-------: // Called from script generated on server // Concatenate the three arrays: mainArrayBegin, helperArray, mainArrayEnd into mainArray // Write the new data in the leftFrame. for (var i = 0; i < mainArrayBegin.length; i++) { mainArray[i]=mainArrayBegin[i]; } for (var i = mainArrayBegin.length ; i < (mainArrayBegin.length + helperArray.length); i++) { mainArray[i]= helperArray[i -mainArrayBegin.length]; } for (var i = (mainArrayBegin.length + helperArray.length); i < (mainArrayBegin.length + helperArray.length + mainArrayEnd.length); i++) { mainArray[i]=mainArrayEnd[i - mainArrayBegin.length - helperArray.length]; } } // Note: the