var SitesApplication=Class.create({initialize:function(i,e,f,c,a,b,d){this.showDebugMessages=false;this.sessionID=i;this.currentCollectionBasket=a;this.isPINCollection=b;this.isIE=navigator.appVersion.indexOf("MSIE")>0;this.isIE7=navigator.appVersion.indexOf("MSIE 7.0")>0;this.isMac=navigator.appVersion.indexOf("Mac")>0||navigator.appVersion.indexOf("Apple")>0;this.isSafari=navigator.appVersion.indexOf("AppleWebKit/")>0&&this.isMac;this.isChrome=navigator.appVersion.indexOf("Chrome/")>0;this.timezoneOffset=new Date().getTimezoneOffset()*60;this.currentView=new ViewDescriptor("recordCollection",e,f,c);this.slideShowTimingInSeconds=3;this.flashPluginAvailable=CantoBrowserPluginDetector.hasFlashPlayer();this.currentTheme=d;this.initializeSlider();var h=$("quickSearchInput");if(h){this.quickSearchAutoCompleter=new CantoAutocompleter(h,"quickSearchAutoCompletePopup","quicksearchautocompletepopup.jspx;jsessionid="+this.sessionID,{paramName:"query",contentType:"application/x-www-form-urlencoded; charset=UTF-8",minChars:1,tokens:[" ","|","&"],afterUpdateElement:function(){app.doQuickSearch($F("quickSearchInput"))}})}this.browsingHistorySites=new BrowsingHistorySites();this.browsingHistoryManager=new BrowsingHistoryManager(function(j){if(!b){this.browsingHistorySites.loadBrowserHistoryState(j)}else{this.browsingHistorySites.loadBrowserHistoryStateForPINCollection(j)}}.bind(this));var g={onCreate:this.showWorker.bind(this),onComplete:this.hideWorker.bind(this)};Ajax.Responders.register(g);this.updateRecordsPerPage();Event.observe(window,"resize",this.optimizePopupWindowHeight.bindAsEventListener(this),false);window.setInterval(function(){this.doRequest("sessionalive.jspx","recordView="+this.currentView.getRecordView())}.bind(this),59000)},showWorker:function(){window.setTimeout(function(){if(Ajax.activeRequestCount>0&&!this.isPINCollection){$("workIndicator").src=this.currentTheme+"/images/working.gif"}}.bind(this),500)},hideWorker:function(){if(Ajax.activeRequestCount<=0&&!this.isPINCollection){$("workIndicator").src=this.currentTheme+"/images/transparent.gif"}},buildPage:function(a){if(this.isPINCollection&&(a=="infoview.jspx"||a=="infowindow.jspx"||a=="thumbnailview.jspx")){return"pincollection"+a}return a},showAlert:function(a){if(this.showDebugMessages){alert(a)}},applySessionID:function(a){if(this.sessionID){a+=";jsessionid="+this.sessionID}return a},doRequest:function(c,d,a,b){c=this.buildPage(c);if(this.sessionID){c+=";jsessionid="+this.sessionID}new Ajax.Request(c,{parameters:d,evalScripts:b,contentType:"application/x-www-form-urlencoded; charset=UTF-8",onComplete:function(f,g){try{if(Object.isFunction(a)){a(f,g)}}catch(h){this.showAlert("Oops, there's been an error on page "+c+" with "+d+"\n"+h)}}.bind(this),onFailure:function(){this.showAlert("Oops, there's been an error on page "+c+" with "+d)}.bind(this)})},doUpdate:function(d,f,e,b,c,a){d=this.buildPage(d);if(this.sessionID){d+=";jsessionid="+this.sessionID}new Ajax.Updater(e,d,{parameters:f,evalScripts:c,contentType:"application/x-www-form-urlencoded; charset=UTF-8",onComplete:function(g,h){if(a){a.each(function(j){Element.update(j,c?g.responseText:g.responseText.stripScripts())}.bind(this))}try{if(Object.isFunction(b)){b(g,h)}}catch(i){this.showAlert("Oops, there's been an error on page "+d+" with "+f)}}.bind(this),onFailure:function(g){this.showAlert("Oops, there's been an error on page "+d+" with "+f+" for target "+e);if(g.status==500&&!this.showDebugMessages){$("body").update(g.responseText);exitApplication("SessionIsExpired")}}.bind(this)})},setImageSize:function(a){var b="recordView="+this.currentView.getRecordView()+"&imageSizeLabel="+a;this.doRequest("changerecordviewthumbnailsize.jspx",b,function(d){var c=Number(d.responseText);this.currentView.setImageSizeCurrent(c);this.updateRecords()}.bind(this))},setImageSizeForCurrentCollectionBasket:function(a){var b="recordView=recordCollectionCollectionBasketView&imageSizeLabel="+a+"&collectionBasket="+encodeURIComponent(this.currentCollectionBasket);this.doRequest("changerecordviewthumbnailsize.jspx",b,function(){this.doUpdate("collectionbasketview.jspx",b,"popupFrameBody",undefined,true)}.bind(this))},setSorting:function(a){var b="recordView="+this.currentView.getRecordView()+"&uid="+a;this.doRequest("setsorting.jspx",b,function(){this.setSortingDirection(true)}.bind(this))},setSortingDirection:function(a,c,b){var d="recordView="+this.currentView.getRecordView();if(c){d+="&direction="+c}this.doUpdate("setsortingdirection.jspx",d,"sortDirectionIndicator",function(){if(a){this.updateRecords()}if(b){b()}}.bind(this))},setRecordsPerPage:function(a){var b="recordView="+this.currentView.getRecordView()+"&rows="+a+"&storeRowValueInLRU=storeRowValueInLRU";this.doRequest("changeviewsettings.jspx",b);this.currentView.setRecordsPerPage(a);b="recordView="+this.currentView.getRecordView()+"&collectionBasket="+encodeURIComponent(this.currentCollectionBasket)+"&rows="+a;this.doUpdate(this.currentView.getRecordViewRenderer(),b,"recordsContainer",function(){this.updateNavigationBar()}.bind(this),true)},setRecordsPerPageForCurrentCollectionBasket:function(a){var b="recordView=recordCollectionCollectionBasketView&rows="+a+"&storeRowValueInLRU=storeRowValueInLRU";this.doRequest("changeviewsettings.jspx",b);b="recordView=recordCollectionCollectionBasketView&collectionBasket="+encodeURIComponent(this.currentCollectionBasket)+"&rows="+a;this.doUpdate("collectionbasketview.jspx",b,"popupFrameBody",undefined,true)},gotoPage:function(b,a,d){var c="recordView="+b+"&collectionBasket="+encodeURIComponent(this.currentCollectionBasket)+"&page="+parseInt(0+a,10);if(b=="recordCollectionThumbnailView"||b=="recordCollectionReportView"){this.doUpdate(this.currentView.getRecordViewRenderer(),c,"recordsContainer",function(){this.updateNavigationBar();this.updateSearchTermStatistics();window.scrollTo(0,0);if(d==undefined||!d){this.browsingHistorySites.saveBrowserHistoryState({mainPageRecordView:b,mainPage:a})}}.bind(this),true)}else{if(b=="recordCollectionPreviewView"){this.doRequest("previewviewimagedescriptor.jspx",c+"&flash="+this.flashPluginAvailable,function(q){var p=q.responseXML.documentElement;var f={recordName:p.getElementsByTagName("title")[0].childNodes[0],thumbnailURL:p.getElementsByTagName("thumbnail")[0].childNodes[0].data,assetURL:p.getElementsByTagName("assetURL")[0].childNodes[0].data,assetType:p.getElementsByTagName("assetType")[0].childNodes[0].data};this.currentPreviewURL=f.assetURL;var j=$("previewImageMetadataContainer");var i=$("previewImageThumbnail");CantoUtils.update(j,f.recordName);if($("previewViewHotSpotBody")){$("previewViewHotSpotBody").update("")}hotSpotCommentsLib.hideUserComments();if(f.assetType=="image"){$("previewViewPluginContainer").update("");i.src=f.thumbnailURL;i.setStyle({display:"inline"});var m=new Image();m.onload=function(){if(f.assetURL==this.currentPreviewURL){i.src=f.assetURL;if(this.isIE7){var s=m.width;if(s<256){s=256}$("previewViewPopupHeader").setStyle({width:s+"px"});$("previewViewPopupBody").setStyle({width:s+"px"})}var e=$("previewImageLoadtext");if(e){Effect.BlindUp(e,{delay:0,duration:0.3,queue:"end"})}this.doUpdate("previewviewhotspot.jspx",c,"previewViewHotSpotBody",function(t){if(this.isIE7&&t.responseText.length>0){s+=260;var u=$("previewViewHotSpotBody");if(u.hasChildNodes()){if(s<256){s=256}}$("previewViewPopupHeader").setStyle({width:s+"px"});$("previewViewPopupBody").setStyle({width:s+"px"})}}.bind(this),true)}}.bind(this);(function(){if(i.src.indexOf(f.assetURL)==-1&&this.currentPreviewURL==f.assetURL){var e=$("previewImageLoadtext");if(e){Effect.BlindDown(e,{delay:0,duration:0.3,queue:"end"})}}}).bind(this).delay(2);m.src=f.assetURL;this.doUpdate("previewviewhotspot.jspx",c,"previewViewHotSpotBody",function(e){if(this.isIE7&&e.responseText.length>0){var t=m.width+260;var s=$("previewViewHotSpotBody");if(t<256){t=256}$("previewViewPopupHeader").setStyle({width:t+"px"});$("previewViewPopupBody").setStyle({width:t+"px"})}}.bind(this),true)}else{i.setStyle({display:"none"});$("previewRecordContainer").select(".leftOverlay")[0].update("");$("previewRecordContainer").select(".rightOverlay")[0].update("");var l=$("previewViewBodyContainer");if(l!=undefined){l.removeClassName("paddingHotSpotPreview")}var h=$("previewImageLoadtext");if(h){Effect.BlindUp(h,{delay:0,duration:0.3,queue:"end"})}var g=128;try{g=p.getElementsByTagName("previewImageBoundingBox")[0].childNodes[0].data}catch(k){}if(this.isIE7){$("previewViewPopupHeader").setStyle({width:g+"px"});$("previewViewPopupBody").setStyle({width:g+"px"})}if(f.assetType=="flv"){var n="assetURL="+f.assetURL.replace("?","%3F")+"&thumbnailURL="+f.thumbnailURL.replace("?","%3F").replace(/&/g,"%26");this.doUpdate("previewviewvideoplayer.jspx",n,"previewViewPluginContainer",undefined,true)}else{if(f.assetType=="mp3"){var r="assetURL="+f.assetURL.replace("?","%3F")+"&thumbnailURL="+f.thumbnailURL.replace("?","%3F").replace(/&/g,"%26");this.doUpdate("previewviewaudioplayer.jspx",r,"previewViewPluginContainer",undefined,true)}else{if(f.assetType=="iframe"){var o=Builder.node("iframe",{style:"width: 100%; min-width: "+g+"px; height:"+g+"px"});$("previewViewPluginContainer").update(o);o.src=f.assetURL.replace(/%26/g,"&")}}}}this.doUpdate("navigation.jspx",c,"previewNavigationBar",function(e){var s=e.responseText;var u=$("previewRecordContainer").select(".leftOverlay")[0];var t=$("previewRecordContainer").select(".rightOverlay")[0];s.indexOf("hasPreviousPage")>-1?u.addClassName("action"):u.removeClassName("action");s.indexOf("hasNextPage")>-1?t.addClassName("action"):t.removeClassName("action")}.bind(this));c+="&isSlideShowPlaying="+(this.slideShowInterval!=undefined?"true":"false");this.doUpdate("previewviewfunctions.jspx",c,"previewViewFunctions");this.doUpdate("previewviewdiscussion.jspx",c,"previewViewDiscussionBody",undefined,true);if(d==undefined||!d){this.browsingHistorySites.saveBrowserHistoryState({windowPageRecordView:b,windowPage:a,windowOpened:true})}}.bind(this))}else{if(b=="recordCollectionInfoView"){this.updateInfoView(a,undefined,undefined,d)}else{if(b=="recordCollectionCollectionBasketView"){this.doUpdate("collectionbasketview.jspx",c,"popupFrameBody",undefined,true);if(d==undefined||!d){this.browsingHistorySites.saveBrowserHistoryState({windowPageRecordView:b,windowPage:a,windowOpened:true})}}}}}},updateInfoView:function(a,b,d,e){var c="recordView=recordCollectionInfoView&collectionBasket="+encodeURIComponent(this.currentCollectionBasket);if(a!=undefined){c+="&page="+parseInt(0+a,10)}else{c+="&recordID="+b+"&singleCatalogID="+d}this.doUpdate("infoview.jspx",c,"infoViewDataContainer",function(){this.doUpdate("navigation.jspx",c,"infoNavigationBar");if(!this.isPINCollection){this.doUpdate("infoviewfunctions.jspx",c,"infoViewFunctions")}this.optimizePopupWindowHeight();if(e==undefined||!e){this.browsingHistorySites.saveBrowserHistoryState({windowPageRecordView:"recordCollectionInfoView",windowPage:a,windowOpened:true})}}.bind(this),true)},updateRecords:function(){var a="recordView="+this.currentView.getRecordView()+"&collectionBasket="+encodeURIComponent(this.currentCollectionBasket);this.doUpdate(this.currentView.getRecordViewRenderer(),a,"recordsContainer",function(){this.updateNavigationBar();this.updateSearchTermStatistics()}.bind(this),true)},resetToInitialState:function(){this.clearAllFilters(function(){this.gotoPage(this.currentView.getRecordView(),1,true);this.browsingHistorySites.saveBrowserHistoryState({resetFilters:true,resetCategory:true,mainPageRecordView:"recordCollectionThumbnailView",mainPage:1})}.bind(this))},clearAllFilters:function(a){var b="recordView="+this.currentView.getRecordView()+"&skipFindAll=true";this.doRequest("fieldfilterreset.jspx",b,function(){var c="recordView="+this.currentView.getRecordView()+"&collectionBasket="+encodeURIComponent(this.currentCollectionBasket);this.doRequest("collectionbasketrevealdeletefilter.jspx",c,function(){this.doRequest("mypincollectionsrevealdeletefilter.jspx",c,function(){this.doRequest("recordsrevealdeletefilter.jspx",c,function(){this.updateAllFieldFilters(true,function(){this.setCurrentCategory(undefined,undefined,function(){this.doQuickSearch("",function(){if(a){a()}}.bind(this),true)}.bind(this),true)}.bind(this))}.bind(this))}.bind(this))}.bind(this))}.bind(this))},findRecord:function(b,a){this.clearAllFilters(function(){var c="recordView="+this.currentView.getRecordView()+"&singleCatalogID="+b+"&recordID="+a;this.doRequest("search.jspx",c,function(){this.gotoPage("recordCollectionInfoView",1,true);this.gotoPage(this.currentView.getRecordView(),1,true);this.browsingHistorySites.saveBrowserHistoryState({catalogID:b,recordID:a,windowOpened:true})}.bind(this))}.bind(this))},revealRecords:function(b,a){this.clearAllFilters(function(){var c="recordView="+this.currentView.getRecordView()+"&singleCatalogID="+b+"&records="+a;this.doRequest("recordsreveal.jspx",c,function(){this.updateAllAdvancedSearchBarBoxes();this.gotoPage("recordCollectionInfoView",1,true);this.gotoPage(this.currentView.getRecordView(),1,true);this.browsingHistorySites.saveBrowserHistoryState({catalogID:b,records:a,windowOpened:false})}.bind(this))}.bind(this))},deleteRevealedRecordsFilter:function(){var a="recordView="+this.currentView.getRecordView()+"&collectionBasket="+encodeURIComponent(this.currentCollectionBasket);this.doRequest("recordsrevealdeletefilter.jspx",a,function(){this.updateAllAdvancedSearchBarBoxes();this.closeAllAdvancedSearchPopups();this.gotoPage(this.currentView.getRecordView(),1,true);this.browsingHistorySites.saveBrowserHistoryState({records:""})}.bind(this))},setCurrentCategory:function(d,b,a,e){var c="recordView="+this.currentView.getRecordView();if(d!=undefined&&b!=undefined){c+="&singleCatalogID="+d+"&categoryID="+b}this.doUpdate("categoryfilter.jspx",c,"categoryFilterBox",function(){this.doUpdate("breadcrumb.jspx",c,"categoryBreadcrumb",function(){if(a){a()}else{this.gotoPage(this.currentView.getRecordView(),1,true)}this.updateSortingState();if(e==undefined||!e){if(d==undefined&&b==undefined){this.browsingHistorySites.saveBrowserHistoryState({resetCategory:true,onCompleteFunctionSetCurrentCategory:a})}else{this.browsingHistorySites.saveBrowserHistoryState({catalogID:d,categoryID:b,onCompleteFunctionSetCurrentCategory:a})}}}.bind(this))}.bind(this))},setCurrentFieldFilter:function(a,b){var c="recordView="+this.currentView.getRecordView()+"&uid="+a+"&state=";var d;if($(b)){d=encodeURIComponent($F(b));c+=d}else{d=encodeURIComponent(b);c+=d}this.doUpdate("fieldfilter.jspx",c,"ff"+a,function(){this.gotoPage(this.currentView.getRecordView(),1,true);this.updateSortingState();this.updateAllAdvancedSearchBarBoxes(function(){var e=$("ffpopup"+a);var f=$("asffb"+a);this.closeAllAdvancedSearchPopups(f?"ffpopupframe"+a:undefined);if(e&&f){this.showFieldFilterPopup(a)}this.browsingHistorySites.saveBrowserHistoryState({filterFieldUID:a,filterState:d})}.bind(this))}.bind(this))},updateAllFieldFilters:function(b,a){var c="recordView="+this.currentView.getRecordView()+"&timezoneOffsetInSeconds="+this.timezoneOffset+"&skipFindAll="+b;if($("fieldFilterBox")){this.doUpdate("fieldfiltercontainer.jspx",c,"fieldFilterBox",function(){this.closeAllAdvancedSearchPopups();this.updateAllAdvancedSearchBarBoxes(function(){if(a){a()}}.bind(this))}.bind(this))}else{this.closeAllAdvancedSearchPopups();this.updateAllAdvancedSearchBarBoxes(function(){if(a){a()}}.bind(this))}},showFieldFilterPopup:function(a){this.closeAllAdvancedSearchPopups("ffpopupframe"+a);var b="recordView="+this.currentView.getRecordView()+"&skipHeader=true&uid="+a;var c=$("ffpopupframe"+a)||$(Builder.node("div",{id:"ffpopupframe"+a,className:"popupContainer",style:"display: none;"},[Builder.node("div",{className:"popupBorderTop"}),Builder.node("div",{className:"popupBorderLeft"},[Builder.node("div",{className:"popupBorderRight"},[Builder.node("div",{className:"popupContentWrapper"},[Builder.node("div",{id:"ffpopup"+a,className:"advancedSearchPopup"}),Builder.node("div",{className:"popupContentFooter"},[Builder.node("span",{className:"button",onclick:"app.closeAllAdvancedSearchPopups ();"},"close"),Builder.node("div",{className:"clearFloat"})])])])]),Builder.node("div",{className:"popupBorderBottom"})]));$("body").appendChild(c);this.doUpdate("fieldfilter.jspx",b,"ffpopup"+a,function(){var d=$("asffb"+a);var f=d.positionedOffset();var e=d.getDimensions();c.setStyle({top:(f.top+e.height-1)+"px",left:f.left+"px"});this.setElementVisible(c,true)}.bind(this))},closeAllAdvancedSearchPopups:function(a){$$(".popupContainer").each(function(b){if((!a||b.id!=a)&&!b.hasClassName("keepPopupContainer")){this.setElementVisible(b,false,undefined,function(){b.parentNode.removeChild(b)}.bind(this))}else{if(b.hasClassName("keepPopupContainer")&&(!a||b.id!=a)){if(b.visible()){this.setElementVisible(b,false)}}}}.bind(this))},updateAllAdvancedSearchBarBoxes:function(a){var b="recordView="+this.currentView.getRecordView()+"&timezoneOffsetInSeconds="+this.timezoneOffset;this.doUpdate("advancedsearchcontainer.jspx",b,"advancedSearchBoxContainer",function(){this.doUpdate("advancedsearchstatistics.jspx",b,"advancedSearchStatisticsContainer");if(a){a()}}.bind(this))},showAdvancedSearchFieldListPopup:function(){this.closeAllAdvancedSearchPopups("advancedSearchFieldListPopup");var d=$("advancedSearchFieldListPopup");var a=$("advancedSearchFieldListPopupAction");var c=a.positionedOffset();var b=a.getDimensions();d.setStyle({top:(c.top+b.height-1)+"px",left:c.left+"px"});this.setElementVisible(d,true)},addAdvancedSearchCondition:function(a){var c=$(Builder.node("div",{id:"aspopupframe"+a,className:"popupContainer"},[Builder.node("div",{className:"popupBorderTop"}),Builder.node("div",{className:"popupBorderLeft"},[Builder.node("div",{className:"popupBorderRight"},[Builder.node("div",{className:"popupContentWrapper"},[Builder.node("div",{id:"aspopup"+a,className:"advancedSearchPopup"})])])]),Builder.node("div",{className:"popupBorderBottom"})]));$("body").appendChild(c);var b="recordView="+this.currentView.getRecordView()+"&uid="+a;this.doUpdate("advancedsearchconditionadd.jspx",b,"aspopup"+a,function(){var d=$("advancedSearchFieldListPopupAction");var f=d.positionedOffset();var e=d.getDimensions();c.setStyle({top:(f.top+e.height-1)+"px",left:f.left+"px"})}.bind(this),true)},editAdvancedSearchCondition:function(a){this.closeAllAdvancedSearchPopups("aspopupframe"+a);var c=$("aspopupframe"+a)||$(Builder.node("div",{id:"aspopupframe"+a,className:"popupContainer",style:"display: none;"},[Builder.node("div",{className:"popupBorderTop"}),Builder.node("div",{className:"popupBorderLeft"},[Builder.node("div",{className:"popupBorderRight"},[Builder.node("div",{className:"popupContentWrapper"},[Builder.node("div",{id:"aspopup"+a,className:"advancedSearchPopup"})])])]),Builder.node("div",{className:"popupBorderBottom"})]));$("body").appendChild(c);var b="recordView="+this.currentView.getRecordView()+"&page="+a;this.doUpdate("advancedsearchconditionedit.jspx",b,"aspopup"+a,function(){var d=$("asqc"+a);var f=d.positionedOffset();var e=d.getDimensions();c.setStyle({top:(f.top+e.height-1)+"px",left:f.left+"px"});this.setElementVisible(c,true)}.bind(this),true)},saveAdvancedSearchCondition:function(b,c){var a=Form.serialize(c);var d="recordView="+this.currentView.getRecordView()+"&page="+b+"&"+a;a.scan(/&ev([0-9]+)=on/,function(g){var f=g[1];var e="fd"+f;var h=$(e);if(h){d+="&"+e+"="+encodeURIComponent($F(h))}});this.doRequest("advancedsearchconditioncheck.jspx",d,function(e){if(e.responseText){alert(e.responseText)}else{this.closeAllAdvancedSearchPopups();this.doRequest("advancedsearchconditionsave.jspx",d,function(){this.updateAllAdvancedSearchBarBoxes();this.gotoPage(this.currentView.getRecordView(),1);this.updateSortingState()}.bind(this))}}.bind(this))},deleteAdvancedSearchCondition:function(a){var b="recordView="+this.currentView.getRecordView()+"&page="+a;this.doRequest("advancedsearchconditiondelete.jspx",b,function(){this.updateAllAdvancedSearchBarBoxes();this.closeAllAdvancedSearchPopups();this.doQuickSearch($F("quickSearchInput"))}.bind(this))},deleteAllAdvancedSearchConditionsAndFilters:function(){var a="recordView="+this.currentView.getRecordView()+"&removeall=true";this.doRequest("advancedsearchconditiondelete.jspx",a,function(){var b="recordView="+this.currentView.getRecordView()+"&skipFindAll=true";this.doRequest("fieldfilterreset.jspx",b,function(){var c="recordView="+this.currentView.getRecordView()+"&collectionBasket="+encodeURIComponent(this.currentCollectionBasket);this.doRequest("collectionbasketrevealdeletefilter.jspx",c,function(){this.doRequest("mypincollectionsrevealdeletefilter.jspx",c,function(){this.doRequest("recordsrevealdeletefilter.jspx",c,function(){this.updateAllFieldFilters(true,function(){this.doQuickSearch($F("quickSearchInput"));this.updateAllAdvancedSearchBarBoxes();this.browsingHistorySites.saveBrowserHistoryState({resetFilters:true,records:"",collectionBasketReveal:"",collectionUID:""})}.bind(this))}.bind(this))}.bind(this))}.bind(this))}.bind(this))}.bind(this))},toggleUserFilterExistingValues:function(e,a,d){if(Element.visible(e)){Element.hide(e);if(d){$(e).parentNode.firstDescendant().src=this.currentTheme+"/images/icons/boxtree_triangle-normal.png"}}else{Element.show(e);var b=$(e).select("div");if(b.length<=0){var c="recordView="+this.currentView.getRecordView()+"&page="+a+"&timezoneOffsetInSeconds="+this.timezoneOffset;if(d){c+="&xml="+encodeURIComponent($F(d))}this.doUpdate("advancedsearchcategoriesexistingvalues.jspx",c,e,function(){if(d){$(e).parentNode.firstDescendant().src=this.currentTheme+"/images/icons/boxsubtitle_triangle-open.png"}}.bind(this),true)}else{if(d){$(e).parentNode.firstDescendant().src=this.currentTheme+"/images/icons/boxsubtitle_triangle-open.png"}}}},doQuickSearch:function(b,a,d){$("quickSearchInput").value=b;var c="recordView="+this.currentView.getRecordView()+"&query="+encodeURIComponent(b);this.doRequest("quicksearch.jspx",c,function(){if(a){a()}else{this.gotoPage(this.currentView.getRecordView(),1,true);this.updateSortingState()}if(d==undefined||!d){this.browsingHistorySites.saveBrowserHistoryState({query:encodeURIComponent(b),onCompleteFunctionDoQuickSearch:a})}}.bind(this))},clearQuickSearch:function(a){$("quickSearchInput").value="";var b="recordView="+this.currentView.getRecordView()+"&query=";this.doRequest("quicksearch.jspx",b,function(){if(a){a()}else{this.gotoPage(this.currentView.getRecordView(),1,true)}this.browsingHistorySites.saveBrowserHistoryState({query:"",onCompleteFunctionDoQuickSearch:a})}.bind(this))},updateNavigationBar:function(){var a="recordView="+this.currentView.getRecordView();this.doUpdate("navigation.jspx",a,"navigationBarTop");this.doUpdate("navigation.jspx",a,"navigationBarBottom")},updateSearchTermStatistics:function(){if($("quickSearchInput")){var a="recordView="+this.currentView.getRecordView()+"&query="+encodeURIComponent($F("quickSearchInput"));this.doUpdate("searchtermstatistics.jspx",a,"searchTermStatistics")}},updateCollectionBasketButton:function(){var a="recordView=recordCollectionCollectionBasketView&collectionBasket="+encodeURIComponent(this.currentCollectionBasket);this.doUpdate("collectionbasketbutton.jspx",a,"collectionBasketToolbarButton")},addRecordToCollectionBasket:function(b,d,a){var c="recordView="+this.currentView.getRecordView()+"&collectionBasket="+encodeURIComponent(b||this.currentCollectionBasket)+"&singleCatalogID="+d+"&recordID="+a;this.doRequest("addtocollectionbasket.jspx",c,function(){$$(".collectionBasketStateImg"+d+"_"+a).each(function(e){this.doUpdate("recordstateincollectionbasket.jspx",c,e.parentNode)}.bind(this));this.updateCollectionBasketButton()}.bind(this))},removeRecordFromCollectionBasket:function(c,e,a,b){var d="recordView="+this.currentView.getRecordView()+"&collectionBasket="+encodeURIComponent(c||this.currentCollectionBasket)+"&singleCatalogID="+e+"&recordID="+a;this.doRequest("removefromcollectionbasket.jspx",d,function(){$$(".collectionBasketStateImg"+e+"_"+a).each(function(f){this.doUpdate("recordstateincollectionbasket.jspx",d,f.parentNode)}.bind(this));this.updateCollectionBasketButton();if(b){this.updateCollectionBasketWindow()}}.bind(this))},addPageToCollectionBasket:function(){var a="recordView="+this.currentView.getRecordView()+"&collectionBasket="+encodeURIComponent(this.currentCollectionBasket)+"&bulkMode=page";this.doRequest("addtocollectionbasket.jspx",a,function(){this.updateRecords();this.updateCollectionBasketButton()}.bind(this))},addCollectionToCollectionBasket:function(){var a="recordView="+this.currentView.getRecordView()+"&collectionBasket="+encodeURIComponent(this.currentCollectionBasket)+"&bulkMode=collection";this.doRequest("addtocollectionbasket.jspx",a,function(){this.updateRecords();this.updateCollectionBasketButton()}.bind(this))},clearCollectionBasket:function(){var a="recordView=recordCollectionCollectionBasketView&collectionBasket="+encodeURIComponent(this.currentCollectionBasket)+"&page=1";this.doRequest("collectionbasketclear.jspx",a,function(){this.doUpdate("collectionbasketview.jspx",a,"popupFrameBody",undefined,true);this.updateRecords();this.updateCollectionBasketButton()}.bind(this))},revealCollectionBasket:function(){this.clearAllFilters(function(){var a="recordView="+this.currentView.getRecordView()+"&collectionBasket="+encodeURIComponent(this.currentCollectionBasket);this.doRequest("collectionbasketreveal.jspx",a,function(){this.updateAllAdvancedSearchBarBoxes();this.gotoPage(this.currentView.getRecordView(),1,true);this.browsingHistorySites.saveBrowserHistoryState({collectionBasketReveal:encodeURIComponent(this.currentCollectionBasket),windowOpened:false})}.bind(this))}.bind(this))},deleteRevealedCollectionBasketFilter:function(){var a="recordView="+this.currentView.getRecordView()+"&collectionBasket="+encodeURIComponent(this.currentCollectionBasket);this.doRequest("collectionbasketrevealdeletefilter.jspx",a,function(){this.updateAllAdvancedSearchBarBoxes();this.closeAllAdvancedSearchPopups();this.gotoPage(this.currentView.getRecordView(),1,true);this.browsingHistorySites.saveBrowserHistoryState({collectionBasketReveal:""})}.bind(this))},showCreatePinCollection:function(a){var b="recordView=recordCollectionCollectionBasketView&collectionBasket="+encodeURIComponent(this.currentCollectionBasket);if(a){b+="&"+Form.serialize(a)}this.doUpdate("createpincollectionconfiguration.jspx",b,"popupFrameBody",function(){this.showPopupWindow()}.bind(this),true)},createPinCollection:function(a){var b="recordView=recordCollectionCollectionBasketView&collectionBasket="+encodeURIComponent(this.currentCollectionBasket)+"&"+Form.serialize(a);this.doRequest("createpincollection.jspx",b,function(c){var d=c.responseText;if(d.length>0){$("createPinCollectionError").update(Builder.node("span").update(d)).show()}else{this.doUpdate("mypincollections.jspx","recordView="+this.currentView.getRecordView(),"myPinCollectionsFrameBody");this.hidePopupWindow()}}.bind(this))},revealPinCollection:function(a){this.clearAllFilters(function(){var b="recordView="+this.currentView.getRecordView()+"&collectionName="+a;this.doRequest("mypincollectionsreveal.jspx",b,function(){this.updateAllAdvancedSearchBarBoxes();this.gotoPage(this.currentView.getRecordView(),1,true);this.browsingHistorySites.saveBrowserHistoryState({collectionUID:a})}.bind(this))}.bind(this))},deleteRevealedPinCollectionFilter:function(){var a="recordView="+this.currentView.getRecordView()+"&collectionBasket="+encodeURIComponent(this.currentCollectionBasket);this.doRequest("mypincollectionsrevealdeletefilter.jspx",a,function(){this.updateAllAdvancedSearchBarBoxes();this.closeAllAdvancedSearchPopups();this.gotoPage(this.currentView.getRecordView(),1,true);this.browsingHistorySites.saveBrowserHistoryState({collectionUID:""})}.bind(this))},deletePinCollection:function(a){var b="recordView="+this.currentView.getRecordView()+"&collectionName="+a;this.doRequest("mypincollectionsdelete.jspx",b,function(){this.doUpdate("mypincollections.jspx","recordView="+this.currentView.getRecordView(),"myPinCollectionsFrameBody")}.bind(this))},showPinCollectionInformationWindow:function(a){var b="recordView=recordCollectionThumbnailView&collectionName="+a;this.doUpdate("mypincollectioninfowindow.jspx",b,"popupFrameBody",function(){this.showPopupWindow()}.bind(this))},showInfoWindow:function(a,c){var b="recordView=recordCollectionInfoView&page="+(a+1)+"&collectionBasket="+encodeURIComponent(this.currentCollectionBasket);this.doUpdate("infowindow.jspx",b,"popupFrameBody",function(){this.gotoPage("recordCollectionInfoView",a+1,c);this.showPopupWindow()}.bind(this))},showPopupWindow:function(){Zoom.stopZoomTooltip();Zoom.hideTooltips();var a=document.viewport.getScrollOffsets();var b=a[1]+(document.viewport.getHeight()/10);var c=a[0];this.setVisibleOpacityLayer(true);$("popupFrame").setStyle({top:b+"px",left:c+"px"});this.setElementVisible($("popupFrame"),true)},hidePopupWindow:function(c,b){var a=$("popupFrame");this.setVisibleOpacityLayer(false);this.setElementVisible(a,false);if(!c){this.browsingHistorySites.saveBrowserHistoryState({windowOpened:false})}if(b){b(a)}},hidePreviewWindow:function(){this.stopSlideShow();this.hidePopupWindow(true);var a=$f();if(a){a.stop()}this.browsingHistorySites.saveBrowserHistoryState({windowOpened:false})},hideInfoWindow:function(){this.hidePopupWindow(true);this.browsingHistorySites.saveBrowserHistoryState({windowOpened:false})},hideCollectionBasketWindow:function(){this.hidePopupWindow(true);this.browsingHistorySites.saveBrowserHistoryState({windowOpened:false})},showPreviewWindow:function(a,c){var b="recordView=recordCollectionPreviewView&page="+(a+1)+"&collectionBasket="+encodeURIComponent(this.currentCollectionBasket);this.doUpdate("previewview.jspx",b,"popupFrameBody",function(){this.gotoPage("recordCollectionPreviewView",a+1,c);this.showPopupWindow()}.bind(this),true)},optimizePopupWindowHeight:function(){var a;$$(".popupHeader").each(function(b){a=b.getDimensions().height+10});CantoUtils.optimizePopupWindowHeight(".scrollingPopupBody",a)},updateCollectionBasketWindow:function(){var a="recordView=recordCollectionCollectionBasketView&collectionBasket="+encodeURIComponent(this.currentCollectionBasket);this.doUpdate("collectionbasketview.jspx",a,"popupFrameBody",undefined,true)},showCollectionBasketWindow:function(b){this.closeAllAdvancedSearchPopups();var a="recordView=recordCollectionCollectionBasketView&collectionBasket="+encodeURIComponent(this.currentCollectionBasket)+"&page=1";this.doUpdate("collectionbasketview.jspx",a,"popupFrameBody",function(){this.showPopupWindow();if(b==undefined||!b){this.browsingHistorySites.saveBrowserHistoryState({windowPageRecordView:"recordCollectionCollectionBasketView",windowPage:1,windowOpened:true})}}.bind(this),true)},setCurrentCollectionBasket:function(a){if(a&&a.length>0){var b="recordView=recordCollectionCollectionBasketView&collectionBasket="+encodeURIComponent(a);this.doRequest("collectionbasketsetcurrent.jspx",b,function(){this.currentCollectionBasket=a;this.doUpdate("collectionbasketview.jspx",b,"popupFrameBody",undefined,true);this.updateRecords();this.updateCollectionBasketButton()}.bind(this))}},deleteCollectionBasket:function(a){var b="recordView=recordCollectionCollectionBasketView&collectionBasket="+encodeURIComponent(a);this.doRequest("collectionbasketdelete.jspx",b,function(){b="recordView=recordCollectionCollectionBasketView&collectionBasket="+encodeURIComponent(this.currentCollectionBasket);this.doUpdate("collectionbasketview.jspx",b,"popupFrameBody",undefined,true)}.bind(this))},renameCurrentCollectionBasket:function(a){if(a&&a.length>0){var b="recordView=recordCollectionCollectionBasketView&collectionBasket="+encodeURIComponent(this.currentCollectionBasket)+"&newCollectionBasketName="+encodeURIComponent(a);this.doRequest("collectionbasketrename.jspx",b,function(){this.setCurrentCollectionBasket(a)}.bind(this))}},setSortingForCurrentCollectionBasket:function(a){var b="recordView=recordCollectionCollectionBasketView&uid="+a;this.doRequest("setsorting.jspx",b,function(){this.setSortingDirectionForCurrentCollectionBasket(true)}.bind(this))},setSortingDirectionForCurrentCollectionBasket:function(a,b){var c="recordView=recordCollectionCollectionBasketView";if(b){c+="&direction="+b}this.doUpdate("setsortingdirection.jspx",c,"sortDirectionBasketIndicator",function(){if(a){var d="collectionBasket="+encodeURIComponent(this.currentCollectionBasket)+"&recordView=recordCollectionCollectionBasketView";this.doUpdate("collectionbasketview.jspx",d,"popupFrameBody",undefined,true)}}.bind(this))},updateNavigationBarForCollectionBasket:function(){var a="recordView=recordCollectionCollectionBasketView&collectionBasket="+encodeURIComponent(this.currentCollectionBasket);this.doUpdate("navigation.jspx",a,"collectionBasketNavigationBarTop");this.doUpdate("navigation.jspx",a,"collectionBasketNavigationBarBottom")},showDirectPrintWindow:function(c,a){var b="recordView="+this.currentView.getRecordView()+"&singleCatalogID="+c+"&recordID="+a;this.doUpdate("directprintconfiguration.jspx",b,"popupFrameBody",function(){this.showPopupWindow()}.bind(this))},showCollectionBasketPrintWindow:function(a){var b="recordView="+this.currentView.getRecordView()+"&collectionBasket="+encodeURIComponent(a);this.doUpdate("printconfiguration.jspx",b,"popupFrameBody",function(){this.showPopupWindow()}.bind(this))},showPINCollectionPrintWindow:function(){var a="recordView="+this.currentView.getRecordView();this.doUpdate("pincollectionprintconfiguration.jspx",a,"popupFrameBody",function(){this.showPopupWindow()}.bind(this))},updatePrintPreviewImage:function(f,e,d,b,c){var a=b=="{90eb9f3f-ef03-442c-807c-88c70d257174}"?c:b;$(f).src="Thumbnail.ThumbnailServlet;jsessionid="+this.sessionID+"?recordView="+this.currentView.getRecordView()+"&printSet="+encodeURIComponent(a)+"&collectionBasket="+encodeURIComponent(d)+"&imageSize="+e+"&random="+Math.random()},printCollectionBasket:function(e,c,d,b){var a=c=="{90eb9f3f-ef03-442c-807c-88c70d257174}"?d:c;var f="recordView=recordCollectionCollectionBasketView&collectionBasket="+encodeURIComponent(e)+"&template="+encodeURIComponent(a)+"&async="+b;this.doRequest("print.jspx",f);if(!b){(function(){this.updateDownloadState()}.bind(this).delay(0.5))}this.hidePopupWindow(true)},showDirectDownloadWindow:function(c,a){var b="recordView="+this.currentView.getRecordView()+"&singleCatalogID="+c+"&recordID="+a;this.doUpdate("directdownloadconfiguration.jspx",b,"popupFrameBody",function(){this.showPopupWindow()}.bind(this),true)},showDownloadWindow:function(a){var b="recordView="+this.currentView.getRecordView()+"&collectionBasket="+a;this.doUpdate("downloadconfiguration.jspx",b,"popupFrameBody",function(){this.showPopupWindow()}.bind(this),true)},showPINCollectionDownloadWindow:function(){var a="recordView="+this.currentView.getRecordView();this.doUpdate("pincollectiondownloadconfiguration.jspx",a,"popupFrameBody",function(){this.showPopupWindow()}.bind(this),true)},downloadCollectionBasket:function(e,b,d,a){var c=b=="{90eb9f3f-ef03-442c-807c-88c70d257174}"?d:b;var f="recordView=recordCollectionCollectionBasketView&collectionBasket="+encodeURIComponent(e)+"&assetAction="+encodeURIComponent(c)+"&async="+a;this.doRequest("download.jspx",f);if(!a){(function(){this.updateDownloadState()}.bind(this).delay(0.5))}this.hidePopupWindow(undefined,function(g){Effect.ScrollTo($("downloadStateContainer"),{duration:0.5,afterFinish:function(){Effect.Shake($("downloadStateContainer"),{delay:0})}})}.bind(this))},updateDownloadState:function(){if(!this.runningDownloadInterval){var a="recordView="+this.currentView.getRecordView();this.doUpdate("downloadstate.jspx",a,"downloadStateContainer",function(){this.runningDownloadInterval=setInterval(function(){this.doUpdate("downloadstate.jspx",a,"downloadStateContainer",function(b){if(b.responseText.indexOf("noDownloadsRunning")>-1){window.clearInterval(this.runningDownloadInterval);this.runningDownloadInterval=undefined}}.bind(this),true)}.bind(this),1000)}.bind(this),true)}},showImageCouch:function(e,b,c,a){var d="recordView="+this.currentView.getRecordView()+"&catalogID="+e+"&recordID="+b+"&collectionBasket="+encodeURIComponent(c)+"&async="+a;this.doUpdate("imagecouchconfiguration.jspx",d,"popupFrameBody",function(){this.showPopupWindow()}.bind(this),true)},dispatchDownload:function(c,a,b){if($("downloadForm").select("input:checked[type=radio][name=assetActionChooser]").pluck("value")=="imageCouch"){this.showImageCouch(c,a,b,$("asyncDownload")&&$F("asyncDownload")==="true")}else{this.downloadCollectionBasket(b,$("downloadForm").select("input:checked[type=radio][name=assetActionChooser]").pluck("value"),$("assetActionUserChosenValue")?$F("assetActionUserChosenValue"):undefined,false)}},updateSortingState:function(){var a="recordView="+this.currentView.getRecordView();this.doUpdate("sortingstate.jspx",a,"sortingStateContainer")},deleteProcess:function(a){var b="recordView="+this.currentView.getRecordView()+"&processID="+a;this.doRequest("deleteprocess.jspx",b)},setVisibleOpacityLayer:function(a){if(a){$("opacityLayer").setStyle({display:"block"})}else{$("opacityLayer").hide()}},storeDatePickerValue:function(a){var b=$(a.id+"Store");if(b){b.value=a.yyyy+a.mm+a.dd+a.xxx}},switchSession:function(b,a){var c="recordView="+this.currentView.getRecordView()+"&user="+encodeURIComponent(b)+"&password="+encodeURIComponent(a);this.doRequest("switchsession.jspx",c,function(d){var e=d.responseText;if(e.length>0){$("wrongUserNameOrPassword").update(Builder.node("span").update(e)).show()}else{this.doUpdate("header.jspx","recordView="+this.currentView.getRecordView(),"header");this.updateRecordViewSetChooser();this.clearAllFilters(function(){this.doUpdate("mypincollections.jspx","recordView="+this.currentView.getRecordView(),"myPinCollectionsFrameBody");this.gotoPage(this.currentView.getRecordView(),1);this.updateCollectionBasketButton();$("recordViewSet").href=this.applySessionID("rvs2css.jspx")+"?recordView="+this.currentView.getRecordView()}.bind(this))}}.bind(this))},showChangePasswordRequestWindow:function(){var a="recordView="+this.currentView.getRecordView();this.doUpdate("changepasswordrequestwindowconfiguration.jspx",a,"popupFrameBody",function(){this.showPopupWindow()}.bind(this))},changePasswordRequest:function(a){var b="recordView="+this.currentView.getRecordView()+"&user="+encodeURIComponent(a);this.doRequest("changepasswordrequestwindow.jspx",b,function(c){var d=c.responseText;if(d.length>0){$("changePasswordErrorContainer").update(Builder.node("span").update(d)).show()}else{this.hidePopupWindow()}}.bind(this))},showCreateAccountWindow:function(){var a="recordView="+this.currentView.getRecordView();this.doUpdate("createaccountwindowconfiguration.jspx",a,"popupFrameBody",function(){this.showPopupWindow()}.bind(this))},createAccount:function(a){var b="recordView="+this.currentView.getRecordView()+"&"+Form.serialize(a);this.doRequest("createaccountwindow.jspx",b,function(c){var d=c.responseText;if(d.length>0){if(d.indexOf("userSuccessfullyCreatedIdentifier")>=0){$("createAccountContainer").update(d)}else{$("createAccountErrorContainer").update(Builder.node("span").update(d)).show()}}else{this.hidePopupWindow()}}.bind(this))},showContactWindow:function(){this.doUpdate("contactview.jspx","","popupFrameBody",function(){this.showPopupWindow()}.bind(this))},showShareSearchWindow:function(shareSearchString){this.doUpdate("sharesearchdialog.jspx?query=" + shareSearchString,"","popupFrameBody",function(){this.showPopupWindow()}.bind(this))},showHelpWindow:function(){this.doUpdate("helpview.jspx","","popupFrameBody",function(){this.showPopupWindow()}.bind(this))},startBreadcrumbPopupShowing:function(b,a){this.stopBreadcrumbPopupShowing();this.timerBreadcrumbPopupShowing=setTimeout(function(){var c=$(b);if(c){this.closeAllAdvancedSearchPopups(c.id);this.setElementVisible(b,true,function(d){d.element.style.display="inline"}.bind(this))}}.bind(this),a?10:1000)},stopBreadcrumbPopupShowing:function(){if(this.timerBreadcrumbPopupShowing!=undefined){clearTimeout(this.timerBreadcrumbPopupShowing)}},startBreadcrumbPopupHiding:function(a){this.stopBreadcrumbPopupHiding();this.timerBreadcrumbPopupHiding=setTimeout(function(){var b=$(a);if(b){this.setElementVisible(b,false)}}.bind(this),1000)},stopBreadcrumbPopupHiding:function(){if(this.timerBreadcrumbPopupHiding!=undefined){clearTimeout(this.timerBreadcrumbPopupHiding)}},showBox:function(e,b){this.closeAllAdvancedSearchPopups();var c=$(e).next();var a=c.visible();if(!a){e.removeClassName("collapsed");Effect.toggle(c,"blind",{delay:0,duration:0.2,queue:"end"});if(b){var d="collapsed=false&boxID="+encodeURIComponent(b);this.doRequest("boxcollapsestate.jspx",d)}}else{Effect.Shake(c,{delay:0,queue:"end"})}},toggleBox:function(e,b){this.closeAllAdvancedSearchPopups();var c=$(e).next();var a=c.visible();Effect.toggle(c,"blind",{delay:0,duration:0.2,queue:"end"});if(a){e.addClassName("collapsed")}else{e.removeClassName("collapsed")}if(b){var d="collapsed="+a+"&boxID="+encodeURIComponent(b);this.doRequest("boxcollapsestate.jspx",d)}},toggleExclusiveBox:function(g,c,f){this.closeAllAdvancedSearchPopups();var d=$(g).next();var a=d.visible();$$(f+" .boxTitle").each(function(h){h.addClassName("collapsed")}.bind(this));var b=false;$$(f+" .boxBody").each(function(h){if(h.visible()){b=true}}.bind(this));if(b){$$(f+" .boxBody").each(function(h){if(h.visible()){if(this.isIE7){h.setStyle({overflow:"visible",display:"none"});Effect.toggle(d,"blind",{delay:0,duration:0.5,queue:"end"})}else{Effect.BlindUp(h,{delay:0,duration:0.5,afterFinish:function(){h.setStyle({overflow:"visible",display:"none"});Effect.toggle(d,"blind",{delay:0,duration:0.5,queue:"end"})}})}}}.bind(this))}else{Effect.toggle(d,"blind",{delay:0,duration:0.5,queue:"end"})}if(a&&!g.hasClassName("collapsed")){g.addClassName("collapsed")}else{g.removeClassName("collapsed")}if(c){var e="collapsed="+a+"&boxID="+encodeURIComponent(c);this.doRequest("boxcollapsestate.jspx",e)}},toggleExclusiveSubBox:function(g,c,f){this.closeAllAdvancedSearchPopups();var d=$(g).next();var a=d.visible();$$(f+" .boxSubTitle  ").each(function(h){h.addClassName("collapsed")}.bind(this));var b=false;$$(f+" .boxSubBody ").each(function(h){if(h.visible()){b=true}}.bind(this));if(b){$$(f+" .boxSubBody ").each(function(h){if(h.visible()){if(this.isIE7){h.setStyle({overflow:"visible",display:"none"});Effect.toggle(d,"blind",{delay:0,duration:0.5,queue:"end"})}else{Effect.BlindUp(h,{delay:0,duration:0.5,afterFinish:function(){h.setStyle({overflow:"visible",display:"none"});Effect.toggle(d,"blind",{delay:0,duration:0.5,queue:"end"})}})}}}.bind(this))}else{Effect.toggle(d,"blind",{delay:0,duration:0.5,queue:"end"})}if(a&&!g.hasClassName("collapsed")){g.addClassName("collapsed")}else{g.removeClassName("collapsed")}if(c){var e="collapsed="+a+"&boxID="+encodeURIComponent(c);this.doRequest("boxcollapsestate.jspx",e)}},setElementVisible:function(c,d,a,b){if(c){if(d){Effect.Appear(c,{delay:0,duration:0.3,beforeSetup:function(e){e.element.setOpacity(e.options.from).show();if(a){a(e)}},afterFinish:function(e){if(b){b(e)}},queue:"end"})}else{Effect.Fade(c,{delay:0,duration:0.3,afterFinish:function(e){if(b){b(e)}}.bind(this),queue:"end"})}}},updateImageSizeChooser:function(){this.imageSizeSlider.inStateChange=true;this.imageSizeSlider.range=$R(this.currentView.getImageSizeMinimum(),this.currentView.getImageSizeMaximum());this.imageSizeSlider.setValue(this.currentView.getImageSizeCurrent(),0);this.imageSizeSlider.inStateChange=false},updateRecordsPerPage:function(){var d=this.currentView.getRecordsPerPage();var b=$("recordsPerPageChooser");for(var a=0,c=b.length;a<c;a++){if(b.options[a].value==d){b.options[a].selected=true;break}}},setRecordView:function(a){this.currentView.setRecordView(a);this.updateRecords();this.updateImageSizeChooser();this.updateRecordsPerPage();this.hideRecordInformationTooltip();this.closeAllAdvancedSearchPopups()},setRecordViewSet:function(a){var b="recordView="+this.currentView.getRecordView()+"&recordViewSet="+encodeURIComponent(a);this.doRequest("setviewset.jspx",b,function(){$("recordViewSet").href=this.applySessionID("rvs2css.jspx")+"?"+b;this.updateRecords()}.bind(this))},updateRecordViewSetChooser:function(){if($("recordViewSetChooser")){var a="recordView="+this.currentView.getRecordView();this.doUpdate("recordviewsetchooser.jspx",a,"recordViewSetChooserContainer",function(){$("recordViewSet").href=this.applySessionID("rvs2css.jspx")+"?"+a}.bind(this))}},startSlideShow:function(a,b,c){if(c){this.enableStartSlideShow=false;this.slideShowTimingInSeconds=Math.max(Number(prompt(c,this.slideShowTimingInSeconds)),1)}this.enableStartSlideShow=true;setTimeout(function(){if(this.enableStartSlideShow&&this.slideShowInterval==undefined){var d=a;if(d<b){this.gotoPage("recordCollectionPreviewView",++d,true);this.slideShowInterval=setInterval(function(){if(d<b){app.gotoPage("recordCollectionPreviewView",++d,true)}else{app.stopSlideShow(d)}},this.slideShowTimingInSeconds*1000)}}}.bind(this),c?0:400)},stopSlideShow:function(a){this.enableStartSlideShow=false;if(this.slideShowInterval!=undefined){clearInterval(this.slideShowInterval)}this.slideShowInterval=undefined;if(a){this.gotoPage("recordCollectionPreviewView",a,true)}},showRecordInformationTooltip:function(f,e,c,b,d){if(!this.isPINCollection){var a=Event.pointerX(f);var h=Event.pointerY(f);var g=$("recordInformationTooltipContainer");if(!g){clearTimeout(this.timerTooltip);this.timerTooltip=setTimeout(function(){g=$(Builder.node("div",{id:"recordInformationTooltipContainer"}));$("body").appendChild(g);CantoUtils.updateTooltipPosition(a,h,g,15,2);var i=this.currentView.getRecordView();if(d!=undefined){i=d}var j="recordView="+i+"&singleCatalogID="+e+"&recordID="+c+"&recordIndex="+b;this.doUpdate("tooltipinfoview.jspx",j,"recordInformationTooltipContainer",function(){if(this.isIE){g.setStyle({visibility:"visible",zIndex:10000})}else{g.setOpacity(0);g.setStyle({visibility:"visible",zIndex:10000});new Effect.Opacity(g.id,{from:0,to:1,duration:0.3,queue:"end"})}}.bind(this),true)}.bind(this),500)}else{CantoUtils.updateTooltipPosition(a,h,g,15,2)}}},hideRecordInformationTooltip:function(){clearTimeout(this.timerTooltip);var a=$("recordInformationTooltipContainer");if(a){if(this.isIE){a.remove()}else{new Effect.Opacity(a.id,{from:1,to:0,duration:0.3,queue:"end",afterFinish:function(){a.remove()}})}}},logout:function(a){Event.stopObserving(window,"resize",this.optimizePopupWindowHeight.bindAsEventListener(this));var b="recordView="+this.currentView.getRecordView()+"&ri="+Math.random();this.doRequest("logout.jspx",b,function(){if(a!=null){location.href="index.jspx?com.canto.cumulus.web.ErrorID="+a}else{location.href="index.jspx"}}.bind(this))},initializeSlider:function(){this.imageSizeSlider=new Control.Slider($("imageSizeSliderKnob"),$("imageSizeSliderTrack"),{range:$R(this.currentView.getImageSizeMinimum(),this.currentView.getImageSizeMaximum()),sliderValue:this.currentView.getImageSizeCurrent(),onSlide:function(a){$("recordsContainer").select(".recordSelector").each(function(c){if(this.currentView.getRecordView()=="recordCollectionReportView"){c.select(".resizableImage").each(function(d){if(d.width>d.height){d.width=a}else{d.height=a}var e=d.up(".fieldSelector");if(e){e.setStyle({width:a+"px",height:a+"px"})}}.bind(this))}else{if(this.currentView.getRecordView()=="recordCollectionThumbnailView"){c.setStyle({width:a+"px"});var b=c.select('div[class!="clearFloat"]');b.each(function(d){d.setStyle({width:a+"px"})}.bind(this));c.select(".resizableImage").each(function(d){if(d.width>d.height){d.width=a}else{d.height=a}var e=d.up(".fieldSelector");if(e){e.setStyle({height:a+"px"})}}.bind(this))}}}.bind(this));this.imageSizeSlider.handles[0].setAttribute("title",Math.round(a)+"px")}.bind(this),onChange:function(b){var a=Math.round(b);this.setImageSize(a);this.imageSizeSlider.handles[0].setAttribute("title",a+"px")}.bind(this)})},setLanguage:function(a){var b="locale="+a;this.doRequest("changelanguage.jspx",b,function(d){var c=d.responseText.evalJSON(true);document.title=c.applicationName;b="recordView="+this.currentView.getRecordView();if(!this.isPINCollection){this.doRequest("setviewsets.jspx",b);this.browsingHistorySites.loadBrowserHistoryState(this.browsingHistoryManager.currentHash,true);this.doUpdate("header.jspx","recordView="+this.currentView.getRecordView(),"header",undefined,true);this.doUpdate("advancedsearchfieldlistpopup.jspx",b,"advancedSearchFieldListPopup");this.doUpdate("thumbnailslidercontainer.jspx",b,"thumbnailSliderContainer",undefined,true);this.doUpdate("viewchooser.jspx",b,"viewChooser");this.doUpdate("collectionbasketbulkfunctions.jspx",b,"collectionBasketBulkFunctions");this.doUpdate("quicksearchbutton.jspx",b,"quickSearchButton",function(){var e=$("quickSearchInput");if(e){this.quickSearchAutoCompleter=new CantoAutocompleter(e,"quickSearchAutoCompletePopup","quicksearchautocompletepopup.jspx;jsessionid="+this.sessionID,{paramName:"query",contentType:"application/x-www-form-urlencoded; charset=UTF-8",minChars:1,tokens:[" ","|","&"],afterUpdateElement:function(){app.doQuickSearch($F("quickSearchInput"))}})}}.bind(this));this.updateCollectionBasketButton();this.updateRecordViewSetChooser();this.doUpdate("recordfooter.jspx",b,"recordFooter");this.doUpdate("applicationfooter.jspx",b,"applicationFooter")}else{this.doRequest("setviewsets.jspx",b);this.doUpdate("pincollectionheader.jspx","recordView="+this.currentView.getRecordView(),"header",undefined,true);this.doUpdate("recordfooter.jspx",b,"recordFooter");this.doUpdate("applicationfooter.jspx",b,"applicationFooter");this.doUpdate("pincollectionthumbnailslidercontainer.jspx",b,"thumbnailSliderContainer",undefined,true);this.doUpdate("pincollectionthumbnailview.jspx",b,"recordsContainer");this.doUpdate("pincollectionfunctionbar.jspx",b,"collectionFunctionBarRight");this.doUpdate("pincollectionsortingstate.jspx",b,"sortingStateContainer")}}.bind(this))},setTheme:function(a){this.currentTheme=a;var b="theme="+a;this.doRequest("changetheme.jspx",b,function(c){$("sitesStructureStylesheet").href=this.currentTheme+"/styles/structure.css";$("sitesThemeStylesheet").href=this.currentTheme+"/styles/theme.css";$("datePickerStylesheet").href=this.currentTheme+"/styles/datepicker.css";$("cropperSettings").href=this.currentTheme+"/styles/cropper.css";$("tabbedPaneStylesheet").href=this.currentTheme+"/styles/jstabbedpane.css";if($("ieStylesheet")){$("ieStylesheet").href=this.currentTheme+"/styles/ie7.css"}b="recordView="+this.currentView.getRecordView();if(!this.isPINCollection){this.browsingHistorySites.loadBrowserHistoryState(this.browsingHistoryManager.currentHash);this.doUpdate("header.jspx",b,"header",undefined,true);this.doUpdate("advancedsearchfieldlistpopup.jspx",b,"advancedSearchFieldListPopup");this.doUpdate("thumbnailslidercontainer.jspx",b,"thumbnailSliderContainer",undefined,true);this.doUpdate("viewchooser.jspx",b,"viewChooser");this.doUpdate("collectionbasketbulkfunctions.jspx",b,"collectionBasketBulkFunctions");this.doUpdate("quicksearchbutton.jspx",b,"quickSearchButton",function(){var d=$("quickSearchInput");if(d){this.quickSearchAutoCompleter=new CantoAutocompleter(d,"quickSearchAutoCompletePopup","quicksearchautocompletepopup.jspx;jsessionid="+this.sessionID,{paramName:"query",contentType:"application/x-www-form-urlencoded; charset=UTF-8",minChars:1,tokens:[" ","|","&"],afterUpdateElement:function(){app.doQuickSearch($F("quickSearchInput"))}})}}.bind(this));this.updateCollectionBasketButton();this.updateRecordViewSetChooser();this.doUpdate("recordfooter.jspx",b,"recordFooter");this.doUpdate("applicationfooter.jspx",b,"applicationFooter")}else{this.gotoPage("recordCollectionThumbnailView",1,true);this.doUpdate("pincollectionheader.jspx",b,"header",undefined,true);this.doUpdate("pincollectionsortingstate.jspx",b,"sortingStateContainer",undefined,true);this.doUpdate("pincollectionfunctionbar.jspx",b,"collectionFunctionBarRight",undefined,true);this.doUpdate("pincollectionthumbnailslidercontainer.jspx",b,"thumbnailSliderContainer",undefined,true);this.doUpdate("recordfooter.jspx",b,"recordFooter");this.doUpdate("applicationfooter.jspx",b,"applicationFooter")}}.bind(this))},showRelatedRecords:function(g,a,h,b,d,f,c){var e="recordView="+this.currentView.getRecordView()+"&singleCatalogID="+g+"&recordID="+a+"&relation="+b+"&direction="+d+"&title="+f;if(c!=undefined){e+="&numberOfRelationsToShow="+c}this.doUpdate("infoviewrelation.jspx",e,h)},setInfoFieldEditorButtonsVisible:function(a,d){var c=$$(".editPanel");var b=$("editButton"+a);if(d){if(c.length==0&&b){b.setStyle({display:"inline"})}}else{if(b){b.hide()}}},showRecordEditor:function(b,a,c,d){var e="recordView="+this.currentView.getRecordView()+"&recordIndex="+b+"&uid="+a+"&escapedClassID="+c+"&preSeparator="+d;this.doUpdate("infovieweditfield.jspx",e,c+"line",undefined,true)},saveRecordEditor:function(d,f,c,b){var a=Form.serialize(d);var e="recordView="+this.currentView.getRecordView()+"&catalogID="+f+"&recordID="+c+"&"+a;this.doRequest("updaterecord.jspx",e,function(){this.updateInfoView(undefined,c,f);var g=$$(".pageInput").first().value;this.gotoPage(this.currentView.getRecordView(),g)}.bind(this))},cancelRecordEditor:function(a){this.gotoPage("recordCollectionInfoView",a,true)},validateRecordEditor:function(b,c,a){clearTimeout(this.timerValidator);this.timerValidator=setTimeout(function(){var d="recordView="+this.currentView.getRecordView()+"&catalogID="+c+"&recordID="+a+"&"+Form.serialize(b);this.doRequest("validaterecord.jspx",d,function(g){var f=g.responseText.evalJSON(true);var e=$(b);e.select(".infoItemErrorContainer").each(function(h){h.hide()});$$(".saveRecordEditorButton").each(function(h){Element.show(h)});f.each(function(j){var h=j.guid.substring(1,37);var i=e.select(".errorMessage"+h)[0]||undefined;var k=e.select(".errorContainer"+h)[0]||undefined;if(i&&k){i.update(j.error);k.show()}Element.hide($("saveButton"+h))})}.bind(this))}.bind(this),750)},showUploadWindow:function(c,a){var b="recordView=recordCollectionThumbnailView";if(c!=undefined&&a!=undefined){b+="&singleCatalogID="+c+"&categoryID="+a}this.doUpdate("uploadconfiguration.jspx",b,"popupFrameBody",function(){this.showPopupWindow()}.bind(this),true)},hideUploadWindow:function(){this.hidePopupWindow(true);this.browsingHistorySites.saveBrowserHistoryState({windowOpened:false})},revealUploadedRecords:function(b,a){this.clearAllFilters(function(){var c="recordView="+this.currentView.getRecordView()+"&singleCatalogID="+b+"&records="+a;this.doRequest("recordsreveal.jspx",c,function(){this.updateAllAdvancedSearchBarBoxes();this.gotoPage("recordCollectionInfoView",1,true);this.gotoPage(this.currentView.getRecordView(),1,true);this.browsingHistorySites.saveBrowserHistoryState({catalogID:b,records:a,windowOpened:false})}.bind(this))}.bind(this))},catalogFiles:function(b,c){if(b){var f="uploadIFrame"+c;var a=document.createElement("div");a.style.position="absolute";a.style.top="0";a.style.marginLeft="-10000px";if(this.isIE){a.innerHTML='<iframe id="'+f+'" name="'+f+'" src="about:blank""/>'}else{var e=document.createElement("iframe");e.setAttribute("name",f);e.setAttribute("id",f);a.insertBefore(e,null)}$("body").insertBefore(a,null);b.target=f;b.submit()}var d="recordView=recordCollectionThumbnailView&processID="+c;this.doUpdate("uploadstate.jspx",d,"uploadState",function(){var h=$("catalogingStatus");var g=h.getAttribute("processState");if(g<4){window.setTimeout(function(){this.catalogFiles(undefined,c)}.bind(this),1000)}else{this.updateRecords()}}.bind(this),true)},cancelProcess:function(a){var b="recordView=recordCollectionThumbnailView&processID="+a;this.doRequest("cancelprocess.jspx",b)},updateAssetHandlingSetForCatalog:function(h,a,f){if(h!=undefined&&h.selectedIndex!=undefined){var c=h.options[h.selectedIndex];var g=c.getAttribute("defaultAHS");if(g){for(var e=0;e<a.options.length;e++){if(a.options[e].id==g){a.options[e].selected=true;break}}}if(f){var d=c.getAttribute("defaultPermissionTemplate");if(d){for(var b=0;b<f.options.length;b++){if(f.options[b].id==d){f.options[b].selected=true;break}}}}}},changeUploadDestinationCategory:function(c,a){var b="recordView="+this.currentView.getRecordView();if(c!=undefined&&a!=undefined){b+="&singleCatalogID="+c+"&categoryID="+a}this.doUpdate("uploadcategoryview.jspx",b,"uploadCategoryFilterBox",undefined,true)},togglePreviewWindowUserCommentHotSpots:function(b,c,a){var d="collapsed="+b+"&boxID="+encodeURIComponent(c);this.doRequest("boxcollapsestate.jspx",d,function(e){if(b){hotSpotCommentsLib.hideUserComments()}this.gotoPage("recordCollectionPreviewView",a);var f=$("previewViewBodyContainer");if(f!=undefined){f.removeClassName("paddingHotSpotPreview")}}.bind(this),true)},togglePreviewWindowDiscussions:function(b,c,a){var d="collapsed="+b+"&boxID="+encodeURIComponent(c);this.doRequest("boxcollapsestate.jspx",d,function(e){this.gotoPage("recordCollectionPreviewView",a,true)}.bind(this),true)},addDiscussionEntry:function(e,a,d){var b=$(d).value;var c="recordView="+app.currentView.getRecordView()+"&singleCatalogID="+e+"&recordID="+a+"&value="+encodeURIComponent(b)+"&action=create";app.doRequest("communitydiscussionhandler.jspx",c,function(){app.doUpdate("previewviewdiscussion.jspx",c,"previewViewDiscussionBody",undefined,true)}.bind(this))},deleteDiscussionEntry:function(d,a,b){var c="recordView="+app.currentView.getRecordView()+"&singleCatalogID="+d+"&recordID="+a+"&userCommentThreadID="+b+"&action=delete";app.doRequest("communitydiscussionhandler.jspx",c,function(){app.doUpdate("previewviewdiscussion.jspx",c,"previewViewDiscussionBody",undefined,true)}.bind(this))},editDiscussionEntry:function(a,b,c){$(b).setStyle({display:"block"});$(c).setStyle({display:"none"});window.setTimeout(function(){$(a).focus()},100)},saveDiscussionEntry:function(f,b,d,a){var c=$(a).value;var e="recordView="+app.currentView.getRecordView()+"&singleCatalogID="+f+"&recordID="+b+"&userCommentThreadID="+d+"&value="+encodeURIComponent(c)+"&action=modify";app.doRequest("communitydiscussionhandler.jspx",e,function(){app.doUpdate("previewviewdiscussion.jspx",e,"previewViewDiscussionBody",undefined,true)}.bind(this))},hideEditDiscussionEntry:function(a,b){$(a).setStyle({display:"none"});$(b).setStyle({display:"block"})},setEditCurrentCategory:function(c,a){var b="recordView="+this.currentView.getRecordView();if(c!=undefined&&a!=undefined){b+="&singleCatalogID="+c+"&categoryID="+a}this.doUpdate("infovieweditcategoryfield.jspx",b,"editCategoryFieldBox")},showEditCategoryIcon:function(c){var b=$("currentCategories").value.split(",");var d=$$(".categoriesAdded")[0].value.split(",");var a=$$(".categoriesRemoved")[0].value.split(",");if((!b.include(c)||a.include(c))&&!d.include(c)){$("addCategoryIcon"+c).setStyle({display:"block"})}},hideEditCategoryIcon:function(a){$("addCategoryIcon"+a).setStyle({display:"none"})},hideSelectedCategories:function(){$("editCategoryFieldBox").setStyle({display:"none"});$$(".categoriesEditorContainer .infoItemDialogButtons").each(function(a){a.setStyle({display:"block"})})},addSelectedCategories:function(){var b=5;var a=$("popupFrame").cumulativeOffset().top;$$(".categoriesEditorContainer .infoItemDialogButtons").each(function(c){c.setStyle({display:"none"})});$$(".categoriesEditorContainer").each(function(d){var c=d.cumulativeOffset();$("editCategoryFieldBox").setStyle({left:(c.left+d.getDimensions().width+b)+"px",top:(c.top-a-d.cumulativeScrollOffset().top)+"px"})});$("editCategoryFieldBox").setStyle({display:"block"})},addCategoryField:function(e,c){$("editCategoryFieldBox").setStyle({display:"none"});$$(".categoriesEditorContainer .infoItemDialogButtons").each(function(i){i.setStyle({display:"block"})});var g=$$(".categoriesAdded")[0];var b=g.value.split(",");b.push(e);g.value=b.without(b.join(","),"");var f=$("categoryName"+e).innerHTML;var d="categories0";var a="categories"+c;var h=$$(".categoriesEditorContainer")[0].select("select");h.each(function(j){if(j.id==d||j.id==a){var m=false;for(var k=j.length-1;k>=0;k--){if(j.options[k].value==e){m=true;break}}if(!m){var n=new Option(f,e);var l=j.options.length;j.options[l]=n;j.selectedIndex=l;if(b.indexOf(e)==-1){b.push(e)}}}})},
reducedViewFilter: function ()
{
	var params = 'recordView=' + app.currentView.getRecordView ();
	app.doRequest ('extendedViewAddFilter.jspx', params, function()
	{
		this.doUpdate ('extendedviewbutton.jspx', params, 'extendedViewButton');
		this.updateAllFieldFilters (true, function ()
		{
			this.setCurrentCategory (undefined, undefined, function ()
			{
				this.doQuickSearch ($ ('quickSearchInput').value, undefined, true);
			}.bind (this), true);
		}.bind (this));
	}.bind (this));
},
extendedViewFilter: function ()
{
	var params = 'recordView=' + app.currentView.getRecordView ();
	app.doRequest ('extendedViewRemoveFilter.jspx', params, function()
	{
		this.doUpdate ('extendedviewbutton.jspx', params, 'extendedViewButton');
		this.updateAllFieldFilters (true, function ()
		{
			this.setCurrentCategory (undefined, undefined, function ()
			{
				this.doQuickSearch ($ ('quickSearchInput').value, undefined, true);
			}.bind (this), true);
		}.bind (this));
	}.bind (this));
},removeSelectedCategories:function(d,l){d=$(d);var c=[];var h=d.select("select")[0];if(h.length>1){for(var f=h.length-1;f>=0;f--){if(h.options[f].selected){c.push(h.options[f].value);$(h.options[f]).remove()}}var g=d.up(".categoriesEditorContainer");var j=g.select("select");j.each(function(m){for(var n=m.length-1;n>=0;n--){if(c.indexOf(m.options[n].value)>-1){$(m.options[n]).remove()}}});var b=g.select(".categoriesAdded")[0]||undefined;var a=g.select(".categoriesRemoved")[0]||undefined;if(a){var k=a.value.split(",");var e=b.value.split(",")||[];e=e.without(c.join(","),"");k=k.without(c.join(","),"");k=k.concat(c);a.value=k.join(",");if(b){b.value=e.join(",")}}}else{alert(l)}}});var app;var componentInitialization=false;function exitApplication(a){if(app){app.logout(a);app=undefined}}function initApplication(d,c,a,g,e,f,b){app=new SitesApplication(d,c,a,g,e,f,b);app.updateAllFieldFilters(true);app.browsingHistorySites.saveBrowserHistoryState({mainPageRecordView:"recordCollectionThumbnailView",mainPage:1})};
