/* [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','301',jdecode('Home'),jdecode(''),'/301.html','true',[],'',''],
	['PAGE','37601',jdecode('About+Us'),jdecode(''),'/37601.html','true',[],'',''],
	['PAGE','4701',jdecode('Conveyancing'),jdecode(''),'/4701/index.html','true',[ 
		['PAGE','7001',jdecode('Glossary'),jdecode(''),'/4701/7001.html','true',[],'',''],
		['PAGE','32301',jdecode('Instruct+Us'),jdecode(''),'/4701/32301.html','true',[],'',''],
		['PAGE','32901',jdecode('Pricing'),jdecode(''),'/4701/32901.html','false',[],'',''],
		['PAGE','38801',jdecode('Free+Advice'),jdecode(''),'/4701/38801.html','true',[],'','']
	],'',''],
	['PAGE','35501',jdecode('Wills+%26+Probate'),jdecode(''),'/35501.html','true',[],'',''],
	['PAGE','4743',jdecode('Links'),jdecode(''),'/4743/index.html','false',[ 
		['PAGE','5448',jdecode('Legal+News'),jdecode(''),'/4743/5448.html','false',[],'',''],
		['PAGE','5469',jdecode('Property+News'),jdecode(''),'/4743/5469.html','true',[],'',''],
		['PAGE','5427',jdecode('Estate+Agents'),jdecode(''),'/4743/5427.html','true',[],'','']
	],'',''],
	['PAGE','4764',jdecode('Contact'),jdecode(''),'/4764/index.html','true',[ 
		['PAGE','36301',jdecode('Our+Location'),jdecode(''),'/4764/36301.html','true',[],'','']
	],'',''],
	['PAGE','4869',jdecode('Legal+Info'),jdecode(''),'/4869/index.html','true',[ 
		['PAGE','13001',jdecode('Company+Info'),jdecode(''),'/4869/13001.html','true',[],'',''],
		['PAGE','30201',jdecode('Privacy+Policy'),jdecode(''),'/4869/30201.html','true',[],'',''],
		['PAGE','13043',jdecode('Terms+%26+Condtions'),jdecode(''),'/4869/13043.html','true',[],'','']
	],'',''],
	['PAGE','38501',jdecode('Blog'),jdecode(''),'/38501.html','false',[],'',''],
	['PAGE','39712',jdecode('Testimonials'),jdecode(''),'/39712.html','false',[],'',''],
	['PAGE','41212',jdecode('Recruitment'),jdecode(''),'/41212.html','false',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Palette';
theSitetree.paletteFamily='59BCE9';
theSitetree.keyvisualId='9349';
theSitetree.keyvisualName='kv_9349.jpg';
theSitetree.fontsetId='17416';
theSitetree.graphicsetId='12797';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Palette',
				paletteFamily: 	'59BCE9',
				keyvisualId: 	'9349',
				keyvisualName: 	'kv_9349.jpg',
				fontsetId: 		'17416',
				graphicsetId: 	'12797',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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:  '301',
internalId:  '',
customField: '20090225-082323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4869',
internalId:  '',
customField: '20080621-170124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20090225-083346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4743',
internalId:  '',
customField: '20090125-101412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5427',
internalId:  '',
customField: '20080621-165741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5448',
internalId:  '',
customField: '20080303-154838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30201',
internalId:  '',
customField: '20080621-170149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4764',
internalId:  '',
customField: '20090305-105003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13043',
internalId:  '',
customField: '20080621-170217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37601',
internalId:  '',
customField: '20090205-174306'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '36301',
internalId:  'location',
customField: 'language:en;country:GB;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35501',
internalId:  '',
customField: '20090205-154931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36301',
internalId:  '',
customField: '20090125-104524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20090122-230636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5469',
internalId:  '',
customField: '20080621-165717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13001',
internalId:  '',
customField: '20080621-170134'
};
webappMappings['7050']=webappMappings['7050-1931']={
webappId:    '7050',
documentId:  '38501',
internalId:  '1931',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32901',
internalId:  '',
customField: '20080621-152038'
};
webappMappings['7008']=webappMappings['7008-1255']={
webappId:    '7008',
documentId:  '32301',
internalId:  '1255',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32301',
internalId:  '',
customField: '20080721-133959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38501',
internalId:  '',
customField: '20090224-122242'
};
webappMappings['7008']=webappMappings['7008-4012']={
webappId:    '7008',
documentId:  '38801',
internalId:  '4012',
customField: 'language:en;country:GB;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38801',
internalId:  '',
customField: '20090224-220510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39712',
internalId:  '',
customField: '20090228-100526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41212',
internalId:  '',
customField: '20100222-133833'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN2OPK';
var companyName   = 'Conveyancing+-+Wills+-+Probate+-+Home+Information+Packs';
var htmlTitle	  = 'Savilles+Solicitors+-+Conveyancing++HIP+Specialists';
var metaKeywords  = 'property+solicitor+conveyancing%2Chouse+conveyancing%2Cconveyancing+uk%2Cconveyancing+lawyer%2Cproperty+conveyancing+uk%2Cconveyancing+solicitor+uk%2Cconveyancing+fees%2Cconveyancing+services+uk%2Cconveyancing+cheshire%2Cconveyancing+solicitor+quotes%2Cuk+conveyancing+solicitor%2Cmoving+advice%2Cremortgaging+your+home%2Cremortgaging+advice+service%2Cremortgaging+advice%2Cremortgages+in+cheshire%2Cadvice+on+remortgaging%2Cmoving+house+advice%2Cproperty+home+information+packs%2Chome+owner+information+pack%2Chip+home+information+pack+uk%2Chome+buyer+information+pack%2Chome+information+pack+uk%2Chome+information+pack+solicitor%2Chome+information+pack+inspectors%2C+www.savilles-solicitors.co.uk%2C+solicitors+cheadle%2C+convevyancing+cheadle%2C+solicitors+stockport%2C+solicitors+cheshire';
var metaContents  = 'Home+Information+Pack+suppliers+providing+conveyancing+services+by+solicitors+with+over+20+years+experience.+Fixed+fees+for+conveyancing.+Probate+and+Will+drafting+services+also+available.++We+provide+conveyancing+services+for++clients+nationwide.';
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();
};
