/* [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 theSitetree=[ 
	['PAGE','1001',jdecode('Home'),jdecode(''),'/1001.html','true',[],''],
	['PAGE','15001',jdecode('About+us'),jdecode(''),'/15001.html','true',[],''],
	['PAGE','15127',jdecode('Dental+implants'),jdecode(''),'/15127.html','true',[],''],
	['PAGE','15085',jdecode('Assessment'),jdecode(''),'/15085.html','true',[],''],
	['PAGE','15022',jdecode('Implant+treatment'),jdecode(''),'/15022.html','true',[],''],
	['PAGE','15043',jdecode('Single+implants'),jdecode(''),'/15043.html','true',[],''],
	['PAGE','15064',jdecode('Multiple+implants'),jdecode(''),'/15064.html','true',[],''],
	['PAGE','15148',jdecode('Fees+and+finance'),jdecode(''),'/15148.html','true',[],''],
	['PAGE','15106',jdecode('Further+information'),jdecode(''),'/15106.html','true',[],''],
	['PAGE','15169',jdecode('Contact+us'),jdecode(''),'/15169.html','true',[],'']];
var siteelementCount=10;
theSitetree.topTemplateName='Measure';
theSitetree.paletteFamily='8A9FD6';
theSitetree.keyvisualId='3869';
theSitetree.keyvisualName='kv_3869.jpg';
theSitetree.fontsetId='10492';
theSitetree.graphicsetId='11068';
theSitetree.contentColor='29407C';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				name: 			'Measure',
				paletteFamily: 	'8A9FD6',
				keyvisualId: 	'3869',
				keyvisualName: 	'kv_3869.jpg',
				fontsetId: 		'10492',
				graphicsetId: 	'11068',
				contentColor: 	'29407C',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'4F65A0',
				e_color: 		'4F65A0',
				f_color: 		'4F65A0',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-568']={
webappId:    '7008',
documentId:  '15169',
internalId:  '568',
customField: 'language:en;country:GB;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1001',
internalId:  '',
customField: '20100121-110735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15148',
internalId:  '',
customField: '20100121-110508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15169',
internalId:  '',
customField: '20100121-110552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15001',
internalId:  '',
customField: '20100121-170942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15127',
internalId:  '',
customField: '20090922-004227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15085',
internalId:  '',
customField: '20100121-110310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15022',
internalId:  '',
customField: '20100121-110343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15043',
internalId:  '',
customField: '20100121-110410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15064',
internalId:  '',
customField: '20100121-110440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15106',
internalId:  '',
customField: '20100121-110529'
};
webappMappings['1501']=webappMappings['1501-8146390']={
webappId:    '1501',
documentId:  '1001',
internalId:  '8146390',
customField: '1501'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10INXST3';
var companyName   = 'Dental+Implants+at+Church+Road+Dental+Practice+Manchester';
var htmlTitle	  = 'Dental+implants+at+Church+Road+Dental+Practice+Manchester';
var metaKeywords  = 'dental+implants+Manchester%2C+dental+implant+Manchester%2C+missing+teeth%2C+loose+dentures%2C+dentist%2C+dentists%2C+in%2C+Manchester%2C+Cheshire%2C%2C+Altrincham%2C+Stockport%2C+sedation%2C+cosmetic+dentistry%2C+bridges%2C+veneers%2C+crowns.';
var metaContents  = 'Church+Road+Dental+Practice+is+situated+in+South+Manchester.+It+provides+a+wide+range+of+treatments+including+general+dentistry%2C+cosmetic+dentistry+and+sedation.+This+additional+website+provides+information+about+our+dental+implant+service.';
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();
};
