/* [nodename, id, name, navigationtext, href, isnavigation, childs[], templatename] */

if (typeof(decodeURIComponent) == 'undefined') {
  decodeURIComponent = function(s) {
    return unescape(s);
  }
}

function jdecode(s) {
    s = s.replace(/\+/g, "%20")
    return decodeURIComponent(s);
}

var POS_NODENAME=0;
var POS_ID=1;
var POS_NAME=2;
var POS_NAVIGATIONTEXT=3;
var POS_HREF=4;
var POS_ISNAVIGATION=5;
var POS_CHILDS=6;
var POS_TEMPLATENAME=7;
var POS_TARGET=8;
var theSitetree=[ 
	['PAGE','2001',jdecode('HOME'),jdecode(''),'/2001.html','true',[],'',''],
	['PAGE','2052',jdecode('ABOUT+US'),jdecode(''),'/2052.html','true',[],'',''],
	['PAGE','2136',jdecode('CLUB+NEWSLETTER'),jdecode(''),'/2136.html','true',[],'',''],
	['PAGE','2094',jdecode('CLUB+RIDES'),jdecode(''),'/2094.html','true',[],'',''],
	['PAGE','2178',jdecode('JOIN+THE+CLUB'),jdecode(''),'/2178.html','true',[],'',''],
	['PAGE','63234',jdecode('CALENDAR'),jdecode(''),'/63234.html','true',[],'',''],
	['PAGE','18464',jdecode('RESULTS'),jdecode(''),'/18464.html','true',[],'',''],
	['PAGE','18564',jdecode('GALLERY'),jdecode(''),'/18564.html','true',[],'',''],
	['PAGE','2283',jdecode('BLOG+SPOT'),jdecode(''),'/2283.html','true',[],'',''],
	['ITEM','63834',jdecode('FACE+BOOK'),jdecode(''),'http://www.facebook.com/group.php?gid=342377715713&v=wall&ref=ts','true',[],'','_blank'],
	['ITEM','66338',jdecode('TWITTER'),jdecode(''),'https://twitter.com/bundubashersmtb','true',[],'','_blank'],
	['PAGE','2241',jdecode('INTERESTING+LINKS'),jdecode(''),'/2241.html','true',[],'',''],
	['ITEM','22924',jdecode('WEATHER+SA'),jdecode(''),'http://www.weathersa.co.za/web/Home.asp?ib=1&f=68591&z=Ctry&v=7&g=MeteoT&m=Strm&anim=aStr&av=AvWarn&fav=v0&dam=&graph=temp&uid=&p=&dbug=&h=0&mw=w','true',[],'','_blank'],
	['PAGE','23634',jdecode('CONTACT+US'),jdecode(''),'/23634.html','true',[],'',''],
	['PAGE','73638',jdecode('FEED+BACK+SARDINE+CLASSIC'),jdecode(''),'/73638.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Nucleus';
theSitetree.paletteFamily='5485F3';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='33305';
theSitetree.graphicsetId='14176';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='5485F3';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Nucleus',
				paletteFamily: 	'5485F3',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'33305',
				graphicsetId: 	'14176',
				contentColor: 	'FFFFFF',
				contentBGColor: '5485F3',
				a_color: 		'2F5DC3',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Palatino Linotype, Book Antiqua, Palatino, serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18464',
internalId:  '',
customField: '20100702-152508'
};
webappMappings['7050']=webappMappings['7050-711']={
webappId:    '7050',
documentId:  '2283',
internalId:  '711',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20100728-165518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2283',
internalId:  '',
customField: '20100507-120946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2052',
internalId:  '',
customField: '20100513-074210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2241',
internalId:  '',
customField: '20100729-131423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2178',
internalId:  '',
customField: '20100730-081448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2136',
internalId:  '',
customField: '20100709-122148'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18564',
internalId:  '',
customField: '20100625-151807'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2001',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-d9f466a270aa9482218f39d954367a4b']={
webappId:    '7060',
documentId:  '18564',
internalId:  'd9f466a270aa9482218f39d954367a4b',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2094',
internalId:  '',
customField: '20100520-175641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63234',
internalId:  '',
customField: '20100730-081342'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73638',
internalId:  '',
customField: '20100708-080152'
};
webappMappings['7008']=webappMappings['7008-3593']={
webappId:    '7008',
documentId:  '73638',
internalId:  '3593',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-3353']={
webappId:    '7008',
documentId:  '23634',
internalId:  '3353',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23634',
internalId:  '',
customField: '20100506-170741'
};
var canonHostname = 'sitebuilder1.jnb2.host-h.net';
var accountId     = 'AHTZ10IN2JM4';
var companyName   = 'B+U+N+D+U++++B+A+S+H+E+R+S++++M+O+U+N+T+A+I+N++++B+I+K+E++++C+L+U+B';
var htmlTitle	  = '';
var metaKeywords  = 'Bundu+Bashers+MTB+Club%2C+Margate%2C+South+Coast%2C+Kwazulu+Natal+South+Africa.+Mountain+biking+sport.+Appeals+to+all+ages.';
var metaContents  = 'Bundu+Bashers+Mountain+Bike+Club%2C+Margate%2C+South+Coast%2C+Kwazulu+Natal+South+Africa.++Situated+on+the+beautiful+Hibiscus+coast.Bundu+Bashers+Mountain+Bike+Club+is+located+on+the+South+Soast+of+Kwazulu-Natal+South+Africa%2C+a+setting+which+is+ideal+for+this+kind+of+sport+-+not+only+for+its+fine+weather+conditions+all+year+round%2C+but+also+for+its+safe+and+relaxed+environment.+Bundu+Bashers+will+appeal+to+all%2C+whether+you%27re+6+or+60%2C+even+to+those+who+enjoy+family+or+team+events.';
theSitetree.getById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		if (ar[i][POS_ID] == id){
			return ar[i];
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getParentById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		for (var j = 0; j < ar[i][POS_CHILDS].length; j++) {
			if (ar[i][POS_CHILDS][j][POS_ID] == id) {
				// child found
				return ar[i];
			}
			var result=this.getParentById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getName = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAME];
	}
	return null;
};

theSitetree.getNavigationText = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAVIGATIONTEXT];
	}
	return null;
};

theSitetree.getHREF = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_HREF];
	}
	return null;
};

theSitetree.getIsNavigation = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_ISNAVIGATION];
	}
	return null;
};

theSitetree.getTemplateName = function(id, lastTemplateName, ar) {
	if (typeof(lastTemplateName) == 'undefined'){
		lastTemplateName = this.topTemplateName;
	}
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		var actTemplateName = ar[i][POS_TEMPLATENAME];
		if (actTemplateName == ''){
			actTemplateName = lastTemplateName;
		}
		if (ar[i][POS_ID] == id) {
			return actTemplateName;
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getTemplateName(id, actTemplateName, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getByXx = function(lookup, xx, ar) {
    if (typeof(ar) == 'undefined'){
    	ar = this;
    }
    for (var i=0; i < ar.length; i++) {
        if (ar[i][xx] == lookup){
        	return ar[i];
        }
        if (ar[i][POS_CHILDS].length > 0) {
        	var result=this.getByXx(lookup, xx, ar[i][POS_CHILDS]);
            if (result != null){
                return result;
               }
        }
    }
    return null;
};

function gotoPage(lookup) {
	if(__path_prefix__ == "/servlet/CMServeRES" && typeof (changePage) == 'function'){
		changePage(lookup);
		return;
	}
	var page = theSitetree.getHREF(lookup);
	if (!page) {
		var testFor = [ POS_NAME, POS_NAVIGATIONTEXT ];
		for (var i=0 ; i < testFor.length ; i++) {
			var p = theSitetree.getByXx(lookup, testFor[i]);
			if (p != null) {
				page = p[POS_HREF];
				break;
			}
		}
	}
	document.location.href = (new URL(__path_prefix__ + page, true, true)).toString();
};
