]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/javascript/opac/AbstractRecordResultPage.js
our little opac is growing up
[Evergreen.git] / Open-ILS / src / javascript / opac / AbstractRecordResultPage.js
1
2 AbstractRecordResultPage.prototype                                      = new Page();
3 AbstractRecordResultPage.prototype.constructor  = AbstractRecordResultPage;
4 AbstractRecordResultPage.baseClass                                      = Page.constructor;
5
6
7 /* constructor for our singleton object */
8 function AbstractRecordResultPage() {}
9
10
11 /* initialize all of the UI components and set up data structures */
12 AbstractRecordResultPage.prototype.init = function() {
13
14         debug( "Initing an AbstractRecordResultPage" );
15
16         /* included page chunks */
17         this.searchBar                  = new SearchBarChunk();
18
19         /* UI objects */
20         this.recordBox                  = getById("record_result_box");
21
22         this.authorBox = new Box();
23         this.authorBox.init("Relevant Authors", true, true, 15);
24         this.authorBox.sortByKey();
25
26         this.subjectBox = new Box();
27         this.subjectBox.init("Relevant Subjects", true, true, 15);
28         this.subjectBox.sortByCount();
29
30         this.seriesBox = new Box();
31         this.seriesBox.init("Relevant Series", true, true, 15);
32         this.seriesBox.sortByKey();
33
34         this.sidebarBox         = getById("record_sidebar_box");
35
36         this.sidebarBox.appendChild(this.buildNavBox());
37         this.sidebarBox.appendChild(elem("br"));
38
39         if(!this.hitsPerPage)
40                 this.hitsPerPage                = 10;    /* how many hits are displayed per page */
41
42         this.resetPage();
43
44         this.statusBar                  = getById("top_status_bar_table");
45         this.theadDrawn         = false;
46         this.bigOlBox                   = getById("big_ol_box");
47
48 }
49
50
51
52 /** Resets data structures for a new search */
53 AbstractRecordResultPage.prototype.resetPage = function() {
54         this.searchBar.reset();
55         var spot = getById("progress_bar_location");
56         var spot2 = getById("progress_bar_percent_location");
57         if(spot) {
58                 while(spot.lastChild) 
59                         spot.removeChild(spot.lastChild);
60
61                 /* progress items for each record and it's hit count listing */
62                 this.progressBar = new ProgressBar(parseInt(this.hitsPerPage) * 2);
63                 spot.appendChild(this.progressBar.getNode());
64         }
65         if(spot2 && this.progressBar)
66                 spot2.appendChild(this.progressBar.percentDiv);
67         this.received = 0;
68
69         RemoteRequest.cancelAll();
70
71         this.requestBatch = new RequestBatch();
72         this.finalized = false;
73         this.builtLinks = false;
74
75         this.hitsPerPageSelector = getById('hits_per_page');
76
77         var obj = this;
78         this.hitsPerPageSelector.onchange = function() {
79
80                 var hits;
81                 var hits_obj = obj.hitsPerPageSelector.options[
82                         obj.hitsPerPageSelector.selectedIndex]; 
83
84                 if(hits_obj == null)
85                         return;
86
87                 hits = hits_obj.value
88
89                 debug("Hits per page set to " + hits );
90
91                 obj.hitsPerPage = parseInt(hits);       
92
93
94                 var location = globalSelectedLocation;
95                 if(location == null) location = globalLocation.id();
96
97                 url_redirect(obj.URLRefresh());
98                 obj = null;
99         }
100
101
102         for( var i in this.hitsPerPageSelector.options ) {
103
104                 var hits_obj = obj.hitsPerPageSelector.options[i];
105                 if(hits_obj == null) continue;
106                 var hits = hits_obj.value;
107
108                 if( this.hitsPerPage == parseInt(hits) ) 
109                         this.hitsPerPageSelector.options[i].selected = true;
110         }
111
112 }
113
114
115 AbstractRecordResultPage.prototype.resetSearch = function() {
116         this.recordIDs                          = new Array();
117         this.ranks                                      = new Array();
118         this.hitCount                           = 0;                                    /* hits for the current search */
119         this.searchOffset                       = 0;                                    /* the offset for the search display */
120         this.page                                       = 0;
121
122 }
123
124 AbstractRecordResultPage.prototype.gatherIDs = function(result) {
125         if(result == null) return;
126
127         this.hitCount = parseInt(result.count);
128
129         if(result.ids.length < 1) {
130                 this.finalizePage();
131                 return false;
132         }
133         
134
135         /* the 'ids' field consist of [record, rank] */
136         /* gather all of the ID's */
137         if( result.ids  && typeof result.ids == 'object' 
138                         && result.ids[0] != null
139                         && result.ids[0].constructor == Array ) {
140
141                 for( var i in result.ids ) {
142                         if(result.ids[i]==null || result.ids[i][0] == null) break;
143                         var offset = parseInt(i) + parseInt(this.searchOffset);
144                         this.recordIDs[offset] = result.ids[i][0];
145                         var rank = parseFloat(result.ids[i][1]);
146                         if(rank == 0)
147                                 rank = 0.00000001; /* protect divide by 0 */
148                         this.ranks[offset] =  rank;
149                         /*
150                         debug("adding ranks[" + offset + "] = " + result.ids[i][1] + 
151                                         "  \nrecordIDs["+offset+"], result.ids["+i+"][0]");
152                                         */
153                 }
154
155         } else {
156
157                 for( var i in result.ids ) {
158                         if(result.ids[i]==null) break;
159                         var offset = parseInt(i) + parseInt(this.searchOffset);
160                         this.recordIDs[offset] = result.ids[i];
161                         debug("adding recordIDs["+offset+"], result.ids["+i+"]");
162                 }
163         }
164
165         return true;
166 }
167
168
169
170 AbstractRecordResultPage.prototype.complete = function() {
171
172 }
173
174
175 AbstractRecordResultPage.prototype.displayRecord = 
176         function( record, search_id, page_id ) {
177
178         if(record == null) return;
179         debug("Displaying record " + record.doc_id());
180
181         if(!instanceOf(record, Fieldmapper)) {
182                 debug(" * Received bogus record " + js2JSON(record));
183                 return;
184         }
185
186         if(page_id == 0)
187                 this.buildNextLinks();
188
189         this.received += 1;
190
191         this.progressBar.manualNext();
192
193         var id = parseInt(page_id);
194         var title_row = table_row_find_or_create(this.recordBox, id * 3 + 1 );
195         var author_row = table_row_find_or_create(this.recordBox, id * 3 + 2 );
196         var misc_row = table_row_find_or_create(this.recordBox, id * 3 + 3 );
197
198         add_css_class(misc_row, "record_misc_row");
199         add_css_class(title_row, "record_title_row");
200
201
202         var c = misc_row.insertCell(0);
203
204         /* shove in a div for each of the types of resource */
205         for( var i = 0; i!= 9; i++) {
206                 var div = createAppElement("div");
207                 div.innerHTML = "&nbsp;";
208                 add_css_class(div, "record_resource_div");
209                 c.appendChild(div);
210         }
211         //var options_cell = misc_row.insertCell(1);
212
213         c.className = "record_misc_cell";
214         var resources = record.types_of_resource();
215
216         for( var i in resources ) 
217                 this.buildResourcePic( c, resources[i]);
218
219         author_row.id = "record_result_author_row_" + id;
220         title_row.id = "record_result_title_row_" + id;
221
222         /* build the appropriate context node for this result */
223         var menu_name = "record_result_row_" + page_id;
224         var menu = globalMenuManager.buildMenu(menu_name);
225
226         this.addMenuItems( menu, record );
227
228         globalMenuManager.setContext(title_row, menu);
229         globalMenuManager.setContext(author_row, menu);
230         globalMenuManager.setContext(misc_row, menu);
231
232         getDocument().body.appendChild(menu.getNode());
233
234         //var optionsLink = this.buildExtendedLinks(record, page_id);
235         //if(optionsLink)
236         //      options_cell.appendChild(optionsLink);
237         /* ------------------------------------ */
238
239
240         var pic_cell = title_row.insertCell(0);
241         this.buildRecordImage( pic_cell, record, page_id, record.title());
242
243         var title_cell = title_row.insertCell(title_row.cells.length);
244         title_cell.id = "record_result_title_box_" + id;
245         add_css_class( title_cell, "record_result_title_box");
246
247         var author_cell = author_row.insertCell(author_row.cells.length);
248         author_cell.id = "record_result_author_box_" + id;
249         add_css_class(author_cell, "record_result_author_box");
250
251
252         /* limit the length of the title and author lines */
253         var tlength = 80;
254
255         var title = "";
256         if( record.title() ) {
257                 if(record.title().length > tlength) {
258                         record.title(record.title().substr(0,tlength));
259                         record.title(record.title() + "...");
260                 }
261                 title = normalize(record.title());
262         }
263
264
265         var author = "";
266         if( record.author() ) {
267                 if(record.author().length > tlength) {
268                         record.author( record.author().substr(0,tlength));
269                         record.author(record.author() + "...");
270                 }
271                 author = normalize(record.author());
272         }
273
274         title_cell.appendChild(this.mkLink(record.doc_id(), "title", title, record.title() ));
275         author_cell.innerHTML = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
276         author_cell.appendChild(this.mkLink(record.doc_id(), "author", author ));
277
278         var marcd = null;
279         if(instanceOf(this, RecordResultPage)) {
280                 var span = createAppElement("span");
281                 span.style.marginLeft = "10px";
282
283                 if(record.pubdate() || record.edition())
284                         span.appendChild(createAppTextNode(" -- "));
285
286                 if(record.pubdate())
287                         span.appendChild(createAppTextNode(" " + record.pubdate()));
288
289                 if(record.edition())
290                         span.appendChild(createAppTextNode(" " + record.edition()));
291
292                 author_cell.appendChild(span);
293
294                 var marcb = elem( "a",
295                         {       href:"javascript:void(0)", 
296                                 style: "text-decoration:underline;"
297                         }, null, "View MARC" );
298
299                 debug("Setting up view marc callback with record " + record.doc_id());
300                 var func = buildViewMARCWindow(record);
301                 marcb.onclick = func;
302
303                 marcd = elem( "div", { style: "float:right;font-size:x-small;" } );
304                 marcd.appendChild(marcb);
305
306         }
307
308         var holddiv = null;
309         if(instanceOf(this, RecordResultPage)) {
310
311                 var holds = elem( "a", 
312                 { 
313                         href:"javascript:void(0)", 
314                         style: "text-decoration:underline" 
315                 }, {}, "Place Hold" );
316         
317         
318                 var type = "M";
319                 if(instanceOf(this, RecordResultPage))
320                         type = "T";
321         
322                 var win;
323                 var user = UserSession.instance();
324                 if(user.verifySession()) {
325                         win = new HoldsWindow(record.doc_id(), 
326                                 type, user.userObject, user.userObject, user.session_id);
327                 } else {
328                         win = new HoldsWindow(record.doc_id(), 
329                                 type, null, null, null);
330                 }
331         
332                 
333                 holds.onclick = function() { win.toggle(holds); }
334                 holddiv = elem("div");
335         
336                 //if(instanceOf(this,RecordResultPage))
337                 holddiv.setAttribute("style", "float:right");
338         
339                 holddiv.appendChild(holds);
340                 //var space = elem("span", {style:"padding:5px"},null, " ");
341                 //c.appendChild(space)
342                 //c.appendChild(mktext(" "))
343                 //c.appendChild(holddiv)
344         }
345         
346         var tab = elem("table",{style:"float:right"});
347         var tr = tab.insertRow(0);
348         var tc = tr.insertCell(0);
349         var tc2 = tr.insertCell(1);
350         var tc3 = tr.insertCell(2);
351         tc.setAttribute("nowrap", "nowrap");
352         tc3.setAttribute("nowrap", "nowrap");
353
354         if(holddiv) tc.appendChild(holddiv);
355         tc2.appendChild(mktext(" "));
356         if(marcd) tc3.appendChild(marcd);
357
358         c.appendChild(tab);
359
360
361
362         var classname = "result_even";
363         if((page_id % 2) != 0) 
364                 classname = "result_odd";
365
366         add_css_class(title_row, classname);
367         add_css_class(author_row, classname);
368         add_css_class(misc_row, classname);
369
370         /* now grab the record authors and subjects */
371         if( author ) {
372                 this.authorBox.addItem( this.mkAuthorLink(author) , author);
373         }
374
375         /* gather the subjects.  subjects are either a string or an array of
376                 [subject, broader topic].  currently, they're all just treated like
377                 subjects */
378         var arr = record.subject();
379         var x = 0;
380         for( var sub in arr ) {
381                 if(x++ > 5) break; /* too many subjects makes things real sluggish */
382
383                 var ss = arr[sub];
384
385                 /* only taking first part of subject (non-topic, etc.) */
386                 if( ss.constructor == Array)
387                         ss = ss[0];
388
389                 if( ss.constructor != Array )
390                         ss = [ss];
391
392                 for( var i in ss ) {
393                         var s = normalize(ss[i]);
394                         this.subjectBox.addItem( this.mkSubjectLink(s), s );
395                 }
396         }
397
398         var series = record.series();
399         for( var s in  series ) {
400                 debug("Found series entry: " + series[s] );
401                 var ss = normalize(series[s]);
402                 this.seriesBox.addItem( this.mkSeriesLink(ss), ss );
403         }
404
405         /* requestBatch will only have one request in it when the current
406                 record is the last record requested */
407         if( this.requestBatch.pending() < 2  )
408                 this.finalizePage();
409
410         debug("Finished displaying record " + record.doc_id());
411 }
412
413 AbstractRecordResultPage.prototype.mkAuthorLink = function(auth) {
414         var href = createAppElement("a");
415         add_css_class(href,"record_result_sidebar_link");
416
417         href.setAttribute("href",
418                 "?target=mr_result&mr_search_type=author&page=0&mr_search_query=" +
419                 encodeURIComponent(auth) +
420                 "&mr_search_depth=" + this.searchDepth +
421                 "&mr_search_location=" + this.searchLocation +
422                 "&location=" +  this.searchLocation +
423                 "&depth=" +  this.searchDepth);
424
425         href.appendChild(createAppTextNode(auth));
426         href.title = "Author search for " + auth;
427         return href;
428 }
429
430 AbstractRecordResultPage.prototype.mkSeriesLink = function(series) {
431         var href = createAppElement("a");
432         add_css_class(href,"record_result_sidebar_link");
433
434         debug("Series: " + series + " : " + encodeURIComponent(series));
435
436         href.setAttribute("href",
437                 "?target=mr_result&mr_search_type=series&page=0&mr_search_query=" +
438                 encodeURIComponent(series) +
439                 "&mr_search_depth=" + this.searchDepth +
440                 "&mr_search_location=" + this.searchLocation +
441                 "&location=" +  this.searchLocation +
442                 "&depth=" +  this.searchDepth);
443
444         href.appendChild(createAppTextNode(series));
445         href.title = "Series search for " + series;
446         return href;
447 }
448
449 AbstractRecordResultPage.prototype.mkSubjectLink = function(sub) {
450         var href = createAppElement("a");
451         add_css_class(href,"record_result_sidebar_link");
452         href.setAttribute("href",
453                 "?target=mr_result&mr_search_type=subject&page=0&mr_search_query=" +
454                 encodeURIComponent(sub) + 
455                 "&mr_search_depth=" + this.searchDepth +
456                 "&mr_search_location=" + this.searchLocation +
457                 "&location=" +  this.searchLocation +
458                 "&depth=" +  this.searchDepth);
459
460         href.appendChild(createAppTextNode(sub));
461         href.title = "Subject search for " + sub;
462         return href;
463 }
464
465 AbstractRecordResultPage.prototype.finalizePage = function() {
466
467         if( this.finalized )
468                 return;
469         this.finalized = true;
470
471
472         this.subjectBox.finalize();
473         this.authorBox.finalize();
474         this.seriesBox.finalize();
475
476         this.sidebarBox.appendChild(this.subjectBox.getNode());
477         this.sidebarBox.appendChild(createAppElement("br"));
478
479         this.sidebarBox.appendChild(this.authorBox.getNode());
480         this.sidebarBox.appendChild(createAppElement("br"));
481
482         this.sidebarBox.appendChild(this.seriesBox.getNode());
483         this.sidebarBox.appendChild(createAppElement("br"));
484
485 //      showMe(this.buttonsBox);
486
487         var ses = UserSession.instance().getSessionId();
488         var box = this.sidebarBox;
489
490         if(ses) {
491                 Survey.retrieveOpacRandom(ses, 
492                         function(sur) { 
493                                 sur.setSubmitCallback(
494                                         function() { alert("Thanks!"); return true; });
495                                 box.appendChild( sur.getNode() ); 
496                                 sur.setHidden(false);
497                         }
498                 );
499         } else {
500                 Survey.retrieveOpacRandomGlobal( 
501                         function(sur) { 
502                                 sur.setSubmitCallback(
503                                         function() { alert("Thanks!"); return true; });
504                                 box.appendChild( sur.getNode() ); 
505                                 sur.setHidden(false);
506                         }
507                 );
508         }
509
510
511         if(this.hitCount < 1) {
512                 if(this.progressBar) this.progressBar.stop();
513         }
514
515         /* in case we're hidden */
516         showMe(this.bigOlBox);
517         showMe(getById("hit_count_cell_2"));
518
519 }
520
521
522 AbstractRecordResultPage.prototype.displayCopyCounts = 
523         function(copy_counts, search_id, page_id) {
524                 
525         this.progressBar.manualNext();
526         var titlerow  = getById("record_result_title_row_" + page_id );
527         var authorrow  = getById("record_result_author_row_" + page_id );
528
529         var tcell = getById("record_result_title_box_" + page_id );
530
531         if(!this.theadDrawn) {
532                 var trow = getById("record_result_thead_row");
533                 for( var i in copy_counts) {
534                         var cell = trow.insertCell(trow.cells.length);
535                         add_css_class(cell,"record_result_thead_header");
536                         cell.innerHTML = 
537                                 findOrgType(findOrgUnit(
538                                         copy_counts[i].org_unit).ou_type()).opac_label();
539                 }
540                 this.theadDrawn = true;
541         }
542
543         for( var i in copy_counts) {
544                 var cell = createAppElement("td");
545                 add_css_class(cell, "copy_count_cell");
546                 cell.innerHTML = copy_counts[i].available + " / " + copy_counts[i].count;
547                 cell.setAttribute("rowspan","3");
548                 cell.rowSpan = 3;
549                 cell.title = " Availabie Copies / Total Copies";
550                 titlerow.appendChild(cell);
551         }
552
553         if(page_id  == (parseInt(this.hitsPerPage) - 1) ) {
554                 if(this.progressBar) this.progressBar.stop();
555                 if(this.hitCount < 1)
556                         this.noHits();
557         }
558
559         if( (page_id  == ((parseInt(this.hitCount) - 1 ) - parseInt(this.searchOffset))) ||
560                         (page_id == (parseInt(this.hitsPerPage) - 1) )) 
561                 if(this.progressBar) this.progressBar.stop();
562 }
563
564
565
566 AbstractRecordResultPage.prototype.noHits = function() {
567         var hcell = getById("hit_count_cell");
568         //hcell.appendChild(createAppElement("br"));
569         hcell.appendChild(createAppTextNode("0 hits were returned for you search"));
570 }
571
572
573 AbstractRecordResultPage.prototype.buildNextLinks = function() {
574
575         if(this.builtLinks)
576                 return;
577         this.builtLinks = true;
578
579         var obj = this;
580         var next;
581         var prev;
582
583         debug("Building links");
584         if( this.searchOffset < (parseInt(this.hitCount) - this.hitsPerPage)) {
585                 next = createAppElement("a");
586                 add_css_class(next,"record_next_button");
587                 add_css_class(next,"record_next_button_active");
588                 next.href = "javascript:globalPage.next();";
589         } else {
590                 next = createAppElement("span");
591                 add_css_class(next,"record_next_button_inactive");
592         }
593
594         if(this.searchOffset > 0) {
595                 prev = createAppElement("a");
596                 add_css_class(prev,"record_next_button");
597                 add_css_class(prev,"record_next_button_active");
598                 prev.href = "javascript:globalPage.prev();";
599         } else {
600                 prev = createAppElement("span");
601                 add_css_class(prev,"record_next_button_inactive");
602         }
603
604         next.appendChild(createAppTextNode("Next"));
605         prev.appendChild(createAppTextNode("Previous"));
606
607
608         var i = this.searchOffset;
609         var max = parseInt(i) + this.hitsPerPage;
610         if( max > this.hitCount )
611                 max = this.hitCount;
612
613         var hcell = getById("hit_count_cell");
614         var hcell2 = getById("hit_count_cell_2");
615         hideMe(hcell2);
616
617         if(hcell) {
618
619                 var ident = "Titles";
620                 if(instanceOf(this, MRResultPage))
621                         ident = "Title Groups";
622         
623                 hcell.appendChild(
624                         createAppTextNode( "Displaying " + ident + " " +
625                         ( parseInt(i) + 1 ) + " to " + max + " of " + this.hitCount));
626         
627                 hcell.appendChild(createAppTextNode(" "));
628                 hcell.appendChild(createAppTextNode(" "));
629                 hcell.appendChild(createAppTextNode(" "));
630         
631                 hcell.appendChild(prev);
632                 var span = createAppElement("span");
633                 span.appendChild(createAppTextNode(" ... "));
634                 hcell.appendChild(span);
635                 hcell.appendChild(next);
636         
637                 hcell2.innerHTML = hcell.innerHTML;
638         
639         }
640         
641 }
642
643
644 AbstractRecordResultPage.prototype.buildResourcePic = function(c, resource) {
645         return buildResourcePic(c, resource);
646 }
647
648 function buildResourcePic(c, resource) {
649
650         var pic = createAppElement("img");
651
652
653         if(resource.indexOf("sound recording") != -1) 
654                 resource = "sound recording";
655         pic.setAttribute("src", "/images/" + resource + ".jpg");
656         pic.className = "record_resource_pic";
657         pic.setAttribute("width", "20");
658         pic.setAttribute("height", "20");
659         pic.setAttribute("title", resource);
660
661
662         var index;
663
664         switch(resource) {
665
666                 case "text":
667                         index = 0;
668                         break;
669
670                 case "moving image":
671                         index = 1;
672                         break;
673
674                 case "sound recording":
675                         index = 2;
676                         break;
677
678                 case "software, multimedia":
679                         index = 3;
680                         break;
681
682                 case "still images":
683                         index = 4;
684                         break;
685
686                 case "cartographic":
687                         index = 5;
688                         break;
689
690                 case "mixed material":
691                         index = 6;
692                         break;
693
694                 case "notated music":
695                         index = 7;
696                         break;
697
698                 case "three dimensional object":
699                         index = 8;
700                         break;
701
702                 default:
703                         index = 0;
704         }
705
706         c.childNodes[index].innerHTML = "";
707         c.childNodes[index].appendChild(pic);
708 }
709
710 AbstractRecordResultPage.prototype.buildRecordImage = function(pic_cell, record, page_id, title) {
711
712         debug("Building record image for " + page_id);
713
714         /*
715         var isbn = record.isbn();
716         if(isbn) {
717                 isbn = isbn.replace(/^\s+/,"");
718                 var idx = isbn.indexOf(" ");
719                 if(idx > -1) {
720                         isbn = isbn.substring(0, idx);
721                 }
722
723         } else isbn = "";
724         */
725
726         pic_cell.setAttribute("rowspan","3");
727         pic_cell.rowSpan = 3;
728
729         pic_cell.noWrap = 'nowrap';
730         pic_cell.setAttribute("nowrap", "nowrap");
731
732         pic_cell.width = "60";
733         pic_cell.className = "record_image_cell";
734
735
736         var rankBox;
737         if( this.ranks.length > 0 ) {
738                 var x = (parseInt(this.page) * parseInt(this.hitsPerPage)) + parseInt(page_id);
739                 var per = parseInt(this.ranks[x] / this.ranks[0] * 100.0);
740
741                 debug("Per is " + per);
742                 per = 100 - parseInt(per);
743
744                 rankBox = createAppElement("div");
745                 add_css_class(rankBox, "relevance_box");
746
747                 var d = createAppElement("div");
748                 d.setAttribute("height", per + "%");
749                 d.style.height = per + "%";
750
751                 add_css_class(d, "relevance");
752                 rankBox.appendChild(d);
753
754                 rankBox.setAttribute("title", parseInt((100 - parseInt(per))) + "% Relevant");
755         }
756
757         /* use amazon for now */
758         //var img_src = "http://images.amazon.com/images/P/" +isbn + ".01.MZZZZZZZ.jpg";
759         //var img_src = "http://www.thecontentserver.com/bin/cntsvr.dll?GetImage&SysID=Content&CustID=Cafe&Return=1&Type=S&Key=" + isbn ;
760
761         var img_src = buildISBNSrc(cleanISBN(record.isbn()));
762         var big_div = createAppElement("div");
763         add_css_class(big_div, "record_image_big hide_me");
764
765         var big_pic = createAppElement("img");
766         var pic = createAppElement("img");
767         
768         big_pic.setAttribute("src", img_src);
769         big_pic.setAttribute("border", "0");
770         pic.setAttribute("src", img_src);
771         add_css_class(big_pic, "record_image");
772         add_css_class(pic, "record_image");
773
774         pic.setAttribute("width", "45");
775         pic.setAttribute("height", "50");
776         pic.style.width = "45";
777         pic.style.height = "50";
778
779         if(IE) 
780                 big_div.style.left = 0;
781
782
783         var anch = this.mkLink(record.doc_id(), "img", title );
784         anch.appendChild(big_pic);
785         big_div.appendChild(anch);
786         pic_cell.appendChild(big_div);
787
788         pic_cell.appendChild(pic);
789
790         if(rankBox)
791                 pic_cell.appendChild(rankBox);
792
793         pic.onmouseover = function() {showMe(big_div);}
794         big_div.onmouseout = function(){hideMe(big_div);}
795
796 }
797