6 if( findCurrentPage() == CNBROWSE ) {
7 attachEvt("common", "run", cnBrowseLoadSearch);
8 attachEvt( "common", "locationUpdated", cnBrowseResubmit );
9 attachEvt( "common", "depthChanged", cnBrowseResubmit );
13 function cnBrowseLoadSearch() {
14 unHideMe($('cn_browse'));
15 cnBrowseGo(getCallnumber(), getLocation(), getDepth());
19 function cnBrowseResubmit() {
21 args[PARAM_CN] = cnBrowseCN;
22 args[PARAM_DEPTH] = depthSelGetDepth();
23 args[PARAM_LOCATION] = getNewSearchLocation();
24 goTo(buildOPACLink(args));
29 function cnBrowseGo(cn, org, depth) {
30 if(depth == null) depth = getDepth();
32 org = findOrgUnit(org);
35 var t = findOrgType(org.ou_type());
36 if( t.depth() > depth )
37 org = findOrgUnit(org.parent_ou());
44 _cnBrowseGo( cn, org );
45 appendClear($('cn_browse_where'), text(org.name()));
49 function _cnBrowseGo( cn, org ) {
50 var req = new Request( FETCH_CNBROWSE, cn, org.id(), cnCount, cnOffset );
51 req.callback( cnBrowseDraw );
55 function cnBrowseNext() {
57 _cnBrowseGo( cnBrowseCN, cnBrowseOrg );
60 function cnBrowsePrev() {
62 _cnBrowseGo( cnBrowseCN, cnBrowseOrg );
66 function cnBrowseDraw( r ) {
67 var list = r.getResultObject();
75 function _cnBrowseDraw( list ) {
78 cnTbody = $('cn_tbody');
79 cnRowT = $('cn_browse_row');
80 cnTdT = cnRowT.removeChild($('cn_browse_td'));
81 cnTbody.removeChild(cnRowT);
83 removeChildren(cnTbody);
86 var currentRow = cnRowT.cloneNode(true);
87 cnTbody.appendChild(currentRow);
89 for( var idx in list ) {
92 var currentTd = cnTdT.cloneNode(true);
93 currentRow.appendChild(currentTd);
95 var td = cnTdT.cloneNode(true);
101 var cn_td = $n(currentTd, 'cn_browse_cn');
102 var lib_td = $n(currentTd, 'cn_browse_lib');
103 var title_td = $n(currentTd, 'cn_browse_title');
104 var author_td = $n(currentTd, 'cn_browse_author');
105 var pic_td = $n(currentTd, 'cn_browse_pic');
107 cn_td.appendChild(text(cn.label()));
108 lib_td.appendChild(text(findOrgUnit(cn.owning_lib()).name()));
109 cnBrowseDrawTitle(mods, title_td, author_td, pic_td);
111 if( counter++ % 3 == 0 ) {
113 currentRow = cnRowT.cloneNode(true);
114 cnTbody.appendChild(currentRow);
120 function cnBrowseDrawTitle(mods, title_td, author_td, pic_td) {
122 buildTitleDetailLink(mods, title_td);
123 buildSearchLink(STYPE_AUTHOR, mods.author(), author_td);
124 pic_td.setAttribute("src", buildISBNSrc(cleanISBN(mods.isbn())));
128 args[PARAM_OFFSET] = 0;
129 args[PARAM_RID] = mods.doc_id();
130 args[PARAM_MRID] = 0;
131 pic_td.parentNode.setAttribute("href", buildOPACLink(args));