8 function cnBrowseGo(cn) {
10 var req = new Request( FETCH_CNBROWSE_TARGET,
11 'org_unit', getLocation(),
14 'page_size', MAX_CN );
15 req.callback( cnBrowseDraw );
19 function cnBrowseNext() {
20 var req = new Request( FETCH_CNBROWSE_NEXT,
21 'org_unit', getLocation(),
23 'label', cnBrowseBottomCn,
24 'boundry_id', cnBrowseBottomId,
25 'page_size', MAX_CN );
26 req.callback( cnBrowseDraw );
30 function cnBrowsePrev() {
31 var req = new Request( FETCH_CNBROWSE_PREV,
32 'org_unit', getLocation(),
34 'label', cnBrowseTopCn,
35 'boundry_id', cnBrowseTopId,
36 'page_size', MAX_CN );
37 req.callback( cnBrowseDraw );
46 function cnBrowseDraw( r ) {
47 var list = r.getResultObject();
50 cnTbody = $('cn_tbody');
51 cnRowT = $('cn_browse_row');
52 cnTdT = cnRowT.removeChild($('cn_browse_td'));
53 cnTbody.removeChild(cnRowT);
55 removeChildren(cnTbody);
58 var currentRow = cnRowT.cloneNode(true);
59 cnTbody.appendChild(currentRow);
61 for( var idx in list ) {
64 var currentTd = cnTdT.cloneNode(true);
65 currentRow.appendChild(currentTd);
67 var td = cnTdT.cloneNode(true);
68 var label = list[idx][0];
69 var lib = list[idx][1];
70 var record = list[idx][2];
71 var id = list[idx][3];
74 if( label != cnBrowseCurrent ) {
75 removeCSSClass( td, 'cn_browse_home_cn' );
79 if( idx == 0 ) { cnBrowseTopCn = label; cnBrowseTopId = id; }
80 cnBrowseBottomCn = label;
81 cnBrowseBottomId = id;
83 var cn_td = $n(currentTd, 'cn_browse_cn');
84 var lib_td = $n(currentTd, 'cn_browse_lib');
85 var title_td = $n(currentTd, 'cn_browse_title');
86 var author_td = $n(currentTd, 'cn_browse_author');
87 var pic_td = $n(currentTd, 'cn_browse_pic');
89 cn_td.appendChild(text(label));
90 lib_td.appendChild(text(findOrgUnit(lib).name()));
92 var req = new Request( FETCH_RMODS, record );
93 req.request.title_td = title_td;
94 req.request.author_td = author_td;
95 req.request.pic_td = pic_td;
96 req.callback( cnBrowseDrawTitle );
100 if( counter++ % 3 == 0 ) {
102 currentRow = cnRowT.cloneNode(true);
103 cnTbody.appendChild(currentRow);
108 function cnBrowseDrawTitle(r) {
109 var mods = r.getResultObject();
110 buildTitleDetailLink(mods, r.title_td);
111 buildSearchLink(STYPE_AUTHOR, mods.author(), r.author_td);
112 r.pic_td.setAttribute("src", buildISBNSrc(cleanISBN(mods.isbn())));
116 args[PARAM_OFFSET] = 0;
117 args[PARAM_RID] = mods.doc_id();
118 args[PARAM_MRID] = 0;
119 r.pic_td.parentNode.setAttribute("href", buildOPACLink(args));