/* [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','1901',jdecode('Home'),jdecode(''),'/1901.html','true',[],'',''],
	['PAGE','1952',jdecode('About+Bill+Lomas'),jdecode(''),'/1952/index.html','true',[ 
		['PAGE','28101',jdecode('Bill+at+Jethro%26%23x27%3Bs'),jdecode(''),'/1952/28101.html','true',[],'',''],
		['PAGE','29301',jdecode('Client+feedback'),jdecode(''),'/1952/29301.html','true',[],'','']
	],'',''],
	['PAGE','1978',jdecode('Equine+Dentistry'),jdecode(''),'/1978/index.html','true',[ 
		['PAGE','5201',jdecode('Routine+care'),jdecode(''),'/1978/5201.html','true',[],'',''],
		['PAGE','2004',jdecode('FAQs'),jdecode(''),'/1978/2004.html','true',[],'',''],
		['PAGE','2201',jdecode('Terminology'),jdecode(''),'/1978/2201.html','true',[],'','']
	],'',''],
	['PAGE','2227',jdecode('Case+Studies'),jdecode(''),'/2227/index.html','true',[ 
		['PAGE','2253',jdecode('Polly%26%23x27%3Bs+story'),jdecode(''),'/2227/2253.html','true',[],'',''],
		['PAGE','19101',jdecode('Jazz%26%23x27%3Bs+story'),jdecode(''),'/2227/19101.html','true',[],'',''],
		['PAGE','22101',jdecode('Skooter%26%23x27%3Bs+story'),jdecode(''),'/2227/22101.html','true',[],'',''],
		['PAGE','25501',jdecode('Woody%26%23x27%3Bs+story'),jdecode(''),'/2227/25501.html','true',[],'','']
	],'',''],
	['PAGE','2279',jdecode('Contact+Bill'),jdecode(''),'/2279.html','true',[],'',''],
	['PAGE','15801',jdecode('Links'),jdecode(''),'/15801.html','true',[],'',''],
	['PAGE','8201',jdecode('Guestbook'),jdecode(''),'/8201.html','true',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Nuance';
theSitetree.paletteFamily='CDC1AA';
theSitetree.keyvisualId='8952';
theSitetree.keyvisualName='kv_8952.jpg';
theSitetree.fontsetId='17240';
theSitetree.graphicsetId='12676';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='CDC1AA';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Nuance',
				paletteFamily: 	'CDC1AA',
				keyvisualId: 	'8952',
				keyvisualName: 	'kv_8952.jpg',
				fontsetId: 		'17240',
				graphicsetId: 	'12676',
				contentColor: 	'000000',
				contentBGColor: 'CDC1AA',
				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:  '1901',
internalId:  '',
customField: '20100404-122956'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1952',
internalId:  '',
customField: '20100403-193457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1978',
internalId:  '',
customField: '20100403-193517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20100403-193535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2004',
internalId:  '',
customField: '20100403-193552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20100403-193608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2227',
internalId:  '',
customField: '20100620-122947'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2253',
internalId:  '',
customField: '20100403-193656'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2279',
internalId:  '',
customField: '20100403-193828'
};
webappMappings['7002']=webappMappings['7002-3552']={
webappId:    '7002',
documentId:  '8201',
internalId:  '3552',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8201',
internalId:  '',
customField: '20100403-193858'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15801',
internalId:  '',
customField: '20101205-135138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19101',
internalId:  '',
customField: '20100418-121449'
};
webappMappings['1501']=webappMappings['1501-11413856']={
webappId:    '1501',
documentId:  '1901',
internalId:  '11413856',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22101',
internalId:  '',
customField: '20100517-105527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25501',
internalId:  '',
customField: '20100621-164142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28101',
internalId:  '',
customField: '20101205-140032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29301',
internalId:  '',
customField: '20101205-140931'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT30IN3OYD';
var companyName   = 'Bill+Lomas+-+Equine+Dental+Technician';
var htmlTitle	  = 'Bill+Lomas+Equine+Dental+Technician';
var metaKeywords  = 'equine+dentist+dental+technician+horse+bill+lomas+devon';
var metaContents  = 'Bill+Lomas+equine+dental+technician';
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();
};

