// define list of pages for the menu
var menuitems=new Array;

// show or hide|pageurl|pagetitle
menuitems[0]='1|membership|Club Membership';
menuitems[1]='0|constitution|Constitution';

//menuitems[2]='0|diary|Diary';

menuitems[2]='1|cloth|Club Clothing';
menuitems[3]='1|docs|Policies & Documents';
menuitems[4]='1|flatwaterracing|Flat Water Racing';
menuitems[5]='1|buyandsell|Buy and Sell';
menuitems[6]='0|hareandhounds|Hare & Hounds';
menuitems[7]='0|media|Media Stories';
menuitems[8]='1|people|People';
menuitems[9]='1|galleries|Picture Galleries';
menuitems[10]='1|polo|Polo';
menuitems[11]='1|pool|Pool Sessions';
menuitems[12]='0|sketchbook|Sketchbook';
menuitems[13]='1|training|Training';
menuitems[14]='1|trips|Trips';
menuitems[15]='1|trophies|Virtual trophy cabinet';
menuitems[16]='1|waterfront|Waterfront Newsletters';
menuitems[17]='1|youth|Youth Section';


//
// email definitions moved to mailers.js - edit the new file instead of this one.
//

// month names
GM_months=new Array('January','February','March','April','May','June','July',
  'August','September','October','November','December');

// day names
GM_days=new Array('1st', '2nd', '3rd', '4th', '5th', '6th', '7th', '8th', '9th', '10th',
  '11th', '12th', '13th', '14th', '15th', '16th', '17th', '18th', '19th', '20th',
  '21st', '22nd', '23rd', '24th', '25th', '26th', '27th', '28th', '29th', '30th', '31st');

// number of milliseconds in a week (needed to see if we're within 7 days of a pool session)
GM_week=1000*60*60*24*6;
GM_dow=new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');

function b3c_StartPageBuilder(PTitle){

document.write('<div style=float:right;display:none>');

google_ad_client = "pub-3436725565366954";
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = "120x600_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "336699";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_text = "000000";
google_color_url = "008000";
google_ui_features = "rc:6";

(function(){
function n(c){return c!=null?'"'+c+'"':'""'}function J(c){if(typeof encodeURIComponent=="function"){return encodeURIComponent(c)}else{return escape(c)}}function d(c,a){if(a){window.google_ad_url+="&"+c+"="+a}}function i(c,a){if(a){d(c,J(a))}}function m(c,a,b){if(a&&typeof a=="object"){a=a[b%a.length]}d("color_"+c,a)}function N(c,a){var b=c.screen,e=navigator.javaEnabled(),f=-a.getTimezoneOffset();if(b){d("u_h",b.height);d("u_w",b.width);d("u_ah",b.availHeight);d("u_aw",b.availWidth);d("u_cd",b.colorDepth)}d("u_tz",
f);d("u_his",history.length);d("u_java",e);if(navigator.plugins){d("u_nplug",navigator.plugins.length)}if(navigator.mimeTypes){d("u_nmime",navigator.mimeTypes.length)}}function E(c){c=c.toLowerCase();if(c.substring(0,3)!="ca-"){c="ca-"+c}return c}function V(c,a,b,e){b=b.substring(0,2000);b=b.replace(/%\w?$/,"");if(c.google_ad_output=="js"&&(c.google_ad_request_done||c.google_radlink_request_done)){a.write('<script language="JavaScript1.1" src='+n(b)+"><\/script>")}else if(c.google_ad_output=="html"){if(c.name!=
"google_ads_frame"){if(e!=null){a.write('<div id="'+e+'">')}a.write('<iframe name="google_ads_frame" width='+n(c.google_ad_width)+" height="+n(c.google_ad_height)+" frameborder="+n(c.google_ad_frameborder)+" src="+n(b)+' marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no">');a.write("</iframe>");if(e!=null){a.write("</div>")}}}else if(c.google_ad_output=="textlink"){a.write('<script language="JavaScript1.1" src='+n(b)+"><\/script>")}}function T(c){var a=
null;c.google_ad_frameborder=a;c.google_ad_format=a;c.google_page_url=a;c.google_language=a;c.google_gl=a;c.google_country=a;c.google_region=a;c.google_city=a;c.google_hints=a;c.google_safe=a;c.google_encoding=a;c.google_ad_output=a;c.google_max_num_ads=a;c.google_ad_channel=a;c.google_contents=a;c.google_alternate_ad_url=a;c.google_alternate_color=a;c.google_color_bg=a;c.google_color_text=a;c.google_color_link=a;c.google_color_url=a;c.google_color_border=a;c.google_color_line=a;c.google_reuse_colors=
a;c.google_adtest=a;c.google_kw_type=a;c.google_kw=a;c.google_num_radlinks=a;c.google_max_radlink_len=a;c.google_rl_filtering=a;c.google_rl_mode=a;c.google_rt=a;c.google_rl_dest_url=a;c.google_num_radlinks_per_unit=a;c.google_ad_type=a;c.google_image_size=a;c.google_feedback=a;c.google_skip=a;c.google_page_location=a;c.google_referrer_url=a;c.google_ad_region=a;c.google_ad_section=a;c.google_bid=a;c.google_cpa_choice=a;c.google_cust_age=a;c.google_cust_gender=a;c.google_cust_interests=a;c.google_cust_id=
a;c.google_cust_job=a;c.google_cust_u_url=a;c.google_cust_l=a;c.google_cust_lh=a;c.google_cust_ch=a;c.google_ed=a;c.google_targeting=a;c.google_ad_host=a;c.google_ad_slot=a;c.google_ad_override=a;c.google_ui_features=a}function H(c){var a=null,b=window,e=document,f=new Date,g=f.getTime(),h=b.google_ad_format;if(b.google_cpa_choice){b.google_ad_url="http://pagead2.googlesyndication.com/cpa/ads?";b.google_ad_url+="client="+escape(E(b.google_ad_client));b.google_ad_region="_google_cpa_region_";d("cpa_choice",
b.google_cpa_choice);if(typeof e.characterSet!="undefined"){i("oe",e.characterSet)}else if(typeof e.charset!="undefined"){i("oe",e.charset)}}else{b.google_ad_url="http://pagead2.googlesyndication.com/pagead/ads?";b.google_ad_url+="client="+escape(E(b.google_ad_client))}d("host",b.google_ad_host);var j=b.google_num_slots_by_client,C=b.google_num_slots_by_channel,l=b.google_prev_ad_formats_by_region;if(b.google_ad_region==a&&b.google_ad_section!=a){b.google_ad_region=b.google_ad_section}var k=b.google_ad_region==
a?"":b.google_ad_region,w=false;if(h){w=h.indexOf("_0ads")>0}if(w){if(b.google_num_0ad_slots){b.google_num_0ad_slots=b.google_num_0ad_slots+1}else{b.google_num_0ad_slots=1}if(b.google_num_0ad_slots>3){return false}}else if(!b.google_cpa_choice){if(b.google_num_ad_slots){b.google_num_ad_slots=b.google_num_ad_slots+1}else{b.google_num_ad_slots=1}if(b.google_num_slots_to_rotate){l[k]=a;if(b.google_num_slot_to_show==a){b.google_num_slot_to_show=g%b.google_num_slots_to_rotate+1}if(b.google_num_slot_to_show!=
b.google_num_ad_slots){return false}}else if(b.google_num_ad_slots>3&&k==""){return false}}d("dt",f.getTime());d("hl",b.google_language);if(b.google_country){d("gl",b.google_country)}else{d("gl",b.google_gl)}d("gr",b.google_region);i("gcs",b.google_city);i("hints",b.google_hints);d("adsafe",b.google_safe);d("oe",b.google_encoding);d("lmt",b.google_last_modified_time);i("alternate_ad_url",b.google_alternate_ad_url);d("alt_color",b.google_alternate_color);d("skip",b.google_skip);d("targeting",b.google_targeting);
var p=b.google_ad_client;if(!j[p]){j[p]=1;j.length+=1}else{j[p]+=1}if(l[k]){i("prev_fmts",l[k].toLowerCase());if(j.length>1){d("slot",j[p])}}if(h&&!b.google_ad_slot){i("format",h.toLowerCase());if(l[k]){l[k]=l[k]+","+h}else{l[k]=h}}d("num_ads",b.google_max_num_ads);d("output",c!=a?c:b.google_ad_output);d("adtest",b.google_adtest);if(b.google_ad_slot){d("slotname",b.google_ad_slot)}i("correlator",b.google_correlator);if(b.google_ad_channel){var x=b.google_ad_channel;i("channel",x);var y="",z=x.split("+");
for(var s=0;s<z.length;s++){var t=z[s];if(!C[t]){C[t]=1}else{y+=t+"+"}}i("pv_ch",y)}i("url",b.google_page_url);m("bg",b.google_color_bg,g);m("text",b.google_color_text,g);m("link",b.google_color_link,g);m("url",b.google_color_url,g);m("border",b.google_color_border,g);m("line",b.google_color_line,g);if(b.google_reuse_colors)d("reuse_colors",1);else d("reuse_colors",0);d("kw_type",b.google_kw_type);i("kw",b.google_kw);i("contents",b.google_contents);d("num_radlinks",b.google_num_radlinks);d("max_radlink_len",
b.google_max_radlink_len);d("rl_filtering",b.google_rl_filtering);d("rl_mode",b.google_rl_mode);d("rt",b.google_rt);i("rl_dest_url",b.google_rl_dest_url);d("num_radlinks_per_unit",b.google_num_radlinks_per_unit);d("ad_type",b.google_ad_type);d("image_size",b.google_image_size);d("region",b.google_ad_region);d("feedback_link",b.google_feedback);i("ref",b.google_referrer_url);i("loc",b.google_page_location);d("bid",b.google_bid);d("cust_age",b.google_cust_age);d("cust_gender",b.google_cust_gender);
d("cust_interests",b.google_cust_interests);d("cust_id",b.google_cust_id);d("cust_job",b.google_cust_job);d("cust_u_url",b.google_cust_u_url);d("cust_l",b.google_cust_l);d("cust_lh",b.google_cust_lh);d("cust_ch",b.google_cust_ch);d("ed",b.google_ed);i("ui",b.google_ui_features);if(F(b,e)&&e.body){var A=e.body.scrollHeight,B=e.body.clientHeight;if(B&&A){i("cc",Math.round(B*100/A))}}d("google_ad_override",b.google_ad_override);d("flash",b.google_flash_version);N(b,f);return true}function G(){var c=
window,a=document,b=false;if(O(c.google_ad_output,c.google_ad_client)&&!U()){b=true}var e=b?"json_html":null;if(!H(e)){return}if(!b){V(c,a,c.google_ad_url,null)}else{S()}T(c)}function K(c,a,b){G();return true}function F(c,a){return c.top.location==a.location}function D(c,a){var b=a.documentElement;if(F(c,a))return false;if(c.google_ad_width&&c.google_ad_height){var e=1,f=1;if(c.innerHeight){e=c.innerWidth;f=c.innerHeight}else if(b&&b.clientHeight){e=b.clientWidth;f=b.clientHeight}else if(a.body){e=
a.body.clientWidth;f=a.body.clientHeight}if(f>2*c.google_ad_height||e>2*c.google_ad_width){return false}}return true}function P(c){var a=window,b=document,e=b.location,f=b.referrer,g=null,h=a.onerror;a.onerror=c;if(a.google_ad_frameborder==g){a.google_ad_frameborder=0}if(a.google_ad_output==g){a.google_ad_output="html"}if(a.google_ad_format==g&&a.google_ad_output=="html"){a.google_ad_format=a.google_ad_width+"x"+a.google_ad_height}if(a.google_page_url==g){a.google_page_url=f;if(!D(a,b)){a.google_page_url=
e;a.google_last_modified_time=Date.parse(b.lastModified)/1000;a.google_referrer_url=f}}else{a.google_page_location=f;if(!D(a,b)){a.google_page_location=e}}if(a.google_num_slots_by_channel==g){a.google_num_slots_by_channel=[]}if(a.google_num_slots_by_client==g){a.google_num_slots_by_client=[]}if(a.google_prev_ad_formats_by_region==g){a.google_prev_ad_formats_by_region=[]}if(a.google_correlator==g){a.google_correlator=(new Date).getTime()}if(a.google_adslot_loaded==g){a.google_adslot_loaded={}}if(a.google_adContentsBySlot==
g){a.google_adContentsBySlot={}}if(a.google_flash_version==g){a.google_flash_version=I().toString()}a.onerror=h}function o(c){if(c in q){return q[c]}return q[c]=navigator.userAgent.toLowerCase().indexOf(c)!=-1}var q={};function r(){return o("msie")&&!window.opera}function u(){return o("safari")}function L(){var c=navigator.userAgent,a=c.indexOf("MSIE ");if(a==-1){return 0}else{return parseFloat(c.substring(a+5,c.indexOf(";",a)))}}function U(){if(r()){var c=L();return c<=5}else if(o("firefox")){var a=
navigator.userAgent.indexOf("Firefox")+8,b=parseInt(navigator.userAgent.charAt(a)),e=navigator.userAgent.slice(a);return b<1}else if(u()){var a=navigator.userAgent.indexOf("Safari")+7,e=navigator.userAgent.slice(a),f=parseInt(e);return f<412}else if(window.opera!=null){var a=navigator.userAgent.indexOf("Opera")+6,e=navigator.userAgent.slice(a),b=parseInt(e);return b<9}else if(!r()&&!u()&&o("mozilla")){var a=navigator.userAgent.indexOf("Netscape")+9,e=navigator.userAgent.slice(a),b=parseInt(e);return b<
7}else{return true}}function O(c,a){if(c!="html"){return false}var b={};b["ca-pub-8954402009499768"]=true;return b[a]!=null}function S(){var c=window;d("impl","s");d("callback","_google_setAdContentsBySlotForSync");document.write("<script src = '"+c.google_ad_url+"'><\/script>")}window.google_createDivWithContent=function(c){var a=window,b="google_ads_div_"+c,e="<div id="+b+">",f=a.google_adContentsBySlot[c];if(f==null){return}e+=f._html_;e+="\n</div>\n";document.write(e)};window.google_createDOMIframe=
function(c,a,b,e){var f=document.getElementsByTagName("script"),g=f[f.length-1],h=document.createElement("iframe");h.id="google_ads_iframe_"+c;h.width=a;h.height=b;h.vspace=0;h.hspace=0;h.allowTransparency="true";h.scrolling="no";h.marginWidth=0;h.marginHeight=0;h.frameBorder=0;h.style.border=0;g.parentNode.appendChild(h);h.contentWindow.document.write(e);h.contentWindow.document.close()};window.google_createiframe=function(c,a,b,e,f){var g="google_ads_div_"+c,h="google_ads_iframe_"+c,j="<div id="+
g+">";j+="<iframe id="+h+' width="'+e+'" height="'+f+'" vspace="0" hspace="0" allowtransparency="true" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" style="border:0px;" src="'+a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\"/g,"&quot;")+'"';j+=' onload="'+b+'"';j+="></iframe></div>";document.write(j)};var v="google_ads_iframe_".length;function M(c){var a=c.getAttribute("id"),b=a.substr(v,a.length-v);return b}window._google_syncAdSlotLoaded=function(c){var a=
M(c);window.google_loadiframe(c)};window._google_setAdContentsBySlotForSync=function(c){var a=window;for(var b in c){var e=c[b];a.google_adContentsBySlot[b]=e;if(e==null||e._empty_){}else if(e._expandable_){a.google_createDivWithContent(b)}else{if(navigator.userAgent.indexOf("MSIE ")>0){a.google_adslot_loaded[b]=false;var f="window._google_syncAdSlotLoaded(this);";a.google_createiframe(b,"about:blank",f,e._width_,e._height_)}else{a.google_createDOMIframe(b,e._width_,e._height_,e._html_)}}}};function R(c){var a=
{},b=c.split("?"),e=b[b.length-1].split("&");for(var f=0;f<e.length;f++){var g=e[f].split("=");if(g[0]){try{a[g[0].toLowerCase()]=g.length>1?(window.decodeURIComponent?decodeURIComponent(g[1].replace(/\+/g," ")):unescape(g[1])):""}catch(h){}}}return a}function Q(){var c=window,a=R(document.URL);if(a["google_ad_override"]){c.google_ad_override=a["google_ad_override"]}}function I(){var c=0;if(navigator.plugins&&navigator.mimeTypes.length){var a=navigator.plugins["Shockwave Flash"];if(a&&a.description){c=
a.description.replace(/([a-zA-Z]|\s)+/,"").split(".")[0]}}else if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){c=3;var b=1;while(b){try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+(c+1));c++}catch(e){b=null}}}else if(r()){try{var b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(e){try{var b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");c=6;b.AllowScriptAccess="always"}catch(e){if(c==6){return c}}try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(e){}}if(b!=
null){c=b.GetVariable("$version").split(" ")[1].split(",")[0]}}return c}Q();P(K);G();
})()

document.write('</div>');

  document.write(b3c_StartPageBuilderHTML(PTitle));

}



var ClusterMap='<div class=ClusterMapDiv><a target=_blank href="http://www2.clustrmaps.com/counter/maps.php?url=http://b3c.org.uk/home/&type=small&clusters=no&map=world" \
id="clustrMapsLink"><img width=134 height=106 src="http://www2.clustrmaps.com/counter/index2.php?url=http://b3c.org.uk/home/" \
style="border:1px solid;" alt="Locations of visitors to this site" title="Locations of visitors to this site" \
id="clustrMapsImg" onError="this.onError=null; this.src=\'http://clustrmaps.com/images/clustrmaps-back-soon.jpg\'; \
document.getElementById(\'clustrMapsLink\').href=\'http://clustrmaps.com\'" /></a></div>';



function b3c_StartPageBuilderHTML(PTitle){

  html='<head><title>BCCC - ' + PTitle + '</title>';

  html+='<link rel="shortcut icon" href=/favicon.ico>';

  html+='<meta http-equiv=pragma content=no-cache>';

  html+='<meta http-equiv=expires content=-1>';

  html+='</head><link rel=stylesheet href=http://www.b3c.org.uk/b3c.css>';

  html+='<script src=/mailers.js></script>';


  if (PTitle=="Search Engine") {

    html+="<body id=body onLoad=sf()>";

  }

  html+='<div id=page><div id=header>BCCC - ' + PTitle + '</div>';



  if (location.href.indexOf('www.google.com')>-1) {

    html+='<div id=navbar><div><img src=http://www.b3c.org.uk/search/page_ident.jpg></div>';

  } else {

    html+='<div id=navbar><div><img src=page_ident.jpg ondragstart="return false"></div>';

  }

  html+='<div id=clubmark>';
  html+='<a title="Sport England CLUBMARK" target=_blank href=http://www.clubmark.org.uk><img src=/images/clubmark.png></a><br />';
  html+='<a title="British Canoe Union" target=_blank href=http://www.bcu.org.uk><img src=/images/canoe-england-logo-for-web.jpg></a><br />';
  html+='<a title="River Access Campaign" target=_blank href=http://www.riveraccess.org><img src=/images/River-Access-Logo-web.jpg></a></div>';

  html+='<div id=navlinks><a class=navlink href=http://www.b3c.org.uk/home/>Home</a><br>';



  for (i in menuitems) {

    var ms=menuitems[i].split('|');

    if (ms[0]=='1') html+='<a class=navlink href=http://www.b3c.org.uk/' + ms[1] + '/>' + ms[2] + '</a><br>';

  }



  <!-- html+='<a class=navlink target=_blank href=http://www.b3c-youth.org.uk/>Youth Site</a><br>';-->

  html+='<div class=address>Basingstoke Canal Canoe Club<br>';

  html+='Canal Centre<br>';

  html+='Mytchett Place Road<br>';

  html+='Mytchett<br>';

  html+='Surrey<br>';

  html+='GU16 6DD<p>';

  <!-- html+='Tel: 01252 629800'; -->

  html+='<p><a target=_blank href="http://www.streamline.net/?aff=944a4504ec94ca015828302cd84c2bbe">';

  html+='<img src="http://www.streamline.net/graphics/powered_by.gif" alt="Streamline.Net" border="0"></A>';
  html+='<br /><br /><a title="Internet Content Rating Association" href=http://www.icra.org target=_blank><img border=0 src=/images/icra.gif></a>';
  html+=ClusterMap;
  html+='</p></div></div></div><div id=content><table><tr><td>'; 


  return(html);

}



function b3c_FinishPageBuilder(){

  document.write(b3c_FinishPageBuilderHTML());


}

function sd() {
    alert(document.getElementsByTagName('body')[0].innerHTML);
}

function b3c_FinishPageBuilderHTML(){


    h='</td></tr></table></div><div id=footer>';
    h+='<a class=navlink href=#top>Top</a>';
    h+='<span class=blsq><a class=navlink target=_blank href=mailto:membership@b3c.org.uk';
    h+='?subject=Canoeing%20Enquiry%20via%20www.b3c.org.uk>Contact&nbsp;Us</a></span> ';
    h+='<span class=blsq>Basingstoke Canal Canoe Club &copy; 2004-2009</span> ';
    h+='<span class=blsq>All Rights Reserved</span> ';
    h+='<span class=blsq><a href=javascript:sd()>P</a>age Modified: '+document.lastModified+'</span></div></div>';
    h+='<head>';
    h+='<meta http-equiv=pragma content=no-cache>';
    h+='<meta http-equiv=expires content=-1>';
    h+='</head>';

google='<script type="text/javascript"><!--';
google+='google_ad_client = "pub-3436725565366954";';
google+='google_ad_width = 120;';
google+='google_ad_height = 240;';
google+='google_ad_format = "120x240_as";';
google+='google_ad_type = "text";';
google+='google_ad_channel ="";';
google+='google_color_border = "000000";';
google+='google_color_bg = "F0F0F0";';
google+='google_color_link = "0000FF";';
google+='google_color_text = "000000";';
google+='google_color_url = "008000";';
google+='//--></script>';
google+='<script type="text/javascript"';
google+='  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">';
google+='</script>';

    return(h);

}





function b3c_CheckForPoolSessionThisWeek(pool_year, pool_dates, link) {
//
// loop thru the above month/day pairs checking if any are within the next 6 days.
//
  var cd=new Date();
  cd.setHours(0);
  cd.setMinutes(0);
  cd.setSeconds(0);
  cd.setMilliseconds(0);
  for (i=0; i<pool_dates.length; i+=2) {
    td=new Date(pool_year, pool_dates[i]-1 /*months are month-1*/, pool_dates[i+1]);
    dif=td.getTime()-cd.getTime();
    if ( (dif > 0) && (dif < GM_week)  ) {
      document.write('<div class=poolalert>Pool Session this Sunday evening - ' +
        GM_months[pool_dates[i]-1] + ' ' + GM_days[pool_dates[i+1]-1]);
        if (link==1) document.write('&nbsp;<a href=/pool><font color=yellow>About our pool sessions</font></a>');
        document.write('</div><br>');
    } else if (dif==0) {
      document.write('<div class=poolalert><font size=+1>Pool Session TONIGHT, 4:30pm until 6:30pm.</font>');
        if (link==1) document.write('&nbsp;<a href=/pool><font color=yellow>About our pool sessions</font></a>');
        document.write('</div><br>');
    }
  }
}


function b3c_EventDateList(_title, _year, _dates) {
  // get todays date i.e. now.
  cd=new Date();

//  if (cd.getFullYear() == _year) {
    document.write('<div class=panel1><div class=pheader>'+_title+' Dates for '+_year);
    document.write('</div><div class=pcontent>');
    for (i=0; i<_dates.length; i+=2) {
      td=new Date(_year, _dates[i]-1 /*months are month-1*/, _dates[i+1]);
      if (td>=cd) {
        document.write(GM_months[_dates[i]-1] + ' ' + GM_days[_dates[i+1]-1] + ' (' + GM_dow[td.getDay()].substring(0,3) + ')<br />');
      }
    }
    document.write('</div></div>');
//  }
}



function b3c_mailto(ab, link) {
  addr=mailers[ab];
  if (addr!=undefined) {
    as=addr.split('|');
    if (link==undefined) link=as[0];
    document.write('<a href="mailto:' + as[1] + '@' + as[2] + '?subject=BCCC mail via website">' + link + '<img src=/images/email.gif border=0></a>');
  } else {
    document.write('<b>MailErr:' + ab + '?</b>');
  }
}



function popwin(page) {

  window.open(page,'','width=550,height=550,scrollbars=no,toolbar=no');

  return false;

}

function popslideshow(url) {
  window.open(url,'','fullscreen=yes,scrollbars=no,toolbar=no');
  return false;
}


function b3c_map(mapname, linktext) {

  document.write('<a href=. onClick="return popwin(');

  document.write("'../maps/index.php?mapname=" + mapname + "')");

  document.write('">' + linktext + '<img border=0 src=/images/newwin.gif></a>');

}



function b3c_MakePeopleGrid(people_array) {

  document.write('<table>');

  for (i in people_array) {

    pas=people_array[i].split('|');

    document.write('<tr><td class=people><img src=' + pas[0] + '.jpg></td><td class=people><b>'

      + pas[1] + '</b><a name=' + pas[0] + '></a><br>' + pas[2] + '</div></td></tr>');

  }

  document.write('</table>');

}



function b3c_Inset(_header, _content) {

    h='<div class=panel1>';
    h+='<div class=pheader>' + _header + '</div>';
    h+='<div class=pcontent>' + _content + '</div>';
    h+='</div>';

    document.write(h);

}



function b3c_RenderSlalomResultsTables(resar) {

  h=new String();

  for (i=0; i<resar.length; i++) {

    rs=resar[i].split('|');

    if (rs[0].charAt(0)=='>') {

      // start a new table and possibly finish a previous one

      if (h.length>0) {

        h=h+'</table><p>';

      }

      h=h+'<table class=result_table>';

      h=h+'<tr><th class=result_class colspan=5>' + rs[0].substr(1,1024);

      h=h+'</th><th colspan=2>First Run</th><th colspan=2>Second Run</th></tr>';

      h=h+'<tr><th>Pos</th><th>Bib</th><th>Name</th><th>Age</th><th>Club</th><th>Pen</th>';

      h=h+'<th>Time</th><th>Pen</th><th>Time</th><th>Total</th><th>Pnts</th></tr>';

      pc=0;

    } else if (rs.length>1) {

      // result row

      h=h+'<tr';

      if (rs[4].toUpperCase()=='BCCC') {

        h=h+' class=bccc';

      }

      h=h+'><td>' + rs[0] + '</td><td>' + rs[1] + '</td><td>' + rs[2] + '</td>';

      h=h+'<td>' + rs[3] + '</td><td>' + rs[4] + '</td><td>' + rs[5] + '</td>';

      h=h+'<td>' + rs[6] + '</td><td>' + rs[7] + '</td><td>' + rs[8] + '</td>';

      h=h+'<td>' + rs[9] + '</td><td>' + rs[10] + '</td></tr>';

      pc++;

    } else {

      // must be a promotion line

      if (pc==1) {

        pcstr='The above paddler is promoted to ' + rs[0];

      } else {

        pcstr='The above paddlers are promoted to ' + rs[0];

      }

      h=h+'<tr class=bold_blue><td colspan=11>' + pcstr + '</td></tr>';

    }

  }

  // finish last table definition

  h=h+'</table><p>';



  document.write(h);

}



function b3c_RenderHHResultsTables(resar) {

  h=new String();

  for (i=0; i<resar.length; i++) {

    rs=resar[i].split('|');

    if (rs[0].charAt(0)=='>') {

      // start a new table and possibly finish a previous one

      if (h.length>0) {

        h=h+'</table><p>';

      }

      h=h+'<table class=result_table>';

      h=h+'<tr><th class=result_class colspan=7>' + rs[0].substr(1,1024);

      h=h+'</th></tr>';

      h=h+'<tr><th>Pos</th><th>Name</th><th>Start</th><th>Split</th>';

      h=h+'<th>Finish</th><th>Time</th><th>Points</th></tr>';

      pc=0;

    } else if (rs.length>1) {

      // result row

      h=h+'<tr';

      if (rs[4].toUpperCase()=='BCCC') {

        h=h+' class=bccc';

      }

      h=h+'><td>' + rs[0] + '</td><td>' + rs[1] + '</td><td>' + rs[2] + '</td>';

      h=h+'<td>' + rs[3] + '</td><td>' + rs[4] + '</td><td>' + rs[5] + '</td>';

      h=h+'<td>' + rs[6] + '</td></tr>';

      pc++;

    } else {

      // must be a promotion line

      if (pc==1) {

        pcstr='The above paddler is promoted to ' + rs[0];

      } else {

        pcstr='The above paddlers are promoted to ' + rs[0];

      }

      h=h+'<tr class=bold_blue><td colspan=11>' + pcstr + '</td></tr>';

    }

  }

  // finish last table definition

  h=h+'</table><p>';



  document.write(h);

}



function sf() {

  document.gs.q.focus();

}



function b3c_RenderTripsTable() {

    curdate=new Date();
    curdate.setHours(0);
    curdate.setMinutes(0);
    curdate.setSeconds(0);
    curdate.setMilliseconds(0);

    h='<h3>Planned Trips</h3>';
    h+='<div class=yp><b>YP</b> Indicates that the trip is suitable for younger paddlers ';
    h+='with 2 star skills. If you are not sure please ask the organiser.</div>';
    h+='<div class=trip2days>Indicates a 2 day trip with one or two overnights.</div>';
    h+='<div class=trip3days>Indicates a 3 day trip with two or three overnights.</div>';
    h+='<p><table border=1 cellpadding=4>';
    h+='<tr><th>Date</th><th>Location</th><th>Organiser</th><th>Details</th></tr>';

    shown_current_date=0;

    for (i in _trips) {

        ts=_trips[i].split('|');

        yr='20' + ts[0].substr(0,2);

        mo=ts[0].substr(2,2);

        da=ts[0].substr(4,2);



    if (ts[0].length>6) {

      etrip=ts[0].substr(6,1);

    } else {

      etrip='';

    }



    tripdate=new Date(yr, mo-1, da, 0, 0, 0, 0);



    // date

    row='<td';



    if (etrip=='') {row+='>';}

    else if (etrip=='2') {row+=' class=trip2days>';}

    else if (etrip=='3') {row+=' class=trip3days>';}



    row+=GM_months[mo-1] + '&nbsp;' + GM_days[da-1] + '<br>' + yr + '</td>';



    // location and possible map link?

    row+='<td>' + ts[1];

    if (ts[2]!='') {

        mapurl="'/maps/index.html?" + ts[2] + "'";

        row+='<br><a href=. onClick="return popwin(' + mapurl + ')">Map<img border=0 src=/images/newwin.gif></a>';

    }

    row+='</td>';



    // organiser

    if (ts[3].charAt(0)==':') {

      ma=ts[3].split(':');

      row+='<td><script>b3c_mailto(\'' + ma[1] + '\')</script></td>';

    } else {

      row+='<td>' + ts[3] + '</td>';

    }



    // details

    if (ts[4].indexOf('YP')>0) {

      tdclass=' class=yp';

    } else tdclass='';

    row+='<td' + tdclass + '>' + ts[4] + '</td>';



    if (tripdate<curdate) {

  h+='<tr class=old_trip>' + row;

    } else {

  if (shown_current_date==0) {

    h+='<tr class=trips_to_come><td colspan=4>Today is ' +

      GM_dow[curdate.getDay()] +

      ' ' +

      GM_days[curdate.getDate()-1] +

      ' ' +

      GM_months[curdate.getMonth()] +

// +

//      ' ' +

//      curdate.getYear() +

      '</td></tr>';

    shown_current_date=1;

  }

       h+='<tr>' + row;

    }



    h+='</tr>';

  }



  h+='</table>';



  document.write(h);

}



function b3c_render_pixar_index(folder) {

  h ='<h3>';
  h+='Click a picture to view';
  h+='| <a href=. onClick="return popslideshow(' + "'/galleries/slideshow.php?folder=" + folder + "'" + ');">Slideshow</a>'
  h+='| <a href=/galleries>Galleries</a>';
  h+='</h3>';



  for (i in pixar) {

    h+='<img onClick=b3c_pix("' + i + '") class=iicon src="icons/' + pixar[i] + '" onmousedown="return false" ondragstart="return false"> ';

  }



  document.getElementById("pix").innerHTML=h;

}



function b3c_pix(ref) {

  var iref=parseInt(ref) + 1;

  var imax=pixar.length;



  h='<h3><a href=javascript:b3c_render_pixar_index()>Index</a> | ';



  if (ref > 0) {

    h+='<a href=javascript:b3c_pix(' + parseInt(ref - 1) + ')>Prev</a> | ';

  } else {

    h+='Prev | ';

  }



  if (iref < imax) {

    h+='<a href=javascript:b3c_pix(' + iref + ')>Next</a></h3>';

  } else {

    h+='Next</h3>';

  }



  for (i in pixar) {

    ir=parseInt(i) + 1;

    if (i!=ref) {

      h+='<a href=javascript:b3c_pix(' + i + ')>[' + ir + ']</a> ';

    } else {

      h+='<b>' + ir + '</b> ';

    }

  }



  h+='<br /><div class=imgHolder>';

  h+='<img class=i500 src="browse/' + pixar[ref] + '" onmousedown="return false" ondragstart="return false">';

  h+='</div>';



  //img=new Image();

  //img.src='browse/' + pixar[ref];



  //h+='<div style="width:' + img.width + ';';

  //h+='height:' + img.height + ';';

  //h+='background-image:url(browse/' + pixar[ref] + ');';

  //h+='background-repeat: no-repeat;';

  //h+='border: 1px solid black;"></div>';



  document.getElementById("pix").innerHTML=h;

}



///////////////////////////////////

var message="Function Disabled!";

function clickIE4(){

  if (event.button==2){

    //alert(message);

    return false;

  }

}



function clickNS4(e){

  if (document.layers||document.getElementById&&!document.all){

    if (e.which==2||e.which==3){

      //alert(message);

      return false;

    }

  }

}



function b3c_configure_no_right_click() {

  if (document.layers){

    document.captureEvents(Event.MOUSEDOWN);

    document.onmousedown=clickNS4;

  } else if (document.all&&!document.getElementById){

    document.onmousedown=clickIE4;

  }

  //document.oncontextmenu=new Function("alert(message);return false")

  document.oncontextmenu=new Function("return false")

}

function toggleDivDisplay(id) {
    var d=document.getElementById(id);
    var s=d.style.display;
    if (s=='none') {
        d.style.display='block';
    } else {
        d.style.display='none';
    }
}

function buildWillinkTable(inar, num){
    var h="<h3>Week " + num + " results</a></h3>";
    h+="<div class=wlweek id=results" + num + "><table>";
    h+="<tr><th>Game</th><th width=120px>Team 1</th><th colspan=3></th><th width=120px>Team 2</th></tr>";

    for (var i=1; i<inar.length; i++) {
        var ss=inar[i].split(',');
        var team1=ss[0].split('=');
        var team2=ss[1].split('=');
        var bgnum=i%2;
        if (team1[1]>team2[1]) {
            var rc1="class=tdb";
            var rc2="";
        } else if (team1[1]<team2[1]) {
            var rc1="";
            var rc2="class=tdb";
        } else {
            var rc1="";
            var rc2="";
        }
        h+="<tr class=bg" + bgnum + "><td class=gn>" + i + "</td><td " + rc1 + " align=right>" + team1[0] + "</td><td class=s>";
        h+=team1[1] + "</td><td class=vs>v</td><td class=s>" + team2[1] + "</td><td " + rc2 + ">" + team2[0] + "</td></tr>";
    }

    h+="</table></div>";
    return(h);
}

function b3c_test_StartPageBuilderHTML(PTitle){

  html='<head><title>BCCC - ' + PTitle + '</title>';

  html+='<link rel="shortcut icon" href=/favicon.ico>';

  html+='<meta http-equiv=pragma content=no-cache>';

  html+='<meta http-equiv=expires content=-1>';

  html+='</head><link rel=stylesheet href=http://www.b3c.org.uk/b3c.css>';

  if (PTitle=="Search Engine") {

    html+="<body onLoad=sf()>";

  }

  html+='<div id=page><div id=header>BCCC - ' + PTitle + '</div>';



  if (location.href.indexOf('www.google.com')>-1) {

    html+='<div id=navbar><div><img src=http://www.b3c.org.uk/search/page_ident.jpg></div>';

  } else {

    html+='<div id=navbar><div><img src=page_ident.jpg ondragstart="return false"></div>';

  }

}



