/* [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','29701',jdecode('HOME'),jdecode(''), jdecode('%2F29701.html'), 'true',[],'',''],
	['PAGE','5052',jdecode('MHCC+News'),jdecode(''), jdecode('%2F5052.html'), 'true',[],'',''],
	['PAGE','17127',jdecode('Match+Reports'),jdecode(''), jdecode('%2F17127.html'), 'true',[],'',''],
	['PAGE','17231',jdecode('Juniors'),jdecode(''), jdecode('%2F17231.html'), 'true',[],'',''],
	['PAGE','6001',jdecode('Player+Profiles'),jdecode(''), jdecode('%2F6001.html'), 'true',[],'',''],
	['PAGE','43816',jdecode('Lookie+Likies'),jdecode(''), jdecode('%2F43816.html'), 'true',[],'',''],
	['PAGE','6627',jdecode('Club+Snaps'),jdecode(''), jdecode('%2F6627.html'), 'true',[],'',''],
	['PAGE','24601',jdecode('Club+Hire'),jdecode(''), jdecode('%2F24601.html'), 'true',[],'',''],
	['PAGE','5156',jdecode('History'),jdecode(''), jdecode('%2F5156.html'), 'true',[],'',''],
	['PAGE','30201',jdecode('Find+Us'),jdecode(''), jdecode('%2F30201.html'), 'true',[],'',''],
	['PAGE','6679',jdecode('Contact'),jdecode(''), jdecode('%2F6679.html'), 'true',[],'',''],
	['PAGE','15101',jdecode('Comments+%26+Suggestions'),jdecode(''), jdecode('%2F15101.html'), 'true',[],'',''],
	['PAGE','16301',jdecode('MHCC+Friends'),jdecode(''), jdecode('%2F16301.html'), 'true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Riga';
theSitetree.paletteFamily='66A251';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='11223';
theSitetree.graphicsetId='12044';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='66A251';
var localeDef={
  language: 'en',
  country: 'GB'
};
var prodDef={
  wl_name: 'easily_co_uk',
  product: 'WSCSYSSSSLY0XVDH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Riga',
				paletteFamily: 	'66A251',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'11223',
				graphicsetId: 	'12044',
				contentColor: 	'FFFFFF',
				contentBGColor: '66A251',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30201',
internalId:  '',
customField: '20080702-115836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5052',
internalId:  '',
customField: '20120127-091321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15101',
internalId:  '',
customField: '20110427-133435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6001',
internalId:  '',
customField: '20110802-131559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5156',
internalId:  '',
customField: '20080702-000316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6627',
internalId:  '',
customField: '20110905-154033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6679',
internalId:  '',
customField: '20110427-133402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16301',
internalId:  '',
customField: '20100902-100629'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17127',
internalId:  '',
customField: '20110905-154247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17231',
internalId:  '',
customField: '20110406-114252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24601',
internalId:  '',
customField: '20080709-210553'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '29701',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-1869']={
webappId:    '7008',
documentId:  '6679',
internalId:  '1869',
customField: 'language:en;country:GB;'
};
webappMappings['1501']=webappMappings['1501-6575746']={
webappId:    '1501',
documentId:  '29701',
internalId:  '6575746',
customField: '1501'
};
webappMappings['1002']=webappMappings['1002-15101anbt20ine1rn']={
webappId:    '1002',
documentId:  '15101',
internalId:  '15101anbt20ine1rn',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29701',
internalId:  '',
customField: '20120112-113404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43816',
internalId:  '',
customField: '20110504-161739'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INE1RN';
var companyName   = 'MEIR+HEATH+CRICKET+CLUB';
var htmlTitle	  = 'MEIR+HEATH+C.C.';
var metaKeywords  = 'cricket+meir+heath+';
var metaContents  = 'cricket+meir+heath+';
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();
};

