5 var idsCookie = new cookieObject("ids", 1, "/", COOKIE_IDS);
7 function mresultUnload() { removeChildren(table); table = null;}
9 function mresultDoSearch() {
11 table = G.ui.result.main_table;
13 hideMe(G.ui.result.row_template);
14 while( table.parentNode.rows.length <= getDisplayCount() ) /* add an extra so IE and safari won't complain */
15 hideMe(table.appendChild(G.ui.result.row_template.cloneNode(true)));
17 if(getOffset() == 0 || getHitCount() == null ) {
18 mresultGetCount(); /* get the hit count */
19 mresultCollectIds(); /* do the actual search */
26 function mresultGetCount() {
27 var req = new Request(FETCH_MRCOUNT,
28 getStype(), getTerm(), getLocation(), getDepth(), getForm() );
29 req.callback(mresultHandleCount);
33 function mresultHandleCount(r) {
34 HITCOUNT = parseInt(r.getResultObject());
39 /* performs the actual search */
40 function mresultCollectIds() {
43 if(getOffset() == 0) {
44 idsCookie.put(COOKIE_IDS,"");
47 var c = JSON2js(idsCookie.get(COOKIE_IDS));
48 if(c && c.recs) { records = c.recs; ranks = c.ranks; }
51 if( getOffset() != 0 &&
52 records[getOffset()] != null &&
53 records[resultFinalPageIndex()] != null) {
54 mresultCollectRecords();
58 var req = new Request(FETCH_MRIDS, getStype(), getTerm(),
59 getLocation(), getDepth(), getDisplayCount() * 5, getOffset(), getForm() );
60 req.callback(mresultHandleMRIds);
65 function mresultHandleMRIds(r) {
66 mresultSetRecords(r.getResultObject().ids);
67 mresultCollectRecords();
70 function mresultSetRecords(idstruct) {
72 for( var x = o; x < idstruct.length + o; x++ ) {
73 if(idstruct[x-o] == null) break;
74 records[x] = parseInt(idstruct[x - o][0]);
75 ranks[x] = parseFloat(idstruct[x - o][1]);
77 idsCookie.put(COOKIE_IDS, js2JSON({ recs: records, ranks : ranks }) );
81 function mresultHandleMods(r) {
82 var rec = r.getResultObject();
83 resultDisplayRecord(rec, rowtemplate, r.userdata, true);
84 resultCollectCopyCounts(rec, FETCH_MR_COPY_COUNTS);
88 function mresultCollectRecords() {
90 for( var x = getOffset(); x!= getDisplayCount() + getOffset(); x++ ) {
91 if(isNull(records[x])) break;
92 var req = new Request(FETCH_MRMODS, records[x]);
93 req.request.userdata = i++;
94 req.callback(mresultHandleMods);