var Pattern={metaTags:[],searchResultsCount:0,createActionFormStepSign:function(a){var b=foswiki.HTML.insertBeforeElement(a,"span","►");b.className="foswikiActionFormStepSign"},setAttachmentCount:function(d){var c=foswiki.getElementsByClassName(d,"patternAttachmentHeader","h3");if(c!=undefined){var b=d.getElementsByTagName("tr").length-1;var a=" "+b+"";if(c[0]){c[0].innerHTML+=a}if(c[1]){c[1].innerHTML+=a}}},addSearchResultsCounter:function(a){var b=foswiki.HTML.getHtmlOfElement(a);Pattern.searchResultsCount+=parseInt(b)},displayTotalSearchResultsCount:function(a){if(Pattern.searchResultsCount>=10){var b=" "+TEXT_NUM_TOPICS+" "+Pattern.searchResultsCount+" ";foswiki.HTML.setHtmlOfElement(a,b)}},displayModifySearchLink:function(){var b=document.getElementById("foswikiModifySearchContainer");if(b!=null){if(Pattern.searchResultsCount>0){var a=' '+TEXT_MODIFY_SEARCH+"";foswiki.HTML.setHtmlOfElement(b,a)}}}};var patternRules={".foswikiFormStep h3":function(a){Pattern.createActionFormStepSign(a)},"input#jumpFormField":function(a){foswiki.Form.initBeforeFocusText(a,TEXT_JUMP);a.onfocus=function(){foswiki.Form.clearBeforeFocusText(this)};a.onblur=function(){foswiki.Form.restoreBeforeFocusText(this)}},"input#quickSearchBox":function(a){foswiki.Form.initBeforeFocusText(a,TEXT_SEARCH);a.onfocus=function(){foswiki.Form.clearBeforeFocusText(this)};a.onblur=function(){foswiki.Form.restoreBeforeFocusText(this)}},".foswikiAttachments":function(a){Pattern.setAttachmentCount(a)},"body.patternEditPage":function(a){foswiki.Event.addLoadEvent(initForm,false)},".foswikiSearchResultCount":function(a){Pattern.addSearchResultsCounter(a)},"span#foswikiNumberOfResultsContainer":function(a){Pattern.displayTotalSearchResultsCount(a)},"form#foswikiWebSearchForm":function(a){Pattern.displayModifySearchLink()},"a.foswikiPopUp":function(a){a.onclick=function(){foswiki.Window.openPopup(a.href,{template:"viewplain"});return false}},"input.foswikiFocus":function(a){a.focus()},"input.foswikiChangeFormButton":function(a){a.onclick=function(){suppressSaveValidation()}}};Behaviour.register(patternRules);var initForm;var TEXT_JUMP=foswiki.getMetaTag("TEXT_JUMP");var TEXT_SEARCH=foswiki.getMetaTag("TEXT_SEARCH");var TEXT_NUM_TOPICS=foswiki.getMetaTag("TEXT_NUM_TOPICS");var TEXT_MODIFY_SEARCH=foswiki.getMetaTag("TEXT_MODIFY_SEARCH");var SCRIPTURLPATH=foswiki.getMetaTag("SCRIPTURLPATH");var SCRIPTSUFFIX=foswiki.getMetaTag("SCRIPTSUFFIX");var WEB=foswiki.getMetaTag("WEB");var TOPIC=foswiki.getMetaTag("WEBTOPIC");