/* [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(''), jdecode('%2F401.html'), 'true',[],'',''],
	['PAGE','4701',jdecode('Dog+Boarding'),jdecode(''), jdecode('%2F4701.html'), 'true',[],'',''],
	['PAGE','4722',jdecode('Cat+Boarding'),jdecode(''), jdecode('%2F4722.html'), 'true',[],'',''],
	['PAGE','4743',jdecode('Fees'),jdecode(''), jdecode('%2F4743.html'), 'true',[],'',''],
	['PAGE','4764',jdecode('Grooming'),jdecode(''), jdecode('%2F4764.html'), 'true',[],'',''],
	['PAGE','4785',jdecode('Dog+Training+'),jdecode(''), jdecode('%2F4785.html'), 'true',[],'',''],
	['PAGE','87326',jdecode('Training+Term+Dates'),jdecode(''), jdecode('%2F87326.html'), 'true',[],'',''],
	['PAGE','37001',jdecode('Residential+Training'),jdecode(''), jdecode('%2F37001.html'), 'true',[],'',''],
	['PAGE','4806',jdecode('Rescue+Centre'),jdecode(''), jdecode('%2F4806.html'), 'true',[],'',''],
	['PAGE','13301',jdecode('Dogs+for+re-homing'),jdecode(''), jdecode('%2F13301.html'), 'true',[],'',''],
	['PAGE','13322',jdecode('Success+Stories'),jdecode(''), jdecode('%2F13322.html'), 'true',[],'',''],
	['PAGE','12401',jdecode('Meet+The+Team'),jdecode(''), jdecode('%2F12401.html'), 'true',[],'',''],
	['PAGE','120726',jdecode('Events'),jdecode(''), jdecode('%2F120726.html'), 'true',[],'',''],
	['PAGE','109926',jdecode('Guestbook'),jdecode(''), jdecode('%2F109926.html'), 'true',[],'',''],
	['PAGE','4827',jdecode('Contact+Us'),jdecode(''), jdecode('%2F4827.html'), 'true',[],'',''],
	['PAGE','75226',jdecode('Links'),jdecode(''), jdecode('%2F75226.html'), 'true',[],'',''],
	['PAGE','135726',jdecode('Jobs'),jdecode(''), jdecode('%2F135726.html'), 'true',[],'','']];
var siteelementCount=17;
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 prodDef={
  wl_name: 'easily_co_uk',
  product: 'WSCSYSSSSLY0XVDH'
};
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: '20120204-172957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20101112-162959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4785',
internalId:  '',
customField: '20120131-230154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4722',
internalId:  '',
customField: '20101126-124020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4743',
internalId:  '',
customField: '20110915-104020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4764',
internalId:  '',
customField: '20120113-150000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4806',
internalId:  '',
customField: '20120204-173517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4827',
internalId:  '',
customField: '20101215-082544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12401',
internalId:  '',
customField: '20110408-105032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13322',
internalId:  '',
customField: '20110110-173627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13301',
internalId:  '',
customField: '20120201-163559'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37001',
internalId:  '',
customField: '20120204-173301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '135726',
internalId:  '',
customField: '20120113-150332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '109926',
internalId:  '',
customField: '20101222-102026'
};
webappMappings['1002']=webappMappings['1002-109926anbt10in2rah']={
webappId:    '1002',
documentId:  '109926',
internalId:  '109926anbt10in2rah',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '120726',
internalId:  '',
customField: '20120204-174012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87326',
internalId:  '',
customField: '20111117-094111'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75226',
internalId:  '',
customField: '20111206-154153'
};
webappMappings['1501']=webappMappings['1501-10850210']={
webappId:    '1501',
documentId:  '401',
internalId:  '10850210',
customField: '1501'
};
var webAppHostname = 'cgi.easily.co.uk:80';
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();
};

