// |# $Id: menu.m4js 1.47 2010/06/24 11:06:08 daves Exp $
/* |# $Id: none.m4 1.13 2010/02/09 12:07:32 daves Exp $ */
// |# $Id: links.m4 1.69 2010/04/22 10:46:51 daves Exp $
// |# $Id: img.m4 1.18 2003/10/18 12:48:17 daves Exp $
/* |# $Id: default-cssdefs.m4 1.5 2010/03/21 16:36:57 daves Exp $ */
/* |# $Id: potoc-cssdefs.m4 1.26 2010/03/05 12:07:31 daves Exp $ */
// |# $Id: menu.m4 1.77 2010/06/24 15:21:33 daves Exp $
// |# $Id: dates.m4 1.7 2010/01/08 15:48:22 daves Exp $
// |# $Id: event-list.m4 2010.1 2010/08/17 15:30:55 daves Exp $
if(!window.opener){
var menu_ready;
var menu_show_props;
var menu_hide_props;
var menu_icon_props;
var menu_props;
function menu_scroll_top(){
return window.scrollY+10+"px";}
function menu_scroll_top_IE(){
return document.documentElement.scrollTop+10+"px";}
function menu_icon_show(){
if(menu_ready==null)
return true;
menu_icon_props.top=menu_scroll_top();
menu_show_props.display='none';
menu_hide_props.display='block';
menu_icon_props.display='block';
return false;}
function menu_icon_hide(){
if(menu_ready==null)
return true;
menu_show_props.display='block';
menu_hide_props.display=menu_props.display;
menu_icon_props.display='none';
return false;}
function menu_show(){
if(menu_ready==null)
return true;
menu_props.top=menu_scroll_top();
menu_props.display='block';
menu_show_props.display='none';
menu_hide_props.display='block';
menu_icon_props.display='none';
return false;}
function menu_hide(){
if(menu_ready==null)
return true;
menu_props.display='none';
menu_show_props.display='block';
menu_hide_props.display='none';
menu_icon_props.display='none';
return false;}
function menu_getElementsByTagName_NS(namespaceURI,localName){
return document.documentElement.getElementsByTagNameNS(namespaceURI,localName);}
function menu_getElementsByTagName(namespaceURI,localName){
return document.documentElement.getElementsByTagName(localName);}
function menu_createElement_NS(namespaceURI,qualifiedName){
return document.createElementNS(namespaceURI,qualifiedName);}
function menu_createElement(namespaceURI,qualifiedName){
return document.createElement(qualifiedName);}
function menu_getAttribute_NS(element,namespaceURI,localName){
return element.getAttributeNS(namespaceURI,localName);}
function menu_getAttribute(element,namespaceURI,localName){
return element.getAttribute(localName);}
function menu_setAttribute_NS(element,namespaceURI,qualifiedName,value){
return element.setAttributeNS(namespaceURI,qualifiedName,value);}
function menu_setAttribute(element,namespaceURI,qualifiedName,value){
return element.setAttribute(qualifiedName,value);}
function menu_init(){
if(window.navigator.appName.indexOf('Microsoft')>=0){
menu_scroll_top=menu_scroll_top_IE;}
if(document.documentElement.namespaceURI){
menu_getElementsByTagName=menu_getElementsByTagName_NS;
menu_createElement=menu_createElement_NS;
menu_getAttribute=menu_getAttribute_NS;
menu_setAttribute=menu_setAttribute_NS;}
if(window.removeEventListener)
window.removeEventListener('load',menu_init,true);
var d_namespace=document.documentElement.namespaceURI;
var m_parent=menu_getElementsByTagName(d_namespace,'body')[0];
var m_page_height=m_parent.scrollHeight;
var m_show=menu_createElement(d_namespace,'div');
menu_setAttribute(m_show,null,'id','MenuShow');
menu_setAttribute(m_show,null,'onmouseover','menu_icon_show();');
menu_setAttribute(m_show,null,'style','position:absolute; display:block;'
+' top:0; height:'+m_page_height+'px; left:0; width:2em');
m_parent.appendChild(m_show);
var m_hide=menu_createElement(d_namespace,'div');
menu_setAttribute(m_hide,null,'id','MenuHide');
menu_setAttribute(m_hide,null,'onmouseover','menu_icon_hide();');
menu_setAttribute(m_hide,null,'onclick','menu_hide();');
menu_setAttribute(m_hide,null,'style','position:absolute; display:none;'
+' top:0; height:'+m_page_height+'px; left:25%; width:75%');
m_parent.appendChild(m_hide);
var m_icon=menu_createElement(d_namespace,'div');
menu_setAttribute(m_icon,null,'id','MenuIcon');
menu_setAttribute(m_icon,null,'style','position:absolute; display:none;'
+' left:10px; margin:0');
var m_icon_img=menu_createElement(d_namespace,'img');
menu_setAttribute(m_icon_img,null,'onclick','menu_show();');
menu_setAttribute(m_icon_img,null,'src','menu-open.gif');
menu_setAttribute(m_icon_img,null,'width','22px');
menu_setAttribute(m_icon_img,null,'height','26px');
menu_setAttribute(m_icon_img,null,'border','0');
menu_setAttribute(m_icon_img,null,'alt','');
menu_setAttribute(m_icon_img,null,'title','table of contents');
m_icon.appendChild(m_icon_img);
m_parent.appendChild(m_icon);
var m_this=location.pathname;
if(m_this.substr(-1)=='/')
m_this='./'
else
m_this=m_this.substring(m_this.lastIndexOf('/')+1);
var m_menu=menu_createElement(d_namespace,'div');
menu_setAttribute(m_menu,null,'id','Menu');
menu_setAttribute(m_menu,null,'class','menu');
menu_setAttribute(m_menu,null,'style','position:absolute; display:none;'
+' top:10px; left:10px; width:25%; max-width:12.5em');
var m_menu_div=menu_createElement(d_namespace,'div');
menu_setAttribute(m_menu_div,null,'class','noprint');
var m_menu_table=menu_createElement(d_namespace,'table');
menu_setAttribute(m_menu_table,null,'class','toc');
menu_setAttribute(m_menu_table,null,'cellSpacing','0');
var m_menu_tbody=menu_createElement(d_namespace,'tbody');
var m_menu_tr,m_menu_td;
m_menu_tr=menu_createElement(d_namespace,'tr');
m_menu_td=menu_createElement(d_namespace,'td');
menu_setAttribute(m_menu_td,null,'class','toolbar');
menu_setAttribute(m_menu_td,null,'align','right');
var m_menu_img=menu_createElement(d_namespace,'img');
menu_setAttribute(m_menu_img,null,'onclick','menu_hide();');
menu_setAttribute(m_menu_img,null,'src','menu-close.gif');
menu_setAttribute(m_menu_img,null,'width','11px');
menu_setAttribute(m_menu_img,null,'height','11px');
menu_setAttribute(m_menu_img,null,'border','0');
menu_setAttribute(m_menu_img,null,'alt','');
m_menu_td.appendChild(m_menu_img);
m_menu_tr.appendChild(m_menu_td);
m_menu_tbody.appendChild(m_menu_tr);
m_menu_tr=menu_createElement(d_namespace,'tr');
m_menu_td=menu_createElement(d_namespace,'td');
var m_menu_dl=menu_createElement(d_namespace,'dl');
var m_patt=new RegExp();
m_patt.compile('<abbr +title="([^"]+)">([^<]+)</abbr>','i');
function menu_link(href,text){
var m_a=menu_createElement(d_namespace,'a');
var m_r=m_a;
if(href.substring(0,4)=='RSS;'){
href=href.substring(4);
var rssref=href;
var rssquery='';
var len=rssref.indexOf('#');
if(len>0)
rssref=rssref.substring(0,len);
len=rssref.indexOf('?');
if(len>0){
rssref=rssref.substring(0,len);
rssquery=rssref.substring(len);}
var beg=rssref.lastIndexOf('/');
if(beg<0)
beg=0;
len=rssref.indexOf('.',beg);
if(len>0){
var suff=rssref.substring(len+1);
rssref=rssref.substring(0,len);
if(suff=='jxsl')
rssref=rssref+'.rss.jxsl'+rssquery
else
rssref=rssref+'.rss.xml';}
menu_setAttribute(m_a,null,'href',rssref);
menu_setAttribute(m_a,null,'class','rsslink');
m_a.appendChild(document.createTextNode('RSS'));
m_r=menu_createElement(d_namespace,'span');
m_r.appendChild(m_a);
m_r.appendChild(document.createTextNode('\xA0'));
m_a=menu_createElement(d_namespace,'a');
m_r.appendChild(m_a);}
if(href==m_this)
menu_setAttribute(m_a,null,'href','#');
else if(href.charAt(m_this.length)=='#'
&&href.substring(0,m_this.length)==m_this)
menu_setAttribute(m_a,null,'href',href.substring(m_this.length));
else
menu_setAttribute(m_a,null,'href',href);
RegExp.multiline=true;
while(m_patt.exec(text)){
if(RegExp.leftContext!='')
m_a.appendChild(document.createTextNode(RegExp.leftContext));
var m_abbr=menu_createElement(d_namespace,'abbr');
menu_setAttribute(m_abbr,null,'title',RegExp.$1);
m_abbr.appendChild(document.createTextNode(RegExp.$2));
m_a.appendChild(m_abbr);
text=RegExp.rightContext;}
if(text!='')
m_a.appendChild(document.createTextNode(text));
return m_r;}
function m_item(m_menu_dl,href,text){
var m_dt=menu_createElement(d_namespace,'dt');
var m_dt_strong=menu_createElement(d_namespace,'strong');
m_dt_strong.appendChild(menu_link(href,text));
m_dt.appendChild(m_dt_strong);
m_menu_dl.appendChild(m_dt);}
function m_searchitem(m_menu_dl){
var m_menu_search_dd=menu_createElement(d_namespace,'dd');
var m_menu_search_form=menu_createElement(d_namespace,'form');
menu_setAttribute(m_menu_search_form,null,'class','compact');
menu_setAttribute(m_menu_search_form,null,'action','http://potoc.dandasparks.org.uk/gif/search.jxsl');
menu_setAttribute(m_menu_search_form,null,'method','get');
var m_menu_search_div=menu_createElement(d_namespace,'div');
var m_menu_search_small=menu_createElement(d_namespace,'small');
menu_setAttribute(m_menu_search_small,null,'style','white-space:nowrap');
var m_menu_search_input;
m_menu_search_input=menu_createElement(d_namespace,'input');
menu_setAttribute(m_menu_search_input,null,'name','query');
menu_setAttribute(m_menu_search_input,null,'value','');
menu_setAttribute(m_menu_search_input,null,'class','xmiddle');
menu_setAttribute(m_menu_search_input,null,'size','20');
menu_setAttribute(m_menu_search_input,null,'style','width:90%');
m_menu_search_small.appendChild(m_menu_search_input);
m_menu_search_small.appendChild(document.createTextNode(' '));
m_menu_search_input=menu_createElement(d_namespace,'input');
menu_setAttribute(m_menu_search_input,null,'class','xmiddle');
menu_setAttribute(m_menu_search_input,null,'type','image');
menu_setAttribute(m_menu_search_input,null,'src','search-go.gif');
menu_setAttribute(m_menu_search_input,null,'alt','search');
menu_setAttribute(m_menu_search_input,null,'title','search');
m_menu_search_small.appendChild(m_menu_search_input);
m_menu_search_input=menu_createElement(d_namespace,'input');
menu_setAttribute(m_menu_search_input,null,'name','origin');
menu_setAttribute(m_menu_search_input,null,'type','hidden');
menu_setAttribute(m_menu_search_input,null,'value',m_this);
m_menu_search_small.appendChild(m_menu_search_input);
m_menu_search_input=menu_createElement(d_namespace,'input');
menu_setAttribute(m_menu_search_input,null,'name','base');
menu_setAttribute(m_menu_search_input,null,'type','hidden');
menu_setAttribute(m_menu_search_input,null,'value','http://www.potoc.dandasparks.org.uk/gif/');
m_menu_search_small.appendChild(m_menu_search_input);
m_menu_search_div.appendChild(m_menu_search_small);
m_menu_search_form.appendChild(m_menu_search_div);
m_menu_search_dd.appendChild(m_menu_search_form);
m_menu_dl.appendChild(m_menu_search_dd);}
function m_subitems(m_menu_dl){
var inx;
var href,text,navsep;
var m_dd=menu_createElement(d_namespace,'dd');
var m_dd_small=menu_createElement(d_namespace,'small');
for(inx=1;inx<arguments.length;inx+=3){
if(inx>1){
navsep=arguments[inx-1];
if(navsep!=null){
var m_dd_span=menu_createElement(d_namespace,'span');
menu_setAttribute(m_dd_span,null,'class','nospeak');
m_dd_span.appendChild(document.createTextNode('\xA0'+navsep+' '));
m_dd_small.appendChild(m_dd_span);}
else{
m_dd.appendChild(m_dd_small);
m_menu_dl.appendChild(m_dd);
m_dd=menu_createElement(d_namespace,'dd');
m_dd_small=menu_createElement(d_namespace,'small');}}
href=arguments[inx];
text=arguments[inx+1];
m_dd_small.appendChild(menu_link(href,text));}
m_dd.appendChild(m_dd_small);
m_menu_dl.appendChild(m_dd);}
var m_jxsl=/\.jxsl(\?[^#]*)?(#.*)?$/.test(m_this);
if(!m_jxsl)
m_item(m_menu_dl,'http://potoc.dandasparks.org.uk/gif/search.jxsl?base=http%3A%2F%2Fwww.potoc.dandasparks.org.uk%2Fgif%2F&origin='+m_this,
'Search');
if(!m_jxsl)
m_searchitem(m_menu_dl);
if(!m_jxsl)
m_subitems(m_menu_dl,
'http://potoc.dandasparks.org.uk/gif/quicksearch.jxsl?query=POTOC&base=http%3A%2F%2Fwww.potoc.dandasparks.org.uk%2Fgif%2F&origin='+m_this,
'About POTOC','\u2022',
'http://potoc.dandasparks.org.uk/gif/quicksearch.jxsl?query=areas&base=http%3A%2F%2Fwww.potoc.dandasparks.org.uk%2Fgif%2F&origin='+m_this,
'Areas','\u2022',
'http://potoc.dandasparks.org.uk/gif/quicksearch.jxsl?query=juniors&base=http%3A%2F%2Fwww.potoc.dandasparks.org.uk%2Fgif%2F&origin='+m_this,
'Juniors',null,
'RSS;http://potoc.dandasparks.org.uk/gif/quickresults.jxsl?base=http%3A%2F%2Fwww.potoc.dandasparks.org.uk%2Fgif%2F&origin='+m_this,
'Recent Results',null,
'RSS;http://potoc.dandasparks.org.uk/gif/recent.jxsl?base=http%3A%2F%2Fwww.potoc.dandasparks.org.uk%2Fgif%2F&origin='+m_this,
'Recently Changed Pages');
m_item(m_menu_dl,'../','POTOC\xA0home\xA0page');
m_item(m_menu_dl,'2010-08-15.results.htm','Biddulph Grange Country Park results');
m_item(m_menu_dl,'RSS;events.html','POTOC\xA0fixtures\xA0list');
m_subitems(m_menu_dl,
'events.html#LocalEvents','POTOC informal\xA0events','\u2022',
'events.html#NextLocalEvent','next\xA0informal event',null,
'events.html#Results','POTOC event results');
m_item(m_menu_dl,'http://www.britishorienteering.org.uk/event/findevent.php',
'<abbr title="British Orienteering Federation">BO</abbr>\xA0fixtures\xA0list');
m_subitems(m_menu_dl,
'http://www.walton-chasers.co.uk/fixtures.html',
'<abbr title="Walton Chasers Orienteering Club">WCH</abbr>','\u2022',
'http://www.wrekinorienteers.co.uk/fixtures.html',
'<abbr title="Wrekin Orienteers">WRE</abbr>','\u2022',
'http://www.deeside-orienteering-club.org.uk/events/club+events.htm',
'<abbr title="Deeside Orienteering Club">DEE</abbr>','\u2022',
'http://www.mdoc.org.uk/fixtures_frame.htm',
'<abbr title="Manchester and District Orienteering Club">MDOC</abbr>','\u2022',
'http://www.dvo.org.uk/fixtures.asp',
'<abbr title="Derwent Valley Orienteers">DVO</abbr>');
m_item(m_menu_dl,'location.html#Who','Who\xA0are\xA0we?');
m_subitems(m_menu_dl,
'contacts.html#Contact','Contacting POTOC');
m_item(m_menu_dl,'location.html#Where','Where\xA0are\xA0we?');
m_subitems(m_menu_dl,
'location.html#Maps',
'\u2026 on maps of Britain and North Staffordshire');
m_item(m_menu_dl,'location.html#What',
'What\xA0do\xA0we\xA0do?');
m_subitems(m_menu_dl,
'documents.html','Downloadable Documents',null,
'gfx-index.html','Photograph Index');
m_item(m_menu_dl,'mappedareas.html#Areas',
'Where\xA0do\xA0we\xA0orienteer?');
m_subitems(m_menu_dl,
'mappedareas.html#PermCourses',
'\u2026 including permanent courses');
m_item(m_menu_dl,'http://www.britishorienteering.org.uk/newto/index.php',
'What\xA0is\xA0orienteering?');
m_subitems(m_menu_dl,
'http://www.bbc.co.uk/stoke/content/articles/2004/09/16/sport_orienteering_feature.shtml',
'An introduction to Orienteering',null,
'events.html#LocalEvents','How can I try it?');
m_item(m_menu_dl,'http://www.britishorienteering.org.uk/',
'British\xA0Orienteering Federation');
m_subitems(m_menu_dl,
'http://www.bsoa.org/',
'British\xA0Schools Orienteering Association',null,
'http://www.wmoa.org.uk/',
'West Midlands Orienteering Association',null,
'http://www.coboc.org.uk/',
'<abbr title="City of Birmingham Orienteering Club">COBOC</abbr>','\u2022',
'http://www.harlequins.org.uk/',
'<abbr title="Harlequins Orienteering Club">HOC</abbr>','\u2022',
'http://www.octavian-droobers.org/',
'<abbr title="Octavian Droobers Orienteering Club">OD</abbr>','\u2022',
'../','<abbr title="Potteries Orienteering Club">POTOC</abbr>','\u2022',
'http://www.walton-chasers.co.uk/',
'<abbr title="Walton Chasers Orienteering Club">WCH</abbr>','\u2022',
'http://www.wrekinorienteers.co.uk/',
'<abbr title="Wrekin Orienteers">WRE</abbr>','\u2022',
'http://www.sport.bham.ac.uk/clubs/orienteering.shtml',
'<abbr title="Birmingham University Orienteering Club">BUOC</abbr>','\u2022',
'http://www.uwoc.co.uk/home/',
'<abbr title="University of Warwick Orienteering Club">UWOC</abbr>');
m_item(m_menu_dl,'dataprotection.html',
'POTOC\xA0and Data\xA0Protection');
m_subitems(m_menu_dl,
'privacypolicy.html','Web Privacy Policy',null,
'contacts.html#C-DP','Data Protection Officer',null,
'contacts.html#C-WS','Webmaster');
m_menu_td.appendChild(m_menu_dl);
m_menu_tr.appendChild(m_menu_td);
m_menu_tbody.appendChild(m_menu_tr);
m_menu_table.appendChild(m_menu_tbody);
m_menu_div.appendChild(m_menu_table);
m_menu.appendChild(m_menu_div);
m_parent.appendChild(m_menu);
var d_a_list=menu_getElementsByTagName(d_namespace,'a');
for(inx=0;inx<d_a_list.length;inx+=1){
var d_a=d_a_list[inx];
if(menu_getAttribute(d_a,null,'rel')=='contents'){
menu_setAttribute(d_a,null,'onclick','return menu_show();')}}
menu_show_props=m_show.style;
menu_hide_props=m_hide.style;
menu_icon_props=m_icon.style;
menu_props=m_menu.style;
menu_ready=true;}
if(window.addEventListener)
window.addEventListener('load',menu_init,true)
else
window.attachEvent('onload',menu_init);}
// |# End: menu.m4js
// |# $Id: stripjs.c 1.7 2009/05/10 13:14:35 daves Exp $
