var Fse; if( ! Fse ) Fse = {}; Fse.IMG = {} Fse.IMG.applyImageFilters = function() { var viewSelectionForm = document.getElementById( "viewSelectionForm" ); viewSelectionForm.submit(); }; Fse.IMG.resetImageFilters = function() { window.location="?qsKeyword=&catId=0"; }; Fse.IMG.fetchImageCounts = function( aIds ) { var fnCallback = function( oRequest ) { for( var idx = 0; idx < aIds.length; idx++ ) { var sId = aIds[idx]; var nItemCount = oRequest.xhRequest.getResponseHeader( "item-count-" + sId ); if( nItemCount && nItemCount > 0 ) { var oLookupLink = document.getElementById( sId ); var oLinkElement = document.createElement( "a" ); oLinkElement.setAttribute( "href", oLookupLink.getAttribute( "href" )); var sItemCountText = nItemCount + "\xA0image"; if( nItemCount > 1 ) { sItemCountText = sItemCountText + "s"; } var oCountNode = document.createTextNode( "(" + sItemCountText + ")"); oLinkElement.appendChild( oCountNode ); oLookupLink.appendChild( oLinkElement ); } } }; var sCountURL = "?do=getItemCount"; for( var idx = 0; idx < aIds.length; idx++ ) { sCountURL = sCountURL + "&lookupId=" + encodeURIComponent(aIds[idx]); } Fse.Ajax.getURL( sCountURL, fnCallback ); };