/* [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','24579',jdecode('Home'),jdecode(''), jdecode('%2F24579.html'), 'true',[],'',''],
	['PAGE','55101',jdecode('Charity'),jdecode(''), jdecode('%2F55101.html'), 'true',[],'',''],
	['PAGE','25201',jdecode('Dog+Training+STEVENAGE'),jdecode(''), jdecode('%2F25201.html'), 'true',[],'',''],
	['PAGE','69801',jdecode('Pet+Training+Homework'),jdecode(''), jdecode('%2F69801.html'), 'true',[],'',''],
	['PAGE','70001',jdecode('Dog+Law'),jdecode(''), jdecode('%2F70001.html'), 'true',[],'',''],
	['PAGE','70201',jdecode('Picking+the+right+Trainer'),jdecode(''), jdecode('%2F70201.html'), 'true',[],'',''],
	['PAGE','25222',jdecode('Security+Dog+Training'),jdecode(''), jdecode('%2F25222.html'), 'true',[],'',''],
	['PAGE','76912',jdecode('Security+Clients'),jdecode(''), jdecode('%2F76912.html'), 'true',[],'',''],
	['PAGE','76938',jdecode('SECURITY+OVERSEAS'),jdecode(''), jdecode('%2F76938.html'), 'true',[],'',''],
	['PAGE','76990',jdecode('Detection+Dogs+for+Conservation'),jdecode(''), jdecode('%2F76990.html'), 'true',[],'',''],
	['PAGE','54301',jdecode('Security+FAQ'),jdecode(''), jdecode('%2F54301.html'), 'true',[],'',''],
	['PAGE','77412',jdecode('Instructors+Courses'),jdecode(''), jdecode('%2F77412.html'), 'true',[],'',''],
	['PAGE','25243',jdecode('K9-FX+Film+Dogs'),jdecode(''), jdecode('%2F25243.html'), 'true',[],'',''],
	['PAGE','27022',jdecode('TV+and+Media'),jdecode(''), jdecode('%2F27022.html'), 'true',[],'',''],
	['PAGE','46401',jdecode('Dog+Borstal'),jdecode(''), jdecode('%2F46401.html'), 'true',[],'',''],
	['PAGE','44901',jdecode('Listen+Live+On+BBC+Radio'),jdecode(''), jdecode('%2F44901.html'), 'true',[],'',''],
	['PAGE','41201',jdecode('Latest+News+and+Diary'),jdecode(''), jdecode('%2F41201.html'), 'true',[],'',''],
	['PAGE','60701',jdecode('Working+Trials'),jdecode(''), jdecode('%2F60701.html'), 'true',[],'',''],
	['PAGE','35501',jdecode('My+Photos'),jdecode(''), jdecode('%2F35501.html'), 'true',[],'',''],
	['PAGE','41527',jdecode('Guestbook'),jdecode(''), jdecode('%2F41527.html'), 'true',[],'',''],
	['PAGE','44001',jdecode('Courses'),jdecode(''), jdecode('%2F44001.html'), 'true',[],'',''],
	['PAGE','24674',jdecode('Contact'),jdecode(''), jdecode('%2F24674.html'), 'true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Angkor';
theSitetree.paletteFamily='A8A7A9';
theSitetree.keyvisualId='6899';
theSitetree.keyvisualName='kv_6899.jpg';
theSitetree.fontsetId='11212';
theSitetree.graphicsetId='12032';
theSitetree.contentColor='4E4E4E';
theSitetree.contentBGColor='B6B5B7';
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: 			'Angkor',
				paletteFamily: 	'A8A7A9',
				keyvisualId: 	'6899',
				keyvisualName: 	'kv_6899.jpg',
				fontsetId: 		'11212',
				graphicsetId: 	'12032',
				contentColor: 	'4E4E4E',
				contentBGColor: 'B6B5B7',
				a_color: 		'B6B5B7',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24674',
internalId:  '',
customField: '20110301-165108'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '24579',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-4404173']={
webappId:    '1501',
documentId:  '24579',
internalId:  '4404173',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25201',
internalId:  '',
customField: '20110301-165342'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25222',
internalId:  '',
customField: '20110321-153448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25243',
internalId:  '',
customField: '20100923-101024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24579',
internalId:  '',
customField: '20101130-160242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27022',
internalId:  '',
customField: '20110222-193715'
};
webappMappings['7050']=webappMappings['7050-63']={
webappId:    '7050',
documentId:  '41201',
internalId:  '63',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35501',
internalId:  '',
customField: '20080423-140447'
};
webappMappings['7008']=webappMappings['7008-131']={
webappId:    '7008',
documentId:  '24674',
internalId:  '131',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46401',
internalId:  '',
customField: '20090109-103927'
};
webappMappings['7060']=webappMappings['7060-d5d8a2e7e7c20ff74e02b91b1dc9ce07']={
webappId:    '7060',
documentId:  '35501',
internalId:  'd5d8a2e7e7c20ff74e02b91b1dc9ce07',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41201',
internalId:  '',
customField: '20080830-162723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44901',
internalId:  '',
customField: '20090818-135324'
};
webappMappings['7002']=webappMappings['7002-889']={
webappId:    '7002',
documentId:  '41527',
internalId:  '889',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76990',
internalId:  '',
customField: '20110321-155545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54301',
internalId:  '',
customField: '20110216-093131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41527',
internalId:  '',
customField: '20080830-162634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44001',
internalId:  '',
customField: '20110125-124000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55101',
internalId:  '',
customField: '20101218-171229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60701',
internalId:  '',
customField: '20091215-114525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77412',
internalId:  '',
customField: '20110321-160258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69801',
internalId:  '',
customField: '20110308-220503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70001',
internalId:  '',
customField: '20100923-122042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70201',
internalId:  '',
customField: '20100923-122215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76938',
internalId:  '',
customField: '20110321-172424'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76912',
internalId:  '',
customField: '20110321-154500'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN27EN';
var companyName   = 'Mic+Martin+Dog+Training';
var htmlTitle	  = 'MIC+MARTIN+DOG+TRAINING';
var metaKeywords  = 'Security+Dog+Training+Pet+Dog+Training+Dog+Borstal+Film+Dogs+Mic+Martin+Dog+Obedience+Dog+Bites+BBC+K9behaviour+Mick+martin+Courses+dog+training';
var metaContents  = 'Security+Dog+Training+Pet+Dog+Training+Dog+Borstal+Film+Dogs';
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();
};

