/* [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','9901',jdecode('Home'),jdecode(''),'/9901.html','true',[],'',''],
	['PAGE','19101',jdecode('About+Us'),jdecode(''),'/19101.html','true',[],'',''],
	['PAGE','59523',jdecode('Important+Notices'),jdecode(''),'/59523.html','true',[],'',''],
	['PAGE','32412',jdecode('What+is+Flyball'),jdecode(''),'/32412.html','true',[],'',''],
	['PAGE','19127',jdecode('The+Teams'),jdecode(''),'/19127.html','true',[],'',''],
	['PAGE','19153',jdecode('Starter+Dogs'),jdecode(''),'/19153.html','true',[],'',''],
	['PAGE','68023',jdecode('Diary+Dates+%26+Tournaments'),jdecode(''),'/68023/index.html','true',[ 
		['PAGE','59549',jdecode('Diary+Dates+2011'),jdecode(''),'/68023/59549.html','true',[],'',''],
		['PAGE','42812',jdecode('Diary+Dates+2010'),jdecode(''),'/68023/42812.html','true',[],'',''],
		['PAGE','28312',jdecode('Diary+Dates+2009'),jdecode(''),'/68023/28312.html','true',[],'',''],
		['PAGE','57023',jdecode('Ibstock+Tournament'),jdecode(''),'/68023/57023.html','true',[],'','']
	],'',''],
	['PAGE','35212',jdecode('Training'),jdecode(''),'/35212.html','true',[],'',''],
	['PAGE','40012',jdecode('For+Sale'),jdecode(''),'/40012.html','true',[],'',''],
	['PAGE','32912',jdecode('News'),jdecode(''),'/32912.html','true',[],'',''],
	['PAGE','67723',jdecode('Pictures'),jdecode(''),'/67723.html','true',[],'',''],
	['PAGE','25701',jdecode('Videos'),jdecode(''),'/25701.html','true',[],'',''],
	['PAGE','60623',jdecode('Comments'),jdecode(''),'/60623.html','true',[],'',''],
	['PAGE','19205',jdecode('links'),jdecode(''),'/19205.html','true',[],'',''],
	['PAGE','19231',jdecode('contact'),jdecode(''),'/19231.html','true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Round';
theSitetree.paletteFamily='669999';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='439';
theSitetree.graphicsetId='497';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='a1c6c6';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Round',
				paletteFamily: 	'669999',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'439',
				graphicsetId: 	'497',
				contentColor: 	'FFFFFF',
				contentBGColor: 'a1c6c6',
				a_color: 		'a1c6c6',
				b_color: 		'669999',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9901',
internalId:  '',
customField: '20110907-212555'
};
webappMappings['7008']=webappMappings['7008-3444']={
webappId:    '7008',
documentId:  '19231',
internalId:  '3444',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19101',
internalId:  '',
customField: '20110912-171750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19127',
internalId:  '',
customField: '20110912-173850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19153',
internalId:  '',
customField: '20110912-172638'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68023',
internalId:  '',
customField: '20110227-181340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19205',
internalId:  '',
customField: '20091027-114203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19231',
internalId:  '',
customField: '20090103-213132'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '9901',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-8489677']={
webappId:    '1501',
documentId:  '9901',
internalId:  '8489677',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25701',
internalId:  '',
customField: '20100317-230217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32912',
internalId:  '',
customField: '20110912-173408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32412',
internalId:  '',
customField: '20110907-222835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28312',
internalId:  '',
customField: '20091101-193553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57023',
internalId:  '',
customField: '20110227-192119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35212',
internalId:  '',
customField: '20110608-180755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40012',
internalId:  '',
customField: '20110227-184608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42812',
internalId:  '',
customField: '20110227-181916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59523',
internalId:  '',
customField: '20110305-175934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59549',
internalId:  '',
customField: '20110404-205420'
};
webappMappings['1002']=webappMappings['1002-60623anbt20inertd']={
webappId:    '1002',
documentId:  '60623',
internalId:  '60623anbt20inertd',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60623',
internalId:  '',
customField: '20110219-122851'
};
webappMappings['7060']=webappMappings['7060-4ab3e49d4e6ea9dbc930c252d314c3e9']={
webappId:    '7060',
documentId:  '67723',
internalId:  '4ab3e49d4e6ea9dbc930c252d314c3e9',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67723',
internalId:  '',
customField: '20110227-173901'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INERTD';
var companyName   = 'Hinckley+Hooligans+Flyball+Teams';
var htmlTitle	  = '';
var metaKeywords  = 'flyball+hinckley+hooligans+leicestershire';
var metaContents  = 'flyball+hinckley+leicestershire';
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();
};

