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);
36 var t = findOrgType(org.ou_type());
37 if( t.depth() > depth )
38 org = findOrgUnit(org.parent_ou());
45 _cnBrowseGo( cn, org );
46 appendClear($('cn_browse_where'), text(org.name()));
50 function _cnBrowseGo( cn, org ) {
51 var req = new Request( FETCH_CNBROWSE, cn, org.id(), cnCount, cnOffset );
52 req.callback( cnBrowseDraw );
56 function cnBrowseNext() {
58 _cnBrowseGo( cnBrowseCN, cnBrowseOrg );
61 function cnBrowsePrev() {
63 _cnBrowseGo( cnBrowseCN, cnBrowseOrg );
67 function cnBrowseDraw( r ) {
68 var list = r.getResultObject();
76 function _cnBrowseDraw( list ) {
79 cnTbody = $('cn_tbody');
80 cnRowT = $('cn_browse_row');
81 cnTdT = cnRowT.removeChild($('cn_browse_td'));
82 cnTbody.removeChild(cnRowT);
84 removeChildren(cnTbody);
87 var currentRow = cnRowT.cloneNode(true);
88 cnTbody.appendChild(currentRow);
90 for( var idx in list ) {
93 var currentTd = cnTdT.cloneNode(true);
94 currentRow.appendChild(currentTd);
96 var td = cnTdT.cloneNode(true);
102 var cn_td = $n(currentTd, 'cn_browse_cn');
103 var lib_td = $n(currentTd, 'cn_browse_lib');
104 var title_td = $n(currentTd, 'cn_browse_title');
105 var author_td = $n(currentTd, 'cn_browse_author');
106 var pic_td = $n(currentTd, 'cn_browse_pic');
108 cn_td.appendChild(text(cn.label()));
109 lib_td.appendChild(text(findOrgUnit(cn.owning_lib()).name()));
110 cnBrowseDrawTitle(mods, title_td, author_td, pic_td);
112 if( counter++ % 3 == 0 ) {
114 currentRow = cnRowT.cloneNode(true);
115 cnTbody.appendChild(currentRow);
121 function cnBrowseDrawTitle(mods, title_td, author_td, pic_td) {
123 buildTitleDetailLink(mods, title_td);
124 buildSearchLink(STYPE_AUTHOR, mods.author(), author_td);
125 pic_td.setAttribute("src", buildISBNSrc(cleanISBN(mods.isbn())));
129 args[PARAM_OFFSET] = 0;
130 args[PARAM_RID] = mods.doc_id();
131 args[PARAM_MRID] = 0;
132 pic_td.parentNode.setAttribute("href", buildOPACLink(args));