2 | | -var search=document.getElementById('search');var clearSearch=document.getElementById('clearsearch');initClearSearchLink();function initClearSearchLink(){clearSearch.setAttribute('title','Clear');clearSearch.addEventListener('mousedown',clearSearchBox,true);search.addEventListener('keyup',_handleClearSearchLink,false)}function _handleClearSearchLink(){if(clearSearch){if(search.value.length>0){clearSearch.style.display='block'}else{clearSearch.style.display='none'}}}function clearSearchBox(a){search.value='';clearSearch.style.display='none';if(a){a.preventDefault()}}document.getElementById('logo').onclick=function(){var n=document.getElementById('nav').style;n.display=n.display=='block'?'none':'block'};for(var h=document.getElementsByTagName('h2'),i=0;i<h.length;i++){if(h[i].className=='section_heading'){h[i].onclick=function(){var a=parseInt(this.id.replace(/section_(\d+)/,'$1'));wm_toggle_section(a)}}};for(var a=document.getElementsByTagName('a'),i=0;i<a.length;i++){a[i].onclick=function(){if(this.hash.indexOf('#')==0){wm_reveal_for_hash(this.hash)}}};if(document.location.hash.indexOf('#')==0){wm_reveal_for_hash(document.location.hash)}updateOrientation();window.scrollTo(0,1);function updateOrientation(){switch(window.orientation){case 0:document.body.setAttribute('class','portrait');break;case 90:case-90:document.body.setAttribute('class','landscape')}}window.onorientationchange=updateOrientation;function wm_reveal_for_hash(a){var b=document.getElementById(a.substr(1));if(b){for(var p=b.parentNode;p&&p.className!='content_block'&&p.className!='section_heading';){p=p.parentNode}if(p&&p.style.display!='block'){var c=parseInt(p.id.split('_')[1]);wm_toggle_section(c)}}}function wm_toggle_section(a){var b=document.getElementById('section_'+a),bb=b.getElementsByTagName('button');for(var i=0;i<=1;i++){var s=bb[i].style;s.display=s.display=='none'||(i&&!s.display)?'inline-block':'none'}for(var i=0,d=['content_','anchor_'];i<=1;i++){var s=document.getElementById(d[i]+a).style;s.display=s.display=='block'?'none':'block'}} |