/* [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','1646',jdecode('Home'),jdecode(''), jdecode('%2F1646.html'), 'true',[],'',''],
	['PAGE','19601',jdecode('The+Club'),jdecode(''), jdecode('%2F19601.html'), 'true',[],'',''],
	['PAGE','89112',jdecode('Fixtures+2012'),jdecode(''), jdecode('%2F89112.html'), 'true',[],'',''],
	['PAGE','38012',jdecode('Teams'),jdecode(''), jdecode('%2F38012.html'), 'false',[],'',''],
	['PAGE','20801',jdecode('Fords+Champagne+moment'),jdecode(''), jdecode('%2F20801.html'), 'false',[],'',''],
	['PAGE','3157',jdecode('Hire+of+Club'),jdecode(''), jdecode('%2F3157.html'), 'true',[],'',''],
	['PAGE','3079',jdecode('Contacts'),jdecode(''), jdecode('%2F3079.html'), 'true',[],'',''],
	['PAGE','126112',jdecode('Dinner+and+Dance+Photos'),jdecode(''), jdecode('%2F126112.html'), 'false',[],'',''],
	['PAGE','96112',jdecode('Membership'),jdecode(''), jdecode('%2F96112.html'), 'true',[],'',''],
	['PAGE','3501',jdecode('1st+Team'),jdecode(''), jdecode('%2F3501.html'), 'false',[],'',''],
	['PAGE','3527',jdecode('2nd+Team'),jdecode(''), jdecode('%2F3527.html'), 'false',[],'',''],
	['PAGE','3553',jdecode('3rd+Team'),jdecode(''), jdecode('%2F3553.html'), 'false',[],'',''],
	['PAGE','3579',jdecode('4th+Team'),jdecode(''), jdecode('%2F3579.html'), 'false',[],'',''],
	['PAGE','3001',jdecode('Ladies'),jdecode(''), jdecode('%2F3001.html'), 'true',[],'',''],
	['PAGE','3605',jdecode('Sundays'),jdecode(''), jdecode('%2F3605.html'), 'false',[],'',''],
	['PAGE','59812',jdecode('Guestbook'),jdecode(''), jdecode('%2F59812.html'), 'false',[],'',''],
	['PAGE','1677',jdecode('Colts'),jdecode(''), jdecode('%2F1677.html'), 'true',[],'',''],
	['PAGE','12201',jdecode('Links'),jdecode(''), jdecode('%2F12201.html'), 'true',[],'',''],
	['PAGE','3131',jdecode('50+Club'),jdecode(''), jdecode('%2F3131.html'), 'true',[],'',''],
	['PAGE','3105',jdecode('Location'),jdecode(''), jdecode('%2F3105.html'), 'true',[],'',''],
	['PAGE','38412',jdecode('Match+Reports'),jdecode(''), jdecode('%2F38412.html'), 'true',[],'',''],
	['PAGE','44112',jdecode('6as'),jdecode(''), jdecode('%2F44112.html'), 'false',[],'',''],
	['PAGE','70612',jdecode('Colt+Reports'),jdecode(''), jdecode('%2F70612.html'), 'false',[],'',''],
	['PAGE','91212',jdecode('Players+Stats'),jdecode(''), jdecode('%2F91212.html'), 'true',[],'',''],
	['PAGE','91238',jdecode('Photos'),jdecode(''), jdecode('%2F91238.html'), 'true',[],'',''],
	['PAGE','93512',jdecode('Ladies+Fixtures'),jdecode(''), jdecode('%2F93512.html'), 'false',[],'',''],
	['PAGE','100012',jdecode('Equipment%2FDiscounts'),jdecode(''), jdecode('%2F100012.html'), 'true',[],'',''],
	['PAGE','107512',jdecode('D%26D'),jdecode(''), jdecode('%2F107512.html'), 'false',[],'',''],
	['PAGE','113312',jdecode('BBQ'),jdecode(''), jdecode('%2F113312.html'), 'false',[],'','']];
var siteelementCount=29;
theSitetree.topTemplateName='Rivet';
theSitetree.paletteFamily='355F35';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='17272';
theSitetree.graphicsetId='12689';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='374534';
var localeDef={
  language: 'en',
  country: 'GB'
};
var prodDef={
  wl_name: 'easily_co_uk_ce',
  product: 'WSCSYSSSSLY0XKQS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Rivet',
				paletteFamily: 	'355F35',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'17272',
				graphicsetId: 	'12689',
				contentColor: 	'FFFFFF',
				contentBGColor: '374534',
				a_color: 		'000000',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89112',
internalId:  '',
customField: '20120124-182922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38412',
internalId:  '',
customField: '20110929-123233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19601',
internalId:  '',
customField: '20100503-215703'
};
webappMappings['7005']=webappMappings['7005-90']={
webappId:    '7005',
documentId:  '20801',
internalId:  '90',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1646',
internalId:  '',
customField: '20120203-200244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1677',
internalId:  '',
customField: '20101012-175620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20801',
internalId:  '',
customField: '20090602-182826'
};
webappMappings['7060']=webappMappings['7060-0223971e6914dd5c6ab5be5a3a844a05']={
webappId:    '7060',
documentId:  '91238',
internalId:  '0223971e6914dd5c6ab5be5a3a844a05',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12201',
internalId:  '',
customField: '20090625-215156'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38012',
internalId:  '',
customField: '20110831-223147'
};
webappMappings['7002']=webappMappings['7002-2573']={
webappId:    '7002',
documentId:  '59812',
internalId:  '2573',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3501',
internalId:  '',
customField: '20090205-123919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3527',
internalId:  '',
customField: '20090205-124318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3001',
internalId:  '',
customField: '20111031-161731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3553',
internalId:  '',
customField: '20090205-124557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3579',
internalId:  '',
customField: '20090205-124927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3605',
internalId:  '',
customField: '20081020-123711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3157',
internalId:  '',
customField: '20110421-222658'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3079',
internalId:  '',
customField: '20110330-185004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3131',
internalId:  '',
customField: '20120117-164021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3105',
internalId:  '',
customField: '20081017-183907'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1646',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44112',
internalId:  '',
customField: '20090604-203238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59812',
internalId:  '',
customField: '20090902-122731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70612',
internalId:  '',
customField: '20100427-121217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91238',
internalId:  '',
customField: '20110929-123135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91212',
internalId:  '',
customField: '20110608-123353'
};
webappMappings['1501']=webappMappings['1501-7623732']={
webappId:    '1501',
documentId:  '1646',
internalId:  '7623732',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93512',
internalId:  '',
customField: '20110201-122114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96112',
internalId:  '',
customField: '20111031-161804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100012',
internalId:  '',
customField: '20110403-204855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107512',
internalId:  '',
customField: '20110518-122634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '113312',
internalId:  '',
customField: '20110608-160705'
};
webappMappings['7060']=webappMappings['7060-b3164a7f347e0b76cd8d42fa679ee993']={
webappId:    '7060',
documentId:  '126112',
internalId:  'b3164a7f347e0b76cd8d42fa679ee993',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '126112',
internalId:  '',
customField: '20110913-125246'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INEAFH';
var companyName   = 'Welcome+to+Aldershot+Cricket+Club+';
var htmlTitle	  = 'Aldershot+Cricket+Club';
var metaKeywords  = 'Aldershot+CricketClub+Hampshire%0D%0AFunction+Hire+Aldershot';
var metaContents  = 'One+of+Hampshires+finest+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();
};

