/* [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','58801',jdecode('Home'),jdecode(''), jdecode('%2F58801.html'), 'true',[],'',''],
	['PAGE','7001',jdecode('About+SADSA'),jdecode(''), jdecode('%2F7001%2Findex.html'), 'true',[ 
		['PAGE','55243',jdecode('Constitution'),jdecode(''), jdecode('%2F7001%2F55243.html'), 'true',[],'','']
	],'',''],
	['PAGE','55264',jdecode('By+Laws'),jdecode(''), jdecode('%2F55264%2Findex.html'), 'true',[ 
		['PAGE','7052',jdecode('Animal+Welfare'),jdecode(''), jdecode('%2F55264%2F7052.html'), 'true',[],'',''],
		['PAGE','62001',jdecode('Health+%26+Safety+Code'),jdecode(''), jdecode('%2F55264%2F62001.html'), 'true',[],'',''],
		['PAGE','62022',jdecode('Anti-Doping+Code'),jdecode(''), jdecode('%2F55264%2F62022.html'), 'true',[],'',''],
		['PAGE','62043',jdecode('Musher+Code'),jdecode(''), jdecode('%2F55264%2F62043.html'), 'true',[],'','']
	],'',''],
	['PAGE','59501',jdecode('SADSA+Events'),jdecode(''), jdecode('%2F59501%2Findex.html'), 'true',[ 
		['PAGE','59522',jdecode('Veterinary+Reports'),jdecode(''), jdecode('%2F59501%2F59522.html'), 'true',[],'',''],
		['PAGE','59543',jdecode('SAWDA+Report'),jdecode(''), jdecode('%2F59501%2F59543.html'), 'true',[],'',''],
		['PAGE','59564',jdecode('Results'),jdecode(''), jdecode('%2F59501%2F59564.html'), 'true',[],'',''],
		['PAGE','59585',jdecode('Experiences+%26+Photos'),jdecode(''), jdecode('%2F59501%2F59585.html'), 'true',[],'','']
	],'',''],
	['PAGE','55701',jdecode('Event+Sanctioning'),jdecode(''), jdecode('%2F55701%2Findex.html'), 'true',[ 
		['PAGE','55722',jdecode('Event+Rules+%26+Regulations'),jdecode(''), jdecode('%2F55701%2F55722.html'), 'true',[],'',''],
		['PAGE','55764',jdecode('Veterinary+Guidelines'),jdecode(''), jdecode('%2F55701%2F55764.html'), 'true',[],'','']
	],'',''],
	['PAGE','55806',jdecode('Affiliations'),jdecode(''), jdecode('%2F55806.html'), 'true',[],'',''],
	['PAGE','77801',jdecode('Links'),jdecode(''), jdecode('%2F77801.html'), 'true',[],'',''],
	['PAGE','56222',jdecode('Contact+Us'),jdecode(''), jdecode('%2F56222.html'), 'true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Applicant';
theSitetree.paletteFamily='7890D7';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='26568';
theSitetree.graphicsetId='13383';
theSitetree.contentColor='21346c';
theSitetree.contentBGColor='becefd';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hetzner',
  product: 'WSCSYSSSSLY0XKDS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Applicant',
				paletteFamily: 	'7890D7',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'26568',
				graphicsetId: 	'13383',
				contentColor: 	'21346c',
				contentBGColor: 'becefd',
				a_color: 		'7890D7',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20100929-111520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7052',
internalId:  '',
customField: '20100921-135009'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '58801',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '58801',
internalId:  '1501',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55243',
internalId:  '',
customField: '20110218-114822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55264',
internalId:  '',
customField: '20100921-134924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55701',
internalId:  '',
customField: '20100921-141213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55722',
internalId:  '',
customField: '20110111-211250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55764',
internalId:  '',
customField: '20110107-102020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55806',
internalId:  '',
customField: '20110107-102231'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77801',
internalId:  '',
customField: '20100929-153953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56222',
internalId:  '',
customField: '20100921-142243'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58801',
internalId:  '',
customField: '20110218-114320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59501',
internalId:  '',
customField: '20100922-213456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59522',
internalId:  '',
customField: '20100921-140809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59543',
internalId:  '',
customField: '20100921-140857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59564',
internalId:  '',
customField: '20100921-140953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59585',
internalId:  '',
customField: '20100922-213617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62001',
internalId:  '',
customField: '20100921-135056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62022',
internalId:  '',
customField: '20100921-135217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62043',
internalId:  '',
customField: '20100921-135311'
};
webappMappings['1501']=webappMappings['1501-10705571']={
webappId:    '1501',
documentId:  '58801',
internalId:  '10705571',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-3880']={
webappId:    '7008',
documentId:  '56222',
internalId:  '3880',
customField: 'language:en;country:US;'
};
var webAppHostname = 'sitebuilder.host-h.net:80';
var canonHostname = 'sitebuilder1.jnb2.host-h.net';
var accountId     = 'AHTZ10IN2QS2';
var companyName   = 'South+African+Dryland+Sledding+Association';
var htmlTitle	  = 'SADSA';
var metaKeywords  = 'Sledding%2C+dog+sledding%2C+dogs%2C+dryland%2C+dryland+sledding%2C+exercise%2C+running%2C+canicross%2C+caniwalk%2C+bikejoring%2C+scooter%2C+cart%2C+rig%2C+gig%2C+sled%2C+Alaskan%2C+Siberian%2C+crossbred%2C+purebred%2C+KUSA%2C+AKC%2C+Alaska%2C+USA%2C+RSA%2C+South+African%2C+South+African+Dryland+Sledding+Association%2C+Association%2C+national%2C+urban+mushing%2C+musher%2C+mushing%2C+gangline%2C+tugline%2C+neckline%2C+harness%2C+coat%2C+stretching%2C+warm+up%2C+cool+down%2C+international+affiliations%2C+Sleddog+Central%2C+Mush+with+P.R.I.D.E.%2C+ISDRA%2C+IFSS%2C+ESDRA%2C+Alaskan+Dog+Mushers+Association%2C+Iditarod%2C+Alpirod%2C+Yukon+Quest%2C+junior%2C+senior%2C+veteran%2C+child%2C+puppies%2C+ages+';
var metaContents  = 'The+way+forward+for+Dryland+Sledding+in+South+Africa...for+all+%22thinking%22+clubs';
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();
};

