/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','4701',jdecode('Dog+Boarding'),jdecode(''),'/4701.html','true',[],'',''],
	['PAGE','4722',jdecode('Cat+Boarding'),jdecode(''),'/4722.html','true',[],'',''],
	['PAGE','4743',jdecode('Fees'),jdecode(''),'/4743.html','true',[],'',''],
	['PAGE','4764',jdecode('Grooming'),jdecode(''),'/4764.html','true',[],'',''],
	['PAGE','4785',jdecode('Dog+Training+'),jdecode(''),'/4785.html','true',[],'',''],
	['PAGE','87326',jdecode('Training+Term+Dates'),jdecode(''),'/87326.html','true',[],'',''],
	['PAGE','37001',jdecode('Residential+Training'),jdecode(''),'/37001.html','true',[],'',''],
	['PAGE','4806',jdecode('Rescue+Centre'),jdecode(''),'/4806.html','true',[],'',''],
	['PAGE','13301',jdecode('Dogs+for+re-homing'),jdecode(''),'/13301.html','true',[],'',''],
	['PAGE','13322',jdecode('Success+Stories'),jdecode(''),'/13322.html','true',[],'',''],
	['PAGE','12401',jdecode('Meet+The+Team'),jdecode(''),'/12401.html','true',[],'',''],
	['PAGE','4827',jdecode('Contact+Us'),jdecode(''),'/4827.html','true',[],'',''],
	['PAGE','75226',jdecode('Links'),jdecode(''),'/75226.html','true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Linedup';
theSitetree.paletteFamily='4270B8';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10359';
theSitetree.graphicsetId='10505';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='4270B8';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Linedup',
				paletteFamily: 	'4270B8',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10359',
				graphicsetId: 	'10505',
				contentColor: 	'FFFFFF',
				contentBGColor: '4270B8',
				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:  '401',
internalId:  '',
customField: '20100413-195633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20081217-112554'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4785',
internalId:  '',
customField: '20100716-082041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4722',
internalId:  '',
customField: '20080318-154234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4743',
internalId:  '',
customField: '20091231-115226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4764',
internalId:  '',
customField: '20080117-170040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4806',
internalId:  '',
customField: '20081029-102557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4827',
internalId:  '',
customField: '20100316-115624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12401',
internalId:  '',
customField: '20091204-115642'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13322',
internalId:  '',
customField: '20100306-120904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13301',
internalId:  '',
customField: '20100727-125241'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37001',
internalId:  '',
customField: '20090605-144018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87326',
internalId:  '',
customField: '20100615-122249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75226',
internalId:  '',
customField: '20100427-114447'
};
webappMappings['1501']=webappMappings['1501-10850210']={
webappId:    '1501',
documentId:  '401',
internalId:  '10850210',
customField: '1501'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN2RAH';
var companyName   = 'Old+Clayton+Kennels+%26+Cattery';
var htmlTitle	  = 'Old+Clayton+Kennels+and+Cattery';
var metaKeywords  = 'Boarding%2C+Kennels%2C+Cattery%2C+dog%2C+dogs%2C+cat%2C+cats%2C+animals%2C+canine%2C+training%2C+obedience%2C+classes%2C+dog+behaviour%2C+dog+behaviourist%2C+residential%2C+grooming%2C+pets%2C+groomers%2C+qualified%2C+rescue%2C+West+Sussex%2C+RH20+4AG%2C+Storrington%2C+A24%2C+kennel%2C+old+clayton%2C++professional%2C+Washington%2C+care%2C+caring';
var metaContents  = 'Old+Clayton+Kennels+and+Cattery+has+been+established+in+Washington+West+Sussex+for+more+than+thirty+years.++We+offer+a+professional%2C+caring+boarding+service+for+dogs%2C+cats+and+small+animals.++Alongside+this+we+have+an+on+site+dog+training+centre+with+a+fully+qualified+and+experienced+obedience+intructor+and+behaviourist%2C+a+dog+grooming+parlour%2C+an+animal+rescue+centre+and+fully+stocked+pet+food+and+accessory+shop.+';
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();
};
